Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339919
b: refs/heads/master
c: 971d025
h: refs/heads/master
i:
  339917: 9892d21
  339915: 21db9db
  339911: 473f810
  339903: 7bf64c1
v: v3
  • Loading branch information
Jon Hunter committed Nov 12, 2012
1 parent 07e46d1 commit caf4057
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 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: d308ba50a1234b299a00e63a95e61fdeb2f1a2df
refs/heads/master: 971d0254480572bc6dc5574c28ef8fe014660a31
17 changes: 10 additions & 7 deletions trunk/arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static int omap2_gp_timer_set_next_event(unsigned long cycles,
struct clock_event_device *evt)
{
__omap_dm_timer_load_start(&clkev, OMAP_TIMER_CTRL_ST,
0xffffffff - cycles, 1);
0xffffffff - cycles, OMAP_TIMER_POSTED);

return 0;
}
Expand All @@ -118,18 +118,18 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
{
u32 period;

__omap_dm_timer_stop(&clkev, 1, clkev.rate);
__omap_dm_timer_stop(&clkev, OMAP_TIMER_POSTED, clkev.rate);

switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
period = clkev.rate / HZ;
period -= 1;
/* Looks like we need to first set the load value separately */
__omap_dm_timer_write(&clkev, OMAP_TIMER_LOAD_REG,
0xffffffff - period, 1);
0xffffffff - period, OMAP_TIMER_POSTED);
__omap_dm_timer_load_start(&clkev,
OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST,
0xffffffff - period, 1);
0xffffffff - period, OMAP_TIMER_POSTED);
break;
case CLOCK_EVT_MODE_ONESHOT:
break;
Expand Down Expand Up @@ -359,7 +359,8 @@ static bool use_gptimer_clksrc;
*/
static cycle_t clocksource_read_cycles(struct clocksource *cs)
{
return (cycle_t)__omap_dm_timer_read_counter(&clksrc, 1);
return (cycle_t)__omap_dm_timer_read_counter(&clksrc,
OMAP_TIMER_POSTED);
}

static struct clocksource clocksource_gpt = {
Expand All @@ -373,7 +374,8 @@ static struct clocksource clocksource_gpt = {
static u32 notrace dmtimer_read_sched_clock(void)
{
if (clksrc.reserved)
return __omap_dm_timer_read_counter(&clksrc, 1);
return __omap_dm_timer_read_counter(&clksrc,
OMAP_TIMER_POSTED);

return 0;
}
Expand Down Expand Up @@ -455,7 +457,8 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
BUG_ON(res);

__omap_dm_timer_load_start(&clksrc,
OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0, 1);
OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0,
OMAP_TIMER_POSTED);
setup_sched_clock(dmtimer_read_sched_clock, 32, clksrc.rate);

if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/plat-omap/include/plat/dmtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
#define OMAP_TIMER_TRIGGER_OVERFLOW 0x01
#define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02

/* posted mode types */
#define OMAP_TIMER_NONPOSTED 0x00
#define OMAP_TIMER_POSTED 0x01

/* timer capabilities used in hwmod database */
#define OMAP_TIMER_SECURE 0x80000000
#define OMAP_TIMER_ALWON 0x40000000
Expand Down

0 comments on commit caf4057

Please sign in to comment.