feat(esp_tee): Support for ESP-TEE - bootloader component

This commit is contained in:
Laukik Hase
2024-07-01 13:42:07 +05:30
parent 604ccb8f8e
commit 66f880fc1c
5 changed files with 16 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
idf_build_get_property(target IDF_TARGET) idf_build_get_property(target IDF_TARGET)
idf_build_get_property(esp_tee_build ESP_TEE_BUILD)
if(${target} STREQUAL "linux") if(${target} STREQUAL "linux")
return() # This component is not supported by the POSIX/Linux simulator return() # This component is not supported by the POSIX/Linux simulator
@@ -7,7 +8,9 @@ endif()
idf_component_register(PRIV_REQUIRES partition_table esptool_py) idf_component_register(PRIV_REQUIRES partition_table esptool_py)
# Do not generate flash file when building bootloader or is in early expansion of the build # Do not generate flash file when building bootloader or is in early expansion of the build
if(BOOTLOADER_BUILD OR NOT CONFIG_APP_BUILD_BOOTLOADER) # This also applies to the ESP-TEE build, as the esp_tee component only requires the
# Kconfig options from the bootloader
if(BOOTLOADER_BUILD OR esp_tee_build OR NOT CONFIG_APP_BUILD_BOOTLOADER)
return() return()
endif() endif()

View File

@@ -1,7 +1,9 @@
idf_build_get_property(esp_tee_build ESP_TEE_BUILD)
set(BOOTLOADER_OFFSET ${CONFIG_BOOTLOADER_OFFSET_IN_FLASH}) set(BOOTLOADER_OFFSET ${CONFIG_BOOTLOADER_OFFSET_IN_FLASH})
# Do not generate flash file when building bootloader # Do not generate flash file when building bootloader
if(BOOTLOADER_BUILD OR NOT CONFIG_APP_BUILD_BOOTLOADER) if(BOOTLOADER_BUILD OR esp_tee_build OR NOT CONFIG_APP_BUILD_BOOTLOADER)
return() return()
endif() endif()

View File

@@ -32,7 +32,8 @@ set(COMPONENTS
main main
efuse efuse
esp_system esp_system
newlib) newlib
esp_tee)
# EXTRA_COMPONENT_DIRS can be populated with directories containing one or several components. # EXTRA_COMPONENT_DIRS can be populated with directories containing one or several components.
# Make sure this variable contains `bootloader_components` directory of the project being compiled. # Make sure this variable contains `bootloader_components` directory of the project being compiled.

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -53,6 +53,11 @@ void __attribute__((noreturn)) call_start_cpu0(void)
bootloader_reset(); bootloader_reset();
} }
// 2.1 Load the TEE image
#if CONFIG_SECURE_ENABLE_TEE
bootloader_utility_load_tee_image(&bs);
#endif
// 3. Load the app image for booting // 3. Load the app image for booting
bootloader_utility_load_boot_image(&bs, boot_index); bootloader_utility_load_boot_image(&bs, boot_index);
} }

View File

@@ -71,6 +71,7 @@ SECTIONS
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_enable .text.bootloader_random_enable) *libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_enable .text.bootloader_random_enable)
*libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*) *libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*) *libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_utility_tee.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*) *libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*) *libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_panic.*(.literal .text .literal.* .text.*) *libbootloader_support.a:bootloader_panic.*(.literal .text .literal.* .text.*)