blob: b6b4f19d84d29250a2068d493c6ad9fca40af610 [file] [log] [blame]
Simon Glass8fbf9922019-01-21 14:53:36 -07001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2018 Google
4 */
5
6#include <common.h>
7
Kever Yangb22e9fd2019-07-22 19:59:41 +08008#ifdef CONFIG_SPL_BUILD
Simon Glass8fbf9922019-01-21 14:53:36 -07009/* provided to defeat compiler optimisation in board_init_f() */
10void gru_dummy_function(int i)
11{
12}
Kever Yangb22e9fd2019-07-22 19:59:41 +080013
14int board_early_init_f(void)
15{
16# ifdef CONFIG_TARGET_CHROMEBOOK_BOB
17 int sum, i;
18
19 /*
20 * Add a delay and ensure that the compiler does not optimise this out.
21 * This is needed since the power rails tail a while to turn on, and
22 * we get garbage serial output otherwise.
23 */
24 sum = 0;
25 for (i = 0; i < 150000; i++)
26 sum += i;
27 gru_dummy_function(sum);
28#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
29
30 return 0;
31}
32#endif