summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac
diff options
context:
space:
mode:
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r--sys/powerpc/powermac/platform_powermac.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/powerpc/powermac/platform_powermac.c b/sys/powerpc/powermac/platform_powermac.c
index e21a48c..1954ae9 100644
--- a/sys/powerpc/powermac/platform_powermac.c
+++ b/sys/powerpc/powermac/platform_powermac.c
@@ -56,6 +56,7 @@ extern void *ap_pcpu;
#endif
static int powermac_probe(platform_t);
+static int powermac_attach(platform_t);
void powermac_mem_regions(platform_t, struct mem_region **phys, int *physsz,
struct mem_region **avail, int *availsz);
static u_long powermac_timebase_freq(platform_t, struct cpuref *cpuref);
@@ -67,6 +68,7 @@ static void powermac_reset(platform_t);
static platform_method_t powermac_methods[] = {
PLATFORMMETHOD(platform_probe, powermac_probe),
+ PLATFORMMETHOD(platform_attach, powermac_attach),
PLATFORMMETHOD(platform_mem_regions, powermac_mem_regions),
PLATFORMMETHOD(platform_timebase_freq, powermac_timebase_freq),
@@ -118,6 +120,35 @@ powermac_mem_regions(platform_t plat, struct mem_region **phys, int *physsz,
ofw_mem_regions(phys,physsz,avail,availsz);
}
+static int
+powermac_attach(platform_t plat)
+{
+ phandle_t rootnode;
+ char model[32];
+
+
+ /*
+ * Quiesce Open Firmware on PowerMac11,2 and 12,1. It is
+ * necessary there to shut down a background thread doing fan
+ * management, and is harmful on other machines (it will make OF
+ * shut off power to various system components it had turned on).
+ *
+ * Note: we don't need to worry about which OF module we are
+ * using since this is called only from very early boot, within
+ * OF's boot context.
+ */
+
+ rootnode = OF_finddevice("/");
+ if (OF_getprop(rootnode, "model", model, sizeof(model)) > 0) {
+ if (strcmp(model, "PowerMac11,2") == 0 ||
+ strcmp(model, "PowerMac12,1") == 0) {
+ ofw_quiesce();
+ }
+ }
+
+ return (0);
+}
+
static u_long
powermac_timebase_freq(platform_t plat, struct cpuref *cpuref)
{
OpenPOWER on IntegriCloud