drivers: optee: allow op-tee to access devices on the i2c bus
Subsystems (2)
PATCH v3 1/1 drivers: optee: allow op-tee to access devices on the i2c bus
Some secure elements like NXP's SE050 sit on I2C buses. For OP-TEE to control this type of cryptographic devices it needs coordinated access to the bus, so collisions and RUNTIME_PM dont get in the way.
This trampoline driver allow OP-TEE to access them.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>
---
v3: use from/to msg param to support all types of memory
modify OPTEE_MSG_RPC_CMD_I2C_TRANSFER id
drivers/tee/optee/optee_msg.h | 17 ++++++++ drivers/tee/optee/rpc.c | 80 +++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+)
drivers/tee/optee/optee_msg.h +17 -0
@@ -419,4 +419,21 @@ struct optee_msg_arg {*/ #define OPTEE_MSG_RPC_CMD_SHM_FREE 7 +/* +* Access a device on an i2c bus +* +* [in] param[0].u.value.a mode: RD(0), WR(1) +* [in] param[0].u.value.b i2c adapter +* [in] param[0].u.value.c i2c chip +* +* [in/out] memref[1] buffer to exchange the transfer data +* with the secure world +* +* [out] param[0].u.value.a bytes transferred by the driver +*/ +#define OPTEE_MSG_RPC_CMD_I2C_TRANSFER 21 +#define OPTEE_MSG_RPC_CMD_I2C_TRANSFER_RD 0 +#define OPTEE_MSG_RPC_CMD_I2C_TRANSFER_WR 1 + +#endif /* _OPTEE_MSG_H */
drivers/tee/optee/rpc.c +80 -0
98 lines not on this page · raw message
Signature · 1 line
2.17.1