summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-11-10 20:09:05 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-11-10 20:09:05 +0000
commita02271c20b5b3080a0d8e5cbf989f455ba15d9f6 (patch)
tree2e3c5cf0d13707dfbc3203516da0bb27b8707fb5 /sys/powerpc/powermac
parentd6fa755921a93be58009125a64cd5eae55bb364b (diff)
downloadFreeBSD-src-a02271c20b5b3080a0d8e5cbf989f455ba15d9f6.zip
FreeBSD-src-a02271c20b5b3080a0d8e5cbf989f455ba15d9f6.tar.gz
Disabling CPU NAP modes during SMU commands is a hack needed only on U3
systems. Don't use it on non-U3 systems to allow cpu_idle() to work correctly.
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r--sys/powerpc/powermac/smu.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/powerpc/powermac/smu.c b/sys/powerpc/powermac/smu.c
index 2894904..31fb09f 100644
--- a/sys/powerpc/powermac/smu.c
+++ b/sys/powerpc/powermac/smu.c
@@ -96,6 +96,7 @@ struct smu_softc {
struct resource *sc_memr;
int sc_memrid;
+ int sc_u3;
bus_dma_tag_t sc_dmatag;
bus_space_tag_t sc_bt;
@@ -275,6 +276,10 @@ smu_attach(device_t dev)
sc->sc_cur_cmd = NULL;
sc->sc_doorbellirqid = -1;
+ sc->sc_u3 = 0;
+ if (OF_finddevice("/u3") != -1)
+ sc->sc_u3 = 1;
+
/*
* Map the mailbox area. This should be determined from firmware,
* but I have not found a simple way to do that.
@@ -417,7 +422,9 @@ smu_send_cmd(device_t dev, struct smu_cmd *cmd)
mtx_assert(&sc->sc_mtx, MA_OWNED);
- powerpc_pow_enabled = 0; /* SMU cannot work if we go to NAP */
+ if (sc->sc_u3)
+ powerpc_pow_enabled = 0; /* SMU cannot work if we go to NAP */
+
sc->sc_cur_cmd = cmd;
/* Copy the command to the mailbox */
@@ -464,7 +471,8 @@ smu_doorbell_intr(void *xdev)
sizeof(sc->sc_cmd->data));
wakeup(sc->sc_cur_cmd);
sc->sc_cur_cmd = NULL;
- powerpc_pow_enabled = 1;
+ if (sc->sc_u3)
+ powerpc_pow_enabled = 1;
done:
/* Queue next command if one is pending */
OpenPOWER on IntegriCloud