summaryrefslogtreecommitdiff
path: root/include/rk_timer_irq.h
blob: 6de549e2817ab1d6f25013adc912677675094054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * (C) Copyright 2018 Rockchip Electronics Co., Ltd
 *
 * SPDX-License-Identifier:     GPL-2.0+
 */

#ifndef _RK_TIMER_IRQ_H
#define _RK_TIMER_IRQ_H

#include <irq-platform.h>

#ifdef CONFIG_ROCKCHIP_RK3399
#define TIMER_CTRL		0x1c
#else
#define TIMER_CTRL		0x10
#endif

#define TIMER_LOAD_COUNT0	0x00
#define TIMER_LOAD_COUNT1	0x04
#define TIMER_INTSTATUS		0x18

#define TIMER_EN		BIT(0)
#define TIMER_INT_EN		BIT(2)
#define TIMER_CLR_INT		BIT(0)

#if defined(CONFIG_ROCKCHIP_RK3128)
#define TIMER_BASE		(0x20044000 + 0x20)	/* TIMER 1 */
#define TIMER_IRQ		IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK322X)
#define TIMER_BASE		(0x110C0000 + 0x20)	/* TIMER 1 */
#define TIMER_IRQ		IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3288)
#define TIMER_BASE		(0xFF6B0000 + 0x20)	/* TIMER 1 */
#define TIMER_IRQ		IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3328)
#define TIMER_BASE		(0xFF1C0000 + 0x20)	/* TIMER 1 */
#define TIMER_IRQ		IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3368)
/*
 * Use timer0 and never change, because timer0 will be used in charge animation
 * driver to support auto wakeup when system suspend. If core poweroff, PMU only
 * support timer0(not all timer) as wakeup source.
 */
#define TIMER_BASE		(0xFF810000 + 0x00)	/* TIMER 0 */
#define TIMER_IRQ		IRQ_TIMER0
#elif defined(CONFIG_ROCKCHIP_RK3399)
#define TIMER_BASE		(0xFF850000 + 0x20)	/* TIMER 1 */
#define TIMER_IRQ		IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3308)
#define TIMER_BASE		(0xFF1a0000 + 0x20)	/* TIMER 1 */
#define TIMER_IRQ		IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_PX30)
/*
 * Use timer0 and never change, because timer0 will be used in charge animation
 * driver to support auto wakeup when system suspend. If core poweroff, PMU only
 * support timer0(not all timer) as wakeup source.
 */
#define TIMER_BASE		(0xFF210000 + 0x00)	/* TIMER 0 */
#define TIMER_IRQ		IRQ_TIMER0
#elif defined(CONFIG_ROCKCHIP_RK1808)
#define TIMER_BASE		(0xFF700000 + 0x20)	/* TIMER 1 */
#define TIMER_IRQ		IRQ_TIMER1
#else
"Missing definitions of timer module test"
#endif

#endif