huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2015 Rockchip Electronics Co., Ltd |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Simon Glass | e0f177b | 2015-12-13 21:37:00 -0700 | [diff] [blame] | 8 | #include <debug_uart.h> |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 9 | #include <asm/io.h> |
Heiko Stübner | 5c43acb | 2017-02-18 19:46:26 +0100 | [diff] [blame] | 10 | #include <asm/arch/bootrom.h> |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 11 | #include <asm/arch/grf_rk3036.h> |
| 12 | #include <asm/arch/hardware.h> |
| 13 | #include <asm/arch/sdram_rk3036.h> |
| 14 | #include <asm/arch/timer.h> |
| 15 | #include <asm/arch/uart.h> |
| 16 | |
| 17 | DECLARE_GLOBAL_DATA_PTR; |
| 18 | |
| 19 | #define GRF_BASE 0x20008000 |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 20 | |
| 21 | #define DEBUG_UART_BASE 0x20068000 |
| 22 | |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 23 | void board_init_f(ulong dummy) |
| 24 | { |
| 25 | #ifdef EARLY_DEBUG |
Tom Rini | 9240876 | 2017-05-08 22:14:20 -0400 | [diff] [blame] | 26 | struct rk3036_grf * const grf = (void *)GRF_BASE; |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 27 | /* |
| 28 | * NOTE: sd card and debug uart use same iomux in rk3036, |
| 29 | * so if you enable uart, |
| 30 | * you can not boot from sdcard |
| 31 | */ |
| 32 | rk_clrsetreg(&grf->gpio1c_iomux, |
| 33 | GPIO1C3_MASK << GPIO1C3_SHIFT | |
| 34 | GPIO1C2_MASK << GPIO1C2_SHIFT, |
| 35 | GPIO1C3_UART2_SOUT << GPIO1C3_SHIFT | |
| 36 | GPIO1C2_UART2_SIN << GPIO1C2_SHIFT); |
Simon Glass | e0f177b | 2015-12-13 21:37:00 -0700 | [diff] [blame] | 37 | debug_uart_init(); |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 38 | #endif |
| 39 | rockchip_timer_init(); |
| 40 | sdram_init(); |
| 41 | |
| 42 | /* return to maskrom */ |
Philipp Tomsich | 7234c73 | 2017-10-10 16:21:16 +0200 | [diff] [blame] | 43 | back_to_bootrom(BROM_BOOT_NEXTSTAGE); |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | /* Place Holders */ |
| 47 | void board_init_r(gd_t *id, ulong dest_addr) |
| 48 | { |
| 49 | /* |
| 50 | * Function attribute is no-return |
| 51 | * This Function never executes |
| 52 | */ |
| 53 | while (1) |
| 54 | ; |
| 55 | } |