mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(dma2d,ppa): Support flash encryption for DMA2D and PPA
This commit is contained in:
@@ -173,6 +173,9 @@ static bool dma2d_job_picked_cb(uint32_t num_chans, const dma2d_trans_channel_in
|
||||
};
|
||||
dma2d_register_rx_event_callbacks(rx_chan, &dma_cbs, mcp);
|
||||
|
||||
// 2D-DMA channel data burst length is set to the maximum burst length by default, which meets the encryption alignment restriction
|
||||
// so even if flash encryption is enabled, it can work properly
|
||||
|
||||
dma2d_set_desc_addr(tx_chan, (intptr_t)(mcp->tx_desc));
|
||||
dma2d_set_desc_addr(rx_chan, (intptr_t)(mcp->rx_desc));
|
||||
|
||||
|
||||
@@ -178,9 +178,9 @@ TEST_CASE("MIPI DSI use DMA2D (EK79007)", "[mipi_dsi]")
|
||||
|
||||
uint8_t *img = NULL;
|
||||
size_t buffer_alignment = 1;
|
||||
// If flash encryption is enabled, the buffer address and size must be aligned to SOC_GDMA_EXT_MEM_ENC_ALIGNMENT.
|
||||
// If flash encryption is enabled, the buffer address and size must be aligned to SOC_MEMSPI_ENCRYPTION_ALIGNMENT.
|
||||
if (esp_efuse_is_flash_encryption_enabled()) {
|
||||
buffer_alignment = SOC_GDMA_EXT_MEM_ENC_ALIGNMENT;
|
||||
buffer_alignment = SOC_MEMSPI_ENCRYPTION_ALIGNMENT;
|
||||
}
|
||||
img = heap_caps_aligned_calloc(buffer_alignment, 1, TEST_IMG_SIZE, MALLOC_CAP_DMA | MALLOC_CAP_SPIRAM);
|
||||
|
||||
@@ -249,12 +249,12 @@ TEST_CASE("MIPI DSI use DMA2D (EK79007)", "[mipi_dsi]")
|
||||
size_t start_alignment = 1;
|
||||
size_t src_x_start = 50;
|
||||
size_t src_y_start = 50;
|
||||
// If flash encryption is enabled, the buffer address and size must be aligned to SOC_GDMA_EXT_MEM_ENC_ALIGNMENT.
|
||||
// If flash encryption is enabled, the buffer address and size must be aligned to SOC_MEMSPI_ENCRYPTION_ALIGNMENT.
|
||||
if (esp_efuse_is_flash_encryption_enabled()) {
|
||||
test_block_size = ALIGN_DOWN(test_block_size, SOC_GDMA_EXT_MEM_ENC_ALIGNMENT);
|
||||
start_alignment = SOC_GDMA_EXT_MEM_ENC_ALIGNMENT;
|
||||
src_x_start = ALIGN_DOWN(src_x_start, SOC_GDMA_EXT_MEM_ENC_ALIGNMENT);
|
||||
src_y_start = ALIGN_DOWN(src_y_start, SOC_GDMA_EXT_MEM_ENC_ALIGNMENT);
|
||||
test_block_size = ALIGN_DOWN(test_block_size, SOC_MEMSPI_ENCRYPTION_ALIGNMENT);
|
||||
start_alignment = SOC_MEMSPI_ENCRYPTION_ALIGNMENT;
|
||||
src_x_start = ALIGN_DOWN(src_x_start, SOC_MEMSPI_ENCRYPTION_ALIGNMENT);
|
||||
src_y_start = ALIGN_DOWN(src_y_start, SOC_MEMSPI_ENCRYPTION_ALIGNMENT);
|
||||
}
|
||||
|
||||
printf("Add Built-in DMA2D draw bitmap hook\r\n");
|
||||
|
||||
Reference in New Issue
Block a user