Skip to contentSkip to conversation

arm64: renesas: r8a779f0: Add INTC-EX support

PATCH Superseded Geert Uytterhoeven 4 participants 11 messages Jul 26, 2023 – Jul 27, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

cover arm64: renesas: r8a779f0: Add INTC-EX support

Hi all,

This patch series attempts to support for the Interrupt Controller for External Devices (INTC-EX) on the Renesas R-Car S4-8 (R8A779F0) SoC.

As I do not have physical access to a Spider development board, I am sending this out to a limited audience, and hope someone can test it, using patch 3/3.

Thanks for testing, and for your comments!

Geert Uytterhoeven (3):
dt-bindings: irqchip: renesas,irqc: Add r8a779f0 support
arm64: dts: renesas: r8a779f0: Add INTC-EX node
[RFT] arm64: dts: renesas: spider: Add keyboard to test IRQ[0145]

 .../interrupt-controller/renesas,irqc.yaml    |  1 +
 .../boot/dts/renesas/r8a779f0-spider.dts      | 52 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi     | 15 ++++++
 3 files changed, 68 insertions(+)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH 1/3 dt-bindings: irqchip: renesas,irqc: Add r8a779f0 support

Document support for the Interrupt Controller for External Devices (INT-EX) in the Renesas R-Car S4-8 (R8A779F0) SoC.

---
 .../devicetree/bindings/interrupt-controller/renesas,irqc.yaml   | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml +1 -0
index 95033cb514fbd8f6..b417341fc8ae049b 100644
@@ -37,6 +37,7 @@ properties:
           - renesas,intc-ex-r8a77990    # R-Car E3
           - renesas,intc-ex-r8a77995    # R-Car D3
           - renesas,intc-ex-r8a779a0    # R-Car V3U
+          - renesas,intc-ex-r8a779f0    # R-Car S4-8
           - renesas,intc-ex-r8a779g0    # R-Car V4H
       - const: renesas,irqc
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] dt-bindings: irqchip: renesas,irqc: Add r8a779f0 support

Quoting Geert Uytterhoeven (2023-07-26 15:44:41)

Quoted 3 lines

Document support for the Interrupt Controller for External Devices (INT-EX) in the Renesas R-Car S4-8 (R8A779F0) SoC.

Quoted 20 lines
---
 .../devicetree/bindings/interrupt-controller/renesas,irqc.yaml   | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml +1 -0
index 95033cb514fbd8f6..b417341fc8ae049b 100644
@@ -37,6 +37,7 @@ properties:
           - renesas,intc-ex-r8a77990    # R-Car E3
           - renesas,intc-ex-r8a77995    # R-Car D3
           - renesas,intc-ex-r8a779a0    # R-Car V3U
+          - renesas,intc-ex-r8a779f0    # R-Car S4-8
           - renesas,intc-ex-r8a779g0    # R-Car V4H
       - const: renesas,irqc
 
Signature · 1 line
2.34.1
author maintainer
#3 lore raw

PATCH 2/3 arm64: dts: renesas: r8a779f0: Add INTC-EX node

In reply to Geert Uytterhoeven

Add the device node for the Interrupt Controller for External Devices (INTC-EX) on the Renesas R-Car S4-8 (R8A779F0) SoC, which serves external IRQ pins IRQ[0-5].

---
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/renesas/r8a779f0.dtsi +15 -0
index 1d5426e6293c5616..0059c9c580f3f9ef 100644
@@ -466,6 +466,21 @@ tsc: thermal@e6198000 {
 			#thermal-sensor-cells = <1>;
 		};
 
+		intc_ex: interrupt-controller@e61c0000 {
+			compatible = "renesas,intc-ex-r8a779f0", "renesas,irqc";
+			#interrupt-cells = <2>;
+			interrupt-controller;
+			reg = <0 0xe61c0000 0 0x200>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_CORE R8A779F0_CLK_CL16M>;
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+		};
+
 		tmu0: timer@e61e0000 {
 			compatible = "renesas,tmu-r8a779f0", "renesas,tmu";
 			reg = <0 0xe61e0000 0 0x30>;
Signature · 1 line
2.34.1
Tested-by Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] arm64: dts: renesas: r8a779f0: Add INTC-EX node

Quoting Geert Uytterhoeven (2023-07-26 15:44:42)

Quoted 3 lines

Add the device node for the Interrupt Controller for External Devices (INTC-EX) on the Renesas R-Car S4-8 (R8A779F0) SoC, which serves external IRQ pins IRQ[0-5].

Well, I believe we have at least validated the core intc_ex with the test in 3/3... so

Quoted 34 lines
---
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/renesas/r8a779f0.dtsi +15 -0
index 1d5426e6293c5616..0059c9c580f3f9ef 100644
@@ -466,6 +466,21 @@ tsc: thermal@e6198000 {
                        #thermal-sensor-cells = <1>;
                };
 
