[PATCH] arm64: dts: allwiner: h5: OrangePi PC2: add ethernet LEDs

Jernej Škrabec jernej.skrabec at gmail.com
Mon Sep 8 15:57:46 PDT 2025


Dne torek, 9. september 2025 ob 00:11:46 Srednjeevropski poletni čas je Aleksander Jan Bajkowski napisal(a):
> Hi Jernej,
> 
> On 9/8/25 16:45, Jernej Škrabec wrote:
> > Dne ponedeljek, 18. avgust 2025 ob 18:35:13 Srednjeevropski poletni čas je Aleksander Jan Bajkowski napisal(a):
> >> This patch adds support for Ethernet LEDs.
> > How did you tested this? According to linux-sunxi wiki, this board has
> > RTL8211E, while LED control is supported only with RTL8211F driver.
> 
> 
> For testing, I used OpenWRT snapshot with kernel 6.12. OpenWRT backported
> patches from kernel 6.16 that add LED control support. Realtek RTL8211E
> supports LED control since commit:
> 708686132ba02659267c0cebcc414348ece389a5 ("net: phy: realtek: Add 
> support for PHY LEDs on RTL8211E")

Ah, I haven't checked the latest code. Alright.

> 
> >
> >> Signed-off-by: Aleksander Jan Bajkowski<olek2 at wp.pl>
> >> ---
> >>   .../dts/allwinner/sun50i-h5-orangepi-pc2.dts  | 20 +++++++++++++++++++
> >>   1 file changed, 20 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
> >> index 0f29da7d51e6..7688f565ec9b 100644
> >> --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
> >> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
> >> @@ -7,6 +7,7 @@
> >>   
> >>   #include <dt-bindings/gpio/gpio.h>
> >>   #include <dt-bindings/input/input.h>
> >> +#include <dt-bindings/leds/common.h>
> >>   #include <dt-bindings/pinctrl/sun4i-a10.h>
> >>   
> >>   / {
> >> @@ -132,6 +133,25 @@ &external_mdio {
> >>   	ext_rgmii_phy: ethernet-phy at 1 {
> >>   		compatible = "ethernet-phy-ieee802.3-c22";
> >>   		reg = <1>;
> >> +
> >> +		leds {
> >> +			#address-cells = <1>;
> >> +			#size-cells = <0>;
> >> +
> >> +			led at 0 {
> >> +				reg = <0>;
> >> +				color = <LED_COLOR_ID_GREEN>;
> >> +				function = LED_FUNCTION_LAN;
> >> +				linux,default-trigger = "netdev";
> >> +			};
> >> +
> >> +			led at 1 {
> >> +				reg = <1>;
> >> +				color = <LED_COLOR_ID_AMBER>;
> >> +				function = LED_FUNCTION_LAN;
> >> +				linux,default-trigger = "netdev";
> >> +			};
> > Schematic says LED0 is "Yellow" or Amber in this DT. So LED1 should be green.
> >
> > Also, I'm not sure if trigger really needs to be added, since PHY network
> > will set it as such.
> 
> I think there is a mistake in the schematic. Setting the trigger on LED0
> illuminates the green LED. My tests found that the netdev trigger isn't
> set by default.

Ok.

Reviewed-by: Jernej Skrabec <jernej.skrabec at gmail.com>

Best regards,
Jernej





More information about the linux-arm-kernel mailing list