-
Notifications
You must be signed in to change notification settings - Fork 606
Add GlobalPlatform API client library (libteec) and example app (optee_gp) #3074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@gpoulios let's create new defconfig to enable optee, so ci could check no change will break optee in the future. |
78792a1
to
def32ab
Compare
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. This commit addresses those issues. Signed-off-by: George Poulios <[email protected]>
def32ab
to
83778fc
Compare
do you plan to port optee_test too? @gpoulios |
Not any time soon. Perhaps in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @gpoulios :-)
Is the name tee/
correct, shouldn't it be optee/
? I can see we use already OPTEE
name in NuttX and the OP-TEE project uses optee_
suffix :-)
Can we please move optee/
under some existing group/category to keep things clean i.e. system/optee
?
This will be initial commit so some words of introduction would be nice to put into a commit - for instance what is this library, whers is the homepage and documentation, etc + some info in the src headers so newcomers will know what this is :-)
Mixed case identifiers comes from the library API so we need to accept that.
The directory is named tee/ because there might be some other implementation in the future (e.g. libamdteec or whatever). It also comes from the fact that the specification is not OPTEE specific. @cederom Do you still want me to rename it?
I considered that but then I thought, it’s not exactly a system thing, right? Just didn’t fit alongside the other packages under system/. But if you want it there, sure.
You mean put this info on the commit message of the commit introducing libteec?
You lost me here, can you show me an example please? There are no header files introduced by us. Only the library’s (downloaded) headers. As for new comers, if they have any aspirations to write an OPTEE client app in NuttX, I’m pretty sure they know already those things, but sure I can put a few links here and there.
Yes, whitelisting is in the NuttX PR i mentioned in the description. |
Thanks @gpoulios, lets keep the top level The note I mentioned was to put a brief description of what "TEE" is and URL reference to the standard in the Kconfig help and/or top part of the source files ("file header" in terms of location) so its fast to know that these files are :-) Lets keep things self-explanatory :-) |
Support for downloading, patching and linking against optee_client/libteec by NuttX apps. Defaults to version 4.6.0. Enabled with CONFIG_LIBTEEC. More info: - https://github.com/OP-TEE/optee_client - https://optee.readthedocs.io/en/latest/architecture/globalplatform_api.html#tee-client-api - https://globalplatform.org/specs-library/?filter-committee=tee (GPD_SPE_007) Signed-off-by: George Poulios <[email protected]>
Add an example app that opens a session with the devices pseudo-TA and enumerates the available devices (prints their UUIDs only) using the GlobalPlatform API and libteec. The example showcases: - initializing the context - opening a session - invoking a command using NULL references - invoking a command using temp shared memory - invoking a command using registered shared memory - closing the session - finalizing the context Enabled with CONFIG_EXAMPLES_OPTEE_GP. Signed-off-by: George Poulios <[email protected]>
83778fc
to
8477505
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @gpoulios :-)
One check should pass now that apache/nuttx#16356 is merged. The other failing check (msys), I don’t quite understand. Can someone re-trigger those please? @xiaoxiang781216 perhaps? Thanks |
Done, but you can update the patch to retrigger ci too. |
Thank you @xiaoxiang781216. I know, I just didn’t want to lose the approvals or rerun it from scratch. |
Summary
Note
Will keep this a draft until apache/nuttx#16356 is merged, as the current driver is not fully compatible with the GP API. apache/nuttx#16356 also introduces the necessary nxstyle whitelisting for this one to pass the CI checks.
This PR addresses the following:
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: Fix OP-TEE driver compatibility issues nuttx#16356
NuttX configs
imx93-evk:nsh
andimx93-evk:knsh
with additional config:Logs