mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-17 20:51:39 +00:00
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>
This commit is contained in:
parent
4f0b061444
commit
57d55db603
4 changed files with 37 additions and 37 deletions
|
@ -73,7 +73,6 @@ config ROCKCHIP_RK322X
|
||||||
config ROCKCHIP_RK3288
|
config ROCKCHIP_RK3288
|
||||||
bool "Support Rockchip RK3288"
|
bool "Support Rockchip RK3288"
|
||||||
select CPU_V7A
|
select CPU_V7A
|
||||||
select SPL_BOARD_INIT if SPL
|
|
||||||
select SUPPORT_SPL
|
select SUPPORT_SPL
|
||||||
select SPL
|
select SPL
|
||||||
select SUPPORT_TPL
|
select SUPPORT_TPL
|
||||||
|
|
|
@ -196,42 +196,6 @@ void board_init_f(ulong dummy)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#ifdef CONFIG_SPL_OS_BOOT
|
||||||
|
|
||||||
#define PMU_BASE 0xff730000
|
#define PMU_BASE 0xff730000
|
||||||
|
|
|
@ -66,6 +66,7 @@ config TARGET_FENNEC_RK3288
|
||||||
config TARGET_FIREFLY_RK3288
|
config TARGET_FIREFLY_RK3288
|
||||||
bool "Firefly-RK3288"
|
bool "Firefly-RK3288"
|
||||||
select BOARD_LATE_INIT
|
select BOARD_LATE_INIT
|
||||||
|
select SPL_BOARD_INIT if SPL
|
||||||
help
|
help
|
||||||
Firefly is a RK3288-based development board with 2 USB ports,
|
Firefly is a RK3288-based development board with 2 USB ports,
|
||||||
HDMI, VGA, micro-SD card, audio, WiFi and Gigabit Ethernet, It
|
HDMI, VGA, micro-SD card, audio, WiFi and Gigabit Ethernet, It
|
||||||
|
|
|
@ -4,3 +4,39 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#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
|
||||||
|
|
Loading…
Add table
Reference in a new issue