xref: /linux/arch/arm/include/asm/smp_twd.h (revision 81e46f7b6dcec485bcb1f988ba4dc5b20189573c)
1f32f4ce2SRussell King #ifndef __ASMARM_SMP_TWD_H
2f32f4ce2SRussell King #define __ASMARM_SMP_TWD_H
3f32f4ce2SRussell King 
4f4a27aedSSrinidhi Kasagar #define TWD_TIMER_LOAD			0x00
5f4a27aedSSrinidhi Kasagar #define TWD_TIMER_COUNTER		0x04
6f4a27aedSSrinidhi Kasagar #define TWD_TIMER_CONTROL		0x08
7f4a27aedSSrinidhi Kasagar #define TWD_TIMER_INTSTAT		0x0C
8f4a27aedSSrinidhi Kasagar 
9f4a27aedSSrinidhi Kasagar #define TWD_WDOG_LOAD			0x20
10f4a27aedSSrinidhi Kasagar #define TWD_WDOG_COUNTER		0x24
11f4a27aedSSrinidhi Kasagar #define TWD_WDOG_CONTROL		0x28
12f4a27aedSSrinidhi Kasagar #define TWD_WDOG_INTSTAT		0x2C
13f4a27aedSSrinidhi Kasagar #define TWD_WDOG_RESETSTAT		0x30
14f4a27aedSSrinidhi Kasagar #define TWD_WDOG_DISABLE		0x34
15f4a27aedSSrinidhi Kasagar 
16f4a27aedSSrinidhi Kasagar #define TWD_TIMER_CONTROL_ENABLE	(1 << 0)
17f4a27aedSSrinidhi Kasagar #define TWD_TIMER_CONTROL_ONESHOT	(0 << 1)
18f4a27aedSSrinidhi Kasagar #define TWD_TIMER_CONTROL_PERIODIC	(1 << 1)
19f4a27aedSSrinidhi Kasagar #define TWD_TIMER_CONTROL_IT_ENABLE	(1 << 2)
20f4a27aedSSrinidhi Kasagar 
21*81e46f7bSMarc Zyngier #include <linux/ioport.h>
22*81e46f7bSMarc Zyngier 
23f32f4ce2SRussell King struct clock_event_device;
24f32f4ce2SRussell King 
25f32f4ce2SRussell King extern void __iomem *twd_base;
26f32f4ce2SRussell King 
27*81e46f7bSMarc Zyngier int twd_timer_setup(struct clock_event_device *);
28*81e46f7bSMarc Zyngier 
29*81e46f7bSMarc Zyngier struct twd_local_timer {
30*81e46f7bSMarc Zyngier 	struct resource	res[2];
31*81e46f7bSMarc Zyngier };
32*81e46f7bSMarc Zyngier 
33*81e46f7bSMarc Zyngier #define DEFINE_TWD_LOCAL_TIMER(name,base,irq)	\
34*81e46f7bSMarc Zyngier struct twd_local_timer name __initdata = {	\
35*81e46f7bSMarc Zyngier 	.res	= {				\
36*81e46f7bSMarc Zyngier 		DEFINE_RES_MEM(base, 0x10),	\
37*81e46f7bSMarc Zyngier 		DEFINE_RES_IRQ(irq),		\
38*81e46f7bSMarc Zyngier 	},					\
39*81e46f7bSMarc Zyngier };
40*81e46f7bSMarc Zyngier 
41*81e46f7bSMarc Zyngier int twd_local_timer_register(struct twd_local_timer *);
42f32f4ce2SRussell King 
43f32f4ce2SRussell King #endif
44