Skip to content

Commit 23cfe08

Browse files
Merge branch 'fix/aes_operation_using_psram_memory_with_psram_enc_v5.3' into 'release/v5.3'
Enable AXI-DMA AES-ECC mean access when external memory encryption is enabled (v5.3) See merge request espressif/esp-idf!30822
2 parents 30ea848 + 0c5bce6 commit 23cfe08

File tree

17 files changed

+231
-36
lines changed

17 files changed

+231
-36
lines changed

components/app_update/esp_ota_ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "esp_image_format.h"
1818
#include "esp_secure_boot.h"
1919
#include "esp_flash_encrypt.h"
20+
#include "spi_flash_mmap.h"
2021
#include "sdkconfig.h"
2122

2223
#include "esp_ota_ops.h"

components/bootloader_support/bootloader_flash/src/bootloader_flash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#include "hal/efuse_ll.h"
1414
#include "hal/efuse_hal.h"
1515

16+
#ifndef BOOTLOADER_BUILD
17+
#include "spi_flash_mmap.h"
18+
#endif
1619
#include "hal/spi_flash_ll.h"
1720
#include "rom/spi_flash.h"
1821
#if CONFIG_IDF_TARGET_ESP32

components/bootloader_support/include/esp_flash_encrypt.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
#include "esp_attr.h"
1010
#include "esp_err.h"
1111
#include "soc/soc_caps.h"
12-
#ifndef BOOTLOADER_BUILD
13-
#include "spi_flash_mmap.h"
14-
#endif
1512
#include "hal/efuse_ll.h"
1613
#include "sdkconfig.h"
1714

components/bootloader_support/src/bootloader_init.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "bootloader_random.h"
1515
#include "bootloader_clock.h"
1616
#include "bootloader_common.h"
17-
#include "esp_flash_encrypt.h"
1817
#include "esp_cpu.h"
1918
#include "soc/rtc.h"
2019
#include "hal/wdt_hal.h"

components/bootloader_support/src/bootloader_utility.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#include "esp_app_desc.h"
3535
#include "esp_secure_boot.h"
3636
#include "esp_flash_encrypt.h"
37+
#ifndef BOOTLOADER_BUILD
38+
#include "spi_flash_mmap.h"
39+
#endif
3740
#include "esp_flash_partitions.h"
3841
#include "bootloader_flash_priv.h"
3942
#include "bootloader_random.h"

components/esp_partition/partition.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#if !CONFIG_IDF_TARGET_LINUX
2828
#include "esp_flash.h"
2929
#include "esp_flash_encrypt.h"
30+
#include "spi_flash_mmap.h"
3031
#endif
3132
#include "esp_log.h"
3233
#include "esp_rom_md5.h"

components/esp_system/port/cpu_start.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
#include "bootloader_flash_config.h"
9494
#include "bootloader_flash.h"
9595
#include "esp_private/crosscore_int.h"
96-
#include "esp_flash_encrypt.h"
9796

9897
#include "esp_private/sleep_gpio.h"
9998
#include "hal/wdt_hal.h"
@@ -114,6 +113,7 @@
114113
#include "esp_rom_spiflash.h"
115114
#include "bootloader_init.h"
116115
#include "esp_private/bootloader_flash_internal.h"
116+
#include "spi_flash_mmap.h"
117117
#endif // CONFIG_APP_BUILD_TYPE_RAM
118118

119119
//This dependency will be removed in the future

components/espcoredump/src/core_dump_flash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "esp_flash_encrypt.h"
1313
#include "esp_rom_crc.h"
1414
#include "esp_private/spi_flash_os.h"
15+
#include "spi_flash_mmap.h"
1516

1617
#define BLANK_COREDUMP_SIZE 0xFFFFFFFF
1718

components/hal/esp32p4/include/hal/axi_dma_ll.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@ static inline void axi_dma_ll_rx_enable_etm_task(axi_dma_dev_t *dev, uint32_t ch
273273
dev->in[channel].conf.in_conf0.in_etm_en_chn = enable;
274274
}
275275

276+
/**
277+
* @brief Whether to enable the mean access ecc or aes domain
278+
*/
279+
static inline void axi_dma_ll_rx_enable_ext_mem_ecc_aes_access(axi_dma_dev_t *dev, uint32_t channel, bool enable)
280+
{
281+
dev->in[channel].conf.in_conf0.in_ecc_aec_en_chn = enable;
282+
}
283+
276284
///////////////////////////////////// TX /////////////////////////////////////////
277285
/**
278286
* @brief Get DMA TX channel interrupt status word
@@ -471,6 +479,14 @@ static inline void axi_dma_ll_tx_enable_etm_task(axi_dma_dev_t *dev, uint32_t ch
471479
dev->out[channel].conf.out_conf0.out_etm_en_chn = enable;
472480
}
473481

482+
/**
483+
* @brief Whether to enable the mean access ecc or aes domain
484+
*/
485+
static inline void axi_dma_ll_tx_enable_ext_mem_ecc_aes_access(axi_dma_dev_t *dev, uint32_t channel, bool enable)
486+
{
487+
dev->out[channel].conf.out_conf0.out_ecc_aec_en_chn = enable;
488+
}
489+
474490
///////////////////////////////////// CRC-TX /////////////////////////////////////////
475491

476492
/**

components/hal/test_apps/crypto/main/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ if(CONFIG_SOC_SHA_SUPPORTED)
6868
endif()
6969

7070
idf_component_register(SRCS ${srcs}
71-
PRIV_REQUIRES efuse mbedtls esp_mm
71+
PRIV_REQUIRES efuse mbedtls esp_mm bootloader_support
7272
REQUIRES test_utils unity
7373
WHOLE_ARCHIVE
7474
PRIV_INCLUDE_DIRS "${priv_include_dirs}"

0 commit comments

Comments
 (0)