All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/4] OP-TEE I2C trampoline and associated tests
@ 2021-01-12  8:43 Jorge Ramirez-Ortiz
  2021-01-12  8:43 ` [PATCHv3 1/4] drivers: tee: i2c trampoline driver Jorge Ramirez-Ortiz
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Jorge Ramirez-Ortiz @ 2021-01-12  8:43 UTC (permalink / raw)
  To: u-boot

This patchset allows OP-TEE to communicate with I2C devices; a typical
use case would be servicing U-Boot requests that require underlying
cryptographic operations implemented by an I2C chip.

On a board fitted with the NXP SE050 I2C secure element, OP-TEE can
route some of the cryptographic operations it needs to that device (ie
RSA, ECC, CTR..).

Before the REE executes, OP-TEE would use its own I2C drivers to
communicate with the device on the bus; later on, once the REE is up,
accesses to the I2C bus should be coordinated with the REE to avoid
collisions. However instead of implementing such a synchronization
mechanism, this trampoline service permits OP-TEE to route those I2C
requests back to U-boot without then having to worry about collisions.

Lets suppose that U-Boot executes the trusted application Android
Verified Boot; when OP-TEE receives the request - and before executing
the application - it uses RSA to verify it. So on the back of the TA
function invocation, OP-TEE returns to U-boot with a sequence of RPC
calls requesting I2C transfers (check carefully the implementation in
do_call_with_arg(...) implemented in drivers/tee/optee/core.c and
notice the while loop)

When using sandbox testing, RPC is called directly to validate its
actual implementation; however as succintly described above, these
calls will always be originated in OP-TEE.

Igor Opaniuk (3):
  test: py: add pygit2 and pyelftools to requirements.txt
  drivers: tee: sandbox: add rpc test ta emulation
  test: dm: tee: extend with RPC test

Jorge Ramirez-Ortiz (1):
  drivers: tee: i2c trampoline driver

 drivers/tee/Makefile                     |   2 +
 drivers/tee/optee/Kconfig                |   9 ++
 drivers/tee/optee/Makefile               |   1 +
 drivers/tee/optee/i2c.c                  |  90 +++++++++++++++
 drivers/tee/optee/optee_msg.h            |  21 ++++
 drivers/tee/optee/optee_msg_supplicant.h |   5 +
 drivers/tee/optee/optee_private.h        |  17 +++
 drivers/tee/optee/supplicant.c           |   3 +
 drivers/tee/sandbox.c                    | 137 ++++++++++++++++++++++-
 include/tee/optee_ta_rpc_test.h          |  28 +++++
 test/dm/tee.c                            | 109 +++++++++++++++++-
 test/py/requirements.txt                 |   2 +
 12 files changed, 415 insertions(+), 9 deletions(-)
 create mode 100644 drivers/tee/optee/i2c.c
 create mode 100644 include/tee/optee_ta_rpc_test.h

-- 
2.17.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-01-20 15:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12  8:43 [PATCHv3 0/4] OP-TEE I2C trampoline and associated tests Jorge Ramirez-Ortiz
2021-01-12  8:43 ` [PATCHv3 1/4] drivers: tee: i2c trampoline driver Jorge Ramirez-Ortiz
2021-01-13 16:10   ` Simon Glass
2021-01-12  8:43 ` [PATCHv3 2/4] test: py: add pygit2 and pyelftools to requirements.txt Jorge Ramirez-Ortiz
2021-01-13 16:10   ` Simon Glass
2021-01-12  8:43 ` [PATCHv3 3/4] drivers: tee: sandbox: add rpc test ta emulation Jorge Ramirez-Ortiz
2021-01-13 16:10   ` Simon Glass
2021-01-20  8:49   ` Jens Wiklander
2021-01-20  9:39     ` Igor Opaniuk
2021-01-20 15:51       ` Jens Wiklander
2021-01-12  8:43 ` [PATCHv3 4/4] test: dm: tee: extend with RPC test Jorge Ramirez-Ortiz
2021-01-13 16:10   ` Simon Glass
2021-01-14  9:40     ` Igor Opaniuk
2021-01-14 15:42       ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.