+               intc_ex: interrupt-controller@e61c0000 {
+                       compatible = "renesas,intc-ex-r8a779f0", "renesas,irqc";
+                       #interrupt-cells = <2>;
+                       interrupt-controller;
+                       reg = <0 0xe61c0000 0 0x200>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_CL16M>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+               };
+
                tmu0: timer@e61e0000 {
                        compatible = "renesas,tmu-r8a779f0", "renesas,tmu";
                        reg = <0 0xe61e0000 0 0x30>;
Signature · 1 line
2.34.1
author maintainer
#5 lore raw

PATCH 3/3 arm64: dts: renesas: spider: Add keyboard to test IRQ[0145]

In reply to Geert Uytterhoeven

Add an interrupt-controlled keyboard to test operation of the Interrupt Controller for External Devices (INTC-EX) on the Spider development board.

Test procedure:
- Run "evtest" (select device event number "0"),
- Pull one of the following signals on the Spider Breakout Board low to trigger the corresponding interrupt and keypress (key release is automatic):
- Test point CP18 -> IRQ0 (KEY_0),
- Test point CP17 -> IRQ1 (KEY_1),
- CN37 pin 4 -> IRQ4 (KEY_4),
- CN37 pin 2 -> IRQ5 (KEY_5).

GND is available on e.g. pin 8 of CN37 (MSIOF0 PIN HEADER).

---
Not intended for upstream merge.

I do not have physical access to a Spider development board. Thanks for testing!

Note that this IRQ conflicts with operation of LED7, so do not apply the LED patch while testing.

---
 .../boot/dts/renesas/r8a779f0-spider.dts      | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
arch/arm64/boot/dts/renesas/r8a779f0-spider.dts +52 -0
index 7aac3f4d319c330c..a73251da1f215141 100644
@@ -6,12 +6,56 @@
  */
 
 /dts-v1/;
+
+#include <dt-bindings/input/input.h>
+
 #include "r8a779f0-spider-cpu.dtsi"
 #include "r8a779f0-spider-ethernet.dtsi"
 
 / {
 	model = "Renesas Spider CPU and Breakout boards based on r8a779f0";
 	compatible = "renesas,spider-breakout", "renesas,spider-cpu", "renesas,r8a779f0";
+
+	keyboard-irq {
+		compatible = "gpio-keys";
+
+		pinctrl-0 = <&keyboard_irq_pins>;
+		pinctrl-names = "default";
+
+		interrupt-parent = <&intc_ex>;
+
+		key-0 {
+			interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+			linux,code = <KEY_0>;
+			label = "Breakabout Board CP18";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		key-1 {
+			interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+			linux,code = <KEY_1>;
+			label = "Breakabout Board CP17";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		key-4 {
+			interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
+			linux,code = <KEY_4>;
+			label = "Breakout Board CN37-4";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		key-5 {
+			interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
+			linux,code = <KEY_5>;
+			label = "Breakout Board CN37-2";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+	};
 };
 
 &i2c4 {
@@ -22,3 +66,11 @@ eeprom@51 {
 		pagesize = <8>;
 	};
 };
+
+&pfc {
+	keyboard_irq_pins: keyboard-irq {
+		groups = "intc_ex_irq0", "intc_ex_irq1", "intc_ex_irq4",
+			 "intc_ex_irq5";
+		function = "intc_ex";
+	};
+};
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH/RFT 3/3] arm64: dts: renesas: spider: Add keyboard to test IRQ[0145]

Quoted 14 lines · Geert Uytterhoeven

Add an interrupt-controlled keyboard to test operation of the Interrupt Controller for External Devices (INTC-EX) on the Spider development board.

Test procedure:
- Run "evtest" (select device event number "0"),
- Pull one of the following signals on the Spider Breakout Board low to trigger the corresponding interrupt and keypress (key release is automatic):
- Test point CP18 -> IRQ0 (KEY_0),
- Test point CP17 -> IRQ1 (KEY_1),
- CN37 pin 4 -> IRQ4 (KEY_4),
- CN37 pin 2 -> IRQ5 (KEY_5).

Quoted 8 lines

GND is available on e.g. pin 8 of CN37 (MSIOF0 PIN HEADER).

---
Not intended for upstream merge.

I do not have physical access to a Spider development board. Thanks for testing!

Kieran and I held a remote test session over IRC and Jitsi, and IRQ4 and IRQ5 are confirmed working.
We couldn't locate test points CP17 and CP18, though.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Tested-by on v1 3/3
#7 lore raw

Re: [PATCH/RFT 3/3] arm64: dts: renesas: spider: Add keyboard to test IRQ[0145]

In reply to Geert Uytterhoeven

Quoting Geert Uytterhoeven (2023-07-26 15:44:43)

Quoted 4 lines

Add an interrupt-controlled keyboard to test operation of the Interrupt Controller for External Devices (INTC-EX) on the Spider development board.

Quoted 9 lines

Test procedure:
- Run "evtest" (select device event number "0"),
- Pull one of the following signals on the Spider Breakout Board low to trigger the corresponding interrupt and keypress (key release is automatic):
- Test point CP18 -> IRQ0 (KEY_0),
- Test point CP17 -> IRQ1 (KEY_1),
- CN37 pin 4 -> IRQ4 (KEY_4),
- CN37 pin 2 -> IRQ5 (KEY_5).

Pin 4 working, while Pin 2 fires 'once'.

CP18/CP17 yet to be found.

In cooperation with Geert ...

Quoted 92 lines

GND is available on e.g. pin 8 of CN37 (MSIOF0 PIN HEADER).

---
Not intended for upstream merge.

I do not have physical access to a Spider development board. Thanks for testing!

Note that this IRQ conflicts with operation of LED7, so do not apply the LED patch while testing.

---
 .../boot/dts/renesas/r8a779f0-spider.dts      | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
arch/arm64/boot/dts/renesas/r8a779f0-spider.dts +52 -0
index 7aac3f4d319c330c..a73251da1f215141 100644
@@ -6,12 +6,56 @@
  */
 
 /dts-v1/;
+
+#include <dt-bindings/input/input.h>
+
 #include "r8a779f0-spider-cpu.dtsi"
 #include "r8a779f0-spider-ethernet.dtsi"
 
 / {
        model = "Renesas Spider CPU and Breakout boards based on r8a779f0";
        compatible = "renesas,spider-breakout", "renesas,spider-cpu", "renesas,r8a779f0";
+
+       keyboard-irq {
+               compatible = "gpio-keys";
+
+               pinctrl-0 = <&keyboard_irq_pins>;
+               pinctrl-names = "default";
+
+               interrupt-parent = <&intc_ex>;
+
+               key-0 {
+                       interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+                       linux,code = <KEY_0>;
+                       label = "Breakabout Board CP18";
+                       wakeup-source;
+                       debounce-interval = <20>;
+               };
+
+               key-1 {
+                       interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+                       linux,code = <KEY_1>;
+                       label = "Breakabout Board CP17";
+                       wakeup-source;
+                       debounce-interval = <20>;
+               };
+
+               key-4 {
+                       interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
+                       linux,code = <KEY_4>;
+                       label = "Breakout Board CN37-4";
+                       wakeup-source;
+                       debounce-interval = <20>;
+               };
+
+               key-5 {
+                       interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
+                       linux,code = <KEY_5>;
+                       label = "Breakout Board CN37-2";
+                       wakeup-source;
+                       debounce-interval = <20>;
+               };
+       };
 };
 
 &i2c4 {
@@ -22,3 +66,11 @@ eeprom@51 {
                pagesize = <8>;
        };
 };
+
+&pfc {
+       keyboard_irq_pins: keyboard-irq {
+               groups = "intc_ex_irq0", "intc_ex_irq1", "intc_ex_irq4",
+                        "intc_ex_irq5";
+               function = "intc_ex";
+       };
+};
Signature · 1 line
2.34.1
Tested-by on v1 3/3
#8 lore raw

RE: [PATCH/RFT 3/3] arm64: dts: renesas: spider: Add keyboard to test IRQ[0145]

In reply to Geert Uytterhoeven

Hi Geert-san,

Quoted 16 lines

From: Geert Uytterhoeven, Sent: Wednesday, July 26, 2023 11:45 PM

Add an interrupt-controlled keyboard to test operation of the Interrupt Controller for External Devices (INTC-EX) on the Spider development board.

Test procedure:
- Run "evtest" (select device event number "0"),
- Pull one of the following signals on the Spider Breakout Board low to trigger the corresponding interrupt and keypress (key release is automatic):
- Test point CP18 -> IRQ0 (KEY_0),
- Test point CP17 -> IRQ1 (KEY_1),
- CN37 pin 4 -> IRQ4 (KEY_4),
- CN37 pin 2 -> IRQ5 (KEY_5).

Quoted 5 lines

GND is available on e.g. pin 8 of CN37 (MSIOF0 PIN HEADER).

---
Not intended for upstream merge.

Thank you for the patch! I got it.

Quoted 5 lines

I do not have physical access to a Spider development board. Thanks for testing!

Note that this IRQ conflicts with operation of LED7, so do not apply the LED patch while testing.

I also tested on my Spider board about IRQ4 and IRQ5.

# For the record. My environment is Spider ES1.2 board which has a switch board. # Since the SW3 pin 7 of the switch board is low, we cannot use CN37. # However, we can use the SW3 pin 7 instead.

Best regards,
Yoshihiro Shimoda

Quoted 79 lines
---
 .../boot/dts/renesas/r8a779f0-spider.dts      | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
arch/arm64/boot/dts/renesas/r8a779f0-spider.dts +52 -1
index 7aac3f4d319c330c..a73251da1f215141 100644
@@ -6,12 +6,56 @@
  */
 
 /dts-v1/;
+
+#include <dt-bindings/input/input.h>
+
 #include "r8a779f0-spider-cpu.dtsi"
 #include "r8a779f0-spider-ethernet.dtsi"
 
 / {
 	model = "Renesas Spider CPU and Breakout boards based on r8a779f0";
 	compatible = "renesas,spider-breakout", "renesas,spider-cpu", "renesas,r8a779f0";
+
+	keyboard-irq {
+		compatible = "gpio-keys";
+
+		pinctrl-0 = <&keyboard_irq_pins>;
+		pinctrl-names = "default";
+
+		interrupt-parent = <&intc_ex>;
+
+		key-0 {
+			interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+			linux,code = <KEY_0>;
+			label = "Breakabout Board CP18";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		key-1 {
+			interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+			linux,code = <KEY_1>;
+			label = "Breakabout Board CP17";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		key-4 {
+			interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
+			linux,code = <KEY_4>;
+			label = "Breakout Board CN37-4";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		key-5 {
+			interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
+			linux,code = <KEY_5>;
+			label = "Breakout Board CN37-2";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+	};
 };
 
 &i2c4 {
@@ -22,3 +66,11 @@ eeprom@51 {
 		pagesize = <8>;
 	};
 };
+
+&pfc {
+	keyboard_irq_pins: keyboard-irq {
+		groups = "intc_ex_irq0", "intc_ex_irq1", "intc_ex_irq4",
+			 "intc_ex_irq5";
+		function = "intc_ex";
+	};
+};
--

2.34.1

#9 lore raw

Re: [PATCH/RFT 3/3] arm64: dts: renesas: spider: Add keyboard to test IRQ[0145]

Hi Shimoda-san,

Quoted 30 lines · Yoshihiro Shimoda
Quoted 16 lines

From: Geert Uytterhoeven, Sent: Wednesday, July 26, 2023 11:45 PM

Add an interrupt-controlled keyboard to test operation of the Interrupt Controller for External Devices (INTC-EX) on the Spider development board.

Test procedure:
- Run "evtest" (select device event number "0"),
- Pull one of the following signals on the Spider Breakout Board low to trigger the corresponding interrupt and keypress (key release is automatic):
- Test point CP18 -> IRQ0 (KEY_0),
- Test point CP17 -> IRQ1 (KEY_1),
- CN37 pin 4 -> IRQ4 (KEY_4),
- CN37 pin 2 -> IRQ5 (KEY_5).

Quoted 5 lines

GND is available on e.g. pin 8 of CN37 (MSIOF0 PIN HEADER).

---
Not intended for upstream merge.

Thank you for the patch! I got it.

Quoted 5 lines

I do not have physical access to a Spider development board. Thanks for testing!

Note that this IRQ conflicts with operation of LED7, so do not apply the LED patch while testing.

Quoted 7 lines

I also tested on my Spider board about IRQ4 and IRQ5.

# For the record. My environment is Spider ES1.2 board which has a switch board. # Since the SW3 pin 7 of the switch board is low, we cannot use CN37. # However, we can use the SW3 pin 7 instead.

Thanks for testing!
I will convert this to a DTS overlay, and will add it to my topic/renesas-overlays
branch.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Reviewed-by on the v1 series
#10 lore raw
In reply to Geert Uytterhoeven

Hi Geert-san,

Quoted 4 lines

From: Geert Uytterhoeven, Sent: Wednesday, July 26, 2023 11:45 PM

Hi all,

Quoted 8 lines

This patch series attempts to support for the Interrupt Controller for External Devices (INTC-EX) on the Renesas R-Car S4-8 (R8A779F0) SoC.

As I do not have physical access to a Spider development board, I am sending this out to a limited audience, and hope someone can test it, using patch 3/3.

Thanks for testing, and for your comments!

Thank you for the patches!

Best regards,
Yoshihiro Shimoda

Quoted 23 lines

Geert Uytterhoeven (3):
dt-bindings: irqchip: renesas,irqc: Add r8a779f0 support
arm64: dts: renesas: r8a779f0: Add INTC-EX node
[RFT] arm64: dts: renesas: spider: Add keyboard to test IRQ[0145]

 .../interrupt-controller/renesas,irqc.yaml    |  1 +
 .../boot/dts/renesas/r8a779f0-spider.dts      | 52 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi     | 15 ++++++
 3 files changed, 68 insertions(+)

--
2.34.1

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds