blob: 801548109b9b17fce5164ded9d8f143129e47cc0 [file] [log] [blame]
huang linbe1d5e02015-11-17 14:20:27 +08001/*
2 * (C) Copyright 2015 Rockchip Electronics Co., Ltd
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
Simon Glass9b205192015-12-13 21:37:00 -07008#include <debug_uart.h>
huang linbe1d5e02015-11-17 14:20:27 +08009#include <asm/io.h>
10#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
16DECLARE_GLOBAL_DATA_PTR;
17
18#define GRF_BASE 0x20008000
19static struct rk3036_grf * const grf = (void *)GRF_BASE;
20
21#define DEBUG_UART_BASE 0x20068000
22
23extern void back_to_bootrom(void);
24
25void board_init_f(ulong dummy)
26{
27#ifdef EARLY_DEBUG
28 /*
29 * NOTE: sd card and debug uart use same iomux in rk3036,
30 * so if you enable uart,
31 * you can not boot from sdcard
32 */
33 rk_clrsetreg(&grf->gpio1c_iomux,
34 GPIO1C3_MASK << GPIO1C3_SHIFT |
35 GPIO1C2_MASK << GPIO1C2_SHIFT,
36 GPIO1C3_UART2_SOUT << GPIO1C3_SHIFT |
37 GPIO1C2_UART2_SIN << GPIO1C2_SHIFT);
Simon Glass9b205192015-12-13 21:37:00 -070038 debug_uart_init();
huang linbe1d5e02015-11-17 14:20:27 +080039#endif
40 rockchip_timer_init();
41 sdram_init();
42
43 /* return to maskrom */
44 back_to_bootrom();
45}
46
47/* Place Holders */
48void board_init_r(gd_t *id, ulong dest_addr)
49{
50 /*
51 * Function attribute is no-return
52 * This Function never executes
53 */
54 while (1)
55 ;
56}
Simon Glass9b205192015-12-13 21:37:00 -070057
58void hang(void)
59{
60 while (1)
61 ;
62}