1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2016 Rockchip Electronics Co., Ltd
6 #include <asm/arch-rockchip/hardware.h>
7 #include <asm/arch-rockchip/grf_rk3288.h>
9 #define GRF_BASE 0xff770000
11 int arch_cpu_init(void)
13 /* We do some SoC one time setting here. */
14 struct rk3288_grf * const grf = (void *)GRF_BASE;
16 /* Use rkpwm by default */
17 rk_setreg(&grf->soc_con2, 1 << 0);
22 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
23 void board_debug_uart_init(void)
25 /* Enable early UART on the RK3288 */
26 struct rk3288_grf * const grf = (void *)GRF_BASE;
28 rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
29 GPIO7C6_MASK << GPIO7C6_SHIFT,
30 GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
31 GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);