Page MenuHomeFreeBSD

powerpc/powermac: Constrain 'cpu_sleep()' for AIM to mpc745x
Needs ReviewPublic

Authored by jhibbits on Feb 25 2020, 1:58 AM.

Details

Reviewers
None
Group Reviewers
PowerPC
Summary

Rename cpu_sleep() to mpc745x_sleep() to denote what it's actually
intended for. This function is very G4-specific, and will not work on any other
CPU. This will afterward eliminate a platform_smp_timebase_sync() call, by
directly updating the timebase instead.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 29587
Build 27448: arc lint + arc unit

Event Timeline

bdragon added inline comments.
sys/powerpc/powermac/platform_powermac.c
420

Won't this cause console spam on G3?

424

Would be a great time to document this line... I was thinking this was debug code, but as you said in irc, what it's doing is setting the ofw wakeup entry point.

sys/powerpc/powermac/platform_powermac.c
420

Currently this is only called from pmu_set_speed(), which is, to the best of my knowledge, only supported on G4 TiBooks, so there will be no spamming here.

424

Great idea. I'll add a comment.

markmi_dsl-only.net added inline comments.
sys/powerpc/powermac/platform_powermac.c
420

DEVMETHOD(cpufreq_drv_set, pmufreq_set)

and:

static int
pmufreq_set(device_t dev, const struct cf_setting *set)
{
. . .

error = pmu_set_speed(speed_sel);

. . .
}

Is this sort of code reached by, say, powerd? powerpd is running on the G5 Quad I have access to.

sys/powerpc/powermac/platform_powermac.c
420

pmufreq only attaches to g4 machines that use the PMU for frequency control. Your g5 is unaffected.