public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] PXA270 support
@ 2005-03-14 22:16 Woodruff, Richard
  2005-03-14 22:55 ` Wolfgang Denk
  0 siblings, 1 reply; 14+ messages in thread
From: Woodruff, Richard @ 2005-03-14 22:16 UTC (permalink / raw)
  To: u-boot

Wolfgang,

> Note: this is BROKEN.
> 
> CFG_HZ should be 1000 on all boards. it has NOTHING to  do  with  any
> clock  frequencies of your baord or processor (yes, I know that quite
> a lot of boards are broken this way).

Why is this?  The common use seems to be many flash drivers may get a
time source directly and need to normalize the number of ticks to a
second's value.  I know I set up my timer with the CFG_HZ value in mind
to gauge udelays.

void udelay (unsigned long usec)
{
  ulong tmo, tmp;

  if (usec >= 1000) {/* if "big" number, spread	normalization to seconds
*/
    tmo = usec / 1000;/* start to normalize for usec to ticks per sec */
    tmo *= CFG_HZ;/* find number of "ticks" to wait to achieve target */
    tmo /= 1000;/* finish normalize. */
  } else {/* else small number, don't kill it prior to HZ multiply */
    tmo = usec * CFG_HZ;
    tmo /= (1000*1000);
  }
  ...

How is 1000 correct?  That doesn't seem to follow.

Regards,
Richard W.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [U-Boot-Users] PXA270 support
@ 2005-03-17 22:14 Woodruff, Richard
  0 siblings, 0 replies; 14+ messages in thread
From: Woodruff, Richard @ 2005-03-17 22:14 UTC (permalink / raw)
  To: u-boot

That was Wolfgang's assertion.

A quick grep of the code seems to indicate that as long as CFG_HZ
represents the number of ticks in a second usage is ok.

HOWEVER, there is a strong chance of overflow depending on the value in
use.  Thus 1000 is probably a very save value.

I know for ARM ports I've worked on so far I have always applied almost
the max presaler as I did encounter overflow when validating timing
operations.  At that time I just assumed people need to be careful about
assigning CFG_HZ to as small a value as possible, Wolfgang appears to be
taking even a stronger stance.

Regards,
Richard W.

> -----Original Message-----
> From: u-boot-users-admin at lists.sourceforge.net [mailto:u-boot-users-
> admin at lists.sourceforge.net] On Behalf Of Detlef Vollmann
> Sent: Monday, March 14, 2005 6:03 PM
> To: Wolfgang Denk
> Cc: Woodruff, Richard; u-boot-users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] PXA270 support
> 
> Wolfgang Denk wrote:
> > CFG_HZ is the number of "clock ticks" per second; it has exactly
the
> > same meaning as the HZ variable in the Linux kernel.
> >
> > Like in current Linux kernels, U-Boot  normally  uses  a  1
millisec
> > system tick, thus CFG_HZ should be 1000.
> And get_timer() should deliver that system tick?
> If so, at least all ARM based CPU ports are "broken"....
> 
> Detlef
> 
> --
> Detlef Vollmann   vollmann engineering gmbh
> Linux and C++ for Embedded Systems    http://www.vollmann.ch/
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real
users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [U-Boot-Users] PXA270 support
@ 2005-03-14 23:44 Woodruff, Richard
  2005-03-15  0:00 ` Wolfgang Denk
  0 siblings, 1 reply; 14+ messages in thread
From: Woodruff, Richard @ 2005-03-14 23:44 UTC (permalink / raw)
  To: u-boot

> Mind the term "ticks" here. This is the "system tick", but not any of
> the clocks applied to any of the CPU pins.
> 
> > second's value.  I know I set up my timer with the CFG_HZ value in
mind
> > to gauge udelays.
> 
> CFG_HZ is the number of "clock ticks" per second; it has exactly  the
> same meaning as the HZ variable in the Linux kernel.
> 
> Like in current Linux kernels, U-Boot  normally  uses  a  1  millisec
> system tick, thus CFG_HZ should be 1000.

Ok.  The kernel's HZ value is variable on many architectures, so by the
same token I would say u-boots could be also.  It should never be
assumed that CFG_HZ is 1000.  Perhaps by convention it's a good rate for
the few PPC systems which actually use the clock interrupt to do
something.

For ARM, it turns out to be convenient to assign the tick generator to
be CFG_HZ value.  This saves on a little math.

I can see where it might be better to assign it to match the rate your
target kernel would use, but it is probably not necessary as the kernel
should re-init it anyway.

Regards,
Richard W.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [U-Boot-Users] PXA270 support
@ 2005-03-11 12:39 Detlef Vollmann
  2005-03-11 16:12 ` Robert Whaley
  0 siblings, 1 reply; 14+ messages in thread
From: Detlef Vollmann @ 2005-03-11 12:39 UTC (permalink / raw)
  To: u-boot

Hello,

has anybody tried to port u-boot to a PXA270 based board?
I just started with lifting the startup code from Intel's blob
into u-boot, and with a little work made it compile and link.
But (of course) it is not that easy: it doesn't work :-(

Before I now start the long debugging sessions I just thought
I'd try the list.  Maybe somebody has something working for
a PXA27x.

Any hints welcome
Detlef

-- 
Detlef Vollmann   vollmann engineering gmbh
Linux and C++ for Embedded Systems    http://www.vollmann.ch/

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

end of thread, other threads:[~2005-03-30  9:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-14 22:16 [U-Boot-Users] PXA270 support Woodruff, Richard
2005-03-14 22:55 ` Wolfgang Denk
2005-03-15  0:03   ` Detlef Vollmann
2005-03-15  0:29     ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2005-03-17 22:14 Woodruff, Richard
2005-03-14 23:44 Woodruff, Richard
2005-03-15  0:00 ` Wolfgang Denk
2005-03-11 12:39 Detlef Vollmann
2005-03-11 16:12 ` Robert Whaley
2005-03-14 20:23   ` Detlef Vollmann
2005-03-14 20:36     ` Robert Whaley
2005-03-30  9:12       ` Detlef Vollmann
2005-03-30  9:46         ` Wolfgang Denk
2005-03-14 22:03     ` Wolfgang Denk

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