Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36669
b: refs/heads/master
c: 84904d0
h: refs/heads/master
i:
  36667: 8793465
v: v3
  • Loading branch information
Kevin Hilman authored and Russell King committed Sep 28, 2006
1 parent ba3a86c commit 7e17199
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 746140c71d537560bbd22c1b148fb21031c30e71
refs/heads/master: 84904d0ead0a8c419abd45c7b2ac8d76d50a0d48
1 change: 1 addition & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ config ARCH_IOP33X
config ARCH_IXP4XX
bool "IXP4xx-based"
depends on MMU
select GENERIC_TIME
help
Support for Intel's IXP4XX (XScale) family of processors.

Expand Down
38 changes: 27 additions & 11 deletions trunk/arch/arm/mach-ixp4xx/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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>
Expand Down Expand Up @@ -255,16 +256,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);
Expand Down Expand Up @@ -309,7 +300,6 @@ static void __init ixp4xx_timer_init(void)

struct sys_timer ixp4xx_timer = {
.init = ixp4xx_timer_init,
.offset = ixp4xx_gettimeoffset,
};

static struct resource ixp46x_i2c_resources[] = {
Expand Down Expand Up @@ -365,3 +355,29 @@ 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 = CLOCKSOURCE_MASK(32),
.shift = 20,
.is_continuous = 1,
};

unsigned long ixp4xx_timer_freq = FREQ;
static int __init ixp4xx_clocksource_init(void)
{
clocksource_ixp4xx.mult =
clocksource_hz2mult(ixp4xx_timer_freq,
clocksource_ixp4xx.shift);
clocksource_register(&clocksource_ixp4xx);

return 0;
}

device_initcall(ixp4xx_clocksource_init);
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-ixp4xx/nslu2-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ static void nslu2_power_off(void)

static void __init nslu2_init(void)
{
ixp4xx_timer_freq = NSLU2_FREQ;

ixp4xx_sys_init();

nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-arm/arch-ixp4xx/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ struct ixp4xx_i2c_pins {

struct sys_timer;

/*
* Frequency of clock used for primary clocksource
*/
extern unsigned long ixp4xx_timer_freq;

/*
* Functions used by platform-level setup code
*/
Expand Down

0 comments on commit 7e17199

Please sign in to comment.