Commit 4308cb16 authored by Ralf Baechle's avatar Ralf Baechle

[MIPS] Sibyte: Fix interrupt timer off by one bug.

    
From Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>:
    
The timers need to be loaded with 1 less than the desired interval not
the interval itself.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent a77f1242
...@@ -75,10 +75,10 @@ void sb1250_time_init(void) ...@@ -75,10 +75,10 @@ void sb1250_time_init(void)
/* Disable the timer and set up the count */ /* Disable the timer and set up the count */
__raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
#ifdef CONFIG_SIMULATION #ifdef CONFIG_SIMULATION
__raw_writeq(50000 / HZ, __raw_writeq((50000 / HZ) - 1,
IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
#else #else
__raw_writeq(1000000 / HZ, __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1,
IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment