Skip to contentSkip to conversation

Add Nintendo NES/SuperNES classic support

PATCH Superseded Miquel Raynal 2 participants 10 messages Apr 21, 2018 – Apr 24, 2018

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add Nintendo NES/SuperNES classic support

This series adds support for the NES/SuperNES classic consoles from Nintendo. Changes are done in A23/A33 DTSI to add NAND support.

Thanks,
Miqu?l

Changes since v2
================
* s/arm:/ARM:/ in commit title.
* Added "Allwinner,sun8i-r16" compatibles.
* Removed USB host controller nodes.
* Added dr_mode = "otg" to OTG node.
* Added the bias-pull-up property to CS/RB pins.
* Renamed 'sun8i-r16-nintendo-supernes-classic.dts' into 'sun8i-r16-nintendo-super-nes-classic.dts'.
* Added copyright licenses.

Changes since v1
================

arm: dts: sun8i: a23/a33: declare NAND pins
* Patch created by splitting the v1 in two
* Removed the trailing '@0' after the NAND pins declarations
* Changed the name of these declarations
* Declared all CS/RB lines
* Reorganized the pins entry of nand_pins

arm: dts: nes: add Nintendo NES/SuperNES Classic Edition support
* Created two DTS: nes-classic and supernes-classic
* Moved the NAND pinctrl declaration into the DTSI
* Removed the USB hackery explanation
* Explained why one UART port is preferred to the other

Miquel Raynal (2):
ARM: dts: sun8i: a23/a33: declare NAND pins
ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

 arch/arm/boot/dts/Makefile                         |  2 +
 arch/arm/boot/dts/sun8i-a23-a33.dtsi               | 33 +++++++++++++
 .../boot/dts/sun8i-r16-nintendo-nes-classic.dts    | 56 ++++++++++++++++++++++
 .../dts/sun8i-r16-nintendo-super-nes-classic.dts   | 19 ++++++++
 4 files changed, 110 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts
 create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
Signature · 1 line
2.14.1
#1 lore raw

PATCH v3 1/2 ARM: dts: sun8i: a23/a33: declare NAND pins

Declare NAND pins (bus, chip select and ready/busy) for a23/a33 SoCs.

---
 arch/arm/boot/dts/sun8i-a23-a33.dtsi | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a23-a33.dtsi +31 -0
index 971f9be699a7..6b9e85b4ba0f 100644
@@ -315,6 +315,37 @@
 				bias-pull-up;
 			};
 
