Skip to content

Commit

Permalink
feat(esp_tee): Support for ESP-TEE - tools directory
Browse files Browse the repository at this point in the history
  • Loading branch information
laukik-hase committed Dec 2, 2024
1 parent e51d2c1 commit 420810e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitlab/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
/components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
/components/esp_security/ @esp-idf-codeowners/security
/components/esp_system/ @esp-idf-codeowners/system
/components/esp_tee/ @esp-idf-codeowners/security
/components/esp_timer/ @esp-idf-codeowners/system
/components/esp-tls/ @esp-idf-codeowners/app-utilities
/components/esp_vfs_*/ @esp-idf-codeowners/storage
Expand Down
29 changes: 19 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ endif()
# Add the following build specifications here, since these seem to be dependent
# on config values on the root Kconfig.

if(NOT BOOTLOADER_BUILD)
if(BOOTLOADER_BUILD)

if(CONFIG_COMPILER_OPTIMIZATION_SIZE)
if(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND compile_options "-Oz")
else()
Expand All @@ -24,20 +24,29 @@ if(NOT BOOTLOADER_BUILD)
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND compile_options "-freorder-blocks")
endif()
elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG)
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG)
list(APPEND compile_options "-Og")
if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CONFIG_IDF_TARGET_LINUX)
list(APPEND compile_options "-fno-shrink-wrap") # Disable shrink-wrapping to reduce binary size
endif()
elseif(CONFIG_COMPILER_OPTIMIZATION_NONE)
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE)
list(APPEND compile_options "-O0")
elseif(CONFIG_COMPILER_OPTIMIZATION_PERF)
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF)
list(APPEND compile_options "-O2")
endif()

else() # BOOTLOADER_BUILD
elseif(ESP_TEE_BUILD)

if(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND compile_options "-Oz")
else()
list(APPEND compile_options "-Os")
list(APPEND compile_options "-freorder-blocks")
endif()

else()

if(CONFIG_COMPILER_OPTIMIZATION_SIZE)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND compile_options "-Oz")
else()
Expand All @@ -46,14 +55,14 @@ else() # BOOTLOADER_BUILD
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND compile_options "-freorder-blocks")
endif()
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG)
elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG)
list(APPEND compile_options "-Og")
if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CONFIG_IDF_TARGET_LINUX)
list(APPEND compile_options "-fno-shrink-wrap") # Disable shrink-wrapping to reduce binary size
endif()
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE)
elseif(CONFIG_COMPILER_OPTIMIZATION_NONE)
list(APPEND compile_options "-O0")
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF)
elseif(CONFIG_COMPILER_OPTIMIZATION_PERF)
list(APPEND compile_options "-O2")
endif()

Expand Down
3 changes: 3 additions & 0 deletions tools/ci/artifacts_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ class ArtifactType(str, Enum):
ArtifactType.MAP_AND_ELF_FILES: [
'**/build*/bootloader/*.map',
'**/build*/bootloader/*.elf',
'**/build*/esp_tee/*.map',
'**/build*/esp_tee/*.elf',
'**/build*/*.map',
'**/build*/*.elf',
],
ArtifactType.BUILD_DIR_WITHOUT_MAP_AND_ELF_FILES: [
f'**/build*/{DEFAULT_BUILD_LOG_FILENAME}',
'**/build*/*.bin',
'**/build*/bootloader/*.bin',
'**/build*/esp_tee/*.bin',
'**/build*/partition_table/*.bin',
'**/build*/flasher_args.json',
'**/build*/flash_project_args',
Expand Down
3 changes: 3 additions & 0 deletions tools/ci/idf_ci/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ class AppUploader(AppDownloader):
ArtifactType.MAP_AND_ELF_FILES: [
'bootloader/*.map',
'bootloader/*.elf',
'esp_tee/*.map',
'esp_tee/*.elf',
'*.map',
'*.elf',
'gdbinit/*',
],
ArtifactType.BUILD_DIR_WITHOUT_MAP_AND_ELF_FILES: [
'*.bin',
'bootloader/*.bin',
'esp_tee/*.bin',
'partition_table/*.bin',
'flasher_args.json',
'flash_project_args',
Expand Down
1 change: 1 addition & 0 deletions tools/cmake/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ macro(idf_build_process target)

idf_build_set_property(BOOTLOADER_BUILD "${BOOTLOADER_BUILD}")
idf_build_set_property(NON_OS_BUILD "${NON_OS_BUILD}")
idf_build_set_property(ESP_TEE_BUILD "${ESP_TEE_BUILD}")

idf_build_set_property(IDF_TOOLCHAIN "${IDF_TOOLCHAIN}")

Expand Down

0 comments on commit 420810e

Please sign in to comment.