diff options
-rw-r--r-- | arch/m68knommu/platform/coldfire/timers.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/m68knommu/platform/coldfire/timers.c b/arch/m68knommu/platform/coldfire/timers.c index ba5a9f32ebd4..454f25493491 100644 --- a/arch/m68knommu/platform/coldfire/timers.c +++ b/arch/m68knommu/platform/coldfire/timers.c | |||
@@ -111,7 +111,13 @@ void hw_timer_init(void) | |||
111 | 111 | ||
112 | __raw_writew(MCFTIMER_TMR_DISABLE, TA(MCFTIMER_TMR)); | 112 | __raw_writew(MCFTIMER_TMR_DISABLE, TA(MCFTIMER_TMR)); |
113 | mcftmr_cycles_per_jiffy = FREQ / HZ; | 113 | mcftmr_cycles_per_jiffy = FREQ / HZ; |
114 | __raw_writetrr(mcftmr_cycles_per_jiffy, TA(MCFTIMER_TRR)); | 114 | /* |
115 | * The coldfire timer runs from 0 to TRR included, then 0 | ||
116 | * again and so on. It counts thus actually TRR + 1 steps | ||
117 | * for 1 tick, not TRR. So if you want n cycles, | ||
118 | * initialize TRR with n - 1. | ||
119 | */ | ||
120 | __raw_writetrr(mcftmr_cycles_per_jiffy - 1, TA(MCFTIMER_TRR)); | ||
115 | __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 | | 121 | __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 | |
116 | MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR)); | 122 | MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR)); |
117 | 123 | ||