@@ -464,10 +464,9 @@
#define S5P_EINT_BASE2 (S5P_EINT_BASE1 + 16)
#define S5P_GPIOINT_BASE (S5P_EINT_BASE1 + 32)
#define IRQ_GPIO_END (S5P_GPIOINT_BASE + S5P_GPIOINT_COUNT)
-#define IRQ_TIMER_BASE (IRQ_GPIO_END + 64)
/* Set the default NR_IRQS */
-#define NR_IRQS (IRQ_TIMER_BASE + IRQ_TIMER_COUNT)
+#define NR_IRQS (IRQ_GPIO_END + 64)
#endif /* __ASM_ARCH_IRQS_H */
@@ -207,6 +207,12 @@
#define IRQ_LCD_VSYNC IRQ_S3C2443_LCD3
#define IRQ_LCD_SYSTEM IRQ_S3C2443_LCD2
+#define IRQ_TIMER0_VIC IRQ_TIMER0
+#define IRQ_TIMER1_VIC IRQ_TIMER1
+#define IRQ_TIMER2_VIC IRQ_TIMER2
+#define IRQ_TIMER3_VIC IRQ_TIMER3
+#define IRQ_TIMER4_VIC IRQ_TIMER4
+
#ifdef CONFIG_CPU_S3C2440
#define IRQ_S3C244X_AC97 IRQ_S3C2440_AC97
#else
@@ -198,9 +198,6 @@ void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
/* initialise the pair of VICs */
vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME);
vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME);
-
- /* add the timer sub-irqs */
- s3c_init_vic_timer_irq(5, IRQ_TIMER0);
}
#define eint_offset(irq) ((irq) - IRQ_EINT(0))
@@ -107,14 +107,6 @@
#define IRQ_TC IRQ_PENDN
#define IRQ_ADC S3C64XX_IRQ_VIC1(31)
-#define S3C64XX_TIMER_IRQ(x) S3C_IRQ(64 + (x))
-
-#define IRQ_TIMER0 S3C64XX_TIMER_IRQ(0)
-#define IRQ_TIMER1 S3C64XX_TIMER_IRQ(1)
-#define IRQ_TIMER2 S3C64XX_TIMER_IRQ(2)
-#define IRQ_TIMER3 S3C64XX_TIMER_IRQ(3)
-#define IRQ_TIMER4 S3C64XX_TIMER_IRQ(4)
-
/* compatibility for device defines */
#define IRQ_IIC1 IRQ_S3C6410_IIC1
@@ -141,8 +141,6 @@
#define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x))
-#define IRQ_TIMER_BASE (11)
-
/* Set the default NR_IRQS */
#define NR_IRQS (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1)
@@ -97,8 +97,6 @@
#define IRQ_SDMFIQ S5P_IRQ_VIC2(31)
#define IRQ_VIC_END S5P_IRQ_VIC2(31)
-#define IRQ_TIMER_BASE (11)
-
#define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0))
#define S5P_EINT_BASE2 (IRQ_VIC_END + 1)
@@ -118,8 +118,6 @@
#define IRQ_MDNIE3 S5P_IRQ_VIC3(8)
#define IRQ_VIC_END S5P_IRQ_VIC3(31)
-#define IRQ_TIMER_BASE (11)
-
#define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0))
#define S5P_EINT_BASE2 (IRQ_VIC_END + 1)
@@ -1161,20 +1161,20 @@ arch_initcall(s5p_pmu_init);
*/
struct platform_device s3c_device_timer[] = {
- [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
- [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
- [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
- [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
- [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
+ [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0_VIC) },
+ [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1_VIC) },
+ [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2_VIC) },
+ [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3_VIC) },
+ [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4_VIC) },
};
#endif /* CONFIG_SAMSUNG_DEV_PWM */
static struct resource samsung_pwm_resource[] = {
- DEFINE_RES_IRQ(IRQ_TIMER0),
- DEFINE_RES_IRQ(IRQ_TIMER1),
- DEFINE_RES_IRQ(IRQ_TIMER2),
- DEFINE_RES_IRQ(IRQ_TIMER3),
- DEFINE_RES_IRQ(IRQ_TIMER4),
+ DEFINE_RES_IRQ(IRQ_TIMER0_VIC),
+ DEFINE_RES_IRQ(IRQ_TIMER1_VIC),
+ DEFINE_RES_IRQ(IRQ_TIMER2_VIC),
+ DEFINE_RES_IRQ(IRQ_TIMER3_VIC),
+ DEFINE_RES_IRQ(IRQ_TIMER4_VIC),
DEFINE_RES_MEM(SAMSUNG_PA_TIMER, SZ_4K),
};
@@ -44,15 +44,6 @@
#define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x))
#define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x))
-#define S5P_TIMER_IRQ(x) (IRQ_TIMER_BASE + (x))
-
-#define IRQ_TIMER0 S5P_TIMER_IRQ(0)
-#define IRQ_TIMER1 S5P_TIMER_IRQ(1)
-#define IRQ_TIMER2 S5P_TIMER_IRQ(2)
-#define IRQ_TIMER3 S5P_TIMER_IRQ(3)
-#define IRQ_TIMER4 S5P_TIMER_IRQ(4)
-#define IRQ_TIMER_COUNT (5)
-
#define IRQ_EINT(x) ((x) < 16 ? ((x) + S5P_EINT_BASE1) \
: ((x) - 16 + S5P_EINT_BASE2))
@@ -29,6 +29,4 @@ void __init s5p_init_irq(u32 *vic, u32 num_vic)
for (irq = 0; irq < num_vic; irq++)
vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0);
#endif
-
- s3c_init_vic_timer_irq(5, IRQ_TIMER0);
}
@@ -135,6 +135,11 @@ static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id)
{
struct clock_event_device *evt = dev_id;
+ if (pwm->variant.has_tint_cstat) {
+ u32 mask = (1 << timer_source.event_id);
+ writel(mask | (mask << 5), S3C64XX_TINT_CSTAT);
+ }
+
evt->event_handler(evt);
return IRQ_HANDLED;
@@ -168,6 +173,11 @@ static void __init samsung_clockevent_init(void)
irq_number = pwm->irq[timer_source.event_id];
setup_irq(irq_number, &samsung_clock_event_irq);
+
+ if (pwm->variant.has_tint_cstat) {
+ u32 mask = (1 << timer_source.event_id);
+ writel(mask | (mask << 5), S3C64XX_TINT_CSTAT);
+ }
}
static void __iomem *samsung_timer_reg(void)