All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support
@ 2018-04-24 15:55 Miquel Raynal
  2018-04-24 15:55 ` [PATCH v5 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins Miquel Raynal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Miquel Raynal @ 2018-04-24 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

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 v4
================
* I should not have added cs1 and rb1 pins in the default pinctrl,
  removed.

Changes since v3
================
* Moved the pinctrl declaration in the first patch.
* Fixed the "nintendo,super-nes-classic" compatible name.
* Added the "nintendo,nes-classic" compatible in the
  nintendo-super-nes-classic DT.
* Removed repeated aliases/chosen nodes from
  nintendo-super-nes-classic DT.

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   | 11 +++++
 4 files changed, 102 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

-- 
2.14.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v5 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins
  2018-04-24 15:55 [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support Miquel Raynal
@ 2018-04-24 15:55 ` Miquel Raynal
  2018-04-24 15:55 ` [PATCH v5 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support Miquel Raynal
  2018-04-25  7:03 ` [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2018-04-24 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 arch/arm/boot/dts/sun8i-a23-a33.dtsi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
index 971f9be699a7..44f3cad3de75 100644
--- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
+++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
@@ -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>;
@@ -315,6 +317,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";
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v5 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-24 15:55 [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support Miquel Raynal
  2018-04-24 15:55 ` [PATCH v5 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins Miquel Raynal
@ 2018-04-24 15:55 ` Miquel Raynal
  2018-04-25  7:03 ` [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2018-04-24 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

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 <miquel.raynal@bootlin.com>
---
 arch/arm/boot/dts/Makefile                         |  2 +
 .../boot/dts/sun8i-r16-nintendo-nes-classic.dts    | 56 ++++++++++++++++++++++
 .../dts/sun8i-r16-nintendo-super-nes-classic.dts   | 11 +++++
 3 files changed, 69 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

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7e2424957809..c904eb85d4d2 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -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-super-nes-classic.dtb \
 	sun8i-r16-parrot.dtb \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v3s-licheepi-zero.dtb \
diff --git a/arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts b/arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts
new file mode 100644
index 000000000000..fc0658cfa319
--- /dev/null
+++ b/arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic.dts
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0 OR X11
+/* Copyright (c) 2016 FUKAUMI Naoki <naobsd@gmail.com> */
+
+/dts-v1/;
+#include "sun8i-a33.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+/ {
+	model = "Nintendo NES Classic Edition";
+	compatible = "nintendo,nes-classic", "allwinner,sun8i-r16",
+		     "allwinner,sun8i-a33";
+
+	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>;
+		nand-ecc-step-size = <1024>;
+	};
+};
+
+&usb_otg {
+	status = "okay";
+	dr_mode = "otg";
+};
+
+&usbphy {
+	/* VBUS is always on because it is wired to the power supply */
+	usb1_vbus-supply = <&reg_vcc5v0>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts b/arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
new file mode 100644
index 000000000000..80761d7904ec
--- /dev/null
+++ b/arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0 OR X11
+/* Copyright (c) 2018 Miqu?l RAYNAL <miquel.raynal@bootlin.com> */
+
+/dts-v1/;
+#include "sun8i-r16-nintendo-nes-classic.dts"
+
+/ {
+	model = "Nintendo SuperNES Classic Edition";
+	compatible = "nintendo,super-nes-classic", "nintendo,nes-classic",
+		     "allwinner,sun8i-r16", "allwinner,sun8i-a33";
+};
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support
  2018-04-24 15:55 [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support Miquel Raynal
  2018-04-24 15:55 ` [PATCH v5 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins Miquel Raynal
  2018-04-24 15:55 ` [PATCH v5 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support Miquel Raynal
@ 2018-04-25  7:03 ` Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2018-04-25  7:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 24, 2018 at 05:55:01PM +0200, Miquel Raynal wrote:
> This series adds support for the NES/SuperNES classic consoles from
> Nintendo. Changes are done in A23/A33 DTSI to add NAND support.

Applied, thanks!
Maxime

-- 
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/20180425/8b33998d/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-25  7:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 15:55 [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support Miquel Raynal
2018-04-24 15:55 ` [PATCH v5 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins Miquel Raynal
2018-04-24 15:55 ` [PATCH v5 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support Miquel Raynal
2018-04-25  7:03 ` [PATCH v5 0/2] Add Nintendo NES/SuperNES classic support Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.