Force boot-led ON and no more rely on default-state.
This patch avoid device-tree modification for U-Boot.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
default-state = "off";
status = "okay";
};
default-state = "off";
status = "okay";
};
-
- blue {
- default-state = "on";
- };
default-state = "off";
status = "okay";
};
default-state = "off";
status = "okay";
};
-
- blue {
- default-state = "on";
- };
#endif /* CONFIG_USB_GADGET */
#endif /* CONFIG_USB_GADGET */
static int get_led(struct udevice **dev, char *led_string)
{
char *led_name;
static int get_led(struct udevice **dev, char *led_string)
{
char *led_name;
struct udevice *dev;
int ret;
struct udevice *dev;
int ret;
+ if (!CONFIG_IS_ENABLED(LED))
+ return 0;
+
ret = get_led(&dev, "u-boot,boot-led");
if (ret)
return ret;
ret = get_led(&dev, "u-boot,boot-led");
if (ret)
return ret;
ret = led_set_state(dev, cmd);
return ret;
}
ret = led_set_state(dev, cmd);
return ret;
}
static void __maybe_unused led_error_blink(u32 nb_blink)
{
static void __maybe_unused led_error_blink(u32 nb_blink)
{
int ret;
struct udevice *led;
u32 i;
int ret;
struct udevice *led;
u32 i;
-#ifdef CONFIG_LED
- ret = get_led(&led, "u-boot,error-led");
- if (!ret) {
- /* make u-boot,error-led blinking */
- /* if U32_MAX and 125ms interval, for 17.02 years */
- for (i = 0; i < 2 * nb_blink; i++) {
- led_set_state(led, LEDST_TOGGLE);
- mdelay(125);
- WATCHDOG_RESET();
+ if (CONFIG_IS_ENABLED(LED)) {
+ ret = get_led(&led, "u-boot,error-led");
+ if (!ret) {
+ /* make u-boot,error-led blinking */
+ /* if U32_MAX and 125ms interval, for 17.02 years */
+ for (i = 0; i < 2 * nb_blink; i++) {
+ led_set_state(led, LEDST_TOGGLE);
+ mdelay(125);
+ WATCHDOG_RESET();
+ }
+ led_set_state(led, LEDST_ON);
- led_set_state(led, LEDST_ON);
/* infinite: the boot process must be stopped */
if (nb_blink == U32_MAX)
/* infinite: the boot process must be stopped */
if (nb_blink == U32_MAX)
if (CONFIG_IS_ENABLED(LED))
led_default_state();
if (CONFIG_IS_ENABLED(LED))
led_default_state();
void board_quiesce_devices(void)
{
void board_quiesce_devices(void)
{
}
/* eth init function : weak called in eqos driver */
}
/* eth init function : weak called in eqos driver */