Hi Yegor, On Tue, 30 Sept 2025 at 08:48, Yegor Yefremov <[email protected]> wrote: > > Hi Simon, > > On Tue, Sep 30, 2025 at 4:13 PM Simon Glass <[email protected]> wrote: > > > > Hi Yegor, > > > > On Tue, 30 Sept 2025 at 06:35, Yegor Yefremov > > <[email protected]> wrote: > > > > > > On Tue, Sep 30, 2025 at 12:29 PM Yegor Yefremov > > > <[email protected]> wrote: > > > > > > > > Hi all, > > > > > > > > I added the following LED definition to the am335x-baltos.dts: > > > > > > > > leds { > > > > pinctrl-names = "default"; > > > > pinctrl-0 = <&user_leds>; > > > > > > > > compatible = "gpio-leds"; > > > > > > > > led-power { > > > > label = "led-red"; > > > > gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; > > > > default-state = "on"; > > > > }; > > > > }; > > > > user_leds: user-leds-pins { > > > > pinctrl-single,pins = < > > > > AM33XX_PADCONF(AM335X_PIN_MII1_COL, > > > > PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* mii1_col.gpio3_0 PWR LED */ > > > > >; > > > > }; > > > > > > > > The gpio-leds driver is working and I can toggle the led-red via the > > > > led command. > > > > > > > > Then, I created an am335x-baltos-u-boot.dtsi file with the following > > > > content: > > > > > > > > / { > > > > config { > > > > u-boot,activity-led = "led-red"; > > > > }; > > > > }; > > > > > > > > I have also tried "led-power" instead of "led-red". > > > > > > > > In my final DTS files I have the following nodes: > > > > > > > > leds { > > > > pinctrl-names = "default"; > > > > pinctrl-0 = <0x56>; > > > > compatible = "gpio-leds"; > > > > > > > > led-power { > > > > label = "led-red"; > > > > gpios = <0x57 0x00 0x01>; > > > > default-state = "on"; > > > > }; > > > > }; > > > > > > > > config { > > > > u-boot,activity-led = "led-red"; > > > > }; > > > > > > > > U-Boot cannot find the activity-led node. > > > > ofnode_options_get_by_phandle("activity-led", &led_node); returns -22, > > > > because ofnode_path("/options/u-boot") fails. > > > > > > > > When driver debug is enabled, I also see the following messages: > > > > > > > > bind node config > > > > Device 'config' has no compatible string > > > > > > > > My am335x-baltos-u-boot.dtsi code is similar to what I could find in > > > > arch/arm/dts for the boot-led usage. > > > > > > > > Where should I debug further? > > > > It is a bit confusing as there is still 'legacy' LED stuff in the > > tree. For your problem I would suggest checking that the LED device is > > configured correctly. > > > > For sandbox in test.dts you can see: > > > > options { > > u-boot { > > compatible = "u-boot,config"; > > boot-led = <&sandbox_led_green>; > > activity-led = <&sandbox_led_red>; > > ... > > }; > > }; > > > > Check that led_init() is being called in the LED uclass. > > It is working now using your suggestion. Thanks. > > > > > > > Should activity-led be also mentioned in > > > doc/device-tree-bindings/config.txt? > > > > We should be using /options/u-boot for this[1] > > This means, everything that can be found via the following command > won't work and should be removed? > > grep -r --include='*.dts[i]' boot-led arch/arm/dts
Yes. I did a series to remove the legacy LED stuff last year but it wasn't applied because people wanted me to do more, probably what you are looking at doing now :-) Regards, Simon [2] https://patchwork.ozlabs.org/project/uboot/list/?series=431000&state=*

