Skip to contentSkip to conversation

arm64: dts: renesas: Eagle V3M PFC/GPIO update and SPI NOR flash bitbang hack

PATCH In review Magnus Damm 2 participants 6 messages Jan 18, 2018 – Jan 19, 2018

Subsystems (2)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

cover arm64: dts: renesas: Eagle V3M PFC/GPIO update and SPI NOR flash bitbang hack

arm64: dts: renesas: Eagle V3M PFC/GPIO update and SPI NOR flash bitbang hack

[PATCH/RFC 01/03] arm64: dts: renesas: r8a77970: Add PFC node for Eagle V3M [PATCH/RFC 02/03] arm64: dts: renesas: r8a77970: Add GPIO nodes [PATCH/RFC 03/03] arm64: dts: renesas: eagle: NOR flash SPI bitbang prototype

This series gives the R-Car V3M SoC and the Eagle board an update when it comes to PFC and GPIO support. Also to test the two QSPI channels are configured as GPIOs and via SPI bitbang the SPI NOR flash chips are probed.

Patch 1 and 2 are rather ready for upstream merge:

Patch 3 is just for testing purpose and shall not be picked up:

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

Developed on top of renesas-drivers-2018-01-09-v4.15-rc7

 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts |   46 ++++++++++
 arch/arm64/boot/dts/renesas/r8a77970.dtsi      |  101 ++++++++++++++++++++++++
 2 files changed, 147 insertions(+)
author maintainer
#1 lore raw

PATCH 1/3 arm64: dts: renesas: r8a77970: Add PFC node for Eagle V3M

From: Magnus Damm <[email protected]>

Add DT nodes for the PFC on the r8a77970 SoC and hook up the SCIF console to make use of the PFC to configure the pins.

---

Depends on r8a77970 PFC support - included in latest renesas-drivers

 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts |   10 ++++++++++
 arch/arm64/boot/dts/renesas/r8a77970.dtsi      |    5 +++++
 2 files changed, 15 insertions(+)
arch/arm64/boot/dts/renesas/r8a77970-eagle.dts +10 -0
@@ -52,11 +52,21 @@
 	clock-frequency = <32768>;
 };
 
+&pfc {
+	scif0_pins: scif0 {
+		groups = "scif0_data";
+		function = "scif0";
+	};
+};
+
 &rwdt {
 	timeout-sec = <60>;
 	status = "okay";
 };
 
 &scif0 {
+	pinctrl-0 = <&scif0_pins>;
+	pinctrl-names = "default";
+
 	status = "okay";
 };
arch/arm64/boot/dts/renesas/r8a77970.dtsi +5 -0
@@ -117,6 +117,11 @@
 			reg = <0 0xe6160000 0 0x200>;
 		};
 
+		pfc: pin-controller@e6060000 {
+			compatible = "renesas,pfc-r8a77970";
+			reg = <0 0xe6060000 0 0x504>;
+		};
+
 		sysc: system-controller@e6180000 {
 			compatible = "renesas,r8a77970-sysc";
 			reg = <0 0xe6180000 0 0x440>;
#2 lore raw

Re: [PATCH/RFC 01/03] arm64: dts: renesas: r8a77970: Add PFC node for Eagle V3M

Hello!

Quoted 9 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Add DT nodes for the PFC on the r8a77970 SoC and hook up the SCIF console to make use of the PFC to configure the pins.

---

Depends on r8a77970 PFC support - included in latest renesas-drivers

Magnus, I have already posted R8A77970 PFC stuff back in November:

https://patchwork.kernel.org/patch/10053687/
https://patchwork.kernel.org/patch/10053689/

MBR, Sergei

author maintainer
#3 lore raw

PATCH 2/3 arm64: dts: renesas: r8a77970: Add GPIO nodes

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Add GPIO device nodes for the r8a77970 SoC. Each GPIO device is currently assumed to have 32 pins.

---

 arch/arm64/boot/dts/renesas/r8a77970.dtsi |   96 +++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)
arch/arm64/boot/dts/renesas/r8a77970.dtsi +96 -0
@@ -248,6 +248,102 @@
 			       <&ipmmu_ds1 22>, <&ipmmu_ds1 23>;
 		};
 
