gpoulios opened a new pull request, #3074: URL: https://github.com/apache/nuttx-apps/pull/3074
## Summary > [!NOTE] > Will keep this a draft until https://github.com/apache/nuttx/pull/16356 is merged, as the current driver is not fully compatible with the GP API. This PR addresses the following: 1. **examples/optee**: Fixes usage of some fields during shared memory registration in the existing OP-TEE example - Previous version of optee example was using id during shm registration as input whereas it is an output variable. It was also specifying flags to dictate the behaviour whereas the latest implementation of the driver prohibits their use. 2. **tee/libteec**: Adds the libteec library into NuttX-Apps - Downloads [optee_client](https://github.com/OP-TEE/optee_client/), patches libteec to work with NuttX, and adds it as a static library. Defaults to version 4.6.0. 3. **examples/optee_gp**: Adds an example app making use of GlobalPlatform TEE client API (libteec) - The app opens a session with the OP-TEE built-in pseudo TA "devices", and invokes a command to enumerate available devices on the secure world OS. It demonstrates use of NULL memrefs, temporary shared memory, and registered shared memory. ## Impact Adds support for communicating with TEEs using the familiar GP API. No impact to existing users. ## Testing Tested on a NXP i.MX93 EVK running: - TF-A: version v2.10.0, tag `lf-6.6.52_2.2.0` - OP-TEE OS: revision 4.4 (60beb308810f9561), tag `lf-6.6.52_2.2.0` - NuttX PR: https://github.com/apache/nuttx/pull/16356 - NuttX configs `imx93-evk:nsh` and `imx93-evk:knsh` with additional config: ``` CONFIG_ALLOW_BSD_COMPONENTS=y CONFIG_ARCH_VMA_MAPPING=y CONFIG_ARCH_SHM_NPAGES=4096 CONFIG_ARCH_SHM_VBASE=0xFF000000 CONFIG_DEV_OPTEE_SMC=y CONFIG_EXAMPLES_OPTEE=y CONFIG_EXAMPLES_OPTEE_GP=y CONFIG_FS_SHMFS=y CONFIG_LIBC_MEMFD_SHMFS=y CONFIG_LIBTEEC=y ``` - Logs ``` [...] OP-TEE: OS revision 4.4 (60beb308810f9561) NuttShell (NSH) nsh> optee impl id: 1, impl caps: 1, gen caps: 13 Available devices: d96a5b40-c3e5-21e3-8794-1002a5d5c61b f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c nsh> optee_gp INF [6] TEEC:optee_gp_main:159: Available devices: INF [6] TEEC:optee_gp_main:169: d96a5b40-c3e5-21e3-8794-1002a5d5c61b INF [6] TEEC:optee_gp_main:169: f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c ``` ``` [...] OP-TEE: OS revision 4.4 (60beb308810f9561) NuttShell (NSH) knsh> optee impl id: 1, impl caps: 1, gen caps: 13 Available devices: d96a5b40-c3e5-21e3-8794-1002a5d5c61b f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c knsh> optee_gp INF [6] TEEC:main:159: Available devices: INF [6] TEEC:main:169: d96a5b40-c3e5-21e3-8794-1002a5d5c61b INF [6] TEEC:main:169: f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org