diff mbox series

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

Message ID d6ccbb7b7a73eb35f1e1a8d85adcf9f1f980b2c1.1690382328.git.geert+renesas@glider.be (mailing list archive)
State RFC
Delegated to: Geert Uytterhoeven
Headers show
Series arm64: renesas: r8a779f0: Add INTC-EX support | expand

Commit Message

Geert Uytterhoeven July 26, 2023, 2:44 p.m. UTC
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).

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
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(+)

Comments

Geert Uytterhoeven July 26, 2023, 3:33 p.m. UTC | #1
On Wed, Jul 26, 2023 at 4:44 PM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> 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).
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> 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
Kieran Bingham July 26, 2023, 3:35 p.m. UTC | #2
Quoting Geert Uytterhoeven (2023-07-26 15:44:43)
> 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).

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

CP18/CP17 yet to be found.

In cooperation with Geert ...

Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> 


> 
> GND is available on e.g. pin 8 of CN37 (MSIOF0 PIN HEADER).
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> 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(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
> index 7aac3f4d319c330c..a73251da1f215141 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
> @@ -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
>
Yoshihiro Shimoda July 27, 2023, 5:48 a.m. UTC | #3
Hi Geert-san,

> 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).
> 
> GND is available on e.g. pin 8 of CN37 (MSIOF0 PIN HEADER).
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Not intended for upstream merge.

Thank you for the patch! I got it.

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

Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

# 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

> ---
>  .../boot/dts/renesas/r8a779f0-spider.dts      | 52 +++++++++++++++++++
>  1 file changed, 52 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
> index 7aac3f4d319c330c..a73251da1f215141 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
> @@ -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
Geert Uytterhoeven July 27, 2023, 8 a.m. UTC | #4
Hi Shimoda-san,

On Thu, Jul 27, 2023 at 7:48 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> > 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).
> >
> > GND is available on e.g. pin 8 of CN37 (MSIOF0 PIN HEADER).
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > Not intended for upstream merge.
>
> Thank you for the patch! I got it.
>
> > 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.
>
> Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>
> # 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
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
index 7aac3f4d319c330c..a73251da1f215141 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
+++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
@@ -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";
+	};
+};