rpi3 clock drift

Peter Jeremy peter at rulingia.com
Fri Nov 29 22:03:29 UTC 2019


On 2019-Nov-29 20:37:36 +0000, James Shuriff <james at 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 = "arm,armv7-timer";
                interrupt-parent = <0x3>;
                interrupts = <0x0 0x1 0x3 0x2>;
                always-on;
        };
There's no clock-frequency clause there and no (obvious) link to:
        clocks {
                compatible = "simple-bus";
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                clock at 3 {
                        compatible = "fixed-clock";
                        reg = <0x3>;
                        #clock-cells = <0x0>;
                        clock-output-names = "osc";
                        clock-frequency = <0x124f800>;
                        phandle = <0x4>;
                };
...
        };

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 kernel?

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20191130/862f633f/attachment.sig>


More information about the freebsd-arm mailing list