]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: roc-rk3399-pc: Add custom led_setup()
authorJagan Teki <jagan@amarulasolutions.com>
Tue, 21 Jul 2020 15:06:01 +0000 (20:36 +0530)
committerKever Yang <kever.yang@rock-chips.com>
Wed, 22 Jul 2020 12:55:13 +0000 (20:55 +0800)
roc-rk3399-pc has some specific requirements to support LEDS,
environment. board detection and etc prior to U-Boot proper.

So as of now SPL would be a better stage for these custom board
requirements to support unlike TPL. Adding few of these custom
requirements like LEDS in TPL would require extra code pulling
and also the size of TPL can grow.

So, this patch moves the leds code from TPL into SPL Board init
led_setup code.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
(split tpl.c change as separate patch)
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
configs/roc-pc-mezzanine-rk3399_defconfig
configs/roc-pc-rk3399_defconfig

index 7c3a8036549ecbe267083b47a9eb684ed8c879d7..2b447df8aac6d6dbe69aac54af7f4177fd4ece9a 100644 (file)
@@ -6,7 +6,6 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
-#include <asm/arch-rockchip/periph.h>
 #include <power/regulator.h>
 #include <spl_gpio.h>
 #include <asm/io.h>
@@ -30,19 +29,16 @@ int board_early_init_f(void)
 out:
        return 0;
 }
-#endif
 
-#if defined(CONFIG_TPL_BUILD)
+#else
 
-#define GPIO0_BASE      0xff720000
+#define GPIO0_BASE     0xff720000
 
-int board_early_init_f(void)
+void led_setup(void)
 {
        struct rockchip_gpio_regs * const gpio0 = (void *)GPIO0_BASE;
 
        /* Turn on red LED, indicating full power mode */
        spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1);
-
-       return 0;
 }
 #endif
index c87a8568fc7cbeeff6f9e87c1abea1aa3cb55e98..15d511741f667e580a02a4634eaa64ecc1e60b9c 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_ENV_SIZE=0x8000
 CONFIG_ENV_OFFSET=0x3F8000
 CONFIG_ENV_SECT_SIZE=0x1000
@@ -21,7 +22,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_TPL=y
-CONFIG_TPL_GPIO_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
index 601f5c6ae1763a722661d33c284b4b1444c6ec04..2a6d0d22c8e71e37adfec2a8564f1fd8b0af5d97 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_ENV_SIZE=0x8000
 CONFIG_ENV_OFFSET=0x3F8000
 CONFIG_ENV_SECT_SIZE=0x1000
@@ -21,7 +22,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_TPL=y
-CONFIG_TPL_GPIO_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y