summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorGordon Willem Klok <gwk@cvs.openbsd.org>2007-04-03 14:48:54 +0000
committerGordon Willem Klok <gwk@cvs.openbsd.org>2007-04-03 14:48:54 +0000
commitd1387b393a35c23e692e945817d534ab11c9fda3 (patch)
tree5c2f3ae7ed24bd5d329da3b3515ed0472b0a1970 /sys/arch
parent7ce45cdf3e52dadddfd2c2642e5d38996f3e6c1f (diff)
A fix for smp old world macs such as the 9500MP and 9600MP which lack the
/cpus openfirmware node of the new world macs, and only have one cpu node. We look at a register of the memory controller called hammerhead for the arbitration bit being set indicating a two way machine. Quad processor old worlds made by e.g. Daystar Digital would require a different heurisitic. This heuristic comes from linux/netbsd. ok kettenis@ and drahn@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/macppc/macppc/mainbus.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/sys/arch/macppc/macppc/mainbus.c b/sys/arch/macppc/macppc/mainbus.c
index fcf075dd263..0193690aaec 100644
--- a/sys/arch/macppc/macppc/mainbus.c
+++ b/sys/arch/macppc/macppc/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.18 2007/03/31 08:31:02 kettenis Exp $ */
+/* $OpenBSD: mainbus.c,v 1.19 2007/04/03 14:48:53 gwk Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -56,6 +56,8 @@ struct cfdriver mainbus_cd = {
/* hw.product sysctl see sys/kern/kern_sysctl.c */
extern char *hw_prod, *hw_ver, *hw_vendor;
+#define HH_REG_CONF 0x90
+
void mb_intr_establish(struct confargs *, int (*)(void *), void *);
void mb_intr_disestablish(struct confargs *);
caddr_t mb_cvtaddr(struct confargs *);
@@ -145,6 +147,31 @@ mbattach(struct device *parent, struct device *self, void *aux)
config_found(self, &nca, mbprint);
}
+ /*
+ * Special hack for SMP old world macs which lack /cpus and only have
+ * one cpu node.
+ */
+ node = OF_finddevice("/hammerhead");
+ if (node != -1) {
+ len = OF_getprop(node, "reg", reg, sizeof(reg));
+ if (len >= 2) {
+ u_char *hh_base;
+ int twoway = 0;
+
+ if ((hh_base = mapiodev(reg[0], reg[1])) != NULL) {
+ twoway = in32rb(hh_base + HH_REG_CONF) & 0x02;
+ unmapiodev(hh_base, reg[1]);
+ }
+ if (twoway) {
+ nca.ca_name = "cpu";
+ nca.ca_bus = &sc->sc_bus;
+ nca.ca_reg = reg;
+ reg[0] = 1;
+ config_found(self, &nca, mbprint);
+ }
+ }
+ }
+
for (node = OF_child(OF_peer(0)); node; node=OF_peer(node)) {
bzero (name, sizeof(name));
if (OF_getprop(node, "device_type", name,