From owner-freebsd-arm@freebsd.org Fri Nov 29 22:03:29 2019 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98E021BD97B for ; Fri, 29 Nov 2019 22:03:29 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PpRh42VSz4MF4; Fri, 29 Nov 2019 22:03:28 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id xATM3Gfk026311 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 30 Nov 2019 09:03:22 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id xATM3Bil085565 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 30 Nov 2019 09:03:11 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id xATM3BEI085564; Sat, 30 Nov 2019 09:03:11 +1100 (AEDT) (envelope-from peter) Date: Sat, 30 Nov 2019 09:03:11 +1100 From: Peter Jeremy To: James Shuriff Cc: Ian Lepore , "freebsd-arm@freebsd.org" Subject: Re: rpi3 clock drift Message-ID: <20191129220311.GD37113@server.rulingia.com> References: <20191129052800.GA37113@server.rulingia.com> <65be6d3628a8d35084f7c98266582090f59b18be.camel@freebsd.org> <731a9e57ba62d5a6ede74fdde3fd82543484813b.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 47PpRh42VSz4MF4 X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of peter@rulingia.com designates 2001:19f0:5801:ebe:5400:1ff:fe53:30fd as permitted sender) smtp.mailfrom=peter@rulingia.com X-Spamd-Result: default: False [-7.65 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[rulingia.com]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.0.0.3]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-3.25)[ip: (-9.59), ipnet: 2001:19f0:5800::/38(-4.81), asn: 20473(-1.78), country: US(-0.05)]; SH_EMAIL_ZRD(0.00)[0.0.0.3] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2019 22:03:29 -0000 --pAwQNkOnpTn9IO2O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Nov-29 20:37:36 +0000, James Shuriff wrote: >I dumped the FDT from the system I built from source and I cannot >find any reference to 0x337F980 (54 MHz). I looked at the FreeBSD >source file generic_timer.c and it looks like it's grabbing the >frequency from FDT but I cannot figure out where it's getting the 54 >MHz from. clk_osc in the FDT is still showing 0x124f800 (19.2 MHz) on >the system with the bad clock. I've been rummaging around on my (early) RPi2. The timer code seems to be the same, even if the SoC is different (I have armv7, RPi3 is armv8). In my FDT, I have: timer { compatible =3D "arm,armv7-timer"; interrupt-parent =3D <0x3>; interrupts =3D <0x0 0x1 0x3 0x2>; always-on; }; There's no clock-frequency clause there and no (obvious) link to: clocks { compatible =3D "simple-bus"; #address-cells =3D <0x1>; #size-cells =3D <0x0>; clock@3 { compatible =3D "fixed-clock"; reg =3D <0x3>; #clock-cells =3D <0x0>; clock-output-names =3D "osc"; clock-frequency =3D <0x124f800>; phandle =3D <0x4>; }; =2E.. }; The relevant dmesg should look like: generic_timer0: irq 0,1,2,3 on ofwbus0 Timecounter "ARM MPCore Timecounter" frequency 19200000 Hz quality 1000 Event timer "ARM MPCore Eventtimer" frequency 19200000 Hz quality 1000 At least on my RPi2, I have: Using DTB provided by EFI at 0x7ff8000. and FreeBSD/arm EFI loader, Revision 1.1 Command line arguments: l EFI version: 2.70 EFI Firmware: Das U-Boot (rev 8216.2304) Console: efi (0) Load Path: /\efi\boot\bootarm.efi Are you building a 32-bit or 64-bit FreeBSD? Where are you getting your boot code from? Have you tried using the boot code from the FreeBSD RPi3 image with your ke= rnel? --=20 Peter Jeremy --pAwQNkOnpTn9IO2O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl3hlZJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzQyrw//QeOIk3+jAFl2T4RntG4b1j9IH/0TiCJ2fEWBDmfihS51B222jIeMTN6x /y+RIUEhzScRmiILf0bHqq0iIJAuHwXPgbPmCAGXea2w0KKm2xK5p7CQMdxRGSj3 yHvueFwzYoSSBYC1E+7NaWB6MkqcsBWCr1dyo49ME5zfHjbRE7XqG7UzHXt+kCeW P11AsM2UTDDiYCDNIX9+vodrWMnHE2ZxQ0QQbCZoz/Kb1FcDb2kPneENMzGL+X+R W/DwG1b3QE04YWaDdHRjOr8PxIUeQ9Kr6hLwLF//TJN+tWlH/CEhCfO/9FXiFt4X /GXLPYy2G2G3eVYAg6DSBqUcg1y+ayTL7BcL0DvBX/xKcV1IQnm9evQENoIS1cQF pBXRRXL9ut78R59vCIxLOOfblpUx1YvrXZ4l6UcdvFdGCic+f3dBDmkhxj2czjDU GtdQcXEwg3q9ibBGFGClUw5Km3j5RLVtzHqFpT2ZAnfDoT7u9xTHgTkqvZRLOLpU 0ZWcyknNFyzebh7pKx4vONY61DTAn6fzF9NMWOszh48NR7fmJxjTwKPOSLx3Tp4l HaBt8pz8UkZSUUZkeH0Io3Ke2CcDlOzSehfReedpdSXmJk9TKZgImLAThZcGfNek XKAhHvY2AqxqfwNK1YfOzS8+Ay2BCBvGES1jC8tDrWzPUkaxDoQ= =QBt1 -----END PGP SIGNATURE----- --pAwQNkOnpTn9IO2O--