diff options
author | Alper Nebi Yasak <alpernebiyasak@gmail.com> | 2020-10-28 00:15:11 +0300 |
---|---|---|
committer | Kever Yang <kever.yang@rock-chips.com> | 2020-11-13 13:15:08 +0300 |
commit | 13634bb6585ec0e789da7504146873fb492456e5 (patch) | |
tree | 1c77816139c5d0cf2c0b4e877339ee79bce5675b /board/google | |
parent | eb89025013a6d4b1d9cf307e5a2a087196ee9f02 (diff) | |
download | u-boot-13634bb6585ec0e789da7504146873fb492456e5.tar.xz |
rockchip: gru: Allow setting up clocks in U-Boot proper
Commit fe974716326c ("rockchip: rk3288: Allow setting up clocks in
U-Boot proper") fixes some clock issues when chainloading U-Boot on
rk3288 chromebooks. Part of that change is still available in veyron's
board_early_init_r() function. Since chain-loading U-Boot proper from
vendor firmware is possible on gru boards as well, do the same thing for
them too.
On rk3399, this needs to detect whether SPL was run via handoff, so
enable that and bloblist kconfigs it needs for chromebook_bob.
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang<kever.yang@rock-chips.com>
Diffstat (limited to 'board/google')
-rw-r--r-- | board/google/gru/gru.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/board/google/gru/gru.c b/board/google/gru/gru.c index 7dfbc3ac86..441a1a376a 100644 --- a/board/google/gru/gru.c +++ b/board/google/gru/gru.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <dm.h> #include <init.h> #ifdef CONFIG_SPL_BUILD @@ -31,3 +32,25 @@ int board_early_init_f(void) 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_GET_DRIVER(clk_rk3399), &clk); + if (ret) { + debug("%s: CLK init failed: %d\n", __func__, ret); + return ret; + } + + return 0; +} +#endif |