Skip to content

Commit 86bd3d3

Browse files
author
Jiang Jiang Jian
committed
Merge branch 'fix/axi_dma_ext_mem_alignment_c5_v5.5' into 'release/v5.5'
Align AES and SHA buffers to 16 when SPIRAM encryption is enabled (v5.5) See merge request espressif/esp-idf!43261
2 parents 34ff240 + 317a6f0 commit 86bd3d3

File tree

10 files changed

+101
-56
lines changed

10 files changed

+101
-56
lines changed

components/mbedtls/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ endif()
233233
if((SHA_PERIPHERAL_TYPE STREQUAL "core" AND CONFIG_SOC_SHA_SUPPORT_DMA) OR AES_PERIPHERAL_TYPE STREQUAL "dma")
234234
target_link_libraries(mbedcrypto PRIVATE idf::esp_mm)
235235
if(CONFIG_SOC_SHA_GDMA OR CONFIG_SOC_AES_GDMA)
236-
if(CONFIG_SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT)
237-
target_link_libraries(mbedcrypto PRIVATE idf::bootloader_support)
238-
endif()
239236
target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/crypto_shared_gdma/esp_crypto_shared_gdma.c")
240237
endif()
241238
endif()

components/mbedtls/port/aes/dma/esp_aes_dma_core.c

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
#include "aes/esp_aes_gcm.h"
4242
#endif
4343

44-
#ifdef SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
45-
#include "esp_flash_encrypt.h"
46-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
44+
#ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
45+
#include "hal/efuse_hal.h"
46+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
4747

