1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2015 Google, Inc
13 #include <asm/arch-rockchip/clock.h>
14 #include <asm/arch-rockchip/grf_rk3188.h>
15 #include <asm/arch-rockchip/periph.h>
16 #include <asm/arch-rockchip/pmu_rk3288.h>
17 #include <asm/arch-rockchip/boot_mode.h>
18 #include <dm/pinctrl.h>
20 __weak int rk_board_late_init(void)
25 int board_late_init(void)
27 struct rk3188_grf *grf;
30 grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
32 pr_err("grf syscon returned %ld\n", PTR_ERR(grf));
34 /* enable noc remap to mimic legacy loaders */
35 rk_clrsetreg(&grf->soc_con0,
36 NOC_REMAP_MASK << NOC_REMAP_SHIFT,
37 NOC_REMAP_MASK << NOC_REMAP_SHIFT);
40 return rk_board_late_init();
45 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
46 struct udevice *pinctrl;
50 * We need to implement sdcard iomux here for the further
51 * initialization, otherwise, it'll hit sdcard command sending
54 ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
56 debug("%s: Cannot find pinctrl device\n", __func__);
59 ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
61 debug("%s: Failed to set up SD card\n", __func__);
67 printf("board_init: Error %d\n", ret);
69 /* No way to report error here */
78 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
79 void enable_caches(void)
81 /* Enable D-cache. I-cache is already enabled in start.S */