Simon Glass | 8fbf992 | 2019-01-21 14:53:36 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright 2018 Google |
| 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | |
| 8 | int board_init(void) |
| 9 | { |
| 10 | return 0; |
| 11 | } |
| 12 | |
Kever Yang | b22e9fd | 2019-07-22 19:59:41 +0800 | [diff] [blame^] | 13 | #ifdef CONFIG_SPL_BUILD |
Simon Glass | 8fbf992 | 2019-01-21 14:53:36 -0700 | [diff] [blame] | 14 | /* provided to defeat compiler optimisation in board_init_f() */ |
| 15 | void gru_dummy_function(int i) |
| 16 | { |
| 17 | } |
Kever Yang | b22e9fd | 2019-07-22 19:59:41 +0800 | [diff] [blame^] | 18 | |
| 19 | int board_early_init_f(void) |
| 20 | { |
| 21 | # ifdef CONFIG_TARGET_CHROMEBOOK_BOB |
| 22 | int sum, i; |
| 23 | |
| 24 | /* |
| 25 | * Add a delay and ensure that the compiler does not optimise this out. |
| 26 | * This is needed since the power rails tail a while to turn on, and |
| 27 | * we get garbage serial output otherwise. |
| 28 | */ |
| 29 | sum = 0; |
| 30 | for (i = 0; i < 150000; i++) |
| 31 | sum += i; |
| 32 | gru_dummy_function(sum); |
| 33 | #endif /* CONFIG_TARGET_CHROMEBOOK_BOB */ |
| 34 | |
| 35 | return 0; |
| 36 | } |
| 37 | #endif |