mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-08 22:24:32 +00:00
401d1c4f5d
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
47 lines
746 B
C
47 lines
746 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* (C) Copyright 2015 Google, Inc
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <hang.h>
|
|
#include <led.h>
|
|
#include <log.h>
|
|
#include <asm/global_data.h>
|
|
|
|
#ifdef CONFIG_SPL_BUILD
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
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_state(dev, LEDST_ON);
|
|
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
|