Add Nintendo NES/SuperNES classic support
Subsystems (3)
v2 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 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 | 29 ++++++++++ .../boot/dts/sun8i-r16-nintendo-nes-classic.dts | 62 ++++++++++++++++++++++ .../dts/sun8i-r16-nintendo-supernes-classic.dts | 17 ++++++ 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-supernes-classic.dts
Signature · 1 line
2.14.1
PATCH v2 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 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm/boot/dts/sun8i-a23-a33.dtsi +27 -0
@@ -315,6 +315,33 @@ 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"; + }; + + nand_pins_cs1: nand-pins-cs1 { + pins = "PC3"; + function = "nand0"; + }; + + nand_pins_rb0: nand-pins-rb0 { + pins = "PC6"; + function = "nand0"; + }; + + nand_pins_rb1: nand-pins-rb1 { + pins = "PC7"; + function = "nand0"; + }; + pwm0_pins: pwm0 { pins = "PH0"; function = "pwm0";
Signature · 1 line
2.14.1
PATCH v2 1/2 arm: dts: sun8i: a23/a33: declare NAND pins
Quoted 32 lines · Miquel Raynal
Declare NAND pins (bus, chip select and ready/busy) for a23/a33 SoCs.
Signed-off-by Miquel Raynal <[email protected]>--- arch/arm/boot/dts/sun8i-a23-a33.dtsi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)arch/arm/boot/dts/sun8i-a23-a33.dtsi +17
-0@@ -315,6 +315,33 @@ 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"; + }; + + nand_pins_cs1: nand-pins-cs1 { + pins = "PC3"; + function = "nand0"; + }; +
arch/arm/boot/dts/sun8i-a23-a33.dtsi line 344
Quoted 10 lines
arch/arm/boot/dts/sun8i-a23-a33.dtsi +10
-0+ nand_pins_rb0: nand-pins-rb0 { + pins = "PC6"; + function = "nand0"; + }; + + nand_pins_rb1: nand-pins-rb1 { + pins = "PC7"; + function = "nand0"; + }; +
The CS and RB pins are pulled up by default in the PIO hardware reset values. But you should make them explicit, especially since you likely don't know if there are external pull-ups on these lines. I suppose you could set them to _not_ pull-up and see if things still work.
ChenYu
Quoted 6 lines
arch/arm/boot/dts/sun8i-a23-a33.dtsi +0
-1pwm0_pins: pwm0 { pins = "PH0"; function = "pwm0"; --2.14.1
PATCH v2 2/2 arm: dts: nes: add Nintendo NES/SuperNES Classic Edition support
In reply to Miquel RaynalThe 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 | 62 ++++++++++++++++++++++ .../dts/sun8i-r16-nintendo-supernes-classic.dts | 17 ++++++ 4 files changed, 83 insertions(+) create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts
arch/arm/boot/dts/Makefile +2 -0
@@ -990,6 +990,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
@@ -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 +62 -0
62 lines not on this page · raw message
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +17 -0
@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11 + +/dts-v1/; +#include "sun8i-r16-nintendo-nes-classic.dts" + +/ { + model = "Nintendo SuperNES Classic Edition"; + compatible = "nintendo,supernes-classic", "allwinner,sun8i-a33"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +};
Signature · 1 line
2.14.1
PATCH v2 2/2 arm: dts: nes: add Nintendo NES/SuperNES Classic Edition support
Quoted 48 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.
Signed-off-by Miquel Raynal <[email protected]>--- arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/sun8i-a23-a33.dtsi | 2 + .../boot/dts/sun8i-r16-nintendo-nes-classic.dts | 62 ++++++++++++++++++++++ .../dts/sun8i-r16-nintendo-supernes-classic.dts | 17 ++++++ 4 files changed, 83 insertions(+) create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dtsarch/arm/boot/dts/Makefile +2
-0@@ -990,6 +990,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@@ -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 +0
-0
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts line 10
Quoted 10 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +10
-0@@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11 +/* Copyright (c) 2016 FUKAUMI Naoki <[email protected]> */ + +/dts-v1/; +#include "sun8i-a33.dtsi" +#include "sunxi-common-regulators.dtsi" + +/ { + model = "Nintendo NES Classic Edition"; + compatible = "nintendo,nes-classic", "allwinner,sun8i-a33";
The chip found on the board is the R16, which is compatible or identical with the A33. Nevertheless, please have an R33 compatible in front of the A33 one. That would describe it properly.
Quoted 27 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +27
-0+ + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&uart0 { + /* + * UART0 is available on two ports: PB and PF, both are accessible. + * PF can also be used for the SD card so PB is preferred. + */ + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&nfc { + status = "okay"; + + /* 2Gb Macronix MX30LF2G18AC (3V) */ + nand at 0 { + #address-cells = <1>; + #size-cells = <1>;
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts line 47
Quoted 10 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +10
-0+ reg = <0>; + allwinner,rb = <0>; + nand-ecc-mode = "hw"; + nand-ecc-strength = <16>; + nand-ecc-step-size = <1024>; + }; +}; + +&usb_otg { + status = "okay";
This is missing a "dr_mode" property.
Quoted 5 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +5
-0+}; + +&usbphy { + /* VBUS is always on because it is wired to the power supply */ + usb1_vbus-supply = <®_vcc5v0>;
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts line 62
Quoted 10 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +10
-0+ status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +};
What is connected to the USB hosts? OTG does not use these.
Quoted 6 lines
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +0
-0
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts line 8
Quoted 8 lines
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +8
-0@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11 + +/dts-v1/; +#include "sun8i-r16-nintendo-nes-classic.dts" + +/ { + model = "Nintendo SuperNES Classic Edition"; + compatible = "nintendo,supernes-classic", "allwinner,sun8i-a33";
Same here.
ChenYu
Quoted 12 lines
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +9
-1+ + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; --2.14.1
PATCH v2 2/2 arm: dts: nes: add Nintendo NES/SuperNES Classic Edition support
Quoted 7 lines · Chen-Yu Tsai
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts line 1
Quoted 7 lines
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +1
-0@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11
This should have a copyright license too
And could we call it super-nes-classic?
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/20180327/9d2aad9c/attachment.sig>
PATCH v2 2/2 arm: dts: nes: add Nintendo NES/SuperNES Classic Edition support
Hi Maxime,
Quoted 10 lines · Maxime Ripard
Quoted 7 lines · Chen-Yu Tsai
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts line 1
Quoted 7 lines
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +1
-0@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11This should have a copyright license too
Added.
Quoted 2 lines
And could we call it super-nes-classic?
Of course yes.
Thanks for reviewing, the v3 is coming.
Miqu?l
PATCH v2 2/2 arm: dts: nes: add Nintendo NES/SuperNES Classic Edition support
In reply to Chen-Yu TsaiHi Chen-Yu,
Quoted 56 lines · Chen-Yu Tsai
Quoted 54 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.
Signed-off-by Miquel Raynal <[email protected]>--- arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/sun8i-a23-a33.dtsi | 2 + .../boot/dts/sun8i-r16-nintendo-nes-classic.dts | 62 ++++++++++++++++++++++ .../dts/sun8i-r16-nintendo-supernes-classic.dts | 17 ++++++ 4 files changed, 83 insertions(+) create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dtsarch/arm/boot/dts/Makefile +2
-0@@ -990,6 +990,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@@ -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 +6
-0@@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11 +/* Copyright (c) 2016 FUKAUMI Naoki <[email protected]> */ + +/dts-v1/; +#include "sun8i-a33.dtsi" +#include "sunxi-common-regulators.dtsi"
Quoted 8 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts line 10
Quoted 4 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +4
-0+ +/ { + model = "Nintendo NES Classic Edition"; + compatible = "nintendo,nes-classic", "allwinner,sun8i-a33";The chip found on the board is the R16, which is compatible or identical with the A33. Nevertheless, please have an R33 compatible in front of the A33 one. That would describe it properly.
I suppose you mean R16 compatible?
I added an "allwinner,sun8i-r16" compatible between the "nes-classic" and the "sun8i-a33" ones.
Quoted 32 lines
Quoted 32 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +31
-0+ + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&uart0 { + /* + * UART0 is available on two ports: PB and PF, both are accessible. + * PF can also be used for the SD card so PB is preferred. + */ + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&nfc { + status = "okay"; + + /* 2Gb Macronix MX30LF2G18AC (3V) */ + nand at 0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + allwinner,rb = <0>; + nand-ecc-mode = "hw"; + nand-ecc-strength = <16>;
Quoted 8 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts line 47
Quoted 6 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +6
-0+ nand-ecc-step-size = <1024>; + }; +}; + +&usb_otg { + status = "okay";This is missing a "
dr_mode" property.
Right.
Quoted 10 lines
Quoted 10 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +9
-0+}; + +&usbphy { + /* VBUS is always on because it is wired to the power supply */ + usb1_vbus-supply = <®_vcc5v0>; + status = "okay"; +}; + +&ehci0 {
Quoted 8 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts line 62
Quoted 6 lines
arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts new file +6
-0+ status = "okay"; +}; + +&ohci0 { + status = "okay"; +};What is connected to the USB hosts? OTG does not use these.
My mistake, I thought these were still needed. I will remove them both as there is only one OTG port.
Quoted 17 lines
Quoted 7 lines
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +0
-0arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts line 8
Quoted 8 lines
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +8
-0@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11 + +/dts-v1/; +#include "sun8i-r16-nintendo-nes-classic.dts" + +/ { + model = "Nintendo SuperNES Classic Edition"; + compatible = "nintendo,supernes-classic", "allwinner,sun8i-a33";Same here.
Okay.
Quoted 15 lines
ChenYu
Quoted 10 lines
arch/arm/boot/dts/sun8i-r16-nintendo-supernes-classic.dts new file +9
-1+ + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; --Quoted 2 lines
2.14.1
Thanks,
Miqu?l
Signature · 3 lines
Miquel Raynal, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
v2 cover Add Nintendo NES/SuperNES classic support
In reply to Miquel RaynalQuoted 23 lines · Miquel Raynal
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?lChanges 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 ofnand_pinsarm: 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
Quoted 3 lines
Miquel Raynal (2):
arm: dts: sun8i: a23/a33: declare NAND pins
arm: dts: nes: add Nintendo NES/SuperNES Classic Edition support
"ARM" should be uppercase. However, "arm64" should be lowercase.
ChenYu
Quoted 12 lines
arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/sun8i-a23-a33.dtsi | 29 ++++++++++ .../boot/dts/sun8i-r16-nintendo-nes-classic.dts | 62 ++++++++++++++++++++++ .../dts/sun8i-r16-nintendo-supernes-classic.dts | 17 ++++++ 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-supernes-classic.dts--
2.14.1