From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Gehrlein Date: Wed, 14 May 2008 08:36:37 +0200 Subject: [U-Boot-Users] i.MX31: question about CFG_HZ and CKIL In-Reply-To: <20080509221328.CAEB4247F5@gemini.denx.de> References: <20080509221328.CAEB4247F5@gemini.denx.de> Message-ID: <482A8875.1090802@tqs.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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