Merge branch 'bugfix/dma_alignment_for_encryption_memory' into 'master'

fix(gdma): relax alignment constraint for internal memory

Closes IDFGH-14453

See merge request espressif/esp-idf!37055
This commit is contained in:
morris 2025-02-19 11:09:06 +08:00
commit deb703cc68

View File

@ -392,10 +392,9 @@ esp_err_t gdma_config_transfer(gdma_channel_handle_t dma_chan, const gdma_transf
// if MSPI encryption is enabled, and DMA wants to read/write external memory // if MSPI encryption is enabled, and DMA wants to read/write external memory
if (esp_flash_encryption_enabled()) { if (esp_flash_encryption_enabled()) {
gdma_hal_enable_access_encrypt_mem(hal, pair->pair_id, dma_chan->direction, config->access_ext_mem); gdma_hal_enable_access_encrypt_mem(hal, pair->pair_id, dma_chan->direction, config->access_ext_mem);
// when DMA access the encrypted memory, extra alignment is needed, for both internal and external memory // when DMA access the encrypted memory, extra alignment is needed for external memory
if (config->access_ext_mem) { if (config->access_ext_mem) {
ext_mem_alignment = MAX(ext_mem_alignment, GDMA_ACCESS_ENCRYPTION_MEM_ALIGNMENT); ext_mem_alignment = MAX(ext_mem_alignment, GDMA_ACCESS_ENCRYPTION_MEM_ALIGNMENT);
int_mem_alignment = MAX(int_mem_alignment, GDMA_ACCESS_ENCRYPTION_MEM_ALIGNMENT);
} }
} else { } else {
gdma_hal_enable_access_encrypt_mem(hal, pair->pair_id, dma_chan->direction, false); gdma_hal_enable_access_encrypt_mem(hal, pair->pair_id, dma_chan->direction, false);