* [patch-rt 0/2] Initial ARM generic-timeofday support
@ 2006-06-05 22:29 dsaxena
2006-06-05 22:29 ` [patch-rt 1/2] Remove existing time code from ARM architecture dsaxena
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: dsaxena @ 2006-06-05 22:29 UTC (permalink / raw)
To: mingo, tglx, johnstul; +Cc: dwalker, james.perkins, linux-kernel, rmk, khilman
Hi,
This patchset (against -rt26, but should apply to newer patch) adds
initial support for generic TOD on ARM. It is fairly simple and
copletely rips out the existing TOD code in ARM, assuming that each
sub-arch will either provide a clocksource or enable CONFIG_IS_TICK_BASED.
Currently only Versatile is supported.
Please apply so folks can start testing or provide comments.
Tnx,
~Deepak
--
Deepak Saxena - dsaxena@plexity.net - http://www.plexity.net
In the end, they will not say, "those were dark times," they will ask
"why were their poets silent?" - Bertold Brecht
^ permalink raw reply [flat|nested] 9+ messages in thread
* [patch-rt 1/2] Remove existing time code from ARM architecture
2006-06-05 22:29 [patch-rt 0/2] Initial ARM generic-timeofday support dsaxena
@ 2006-06-05 22:29 ` dsaxena
2006-06-05 23:13 ` john stultz
2006-06-05 22:29 ` [patch-rt 2/2] Add clocksource driver for Versatile board dsaxena
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: dsaxena @ 2006-06-05 22:29 UTC (permalink / raw)
To: mingo, tglx, johnstul
Cc: dwalker, james.perkins, linux-kernel, rmk, khilman, Deepak Saxena
[-- Attachment #1: arm-generic-timeofday.patch --]
[-- Type: text/plain, Size: 5523 bytes --]
This patch removes do_gettimeofday(), do_setttimeofday() and associated
time functions from ARM so that it can use the generic time-of-day code.
Each sub-arch must explicitly enable CONFIG_IS_TICK_BASED if it does
not have continous timer source.
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Index: linux-2.6-rt/arch/arm/Kconfig
===================================================================
--- linux-2.6-rt.orig/arch/arm/Kconfig
+++ linux-2.6-rt/arch/arm/Kconfig
@@ -46,6 +46,10 @@ config MCA
<file:Documentation/mca.txt> (and especially the web page given
there) before attempting to build an MCA bus kernel.
+config GENERIC_TIME
+ bool
+ default y
+
config GENERIC_HARDIRQS
bool
default y
Index: linux-2.6-rt/arch/arm/kernel/time.c
===================================================================
--- linux-2.6-rt.orig/arch/arm/kernel/time.c
+++ linux-2.6-rt/arch/arm/kernel/time.c
@@ -28,6 +28,7 @@
#include <linux/profile.h>
#include <linux/sysdev.h>
#include <linux/timer.h>
+#include <linux/timeofday.h>
#include <asm/leds.h>
#include <asm/thread_info.h>
@@ -70,10 +71,12 @@ EXPORT_SYMBOL(profile_pc);
*/
int (*set_rtc)(void);
+#ifdef CONFIG_IS_TICK_BASED
static unsigned long dummy_gettimeoffset(void)
{
return 0;
}
+#endif
/*
* Scheduler clock - returns current time in nanosec units.
@@ -85,34 +88,18 @@ unsigned long long __attribute__((weak))
return (unsigned long long)jiffies * (1000000000 / HZ);
}
-static unsigned long next_rtc_update;
-
/*
- * If we have an externally synchronized linux clock, then update
- * CMOS clock accordingly every ~11 minutes. set_rtc() has to be
- * called as close as possible to 500 ms before the new second
- * starts.
+ * TODO: Merge this with generic RTC layer
*/
-static inline void do_set_rtc(void)
+s64 read_persistent_clock(void)
{
- if (!ntp_synced() || set_rtc == NULL)
- return;
-
- if (next_rtc_update &&
- time_before((unsigned long)xtime.tv_sec, next_rtc_update))
- return;
-
- if (xtime.tv_nsec < 500000000 - ((unsigned) tick_nsec >> 1) &&
- xtime.tv_nsec >= 500000000 + ((unsigned) tick_nsec >> 1))
- return;
+ return 0; /* XXX - do something here! */
+}
- if (set_rtc())
- /*
- * rtc update failed. Try again in 60s
- */
- next_rtc_update = xtime.tv_sec + 60;
- else
- next_rtc_update = xtime.tv_sec + 660;
+void sync_persistent_clock(struct timespec ts)
+{
+ if (set_rtc)
+ set_rtc();
}
#ifdef CONFIG_LEDS
@@ -231,66 +218,6 @@ static inline void do_leds(void)
#define do_leds()
#endif
-void do_gettimeofday(struct timeval *tv)
-{
- unsigned long flags;
- unsigned long seq;
- unsigned long usec, sec, lost;
-
- do {
- seq = read_seqbegin_irqsave(&xtime_lock, flags);
- usec = system_timer->offset();
-
- lost = jiffies - wall_jiffies;
- if (lost)
- usec += lost * USECS_PER_JIFFY;
-
- sec = xtime.tv_sec;
- usec += xtime.tv_nsec / 1000;
- } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
-
- /* usec may have gone up a lot: be safe */
- while (usec >= 1000000) {
- usec -= 1000000;
- sec++;
- }
-
- tv->tv_sec = sec;
- tv->tv_usec = usec;
-}
-
-EXPORT_SYMBOL(do_gettimeofday);
-
-int do_settimeofday(struct timespec *tv)
-{
- time_t wtm_sec, sec = tv->tv_sec;
- long wtm_nsec, nsec = tv->tv_nsec;
-
- if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
- return -EINVAL;
-
- write_seqlock_irq(&xtime_lock);
- /*
- * This is revolting. We need to set "xtime" correctly. However, the
- * value in this location is the value at the most recent update of
- * wall time. Discover what correction gettimeofday() would have
- * done, and then undo it!
- */
- nsec -= system_timer->offset() * NSEC_PER_USEC;
- nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
-
- wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
- wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
-
- set_normalized_timespec(&xtime, sec, nsec);
- set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
-
- ntp_clear();
- write_sequnlock_irq(&xtime_lock);
- clock_was_set();
- return 0;
-}
-
EXPORT_SYMBOL(do_settimeofday);
/**
@@ -333,11 +260,8 @@ void timer_tick(struct pt_regs *regs)
{
profile_tick(CPU_PROFILING, regs);
do_leds();
- do_set_rtc();
do_timer(regs);
-#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
-#endif
}
#ifdef CONFIG_PM
@@ -496,8 +420,10 @@ device_initcall(timer_init_sysfs);
void __init time_init(void)
{
+#ifdef CONFIG_IS_TICK_BASED
if (system_timer->offset == NULL)
system_timer->offset = dummy_gettimeoffset;
+#endif
system_timer->init();
}
Index: linux-2.6-rt/include/asm-arm/timeofday.h
===================================================================
--- /dev/null
+++ linux-2.6-rt/include/asm-arm/timeofday.h
@@ -0,0 +1,4 @@
+#ifndef _ASM_ARM_TIMEOFDAY_H
+#define _ASM_ARM_TIMEOFDAY_H
+#include <asm-generic/timeofday.h>
+#endif
Index: linux-2.6-rt/include/asm-arm/mach/time.h
===================================================================
--- linux-2.6-rt.orig/include/asm-arm/mach/time.h
+++ linux-2.6-rt/include/asm-arm/mach/time.h
@@ -38,7 +38,10 @@ struct sys_timer {
void (*init)(void);
void (*suspend)(void);
void (*resume)(void);
+
+#ifdef CONFIG_IS_TICK_BASED
unsigned long (*offset)(void);
+#endif
#ifdef CONFIG_NO_IDLE_HZ
struct dyn_tick_timer *dyn_tick;
--
Deepak Saxena - dsaxena@plexity.net - http://www.plexity.net
In the end, they will not say, "those were dark times," they will ask
"why were their poets silent?" - Bertold Brecht
^ permalink raw reply [flat|nested] 9+ messages in thread
* [patch-rt 2/2] Add clocksource driver for Versatile board
2006-06-05 22:29 [patch-rt 0/2] Initial ARM generic-timeofday support dsaxena
2006-06-05 22:29 ` [patch-rt 1/2] Remove existing time code from ARM architecture dsaxena
@ 2006-06-05 22:29 ` dsaxena
2006-06-05 23:17 ` john stultz
2006-06-05 23:06 ` [patch-rt 0/2] Initial ARM generic-timeofday support john stultz
2006-06-06 20:05 ` Kevin Hilman
3 siblings, 1 reply; 9+ messages in thread
From: dsaxena @ 2006-06-05 22:29 UTC (permalink / raw)
To: mingo, tglx, johnstul
Cc: dwalker, james.perkins, linux-kernel, rmk, khilman, Deepak Saxena
[-- Attachment #1: arm-versatile-hrt.patch --]
[-- Type: text/plain, Size: 3027 bytes --]
This patch adds a clocksource driver for the ARM versatile board,
allowing it to use the generic time-of-day code.
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Index: linux-2.6-rt/arch/arm/mach-versatile/core.c
===================================================================
--- linux-2.6-rt.orig/arch/arm/mach-versatile/core.c
+++ linux-2.6-rt/arch/arm/mach-versatile/core.c
@@ -27,6 +27,7 @@
#include <linux/interrupt.h>
#include <linux/amba/bus.h>
#include <linux/amba/clcd.h>
+#include <linux/clockchips.h>
#include <asm/system.h>
#include <asm/hardware.h>
@@ -815,46 +816,6 @@ void __init versatile_init(void)
#endif
/*
- * Returns number of ms since last clock interrupt. Note that interrupts
- * will have been disabled by do_gettimeoffset()
- */
-static unsigned long versatile_gettimeoffset(void)
-{
- unsigned long ticks1, ticks2, status;
-
- /*
- * Get the current number of ticks. Note that there is a race
- * condition between us reading the timer and checking for
- * an interrupt. We get around this by ensuring that the
- * counter has not reloaded between our two reads.
- */
- ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;
- do {
- ticks1 = ticks2;
- status = __raw_readl(VA_IC_BASE + VIC_RAW_STATUS);
- ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;
- } while (ticks2 > ticks1);
-
- /*
- * Number of ticks since last interrupt.
- */
- ticks1 = TIMER_RELOAD - ticks2;
-
- /*
- * Interrupt pending? If so, we've reloaded once already.
- *
- * FIXME: Need to check this is effectively timer 0 that expires
- */
- if (status & IRQMASK_TIMERINT0_1)
- ticks1 += TIMER_RELOAD;
-
- /*
- * Convert the ticks to usecs
- */
- return TICKS2USECS(ticks1);
-}
-
-/*
* IRQ handler for the timer
*/
static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -917,5 +878,36 @@ static void __init versatile_timer_init(
struct sys_timer versatile_timer = {
.init = versatile_timer_init,
- .offset = versatile_gettimeoffset,
};
+
+cycle_t versatile_get_cycles(void)
+{
+ return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
+}
+
+static struct clocksource clocksource_versatile = {
+ .name = "timer3",
+ .rating = 200,
+ .read = versatile_get_cycles,
+ .mask = 0xFFFFFFFF,
+ .shift = 10,
+ .is_continuous = 1,
+};
+
+static int __init versatile_clocksource_init(void)
+{
+ writel(0, TIMER3_VA_BASE + TIMER_CTRL);
+ writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD);
+ writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE);
+ writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
+ TIMER3_VA_BASE + TIMER_CTRL);
+
+ clocksource_versatile.mult =
+ clocksource_khz2mult(1000, clocksource_versatile.shift);
+ register_clocksource(&clocksource_versatile);
+
+ return 0;
+}
+
+device_initcall(versatile_clocksource_init);
+
--
Deepak Saxena - dsaxena@plexity.net - http://www.plexity.net
In the end, they will not say, "those were dark times," they will ask
"why were their poets silent?" - Bertold Brecht
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch-rt 0/2] Initial ARM generic-timeofday support
2006-06-05 22:29 [patch-rt 0/2] Initial ARM generic-timeofday support dsaxena
2006-06-05 22:29 ` [patch-rt 1/2] Remove existing time code from ARM architecture dsaxena
2006-06-05 22:29 ` [patch-rt 2/2] Add clocksource driver for Versatile board dsaxena
@ 2006-06-05 23:06 ` john stultz
2006-06-05 23:13 ` Deepak Saxena
2006-06-06 20:05 ` Kevin Hilman
3 siblings, 1 reply; 9+ messages in thread
From: john stultz @ 2006-06-05 23:06 UTC (permalink / raw)
To: dsaxena; +Cc: mingo, tglx, dwalker, james.perkins, linux-kernel, rmk, khilman
On Mon, 2006-06-05 at 15:29 -0700, dsaxena@plexity.net wrote:
> Hi,
>
> This patchset (against -rt26, but should apply to newer patch) adds
> initial support for generic TOD on ARM. It is fairly simple and
> copletely rips out the existing TOD code in ARM, assuming that each
> sub-arch will either provide a clocksource or enable CONFIG_IS_TICK_BASED.
> Currently only Versatile is supported.
Ah! Looks cool! As a warning, -rt is still running w/ an older version
of the TOD code (B20), so some changes will be needed when -rt moves to
the current version (C2, right now).
The main change is that the read/sync persistent clock bits got cut, so
the clock syncing is still necessary in timer_tick(). There might be a
few other differences but most of the changes were arch-generic so it
shouldn't be too much of an issue.
thanks
-john
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch-rt 1/2] Remove existing time code from ARM architecture
2006-06-05 22:29 ` [patch-rt 1/2] Remove existing time code from ARM architecture dsaxena
@ 2006-06-05 23:13 ` john stultz
0 siblings, 0 replies; 9+ messages in thread
From: john stultz @ 2006-06-05 23:13 UTC (permalink / raw)
To: dsaxena; +Cc: mingo, tglx, dwalker, james.perkins, linux-kernel, rmk, khilman
On Mon, 2006-06-05 at 15:29 -0700, dsaxena@plexity.net wrote:
> plain text document attachment (arm-generic-timeofday.patch)
> This patch removes do_gettimeofday(), do_setttimeofday() and associated
> time functions from ARM so that it can use the generic time-of-day code.
> Each sub-arch must explicitly enable CONFIG_IS_TICK_BASED if it does
> not have continous timer source.
It might be good to define CONFIG_IS_TICK_BASED for the other ARM arches
so they continue to build after your changes. Otherwise it looks good to
me.
Another aside: CONFIG_IS_TICK_BASED also goes away w/ the Cx series. So
there you will want to conditionally enable GENERIC_TIME if you have a
clocksources defined and just wrap the old get/set_timeofday() w/ ifndef
CONFIG_GENERIC_TIME until all the sub-arches have been converted. Don't
worry too much, I'll lend a hand here when the time comes to update -rt,
so it shouldn't be much of an issue.
thanks
-john
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch-rt 0/2] Initial ARM generic-timeofday support
2006-06-05 23:06 ` [patch-rt 0/2] Initial ARM generic-timeofday support john stultz
@ 2006-06-05 23:13 ` Deepak Saxena
2006-06-05 23:16 ` john stultz
0 siblings, 1 reply; 9+ messages in thread
From: Deepak Saxena @ 2006-06-05 23:13 UTC (permalink / raw)
To: john stultz
Cc: mingo, tglx, dwalker, james.perkins, linux-kernel, rmk, khilman
On Jun 05 2006, at 16:06, john stultz was caught saying:
> On Mon, 2006-06-05 at 15:29 -0700, dsaxena@plexity.net wrote:
> > Hi,
> >
> > This patchset (against -rt26, but should apply to newer patch) adds
> > initial support for generic TOD on ARM. It is fairly simple and
> > copletely rips out the existing TOD code in ARM, assuming that each
> > sub-arch will either provide a clocksource or enable CONFIG_IS_TICK_BASED.
> > Currently only Versatile is supported.
>
> Ah! Looks cool! As a warning, -rt is still running w/ an older version
> of the TOD code (B20), so some changes will be needed when -rt moves to
> the current version (C2, right now).
>
> The main change is that the read/sync persistent clock bits got cut, so
> the clock syncing is still necessary in timer_tick(). There might be a
> few other differences but most of the changes were arch-generic so it
> shouldn't be too much of an issue.
OK, I'll keep my out for that. Actually, maybe I should send you a patch
for latest TOD code. Are there any plans to just sync the persistent
time updates with the generic RTC layer? It would require moving stuff
like the CMOS clock code to drivers/rtc, but it would provide a generic
solution.
Tnx,
~Deepak
--
Deepak Saxena - dsaxena@plexity.net - http://www.plexity.net
In the end, they will not say, "those were dark times," they will ask
"why were their poets silent?" - Bertold Brecht
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch-rt 0/2] Initial ARM generic-timeofday support
2006-06-05 23:13 ` Deepak Saxena
@ 2006-06-05 23:16 ` john stultz
0 siblings, 0 replies; 9+ messages in thread
From: john stultz @ 2006-06-05 23:16 UTC (permalink / raw)
To: dsaxena; +Cc: mingo, tglx, dwalker, james.perkins, linux-kernel, rmk, khilman
On Mon, 2006-06-05 at 16:13 -0700, Deepak Saxena wrote:
> On Jun 05 2006, at 16:06, john stultz was caught saying:
> > On Mon, 2006-06-05 at 15:29 -0700, dsaxena@plexity.net wrote:
> > > Hi,
> > >
> > > This patchset (against -rt26, but should apply to newer patch) adds
> > > initial support for generic TOD on ARM. It is fairly simple and
> > > copletely rips out the existing TOD code in ARM, assuming that each
> > > sub-arch will either provide a clocksource or enable CONFIG_IS_TICK_BASED.
> > > Currently only Versatile is supported.
> >
> > Ah! Looks cool! As a warning, -rt is still running w/ an older version
> > of the TOD code (B20), so some changes will be needed when -rt moves to
> > the current version (C2, right now).
> >
> > The main change is that the read/sync persistent clock bits got cut, so
> > the clock syncing is still necessary in timer_tick(). There might be a
> > few other differences but most of the changes were arch-generic so it
> > shouldn't be too much of an issue.
>
> OK, I'll keep my out for that. Actually, maybe I should send you a patch
> for latest TOD code. Are there any plans to just sync the persistent
> time updates with the generic RTC layer? It would require moving stuff
> like the CMOS clock code to drivers/rtc, but it would provide a generic
> solution.
Hmmmm. I like that idea! I've been a bit too busy to look at the RTC
changes in detail, but yes, it sounds like the way to go.
thanks!
-john
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch-rt 2/2] Add clocksource driver for Versatile board
2006-06-05 22:29 ` [patch-rt 2/2] Add clocksource driver for Versatile board dsaxena
@ 2006-06-05 23:17 ` john stultz
0 siblings, 0 replies; 9+ messages in thread
From: john stultz @ 2006-06-05 23:17 UTC (permalink / raw)
To: dsaxena; +Cc: mingo, tglx, dwalker, james.perkins, linux-kernel, rmk, khilman
On Mon, 2006-06-05 at 15:29 -0700, dsaxena@plexity.net wrote:
> plain text document attachment (arm-versatile-hrt.patch)
> This patch adds a clocksource driver for the ARM versatile board,
> allowing it to use the generic time-of-day code.
Code looks good to me!
thanks
-john
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch-rt 0/2] Initial ARM generic-timeofday support
2006-06-05 22:29 [patch-rt 0/2] Initial ARM generic-timeofday support dsaxena
` (2 preceding siblings ...)
2006-06-05 23:06 ` [patch-rt 0/2] Initial ARM generic-timeofday support john stultz
@ 2006-06-06 20:05 ` Kevin Hilman
3 siblings, 0 replies; 9+ messages in thread
From: Kevin Hilman @ 2006-06-06 20:05 UTC (permalink / raw)
To: dsaxena; +Cc: mingo, tglx, johnstul, dwalker, james.perkins, linux-kernel, rmk
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
On Mon, 2006-06-05 at 15:29 -0700, dsaxena@plexity.net wrote:
> patchset (against -rt26, but should apply to newer patch) adds
> initial support for generic TOD on ARM. It is fairly simple and
> copletely rips out the existing TOD code in ARM, assuming that each
> sub-arch will either provide a clocksource or enable CONFIG_IS_TICK_BASED.
> Currently only Versatile is supported.
And here's a patch on top of the ARM support which adds a clocksource
for the ixp4xx platform.
Kevin
[-- Attachment #2: arm-ixp4xx-clocksource.patch --]
[-- Type: text/x-patch, Size: 2218 bytes --]
Add a clocksource driver for the Intel IXP4xx platform allowing it to
use the generic time-of-day code.
Signed-off-by: Kevin Hilman <khilman@deeprooted.net>
Index: ixp4xx/arch/arm/mach-ixp4xx/common.c
===================================================================
--- ixp4xx.orig/arch/arm/mach-ixp4xx/common.c
+++ ixp4xx/arch/arm/mach-ixp4xx/common.c
@@ -27,6 +27,7 @@
#include <linux/bitops.h>
#include <linux/time.h>
#include <linux/timex.h>
+#include <linux/clocksource.h>
#include <asm/hardware.h>
#include <asm/uaccess.h>
@@ -253,16 +254,6 @@ static unsigned volatile last_jiffy_time
#define CLOCK_TICKS_PER_USEC ((CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC)
-/* IRQs are disabled before entering here from do_gettimeofday() */
-static unsigned long ixp4xx_gettimeoffset(void)
-{
- u32 elapsed;
-
- elapsed = *IXP4XX_OSTS - last_jiffy_time;
-
- return elapsed / CLOCK_TICKS_PER_USEC;
-}
-
static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
write_seqlock(&xtime_lock);
@@ -297,8 +288,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 */
@@ -307,7 +296,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[] = {
@@ -363,3 +351,30 @@ 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 = 10,
+ .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);
+ register_clocksource(&clocksource_ixp4xx);
+
+ return 0;
+}
+
+device_initcall(ixp4xx_clocksource_init);
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-06-06 20:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-05 22:29 [patch-rt 0/2] Initial ARM generic-timeofday support dsaxena
2006-06-05 22:29 ` [patch-rt 1/2] Remove existing time code from ARM architecture dsaxena
2006-06-05 23:13 ` john stultz
2006-06-05 22:29 ` [patch-rt 2/2] Add clocksource driver for Versatile board dsaxena
2006-06-05 23:17 ` john stultz
2006-06-05 23:06 ` [patch-rt 0/2] Initial ARM generic-timeofday support john stultz
2006-06-05 23:13 ` Deepak Saxena
2006-06-05 23:16 ` john stultz
2006-06-06 20:05 ` Kevin Hilman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.