[PATCH 05/13] arm64: dts: renesas: r9a09g077m44-rzt2h-evk: Add user LEDs

Prabhakar posted 13 patches 1 month, 3 weeks ago
[PATCH 05/13] arm64: dts: renesas: r9a09g077m44-rzt2h-evk: Add user LEDs
Posted by Prabhakar 1 month, 3 weeks ago
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Add USER LED0-LED8, which are available on RZ/T2H EVK.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 .../dts/renesas/r9a09g077m44-rzt2h-evk.dts    | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts
index 486584fefead..a0cf01978f15 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts
+++ b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts
@@ -7,10 +7,61 @@
 
 /dts-v1/;
 
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h>
+
 #include "r9a09g077m44.dtsi"
 #include "rzt2h-n2h-evk-common.dtsi"
 
 / {
 	model = "Renesas RZ/T2H EVK Board based on r9a09g077m44";
 	compatible = "renesas,rzt2h-evk", "renesas,r9a09g077m44", "renesas,r9a09g077";
+
+	leds {
+		compatible = "gpio-leds";
+
+		led0 {
+			/* SW8-9: ON, SW8-10: OFF */
+			gpios = <&pinctrl RZT2H_GPIO(23, 1) GPIO_ACTIVE_LOW>;
+		};
+
+		led1 {
+			/* SW5-1: OFF, SW5-2: ON */
+			gpios = <&pinctrl RZT2H_GPIO(32, 2) GPIO_ACTIVE_LOW>;
+		};
+
+		led2 {
+			gpios = <&pinctrl RZT2H_GPIO(6, 7) GPIO_ACTIVE_LOW>;
+		};
+
+		led3 {
+			/* SW2-3: OFF */
+			gpios = <&pinctrl RZT2H_GPIO(8, 5) GPIO_ACTIVE_LOW>;
+		};
+
+		led4 {
+			/* SW8-3: ON, SW8-4: OFF */
+			gpios = <&pinctrl RZT2H_GPIO(18, 0) GPIO_ACTIVE_LOW>;
+		};
+
+		led5 {
+			/* SW8-1: ON, SW8-2: OFF */
+			gpios = <&pinctrl RZT2H_GPIO(18, 1) GPIO_ACTIVE_LOW>;
+		};
+
+		led6 {
+			/* SW5-9: OFF, SW5-10: ON */
+			gpios = <&pinctrl RZT2H_GPIO(22, 7) GPIO_ACTIVE_LOW>;
+		};
+
+		led7 {
+			/* SW5-7: OFF, SW5-8: ON */
+			gpios = <&pinctrl RZT2H_GPIO(23, 0) GPIO_ACTIVE_LOW>;
+		};
+
+		led8 {
+			/* SW7-5: OFF, SW7-6: ON */
+			gpios = <&pinctrl RZT2H_GPIO(23, 5) GPIO_ACTIVE_LOW>;
+		};
+	};
 };
-- 
2.50.1
Re: [PATCH 05/13] arm64: dts: renesas: r9a09g077m44-rzt2h-evk: Add user LEDs
Posted by Geert Uytterhoeven 1 month, 2 weeks ago
Hi Prabhakar,

Thanks for your patch!

On Tue, 12 Aug 2025 at 22:03, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Add USER LED0-LED8, which are available on RZ/T2H EVK.

According to the schematics, only the first four are user LEDs?

>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

> --- a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts
> +++ b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts
> @@ -7,10 +7,61 @@
>
>  /dts-v1/;
>
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h>
> +
>  #include "r9a09g077m44.dtsi"
>  #include "rzt2h-n2h-evk-common.dtsi"
>
>  / {
>         model = "Renesas RZ/T2H EVK Board based on r9a09g077m44";
>         compatible = "renesas,rzt2h-evk", "renesas,r9a09g077m44", "renesas,r9a09g077";
> +
> +       leds {
> +               compatible = "gpio-leds";
> +
> +               led0 {

led-0

Cfr. Documentation/devicetree/bindings/leds/leds-gpio.yaml:

    # The first form is preferred, but fall back to just 'led' anywhere in the
    # node name to at least catch some child nodes.
    "(^led-[0-9a-f]$|led)":

> +                       /* SW8-9: ON, SW8-10: OFF */
> +                       gpios = <&pinctrl RZT2H_GPIO(23, 1) GPIO_ACTIVE_LOW>;

color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_DEBUG;
function-enumerator = <0>;

> +               };
> +
> +               led1 {
> +                       /* SW5-1: OFF, SW5-2: ON */
> +                       gpios = <&pinctrl RZT2H_GPIO(32, 2) GPIO_ACTIVE_LOW>;

color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_DEBUG;
function-enumerator = <1>;

> +               };
> +
> +               led2 {
> +                       gpios = <&pinctrl RZT2H_GPIO(6, 7) GPIO_ACTIVE_LOW>;

color = <LED_COLOR_ID_YELLOW>;
function = LED_FUNCTION_DEBUG;
function-enumerator = <2>;

> +               };
> +
> +               led3 {
> +                       /* SW2-3: OFF */
> +                       gpios = <&pinctrl RZT2H_GPIO(8, 5) GPIO_ACTIVE_LOW>;

color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_DEBUG;
function-enumerator = <3>;

> +               };
> +
> +               led4 {
> +                       /* SW8-3: ON, SW8-4: OFF */
> +                       gpios = <&pinctrl RZT2H_GPIO(18, 0) GPIO_ACTIVE_LOW>;

Schematics say "run", so perhaps LED_FUNCTION_ACTIVITY?

    color = <LED_COLOR_ID_GREEN>;
    function = LED_FUNCTION_ACTIVITY;

> +               };
> +
> +               led5 {
> +                       /* SW8-1: ON, SW8-2: OFF */
> +                       gpios = <&pinctrl RZT2H_GPIO(18, 1) GPIO_ACTIVE_LOW>;

Schematics say "error", so

    color = <LED_COLOR_ID_RED>;
    function = LED_FUNCTION_FAULT;

> +               };
> +
> +               led6 {
> +                       /* SW5-9: OFF, SW5-10: ON */
> +                       gpios = <&pinctrl RZT2H_GPIO(22, 7) GPIO_ACTIVE_LOW>;

Schematics says Ether-Cat link-activity, so LED_FUNCTION_LAN?

    color = <LED_COLOR_ID_GREEN>;
    function = LED_FUNCTION_LAN;
    function-enumerator = <0>;

> +               };
> +
> +               led7 {
> +                       /* SW5-7: OFF, SW5-8: ON */
> +                       gpios = <&pinctrl RZT2H_GPIO(23, 0) GPIO_ACTIVE_LOW>;

color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;

> +               };
> +
> +               led8 {
> +                       /* SW7-5: OFF, SW7-6: ON */
> +                       gpios = <&pinctrl RZT2H_GPIO(23, 5) GPIO_ACTIVE_LOW>;

color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;

> +               };
> +       };
>  };

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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
Re: [PATCH 05/13] arm64: dts: renesas: r9a09g077m44-rzt2h-evk: Add user LEDs
Posted by Lad, Prabhakar 1 month, 2 weeks ago
Hi Geert,

Thank you for the review.

On Mon, Aug 18, 2025 at 2:15 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Prabhakar,
>
> Thanks for your patch!
>
> On Tue, 12 Aug 2025 at 22:03, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > Add USER LED0-LED8, which are available on RZ/T2H EVK.
>
> According to the schematics, only the first four are user LEDs?
>
As per [0] user manual Table 7-4, LEDs4-8 can be used as USER LEDs or
for Ethercat Slave. Since ESC is not enabled I haven't added any
#ifdefs.

[0] https://www.renesas.com/en/document/mat/rzt2h-evaluation-board-kit-users-manual?r=25567073

> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> > --- a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts
> > +++ b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts
> > @@ -7,10 +7,61 @@
> >
> >  /dts-v1/;
> >
> > +#include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h>
> > +
> >  #include "r9a09g077m44.dtsi"
> >  #include "rzt2h-n2h-evk-common.dtsi"
> >
> >  / {
> >         model = "Renesas RZ/T2H EVK Board based on r9a09g077m44";
> >         compatible = "renesas,rzt2h-evk", "renesas,r9a09g077m44", "renesas,r9a09g077";
> > +
> > +       leds {
> > +               compatible = "gpio-leds";
> > +
> > +               led0 {
>
> led-0
>
Ok.
> Cfr. Documentation/devicetree/bindings/leds/leds-gpio.yaml:
>
Thanks for the pointer.

>     # The first form is preferred, but fall back to just 'led' anywhere in the
>     # node name to at least catch some child nodes.
>     "(^led-[0-9a-f]$|led)":
>
> > +                       /* SW8-9: ON, SW8-10: OFF */
> > +                       gpios = <&pinctrl RZT2H_GPIO(23, 1) GPIO_ACTIVE_LOW>;
>
> color = <LED_COLOR_ID_GREEN>;
> function = LED_FUNCTION_DEBUG;
> function-enumerator = <0>;
>
> > +               };
> > +
> > +               led1 {
> > +                       /* SW5-1: OFF, SW5-2: ON */
> > +                       gpios = <&pinctrl RZT2H_GPIO(32, 2) GPIO_ACTIVE_LOW>;
>
> color = <LED_COLOR_ID_GREEN>;
> function = LED_FUNCTION_DEBUG;
> function-enumerator = <1>;
>
> > +               };
> > +
> > +               led2 {
> > +                       gpios = <&pinctrl RZT2H_GPIO(6, 7) GPIO_ACTIVE_LOW>;
>
> color = <LED_COLOR_ID_YELLOW>;
> function = LED_FUNCTION_DEBUG;
> function-enumerator = <2>;
>
> > +               };
> > +
> > +               led3 {
> > +                       /* SW2-3: OFF */
> > +                       gpios = <&pinctrl RZT2H_GPIO(8, 5) GPIO_ACTIVE_LOW>;
>
> color = <LED_COLOR_ID_RED>;
> function = LED_FUNCTION_DEBUG;
> function-enumerator = <3>;
>
> > +               };
> > +
> > +               led4 {
> > +                       /* SW8-3: ON, SW8-4: OFF */
> > +                       gpios = <&pinctrl RZT2H_GPIO(18, 0) GPIO_ACTIVE_LOW>;
>
> Schematics say "run", so perhaps LED_FUNCTION_ACTIVITY?
>
>     color = <LED_COLOR_ID_GREEN>;
>     function = LED_FUNCTION_ACTIVITY;
>
Perhaps I'll have LED_FUNCTION_DEBUG for LEDs4-8 as currently they are
used as USER LEDs and  function-enumerator = 4/5/6/7?

Cheers,
Prabhakar

> > +               };
> > +
> > +               led5 {
> > +                       /* SW8-1: ON, SW8-2: OFF */
> > +                       gpios = <&pinctrl RZT2H_GPIO(18, 1) GPIO_ACTIVE_LOW>;
>
> Schematics say "error", so
>
>     color = <LED_COLOR_ID_RED>;
>     function = LED_FUNCTION_FAULT;
>
> > +               };
> > +
> > +               led6 {
> > +                       /* SW5-9: OFF, SW5-10: ON */
> > +                       gpios = <&pinctrl RZT2H_GPIO(22, 7) GPIO_ACTIVE_LOW>;
>
> Schematics says Ether-Cat link-activity, so LED_FUNCTION_LAN?
>
>     color = <LED_COLOR_ID_GREEN>;
>     function = LED_FUNCTION_LAN;
>     function-enumerator = <0>;
>
> > +               };
> > +
> > +               led7 {
> > +                       /* SW5-7: OFF, SW5-8: ON */
> > +                       gpios = <&pinctrl RZT2H_GPIO(23, 0) GPIO_ACTIVE_LOW>;
>
> color = <LED_COLOR_ID_GREEN>;
> function = LED_FUNCTION_LAN;
> function-enumerator = <1>;
>
> > +               };
> > +
> > +               led8 {
> > +                       /* SW7-5: OFF, SW7-6: ON */
> > +                       gpios = <&pinctrl RZT2H_GPIO(23, 5) GPIO_ACTIVE_LOW>;
>
> color = <LED_COLOR_ID_GREEN>;
> function = LED_FUNCTION_LAN;
> function-enumerator = <2>;
>
> > +               };
> > +       };
> >  };
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> 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
Re: [PATCH 05/13] arm64: dts: renesas: r9a09g077m44-rzt2h-evk: Add user LEDs
Posted by Geert Uytterhoeven 1 month, 2 weeks ago
Hi Prabhakar,

On Mon, 18 Aug 2025 at 15:40, Lad, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> On Mon, Aug 18, 2025 at 2:15 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Tue, 12 Aug 2025 at 22:03, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > >
> > > Add USER LED0-LED8, which are available on RZ/T2H EVK.
> >
> > According to the schematics, only the first four are user LEDs?
> >
> As per [0] user manual Table 7-4, LEDs4-8 can be used as USER LEDs or
> for Ethercat Slave. Since ESC is not enabled I haven't added any
> #ifdefs.

OK

> [0] https://www.renesas.com/en/document/mat/rzt2h-evaluation-board-kit-users-manual?r=25567073
>
> > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > > --- a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts
> > > +++ b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts

> Perhaps I'll have LED_FUNCTION_DEBUG for LEDs4-8 as currently they are
> used as USER LEDs and  function-enumerator = 4/5/6/7?

That sounds fine, thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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