diff options
author | Kever Yang <kever.yang@rock-chips.com> | 2019-07-22 19:59:41 +0800 |
---|---|---|
committer | Kever Yang <kever.yang@rock-chips.com> | 2019-07-29 10:25:27 +0800 |
commit | faa98c7c5af2cc1224b77526f0106f26af86ad63 (patch) | |
tree | 5f8f29723a4b687af7634e6430e54635e76438e2 | |
parent | 4e1aeb89afcc63f4d498719e1d2e5dcac8ae9ffc (diff) |
rockchip: rk3399: move chromebook bob specific flow to its board file
Add a board_early_init_f() in board_init_f() and move the board
specific init code into its own board file.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
-rw-r--r-- | arch/arm/include/asm/arch-rockchip/sys_proto.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-rockchip/rk3399-board-spl.c | 20 | ||||
-rw-r--r-- | board/google/gru/gru.c | 21 |
3 files changed, 27 insertions, 18 deletions
diff --git a/arch/arm/include/asm/arch-rockchip/sys_proto.h b/arch/arm/include/asm/arch-rockchip/sys_proto.h index 905c774c15..de5a8f11a9 100644 --- a/arch/arm/include/asm/arch-rockchip/sys_proto.h +++ b/arch/arm/include/asm/arch-rockchip/sys_proto.h @@ -6,8 +6,4 @@ #ifndef _ASM_ARCH_SYS_PROTO_H #define _ASM_ARCH_SYS_PROTO_H - -/* provided to defeat compiler optimisation in board_init_f() */ -void gru_dummy_function(int i); - #endif /* _ASM_ARCH_SYS_PROTO_H */ diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index e6325274c3..cb481c58ec 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -57,6 +57,11 @@ __weak void rockchip_stimer_init(void) { } +__weak int board_early_init_f(void) +{ + return 0; +} + __weak int arch_cpu_init(void) { return 0; @@ -70,20 +75,6 @@ void board_init_f(ulong dummy) #ifdef CONFIG_DEBUG_UART debug_uart_init(); -# ifdef CONFIG_TARGET_CHROMEBOOK_BOB - int sum, i; - - /* - * Add a delay and ensure that the compiler does not optimise this out. - * This is needed since the power rails tail a while to turn on, and - * we get garbage serial output otherwise. - */ - sum = 0; - for (i = 0; i < 150000; i++) - sum += i; - gru_dummy_function(sum); -#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */ - /* * Debug UART can be used from here if required: * @@ -95,6 +86,7 @@ void board_init_f(ulong dummy) debug("U-Boot SPL board init\n"); #endif + board_early_init_f(); arch_cpu_init(); ret = spl_early_init(); diff --git a/board/google/gru/gru.c b/board/google/gru/gru.c index b116b1a549..c2895e1267 100644 --- a/board/google/gru/gru.c +++ b/board/google/gru/gru.c @@ -10,7 +10,28 @@ int board_init(void) return 0; } +#ifdef CONFIG_SPL_BUILD /* provided to defeat compiler optimisation in board_init_f() */ void gru_dummy_function(int i) { } + +int board_early_init_f(void) +{ +# ifdef CONFIG_TARGET_CHROMEBOOK_BOB + int sum, i; + + /* + * Add a delay and ensure that the compiler does not optimise this out. + * This is needed since the power rails tail a while to turn on, and + * we get garbage serial output otherwise. + */ + sum = 0; + for (i = 0; i < 150000; i++) + sum += i; + gru_dummy_function(sum); +#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */ + + return 0; +} +#endif |