arm64: dts: rockchip: rk3568-rock-3b: describe the Ethernet PHY LEDs
Subsystems (2)
PATCH 1/1 arm64: dts: rockchip: rk3568-rock-3b: describe the Ethernet PHY LEDs
From: Midgy BALON <[email protected]>
The ROCK 3B RJ45 jack carries two LEDs wired to the RTL8211F PHY LED pins. Describe them in the PHY nodes' "leds" subnode (binding:Documentation/devicetree/bindings/net/ethernet-phy.yaml) so that PHYLIB_LEDS instantiates one LED classdev per pin; the RTL8211F driver drives them in hardware via led_hw_control_set (e.g. the netdev trigger with link / rx+tx modes: amber = link, green = activity).
Tooling disclosure (per Documentation/process/generated-content.rst):
the DT hunks in this patch were drafted with AI assistance (Mistral Vibe), then reviewed by the author and verified on a ROCK 3B board:
the two PHY LEDs appear as stmmac-*:amber:lan / stmmac-*:green:lan LED classdevs and drive the RJ45 jack LEDs via the netdev trigger (amber = link, green = rx/tx activity, HW-offloaded to the PHY). Signed-off-by remains with the human author per the DCO.
---
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +32 -0
@@ -605,6 +607,22 @@ rgmii_phy0: ethernet-phy@1 { reset-assert-us = <20000>; reset-deassert-us = <50000>; reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = <LED_COLOR_ID_AMBER>; + function = LED_FUNCTION_LAN; + }; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_LAN; + }; + }; }; };
@@ -615,6 +633,22 @@ rgmii_phy1: ethernet-phy@1 { reset-assert-us = <20000>; reset-deassert-us = <50000>; reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>; + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = <LED_COLOR_ID_AMBER>; + function = LED_FUNCTION_LAN; + }; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_LAN; + }; + }; }; };
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] arm64: dts: rockchip: under-indented leds nodes in rk3568-rock-3b.dts --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] arm64: dts: rockchip: under-indented leds nodes in rk3568-rock-3b.dts
--
commit 0800df3a997571bcce7adee9bf91cb1d76d2c711
Author: Midgy BALON <[email protected]>
arm64: dts: rockchip: rk3568-rock-3b: describe the Ethernet PHY LEDs
This commit adds leds child subnodes to the rgmii_phy0 and rgmii_phy1 Ethernet PHY nodes on the Radxa ROCK 3B to describe the amber and green RJ45 jack LEDs.
Quoted 39 lines
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +24
-0@@ -580,6 +580,22 @@ rgmii_phy0: ethernet-phy@1 { reset-assert-us = <20000>; reset-deassert-us = <50000>; reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = <LED_COLOR_ID_AMBER>; + function = LED_FUNCTION_LAN; + }; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_LAN; + }; + }; }; };@@ -590,6 +606,22 @@ rgmii_phy1: ethernet-phy@1 { reset-assert-us = <20000>; reset-deassert-us = <50000>; reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>; + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = <LED_COLOR_ID_AMBER>; + function = LED_FUNCTION_LAN;
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts rgmii_phy1: ethernet-phy@1 { · line 626
Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +8
-0+ }; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_LAN; + }; + }; }; };
[Severity: Low]
This isn't a bug, but both leds child subnodes in rgmii_phy0 and rgmii_phy1 are indented by one tab instead of two (aligning with the enclosing ethernet-phy@1 nodes) and lack a blank line after reset-gpios, contrary to Documentation/devicetree/bindings/dts-coding-style.rst.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v2 1/1 arm64: dts: rockchip: rk3568-rock-3b: describe the Ethernet PHY LEDs
In reply to MidG971From: Midgy BALON <[email protected]>
The ROCK 3B RJ45 jack carries two LEDs wired to the RTL8211F PHY LED pins. Describe them in the PHY nodes' "leds" subnode (binding:Documentation/devicetree/bindings/net/ethernet-phy.yaml) so that PHYLIB_LEDS instantiates one LED classdev per pin; the RTL8211F driver drives them in hardware via led_hw_control_set (e.g. the netdev trigger with link / rx+tx modes: amber = link, green = activity).
Tooling disclosure (per Documentation/process/generated-content.rst):
the DT hunks in this patch were drafted with AI assistance (Mistral Vibe), then reviewed by the author and verified on a ROCK 3B board:
the two PHY LEDs appear as stmmac-*:amber:lan / stmmac-*:green:lan LED classdevs and drive the RJ45 jack LEDs via the netdev trigger (amber = link, green = rx/tx activity, HW-offloaded to the PHY).
Changes in v2:
- Fix leds subnode indentation (align with the enclosing PHY node) and add the blank line after reset-gpios, per the Sashiko AI review and Documentation/devicetree/bindings/dts-coding-style.rst.
---
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +34 -0
@@ -605,6 +607,23 @@ rgmii_phy0: ethernet-phy@1 { reset-assert-us = <20000>; reset-deassert-us = <50000>; reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = <LED_COLOR_ID_AMBER>; + function = LED_FUNCTION_LAN; + }; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_LAN; + }; + }; }; };
@@ -615,6 +634,23 @@ rgmii_phy1: ethernet-phy@1 { reset-assert-us = <20000>; reset-deassert-us = <50000>; reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = <LED_COLOR_ID_AMBER>; + function = LED_FUNCTION_LAN; + }; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_LAN; + }; + }; }; };