Skip to content

Commit 04e8854

Browse files
committed
drivers: Flash: Add SPI NAND Flash driver support
Add SPI NAND Flash driver support Signed-off-by: Daniel Zhang <danielzhang@mxic.com.cn>
1 parent 9211abc commit 04e8854

File tree

15 files changed

+2034
-0
lines changed

15 files changed

+2034
-0
lines changed

drivers/flash/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_SMARTBOND flash_smartbond.c)
6363
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_TELINK_B91 soc_flash_b91.c)
6464
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_XMC4XXX soc_flash_xmc4xxx.c)
6565
zephyr_library_sources_ifdef(CONFIG_SPI_FLASH_AT45 spi_flash_at45.c)
66+
zephyr_library_sources_ifdef(CONFIG_SPI_NAND bch.c)
67+
zephyr_library_sources_ifdef(CONFIG_SPI_NAND spi_nand.c)
6668
zephyr_library_sources_ifdef(CONFIG_SPI_NOR spi_nor.c)
6769
# zephyr-keep-sorted-stop
6870

drivers/flash/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ source "drivers/flash/Kconfig.lpc"
180180
source "drivers/flash/Kconfig.max32"
181181
source "drivers/flash/Kconfig.mcux"
182182
source "drivers/flash/Kconfig.mspi"
183+
source "drivers/flash/Kconfig.nand"
183184
source "drivers/flash/Kconfig.nios2_qspi"
184185
source "drivers/flash/Kconfig.nor"
185186
source "drivers/flash/Kconfig.nordic_qspi_nor"

drivers/flash/Kconfig.nand

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2022-2025 Macronix International Co., Ltd.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
menuconfig SPI_NAND
5+
bool "SPI NAND Flash"
6+
select FLASH_HAS_DRIVER_ENABLED
7+
select FLASH_HAS_EXPLICIT_ERASE
8+
select FLASH_HAS_PAGE_LAYOUT
9+
depends on SPI
10+
11+
if SPI_NAND
12+
13+
config SPI_NAND_INIT_PRIORITY
14+
int
15+
default 80
16+
help
17+
Device driver initialization priority.
18+
Device is connected to SPI bus, it has to
19+
be initialized after SPI driver.
20+
21+
endif # SPI_NAND

0 commit comments

Comments
 (0)