1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Device Tree support for Rockchip SoCs
5 * Copyright (c) 2013 MundoReader S.L.
6 * Author: Heiko Stuebner <heiko@sntech.de>
9 #include <linux/kernel.h>
10 #include <linux/init.h>
12 #include <linux/of_platform.h>
13 #include <linux/irqchip.h>
14 #include <linux/clk-provider.h>
15 #include <linux/clocksource.h>
16 #include <linux/mfd/syscon.h>
17 #include <linux/regmap.h>
18 #include <asm/mach/arch.h>
19 #include <asm/mach/map.h>
20 #include <asm/hardware/cache-l2x0.h>
24 #define RK3288_TIMER6_7_PHYS 0xff810000
26 static void __init
rockchip_timer_init(void)
28 if (of_machine_is_compatible("rockchip,rk3288")) {
29 void __iomem
*reg_base
;
32 * Most/all uboot versions for rk3288 don't enable timer7
33 * which is needed for the architected timer to work.
34 * So make sure it is running during early boot.
36 reg_base
= ioremap(RK3288_TIMER6_7_PHYS
, SZ_16K
);
38 writel(0, reg_base
+ 0x30);
39 writel(0xffffffff, reg_base
+ 0x20);
40 writel(0xffffffff, reg_base
+ 0x24);
41 writel(1, reg_base
+ 0x30);
45 pr_err("rockchip: could not map timer7 registers\n");
53 static void __init
rockchip_dt_init(void)
55 rockchip_suspend_init();
58 static const char * const rockchip_board_dt_compat
[] = {
69 DT_MACHINE_START(ROCKCHIP_DT
, "Rockchip (Device Tree)")
72 .init_time
= rockchip_timer_init
,
73 .dt_compat
= rockchip_board_dt_compat
,
74 .init_machine
= rockchip_dt_init
,