]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sam9x60-curiosity: migrate Boot LED setup to use /options/u-boot/boot-led
authorQuentin Schulz <quentin.schulz@cherry.de>
Wed, 12 Nov 2025 17:48:15 +0000 (18:48 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 3 Dec 2025 17:03:45 +0000 (11:03 -0600)
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.

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.

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.

Note that this is not tested as I do not own this device.

Cc: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Tested-by: Alexander Dahl <ada@thorsis.com>
arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi
board/atmel/sam9x60_curiosity/sam9x60_curiosity.c

index 9144387861eca5ab14b756063b89866d280d7dea..b8f16c0b0c08ab398e2f0aa77b81b60ffeb81375 100644 (file)
                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";
                };
        };
index e75043ec00f9028bf81e32244d6d38fb3eb03618..3393478e4c8c6785caadab29284f84f449cb414f 100644 (file)
@@ -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 */