mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-18 18:59:44 +00:00
db41d65a97
At present panic() is in the vsprintf.h header file. That does not seem like an obvious choice for hang(), even though it relates to panic(). So let's put hang() in its own header. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Migrate a few more files] Signed-off-by: Tom Rini <trini@konsulko.com>
43 lines
648 B
C
43 lines
648 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* (C) Copyright 2015 Google, Inc
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <hang.h>
|
|
|
|
#ifdef CONFIG_SPL_BUILD
|
|
static int setup_led(void)
|
|
{
|
|
#ifdef CONFIG_SPL_LED
|
|
struct udevice *dev;
|
|
char *led_name;
|
|
int ret;
|
|
|
|
led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
|
|
if (!led_name)
|
|
return 0;
|
|
ret = led_get_by_label(led_name, &dev);
|
|
if (ret) {
|
|
debug("%s: get=%d\n", __func__, ret);
|
|
return ret;
|
|
}
|
|
ret = led_set_on(dev, 1);
|
|
if (ret)
|
|
return ret;
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
|
|
void spl_board_init(void)
|
|
{
|
|
int ret;
|
|
|
|
ret = setup_led();
|
|
if (ret) {
|
|
debug("LED ret=%d\n", ret);
|
|
hang();
|
|
}
|
|
}
|
|
#endif
|