• Stefan Roese's avatar
    powerpc: Fix decrementer setup on 1GHz boards · 3e7b4843
    Stefan Roese authored
    We noticed that recent kernels didn't boot on our 1GHz Canyonlands 460EX
    boards anymore. As it seems, patch 8d165db1 [powerpc: Improve
    decrementer accuracy] introduced this problem. The routine div_sc()
    overflows with shift = 32 resulting in this incorrect setup:
    
    time_init: decrementer frequency = 1000.000012 MHz
    time_init: processor frequency   = 1000.000012 MHz
    clocksource: timebase mult[400000] shift[22] registered
    clockevent: decrementer mult[33] shift[32] cpu[0]
    
    This patch now introduces a local div_dc64() version of this function
    so that this overflow doesn't happen anymore.
    Signed-off-by: default avatarStefan Roese <sr@denx.de>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: Detlev Zundel <dzu@denx.de>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    3e7b4843
time.c 32.8 KB