]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - arch/arm/mach-rockchip/rk3288-board-tpl.c
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Amarula Solutions
7 #include <debug_uart.h>
13 #include <asm/arch/bootrom.h>
14 #include <asm/arch/clock.h>
15 #include <asm/arch/grf_rk3288.h>
16 #include <asm/arch/periph.h>
17 #include <asm/arch/pmu_rk3288.h>
18 #include <asm/arch/sys_proto.h>
19 #include <asm/arch/timer.h>
21 #define GRF_BASE 0xff770000
22 void board_init_f(ulong dummy
)
27 /* Example code showing how to enable the debug UART on RK3288 */
28 /* Enable early UART on the RK3288 */
29 struct rk3288_grf
* const grf
= (void *)GRF_BASE
;
31 rk_clrsetreg(&grf
->gpio7ch_iomux
, GPIO7C7_MASK
<< GPIO7C7_SHIFT
|
32 GPIO7C6_MASK
<< GPIO7C6_SHIFT
,
33 GPIO7C7_UART2DBG_SOUT
<< GPIO7C7_SHIFT
|
34 GPIO7C6_UART2DBG_SIN
<< GPIO7C6_SHIFT
);
36 * Debug UART can be used from here if required:
41 * printascii("string");
45 ret
= spl_early_init();
47 debug("spl_early_init() failed: %d\n", ret
);
51 rockchip_timer_init();
54 ret
= rockchip_get_clk(&dev
);
56 debug("CLK init failed: %d\n", ret
);
60 ret
= uclass_get_device(UCLASS_RAM
, 0, &dev
);
62 debug("DRAM init failed: %d\n", ret
);
67 void board_return_to_bootrom(void)
69 back_to_bootrom(BROM_BOOT_NEXTSTAGE
);
72 u32
spl_boot_device(void)
74 return BOOT_DEVICE_BOOTROM
;
77 void spl_board_init(void)
79 puts("\nU-Boot TPL " PLAIN_VERSION
" (" U_BOOT_DATE
" - " \