devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] arm: dts: bcm2711: Describe Ethernet LEDs
@ 2024-04-23 19:14 Florian Fainelli
  2024-04-23 19:53 ` Stefan Wahren
  2024-04-26 18:21 ` Florian Fainelli
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2024-04-23 19:14 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: andrew, Florian Fainelli, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Broadcom internal kernel review list,
	Andre Przywara, Nick Hawkins, Michal Simek, Laurent Pinchart,
	Linus Walleij, Paul Barker, Stefan Wahren, Geert Uytterhoeven,
	Uwe Kleine-König,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

Describe the Ethernet LEDs for the Raspberry Pi 4 model B board as well
as the Raspberry Pi 4 CM board. The Raspberry Pi 400 board does not
include RJ45 connector LEDs so the 'leds' node is deleted accordingly.

The Ethernet PHY LEDs are numbered in the PHY package/pin list from LED1
through LED4, however their address within the LED registers function
selector is 0-indexed.

Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
Changes in v3:

- explain LED numbering and add comments
- rename individual LED DT nodes to led@<N>

Changes in v2:

- added function = LED_FUNCTION_LAN
- rebased against latest tree

 .../arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts | 22 +++++++++++++++++
 .../arm/boot/dts/broadcom/bcm2711-rpi-400.dts |  1 +
 .../boot/dts/broadcom/bcm2711-rpi-cm4-io.dts  | 24 +++++++++++++++++++
 3 files changed, 47 insertions(+)

diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts
index cfc8cb5e10ba..353bb50ce542 100644
--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts
+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts
@@ -5,6 +5,7 @@
 #include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-peripheral.dtsi"
 #include "bcm283x-rpi-wifi-bt.dtsi"
+#include <dt-bindings/leds/common.h>
 
 / {
 	compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
@@ -204,6 +205,27 @@ &genet_mdio {
 	phy1: ethernet-phy@1 {
 		/* No PHY interrupt */
 		reg = <0x1>;
+
+		leds {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			/* LED1 */
+			led@0 {
+				reg = <0>;
+				color = <LED_COLOR_ID_GREEN>;
+				function = LED_FUNCTION_LAN;
+				default-state = "keep";
+			};
+
+			/* LED2 */
+			led@1 {
+				reg = <1>;
+				color = <LED_COLOR_ID_AMBER>;
+				function = LED_FUNCTION_LAN;
+				default-state = "keep";
+			};
+		};
 	};
 };
 
diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts
index 5a2869a18bd5..ca9be91b4f36 100644
--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts
+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts
@@ -30,6 +30,7 @@ &expgpio {
 
 &genet_mdio {
 	clock-frequency = <1950000>;
+	/delete-node/ leds;
 };
 
 &led_pwr {
diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-cm4-io.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-cm4-io.dts
index 7c6a5bdf48aa..6bc77dd48c0d 100644
--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-cm4-io.dts
+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-cm4-io.dts
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include "bcm2711-rpi-cm4.dtsi"
 #include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
@@ -110,6 +111,29 @@ rtc@51 {
 	};
 };
 
+&phy1 {
+	leds {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/* LED2 */
+		led@1 {
+			reg = <1>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			default-state = "keep";
+		};
+
+		/* LED3 */
+		led@2 {
+			reg = <2>;
+			color = <LED_COLOR_ID_AMBER>;
+			function = LED_FUNCTION_LAN;
+			default-state = "keep";
+		};
+	};
+};
+
 &led_act {
 	gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
 };
-- 
2.34.1


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

* Re: [PATCH v3] arm: dts: bcm2711: Describe Ethernet LEDs
  2024-04-23 19:14 [PATCH v3] arm: dts: bcm2711: Describe Ethernet LEDs Florian Fainelli
@ 2024-04-23 19:53 ` Stefan Wahren
  2024-04-26 18:21 ` Florian Fainelli
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Wahren @ 2024-04-23 19:53 UTC (permalink / raw)
  To: Florian Fainelli, linux-arm-kernel
  Cc: andrew, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Broadcom internal kernel review list, Andre Przywara,
	Nick Hawkins, Michal Simek, Laurent Pinchart, Linus Walleij,
	Paul Barker, Geert Uytterhoeven, Uwe Kleine-König,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

Am 23.04.24 um 21:14 schrieb Florian Fainelli:
> Describe the Ethernet LEDs for the Raspberry Pi 4 model B board as well
> as the Raspberry Pi 4 CM board. The Raspberry Pi 400 board does not
> include RJ45 connector LEDs so the 'leds' node is deleted accordingly.
>
> The Ethernet PHY LEDs are numbered in the PHY package/pin list from LED1
> through LED4, however their address within the LED registers function
> selector is 0-indexed.
>
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>


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

* Re: [PATCH v3] arm: dts: bcm2711: Describe Ethernet LEDs
  2024-04-23 19:14 [PATCH v3] arm: dts: bcm2711: Describe Ethernet LEDs Florian Fainelli
  2024-04-23 19:53 ` Stefan Wahren
@ 2024-04-26 18:21 ` Florian Fainelli
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2024-04-26 18:21 UTC (permalink / raw)
  To: bcm-kernel-feedback-list, Florian Fainelli, linux-arm-kernel
  Cc: Florian Fainelli, andrew, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara, Nick Hawkins, Michal Simek,
	Laurent Pinchart, Linus Walleij, Paul Barker, Stefan Wahren,
	Geert Uytterhoeven, Uwe Kleine-König,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

From: Florian Fainelli <f.fainelli@gmail.com>

On Tue, 23 Apr 2024 12:14:55 -0700, Florian Fainelli <florian.fainelli@broadcom.com> wrote:
> Describe the Ethernet LEDs for the Raspberry Pi 4 model B board as well
> as the Raspberry Pi 4 CM board. The Raspberry Pi 400 board does not
> include RJ45 connector LEDs so the 'leds' node is deleted accordingly.
> 
> The Ethernet PHY LEDs are numbered in the PHY package/pin list from LED1
> through LED4, however their address within the LED registers function
> selector is 0-indexed.
> 
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---

Applied to https://github.com/Broadcom/stblinux/commits/devicetree/next, thanks!
--
Florian

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

end of thread, other threads:[~2024-04-26 18:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 19:14 [PATCH v3] arm: dts: bcm2711: Describe Ethernet LEDs Florian Fainelli
2024-04-23 19:53 ` Stefan Wahren
2024-04-26 18:21 ` Florian Fainelli

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