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> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 7 | #include <init.h> |
Simon Glass | 8fbf992 | 2019-01-21 14:53:36 -0700 | [diff] [blame] | 8 | |
Kever Yang | b22e9fd | 2019-07-22 19:59:41 +0800 | [diff] [blame] | 9 | #ifdef CONFIG_SPL_BUILD |
Simon Glass | 8fbf992 | 2019-01-21 14:53:36 -0700 | [diff] [blame] | 10 | /* provided to defeat compiler optimisation in board_init_f() */ |
| 11 | void gru_dummy_function(int i) |
| 12 | { |
| 13 | } |
Kever Yang | b22e9fd | 2019-07-22 19:59:41 +0800 | [diff] [blame] | 14 | |
| 15 | int board_early_init_f(void) |
| 16 | { |
| 17 | # ifdef CONFIG_TARGET_CHROMEBOOK_BOB |
| 18 | int sum, i; |
| 19 | |
| 20 | /* |
| 21 | * Add a delay and ensure that the compiler does not optimise this out. |
| 22 | * This is needed since the power rails tail a while to turn on, and |
| 23 | * we get garbage serial output otherwise. |
| 24 | */ |
| 25 | sum = 0; |
| 26 | for (i = 0; i < 150000; i++) |
| 27 | sum += i; |
| 28 | gru_dummy_function(sum); |
| 29 | #endif /* CONFIG_TARGET_CHROMEBOOK_BOB */ |
| 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | #endif |