1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2018 Linaro Limited
6 #ifndef __OPTEE_PRIVATE_H
7 #define __OPTEE_PRIVATE_H
13 * struct optee_private - OP-TEE driver private data
14 * @rpmb_mmc: mmc device for the RPMB partition
15 * @rpmb_dev_id: mmc device id matching @rpmb_mmc
16 * @rpmb_original_part: the previosly active partition on the mmc device,
17 * used to restore active the partition when the RPMB
18 * accesses are finished
20 struct optee_private {
23 int rpmb_original_part;
28 void optee_suppl_cmd(struct udevice *dev, struct tee_shm *shm_arg,
31 #ifdef CONFIG_SUPPORT_EMMC_RPMB
33 * optee_suppl_cmd_rpmb() - route RPMB frames to mmc
34 * @dev: device with the selected RPMB partition
35 * @arg: OP-TEE message holding the frames to transmit to the mmc
36 * and space for the response frames.
38 * Routes signed (MACed) RPMB frames from OP-TEE Secure OS to MMC and vice
39 * versa to manipulate the RPMB partition.
41 void optee_suppl_cmd_rpmb(struct udevice *dev, struct optee_msg_arg *arg);
44 * optee_suppl_rpmb_release() - release mmc device
47 * Releases the mmc device and restores the previously selected partition.
49 void optee_suppl_rpmb_release(struct udevice *dev);
51 static inline void optee_suppl_cmd_rpmb(struct udevice *dev,
52 struct optee_msg_arg *arg)
54 debug("OPTEE_MSG_RPC_CMD_RPMB not implemented\n");
55 arg->ret = TEE_ERROR_NOT_IMPLEMENTED;
58 static inline void optee_suppl_rpmb_release(struct udevice *dev)
63 void *optee_alloc_and_init_page_list(void *buf, ulong len, u64 *phys_buf_ptr);
65 #endif /* __OPTEE_PRIVATE_H */