2 * Copyright (C) 2017 Amarula Solutions
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <debug_uart.h>
14 #include <asm/arch/bootrom.h>
15 #include <asm/arch/clock.h>
16 #include <asm/arch/grf_rk3288.h>
17 #include <asm/arch/periph.h>
18 #include <asm/arch/pmu_rk3288.h>
19 #include <asm/arch/sys_proto.h>
20 #include <asm/arch/timer.h>
22 DECLARE_GLOBAL_DATA_PTR;
24 #define GRF_BASE 0xff770000
25 void board_init_f(ulong dummy)
30 /* Example code showing how to enable the debug UART on RK3288 */
31 /* Enable early UART on the RK3288 */
32 struct rk3288_grf * const grf = (void *)GRF_BASE;
34 rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
35 GPIO7C6_MASK << GPIO7C6_SHIFT,
36 GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
37 GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
39 * Debug UART can be used from here if required:
44 * printascii("string");
48 ret = spl_early_init();
50 debug("spl_early_init() failed: %d\n", ret);
54 rockchip_timer_init();
57 ret = rockchip_get_clk(&dev);
59 debug("CLK init failed: %d\n", ret);
63 ret = uclass_get_device(UCLASS_RAM, 0, &dev);
65 debug("DRAM init failed: %d\n", ret);
70 void board_return_to_bootrom(void)
72 back_to_bootrom(BROM_BOOT_NEXTSTAGE);
75 u32 spl_boot_device(void)
77 return BOOT_DEVICE_BOOTROM;
80 void spl_board_init(void)
82 puts("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \