Skip to content

Commit ef3232e

Browse files
committed
Nuvoton WPCM450 FIU SPI flash controller
Merge series from Jonathan Neuschäfer <j.neuschaefer@gmx.net>: This patchset adds DT bindings and a driver for the Flash Interface Unit (FIU), the SPI flash controller in the Nuvoton WPCM450 BMC SoC. It supports four chip selects, and direct (memory-mapped) access to 16 MiB per chip. Larger flash chips can be accessed by software-defined SPI transfers. The existing NPCM7xx FIU driver is sufficitently incompatible with the WPCM450 FIU that I decided to write a new driver.
2 parents 9c512e4 + dd71cd4 commit ef3232e

4 files changed

Lines changed: 586 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/spi/nuvoton,wpcm450-fiu.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Nuvoton WPCM450 Flash Interface Unit (FIU)
8+
9+
maintainers:
10+
- Jonathan Neuschäfer <j.neuschaefer@gmx.net>
11+
12+
allOf:
13+
- $ref: /schemas/spi/spi-controller.yaml#
14+
15+
properties:
16+
compatible:
17+
const: nuvoton,wpcm450-fiu
18+
19+
reg:
20+
items:
21+
- description: FIU registers
22+
- description: Memory-mapped flash contents
23+
24+
reg-names:
25+
items:
26+
- const: control
27+
- const: memory
28+
29+
interrupts:
30+
maxItems: 1
31+
32+
clocks:
33+
maxItems: 1
34+
35+
nuvoton,shm:
36+
$ref: /schemas/types.yaml#/definitions/phandle
37+
description: a phandle to the SHM block (see ../arm/nuvoton,shm.yaml)
38+
39+
required:
40+
- compatible
41+
- reg
42+
- clocks
43+
44+
unevaluatedProperties: false
45+
46+
examples:
47+
- |
48+
#include <dt-bindings/clock/nuvoton,wpcm450-clk.h>
49+
spi@c8000000 {
50+
compatible = "nuvoton,wpcm450-fiu";
51+
reg = <0xc8000000 0x1000>, <0xc0000000 0x4000000>;
52+
#address-cells = <1>;
53+
#size-cells = <0>;
54+
reg-names = "control", "memory";
55+
clocks = <&clk WPCM450_CLK_FIU>;
56+
nuvoton,shm = <&shm>;
57+
58+
flash@0 {
59+
compatible = "jedec,spi-nor";
60+
};
61+
};
62+
63+
shm: syscon@c8001000 {
64+
compatible = "nuvoton,wpcm450-shm", "syscon";
65+
reg = <0xc8001000 0x1000>;
66+
};

drivers/spi/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,17 @@ config SPI_MTK_SNFI
635635
is implemented as a SPI-MEM controller with pipelined ECC
636636
capcability.
637637

638+
config SPI_WPCM_FIU
639+
tristate "Nuvoton WPCM450 Flash Interface Unit"
640+
depends on ARCH_NPCM || COMPILE_TEST
641+
select REGMAP
642+
help
643+
This enables support got the Flash Interface Unit SPI controller
644+
present in the Nuvoton WPCM450 SoC.
645+
646+
This driver does not support generic SPI. The implementation only
647+
supports the spi-mem interface.
648+
638649
config SPI_NPCM_FIU
639650
tristate "Nuvoton NPCM FLASH Interface Unit"
640651
depends on ARCH_NPCM || COMPILE_TEST

drivers/spi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ obj-$(CONFIG_SPI_MTK_NOR) += spi-mtk-nor.o
8383
obj-$(CONFIG_SPI_MTK_SNFI) += spi-mtk-snfi.o
8484
obj-$(CONFIG_SPI_MXIC) += spi-mxic.o
8585
obj-$(CONFIG_SPI_MXS) += spi-mxs.o
86+
obj-$(CONFIG_SPI_WPCM_FIU) += spi-wpcm-fiu.o
8687
obj-$(CONFIG_SPI_NPCM_FIU) += spi-npcm-fiu.o
8788
obj-$(CONFIG_SPI_NPCM_PSPI) += spi-npcm-pspi.o
8889
obj-$(CONFIG_SPI_NXP_FLEXSPI) += spi-nxp-fspi.o

0 commit comments

Comments
 (0)