diff -uprN -X hrt_orig/Documentation/dontdiff hrt_orig/arch/arm/Kconfig hrt/arch/arm/Kconfig --- hrt_orig/arch/arm/Kconfig 2006-06-27 13:50:30.000000000 +0000 +++ hrt/arch/arm/Kconfig 2006-07-11 14:45:05.000000000 +0000 @@ -385,6 +385,12 @@ endmenu menu "Kernel Features" +config GENERIC_TIME + bool + default y + +source "kernel/time/Kconfig" + config SMP bool "Symmetric Multi-Processing (EXPERIMENTAL)" depends on EXPERIMENTAL && REALVIEW_MPCORE diff -uprN -X hrt_orig/Documentation/dontdiff hrt_orig/arch/arm/mach-ixp4xx/common.c hrt/arch/arm/mach-ixp4xx/common.c --- hrt_orig/arch/arm/mach-ixp4xx/common.c 2006-06-27 13:50:30.000000000 +0000 +++ hrt/arch/arm/mach-ixp4xx/common.c 2006-07-14 11:53:23.000000000 +0000 @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include @@ -254,25 +256,38 @@ void __init ixp4xx_init_irq(void) static unsigned volatile last_jiffy_time; -#define CLOCK_TICKS_PER_USEC ((CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC) +#ifdef CONFIG_HIGH_RES_TIMERS -/* IRQs are disabled before entering here from do_gettimeofday() */ -static unsigned long ixp4xx_gettimeoffset(void) +static void ixp4xx_set_mode(int mode, struct clock_event *evt) { - u32 elapsed; - - elapsed = *IXP4XX_OSTS - last_jiffy_time; +} - return elapsed / CLOCK_TICKS_PER_USEC; +static void ixp4xx_set_next_event(unsigned long delta, struct clock_event *evt) +{ + *IXP4XX_OSRT1 = (delta & ~IXP4XX_OST_RELOAD_MASK) | IXP4XX_OST_ENABLE | + IXP4XX_OST_ONE_SHOT; } +static struct clock_event clockevent_ixp4xx = { + .name = "OSTS clock event interface", + .capabilities = CLOCK_CAP_NEXTEVT, + .shift = 32, + .set_mode = ixp4xx_set_mode, + .set_next_event = ixp4xx_set_next_event, +}; +#endif + static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - write_seqlock(&xtime_lock); - /* Clear Pending Interrupt by writing '1' to it */ *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; +#ifdef CONFIG_HIGH_RES_TIMERS + if (clockevent_ixp4xx.event_handler) + clockevent_ixp4xx.event_handler(regs); +#endif + write_seqlock(&xtime_lock); + /* * Catch up with the real idea of time */ @@ -300,8 +315,6 @@ static void __init ixp4xx_timer_init(voi /* Setup the Timer counter value */ *IXP4XX_OSRT1 = (LATCH & ~IXP4XX_OST_RELOAD_MASK) | IXP4XX_OST_ENABLE; - /* Reset time-stamp counter */ - *IXP4XX_OSTS = 0; last_jiffy_time = 0; /* Connect the interrupt handler and enable the interrupt */ @@ -310,7 +323,6 @@ static void __init ixp4xx_timer_init(voi struct sys_timer ixp4xx_timer = { .init = ixp4xx_timer_init, - .offset = ixp4xx_gettimeoffset, }; static struct resource ixp46x_i2c_resources[] = { @@ -366,3 +378,46 @@ void __init ixp4xx_sys_init(void) ixp4xx_exp_bus_size >> 20); } +cycle_t ixp4xx_get_cycles(void) +{ + return *IXP4XX_OSTS; +} + +static struct clocksource clocksource_ixp4xx = { + .name = "OSTS", + .rating = 200, + .read = ixp4xx_get_cycles, + .mask = 0xFFFFFFFF, + .shift = 20, + .is_continuous = 1, +}; + +static int __init ixp4xx_clocksource_init(void) +{ + /* Reset time-stamp counter */ + *IXP4XX_OSTS = 0; + + clocksource_ixp4xx.mult = + clocksource_khz2mult(66660, clocksource_ixp4xx.shift); + clocksource_register(&clocksource_ixp4xx); + + return 0; +} +device_initcall(ixp4xx_clocksource_init); + +#ifdef CONFIG_HIGH_RES_TIMERS +static int __init ixp4xx_clockevent_init(void) +{ + clockevent_ixp4xx.mult = + div_sc(FREQ, NSEC_PER_SEC, clockevent_ixp4xx.shift); + clockevent_ixp4xx.max_delta_ns = + clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); + clockevent_ixp4xx.min_delta_ns = + clockevent_delta2ns(0xf, &clockevent_ixp4xx); + register_local_clockevent(&clockevent_ixp4xx); + + return 0; +} +device_initcall(ixp4xx_clockevent_init); +#endif + diff -uprN -X hrt_orig/Documentation/dontdiff hrt_orig/arch/arm/mach-ixp4xx/common-pci.c hrt/arch/arm/mach-ixp4xx/common-pci.c --- hrt_orig/arch/arm/mach-ixp4xx/common-pci.c 2006-06-28 10:06:33.000000000 +0000 +++ hrt/arch/arm/mach-ixp4xx/common-pci.c 2006-07-11 11:08:43.000000000 +0000 @@ -532,6 +532,8 @@ pci_set_consistent_dma_mask(struct pci_d return -EIO; } +EXPORT_SYMBOL(pci_set_dma_mask); +EXPORT_SYMBOL(pci_set_consistent_dma_mask); EXPORT_SYMBOL(ixp4xx_pci_read); EXPORT_SYMBOL(ixp4xx_pci_write); diff -uprN -X hrt_orig/Documentation/dontdiff hrt_orig/include/asm-arm/hw_irq.h hrt/include/asm-arm/hw_irq.h --- hrt_orig/include/asm-arm/hw_irq.h 1970-01-01 00:00:00.000000000 +0000 +++ hrt/include/asm-arm/hw_irq.h 2006-07-11 15:16:14.000000000 +0000 @@ -0,0 +1,9 @@ +/* + * Nothing to see here yet + */ +#ifndef _ARCH_ARM_HW_IRQ_H +#define _ARCH_ARM_HW_IRQ_H + +#include + +#endif diff -uprN -X hrt_orig/Documentation/dontdiff hrt_orig/include/linux/irq.h hrt/include/linux/irq.h --- hrt_orig/include/linux/irq.h 2006-06-27 13:50:42.000000000 +0000 +++ hrt/include/linux/irq.h 2006-07-11 15:20:20.000000000 +0000 @@ -68,28 +68,29 @@ typedef struct hw_interrupt_type hw_irq * * Pad this out to 32 bytes for cache and indexing reasons. */ -typedef struct irq_desc { - hw_irq_controller *handler; - void *handler_data; - struct irqaction *action; /* IRQ action list */ - unsigned int status; /* IRQ status */ - unsigned int depth; /* nested irq disables */ - unsigned int irq_count; /* For detecting broken interrupts */ - unsigned int irqs_unhandled; - spinlock_t lock; -#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) - unsigned int move_irq; /* Flag need to re-target intr dest*/ -#endif -} ____cacheline_aligned irq_desc_t; -extern irq_desc_t irq_desc [NR_IRQS]; +//typedef struct irq_desc { +// hw_irq_controller *handler; +// void *handler_data; +// struct irqaction *action; /* IRQ action list */ +// unsigned int status; /* IRQ status */ +// unsigned int depth; /* nested irq disables */ +// unsigned int irq_count; /* For detecting broken interrupts */ +// unsigned int irqs_unhandled; +// spinlock_t lock; +//#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) +// unsigned int move_irq; /* Flag need to re-target intr dest*/ +//#endif +//} ____cacheline_aligned irq_desc_t; + +//extern irq_desc_t irq_desc [NR_IRQS]; /* Return a pointer to the irq descriptor for IRQ. */ -static inline irq_desc_t * -irq_descp (int irq) -{ - return irq_desc + irq; -} +//static inline irq_desc_t * +//irq_descp (int irq) +//{ +// return irq_desc + irq; +//} #include /* the arch dependent stuff */ diff -uprN -X hrt_orig/Documentation/dontdiff hrt_orig/kernel/hrtimer.c hrt/kernel/hrtimer.c --- hrt_orig/kernel/hrtimer.c 2006-07-14 11:44:08.000000000 +0000 +++ hrt/kernel/hrtimer.c 2006-07-11 15:14:04.000000000 +0000 @@ -40,6 +40,7 @@ #include #include #include +#include #include