activity-led usage
Simon Glass
sjg at chromium.org
Tue Sep 30 16:13:23 CEST 2025
Hi Yegor,
On Tue, 30 Sept 2025 at 06:35, Yegor Yefremov
<yegorslists at googlemail.com> wrote:
>
> On Tue, Sep 30, 2025 at 12:29 PM Yegor Yefremov
> <yegorslists at googlemail.com> 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.
>
> Should activity-led be also mentioned in doc/device-tree-bindings/config.txt?
We should be using /options/u-boot for this[1]
Regards,
Simon
[1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/options/u-boot.yaml
More information about the U-Boot
mailing list