Page MenuHomeFreeBSD

powerpc/mpc85xx: Synchronize timebase the platform correct way

Authored by jhibbits on Feb 16 2019, 4:55 AM.



To safely synchronize timebase we need to disable the timebase on all
cores, set timebase, and resynchronize. This adds two new devices, mutually
exclusive, which attach on the SoC simplebus, to freeze and unfreeze the
timebase. The devices are singletons, and platform-specific, so I saw no reason
to make them optional and in separate files.

This was found to be necessary for top(1) to work correctly on an AmigaOne
X5000 (P5020 SoC).

Test Plan

Regression test on various Book-E hardware.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Should we panic if freeze_timebase somehow doesn't get set? Or, alternately, fall back on the old lame thing?

I have two alternative paths to go: if (freeze... != NULL), or have a default empty freeze function. Doesn't matter to me which way we go with, but, yes, we need a fallback to do it the lame way.

Add a dummy freezer, to keep the code path easier to follow.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 27 2019, 3:31 AM
This revision was automatically updated to reflect the committed changes.