Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225835
b: refs/heads/master
c: 5b0d495
h: refs/heads/master
i:
  225833: 054b31f
  225831: a359121
v: v3
  • Loading branch information
Russell King committed Dec 22, 2010
1 parent 8bf53b1 commit d8d339c
Show file tree
Hide file tree
Showing 3 changed files with 22 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: 112f38a4a31668eb6a7d91d128296a26afdf7c4b
refs/heads/master: 5b0d495c067d843c52fc1f9edbca29d5e9368b10
1 change: 1 addition & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ config ARCH_IXP4XX
select CPU_XSCALE
select GENERIC_GPIO
select GENERIC_CLOCKEVENTS
select HAVE_SCHED_CLOCK
select DMABOUNCE if PCI
help
Support for Intel's IXP4XX (XScale) family of processors.
Expand Down
31 changes: 20 additions & 11 deletions trunk/arch/arm/mach-ixp4xx/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/irq.h>
#include <asm/sched_clock.h>

#include <asm/mach/map.h>
#include <asm/mach/irq.h>
Expand Down Expand Up @@ -398,6 +399,23 @@ void __init ixp4xx_sys_init(void)
ixp4xx_exp_bus_size >> 20);
}

/*
* sched_clock()
*/
static DEFINE_CLOCK_DATA(cd);

unsigned long long notrace sched_clock(void)
{
u32 cyc = *IXP4XX_OSTS;
return cyc_to_sched_clock(&cd, cyc, (u32)~0);
}

static void notrace ixp4xx_update_sched_clock(void)
{
u32 cyc = *IXP4XX_OSTS;
update_sched_clock(&cd, cyc, (u32)~0);
}

/*
* clocksource
*/
Expand All @@ -418,18 +436,9 @@ unsigned long ixp4xx_timer_freq = FREQ;
EXPORT_SYMBOL(ixp4xx_timer_freq);
static void __init ixp4xx_clocksource_init(void)
{
clocksource_register_hz(&clocksource_ixp4xx, ixp4xx_timer_freq);
}

/*
* sched_clock()
*/
unsigned long long notrace sched_clock(void)
{
cycle_t cyc = ixp4xx_get_cycles(NULL);
struct clocksource *cs = &clocksource_ixp4xx;
init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq);

return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
clocksource_register_hz(&clocksource_ixp4xx, ixp4xx_timer_freq);
}

/*
Expand Down

0 comments on commit d8d339c

Please sign in to comment.