lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0fe35fe3-b63c-478b-9674-a2522f582167@lunn.ch>
Date: Wed, 9 Apr 2025 14:11:13 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>,
	linux-renesas-soc@...r.kernel.org,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org
Subject: Re: [RFC PATCH net-next] net: phy: marvell: support DT
 configurations with only two LEDs

On Wed, Apr 09, 2025 at 08:55:24AM +0200, Wolfram Sang wrote:
> Hi Andrew,
> 
> > Please make use of the LED binding:
> > 
> > &mdio {
> >         pinctrl-0 = <&mdio_pins>;
> >         pinctrl-names = "default";
> >         phy0: ethernet-phy@0 {
> >                 reg = <0>;
> >                 leds {
> >                         #address-cells = <1>;
> >                         #size-cells = <0>;
> > 
> >                         led@0 {
> >                                 reg = <0>;
> >                                 color = <LED_COLOR_ID_WHITE>;
> >                                 function = LED_FUNCTION_WAN;
> >                                 default-state = "keep";
> >                         };
> >                 };
> >         };
> > 
> > Just list the two LEDs you have connected.
> 
> Been there, didn't work. This is what I had:
> 
> 	mdio {
> 		#address-cells = <1>;
> 		#size-cells = <0>;
> 		compatible = "snps,dwmac-mdio";
> 
> 		phy_mii0: ethernet-phy@8 {
> 			reg = <8>;
> 			leds {
> 				#address-cells = <1>;
> 				#size-cells = <0>;
> 				led@0 {
> 					reg = <0>;
> 					color = <LED_COLOR_ID_GREEN>;
> 					function = LED_FUNCTION_LAN;
> 					default-state = "keep";
> 				};
> 
> 				led@1 {
> 					reg = <1>;
> 					color = <LED_COLOR_ID_AMBER>;
> 					function = LED_FUNCTION_ACTIVITY;
> 					default-state = "keep";
> 				};
> 			};
> 		};
> 	};
> 
> I played around with LED_FUNCTION_* values.


Function is just to do with naming. What you want is to add

linux,default-trigger = "netdev";

and ensure you have drivers/leds/trigger/ledtrig-netdev.c in your
kernel.

You should then find that you gain an LED directory per LED in sysfs,
trigger has [netdev] and there are additional files you can use to
configure when the LED lights/blinks for different link speeds, RX and
TX etc.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