Skip to content

Commit 7f10bd6

Browse files
FRASTMcarlescufi
authored andcommitted
drivers: flash: stm32 qspi driver setting dma priority
This adds a table to set the dma channel priority from the DTS The config bits are converted through the table_priority to match the DMA_Priority_level of the stm32cube HAL. Fixes #46725 Signed-off-by: Francois Ramu <[email protected]>
1 parent 7084b5c commit 7f10bd6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/flash/flash_stm32_qspi.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ uint32_t table_p_size[] = {
6060
LL_DMA_PDATAALIGN_WORD,
6161
};
6262

63+
/* Lookup table to set dma priority from the DTS */
64+
uint32_t table_priority[] = {
65+
DMA_PRIORITY_LOW,
66+
DMA_PRIORITY_MEDIUM,
67+
DMA_PRIORITY_HIGH,
68+
DMA_PRIORITY_VERY_HIGH,
69+
};
70+
6371
typedef void (*irq_config_func_t)(const struct device *dev);
6472

6573
struct stream {
@@ -1103,7 +1111,7 @@ static int flash_stm32_qspi_init(const struct device *dev)
11031111
hdma.Init.PeriphInc = DMA_PINC_DISABLE;
11041112
hdma.Init.MemInc = DMA_MINC_ENABLE;
11051113
hdma.Init.Mode = DMA_NORMAL;
1106-
hdma.Init.Priority = dma_cfg.channel_priority;
1114+
hdma.Init.Priority = table_priority[dma_cfg.channel_priority];
11071115
#ifdef CONFIG_DMA_STM32_V1
11081116
/* TODO: Not tested in this configuration */
11091117
hdma.Init.Channel = dma_cfg.dma_slot;

0 commit comments

Comments
 (0)