[U-Boot-Users] [PATCH] MIPS time.c fix

Hi,
The patch attached makes the MIPS timer function get_timer return time in CFG_HZ ticks, where CFG_HZ is set to 1000 per default.
The functions get_ticks and get_tbclk still work using the actual number of COUNT register increments per second, which is equal to the cpu clock frequency for MIPS processors.
With kind regards,
Robert.

On 12/8/06, Robert Deliën robert.delien@nxp.com wrote:
Hi,
The patch attached makes the MIPS timer function get_timer return time in CFG_HZ ticks, where CFG_HZ is set to 1000 per default.
The functions get_ticks and get_tbclk still work using the actual number of COUNT register increments per second, which is equal to the cpu clock frequency for MIPS processors.
The above is not true for all MIPS. A lot (almost all) of older MIPS parts run the cpu CP0 counter at half the core clock rate.
I would suggest changing CPU_CLOCK_RATE to CPU_CP0_COUNT_RATE since they are not always the same.
participants (2)
-
Andrew Dyer
-
Robert Deliën