Skip to content

Commit 4c519da

Browse files
committed
drivers: mspi: Support MSPI driver for STM32
This commit introduces support for the mspi and ospi drivers on STM32, enabling functionality APIs for MSPI/OSPI host controllers.. Signed-off-by: Sara Touqan <[email protected]> Signed-off-by: Sarah Younis <[email protected]> Signed-off-by: Mohammad Odeh <[email protected]>
1 parent 253f367 commit 4c519da

File tree

8 files changed

+4346
-0
lines changed

8 files changed

+4346
-0
lines changed

drivers/mspi/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ zephyr_library_sources_ifdef(CONFIG_MSPI_AMBIQ_AP5 mspi_ambiq_ap5.c)
88
zephyr_library_sources_ifdef(CONFIG_MSPI_AMBIQ_TIMING_SCAN mspi_ambiq_timing_scan.c)
99
zephyr_library_sources_ifdef(CONFIG_MSPI_DW mspi_dw.c)
1010
zephyr_library_sources_ifdef(CONFIG_MSPI_EMUL mspi_emul.c)
11+
zephyr_library_sources_ifdef(CONFIG_MSPI_STM32 mspi_stm32.c)
12+
zephyr_library_sources_ifdef(CONFIG_OSPI_STM32 ospi_stm32.c)
13+
zephyr_library_sources_ifdef(CONFIG_MSPI_STM32_QSPI mspi_stm32_qspi.c)

drivers/mspi/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,7 @@ source "subsys/logging/Kconfig.template.log_config"
6262
source "drivers/mspi/Kconfig.ambiq"
6363
source "drivers/mspi/Kconfig.dw"
6464
source "drivers/mspi/Kconfig.mspi_emul"
65+
source "drivers/mspi/Kconfig.stm32"
66+
source "drivers/mspi/Kconfig.stm32_ospi"
6567

6668
endif # MSPI

drivers/mspi/Kconfig.stm32

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# STM32 MSPI flash driver configuration options
2+
3+
# Copyright (c) 2025 STMicroelectronics
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config MSPI_STM32
7+
bool "STM32 XSPI Controller driver"
8+
depends on DT_HAS_ST_STM32_MSPI_CONTROLLER_ENABLED
9+
select USE_STM32_HAL_XSPI
10+
select USE_STM32_LL_DLYB
11+
imply MSPI_XIP
12+
default y
13+
help
14+
Enable driver for STM32 family of processors.
15+
16+
config MSPI_STM32_QSPI
17+
bool "STM32 QSPI Controller driver"
18+
default y
19+
depends on DT_HAS_ST_STM32_QSPI_CONTROLLER_ENABLED
20+
select USE_STM32_HAL_QSPI
21+
select USE_STM32_HAL_MDMA
22+
imply MSPI_XIP
23+
help
24+
Enable QSPI driver for STM32 family of processors.

drivers/mspi/Kconfig.stm32_ospi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# STM32 Octo SPI flash driver configuration options
2+
3+
# Copyright (c) 2022 STMicroelectronics
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
DT_STM32_OCTOSPI_HAS_DMA := $(dt_compat_any_has_prop,$(DT_COMPAT_ST_STM32_OSPI),dmas)
7+
8+
config OSPI_STM32
9+
bool "STM32 OSPI Controller driver"
10+
default y
11+
depends on DT_HAS_ST_STM32_OSPI_CONTROLLER_ENABLED
12+
select USE_STM32_HAL_OSPI if !SOC_SERIES_STM32H5X
13+
select USE_STM32_LL_DLYB if (SOC_SERIES_STM32H5X || SOC_SERIES_STM32U5X)
14+
select USE_STM32_HAL_MDMA if SOC_SERIES_STM32H7X
15+
select DMA
16+
select USE_STM32_HAL_DMA
17+
select USE_STM32_HAL_DMA_EX
18+
help
19+
Enable OSPI driver for STM32 family of processors.

0 commit comments

Comments
 (0)