Clocks broken on Mac mini

Hugh Blemings hugh at blemings.org
Tue Jan 31 10:48:40 UTC 2017


Hi Hal,

On 31/01/2017 20:35, Hal Murray wrote:
>
> I poked around enough in Open Firmware to "fix" the clock parameters.  But it
> made things worse rather than better.  I assume some step in my thinking is
> backwards.
>

Oh ok, did it make any sort of sensible change ?  Did tweaking the clock 
parameter the "wrong" way make it better I wonder ?

>> When I get some time later today/tonight I'll summarise what we have so  far
>> into a single email and send that off to the linux-ppc crew for  comment,
>> will copy you and list of course.
>
> I think the most important thing is if they have seen this before, understand
> it, and such.  Have they tested with a Mac mini?

One of the chaps I had in mind to bring in was Paul Mackerras, he did 
the original Linuxppc port for Macs and is well across the timebase 
code, probably wrote much of it :)

Ben Herrenschmidt is the other - also a long time LinuxPPC developer and 
both have been the formal kernel Maintainer of arch/powerpc at some 
point or other, so if it's come up they've probably seen it ;)

> The next step would be a quick summary of what the hardware does and how
> clocking works, and/or pointers to the appropriate documentation.
> arch/powerpc/kernel/time.c reads clock-frequency and timebase-frequency  from
> the openfirmware stuff.  Why both of them?

If my memory serves, timebase-frequency is fixed, clock-frequency can 
scale/change depending on power modes and such, but it's been a while :)

I could have sworn that it was timebase that was used for system timing 
though.

> Does a 1.42 GHz Mac mini really run at 1.42?  Why does Open Firmware say
> 1.416666?

It is odd - I reckon this might well be the bug as it would appear that 
the actual CPU Core frequency is indeed set to 1420MHz - c.f. page 25 of 
the datasheet - http://www.atmel.com/Images/doc0833.pdf

But I suspect I/we might be getting into the weeds, entirely possible 
it's a simpler bug somewhere :)

> Does a Mac mini FM the system clock to get pass the EMI rules?

Not as far as I know - the CPU doesn't have inbuilt support for doing 
so, I guess Apple might have done something odd with the external clock 
generation, but I don't recall any such things back in the day.

I'll do up that summary of what we know so far and send that through 
tonight or in the morning, then if it looks about right can solicit some 
help from the kernel guys :)

Cheers,
Hugh

PS It's a bit bizzarre that this happens under FreeBSD as well, though 
it's entirely possible there is some shared code in there, at least at 
an "inspired by" level.


More information about the devel mailing list