xref: /rk3399_rockchip-uboot/include/rk_timer_irq.h (revision d5f538dc02e53c7267fcd4a914104071fca889b5)
1 /*
2  * (C) Copyright 2018 Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #ifndef _RK_TIMER_IRQ_H
8 #define _RK_TIMER_IRQ_H
9 
10 #include <irq-platform.h>
11 
12 #define TIMER_LOAD_COUNT0	0x00
13 #define TIMER_LOAD_COUNT1	0x04
14 #define TIMER_CTRL		0x10
15 #define TIMER_INTSTATUS		0x18
16 
17 #define TIMER_EN		BIT(0)
18 #define TIMER_INT_EN		BIT(2)
19 #define TIMER_CLR_INT		BIT(0)
20 
21 #if defined(CONFIG_ROCKCHIP_RK3128)
22 #define TIMER_BASE		(0x20044000 + 0x20)	/* TIMER 1 */
23 #define TIMER_IRQ		IRQ_TIMER1
24 #elif defined(CONFIG_ROCKCHIP_RK322X)
25 #define TIMER_BASE		(0x110C0000 + 0x20)	/* TIMER 1 */
26 #define TIMER_IRQ		IRQ_TIMER1
27 #elif defined(CONFIG_ROCKCHIP_RK3288)
28 #define TIMER_BASE		(0xFF6B0000 + 0x20)	/* TIMER 1 */
29 #define TIMER_IRQ		IRQ_TIMER1
30 #elif defined(CONFIG_ROCKCHIP_RK3328)
31 #define TIMER_BASE		(0xFF1C0000 + 0x20)	/* TIMER 1 */
32 #define TIMER_IRQ		IRQ_TIMER1
33 #elif defined(CONFIG_ROCKCHIP_RK3368)
34 #define TIMER_BASE		(0xFF810000 + 0x20)	/* TIMER 1 */
35 #define TIMER_IRQ		IRQ_TIMER1
36 #elif defined(CONFIG_ROCKCHIP_RK3399)
37 #define TIMER_BASE		(0xFF850000 + 0x20)	/* TIMER 1 */
38 #define TIMER_IRQ		IRQ_TIMER1
39 #elif defined(CONFIG_ROCKCHIP_PX30)
40 /*
41  * Use timer0 and never change, because timer0 will be used in charge animation
42  * driver to support auto wakeup when system suspend. If core poweroff, PMU only
43  * support timer0(not all timer) as wakeup source.
44  */
45 #define TIMER_BASE		(0xFF210000 + 0x00)	/* TIMER 0 */
46 #define TIMER_IRQ		IRQ_TIMER0
47 #else
48 "Missing definitions of timer module test"
49 #endif
50 
51 #endif
52