Commit 14763b1c authored by Almir Okato's avatar Almir Okato Committed by Gustavo Henrique Nihei
Browse files

espressif: ESP32, ESP32S2 and ESP32C3 native flash encryption



Native flash encryption was added as option for Espressif chips and
added to the initialization process before MCUboot workflow.

Signed-off-by: default avatarAlmir Okato <almir.okato@espressif.com>
parent 818964d5
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -31,6 +31,15 @@ CONFIG_ESP_SCRATCH_SIZE=0x40000
# CONFIG_SECURE_BOOT_V2_ENABLED=1
# CONFIG_SECURE_BOOT_SUPPORTS_RSA=1

# Hardware Flash Encryption related options
# CONFIG_SECURE_FLASH_ENC_ENABLED=1
# CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC=1
# CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_DEC=1
# CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE=1
# CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT=1
# CONFIG_SECURE_BOOT_ALLOW_JTAG=1
# CONFIG_SECURE_BOOT_ALLOW_ROM_BASIC=1

# Options for enabling eFuse emulation in Flash
# CONFIG_EFUSE_VIRTUAL=1
# CONFIG_EFUSE_VIRTUAL_KEEP_IN_FLASH=1
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ endif()
set(hal_srcs
    ${src_dir}/bootloader_wdt.c
    ${src_dir}/secure_boot.c
    ${src_dir}/flash_encrypt.c
    ${src_dir}/${MCUBOOT_TARGET}/bootloader_init.c
    ${esp_idf_dir}/components/hal/mpu_hal.c
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_common_loader.c
@@ -67,11 +68,13 @@ set(hal_srcs
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_panic.c
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_mem.c
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_random.c
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_random_${MCUBOOT_TARGET}.c
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_utility.c
    ${esp_idf_dir}/components/bootloader_support/src/esp_image_format.c
    ${esp_idf_dir}/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_bootloader.c
    ${esp_idf_dir}/components/bootloader_support/src/${MCUBOOT_TARGET}/bootloader_sha.c
    ${esp_idf_dir}/components/bootloader_support/src/${MCUBOOT_TARGET}/secure_boot_secure_features.c
    ${esp_idf_dir}/components/bootloader_support/src/${MCUBOOT_TARGET}/flash_encryption_secure_features.c
    ${esp_idf_dir}/components/spi_flash/${MCUBOOT_TARGET}/spi_flash_rom_patch.c
    ${esp_idf_dir}/components/esp_hw_support/esp_clk.c
    ${esp_idf_dir}/components/esp_hw_support/port/${MCUBOOT_TARGET}/rtc_init.c
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000
#define CONFIG_ESP_CONSOLE_UART_BAUDRATE 115200
#define CONFIG_BOOTLOADER_OFFSET_IN_FLASH 0x1000
#define CONFIG_PARTITION_TABLE_OFFSET 0xE000
#define CONFIG_EFUSE_VIRTUAL_OFFSET 0xE000
#define CONFIG_PARTITION_TABLE_OFFSET 0x10000
#define CONFIG_EFUSE_VIRTUAL_OFFSET 0x250000
#define CONFIG_EFUSE_VIRTUAL_SIZE 0x2000
#define CONFIG_EFUSE_MAX_BLK_LEN 192
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000
#define CONFIG_ESP_CONSOLE_UART_BAUDRATE 115200
#define CONFIG_BOOTLOADER_OFFSET_IN_FLASH 0x0000
#define CONFIG_PARTITION_TABLE_OFFSET 0xE000
#define CONFIG_EFUSE_VIRTUAL_OFFSET 0xE000
#define CONFIG_PARTITION_TABLE_OFFSET 0x10000
#define CONFIG_EFUSE_VIRTUAL_OFFSET 0x250000
#define CONFIG_EFUSE_VIRTUAL_SIZE 0x2000
#define CONFIG_EFUSE_MAX_BLK_LEN 256
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000
#define CONFIG_ESP_CONSOLE_UART_BAUDRATE 115200
#define CONFIG_BOOTLOADER_OFFSET_IN_FLASH 0x1000
#define CONFIG_PARTITION_TABLE_OFFSET 0xE000
#define CONFIG_EFUSE_VIRTUAL_OFFSET 0xE000
#define CONFIG_PARTITION_TABLE_OFFSET 0x10000
#define CONFIG_EFUSE_VIRTUAL_OFFSET 0x250000
#define CONFIG_EFUSE_VIRTUAL_SIZE 0x2000
#define CONFIG_EFUSE_MAX_BLK_LEN 256
Loading