fix(bootloader_support): Make esp_flash_encrypt.h independent of spi_flash_mmap.h header

This commit is contained in:
harshal.patil
2024-05-14 11:21:21 +05:30
committed by BOT
parent bef1fba3bc
commit 0c5bce6918
10 changed files with 14 additions and 8 deletions

View File

@@ -17,6 +17,7 @@
#include "esp_image_format.h" #include "esp_image_format.h"
#include "esp_secure_boot.h" #include "esp_secure_boot.h"
#include "esp_flash_encrypt.h" #include "esp_flash_encrypt.h"
#include "spi_flash_mmap.h"
#include "sdkconfig.h" #include "sdkconfig.h"
#include "esp_ota_ops.h" #include "esp_ota_ops.h"

View File

@@ -13,6 +13,9 @@
#include "hal/efuse_ll.h" #include "hal/efuse_ll.h"
#include "hal/efuse_hal.h" #include "hal/efuse_hal.h"
#ifndef BOOTLOADER_BUILD
#include "spi_flash_mmap.h"
#endif
#include "hal/spi_flash_ll.h" #include "hal/spi_flash_ll.h"
#include "rom/spi_flash.h" #include "rom/spi_flash.h"
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_IDF_TARGET_ESP32

View File

@@ -9,9 +9,6 @@
#include "esp_attr.h" #include "esp_attr.h"
#include "esp_err.h" #include "esp_err.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"
#ifndef BOOTLOADER_BUILD
#include "spi_flash_mmap.h"
#endif
#include "hal/efuse_ll.h" #include "hal/efuse_ll.h"
#include "sdkconfig.h" #include "sdkconfig.h"

View File

@@ -14,7 +14,6 @@
#include "bootloader_random.h" #include "bootloader_random.h"
#include "bootloader_clock.h" #include "bootloader_clock.h"
#include "bootloader_common.h" #include "bootloader_common.h"
#include "esp_flash_encrypt.h"
#include "esp_cpu.h" #include "esp_cpu.h"
#include "soc/rtc.h" #include "soc/rtc.h"
#include "hal/wdt_hal.h" #include "hal/wdt_hal.h"

View File

@@ -34,6 +34,9 @@
#include "esp_app_desc.h" #include "esp_app_desc.h"
#include "esp_secure_boot.h" #include "esp_secure_boot.h"
#include "esp_flash_encrypt.h" #include "esp_flash_encrypt.h"
#ifndef BOOTLOADER_BUILD
#include "spi_flash_mmap.h"
#endif
#include "esp_flash_partitions.h" #include "esp_flash_partitions.h"
#include "bootloader_flash_priv.h" #include "bootloader_flash_priv.h"
#include "bootloader_random.h" #include "bootloader_random.h"

View File

@@ -27,6 +27,7 @@
#if !CONFIG_IDF_TARGET_LINUX #if !CONFIG_IDF_TARGET_LINUX
#include "esp_flash.h" #include "esp_flash.h"
#include "esp_flash_encrypt.h" #include "esp_flash_encrypt.h"
#include "spi_flash_mmap.h"
#endif #endif
#include "esp_log.h" #include "esp_log.h"
#include "esp_rom_md5.h" #include "esp_rom_md5.h"

View File

@@ -93,7 +93,6 @@
#include "bootloader_flash_config.h" #include "bootloader_flash_config.h"
#include "bootloader_flash.h" #include "bootloader_flash.h"
#include "esp_private/crosscore_int.h" #include "esp_private/crosscore_int.h"
#include "esp_flash_encrypt.h"
#include "esp_private/sleep_gpio.h" #include "esp_private/sleep_gpio.h"
#include "hal/wdt_hal.h" #include "hal/wdt_hal.h"
@@ -114,6 +113,7 @@
#include "esp_rom_spiflash.h" #include "esp_rom_spiflash.h"
#include "bootloader_init.h" #include "bootloader_init.h"
#include "esp_private/bootloader_flash_internal.h" #include "esp_private/bootloader_flash_internal.h"
#include "spi_flash_mmap.h"
#endif // CONFIG_APP_BUILD_TYPE_RAM #endif // CONFIG_APP_BUILD_TYPE_RAM
//This dependency will be removed in the future //This dependency will be removed in the future

View File

@@ -12,6 +12,7 @@
#include "esp_flash_encrypt.h" #include "esp_flash_encrypt.h"
#include "esp_rom_crc.h" #include "esp_rom_crc.h"
#include "esp_private/spi_flash_os.h" #include "esp_private/spi_flash_os.h"
#include "spi_flash_mmap.h"
#define BLANK_COREDUMP_SIZE 0xFFFFFFFF #define BLANK_COREDUMP_SIZE 0xFFFFFFFF
@@ -258,7 +259,7 @@ static esp_err_t esp_core_dump_flash_write_prepare(core_dump_write_data_t *wr_da
padding = COREDUMP_CACHE_SIZE - modulo; padding = COREDUMP_CACHE_SIZE - modulo;
} }
/* Now we can check whether we have enough space in our core dump parition /* Now we can check whether we have enough space in our core dump partition
* or not. */ * or not. */
if ((*data_len + padding + cs_len) > s_core_flash_config.partition.size) { if ((*data_len + padding + cs_len) > s_core_flash_config.partition.size) {
ESP_COREDUMP_LOGE("Not enough space to save core dump!"); ESP_COREDUMP_LOGE("Not enough space to save core dump!");

View File

@@ -200,10 +200,10 @@ endif()
if(SHA_PERIPHERAL_TYPE STREQUAL "dma" OR AES_PERIPHERAL_TYPE STREQUAL "dma") if(SHA_PERIPHERAL_TYPE STREQUAL "dma" OR AES_PERIPHERAL_TYPE STREQUAL "dma")
target_link_libraries(mbedcrypto PRIVATE idf::esp_mm) target_link_libraries(mbedcrypto PRIVATE idf::esp_mm)
if(CONFIG_SOC_SHA_GDMA OR CONFIG_SOC_AES_GDMA) if(CONFIG_SOC_SHA_GDMA OR CONFIG_SOC_AES_GDMA)
target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/crypto_shared_gdma/esp_crypto_shared_gdma.c")
if(CONFIG_SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT) if(CONFIG_SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT)
target_link_libraries(mbedcrypto PRIVATE idf::spi_flash idf::bootloader_support) target_link_libraries(mbedcrypto PRIVATE idf::bootloader_support)
endif() endif()
target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/crypto_shared_gdma/esp_crypto_shared_gdma.c")
endif() endif()
endif() endif()

View File

@@ -17,6 +17,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "esp_partition.h" #include "esp_partition.h"
#include "esp_system.h" #include "esp_system.h"
#include "spi_flash_mmap.h"
#include "nvs.h" #include "nvs.h"
#include "nvs_flash.h" #include "nvs_flash.h"