diff options
author | Kever Yang | 2019-07-22 19:59:24 +0800 |
---|---|---|
committer | Kever Yang | 2019-07-29 10:25:27 +0800 |
commit | 57d55db603f548b48d03bdf021dc7eb33464e12c (patch) | |
tree | 90d4e80f4931e0f9a995c03ee362b70eb8957c7d /board/firefly | |
parent | 4f0b061444063d7c60e9624c5431c16f00d067af (diff) |
rockchip: rk3288: move setup_led() to firefly-rk3288
Only firefly-rk3288 has the dts node "u-boot,boot-led",
while CONFIG_SPL_LED is not enable, move code to firefly-rk3288
now in case someone need this code.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'board/firefly')
-rw-r--r-- | board/firefly/firefly-rk3288/firefly-rk3288.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/board/firefly/firefly-rk3288/firefly-rk3288.c b/board/firefly/firefly-rk3288/firefly-rk3288.c index bdc02a6a792..a3f784f0a3a 100644 --- a/board/firefly/firefly-rk3288/firefly-rk3288.c +++ b/board/firefly/firefly-rk3288/firefly-rk3288.c @@ -4,3 +4,39 @@ */ #include <common.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 |