Hi, On Tue, Jul 08, 2008 at 05:14:35PM +0200, Jens Gehrlein wrote: > Wolfgang Denk schrieb: >> In message <[EMAIL PROTECTED]> you wrote: >>> +/* Timer tick */ >>> +#define CFG_HZ 32768 >> >> CFG_HZ is a constant and has to be 1000.
Why is it a board specific define then? > > 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. Not quite correct, I wrote the original mx31 code for U-Boot V1 and then ported it to V2. I think Guennadis work is based on the V1 work. > > 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. You could add a software divider in get_timer(). But I think it's better to define CFG_HZ to whatever the timer frequency is. At least 49 boards do it. Regards Sascha -- Pengutronix e.K. - Linux Solutions for Science and Industry ----------------------------------------------------------- Kontakt-Informationen finden Sie im Header dieser Mail oder auf der Webseite -> http://www.pengutronix.de/impressum/ <- ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users