Skip to content

Commit

Permalink
driver: flash: npcx: introduce npcx flash driver
Browse files Browse the repository at this point in the history
This CL attempts to implement npcx's flash driver instead of the
original one (npcx spi driver plus spi_nor flash driver).

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
  • Loading branch information
MulinChao committed Jul 10, 2023
1 parent 778053f commit d944b96
Show file tree
Hide file tree
Showing 24 changed files with 1,244 additions and 251 deletions.
2 changes: 2 additions & 0 deletions drivers/flash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_SAM flash_sam.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NIOS2_QSPI soc_flash_nios2_qspi.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_GECKO flash_gecko.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_RV32M1 soc_flash_rv32m1.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_NPCX_FIU_QSPI flash_npcx_fiu_qspi.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_NPCX_FIU_NOR flash_npcx_fiu_nor.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_STM32_QSPI flash_stm32_qspi.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_STM32_OSPI flash_stm32_ospi.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_MCUX_FLEXSPI_MX25UM51345G flash_mcux_flexspi_mx25um51345g.c)
Expand Down
2 changes: 2 additions & 0 deletions drivers/flash/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ source "drivers/flash/Kconfig.mcux"

source "drivers/flash/Kconfig.nios2_qspi"

source "drivers/flash/Kconfig.npcx_fiu"

source "drivers/flash/Kconfig.gecko"

source "drivers/flash/Kconfig.nor"
Expand Down
34 changes: 34 additions & 0 deletions drivers/flash/Kconfig.npcx_fiu
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# NPCX Flash driver configuration options

# Copyright (c) 2023 Nuvoton Technology Corporation.
# SPDX-License-Identifier: Apache-2.0

config FLASH_NPCX_FIU_QSPI
bool "Nuvoton NPCX QSPI Bus Flash driver"
default y
depends on DT_HAS_NUVOTON_NPCX_FIU_QSPI_ENABLED
help
This option enables the QSPI Bus Flash driver for NPCX family of
processors.

config FLASH_NPCX_FIU_NOR
bool "Nuvoton NPCX embedded controller (EC) QSPI NOR Flash driver"
default y
depends on DT_HAS_NUVOTON_NPCX_FIU_NOR_ENABLED
depends on FLASH_NPCX_FIU_QSPI
select FLASH_HAS_DRIVER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_JESD216
select FLASH_HAS_EX_OP
help
This option enables the QSPI NOR Flash driver for NPCX family of
processors.

config FLASH_NPCX_FIU_NOR_INIT
bool "QSPI NOR flash feature during driver initialization"
default y
depends on FLASH_NPCX_FIU_NOR
help
This option enables the QSPI NOR Flash features such as Quad-Enable,
4-byte address support and so on during driver initialization. Disable
it if QSPI NOR devices are not ready during driver initialization.

0 comments on commit d944b96

Please sign in to comment.