arm: dts: bcm2711: Describe Ethernet LEDs
authorFlorian Fainelli <florian.fainelli@broadcom.com>
Tue, 23 Apr 2024 19:14:55 +0000 (12:14 -0700)
committerFlorian Fainelli <florian.fainelli@broadcom.com>
Fri, 26 Apr 2024 18:21:45 +0000 (11:21 -0700)
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.

Link: https://lore.kernel.org/r/20240423191500.1443636-1-florian.fainelli@broadcom.com
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts
arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts
arch/arm/boot/dts/broadcom/bcm2711-rpi-cm4-io.dts

index cfc8cb5e10ba7f7aecc6961575d138df3439680d..353bb50ce5425c9763f1a1f9d067bf1055ce4bb2 100644 (file)
@@ -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";
        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";
+                       };
+               };
        };
 };
 
index 5a2869a18bd555cbacdb92c5a7cdee18cf6ef842..ca9be91b4f365475610bf2f50ef4a44f94b8310e 100644 (file)
@@ -30,6 +30,7 @@
 
 &genet_mdio {
        clock-frequency = <1950000>;
+       /delete-node/ leds;
 };
 
 &led_pwr {
index 7c6a5bdf48aa1cff30664054770af9effe6a99f8..6bc77dd48c0d9b26b19968cb6f337fb8c03ab421 100644 (file)
@@ -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"
        };
 };
 
+&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>;
 };