From faa98c7c5af2cc1224b77526f0106f26af86ad63 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Mon, 22 Jul 2019 19:59:41 +0800 Subject: 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 --- board/google/gru/gru.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'board') 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 -- cgit