mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Merge branch 'refactor/gdma_set_iram_safe_in_runtime_v5.4' into 'release/v5.4'
refactor(gdma): use run-time iram-safe config (v5.4) See merge request espressif/esp-idf!38459
This commit is contained in:
@@ -26,6 +26,7 @@ menu "ESP-Driver:SPI Configurations"
|
||||
select HAL_SPI_MASTER_FUNC_IN_IRAM
|
||||
select ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM
|
||||
select GDMA_CTRL_FUNC_IN_IRAM if SOC_GDMA_SUPPORTED
|
||||
select GDMA_ISR_HANDLER_IN_IRAM if SOC_GDMA_SUPPORTED
|
||||
help
|
||||
Place the SPI master ISR in to IRAM to avoid possible cache miss.
|
||||
|
||||
@@ -54,6 +55,7 @@ menu "ESP-Driver:SPI Configurations"
|
||||
default y
|
||||
select HAL_SPI_SLAVE_FUNC_IN_IRAM
|
||||
select GDMA_CTRL_FUNC_IN_IRAM if SOC_GDMA_SUPPORTED
|
||||
select GDMA_ISR_HANDLER_IN_IRAM if SOC_GDMA_SUPPORTED
|
||||
help
|
||||
Place the SPI slave ISR in to IRAM to avoid possible cache miss.
|
||||
|
||||
|
||||
@@ -222,6 +222,9 @@ static esp_err_t alloc_dma_chan(spi_host_device_t host_id, spi_dma_chan_t dma_ch
|
||||
if (dma_chan == SPI_DMA_CH_AUTO) {
|
||||
gdma_channel_alloc_config_t tx_alloc_config = {
|
||||
.flags.reserve_sibling = 1,
|
||||
#if CONFIG_SPI_MASTER_ISR_IN_IRAM
|
||||
.flags.isr_cache_safe = true,
|
||||
#endif
|
||||
.direction = GDMA_CHANNEL_DIRECTION_TX,
|
||||
};
|
||||
ESP_RETURN_ON_ERROR(SPI_GDMA_NEW_CHANNEL(&tx_alloc_config, &dma_ctx->tx_dma_chan), SPI_TAG, "alloc gdma tx failed");
|
||||
@@ -229,6 +232,9 @@ static esp_err_t alloc_dma_chan(spi_host_device_t host_id, spi_dma_chan_t dma_ch
|
||||
gdma_channel_alloc_config_t rx_alloc_config = {
|
||||
.direction = GDMA_CHANNEL_DIRECTION_RX,
|
||||
.sibling_chan = dma_ctx->tx_dma_chan,
|
||||
#if CONFIG_SPI_MASTER_ISR_IN_IRAM
|
||||
.flags.isr_cache_safe = true,
|
||||
#endif
|
||||
};
|
||||
ESP_RETURN_ON_ERROR(SPI_GDMA_NEW_CHANNEL(&rx_alloc_config, &dma_ctx->rx_dma_chan), SPI_TAG, "alloc gdma rx failed");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user