| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | Source codes of optee applications locates in openwrt/marvell/services/optee_app.
|
| 2 | Currently, only a few example applications are provided for customers' reference,
|
| 3 | such as random, cipher and so on.
|
| 4 | Customers can develop their own TAs and CAs according to ASR examples,
|
| 5 | then add their source codes of TA/CA to openwrt/marvell/services/optee_app
|
| 6 | and modify package/services/optee_app/Makefile to build their applications.
|
| 7 |
|
| 8 | For example, if customers want to add an application named 'hello_world'.
|
| 9 | Firstly, they need to develop the source codes following below layout:
|
| 10 | marvell/services/optee_app/helloworld/
|
| 11 | ├── host
|
| 12 | │ ├── Makefile BINARY=optee_example_hello_world
|
| 13 | │ └── main.c Implementation of host application of hello world
|
| 14 | └── ta
|
| 15 | ├── Makefile BINARY=<uuid>
|
| 16 | ├── sub.mk srcs-y += hello_world_ta.c
|
| 17 | ├── include
|
| 18 | │ └── hello_world_ta.h Header exported to non-secure: TA commands API
|
| 19 | ├── hello_world_ta.c Implementation of TA entry points
|
| 20 | └── user_ta_header_defines.h TA_UUID, TA_FLAGS, TA_DATA/STACK_SIZE, ...
|
| 21 |
|
| 22 | Secondly, add below two items to package/services/optee_app/Makefile
|
| 23 | a):
|
| 24 | define Package/optee_app/config
|
| 25 | menu "OPTEE application Configuration"
|
| 26 | .......
|
| 27 | config HELLOWORLD
|
| 28 | bool "Enable hello world TA/CA"
|
| 29 | default n
|
| 30 | ........
|
| 31 | endmenu
|
| 32 | endef
|
| 33 |
|
| 34 | b):
|
| 35 | ifeq ($(CONFIG_HELLOWORLD),y)
|
| 36 | APP_LIST := $(APP_LIST)" helloworld"
|
| 37 | endif
|
| 38 |
|
| 39 | "helloworld" appended to APP_LIST should be the folder name of the hello world application.
|
| 40 |
|
| 41 | Thirdly, 'make menuconfig' under top directory and enable the hello world applcaition as below:
|
| 42 | services--->
|
| 43 | optee_app
|
| 44 | OPTEE application Configuration-->
|
| 45 | [*]Enable hello world TA/CA
|
| 46 |
|
| 47 | Lastly, after build openwrt and burn the images to board, the helloworld executable CA is under
|
| 48 | usr/sbin and its TA is under /usr/lib/optee_armtz。
|