Hello Quentin, thanks for your effort. I'm all in for common behaviour. See more remarks below.
Am Wed, Nov 12, 2025 at 06:48:15PM +0100 schrieb Quentin Schulz: > From: Quentin Schulz <[email protected]> > > This board is one of the last users of /config/u-boot,boot-led property > which is a U-Boot property out of the DT spec. Well, I introduced it back in 2023 with commit 1818b44b7bc ("board: sam9x60-curiosity: Let LED subsystem init leds if enabled"), maybe because I found the old property in the documentation? Not sure since when CONFIG_LED_BOOT and the new property is a thing, but I have no hard feelings here. > Let's migrate it to use the in-spec /options/u-boot/boot-led property. > When enabling LED_BOOT, U-Boot proper will lit the LED right before > entering the main loop, so nothing needs to be done in board files. Fine. Using specified properties and having less board code are both good things! > As explained in the commit adding support for this u-boot,boot-led > property, let's keep backward compatibility in case LED_BOOT isn't > selected. Would be nice to hear the opinion of someone from Microchip for this?! These properties did not gain adoption on their new boards. It's a bit dissapointing their boards are not maintained in mainline U-Boot by themselves anymore. :-/ > Note that this is not tested as I do not own this device. Tested-by: Alexander Dahl <[email protected]> Note: With CONFIG_LED_BOOT enabled, the LED turns to on in a later boot phase as with that option disabled. I don't think this is a problem, just wanted to share the observation. Greets Alex > > Cc: Alexander Dahl <[email protected]> > Signed-off-by: Quentin Schulz <[email protected]> > --- > arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi | 9 ++++++--- > board/atmel/sam9x60_curiosity/sam9x60_curiosity.c | 16 +--------------- > 2 files changed, 7 insertions(+), 18 deletions(-) > > diff --git a/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi > b/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi > index 9144387861e..b8f16c0b0c0 100644 > --- a/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi > +++ b/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi > @@ -21,8 +21,11 @@ > bootph-all; > }; > > - config { > - u-boot,boot-led = "blue"; > + options { > + u-boot { > + compatible = "u-boot,config"; > + boot-led = <&led_blue>; > + }; > }; > > leds { > @@ -34,7 +37,7 @@ > default-state = "off"; > }; > > - led-blue { > + led_blue: led-blue { > default-state = "off"; > }; > }; > diff --git a/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c > b/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c > index e75043ec00f..3393478e4c8 100644 > --- a/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c > +++ b/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c > @@ -28,21 +28,7 @@ void at91_prepare_cpu_var(void); > > static void board_leds_init(void) > { > -#if CONFIG_IS_ENABLED(LED) > - const char *led_name; > - struct udevice *dev; > - int ret; > - > - led_name = ofnode_conf_read_str("u-boot,boot-led"); > - if (!led_name) > - return; > - > - ret = led_get_by_label(led_name, &dev); > - if (ret) > - return; > - > - led_set_state(dev, LEDST_ON); > -#else > +#if !CONFIG_IS_ENABLED(LED_BOOT) > at91_set_pio_output(AT91_PIO_PORTD, 17, 0); /* LED RED */ > at91_set_pio_output(AT91_PIO_PORTD, 19, 0); /* LED GREEN */ > at91_set_pio_output(AT91_PIO_PORTD, 21, 1); /* LED BLUE */ > > -- > 2.51.1 >

