Skip to content

Commit 37525c6

Browse files
committed
refactor(esp_tee): Migrate secure services list from TBL to YAML
1 parent 8f117c7 commit 37525c6

File tree

19 files changed

+384
-157
lines changed

19 files changed

+384
-157
lines changed

components/esp_tee/CMakeLists.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
idf_build_get_property(esp_tee_build ESP_TEE_BUILD)
2-
idf_build_get_property(custom_secure_service_tbl CUSTOM_SECURE_SERVICE_TBL)
2+
idf_build_get_property(custom_secure_service_yaml CUSTOM_SECURE_SERVICE_YAML)
33
idf_build_get_property(custom_secure_service_dir CUSTOM_SECURE_SERVICE_COMPONENT_DIR)
44
idf_build_get_property(custom_secure_service_component CUSTOM_SECURE_SERVICE_COMPONENT)
55
idf_build_get_property(target IDF_TARGET)
@@ -82,33 +82,33 @@ else()
8282
endif()
8383
endif()
8484

85-
set(secure_service_tbl_parser_py
86-
${COMPONENT_DIR}/scripts/secure_service_tbl_parser.py ${CMAKE_CURRENT_BINARY_DIR}/secure_service.tbl
85+
set(secure_service_yml
86+
${COMPONENT_DIR}/scripts/${IDF_TARGET}/sec_srv_tbl_default.yml ${custom_secure_service_yaml}
8787
)
8888

89-
set(secure_service_gen_headers
90-
${CONFIG_DIR}/secure_service_num.h ${CONFIG_DIR}/secure_service_dec.h
91-
${CONFIG_DIR}/secure_service_int.h ${CONFIG_DIR}/secure_service_ext.h
89+
set(secure_service_yml_parser_py
90+
${COMPONENT_DIR}/scripts/secure_service_yml_parser.py
9291
)
9392

9493
if(CONFIG_SECURE_ENABLE_TEE AND NOT esp_tee_build)
95-
execute_process(
96-
COMMAND cat ${COMPONENT_DIR}/scripts/${target}/secure_service.tbl ${custom_secure_service_tbl}
97-
OUTPUT_FILE secure_service.tbl
98-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
99-
)
94+
# Default secure service API families: flash_protection_spi0, flash_protection_spi1,
95+
# interrupt_handling, hal, crypto, efuse, secure_storage, ota, attestation
96+
set(exclude_srv)
97+
if(NOT CONFIG_SECURE_TEE_ATTESTATION)
98+
list(APPEND exclude_srv "attestation")
99+
endif()
100100

101101
execute_process(
102-
COMMAND python ${secure_service_tbl_parser_py} ${secure_service_gen_headers}
103-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
104-
)
105-
106-
set_property(DIRECTORY ${COMPONENT_DIR} APPEND PROPERTY
107-
ADDITIONAL_MAKE_CLEAN_FILES ${secure_service_gen_headers}
102+
COMMAND python ${secure_service_yml_parser_py}
103+
"--sec_srv" ${secure_service_yml}
104+
"--exclude" ${exclude_srv}
105+
WORKING_DIRECTORY ${CONFIG_DIR}
108106
)
109107

110108
execute_process(
111-
COMMAND python ${secure_service_tbl_parser_py} "--wrap"
109+
COMMAND python ${secure_service_yml_parser_py}
110+
"--sec_srv" ${secure_service_yml}
111+
"--exclude" ${exclude_srv} "--wrap"
112112
OUTPUT_VARIABLE wrap_list
113113
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
114114
OUTPUT_STRIP_TRAILING_WHITESPACE
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
secure_services:
2+
- family: misc
3+
entries:
4+
- id: 0
5+
type: custom
6+
function: invalid_secure_service
7+
args: 0
8+
# ID: 1-4 (4) - External memory (Flash) protection [SPI0]
9+
- family: flash_protection_spi0
10+
entries:
11+
- id: 1
12+
type: IDF
13+
function: mmu_hal_map_region
14+
args: 6
15+
- id: 2
16+
type: IDF
17+
function: mmu_hal_unmap_region
18+
args: 3
19+
- id: 3
20+
type: IDF
21+
function: mmu_hal_vaddr_to_paddr
22+
args: 4
23+
- id: 4
24+
type: IDF
25+
function: mmu_hal_paddr_to_vaddr
26+
args: 5
27+
# ID: 30-53 (24) - Interrupt Handling
28+
- family: interrupt_handling
29+
entries:
30+
- id: 30
31+
type: IDF
32+
function: esp_rom_route_intr_matrix
33+
args: 3
34+
- id: 31
35+
type: IDF
36+
function: rv_utils_intr_enable
37+
args: 1
38+
- id: 32
39+
type: IDF
40+
function: rv_utils_intr_disable
41+
args: 1
42+
- id: 33
43+
type: IDF
44+
function: rv_utils_intr_set_priority
45+
args: 2
46+
- id: 34
47+
type: IDF
48+
function: rv_utils_intr_set_type
49+
args: 2
50+
- id: 35
51+
type: IDF
52+
function: rv_utils_intr_set_threshold
53+
args: 1
54+
- id: 36
55+
type: IDF
56+
function: rv_utils_intr_edge_ack
57+
args: 1
58+
- id: 37
59+
type: IDF
60+
function: rv_utils_intr_global_enable
61+
args: 0
62+
# ID: 54-85 (32) - HAL
63+
- family: hal
64+
entries:
65+
- id: 54
66+
type: IDF
67+
function: efuse_hal_chip_revision
68+
args: 0
69+
- id: 55
70+
type: IDF
71+
function: efuse_hal_get_chip_ver_pkg
72+
args: 1
73+
- id: 56
74+
type: IDF
75+
function: efuse_hal_get_disable_wafer_version_major
76+
args: 0
77+
- id: 57
78+
type: IDF
79+
function: efuse_hal_get_mac
80+
args: 1
81+
- id: 58
82+
type: IDF
83+
function: wdt_hal_init
84+
args: 4
85+
- id: 59
86+
type: IDF
87+
function: wdt_hal_deinit
88+
args: 1
89+
# ID: 86-133 (48) - Crypto
90+
- family: crypto
91+
entries:
92+
- id: 86
93+
type: IDF
94+
function: esp_aes_intr_alloc
95+
args: 0
96+
- id: 87
97+
type: IDF
98+
function: esp_aes_crypt_cbc
99+
args: 6
100+
- id: 88
101+
type: IDF
102+
function: esp_aes_crypt_cfb8
103+
args: 6
104+
- id: 89
105+
type: IDF
106+
function: esp_aes_crypt_cfb128
107+
args: 7
108+
- id: 90
109+
type: IDF
110+
function: esp_aes_crypt_ctr
111+
args: 7
112+
- id: 91
113+
type: IDF
114+
function: esp_aes_crypt_ecb
115+
args: 4
116+
- id: 92
117+
type: IDF
118+
function: esp_aes_crypt_ofb
119+
args: 6
120+
- id: 93
121+
type: IDF
122+
function: esp_sha
123+
args: 4
124+
- id: 94
125+
type: IDF
126+
function: esp_sha_block
127+
args: 3
128+
- id: 95
129+
type: IDF
130+
function: esp_sha_dma
131+
args: 6
132+
- id: 96
133+
type: IDF
134+
function: esp_sha_read_digest_state
135+
args: 2
136+
- id: 97
137+
type: IDF
138+
function: esp_sha_write_digest_state
139+
args: 2
140+
# ID: 134-149 (16) - eFuse
141+
- family: efuse
142+
entries:
143+
- id: 134
144+
type: IDF
145+
function: esp_efuse_check_secure_version
146+
args: 1
147+
- id: 135
148+
type: IDF
149+
function: esp_efuse_read_field_blob
150+
args: 3
151+
- id: 136
152+
type: IDF
153+
function: esp_flash_encryption_enabled
154+
args: 0
155+
# ID: 150-169 (20) - Reserved for future use
156+
- family: attestation
157+
entries:
158+
- id: 170
159+
type: custom
160+
function: esp_tee_att_generate_token
161+
args: 6
162+
# ID: 175-194 (20) - Secure Storage
163+
- family: secure_storage
164+
entries:
165+
- id: 175
166+
type: custom
167+
function: esp_tee_sec_storage_init
168+
args: 0
169+
- id: 176
170+
type: custom
171+
function: esp_tee_sec_storage_gen_key
172+
args: 2
173+
- id: 177
174+
type: custom
175+
function: esp_tee_sec_storage_get_signature
176+
args: 4
177+
- id: 178
178+
type: custom
179+
function: esp_tee_sec_storage_get_pubkey
180+
args: 2
181+
- id: 179
182+
type: custom
183+
function: esp_tee_sec_storage_encrypt
184+
args: 8
185+
- id: 180
186+
type: custom
187+
function: esp_tee_sec_storage_decrypt
188+
args: 8
189+
- id: 181
190+
type: custom
191+
function: esp_tee_sec_storage_is_slot_empty
192+
args: 1
193+
- id: 182
194+
type: custom
195+
function: esp_tee_sec_storage_clear_slot
196+
args: 1
197+
# ID: 195-199 (5) - OTA
198+
- family: ota
199+
entries:
200+
- id: 195
201+
type: custom
202+
function: esp_tee_ota_begin
203+
args: 0
204+
- id: 196
205+
type: custom
206+
function: esp_tee_ota_write
207+
args: 3
208+
- id: 197
209+
type: custom
210+
function: esp_tee_ota_end
211+
args: 0
212+
# ID: 200+ - User-defined

components/esp_tee/scripts/esp32c6/secure_service.tbl

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)