rockchip: rk3288: include header for back_to_bootrom
[platform/kernel/u-boot.git] / arch / arm / mach-rockchip / rk3288-board-tpl.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2017 Amarula Solutions
4  */
5
6 #include <common.h>
7 #include <debug_uart.h>
8 #include <dm.h>
9 #include <ram.h>
10 #include <spl.h>
11 #include <version.h>
12 #include <asm/io.h>
13 #include <asm/arch-rockchip/bootrom.h>
14 #include <asm/arch-rockchip/clock.h>
15 #include <asm/arch-rockchip/sys_proto.h>
16 #include <asm/arch-rockchip/timer.h>
17
18 void board_init_f(ulong dummy)
19 {
20         struct udevice *dev;
21         int ret;
22
23 #ifdef CONFIG_DEBUG_UART
24         /*
25          * Debug UART can be used from here if required:
26          *
27          * debug_uart_init();
28          * printch('a');
29          * printhex8(0x1234);
30          * printascii("string");
31          */
32         debug_uart_init();
33 #endif
34         ret = spl_early_init();
35         if (ret) {
36                 debug("spl_early_init() failed: %d\n", ret);
37                 hang();
38         }
39
40         rockchip_timer_init();
41         configure_l2ctlr();
42
43         ret = rockchip_get_clk(&dev);
44         if (ret) {
45                 debug("CLK init failed: %d\n", ret);
46                 return;
47         }
48
49         ret = uclass_get_device(UCLASS_RAM, 0, &dev);
50         if (ret) {
51                 debug("DRAM init failed: %d\n", ret);
52                 return;
53         }
54 }
55
56 void board_return_to_bootrom(void)
57 {
58         back_to_bootrom(BROM_BOOT_NEXTSTAGE);
59 }
60
61 u32 spl_boot_device(void)
62 {
63         return BOOT_DEVICE_BOOTROM;
64 }
65
66 void spl_board_init(void)
67 {
68         puts("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
69                                 U_BOOT_TIME ")\n");
70 }