Merge tag 'u-boot-imx-20200121' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[oweals/u-boot.git] / board / firefly / firefly-rk3288 / firefly-rk3288.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2015 Google, Inc
4  */
5
6 #include <common.h>
7 #include <hang.h>
8
9 #ifdef CONFIG_SPL_BUILD
10 static int setup_led(void)
11 {
12 #ifdef CONFIG_SPL_LED
13         struct udevice *dev;
14         char *led_name;
15         int ret;
16
17         led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
18         if (!led_name)
19                 return 0;
20         ret = led_get_by_label(led_name, &dev);
21         if (ret) {
22                 debug("%s: get=%d\n", __func__, ret);
23                 return ret;
24         }
25         ret = led_set_on(dev, 1);
26         if (ret)
27                 return ret;
28 #endif
29
30         return 0;
31 }
32
33 void spl_board_init(void)
34 {
35         int ret;
36
37         ret = setup_led();
38         if (ret) {
39                 debug("LED ret=%d\n", ret);
40                 hang();
41         }
42 }
43 #endif