blob: 5ec69f131161f1edc07aa9c14f9b81e1e222458b [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
huang linbe1d5e02015-11-17 14:20:27 +08002/*
3 * (C) Copyright 2015 Rockchip Electronics Co., Ltd
huang linbe1d5e02015-11-17 14:20:27 +08004 */
5
6#include <common.h>
Simon Glass9b205192015-12-13 21:37:00 -07007#include <debug_uart.h>
huang linbe1d5e02015-11-17 14:20:27 +08008#include <asm/io.h>
Heiko Stübneraade0772017-02-18 19:46:26 +01009#include <asm/arch/bootrom.h>
huang linbe1d5e02015-11-17 14:20:27 +080010#include <asm/arch/grf_rk3036.h>
11#include <asm/arch/hardware.h>
12#include <asm/arch/sdram_rk3036.h>
13#include <asm/arch/timer.h>
14#include <asm/arch/uart.h>
15
huang linbe1d5e02015-11-17 14:20:27 +080016#define GRF_BASE 0x20008000
huang linbe1d5e02015-11-17 14:20:27 +080017
18#define DEBUG_UART_BASE 0x20068000
19
huang linbe1d5e02015-11-17 14:20:27 +080020void board_init_f(ulong dummy)
21{
22#ifdef EARLY_DEBUG
Tom Rini80403aa2017-05-08 22:14:20 -040023 struct rk3036_grf * const grf = (void *)GRF_BASE;
huang linbe1d5e02015-11-17 14:20:27 +080024 /*
25 * NOTE: sd card and debug uart use same iomux in rk3036,
26 * so if you enable uart,
27 * you can not boot from sdcard
28 */
29 rk_clrsetreg(&grf->gpio1c_iomux,
30 GPIO1C3_MASK << GPIO1C3_SHIFT |
31 GPIO1C2_MASK << GPIO1C2_SHIFT,
32 GPIO1C3_UART2_SOUT << GPIO1C3_SHIFT |
33 GPIO1C2_UART2_SIN << GPIO1C2_SHIFT);
Simon Glass9b205192015-12-13 21:37:00 -070034 debug_uart_init();
huang linbe1d5e02015-11-17 14:20:27 +080035#endif
36 rockchip_timer_init();
37 sdram_init();
38
39 /* return to maskrom */
Philipp Tomsichb82bd1f2017-10-10 16:21:16 +020040 back_to_bootrom(BROM_BOOT_NEXTSTAGE);
huang linbe1d5e02015-11-17 14:20:27 +080041}
42
43/* Place Holders */
44void board_init_r(gd_t *id, ulong dest_addr)
45{
46 /*
47 * Function attribute is no-return
48 * This Function never executes
49 */
50 while (1)
51 ;
52}