Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233739
b: refs/heads/master
c: cbc9438
h: refs/heads/master
i:
  233737: b854f94
  233735: 3e0f9a6
v: v3
  • Loading branch information
Paul Walmsley authored and Tony Lindgren committed Feb 24, 2011
1 parent d1cf870 commit 70718f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c03773206bf2249a890c4d420ed32ef500630095
refs/heads/master: cbc9438075ca9dee3f39a2e7310f81c304b40359
13 changes: 13 additions & 0 deletions trunk/arch/arm/mach-omap2/timer-gp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <asm/mach/time.h>
#include <plat/dmtimer.h>
#include <asm/localtimer.h>
#include <asm/sched_clock.h>

#include "timer-gp.h"

Expand Down Expand Up @@ -190,6 +191,7 @@ static void __init omap2_gp_clocksource_init(void)
/*
* clocksource
*/
static DEFINE_CLOCK_DATA(cd);
static struct omap_dm_timer *gpt_clocksource;
static cycle_t clocksource_read_cycles(struct clocksource *cs)
{
Expand All @@ -204,6 +206,15 @@ static struct clocksource clocksource_gpt = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};

static void notrace dmtimer_update_sched_clock(void)
{
u32 cyc;

cyc = omap_dm_timer_read_counter(gpt_clocksource);

update_sched_clock(&cd, cyc, (u32)~0);
}

/* Setup free-running counter for clocksource */
static void __init omap2_gp_clocksource_init(void)
{
Expand All @@ -224,6 +235,8 @@ static void __init omap2_gp_clocksource_init(void)

omap_dm_timer_set_load_start(gpt, 1, 0);

init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate);

if (clocksource_register_hz(&clocksource_gpt, tick_rate))
printk(err2, clocksource_gpt.name);
}
Expand Down

0 comments on commit 70718f7

Please sign in to comment.