mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 22:04:47 +08:00
[ARM] S3C24XX: Split timer pending code out
Split the timer pending code out to a seperate per-machine header so that when compiling for mach-s3c2410 or mach-s3c24a0 we can use the right timer code without having to #ifdef the timer driver. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
This commit is contained in:
parent
bcae8aeb32
commit
9bc1aaeac0
15
arch/arm/mach-s3c2410/include/mach/tick.h
Normal file
15
arch/arm/mach-s3c2410/include/mach/tick.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/* linux/arch/arm/mach-s3c2410/include/mach/tick.h
|
||||||
|
*
|
||||||
|
* Copyright 2008 Simtec Electronics
|
||||||
|
* Ben Dooks <ben@simtec.co.uk>
|
||||||
|
* http://armlinux.simtec.co.uk/
|
||||||
|
*
|
||||||
|
* S3C2410 - timer tick support
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0))
|
||||||
|
|
||||||
|
static inline int s3c24xx_ostimer_pending(void)
|
||||||
|
{
|
||||||
|
return __raw_readl(S3C2410_SRCPND) & SRCPND_TIMER4;
|
||||||
|
}
|
15
arch/arm/mach-s3c24a0/include/mach/tick.h
Normal file
15
arch/arm/mach-s3c24a0/include/mach/tick.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/* linux/arch/arm/mach-s3c24a0/include/mach/tick.h
|
||||||
|
*
|
||||||
|
* Copyright 2008 Simtec Electronics
|
||||||
|
* Ben Dooks <ben@simtec.co.uk>
|
||||||
|
* http://armlinux.simtec.co.uk/
|
||||||
|
*
|
||||||
|
* S3C24A0 - timer tick support
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SUBSRC_TIMER4 (1 << (IRQ_TIMER4 - IRQ_S3CUART_RX0))
|
||||||
|
|
||||||
|
static inline int s3c24xx_ostimer_pending(void)
|
||||||
|
{
|
||||||
|
return __raw_readl(S3C2410_SUBSRCPND) & SUBSRC_TIMER4;
|
||||||
|
}
|
@ -36,6 +36,7 @@
|
|||||||
#include <plat/regs-timer.h>
|
#include <plat/regs-timer.h>
|
||||||
#include <mach/regs-irq.h>
|
#include <mach/regs-irq.h>
|
||||||
#include <asm/mach/time.h>
|
#include <asm/mach/time.h>
|
||||||
|
#include <mach/tick.h>
|
||||||
|
|
||||||
#include <plat/clock.h>
|
#include <plat/clock.h>
|
||||||
#include <plat/cpu.h>
|
#include <plat/cpu.h>
|
||||||
@ -91,12 +92,9 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks)
|
|||||||
* IRQs are disabled before entering here from do_gettimeofday()
|
* IRQs are disabled before entering here from do_gettimeofday()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0))
|
|
||||||
|
|
||||||
static unsigned long s3c2410_gettimeoffset (void)
|
static unsigned long s3c2410_gettimeoffset (void)
|
||||||
{
|
{
|
||||||
unsigned long tdone;
|
unsigned long tdone;
|
||||||
unsigned long irqpend;
|
|
||||||
unsigned long tval;
|
unsigned long tval;
|
||||||
|
|
||||||
/* work out how many ticks have gone since last timer interrupt */
|
/* work out how many ticks have gone since last timer interrupt */
|
||||||
@ -106,8 +104,7 @@ static unsigned long s3c2410_gettimeoffset (void)
|
|||||||
|
|
||||||
/* check to see if there is an interrupt pending */
|
/* check to see if there is an interrupt pending */
|
||||||
|
|
||||||
irqpend = __raw_readl(S3C2410_SRCPND);
|
if (s3c24xx_ostimer_pending()) {
|
||||||
if (irqpend & SRCPND_TIMER4) {
|
|
||||||
/* re-read the timer, and try and fix up for the missed
|
/* re-read the timer, and try and fix up for the missed
|
||||||
* interrupt. Note, the interrupt may go off before the
|
* interrupt. Note, the interrupt may go off before the
|
||||||
* timer has re-loaded from wrapping.
|
* timer has re-loaded from wrapping.
|
||||||
|
Loading…
Reference in New Issue
Block a user