public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL
@ 2008-05-07  8:59 Jens Gehrlein
  2008-05-08  7:53 ` Guennadi Liakhovetski
  2008-05-09 22:13 ` Wolfgang Denk
  0 siblings, 2 replies; 5+ messages in thread
From: Jens Gehrlein @ 2008-05-07  8:59 UTC (permalink / raw)
  To: u-boot

Hi all,

in the i.MX31 processor reference manual they mention a 32 kHz clock as 
input for several timers and controllers. Sometimes it's called 
ipg_clk_32k. But the documentation does not clearly state, that this 
clock actually is the CKIL.

As far as I could derive from the ADS schematics the CKIL is feeded with 
32768 Hz instead of 32000 Hz. On our board we use 32768 Hz either.

If CKIL is the above mentioned 32 kHz clock, the resulting deviation in 
the timers is "only" about 2.4% as long as CFG_HZ in mx31ads.h is 32000 
Hz. Although it works with the current definition, I'd like to know your 
opinions, whether it is necessary to adjust this value.

Thank you for comments.

Best Regards,
Jens

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

* [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL
  2008-05-07  8:59 [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL Jens Gehrlein
@ 2008-05-08  7:53 ` Guennadi Liakhovetski
  2008-05-09 22:13 ` Wolfgang Denk
  1 sibling, 0 replies; 5+ messages in thread
From: Guennadi Liakhovetski @ 2008-05-08  7:53 UTC (permalink / raw)
  To: u-boot

On Wed, 7 May 2008, Jens Gehrlein wrote:

> in the i.MX31 processor reference manual they mention a 32 kHz clock as 
> input for several timers and controllers. Sometimes it's called 
> ipg_clk_32k. But the documentation does not clearly state, that this 
> clock actually is the CKIL.
> 
> As far as I could derive from the ADS schematics the CKIL is feeded with 
> 32768 Hz instead of 32000 Hz. On our board we use 32768 Hz either.

MCIMX31RM Rev 2.3, section 3.4.4.1.1:

<quote>
The i.MX31 and i.MX31L processors can use either a 32 kHz, 32.768 kHz or a 
38.4 kHz crystal as the external low frequency source. Throughout this 
chapter, the low frequency crystal is referred to as the 32 kHz crystal, 
even though this can refer to the 32.768 or 38.4 kHz values.
</quote>

So, so far it is allowed to use a 32768 crystal.

> If CKIL is the above mentioned 32 kHz clock, the resulting deviation in 
> the timers is "only" about 2.4% as long as CFG_HZ in mx31ads.h is 32000 
> Hz. Although it works with the current definition, I'd like to know your 
> opinions, whether it is necessary to adjust this value.

Further, it depends on the CLKSS signal, which on i.MX31ADS is connected 
to JP22, whether CKIL is used as the reference clock. Unless you override 
this choise later in software.

In any case, I think, you are right. I'll submit a patch for mx31ads 
shortly, then you'll see what you could change for your platform too.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL
  2008-05-07  8:59 [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL Jens Gehrlein
  2008-05-08  7:53 ` Guennadi Liakhovetski
@ 2008-05-09 22:13 ` Wolfgang Denk
  2008-05-14  6:36   ` Jens Gehrlein
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2008-05-09 22:13 UTC (permalink / raw)
  To: u-boot

In message <48216F73.4010809@tqs.de> you wrote:
> 
> If CKIL is the above mentioned 32 kHz clock, the resulting deviation in 
> the timers is "only" about 2.4% as long as CFG_HZ in mx31ads.h is 32000 
> Hz. Although it works with the current definition, I'd like to know your 
> opinions, whether it is necessary to adjust this value.

Note that CFG_HZ is not really configurable, even if the name suggests
so. In reality, CFG_HZ is a constant with the value 1000.

There are some broken boards which don't handle this  correctly,  but
at least that's what you should set.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The goal of science is to build better mousetraps. The goal of nature
is to build better mice.

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

* [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL
  2008-05-09 22:13 ` Wolfgang Denk
@ 2008-05-14  6:36   ` Jens Gehrlein
  2008-05-14 10:30     ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Gehrlein @ 2008-05-14  6:36 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang, Guennadi,

Wolfgang Denk schrieb:
> In message <48216F73.4010809@tqs.de> you wrote:
>> If CKIL is the above mentioned 32 kHz clock, the resulting deviation in 
>> the timers is "only" about 2.4% as long as CFG_HZ in mx31ads.h is 32000 
>> Hz. Although it works with the current definition, I'd like to know your 
>> opinions, whether it is necessary to adjust this value.
> 
> Note that CFG_HZ is not really configurable, even if the name suggests
> so. In reality, CFG_HZ is a constant with the value 1000.
> 
> There are some broken boards which don't handle this  correctly,  but
> at least that's what you should set.

So, as far as I understood the function get_timer() must also return a 
value that is counted up 1000 times per second. But according to 
cpu/arm1136/mx31/interrupt.c this is not the case. GPTCNT is updated 
with 32000 or 32768 Hz, and this counter register's value is currently 
returned by get_timer() (minus base, passed by the caller).

If CFG_HZ should be set to 1000 than cpu/arm1136/mx31/interrupt.c should 
be fixed, i.e. the prescaler had to be adjusted from 1 to approx. 33. Do 
you agree or did I understand this timer stuff completely wrong?

Best regards,
Jens

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

* [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL
  2008-05-14  6:36   ` Jens Gehrlein
@ 2008-05-14 10:30     ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2008-05-14 10:30 UTC (permalink / raw)
  To: u-boot

In message <482A8875.1090802@tqs.de> you wrote:
> 
> If CFG_HZ should be set to 1000 than cpu/arm1136/mx31/interrupt.c should 
> be fixed, i.e. the prescaler had to be adjusted from 1 to approx. 33. Do 
> you agree or did I understand this timer stuff completely wrong?

Yes.

It makes little sense to have 32 kHz interrupts on a system that uses
polling drivers only.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Committee, n.:  A group of men who individually can do nothing but as
a group decide that nothing can be done.                 - Fred Allen

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

end of thread, other threads:[~2008-05-14 10:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-07  8:59 [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL Jens Gehrlein
2008-05-08  7:53 ` Guennadi Liakhovetski
2008-05-09 22:13 ` Wolfgang Denk
2008-05-14  6:36   ` Jens Gehrlein
2008-05-14 10:30     ` Wolfgang Denk

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