2019-01-21 21:53:36 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* Copyright 2018 Google
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2019-01-21 21:53:36 +00:00
|
|
|
|
2019-07-22 11:59:41 +00:00
|
|
|
#ifdef CONFIG_SPL_BUILD
|
2019-01-21 21:53:36 +00:00
|
|
|
/* provided to defeat compiler optimisation in board_init_f() */
|
|
|
|
void gru_dummy_function(int i)
|
|
|
|
{
|
|
|
|
}
|
2019-07-22 11:59:41 +00:00
|
|
|
|
|
|
|
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
|