Skip to content

Commit 9d94e4c

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 9d94e4c

File tree

15 files changed

+1954
-0
lines changed

15 files changed

+1954
-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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) 2022 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_PAGE_LAYOUT
8+
depends on SPI
9+
10+
if SPI_NAND
11+
12+
config SPI_NAND_INIT_PRIORITY
13+
int
14+
default 80
15+
help
16+
Device driver initialization priority.
17+
Device is connected to SPI bus, it has to
18+
be initialized after SPI driver.
19+
20+
config SPI_NAND_CS_WAIT_DELAY
21+
int "Delay time in us"
22+
default 0
23+
help
24+
This is the wait delay (in us) to allow for CS switching to take effect
25+
26+
config SPI_NAND_IDLE_IN_DPD
27+
bool "Use Deep Power-Down mode when flash is not being accessed."
28+
help
29+
Where supported deep power-down mode can reduce current draw
30+
to as little as 0.1% of standby current. However it takes
31+
some milliseconds to enter and exit from this mode.
32+
33+
Select this option for applications where device power
34+
management is not enabled, the flash remains inactive for
35+
long periods, and when used the impact of waiting for mode
36+
enter and exit delays is acceptable.
37+
38+
endif # SPI_NAND

0 commit comments

Comments
 (0)