MIPS time.c fix
PATCH 1/1 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips_timer.diff
Type: application/octet-stream
Size: 6180 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20061208/16caceac/attachment.obj
PATCH 1/1 MIPS time.c fix
Quoted 8 lines · Robert Deli?n
Hi,
The patch attached makes the MIPS timer function
get_timerreturn time inCFG_HZticks, whereCFG_HZis set to 1000 per default.The functions
get_ticksandget_tbclkstill 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.
Signature · 2 lines
Hardware, n.:
The parts of a computer system that can be kicked.