+			nand_pins: nand-pins {
+				pins = "PC0", "PC1", "PC2", "PC5",
+				       "PC8", "PC9", "PC10", "PC11",
+				       "PC12", "PC13", "PC14", "PC15";
+				function = "nand0";
+			};
+
+			nand_pins_cs0: nand-pins-cs0 {
+				pins = "PC4";
+				function = "nand0";
+				bias-pull-up;
+			};
+
+			nand_pins_cs1: nand-pins-cs1 {
+				pins = "PC3";
+				function = "nand0";
+				bias-pull-up;
+			};
+
+			nand_pins_rb0: nand-pins-rb0 {
+				pins = "PC6";
+				function = "nand0";
+				bias-pull-up;
+			};
+
+			nand_pins_rb1: nand-pins-rb1 {
+				pins = "PC7";
+				function = "nand0";
+				bias-pull-up;
+			};
+
 			pwm0_pins: pwm0 {
 				pins = "PH0";
 				function = "pwm0";
Signature · 1 line
2.14.1
#2 lore raw

PATCH v3 2/2 ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

In reply to Miquel Raynal

The Nintendo NES/SuperNES features an R16 already well supported in mainline.

The console over UART0 may be wired on two ports of the R16, both available on the NES Classic PCB.

---
 arch/arm/boot/dts/Makefile                         |  2 +
 arch/arm/boot/dts/sun8i-a23-a33.dtsi               |  2 +
 .../boot/dts/sun8i-r16-nintendo-nes-classic.dts    | 56 ++++++++++++++++++++++
 .../dts/sun8i-r16-nintendo-super-nes-classic.dts   | 19 ++++++++
 4 files changed, 79 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts
 create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
arch/arm/boot/dts/Makefile +2 -0
index 7e2424957809..6813abc8399a 100644
@@ -1010,6 +1010,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 	sun8i-h3-orangepi-plus.dtb \
 	sun8i-h3-orangepi-plus2e.dtb \
 	sun8i-r16-bananapi-m2m.dtb \
+	sun8i-r16-nintendo-nes-classic.dtb \
+	sun8i-r16-nintendo-supernes-classic.dtb \
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
index 6b9e85b4ba0f..44f3cad3de75 100644
@@ -198,6 +198,8 @@
 			clock-names = "ahb", "mod";
 			resets = <&ccu RST_BUS_NAND>;
 			reset-names = "ahb";
+			pinctrl-names = "default";
+			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +56 -0

56 lines not on this page · raw message

arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts new file +19 -0
new file mode 100644
index 000000000000..9cbe058feb6f
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0 OR X11
+/* Copyright (c) 2018 Miqu?l RAYNAL <[email protected]> */
+
+/dts-v1/;
+#include "sun8i-r16-nintendo-nes-classic.dts"
+
+/ {
+	model = "Nintendo SuperNES Classic Edition";
+	compatible = "nintendo,supernes-classic", "allwinner,sun8i-r16",
+		     "allwinner,sun8i-a33";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
Signature · 1 line
2.14.1
#3 lore raw

PATCH v3 2/2 ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

Hi,

Quoted 21 lines · Miquel Raynal

The Nintendo NES/SuperNES features an R16 already well supported in mainline.

The console over UART0 may be wired on two ports of the R16, both available on the NES Classic PCB.

---
 arch/arm/boot/dts/Makefile                         |  2 +
 arch/arm/boot/dts/sun8i-a23-a33.dtsi               |  2 +
 .../boot/dts/sun8i-r16-nintendo-nes-classic.dts    | 56 ++++++++++++++++++++++
 .../dts/sun8i-r16-nintendo-super-nes-classic.dts   | 19 ++++++++
 4 files changed, 79 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts
 create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
arch/arm/boot/dts/Makefile +0 -0
index 7e2424957809..6813abc8399a 100644

arch/arm/boot/dts/Makefile dtb-$(CONFIG_MACH_SUN8I) += \ · line 1014

Quoted 5 lines
arch/arm/boot/dts/Makefile +2 -0
@@ -1010,6 +1010,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 	sun8i-h3-orangepi-plus.dtb \
 	sun8i-h3-orangepi-plus2e.dtb \
 	sun8i-r16-bananapi-m2m.dtb \
+	sun8i-r16-nintendo-nes-classic.dtb \
+	sun8i-r16-nintendo-supernes-classic.dtb \

This doesn't match your DTS name :)

arch/arm/boot/dts/sun8i-a23-a33.dtsi line 202

Quoted 13 lines
arch/arm/boot/dts/Makefile +0 -0
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
index 6b9e85b4ba0f..44f3cad3de75 100644
@@ -198,6 +198,8 @@
 			clock-names = "ahb", "mod";
 			resets = <&ccu RST_BUS_NAND>;
 			reset-names = "ahb";
+			pinctrl-names = "default";
+			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;

This should be in your first patch I guess?

Quoted 6 lines
arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts new file +0 -0
new file mode 100644
index 000000000000..9cbe058feb6f

arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts line 9

Quoted 9 lines
arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts new file +9 -0
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0 OR X11
+/* Copyright (c) 2018 Miqu?l RAYNAL <[email protected]> */
+
+/dts-v1/;
+#include "sun8i-r16-nintendo-nes-classic.dts"
+
+/ {
+	model = "Nintendo SuperNES Classic Edition";
+	compatible = "nintendo,supernes-classic", "allwinner,sun8i-r16",

We should have the same split in the compatible (ie, super-nes-classic) and we should probably add the nes-classic compatible in there as well.

arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts line 17

Quoted 8 lines
arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts new file +8 -0
+		     "allwinner,sun8i-a33";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";

Isn't that part of the NES DTSI already?

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180423/80557a6e/attachment.sig>
#4 lore raw

PATCH v3 2/2 ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

Hi Maxime,

Quoted 19 lines · Maxime Ripard

Hi,

Quoted 16 lines · Miquel Raynal

The Nintendo NES/SuperNES features an R16 already well supported in mainline.

The console over UART0 may be wired on two ports of the R16, both available on the NES Classic PCB.

---
 arch/arm/boot/dts/Makefile                         |  2 +
 arch/arm/boot/dts/sun8i-a23-a33.dtsi               |  2 +
 .../boot/dts/sun8i-r16-nintendo-nes-classic.dts    | 56 ++++++++++++++++++++++
 .../dts/sun8i-r16-nintendo-super-nes-classic.dts   | 19 ++++++++
 4 files changed, 79 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts
 create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
Quoted 12 lines

arch/arm/boot/dts/Makefile dtb-$(CONFIG_MACH_SUN8I) += \ · line 1014

Quoted 10 lines
arch/arm/boot/dts/Makefile +2 -0
index 7e2424957809..6813abc8399a 100644
@@ -1010,6 +1010,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 	sun8i-h3-orangepi-plus.dtb \
 	sun8i-h3-orangepi-plus2e.dtb \
 	sun8i-r16-bananapi-m2m.dtb \
+	sun8i-r16-nintendo-nes-classic.dtb \
+	sun8i-r16-nintendo-supernes-classic.dtb \  

This doesn't match your DTS name :)

Ooooops /o\

Quoted 16 lines
Quoted 9 lines
arch/arm/boot/dts/Makefile +0 -0
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
arch/arm/boot/dts/sun8i-a23-a33.dtsi +0 -0
index 6b9e85b4ba0f..44f3cad3de75 100644

arch/arm/boot/dts/sun8i-a23-a33.dtsi line 202

Quoted 5 lines
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
@@ -198,6 +198,8 @@
 			clock-names = "ahb", "mod";
 			resets = <&ccu RST_BUS_NAND>;
 			reset-names = "ahb";
+			pinctrl-names = "default";
+			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;  

This should be in your first patch I guess?

Actually I think this should not be there but instead, because it is board-related, these two lines should be in the nes-classic.dts' nfc node, right? Other a23/a33/r16 based designs could use the second set of CS/RB pins.

Quoted 13 lines
Quoted 13 lines
arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts new file +6 -0
new file mode 100644
index 000000000000..9cbe058feb6f
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0 OR X11
+/* Copyright (c) 2018 Miqu?l RAYNAL <[email protected]> */
+
+/dts-v1/;
+#include "sun8i-r16-nintendo-nes-classic.dts"
+
Quoted 8 lines

arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts line 9

Quoted 3 lines
arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts new file +3 -0
+/ {
+	model = "Nintendo SuperNES Classic Edition";
+	compatible = "nintendo,supernes-classic", "allwinner,sun8i-r16",  

We should have the same split in the compatible (ie, super-nes-classic) and we should probably add the nes-classic compatible in there as well.

Sure.

Quoted 11 lines

arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts line 17

Quoted 9 lines
arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts new file +8 -0
+		     "allwinner,sun8i-a33";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";  

Isn't that part of the NES DTSI already?

Right, I was not sure if those two should be kept or not. Removed.

Quoted 3 lines

Maxime

Thanks,
Miqu?l

Signature · 3 lines
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v3 2/2 ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

Quoted 16 lines · Miquel Raynal
Quoted 7 lines
Quoted 7 lines
arch/arm/boot/dts/Makefile +0 -0
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
arch/arm/boot/dts/sun8i-a23-a33.dtsi +0 -0
index 6b9e85b4ba0f..44f3cad3de75 100644
Quoted 8 lines

arch/arm/boot/dts/sun8i-a23-a33.dtsi line 202

Quoted 6 lines
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
@@ -198,6 +198,8 @@
 			clock-names = "ahb", "mod";
 			resets = <&ccu RST_BUS_NAND>;
 			reset-names = "ahb";
+			pinctrl-names = "default";
+			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;  

This should be in your first patch I guess?

Quoted 4 lines

Actually I think this should not be there but instead, because it is board-related, these two lines should be in the nes-classic.dts' nfc node, right? Other a23/a33/r16 based designs could use the second set of CS/RB pins.

Does that ever happen?

On a theoretical level, then yeah, sure. But if all the boards seen out there are using the same setup (which is pretty common), then there's no reason not to do it in the DTSI.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180424/522f47ed/attachment.sig>
#6 lore raw

PATCH v3 2/2 ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

Hi Maxime,

Quoted 22 lines · Maxime Ripard
Quoted 16 lines · Miquel Raynal
Quoted 7 lines
Quoted 7 lines
arch/arm/boot/dts/Makefile +0 -0
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
arch/arm/boot/dts/sun8i-a23-a33.dtsi +0 -0
index 6b9e85b4ba0f..44f3cad3de75 100644
Quoted 8 lines

arch/arm/boot/dts/sun8i-a23-a33.dtsi line 202

Quoted 6 lines
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
@@ -198,6 +198,8 @@
 			clock-names = "ahb", "mod";
 			resets = <&ccu RST_BUS_NAND>;
 			reset-names = "ahb";
+			pinctrl-names = "default";
+			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;    

This should be in your first patch I guess?

Quoted 4 lines

Actually I think this should not be there but instead, because it is board-related, these two lines should be in the nes-classic.dts' nfc node, right? Other a23/a33/r16 based designs could use the second set of CS/RB pins.

Quoted 5 lines

Does that ever happen?

On a theoretical level, then yeah, sure. But if all the boards seen out there are using the same setup (which is pretty common), then there's no reason not to do it in the DTSI.

Then I will add these two properties in the DTSI in the first patch.

Thanks,
Miqu?l

Quoted 3 lines

Maxime

Signature · 3 lines
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH v3 2/2 ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

In reply to Maxime Ripard

Hi Maxime,

Quoted 22 lines · Maxime Ripard
Quoted 16 lines · Miquel Raynal
Quoted 7 lines
Quoted 7 lines
arch/arm/boot/dts/Makefile +0 -0
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
arch/arm/boot/dts/sun8i-a23-a33.dtsi +0 -0
index 6b9e85b4ba0f..44f3cad3de75 100644
Quoted 8 lines

arch/arm/boot/dts/sun8i-a23-a33.dtsi line 202

Quoted 6 lines
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
@@ -198,6 +198,8 @@
 			clock-names = "ahb", "mod";
 			resets = <&ccu RST_BUS_NAND>;
 			reset-names = "ahb";
+			pinctrl-names = "default";
+			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;    

This should be in your first patch I guess?

Quoted 4 lines

Actually I think this should not be there but instead, because it is board-related, these two lines should be in the nes-classic.dts' nfc node, right? Other a23/a33/r16 based designs could use the second set of CS/RB pins.

Quoted 5 lines

Does that ever happen?

On a theoretical level, then yeah, sure. But if all the boards seen out there are using the same setup (which is pretty common), then there's no reason not to do it in the DTSI.

I compared the various boards configurations [1] with the R16 datasheet [2], all the boards having a NAND configure all the related pins (including CS1 and RB1). So I guess I can put both properties in the DTSI.

There is one case (sinlinx_sina33) where the NAND is not used and the pins are used for an alternate function: SPI0; but I guess this is not a problem as in this case, the NAND node would not exist in the resulting DTB.

Regards,
Miqu?l

Quoted 3 lines

Maxime

Signature · 3 lines
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw

PATCH v3 2/2 ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

Quoted 29 lines · Miquel Raynal

Hi Maxime,

Quoted 24 lines · Maxime Ripard
Quoted 16 lines · Miquel Raynal
Quoted 7 lines
Quoted 7 lines
arch/arm/boot/dts/Makefile +0 -0
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
arch/arm/boot/dts/sun8i-a23-a33.dtsi +0 -0
index 6b9e85b4ba0f..44f3cad3de75 100644
Quoted 8 lines

arch/arm/boot/dts/sun8i-a23-a33.dtsi line 202

Quoted 6 lines
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
@@ -198,6 +198,8 @@
 			clock-names = "ahb", "mod";
 			resets = <&ccu RST_BUS_NAND>;
 			reset-names = "ahb";
+			pinctrl-names = "default";
+			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;      

This should be in your first patch I guess?

Quoted 4 lines

Actually I think this should not be there but instead, because it is board-related, these two lines should be in the nes-classic.dts' nfc node, right? Other a23/a33/r16 based designs could use the second set of CS/RB pins.

Does that ever happen?

Quoted 8 lines
Quoted 3 lines

On a theoretical level, then yeah, sure. But if all the boards seen out there are using the same setup (which is pretty common), then there's no reason not to do it in the DTSI.

I compared the various boards configurations [1] with the R16 datasheet [2], all the boards having a NAND configure all the related pins (including CS1 and RB1). So I guess I can put both properties in the DTSI.

I forgot to add:
[1] https://github.com/linux-sunxi/sunxi-boards/tree/master/sys_config/a33
[2] http://linux-sunxi.org/images/b/b3/R16_Datasheet_V1.4_%281%29.pdf

Sorry for the spam :)

Miqu?l

Quoted 9 lines

There is one case (sinlinx_sina33) where the NAND is not used and the pins are used for an alternate function: SPI0; but I guess this is not a problem as in this case, the NAND node would not exist in the resulting DTB.

Regards,
Miqu?l

#9 lore raw

PATCH v3 2/2 ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support

In reply to Miquel Raynal
Quoted 29 lines · Miquel Raynal

Hi Maxime,

Quoted 24 lines · Maxime Ripard
Quoted 16 lines · Miquel Raynal
Quoted 7 lines
Quoted 7 lines
arch/arm/boot/dts/Makefile +0 -0
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
arch/arm/boot/dts/sun8i-a23-a33.dtsi +0 -0
index 6b9e85b4ba0f..44f3cad3de75 100644
Quoted 8 lines

arch/arm/boot/dts/sun8i-a23-a33.dtsi line 202

Quoted 6 lines
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
@@ -198,6 +198,8 @@
 			clock-names = "ahb", "mod";
 			resets = <&ccu RST_BUS_NAND>;
 			reset-names = "ahb";
+			pinctrl-names = "default";
+			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;    

This should be in your first patch I guess?

Quoted 4 lines

Actually I think this should not be there but instead, because it is board-related, these two lines should be in the nes-classic.dts' nfc node, right? Other a23/a33/r16 based designs could use the second set of CS/RB pins.

Does that ever happen?

Quoted 8 lines
Quoted 3 lines

On a theoretical level, then yeah, sure. But if all the boards seen out there are using the same setup (which is pretty common), then there's no reason not to do it in the DTSI.

I compared the various boards configurations [1] with the R16 datasheet [2], all the boards having a NAND configure all the related pins (including CS1 and RB1). So I guess I can put both properties in the DTSI.

I don't think we should until we have a clearer view of whether it's needed or not. If it turns out that they are not using it, and that we need to remove it from the DTSI, it's going to be a nightmare to track down what board actually needs what pin.

Quoted 4 lines

There is one case (sinlinx_sina33) where the NAND is not used and the pins are used for an alternate function: SPI0; but I guess this is not a problem as in this case, the NAND node would not exist in the resulting DTB.

Yeah, the sinA33 is using an eMMC, so it's not relevant here.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180424/4d3c9e61/attachment.sig>