All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add Nintendo NES/SuperNES classic support
@ 2018-04-21 16:42 Miquel Raynal
  2018-04-21 16:42 ` [PATCH v3 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins Miquel Raynal
  2018-04-21 16:42 ` [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support Miquel Raynal
  0 siblings, 2 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-21 16:42 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 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

-- 
2.14.1

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

* [PATCH v3 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins
  2018-04-21 16:42 [PATCH v3 0/2] Add Nintendo NES/SuperNES classic support Miquel Raynal
@ 2018-04-21 16:42 ` Miquel Raynal
  2018-04-21 16:42 ` [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support Miquel Raynal
  1 sibling, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-21 16:42 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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

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

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

* [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-21 16:42 [PATCH v3 0/2] Add Nintendo NES/SuperNES classic support Miquel Raynal
  2018-04-21 16:42 ` [PATCH v3 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins Miquel Raynal
@ 2018-04-21 16:42 ` Miquel Raynal
  2018-04-23  7:24   ` Maxime Ripard
  1 sibling, 1 reply; 10+ messages in thread
From: Miquel Raynal @ 2018-04-21 16:42 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 +
 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

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7e2424957809..6813abc8399a 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-supernes-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-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
index 6b9e85b4ba0f..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>;
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..9cbe058feb6f
--- /dev/null
+++ b/arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
@@ -0,0 +1,19 @@
+// 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,supernes-classic", "allwinner,sun8i-r16",
+		     "allwinner,sun8i-a33";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
-- 
2.14.1

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

* [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-21 16:42 ` [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support Miquel Raynal
@ 2018-04-23  7:24   ` Maxime Ripard
  2018-04-23 10:27     ` Miquel Raynal
  0 siblings, 1 reply; 10+ messages in thread
From: Maxime Ripard @ 2018-04-23  7:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sat, Apr 21, 2018 at 06:42:46PM +0200, Miquel Raynal wrote:
> 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 +
>  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
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 7e2424957809..6813abc8399a 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-supernes-classic.dtb \

This doesn't match your DTS name :)

>  	sun8i-r16-parrot.dtb \
>  	sun8i-r40-bananapi-m2-ultra.dtb \
>  	sun8i-v3s-licheepi-zero.dtb \
> diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> index 6b9e85b4ba0f..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>;

This should be in your first patch I guess?

> 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..9cbe058feb6f
> --- /dev/null
> +++ b/arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
> @@ -0,0 +1,19 @@
> +// 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,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.

> +		     "allwinner,sun8i-a33";
> +
> +	aliases {
> +		serial0 = &uart0;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";

Isn't that part of the NES DTSI already?

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/20180423/80557a6e/attachment.sig>

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

* [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-23  7:24   ` Maxime Ripard
@ 2018-04-23 10:27     ` Miquel Raynal
  2018-04-24  7:55       ` Maxime Ripard
  0 siblings, 1 reply; 10+ messages in thread
From: Miquel Raynal @ 2018-04-23 10:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Maxime,

On Mon, 23 Apr 2018 09:24:03 +0200, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:

> Hi,
> 
> On Sat, Apr 21, 2018 at 06:42:46PM +0200, Miquel Raynal wrote:
> > 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 +
> >  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
> > 
> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> > index 7e2424957809..6813abc8399a 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-supernes-classic.dtb \  
> 
> This doesn't match your DTS name :)

Ooooops /o\

> 
> >  	sun8i-r16-parrot.dtb \
> >  	sun8i-r40-bananapi-m2-ultra.dtb \
> >  	sun8i-v3s-licheepi-zero.dtb \
> > diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> > index 6b9e85b4ba0f..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>;  
> 
> 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.

> 
> > 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..9cbe058feb6f
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/sun8i-r16-nintendo-super-nes-classic.dts
> > @@ -0,0 +1,19 @@
> > +// 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,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.

> 
> > +		     "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.

> 
> Maxime
> 

Thanks,
Miqu?l

-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-23 10:27     ` Miquel Raynal
@ 2018-04-24  7:55       ` Maxime Ripard
  2018-04-24  8:05         ` Miquel Raynal
  2018-04-24  8:49         ` Miquel Raynal
  0 siblings, 2 replies; 10+ messages in thread
From: Maxime Ripard @ 2018-04-24  7:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 23, 2018 at 12:27:52PM +0200, Miquel Raynal wrote:
> > >  	sun8i-r16-parrot.dtb \
> > >  	sun8i-r40-bananapi-m2-ultra.dtb \
> > >  	sun8i-v3s-licheepi-zero.dtb \
> > > diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> > > index 6b9e85b4ba0f..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>;  
> > 
> > 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.

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

-- 
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>

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

* [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-24  7:55       ` Maxime Ripard
@ 2018-04-24  8:05         ` Miquel Raynal
  2018-04-24  8:49         ` Miquel Raynal
  1 sibling, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-24  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Maxime,

On Tue, 24 Apr 2018 09:55:05 +0200, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:

> On Mon, Apr 23, 2018 at 12:27:52PM +0200, Miquel Raynal wrote:
> > > >  	sun8i-r16-parrot.dtb \
> > > >  	sun8i-r40-bananapi-m2-ultra.dtb \
> > > >  	sun8i-v3s-licheepi-zero.dtb \
> > > > diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> > > > index 6b9e85b4ba0f..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>;    
> > > 
> > > 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.  
> 
> 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

> 
> Maxime
> 



-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-24  7:55       ` Maxime Ripard
  2018-04-24  8:05         ` Miquel Raynal
@ 2018-04-24  8:49         ` Miquel Raynal
  2018-04-24  9:16           ` Miquel Raynal
  2018-04-24 11:05           ` Maxime Ripard
  1 sibling, 2 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-24  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Maxime,

On Tue, 24 Apr 2018 09:55:05 +0200, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:

> On Mon, Apr 23, 2018 at 12:27:52PM +0200, Miquel Raynal wrote:
> > > >  	sun8i-r16-parrot.dtb \
> > > >  	sun8i-r40-bananapi-m2-ultra.dtb \
> > > >  	sun8i-v3s-licheepi-zero.dtb \
> > > > diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> > > > index 6b9e85b4ba0f..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>;    
> > > 
> > > 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.  
> 
> 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

> 
> Maxime
> 



-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-24  8:49         ` Miquel Raynal
@ 2018-04-24  9:16           ` Miquel Raynal
  2018-04-24 11:05           ` Maxime Ripard
  1 sibling, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-24  9:16 UTC (permalink / raw)
  To: linux-arm-kernel


On Tue, 24 Apr 2018 10:49:11 +0200, Miquel Raynal
<miquel.raynal@bootlin.com> wrote:

> Hi Maxime,
> 
> On Tue, 24 Apr 2018 09:55:05 +0200, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> 
> > On Mon, Apr 23, 2018 at 12:27:52PM +0200, Miquel Raynal wrote:  
> > > > >  	sun8i-r16-parrot.dtb \
> > > > >  	sun8i-r40-bananapi-m2-ultra.dtb \
> > > > >  	sun8i-v3s-licheepi-zero.dtb \
> > > > > diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> > > > > index 6b9e85b4ba0f..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>;      
> > > > 
> > > > 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.    
> > 
> > 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.

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

> 
> 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
> 

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

* [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support
  2018-04-24  8:49         ` Miquel Raynal
  2018-04-24  9:16           ` Miquel Raynal
@ 2018-04-24 11:05           ` Maxime Ripard
  1 sibling, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2018-04-24 11:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 24, 2018 at 10:49:11AM +0200, Miquel Raynal wrote:
> Hi Maxime,
> 
> On Tue, 24 Apr 2018 09:55:05 +0200, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> 
> > On Mon, Apr 23, 2018 at 12:27:52PM +0200, Miquel Raynal wrote:
> > > > >  	sun8i-r16-parrot.dtb \
> > > > >  	sun8i-r40-bananapi-m2-ultra.dtb \
> > > > >  	sun8i-v3s-licheepi-zero.dtb \
> > > > > diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> > > > > index 6b9e85b4ba0f..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>;    
> > > > 
> > > > 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.  
> > 
> > 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.

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.

> 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

-- 
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>

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

end of thread, other threads:[~2018-04-24 11:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-21 16:42 [PATCH v3 0/2] Add Nintendo NES/SuperNES classic support Miquel Raynal
2018-04-21 16:42 ` [PATCH v3 1/2] ARM: dts: sun8i: a23/a33: declare NAND pins Miquel Raynal
2018-04-21 16:42 ` [PATCH v3 2/2] ARM: dts: nes: add Nintendo NES/SuperNES Classic Edition support Miquel Raynal
2018-04-23  7:24   ` Maxime Ripard
2018-04-23 10:27     ` Miquel Raynal
2018-04-24  7:55       ` Maxime Ripard
2018-04-24  8:05         ` Miquel Raynal
2018-04-24  8:49         ` Miquel Raynal
2018-04-24  9:16           ` Miquel Raynal
2018-04-24 11:05           ` 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.