mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-17 02:15:02 +00:00

Switch to use the IO-domain driver to configure IO-domain based on device tree instead of a setup_iodomain() function. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
56 lines
1.1 KiB
C
56 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright 2018 Google
|
|
*/
|
|
|
|
#include <dm.h>
|
|
#include <init.h>
|
|
#include <asm/arch-rockchip/clock.h>
|
|
|
|
#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)
|
|
{
|
|
# if defined(CONFIG_TARGET_CHROMEBOOK_BOB) || defined(CONFIG_TARGET_CHROMEBOOK_KEVIN)
|
|
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
|
|
|
|
#ifndef CONFIG_SPL_BUILD
|
|
int board_early_init_r(void)
|
|
{
|
|
struct udevice *clk;
|
|
int ret;
|
|
|
|
/*
|
|
* This init is done in SPL, but when chain-loading U-Boot SPL will
|
|
* have been skipped. Allow the clock driver to check if it needs
|
|
* setting up.
|
|
*/
|
|
ret = uclass_get_device_by_driver(UCLASS_CLK,
|
|
DM_DRIVER_GET(clk_rk3399), &clk);
|
|
if (ret) {
|
|
debug("%s: CLK init failed: %d\n", __func__, ret);
|
|
return ret;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
#endif
|