spi: sophgo: milkv_duo: Add spi nor flash support for Milk-V Duo board
cover spi: sophgo: milkv_duo: Add spi nor flash support for Milk-V Duo board
This series add spi nor flash controller driver for cv1800b SoC and enable it for Sophgo Milk-V Duo board.
Kongyang Liu (3):
spi: cv1800b: Add spi nor flash controller driver for cv1800b SoC
riscv: dts: sophgo: Add spi nor flash controller node
configs: milkv_duo: Add spi nor configs
arch/riscv/dts/cv1800b-milkv-duo.dts | 13 ++ arch/riscv/dts/cv18xx.dtsi | 17 ++ configs/milkv_duo_defconfig | 3 + drivers/spi/Kconfig | 8 + drivers/spi/Makefile | 1 + drivers/spi/cv1800b_spif.c | 321 +++++++++++++++++++++++++++ 6 files changed, 363 insertions(+) create mode 100644 drivers/spi/cv1800b_spif.c
Signature · 1 line
2.41.0
PATCH 1/3 spi: cv1800b: Add spi nor flash controller driver for cv1800b SoC
Add spi nor flash controller driver for cv1800b SoC
---
drivers/spi/Kconfig | 8 + drivers/spi/Makefile | 1 + drivers/spi/cv1800b_spif.c | 321 +++++++++++++++++++++++++++++++++++++ 3 files changed, 330 insertions(+) create mode 100644 drivers/spi/cv1800b_spif.c
drivers/spi/Kconfig +8 -0
@@ -168,6 +168,14 @@ config CF_SPI Enable the ColdFire SPI driver. This driver can be used on some m68k SoCs. +config CV1800B_SPIF + bool "Sophgo cv1800b SPI Flash Controller driver" + depends on SPI_MEM + help + Enable the Sophgo cv1800b SPI Flash Controller driver. This driver + can be used to access the SPI NOR flash on platforms embedding this + Sophgo cv1800b IP core. + config DAVINCI_SPI bool "Davinci & Keystone SPI driver" depends on ARCH_DAVINCI || ARCH_KEYSTONE
drivers/spi/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_BCM63XX_SPI) += bcm63xx_spi.o obj-$(CONFIG_BCMSTB_SPI) += bcmstb_spi.o obj-$(CONFIG_CF_SPI) += cf_spi.o obj-$(CONFIG_CORTINA_SFLASH) += ca_sflash.o +obj-$(CONFIG_CV1800B_SPIF) += cv1800b_spif.o obj-$(CONFIG_DAVINCI_SPI) += davinci_spi.o obj-$(CONFIG_DESIGNWARE_SPI) += designware_spi.o obj-$(CONFIG_EXYNOS_SPI) += exynos_spi.o
drivers/spi/cv1800b_spif.c new file +321 -0
321 lines not on this page · raw message
Signature · 1 line
2.41.0
Re: [PATCH 1/3] spi: cv1800b: Add spi nor flash controller driver for cv1800b SoC
Quoted 10 lines · Kongyang Liu
Add spi nor flash controller driver for cv1800b SoC
Signed-off-by Kongyang Liu <[email protected]>---
drivers/spi/Kconfig | 8 + drivers/spi/Makefile | 1 + drivers/spi/cv1800b_spif.c | 321 +++++++++++++++++++++++++++++++++++++ 3 files changed, 330 insertions(+) create mode 100644 drivers/spi/cv1800b_spif.c
PATCH 2/3 riscv: dts: sophgo: Add spi nor flash controller node
In reply to Kongyang LiuAdd spi nor flash controller node for cv18xx SoCs
---
arch/riscv/dts/cv1800b-milkv-duo.dts | 13 +++++++++++++ arch/riscv/dts/cv18xx.dtsi | 17 +++++++++++++++++ 2 files changed, 30 insertions(+)
arch/riscv/dts/cv1800b-milkv-duo.dts +13 -0
@@ -41,6 +41,19 @@ no-sdio; }; +&spif { + status = "okay"; + + spiflash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <75000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + m25p,fast-read; + }; +} + &uart0 { status = "okay"; };
arch/riscv/dts/cv18xx.dtsi +17 -0
@@ -52,6 +52,13 @@ #clock-cells = <0>; }; + spif_clk: spi-flash-clock { + compatible = "fixed-clock"; + clock-frequency = <300000000>; + clock-output-names = "spif_clk"; + #clock-cells = <0>; + }; + soc { compatible = "simple-bus"; interrupt-parent = <&plic>;
@@ -197,6 +204,16 @@ status = "disabled"; }; + spif: spi-nor@10000000 { + compatible = "sophgo,cv1800b-spif"; + reg = <0x10000000 0x10000000>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&spif_clk>; + interrupts = <95 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + plic: interrupt-controller@70000000 { reg = <0x70000000 0x4000000>; interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>;
Signature · 1 line
2.41.0
Re: [PATCH 2/3] riscv: dts: sophgo: Add spi nor flash controller node
Quoted 8 lines · Kongyang Liu
Add spi nor flash controller node for cv18xx SoCs
Signed-off-by Kongyang Liu <[email protected]>---
arch/riscv/dts/cv1800b-milkv-duo.dts | 13 +++++++++++++ arch/riscv/dts/cv18xx.dtsi | 17 +++++++++++++++++ 2 files changed, 30 insertions(+)
PATCH 3/3 configs: milkv_duo: Add spi nor configs
In reply to Kongyang LiuAdd configs related to spi nor flash for Sophgo Milk-V Duo board
---
configs/milkv_duo_defconfig | 3 +++ 1 file changed, 3 insertions(+)
configs/milkv_duo_defconfig +3 -0
@@ -28,5 +28,8 @@ CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ADMA=y CONFIG_MMC_SDHCI_CV1800B=y +CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SYS_NS16550=y CONFIG_SYS_NS16550_MEM32=y +CONFIG_SPI=y +CONFIG_CV1800B_SPIF=y
Signature · 1 line
2.41.0
Re: [PATCH 3/3] configs: milkv_duo: Add spi nor configs
Quoted 7 lines · Kongyang Liu
Add configs related to spi nor flash for Sophgo Milk-V Duo board
Signed-off-by Kongyang Liu <[email protected]>---
configs/milkv_duo_defconfig | 3 +++ 1 file changed, 3 insertions(+)