Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2015 Rockchip Electronics Co., Ltd |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Simon Glass | e0f177b | 2015-12-13 21:37:00 -0700 | [diff] [blame] | 7 | #include <debug_uart.h> |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 8 | #include <asm/io.h> |
Kever Yang | 9fbe17c | 2019-03-28 11:01:23 +0800 | [diff] [blame^] | 9 | #include <asm/arch-rockchip/bootrom.h> |
| 10 | #include <asm/arch-rockchip/grf_rk3036.h> |
| 11 | #include <asm/arch-rockchip/hardware.h> |
| 12 | #include <asm/arch-rockchip/sdram_rk3036.h> |
| 13 | #include <asm/arch-rockchip/timer.h> |
| 14 | #include <asm/arch-rockchip/uart.h> |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 15 | |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 16 | #define GRF_BASE 0x20008000 |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 17 | |
| 18 | #define DEBUG_UART_BASE 0x20068000 |
| 19 | |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 20 | void board_init_f(ulong dummy) |
| 21 | { |
| 22 | #ifdef EARLY_DEBUG |
Tom Rini | 9240876 | 2017-05-08 22:14:20 -0400 | [diff] [blame] | 23 | struct rk3036_grf * const grf = (void *)GRF_BASE; |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 24 | /* |
| 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 Glass | e0f177b | 2015-12-13 21:37:00 -0700 | [diff] [blame] | 34 | debug_uart_init(); |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 35 | #endif |
| 36 | rockchip_timer_init(); |
| 37 | sdram_init(); |
| 38 | |
| 39 | /* return to maskrom */ |
Philipp Tomsich | 7234c73 | 2017-10-10 16:21:16 +0200 | [diff] [blame] | 40 | back_to_bootrom(BROM_BOOT_NEXTSTAGE); |
huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | /* Place Holders */ |
| 44 | void 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 | } |