From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Kaehlcke Date: Thu, 25 Feb 2010 20:47:46 +0100 Subject: [U-Boot] [PATCH 2/2 rev2] ep93xx: Refactoring of timer code In-Reply-To: <20100225192259.GA31347@morgana.gnudd.com> References: <20100225181528.GA3628@darwin> <7ee75976e78e2f82b4163fe1ff4233a850d4393c.1266966938.git.matthias@kaehlcke.net> <20100223232209.GR20201@darwin> <4B869D53.1040207@windriver.com> <20100225192259.GA31347@morgana.gnudd.com> Message-ID: <20100225194746.GC3628@darwin> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, El Thu, Feb 25, 2010 at 08:22:59PM +0100 Alessandro Rubini ha dit: > > i was/am working on a new version of the patch, taking into account > > your remarks about the unit of TIMER_FREQ and fixing some issues > > discussed with Alessandro Rubini off-list, who worked on a similar > > patch. > > Actually, I checked the point we disagreed about, which is the unit of > get_ticks() and get_tbclk(). You currently return hw-ticks in > get_ticks, and CONFIG_SYS_HZ (i.e. 1000) in get_tbclk. However, these > two functions are expected to be used together, so they must be > consistent in their return value. actually there is no disagreement between us, i totally agree with you that the return value of get_ticks() should be in CONFIG_SYS_HZ resolution and consistent with get_tbclk(). the patch i sent you yesterday off-list fixes exactly this. > It's true that the functions are little used (they are mostly used in > ppc code, within cpu/*/interrupts), and that's why I didn't even > provide them in cpu/arm926ejs/nomadik/timer.c. All few users assume > they are consistent, but there is no documentation: > > tornado% grep -qr get_tbclk README* doc || echo not found > not found > tornado% grep -qr get_ticks README* doc/* || echo not found > not found > > I've made a quick tour of all definitions in cpu/ and here is the result. > As you see, at91 (which you used as reference, I understand) is wrong, > while all the others use either hwticks or SYS_HZ consistently. yes, i used precisely at91 as reference, i liked it's code structure and didn't notice that it is wrong in this point. thanks for your research! -- Matthias Kaehlcke Embedded Linux Developer Barcelona We build too many walls and not enough bridges (Isaac Newton) .''`. using free software / Debian GNU/Linux | http://debian.org : :' : `. `'` gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-