diff options
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/tick.h | 15 | ||||
-rw-r--r-- | arch/arm/mach-s3c24a0/include/mach/tick.h | 15 | ||||
-rw-r--r-- | arch/arm/plat-s3c/time.c | 7 |
3 files changed, 32 insertions, 5 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/tick.h b/arch/arm/mach-s3c2410/include/mach/tick.h new file mode 100644 index 000000000000..544da41979db --- /dev/null +++ b/arch/arm/mach-s3c2410/include/mach/tick.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* linux/arch/arm/mach-s3c2410/include/mach/tick.h | ||
2 | * | ||
3 | * Copyright 2008 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * | ||
7 | * S3C2410 - timer tick support | ||
8 | */ | ||
9 | |||
10 | #define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0)) | ||
11 | |||
12 | static inline int s3c24xx_ostimer_pending(void) | ||
13 | { | ||
14 | return __raw_readl(S3C2410_SRCPND) & SRCPND_TIMER4; | ||
15 | } | ||
diff --git a/arch/arm/mach-s3c24a0/include/mach/tick.h b/arch/arm/mach-s3c24a0/include/mach/tick.h new file mode 100644 index 000000000000..9dea8ba6fb72 --- /dev/null +++ b/arch/arm/mach-s3c24a0/include/mach/tick.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* linux/arch/arm/mach-s3c24a0/include/mach/tick.h | ||
2 | * | ||
3 | * Copyright 2008 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * | ||
7 | * S3C24A0 - timer tick support | ||
8 | */ | ||
9 | |||
10 | #define SUBSRC_TIMER4 (1 << (IRQ_TIMER4 - IRQ_S3CUART_RX0)) | ||
11 | |||
12 | static inline int s3c24xx_ostimer_pending(void) | ||
13 | { | ||
14 | return __raw_readl(S3C2410_SUBSRCPND) & SUBSRC_TIMER4; | ||
15 | } | ||
diff --git a/arch/arm/plat-s3c/time.c b/arch/arm/plat-s3c/time.c index c6861a05a291..d35e149f4ebf 100644 --- a/arch/arm/plat-s3c/time.c +++ b/arch/arm/plat-s3c/time.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <plat/regs-timer.h> | 36 | #include <plat/regs-timer.h> |
37 | #include <mach/regs-irq.h> | 37 | #include <mach/regs-irq.h> |
38 | #include <asm/mach/time.h> | 38 | #include <asm/mach/time.h> |
39 | #include <mach/tick.h> | ||
39 | 40 | ||
40 | #include <plat/clock.h> | 41 | #include <plat/clock.h> |
41 | #include <plat/cpu.h> | 42 | #include <plat/cpu.h> |
@@ -91,12 +92,9 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks) | |||
91 | * IRQs are disabled before entering here from do_gettimeofday() | 92 | * IRQs are disabled before entering here from do_gettimeofday() |
92 | */ | 93 | */ |
93 | 94 | ||
94 | #define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0)) | ||
95 | |||
96 | static unsigned long s3c2410_gettimeoffset (void) | 95 | static unsigned long s3c2410_gettimeoffset (void) |
97 | { | 96 | { |
98 | unsigned long tdone; | 97 | unsigned long tdone; |
99 | unsigned long irqpend; | ||
100 | unsigned long tval; | 98 | unsigned long tval; |
101 | 99 | ||
102 | /* work out how many ticks have gone since last timer interrupt */ | 100 | /* work out how many ticks have gone since last timer interrupt */ |
@@ -106,8 +104,7 @@ static unsigned long s3c2410_gettimeoffset (void) | |||
106 | 104 | ||
107 | /* check to see if there is an interrupt pending */ | 105 | /* check to see if there is an interrupt pending */ |
108 | 106 | ||
109 | irqpend = __raw_readl(S3C2410_SRCPND); | 107 | if (s3c24xx_ostimer_pending()) { |
110 | if (irqpend & SRCPND_TIMER4) { | ||
111 | /* re-read the timer, and try and fix up for the missed | 108 | /* re-read the timer, and try and fix up for the missed |
112 | * interrupt. Note, the interrupt may go off before the | 109 | * interrupt. Note, the interrupt may go off before the |
113 | * timer has re-loaded from wrapping. | 110 | * timer has re-loaded from wrapping. |