[U-Boot-Users] [PATCH 04/10 v2] [ARM] TQMA31: add new board with i.MX31 processor

Jens Gehrlein sew_s at tqs.de
Tue Jul 8 17:14:35 CEST 2008


Wolfgang Denk schrieb:
> In message <20080708093022.9272.4677.stgit at tq-sewsrv-4.tq-net.de> you wrote:
>> +/* Timer tick */
>> +#define CFG_HZ				32768
> 
> CFG_HZ is a constant and has to be 1000.

I know, we had a discussion earlier about that issue (see "i.MX31: 
question about CFG_HZ and CKIL" of 7th May). The situation is as follows:

The TQMA31, as well as the mx32ads use the General Purpose Timer 1, 
which is feeded by a 32768 clock (possibly imx31_litekit and 
imx31_phycore with 32000 Hz? I don't know.). The prescale divider can 
only be an integer. 32768/1000 = non-integer.

The counter is just read. There are no real interrupts (I mention it, 
because you wrote about this earlier).
The origin source code is from U-Boot V2, I suppose. Guennadi used it 
for the mx31ads.

Currently, I see only one way to solve this:
1. Patch the common file cpu/arm1136/mx31/interrupts.c, function 
interrupt_init(), so that the prescaler divides by 33.
Alternatively, also make the divider a board specific define.
2. Patch all mx31 board config header files with CFG_HZ 1000.
3. All mx31 boards have to be tested.

The following is impossible:
- changing the HW
- using an internal clock, because maximum is 1000 Hz * 4096 = 4096000 
Hz (the maximum divider is 4096). All internal clocks are much higher.
Please for correction if I'm wrong.

What do you suggest to do and who does it?

And while we are at the timers:
The udelay function is the next problem:
udelay cannot go below 1/(32768 Hz) = 30.5 micros
The current function inserts a theoretical nop if the requested usec 
value is below 1000. Therefore, IMHO, this timer is relatively 
imprecise, because the resulting delay is below 1 microsecond.
IMHO, this all because of that slow input clock.

Kind regards,
Jens




More information about the U-Boot mailing list