diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-19 10:43:34 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-19 10:44:53 -0500 |
commit | 40cc52440073903f3b7477a3391c4ca0761445d0 (patch) | |
tree | 3f1f0cdf4180746acb32e3b1089b3a771fb8258c /arch/arm/plat-iop | |
parent | 83cf1eecfe9afee99d6b86f963187acd414c019d (diff) |
ARM: clockevents: fix IOP clock events initialization
Ensure that no interrupt is pending before registering the clock
event device, and properly initialize the periodic tick in the
->set_mode callback.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-iop')
-rw-r--r-- | arch/arm/plat-iop/time.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c index 85d3e55ca4a9..d615e6fbe502 100644 --- a/arch/arm/plat-iop/time.c +++ b/arch/arm/plat-iop/time.c | |||
@@ -87,6 +87,7 @@ static void iop_set_mode(enum clock_event_mode mode, | |||
87 | case CLOCK_EVT_MODE_PERIODIC: | 87 | case CLOCK_EVT_MODE_PERIODIC: |
88 | write_tmr0(tmr & ~IOP_TMR_EN); | 88 | write_tmr0(tmr & ~IOP_TMR_EN); |
89 | write_tcr0(ticks_per_jiffy - 1); | 89 | write_tcr0(ticks_per_jiffy - 1); |
90 | write_trr0(ticks_per_jiffy - 1); | ||
90 | tmr |= (IOP_TMR_RELOAD | IOP_TMR_EN); | 91 | tmr |= (IOP_TMR_RELOAD | IOP_TMR_EN); |
91 | break; | 92 | break; |
92 | case CLOCK_EVT_MODE_ONESHOT: | 93 | case CLOCK_EVT_MODE_ONESHOT: |
@@ -152,6 +153,7 @@ void __init iop_init_time(unsigned long tick_rate) | |||
152 | * Set up interrupting clockevent timer 0. | 153 | * Set up interrupting clockevent timer 0. |
153 | */ | 154 | */ |
154 | write_tmr0(timer_ctl & ~IOP_TMR_EN); | 155 | write_tmr0(timer_ctl & ~IOP_TMR_EN); |
156 | write_tisr(1); | ||
155 | setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); | 157 | setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); |
156 | clockevents_calc_mult_shift(&iop_clockevent, | 158 | clockevents_calc_mult_shift(&iop_clockevent, |
157 | tick_rate, IOP_MIN_RANGE); | 159 | tick_rate, IOP_MIN_RANGE); |
@@ -161,9 +163,6 @@ void __init iop_init_time(unsigned long tick_rate) | |||
161 | clockevent_delta2ns(0xf, &iop_clockevent); | 163 | clockevent_delta2ns(0xf, &iop_clockevent); |
162 | iop_clockevent.cpumask = cpumask_of(0); | 164 | iop_clockevent.cpumask = cpumask_of(0); |
163 | clockevents_register_device(&iop_clockevent); | 165 | clockevents_register_device(&iop_clockevent); |
164 | write_trr0(ticks_per_jiffy - 1); | ||
165 | write_tcr0(ticks_per_jiffy - 1); | ||
166 | write_tmr0(timer_ctl); | ||
167 | 166 | ||
168 | /* | 167 | /* |
169 | * Set up free-running clocksource timer 1. | 168 | * Set up free-running clocksource timer 1. |