4848
/* Max size of each chunk to process when output buffer is in unaligned external ram
4949
must be a multiple of block size
@@ -241,17 +241,17 @@ static int esp_aes_process_dma_ext_ram(esp_aes_context *ctx, const unsigned char
241241

242242
/* When AES-DMA operations are carried out using external memory with external memory encryption enabled,
243243
we need to make sure that the addresses and the sizes of the buffers on which the DMA operates are 16 byte-aligned. */
244-
#ifdef SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
245-
if (esp_flash_encryption_enabled()) {
244+
#ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
245+
if (efuse_hal_flash_encryption_enabled()) {
246246
if (esp_ptr_external_ram(input) || esp_ptr_external_ram(output) || esp_ptr_in_drom(input) || esp_ptr_in_drom(output)) {
247-
input_alignment = MAX(get_cache_line_size(input), SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT);
248-
output_alignment = MAX(get_cache_line_size(output), SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT);
247+
input_alignment = MAX(get_cache_line_size(input), SOC_GDMA_EXT_MEM_ENC_ALIGNMENT);
248+
output_alignment = MAX(get_cache_line_size(output), SOC_GDMA_EXT_MEM_ENC_ALIGNMENT);
249249

250250
input_heap_caps = MALLOC_CAP_8BIT | (esp_ptr_external_ram(input) ? MALLOC_CAP_SPIRAM : MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
251251
output_heap_caps = MALLOC_CAP_8BIT | (esp_ptr_external_ram(output) ? MALLOC_CAP_SPIRAM : MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
252252
}
253253
}
254-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
254+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
255255

256256
if (realloc_input) {
257257
input_buf = heap_caps_aligned_alloc(input_alignment, chunk_len, input_heap_caps);
@@ -537,19 +537,19 @@ int esp_aes_process_dma(esp_aes_context *ctx, const unsigned char *input, unsign
537537
return MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH;
538538
}
539539

540-
#ifdef SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
541-
if (esp_flash_encryption_enabled()) {
540+
#ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
541+
if (efuse_hal_flash_encryption_enabled()) {
542542
if (esp_ptr_external_ram(input) || esp_ptr_external_ram(output) || esp_ptr_in_drom(input) || esp_ptr_in_drom(output)) {
543-
if (((intptr_t)(input) & (SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
543+
if (((intptr_t)(input) & (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
544544
input_needs_realloc = true;
545545
}
546546

547-
if (((intptr_t)(output) & (SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
547+
if (((intptr_t)(output) & (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
548548
output_needs_realloc = true;
549549
}
550550
}
551551
}
552-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
552+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
553553

554554
/* DMA cannot access memory in the iCache range, copy input to internal ram */
555555
if (!s_check_dma_capable(input)) {
@@ -1002,6 +1002,20 @@ int esp_aes_process_dma(esp_aes_context *ctx, const unsigned char *input, unsign
10021002
if (block_bytes > 0) {
10031003
/* Flush cache if input in external ram */
10041004
#if (CONFIG_SPIRAM && SOC_PSRAM_DMA_CAPABLE)
1005+
#ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
1006+
if (efuse_hal_flash_encryption_enabled()) {
1007+
if (esp_ptr_external_ram(input) || esp_ptr_external_ram(output) || esp_ptr_in_drom(input) || esp_ptr_in_drom(output)) {
1008+
if (((intptr_t)(input) & (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
1009+
input_needs_realloc = true;
1010+
}
1011+
1012+
if (((intptr_t)(output) & (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
1013+
output_needs_realloc = true;
1014+
}
1015+
}
1016+
}
1017+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
1018+
10051019
if (esp_ptr_external_ram(input)) {
10061020
if (esp_cache_msync((void *)input, len, ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_UNALIGNED) != ESP_OK) {
10071021
mbedtls_platform_zeroize(output, len);
@@ -1049,12 +1063,18 @@ int esp_aes_process_dma(esp_aes_context *ctx, const unsigned char *input, unsign
10491063
block_in_desc = block_desc;
10501064
block_out_desc = block_desc + crypto_dma_desc_num;
10511065

1066+
#if SOC_AHB_GDMA_VERSION == 2
1067+
// Limit max inlink descriptor length to be 16 byte aligned, as buffer sizes need to be 16 byte aligned
1068+
// when Flash Encryption is enabled.
1069+
dma_desc_setup_link(block_in_desc, input, block_bytes, DMA_DESCRIPTOR_BUFFER_MAX_SIZE_16B_ALIGNED, 0);
1070+
#else
10521071
// the size field has 12 bits, but 0 not for 4096.
10531072
// to avoid possible problem when the size is not word-aligned, we only use 4096-4 per desc.
10541073
// Maximum size of data in the buffer that a DMA descriptor can hold.
10551074
dma_desc_setup_link(block_in_desc, input, block_bytes, DMA_DESCRIPTOR_BUFFER_MAX_SIZE_4B_ALIGNED, 0);
1075+
#endif
10561076

1057-
//Limit max inlink descriptor length to be 16 byte aligned, require for EDMA
1077+
//Limit max outlink descriptor length to be 16 byte aligned, require for EDMA
10581078
dma_desc_setup_link(block_out_desc, output, block_bytes, DMA_DESCRIPTOR_BUFFER_MAX_SIZE_16B_ALIGNED, 0);
10591079

10601080
/* Setup in/out start descriptors */

components/mbedtls/port/crypto_shared_gdma/esp_crypto_shared_gdma.c

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -17,14 +17,16 @@
1717
#include "soc/soc_caps.h"
1818
#include "sdkconfig.h"
1919

20-
#ifdef SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
21-
#include "esp_flash_encrypt.h"
22-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
20+
#ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
21+
#include "hal/efuse_hal.h"
22+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
2323

24-
#if SOC_AHB_GDMA_VERSION == 1
25-
#include "hal/gdma_ll.h"
26-
#elif SOC_AXI_GDMA_SUPPORTED
24+
#if SOC_AXI_GDMA_SUPPORTED
2725
#include "hal/axi_dma_ll.h"
26+
#elif SOC_AHB_GDMA_VERSION == 1
27+
#include "hal/gdma_ll.h"
28+
#elif SOC_AHB_GDMA_VERSION == 2
29+
#include "hal/ahb_dma_ll.h"
2830
#endif /* SOC_AHB_GDMA_VERSION */
2931

3032
#define NEW_CHANNEL_TIMEOUT_MS 1000
@@ -89,7 +91,16 @@ static esp_err_t crypto_shared_gdma_init(void)
8991
.access_ext_mem = true, // crypto peripheral may want to access PSRAM
9092
};
9193
gdma_config_transfer(tx_channel, &transfer_cfg);
94+
95+
/* When using AHB-GDMA version 1, the max data burst size must be 0, otherwise buffers need to be aligned as well.
96+
* Whereas, in case of the other GDMA versions, the RX max burst size is default enabled, but with default burst size of 4,
97+
* but it case of Flash Encryption, the buffers can be allocated from the external memory, which requires 16 byte alignment.
98+
* Thus, we set the max data burst size to 16, similar to the TX channel.
99+
*/
100+
#if SOC_AHB_GDMA_VERSION == 1 || SOC_AXI_GDMA_SUPPORTED // IDF-14335: SOC_AXI_GDMA_SUPPORTED might not be needed here
92101
transfer_cfg.max_data_burst_size = 0;
102+
#endif
103+
93104
gdma_config_transfer(rx_channel, &transfer_cfg);
94105

95106
#ifdef SOC_AES_SUPPORTED
@@ -156,7 +167,7 @@ esp_err_t esp_crypto_shared_gdma_start(const lldesc_t *input, const lldesc_t *ou
156167

157168
/* The external memory ecc-aes access must be enabled when there exists
158169
at least one buffer in the DMA descriptors that resides in external memory. */
159-
#ifdef SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
170+
#if (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT && SOC_AXI_GDMA_SUPPORTED)
160171
static bool check_dma_descs_need_ext_mem_ecc_aes_access(const crypto_dma_desc_t *dmadesc)
161172
{
162173
crypto_dma_desc_t* desc = (crypto_dma_desc_t*) dmadesc;
@@ -168,7 +179,7 @@ static bool check_dma_descs_need_ext_mem_ecc_aes_access(const crypto_dma_desc_t
168179
}
169180
return false;
170181
}
171-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
182+
#endif /* (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT && SOC_AXI_GDMA_SUPPORTED) */
172183

173184
esp_err_t esp_crypto_shared_gdma_start_axi_ahb(const crypto_dma_desc_t *input, const crypto_dma_desc_t *output, gdma_trigger_peripheral_t peripheral)
174185
{
@@ -203,16 +214,19 @@ esp_err_t esp_crypto_shared_gdma_start_axi_ahb(const crypto_dma_desc_t *input, c
203214
/* tx channel is reset by gdma_connect(), also reset rx to ensure a known state */
204215
gdma_get_channel_id(rx_channel, &rx_ch_id);
205216

206-
#if SOC_AHB_GDMA_VERSION == 1
207-
gdma_ll_rx_reset_channel(&GDMA, rx_ch_id);
208-
#elif SOC_AXI_GDMA_SUPPORTED
217+
// IDF-14335: Use gdma_reset() instead
218+
#if SOC_AXI_GDMA_SUPPORTED
209219
axi_dma_ll_rx_reset_channel(&AXI_DMA, rx_ch_id);
210-
#endif /* SOC_AHB_GDMA_VERSION */
220+
#elif SOC_AHB_GDMA_VERSION == 1
221+
gdma_ll_rx_reset_channel(&GDMA, rx_ch_id);
222+
#elif SOC_AHB_GDMA_VERSION == 2
223+
ahb_dma_ll_rx_reset_channel(&AHB_DMA, rx_ch_id);
224+
#endif /* SOC_AXI_GDMA_SUPPORTED */
211225

212226
/* When GDMA operations are carried out using external memory with external memory encryption enabled,
213227
we need to enable AXI-DMA's AES-ECC mean access bit. */
214-
#if (SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT)
215-
if (esp_flash_encryption_enabled()) {
228+
#if (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT && SOC_AXI_GDMA_SUPPORTED)
229+
if (efuse_hal_flash_encryption_enabled()) {
216230
int tx_ch_id = 0;
217231
gdma_get_channel_id(tx_channel, &tx_ch_id);
218232

@@ -224,7 +238,7 @@ esp_err_t esp_crypto_shared_gdma_start_axi_ahb(const crypto_dma_desc_t *input, c
224238
axi_dma_ll_tx_enable_ext_mem_ecc_aes_access(&AXI_DMA, tx_ch_id, false);
225239
}
226240
}
227-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
241+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
228242

229243
gdma_start(tx_channel, (intptr_t)input);
230244
gdma_start(rx_channel, (intptr_t)output);

components/mbedtls/port/sha/core/sha.c

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
#include "esp_sha_dma_priv.h"
4444
#include "sdkconfig.h"
4545

46-
#ifdef SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
47-
#include "esp_flash_encrypt.h"
48-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
46+
#ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
47+
#include "hal/efuse_hal.h"
48+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
4949

5050
#if SOC_SHA_CRYPTO_DMA
5151
#include "hal/crypto_dma_ll.h"
@@ -154,7 +154,7 @@ static DRAM_ATTR crypto_dma_desc_t s_dma_descr_buf;
154154
static esp_err_t esp_sha_dma_process(esp_sha_type sha_type, const void *input, uint32_t ilen,
155155
const void *buf, uint32_t buf_len, bool is_first_block);
156156

157-
#ifdef SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
157+
#ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
158158
static esp_err_t esp_sha_dma_process_ext(esp_sha_type sha_type, const void *input, uint32_t ilen,
159159
const void *buf, uint32_t buf_len, bool is_first_block,
160160
bool realloc_input, bool realloc_buf)
@@ -170,7 +170,7 @@ static esp_err_t esp_sha_dma_process_ext(esp_sha_type sha_type, const void *inpu
170170

171171
if (realloc_input) {
172172
heap_caps = MALLOC_CAP_8BIT | (esp_ptr_external_ram(input) ? MALLOC_CAP_SPIRAM : MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
173-
input_copy = heap_caps_aligned_alloc(SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT, ilen, heap_caps);
173+
input_copy = heap_caps_aligned_alloc(SOC_GDMA_EXT_MEM_ENC_ALIGNMENT, ilen, heap_caps);
174174
if (input_copy == NULL) {
175175
ESP_LOGE(TAG, "Failed to allocate aligned SPIRAM memory");
176176
return ret;
@@ -183,7 +183,7 @@ static esp_err_t esp_sha_dma_process_ext(esp_sha_type sha_type, const void *inpu
183183

184184
if (realloc_buf) {
185185
heap_caps = MALLOC_CAP_8BIT | (esp_ptr_external_ram(buf) ? MALLOC_CAP_SPIRAM : MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
186-
buf_copy = heap_caps_aligned_alloc(SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT, buf_len, heap_caps);
186+
buf_copy = heap_caps_aligned_alloc(SOC_GDMA_EXT_MEM_ENC_ALIGNMENT, buf_len, heap_caps);
187187
if (buf_copy == NULL) {
188188
ESP_LOGE(TAG, "Failed to allocate aligned internal memory");
189189
return ret;
@@ -206,7 +206,7 @@ static esp_err_t esp_sha_dma_process_ext(esp_sha_type sha_type, const void *inpu
206206

207207
return ret;
208208
}
209-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
209+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
210210

211211
/* Performs SHA on multiple blocks at a time */
212212
static esp_err_t esp_sha_dma_process(esp_sha_type sha_type, const void *input, uint32_t ilen,
@@ -227,17 +227,17 @@ static esp_err_t esp_sha_dma_process(esp_sha_type sha_type, const void *input, u
227227

228228
/* When SHA-DMA operations are carried out using external memory with external memory encryption enabled,
229229
we need to make sure that the addresses and the sizes of the buffers on which the DMA operates are 16 byte-aligned. */
230-
#ifdef SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
231-
if (esp_flash_encryption_enabled()) {
230+
#ifdef SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
231+
if (efuse_hal_flash_encryption_enabled()) {
232232
if (esp_ptr_external_ram(input) || esp_ptr_external_ram(buf) || esp_ptr_in_drom(input) || esp_ptr_in_drom(buf)) {
233233
bool input_needs_realloc = false;
234234
bool buf_needs_realloc = false;
235235

236-
if (ilen && ((intptr_t)(input) & (SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
236+
if (ilen && ((intptr_t)(input) & (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
237237
input_needs_realloc = true;
238238
}
239239

240-
if (buf_len && ((intptr_t)(buf) & (SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
240+
if (buf_len && ((intptr_t)(buf) & (SOC_GDMA_EXT_MEM_ENC_ALIGNMENT - 1)) != 0) {
241241
buf_needs_realloc = true;
242242
}
243243

@@ -246,7 +246,7 @@ static esp_err_t esp_sha_dma_process(esp_sha_type sha_type, const void *input, u
246246
}
247247
}
248248
}
249-
#endif /* SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT */
249+
#endif /* SOC_GDMA_EXT_MEM_ENC_ALIGNMENT */
250250

251251
/* DMA descriptor for Memory to DMA-SHA transfer */
252252
if (ilen) {
@@ -273,6 +273,19 @@ static esp_err_t esp_sha_dma_process(esp_sha_type sha_type, const void *input, u
273273
s_dma_descr_buf.next = (&s_dma_descr_input);
274274
}
275275

276+
/* Write back buffers to memory if they are in external RAM
277+
* The writeback needs to be performed in esp_sha_dma_process() instead of esp_sha_dma() to make
278+
* sure that if the buffers are reallocated, then the writeback is performed on the new buffers.
279+
*/
280+
#if (CONFIG_SPIRAM && SOC_PSRAM_DMA_CAPABLE)
281+
if (esp_ptr_external_ram(input)) {
282+
esp_cache_msync((void *)input, ilen, ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_UNALIGNED);
283+
}
284+
if (esp_ptr_external_ram(buf)) {
285+
esp_cache_msync((void *)buf, buf_len, ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_UNALIGNED);
286+
}
287+
#endif
288+
276289
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
277290
if (ilen) {
278291
ESP_ERROR_CHECK(esp_cache_msync(&s_dma_descr_input, sizeof(crypto_dma_desc_t), ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_UNALIGNED));
@@ -317,15 +330,6 @@ int esp_sha_dma(esp_sha_type sha_type, const void *input, uint32_t ilen,
317330
return 0;
318331
}
319332

320-
#if (CONFIG_SPIRAM && SOC_PSRAM_DMA_CAPABLE)
321-
if (esp_ptr_external_ram(input)) {
322-
esp_cache_msync((void *)input, ilen, ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_UNALIGNED);
323-
}
324-
if (esp_ptr_external_ram(buf)) {
325-
esp_cache_msync((void *)buf, buf_len, ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_UNALIGNED);
326-
}
327-
#endif
328-
329333
/* Copy to internal buf if buf is in non DMA capable memory */
330334
if (!s_check_dma_capable(buf) && (buf_len != 0)) {
331335
dma_cap_buf = heap_caps_malloc(sizeof(unsigned char) * buf_len, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);

components/soc/esp32c5/include/soc/Kconfig.soc_caps.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ config SOC_AHB_GDMA_SUPPORT_PSRAM
519519
bool
520520
default y
521521

522+
config SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
523+
int
524+
default 16
525+
522526
config SOC_ETM_GROUPS
523527
int
524528
default 1

components/soc/esp32c5/include/soc/soc_caps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
#define SOC_GDMA_SUPPORT_ETM 1
197197
#define SOC_GDMA_SUPPORT_SLEEP_RETENTION 1
198198
#define SOC_AHB_GDMA_SUPPORT_PSRAM 1
199+
#define SOC_GDMA_EXT_MEM_ENC_ALIGNMENT (16)
199200

200201
/*-------------------------- ETM CAPS --------------------------------------*/
201202
#define SOC_ETM_GROUPS 1U // Number of ETM groups

components/soc/esp32c61/include/soc/Kconfig.soc_caps.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,10 @@ config SOC_AHB_GDMA_SUPPORT_PSRAM
399399
bool
400400
default y
401401

402+
config SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
403+
int
404+
default 16
405+
402406
config SOC_ETM_GROUPS
403407
int
404408
default 1

components/soc/esp32c61/include/soc/soc_caps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
#define SOC_GDMA_SUPPORT_ETM 1 // Support ETM submodule
154154
#define SOC_GDMA_SUPPORT_SLEEP_RETENTION 1
155155
#define SOC_AHB_GDMA_SUPPORT_PSRAM 1
156+
#define SOC_GDMA_EXT_MEM_ENC_ALIGNMENT (16)
156157

157158
/*-------------------------- ETM CAPS --------------------------------------*/
158159
#define SOC_ETM_GROUPS 1U // Number of ETM groups

components/soc/esp32p4/include/soc/Kconfig.soc_caps.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ config SOC_GDMA_SUPPORT_SLEEP_RETENTION
623623
bool
624624
default y
625625

626-
config SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT
626+
config SOC_GDMA_EXT_MEM_ENC_ALIGNMENT
627627
int
628628
default 16
629629

components/soc/esp32p4/include/soc/soc_caps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
#define SOC_AXI_GDMA_SUPPORT_PSRAM 1
223223
#define SOC_GDMA_SUPPORT_ETM 1
224224
#define SOC_GDMA_SUPPORT_SLEEP_RETENTION 1
225-
#define SOC_AXI_DMA_EXT_MEM_ENC_ALIGNMENT (16)
225+
#define SOC_GDMA_EXT_MEM_ENC_ALIGNMENT (16)
226226

227227
/*-------------------------- 2D-DMA CAPS -------------------------------------*/
228228
#define SOC_DMA2D_GROUPS (1U) // Number of 2D-DMA groups

0 commit comments

Comments
 (0)