1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2016 Rockchip Electronics Co., Ltd
7 #include <asm/arch-rockchip/hardware.h>
8 #include <asm/arch-rockchip/grf_rk3288.h>
10 #define GRF_BASE 0xff770000
12 #ifdef CONFIG_SPL_BUILD
13 static void configure_l2ctlr(void)
17 l2ctlr = read_l2ctlr();
18 l2ctlr &= 0xfffc0000; /* clear bit0~bit17 */
21 * Data RAM write latency: 2 cycles
22 * Data RAM read latency: 2 cycles
23 * Data RAM setup latency: 1 cycle
24 * Tag RAM write latency: 1 cycle
25 * Tag RAM read latency: 1 cycle
26 * Tag RAM setup latency: 1 cycle
28 l2ctlr |= (1 << 3 | 1 << 0);
33 int arch_cpu_init(void)
35 #ifdef CONFIG_SPL_BUILD
38 /* We do some SoC one time setting here. */
39 struct rk3288_grf * const grf = (void *)GRF_BASE;
41 /* Use rkpwm by default */
42 rk_setreg(&grf->soc_con2, 1 << 0);
48 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
49 void board_debug_uart_init(void)
51 /* Enable early UART on the RK3288 */
52 struct rk3288_grf * const grf = (void *)GRF_BASE;
54 rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
55 GPIO7C6_MASK << GPIO7C6_SHIFT,
56 GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
57 GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);