diff --git a/components/esp_tee/CMakeLists.txt b/components/esp_tee/CMakeLists.txt index fd39d792bf..bd104f5911 100644 --- a/components/esp_tee/CMakeLists.txt +++ b/components/esp_tee/CMakeLists.txt @@ -15,7 +15,6 @@ endif() if(BOOTLOADER_BUILD) idf_component_register() - return() elseif(esp_tee_build) # TEE build currently only uses the shared headers. idf_component_register(INCLUDE_DIRS include) @@ -86,6 +85,20 @@ else() endif() endif() +# TODO: IDF-14145 +if((CONFIG_SECURE_ENABLE_TEE OR esp_tee_build) AND CMAKE_C_COMPILER_ID MATCHES "GNU") + if(CONFIG_IDF_TARGET_ESP32C5 OR CONFIG_IDF_TARGET_ESP32C61) + # Disable zcmp extension to avoid hardware issue with interrupts (DIG-661) + set(march_option "-march=rv32imac_zicsr_zifencei_zaamo_zalrsc") + idf_build_set_property(COMPILE_OPTIONS "${march_option}" APPEND) + idf_build_set_property(LINK_OPTIONS "${march_option}" APPEND) + endif() +endif() + +if(BOOTLOADER_BUILD) + return() +endif() + set(secure_service_yml ${COMPONENT_DIR}/scripts/${IDF_TARGET}/sec_srv_tbl_default.yml ${custom_secure_service_yaml} ) diff --git a/components/hal/test_apps/tee/main/CMakeLists.txt b/components/hal/test_apps/tee/main/CMakeLists.txt index 4e96a101a4..a701218c2c 100644 --- a/components/hal/test_apps/tee/main/CMakeLists.txt +++ b/components/hal/test_apps/tee/main/CMakeLists.txt @@ -7,3 +7,11 @@ idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "" PRIV_REQUIRES pms_and_cpu_intr esp_psram WHOLE_ARCHIVE) + +# TODO: IDF-14145 +if(CONFIG_IDF_TARGET_ESP32C5 OR CONFIG_IDF_TARGET_ESP32C61) + # Disable zcmp extension to avoid hardware issue with interrupts (DIG-661) + set(march_option "-march=rv32imac_zicsr_zifencei_zaamo_zalrsc") + idf_build_set_property(COMPILE_OPTIONS "${march_option}" APPEND) + idf_build_set_property(LINK_OPTIONS "${march_option}" APPEND) +endif()