public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] MIPS time.c fix
@ 2006-12-08 14:05 Robert Deliën
  2006-12-08 15:38 ` Andrew Dyer
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Deliën @ 2006-12-08 14:05 UTC (permalink / raw)
  To: u-boot

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 

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [U-Boot-Users] [PATCH] MIPS time.c fix
@ 2006-12-11 10:03 Robert Deliën
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Deliën @ 2006-12-11 10:03 UTC (permalink / raw)
  To: u-boot

> 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.

Thanks for your feedback; I wasn't aware of this. I've encountered a couple
of /2 constructions in some configurations, but I though that was just a
quick fix that degrades the granularity of the timer by half in order to
prevent overflows in net.c.

> I would suggest changing CPU_CLOCK_RATE to CPU_CP0_COUNT_RATE since
> they are not always the same.

I have changed it to CFG_CP0_COUNT_RATE, if you don't mind. The IncaIP and
Purple platform seem to have cores with half-speed COUNT registers so those
have been fixed too. Behold the new patch ;-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips_timer2.diff
Type: application/octet-stream
Size: 6651 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20061211/8d42666e/attachment.obj 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-11 10:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-08 14:05 [U-Boot-Users] [PATCH] MIPS time.c fix Robert Deliën
2006-12-08 15:38 ` Andrew Dyer
  -- strict thread matches above, loose matches on Subject: below --
2006-12-11 10:03 Robert Deliën

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox