Skip to content

Commit 802ff9d

Browse files
ananglmasz-nordic
authored andcommitted
[nrf fromlist] drivers: flash: Add generic NOR flash driver for MSPI devices
Add a flash driver intended to handle various flash devices connected over MSPI bus as long as they support JEDEC SFDP. This is an initial commit providing only basic operations in Octal I/O mode with some hard-coded values for Macronix MX25Ux series chips. Upstream PR #: 80042 Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 20ca841 commit 802ff9d

File tree

4 files changed

+713
-0
lines changed

4 files changed

+713
-0
lines changed

drivers/flash/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ zephyr_library_sources_ifdef(CONFIG_FLASH_MCUX_FLEXSPI_MX25UM51345G flash_mcux_f
3434
zephyr_library_sources_ifdef(CONFIG_FLASH_MCUX_FLEXSPI_NOR flash_mcux_flexspi_nor.c)
3535
zephyr_library_sources_ifdef(CONFIG_FLASH_MSPI_ATXP032 flash_mspi_atxp032.c)
3636
zephyr_library_sources_ifdef(CONFIG_FLASH_MSPI_EMUL_DEVICE flash_mspi_emul_device.c)
37+
zephyr_library_sources_ifdef(CONFIG_FLASH_MSPI_NOR flash_mspi_nor.c)
3738
zephyr_library_sources_ifdef(CONFIG_FLASH_NPCX_FIU_NOR flash_npcx_fiu_nor.c)
3839
zephyr_library_sources_ifdef(CONFIG_FLASH_NPCX_FIU_QSPI flash_npcx_fiu_qspi.c)
3940
zephyr_library_sources_ifdef(CONFIG_FLASH_RPI_PICO flash_rpi_pico.c)

drivers/flash/Kconfig.mspi

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,34 @@ config FLASH_MSPI_ATXP032
2828
select FLASH_JESD216
2929
select MSPI_AMBIQ_AP3 if SOC_SERIES_APOLLO3X
3030

31+
menuconfig FLASH_MSPI_NOR
32+
bool "Generic MSPI NOR Flash"
33+
default y
34+
depends on DT_HAS_JEDEC_MSPI_NOR_ENABLED
35+
select FLASH_MSPI
36+
select FLASH_HAS_EXPLICIT_ERASE
37+
select FLASH_JESD216
38+
select GPIO if $(dt_compat_any_has_prop,$(DT_COMPAT_JEDEC_MSPI_NOR),reset-gpios)
39+
40+
if FLASH_MSPI_NOR
41+
42+
config FLASH_MSPI_NOR_INIT_PRIORITY
43+
int
44+
default 80
45+
help
46+
Device driver initialization priority.
47+
Device is connected to MSPI bus, it has to
48+
be initialized after MSPI driver.
49+
50+
config FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE
51+
int "Page size to use for FLASH_LAYOUT feature"
52+
default 65536
53+
help
54+
When CONFIG_FLASH_PAGE_LAYOUT is used this driver will support that
55+
API. By default the page size corresponds to the block size (65536).
56+
Other options include the 32K-byte erase size (32768), the sector
57+
size (4096), or any non-zero multiple of the sector size.
58+
59+
endif # FLASH_MSPI_NOR
60+
3161
endmenu

0 commit comments

Comments
 (0)