Skip to content

Commit

Permalink
driver/tee: add optee client driver module
Browse files Browse the repository at this point in the history
The driver's main purpose is to support the porting of the open source
component optee_client (https://github.com/OP-TEE/optee_client) to nttux.

The basic function of the driver module is to convert the REE application layer data and send it to the TEE through rpmsg.

The main functions include
1 driver registration.
we need to register a device driver(/dev/tee0) through optee_register function.
2 open the driver
3 ioctl the driver
The ioctl command passes different parameters and commands, and interacts with the TEE through rpmsg.
4 close the driver

Signed-off-by: hujun5 <[email protected]>
Change-Id: Ida659b4e5a986729d8ec3e9e64a28efb0802c544
  • Loading branch information
hujun260 committed Nov 20, 2023
1 parent 11b3adf commit 488fdcd
Show file tree
Hide file tree
Showing 7 changed files with 1,589 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/drivers_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <nuttx/trace.h>
#include <nuttx/usrsock/usrsock_rpmsg.h>
#include <nuttx/virtio/virtio.h>
#include <nuttx/drivers/optee.h>

/****************************************************************************
* Public Functions
Expand Down Expand Up @@ -217,5 +218,9 @@ void drivers_initialize(void)
virtio_register_drivers();
#endif

#ifndef CONFIG_DEV_OPTEE_NONE
optee_register();
#endif

drivers_trace_end();
}
22 changes: 22 additions & 0 deletions drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ config DEV_RPMSG_SERVER
default n
depends on RPTUN

choice
prompt "Select optee dev implementation"
default DEV_OPTEE_NONE

config DEV_OPTEE_LOCAL
bool "OPTEE Local Socket Support"
depends on NET_LOCAL

config DEV_OPTEE_RPMSG
bool "OPTEE RPMSG Socket Support"
depends on NET_RPMSG

config DEV_OPTEE_NONE
bool "Disable optee driver"

endchoice

config OPTEE_REMOTE_CPU_NAME
string "The cpuname on which the optee server runs"
default "tee"
depends on DEV_OPTEE_RPMSG

config DRVR_MKRD
bool "RAM disk wrapper (mkrd)"
default n
Expand Down
4 changes: 4 additions & 0 deletions drivers/misc/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ ifeq ($(CONFIG_BLK_RPMSG_SERVER),y)
CSRCS += rpmsgblk_server.c
endif

ifneq ($(CONFIG_DEV_OPTEE_NONE),y)
CSRCS += optee.c
endif

# Include build support

DEPPATH += --dep-path misc
Expand Down
Loading

0 comments on commit 488fdcd

Please sign in to comment.