rockchip: rk3128: use ARM arch timer instead of rk_timer
[oweals/u-boot.git] / arch / arm / mach-rockchip / rk3188-board.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2015 Google, Inc
4  */
5
6 #include <common.h>
7 #include <clk.h>
8 #include <dm.h>
9 #include <ram.h>
10 #include <syscon.h>
11 #include <asm/gpio.h>
12 #include <asm/io.h>
13 #include <asm/arch-rockchip/clock.h>
14 #include <asm/arch-rockchip/grf_rk3188.h>
15 #include <asm/arch-rockchip/periph.h>
16 #include <asm/arch-rockchip/pmu_rk3288.h>
17 #include <asm/arch-rockchip/boot_mode.h>
18
19 __weak int rk_board_late_init(void)
20 {
21         return 0;
22 }
23
24 int board_late_init(void)
25 {
26         struct rk3188_grf *grf;
27
28         setup_boot_mode();
29         grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
30         if (IS_ERR(grf)) {
31                 pr_err("grf syscon returned %ld\n", PTR_ERR(grf));
32         } else {
33                 /* enable noc remap to mimic legacy loaders */
34                 rk_clrsetreg(&grf->soc_con0,
35                         NOC_REMAP_MASK << NOC_REMAP_SHIFT,
36                         NOC_REMAP_MASK << NOC_REMAP_SHIFT);
37         }
38
39         return rk_board_late_init();
40 }
41
42 int board_init(void)
43 {
44         return 0;
45 }
46
47 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
48 void enable_caches(void)
49 {
50         /* Enable D-cache. I-cache is already enabled in start.S */
51         dcache_enable();
52 }
53 #endif