Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Nov 2019 09:03:11 +1100
From:      Peter Jeremy <peter@rulingia.com>
To:        James Shuriff <james@opentech.cc>
Cc:        Ian Lepore <ian@freebsd.org>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: rpi3 clock drift
Message-ID:  <20191129220311.GD37113@server.rulingia.com>
In-Reply-To: <MWHPR06MB3134E3913675771F14E3C4B3AA460@MWHPR06MB3134.namprd06.prod.outlook.com>
References:  <MWHPR06MB3134EC22EC3148DA800B2B7DAA440@MWHPR06MB3134.namprd06.prod.outlook.com> <alpine.BSF.2.21.99999.352.1911272214050.28592@autopsy.pc.athabascau.ca> <20191129052800.GA37113@server.rulingia.com> <alpine.BSF.2.21.99999.352.1911282333250.90234@autopsy.pc.athabascau.ca> <65be6d3628a8d35084f7c98266582090f59b18be.camel@freebsd.org> <alpine.BSF.2.21.99999.352.1911291053140.17959@autopsy.pc.athabascau.ca> <MWHPR06MB313445553D73F019FEEAF50EAA460@MWHPR06MB3134.namprd06.prod.outlook.com> <731a9e57ba62d5a6ede74fdde3fd82543484813b.camel@freebsd.org> <MWHPR06MB3134455800AD75C949D86D8FAA460@MWHPR06MB3134.namprd06.prod.outlook.com> <MWHPR06MB3134E3913675771F14E3C4B3AA460@MWHPR06MB3134.namprd06.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <james@opentech.cc> 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: <ARMv7 Generic Timer> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191129220311.GD37113>