Skip to content

Commit 1d43478

Browse files
committed
Realtek SPI-NAND controller
Merge series from Chris Packham <[email protected]>: This series adds support for the SPI-NAND flash controller on the RTL9300 family of SoCs. There are 2 physical chip selects which are called SPI_MST_CS0 and SPI_MST_CS1 in the datasheet. Via some pin-strapping these can be assigned to either the SPI-NOR controller or the SPI-NAND controller. Which means you can end up with the following permutations SPI-Flash Boot Model SPI_MST_CS0 SPI_MST_CS1 ---------- ----------- ----------- NOR x1 NOR-CS0 X NOR x2 NOR-CS0 NOR-CS1 NAND x1 NAND-CS0 X NAND x2 NAND-CS0 NAND-CS1 NOR+NAND NOR-CS0 NAND-CS0
2 parents f45a439 + 42d20a6 commit 1d43478

File tree

5 files changed

+485
-0
lines changed

5 files changed

+485
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/spi/realtek,rtl9301-snand.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: SPI-NAND Flash Controller for Realtek RTL9300 SoCs
8+
9+
maintainers:
10+
- Chris Packham <[email protected]>
11+
12+
description:
13+
The Realtek RTL9300 SoCs have a built in SPI-NAND controller. It supports
14+
typical SPI-NAND page cache operations in single, dual or quad IO mode.
15+
16+
properties:
17+
compatible:
18+
oneOf:
19+
- items:
20+
- enum:
21+
- realtek,rtl9302b-snand
22+
- realtek,rtl9302c-snand
23+
- realtek,rtl9303-snand
24+
- const: realtek,rtl9301-snand
25+
- const: realtek,rtl9301-snand
26+
27+
reg:
28+
maxItems: 1
29+
30+
interrupts:
31+
maxItems: 1
32+
33+
clocks:
34+
maxItems: 1
35+
36+
required:
37+
- compatible
38+
- reg
39+
- interrupts
40+
- clocks
41+
42+
allOf:
43+
- $ref: /schemas/spi/spi-controller.yaml#
44+
45+
unevaluatedProperties: false
46+
47+
examples:
48+
- |
49+
spi@1a400 {
50+
compatible = "realtek,rtl9302c-snand", "realtek,rtl9301-snand";
51+
reg = <0x1a400 0x44>;
52+
interrupt-parent = <&intc>;
53+
interrupts = <19>;
54+
clocks = <&lx_clk>;
55+
#address-cells = <1>;
56+
#size-cells = <0>;
57+
58+
flash@0 {
59+
compatible = "spi-nand";
60+
reg = <0>;
61+
};
62+
};

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19538,6 +19538,12 @@ S: Maintained
1953819538
F: Documentation/devicetree/bindings/net/dsa/realtek.yaml
1953919539
F: drivers/net/dsa/realtek/*
1954019540

19541+
REALTEK SPI-NAND
19542+
M: Chris Packham <[email protected]>
19543+
S: Maintained
19544+
F: Documentation/devicetree/bindings/spi/realtek,rtl9301-snand.yaml
19545+
F: drivers/spi/spi-realtek-rtl-snand.c
19546+
1954119547
REALTEK WIRELESS DRIVER (rtlwifi family)
1954219548
M: Ping-Ke Shih <[email protected]>
1954319549

drivers/spi/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,17 @@ config SPI_PXA2XX
843843
config SPI_PXA2XX_PCI
844844
def_tristate SPI_PXA2XX && PCI && COMMON_CLK
845845

846+
config SPI_REALTEK_SNAND
847+
tristate "Realtek SPI-NAND Flash Controller"
848+
depends on MACH_REALTEK_RTL || COMPILE_TEST
849+
select REGMAP
850+
help
851+
This enables support for the SPI-NAND Flash controller on
852+
Realtek SoCs.
853+
854+
This driver does not support generic SPI. The implementation
855+
only supports the spi-mem interface.
856+
846857
config SPI_ROCKCHIP
847858
tristate "Rockchip SPI controller driver"
848859
depends on ARCH_ROCKCHIP || COMPILE_TEST

drivers/spi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ obj-$(CONFIG_SPI_ROCKCHIP) += spi-rockchip.o
119119
obj-$(CONFIG_SPI_ROCKCHIP_SFC) += spi-rockchip-sfc.o
120120
obj-$(CONFIG_SPI_RB4XX) += spi-rb4xx.o
121121
obj-$(CONFIG_MACH_REALTEK_RTL) += spi-realtek-rtl.o
122+
obj-$(CONFIG_SPI_REALTEK_SNAND) += spi-realtek-rtl-snand.o
122123
obj-$(CONFIG_SPI_RPCIF) += spi-rpc-if.o
123124
obj-$(CONFIG_SPI_RSPI) += spi-rspi.o
124125
obj-$(CONFIG_SPI_RZV2M_CSI) += spi-rzv2m-csi.o

0 commit comments

Comments
 (0)