Skip to content

Commit

Permalink
drivers: spi: add npcm spip driver
Browse files Browse the repository at this point in the history
add npcm spip driver.

test SPI-Flash w25q256jv DUAL(BBh)/QUAD(EBh) with 3-bytes-addr ok.

note: DUAL READ(BBh) 1-2-2 (cmd-addr-data)
      QUAD READ(EBh) 1-4-4 (cmd-addr-data)

Signed-off-by: James Chiang <[email protected]>
  • Loading branch information
James Chiang committed Sep 4, 2024
1 parent 0d9474a commit 7d00739
Show file tree
Hide file tree
Showing 10 changed files with 479 additions and 11 deletions.
6 changes: 6 additions & 0 deletions boards/nuvoton/npcm400_evb/npcm400_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@
pinctrl-names = "default";
};

&spip0 {
pinctrl-0 = <&pspi1_clk_io0_io1_io2_io3_cs_gp66_67_70_73_76_77>;
pinctrl-names = "default";
status = "okay";
};

&qspi_fiu0 {
ext_flash: w25q256jv@0 {
compatible ="nuvoton,npcm-nor";
Expand Down
5 changes: 5 additions & 0 deletions boards/nuvoton/npcm400_evb/npcm400_evb_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ CONFIG_FLASH_NPCM_NOR=y
CONFIG_FLASH_NPCM_SPIM_QSPI=y
CONFIG_FLASH_NPCM_FIU_QSPI=y

# SPI Driver
CONFIG_SPI=y
CONFIG_SPI_SHELL=y
CONFIG_SPI_NPCM_SPIP=y

# Watchdog Driver
CONFIG_WATCHDOG=y
CONFIG_WDT_NPCM=y
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ zephyr_library_sources_ifdef(CONFIG_USERSPACE spi_handlers.c)
zephyr_library_sources_ifdef(CONFIG_SPI_INFINEON_CAT1 spi_ifx_cat1.c)
zephyr_library_sources_ifdef(CONFIG_SPI_SEDI spi_sedi.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NPCX_SPIP spi_npcx_spip.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NPCM_SPIP spi_npcm_spip.c)
zephyr_library_sources_ifdef(CONFIG_SPI_GRLIB_SPIMCTRL spi_grlib_spimctrl.c)
2 changes: 2 additions & 0 deletions drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ source "drivers/spi/Kconfig.sedi"

source "drivers/spi/Kconfig.npcx"

source "drivers/spi/Kconfig.npcm"

source "drivers/spi/Kconfig.mchp_mss"

source "drivers/spi/Kconfig.grlib_spimctrl"
Expand Down
11 changes: 11 additions & 0 deletions drivers/spi/Kconfig.npcm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Nuvoton NPCM SPI Driver configuration options

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

menuconfig SPI_NPCM_SPIP
bool "Nuvoton NPCM Enhanced Super I/O (eSIO) SPI driver"
default y
depends on DT_HAS_NUVOTON_NPCM_SPIP_ENABLED
help
Enable the SPI peripherals on NPCM MCU.
Loading

0 comments on commit 7d00739

Please sign in to comment.