devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] ARM: dts: renesas: r9a06g032-rzn1d400-eb: describe LEDs
@ 2025-09-19 10:07 Wolfram Sang
  2025-09-22 19:26 ` Rob Herring
  2025-09-26  9:02 ` Geert Uytterhoeven
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2025-09-19 10:07 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, devicetree

To be able to use the LEDs, a configuration switch has to be set to a
non-default value. So, infrastructure to support these switches (which
modify signal routing via the CPLD on the demo board (DB)) is added as
well.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

This patch depends on "[PATCH v3 5/8] ARM: dts: r9a06g032: Add GPIO
controllers" which is still in-flight. I send this out as RFC already,
so we can discuss the introduction of the switch dependant settings. I
copied this approach form RZ/G3S.
 

 .../renesas/r9a06g032-rzn1d400-db-switches.h  | 22 ++++++++++++++
 .../dts/renesas/r9a06g032-rzn1d400-db.dts     | 30 +++++++++++++++++++
 .../dts/renesas/r9a06g032-rzn1d400-eb.dts     | 19 ++++++++++++
 3 files changed, 71 insertions(+)
 create mode 100644 arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db-switches.h

diff --git a/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db-switches.h b/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db-switches.h
new file mode 100644
index 000000000000..4560d16e7c60
--- /dev/null
+++ b/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db-switches.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * On-board switches for the Renesas RZ/N1D demo board (DB) and extension
+ * board (EB)
+ *
+ * Copyright (C) 2025 Renesas Electronics Corp.
+ */
+
+#ifndef __N1D_DB_EB_SWITCHES_H__
+#define __N1D_DB_EB_SWITCHES_H__
+
+#define SW_OFF         0
+#define SW_ON          1
+
+/*
+ * SW_2-2:
+ *     SW_OFF - enable PMOD1-3+LEDs on the extension board
+ *     SW_ON  - enable CAT/S3 (default)
+ */
+#define SW_2_2 SW_ON
+
+#endif
diff --git a/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db.dts b/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db.dts
index 3258b2e27434..849b5ad9c79d 100644
--- a/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db.dts
+++ b/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db.dts
@@ -15,6 +15,7 @@
 #include <dt-bindings/pinctrl/rzn1-pinctrl.h>
 
 #include "r9a06g032.dtsi"
+#include "r9a06g032-rzn1d400-db-switches.h"
 
 / {
 	model = "RZN1D-DB Board";
@@ -185,6 +186,14 @@ fixed-link {
 	};
 };
 
+#if SW2_2 == SW_OFF
+&gpio1 {
+	pinctrl-0 = <&pins_gpio1>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+#endif
+
 &i2c2 {
 	pinctrl-0 = <&pins_i2c2>;
 	pinctrl-names = "default";
@@ -256,6 +265,27 @@ pins_cpld: pins-cpld {
 			 <RZN1_PINMUX(122, RZN1_FUNC_USB)>;
 	};
 
+#if SW2_2 == SW_OFF
+	pins_gpio1: pins-gpio1 {
+		pinmux = <RZN1_PINMUX(80, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(81, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(82, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(83, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(84, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(85, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(86, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(87, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(88, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(89, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(90, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(91, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(92, RZN1_FUNC_GPIO)>,
+			 <RZN1_PINMUX(93, RZN1_FUNC_GPIO)>;
+		drive-strength = <12>;
+		bias-disable;
+	};
+#endif
+
 	pins_eth3: pins_eth3 {
 		pinmux = <RZN1_PINMUX(36, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
 			 <RZN1_PINMUX(37, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
diff --git a/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-eb.dts b/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-eb.dts
index 97a339b30d76..6d0e12ae4de1 100644
--- a/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-eb.dts
+++ b/arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-eb.dts
@@ -8,11 +8,30 @@
 
 #include <dt-bindings/leds/common.h>
 #include "r9a06g032-rzn1d400-db.dts"
+#include "r9a06g032-rzn1d400-db-switches.h"
 
 / {
 	model = "RZN1D-EB Board";
 	compatible = "renesas,rzn1d400-eb", "renesas,rzn1d400-db",
 		     "renesas,r9a06g032";
+
+#if SW2_2 == SW_OFF
+	leds {
+		compatible = "gpio-leds";
+
+		led-prog0 {
+			gpios = <&gpio1b 23 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_PROGRAMMING;
+		};
+
+		led-prog1 {
+			gpios = <&gpio1b 24 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_PROGRAMMING;
+		};
+	};
+#endif
 };
 
 &gmac1 {
-- 
2.47.2


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

end of thread, other threads:[~2025-09-26  9:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19 10:07 [RFC PATCH] ARM: dts: renesas: r9a06g032-rzn1d400-eb: describe LEDs Wolfram Sang
2025-09-22 19:26 ` Rob Herring
2025-09-26  9:24   ` Geert Uytterhoeven
2025-09-26  9:02 ` Geert Uytterhoeven
2025-09-26  9:15   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).