summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2013-09-27 13:12:47 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2013-09-27 13:12:47 +0000
commitb4b3864eb0bde04901e921f56a4c88a4884b882f (patch)
tree87940e9ff38421a0b307f5dd3cda5673012b8ada /sys/powerpc/powermac
parent40809f1aaf52ffccc4f55985e5f79ecec25ea4b9 (diff)
downloadFreeBSD-src-b4b3864eb0bde04901e921f56a4c88a4884b882f.zip
FreeBSD-src-b4b3864eb0bde04901e921f56a4c88a4884b882f.tar.gz
Rework handling of ofw_quiesce(), making it the responsibility of the
platform modules. Whether to call this function or not is highly machine dependent: on some systems, it is required, while on others it breaks everything. Platform modules are in a better position to figure this out. This is required for POWER hypervisor SCSI to work correctly. There are no functional changes on Powermac systems. Approved by: re (kib)
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