From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VuYDo-0005MD-68 for mharc-grub-devel@gnu.org; Sat, 21 Dec 2013 20:52:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuYDi-0005Lp-I4 for grub-devel@gnu.org; Sat, 21 Dec 2013 20:52:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VuYDa-00061C-HO for grub-devel@gnu.org; Sat, 21 Dec 2013 20:52:42 -0500 Received: from mail-ea0-x233.google.com ([2a00:1450:4013:c01::233]:45706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuYDa-000612-9V for grub-devel@gnu.org; Sat, 21 Dec 2013 20:52:34 -0500 Received: by mail-ea0-f179.google.com with SMTP id r15so1722291ead.24 for ; Sat, 21 Dec 2013 17:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=5kPJtzrG0ykhciBWaxKM5J+5mB/zuElEtq/ZSiQ+cUk=; b=vDFJTodzhbLvfKVDK5tpMMPNdKah6I32g5gbx8OonCvmQqAO5/4PkFuL4cStFFFbt+ UUIvDBdi0DOqv1uSsCPOxxDOBhULzQycQt+pdUCqVImBS50g8jZweaE6ZdUiUPyAu85E RSmnD2l0/STF4WZ2N/Hhfd05a6Eag15sw0qpkC93K+HmXgfsRbmuYuDhk3PAy+sjqXXH WH86vCqH3fiYr1iVHFai39h/lK4Vgm8f54nTKcmOp19mrxNltb031XpZBLcTCZMFbdFz jGFaiZxIFoqm3CVFXC6magfRRaZCFPNXRVoOi+8SjQz6I7cCMQz7D75+ParaecPN60L+ ZZwQ== X-Received: by 10.14.212.69 with SMTP id x45mr5072617eeo.69.1387677153222; Sat, 21 Dec 2013 17:52:33 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id g47sm32269324eeo.19.2013.12.21.17.52.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Dec 2013 17:52:31 -0800 (PST) Message-ID: <52B645DE.6090106@gmail.com> Date: Sun, 22 Dec 2013 02:52:30 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Ian Campbell Subject: Re: [PATCH] * grub-core/kern/uboot/init.c (uboot_timer_ms) correct units References: <1387121014-19415-1-git-send-email-ijc@hellion.org.uk> <52B614E6.1090100@gmail.com> <1387675298.17491.14.camel@dagon.hellion.org.uk> <1387675775.17491.16.camel@dagon.hellion.org.uk> In-Reply-To: <1387675775.17491.16.camel@dagon.hellion.org.uk> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9jh4xpAOexFexf9NVDWTFufeEENJTT0N4" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::233 Cc: grub-devel@gnu.org, Leif Lindholm X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2013 01:52:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9jh4xpAOexFexf9NVDWTFufeEENJTT0N4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 22.12.2013 02:29, Ian Campbell wrote: > On Sun, 2013-12-22 at 01:21 +0000, Ian Campbell wrote: >> On Sat, 2013-12-21 at 23:23 +0100, Vladimir '=CF=86-coder/phcoder' Ser= binenko >> wrote: >>> On 15.12.2013 16:23, Ian Campbell wrote: >>>> From: Ian Campbell >>>> >>>> u-boot's API_GET_TIMER returns the current time in ms by directly ex= posing the >>>> internal get_timer which is in ms, which isn't all that clearly docu= mented but >>>> is obvious from the use within u-boot and is mentioned in >>>> http://www.denx.de/wiki/U-Boot/TaskTimerAPI. >>>> >>> During tests on my raspberry pi, I actually experienced the exact >>> opposite. On PI timer API is in microseconds. >>> Are you sure you made no mistake? >> >> I'm quite sure that on the Midway platform get_timer was returning ms >> and the 5s grub countdown took 5s after my fix and some interminably >> long time before it. >> >> Sadly actual documentation of the u-boot API is a bit thin on the >> ground, but get_timer=3D=3Dms is also corroborated by some ad-hoc goog= ling I >> did (e.g. resulting in the above link) as well as inspection of some >> random u-boot ports. Some ports have an explicit get_timer_us function= , >> which adds credence to the idea that get_timer is in ms instead. >=20 > See also this patch to u-boot upstream: >=20 Ok, I've kept current code as generic and added own timer implementation for raspberry pie > commit 5eaa215607c8668bfa6a7183407eba8fec63d648 > Author: Stephen Warren > Date: Wed Mar 27 18:43:23 2013 +0000 >=20 > ARM: bcm2835: fix get_timer() to return ms > =20 > Apparently, CONFIG_SYS_HZ must be 1000. Change this, and fix the ti= mer > driver to conform to this. > =20 > Have the timer implementation export a custom API get_timer_us() fo= r use > by the BCM2835 MMC API, which needs us resolution for a HW workarou= nd. > =20 > Signed-off-by: Stephen Warren >=20 > and from README: >=20 > - CPU timer options: > CONFIG_SYS_HZ >=20 > The frequency of the timer returned by get_timer(). > get_timer() must operate in milliseconds and this CONFI= G > option must be set to 1000. >=20 > Ian. >=20 >=20 --9jh4xpAOexFexf9NVDWTFufeEENJTT0N4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlK2Rd4ACgkQmBXlbbo5nOv0KwD/fWCjri9vVBdnKyU8GKvkmhej 5fLoGmSIGlJxy1lE28gA/R6PcRKUNgJ2FK+6CSEUJL4KJ2ImefYNLbMUn3gbWzPa =IQHP -----END PGP SIGNATURE----- --9jh4xpAOexFexf9NVDWTFufeEENJTT0N4--