+		gpio0: gpio@e6050000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6050000 0 0x50>;
+			interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 0 32>;
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 912>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 912>;
+		};
+
+		gpio1: gpio@e6051000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6051000 0 0x50>;
+			interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 32 32>;
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 911>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 911>;
+		};
+
+		gpio2: gpio@e6052000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6052000 0 0x50>;
+			interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 64 32>;
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 910>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 910>;
+		};
+
+		gpio3: gpio@e6053000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6053000 0 0x50>;
+			interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 96 32>;
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 909>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 909>;
+		};
+
+		gpio4: gpio@e6054000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6054000 0 0x50>;
+			interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 128 32>;
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 908>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 908>;
+		};
+
+		gpio5: gpio@e6055000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6055000 0 0x50>;
+			interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 160 32>;
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 907>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 907>;
+		};
+
 		hscif0: serial@e6540000 {
 			compatible = "renesas,hscif-r8a77970",
 				     "renesas,rcar-gen3-hscif",
#4 lore raw

Re: [PATCH/RFC 02/03] arm64: dts: renesas: r8a77970: Add GPIO nodes

Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Add GPIO device nodes for the r8a77970 SoC. Each GPIO device is currently assumed to have 32 pins.

[...]

Already posted as well:

https://patchwork.kernel.org/patch/10056695/

Quoted 5 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +0 -0
@@ -248,6 +248,102 @@
  			       <&ipmmu_ds1 22>, <&ipmmu_ds1 23>;
  		};

arch/arm64/boot/dts/renesas/r8a77970.dtsi line 259

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +9 -0
 
+		gpio0: gpio@e6050000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6050000 0 0x50>;
+			interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 0 32>;
			gpio-ranges = <&pfc 0 0 22>;
Quoted 6 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +6 -0
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 912>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 912>;
+		};

arch/arm64/boot/dts/renesas/r8a77970.dtsi line 275

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +10 -0
+
+		gpio1: gpio@e6051000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6051000 0 0x50>;
+			interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 32 32>;
			gpio-ranges = <&pfc 0 32 28>;
Quoted 6 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +6 -0
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 911>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 911>;
+		};

arch/arm64/boot/dts/renesas/r8a77970.dtsi line 291

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +10 -0
+
+		gpio2: gpio@e6052000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6052000 0 0x50>;
+			interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 64 32>;
			gpio-ranges = <&pfc 0 64 17>;
Quoted 6 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +6 -0
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 910>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 910>;
+		};

arch/arm64/boot/dts/renesas/r8a77970.dtsi line 307

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +10 -0
+
+		gpio3: gpio@e6053000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6053000 0 0x50>;
+			interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 96 32>;
			gpio-ranges = <&pfc 0 96 17>;
Quoted 6 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +6 -0
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 909>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 909>;
+		};

arch/arm64/boot/dts/renesas/r8a77970.dtsi line 323

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +10 -0
+
+		gpio4: gpio@e6054000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6054000 0 0x50>;
+			interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 128 32>;
			gpio-ranges = <&pfc 0 128 6>;
Quoted 7 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +7 -0
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 908>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 908>;
+		};
+

arch/arm64/boot/dts/renesas/r8a77970.dtsi line 340

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +10 -0
+		gpio5: gpio@e6055000 {
+			compatible = "renesas,gpio-r8a77970",
+				     "renesas,rcar-gen3-gpio",
+				     "renesas,gpio-rcar";
+			reg = <0 0xe6055000 0 0x50>;
+			interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			gpio-ranges = <&pfc 0 160 32>;
+			#interrupt-cells = <2>;
			gpio-ranges = <&pfc 0 160 15>;

arch/arm64/boot/dts/renesas/r8a77970.dtsi line 349

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77970.dtsi +6 -0
+			interrupt-controller;
+			clocks = <&cpg CPG_MOD 907>;
+			power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+			resets = <&cpg 907>;
+		};
+
  		hscif0: serial@e6540000 {
  			compatible = "renesas,hscif-r8a77970",
  				     "renesas,rcar-gen3-hscif",

MBR, Sergei

author maintainer
#5 lore raw

PATCH 3/3 arm64: dts: renesas: eagle: NOR flash SPI bitbang prototype

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Drive the NOR flash chips via SPI bitbang instead of via the two channels of QSPI hardware. This is useful to test the on-chip GPIO devices.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts |   36 ++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm64/boot/dts/renesas/r8a77970-eagle.dts +36 -0
@@ -31,6 +31,42 @@
 		/* first 128MB is reserved for secure area. */
 		reg = <0x0 0x48000000 0x0 0x38000000>;
 	};
+
+	spi_flash@0 {
+		compatible = "spi-gpio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		
+		gpio-sck = <&gpio5 0 0>;
+		gpio-mosi = <&gpio5 1 0>;
+		gpio-miso = <&gpio5 2 0>;
+		cs-gpios = <&gpio5 5 0>;
+		num-chipselects = <1>;
+
+		flash@0 {
+			compatible = "jedec,spi-nor";
+			reg = <0>;
+			spi-max-frequency = <30000000>;
+		};
+	};
+
+	spi_flash@1 {
+		compatible = "spi-gpio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		
+		gpio-sck = <&gpio5 6 0>;
+		gpio-mosi = <&gpio5 7 0>;
+		gpio-miso = <&gpio5 8 0>;
+		cs-gpios = <&gpio5 11 0>;
+		num-chipselects = <1>;
+
+		flash@1 {
+			compatible = "jedec,spi-nor";
+			reg = <0>;
+			spi-max-frequency = <30000000>;
+		};
+	};
 };
 
 &avb {