rockchip: rk3399: move chromebook bob specific flow to its board file
authorKever Yang <kever.yang@rock-chips.com>
Mon, 22 Jul 2019 11:59:41 +0000 (19:59 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 29 Jul 2019 02:25:27 +0000 (10:25 +0800)
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>
arch/arm/include/asm/arch-rockchip/sys_proto.h
arch/arm/mach-rockchip/rk3399-board-spl.c
board/google/gru/gru.c

index 905c774c15bfe5ba47b993809bf5afee7457bc03..de5a8f11a984e205d8cb5ab11a08566f2f62be2c 100644 (file)
@@ -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 */
index e6325274c334e2dfd5687e0d78b6bba3c96c6468..cb481c58ec6d0e6e850336c0a1d3e6fcba5e81d6 100644 (file)
@@ -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();
index b116b1a549b88fe25168b5bccd6357ddcfbbf836..c2895e1267e5c86f20772307b3fc60c10542ebff 100644 (file)
@@ -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