summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/sbus.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-07-10 19:32:26 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-07-10 19:32:26 +0000
commit9a9eb00f7b2ba1a461a4f0e474e2d8431e727018 (patch)
tree9aced9ad7d9f9287739626262ea6f8bb85e23935 /sys/arch/sparc/dev/sbus.c
parentab98f8b4b2be806732331cc202bf10bf268cac9f (diff)
sun4e (i.e. SPARCengine 1e) support. This platform is a mix between sun4 and
sun4c, as it has a sun4c OpenPROM but a sun4 8KB pagesize. VME devices are not supported yet. ok deraadt@
Diffstat (limited to 'sys/arch/sparc/dev/sbus.c')
-rw-r--r--sys/arch/sparc/dev/sbus.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/arch/sparc/dev/sbus.c b/sys/arch/sparc/dev/sbus.c
index 0357403db49..d177c8f45b7 100644
--- a/sys/arch/sparc/dev/sbus.c
+++ b/sys/arch/sparc/dev/sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbus.c,v 1.16 2007/05/29 09:54:13 sobrado Exp $ */
+/* $OpenBSD: sbus.c,v 1.17 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: sbus.c,v 1.17 1997/06/01 22:10:39 pk Exp $ */
/*
@@ -159,7 +159,10 @@ sbus_attach(parent, self, aux)
* IS THIS THE CORRECT DEFAULT??
*/
node = ra->ra_node;
- sc->sc_clockfreq = getpropint(node, "clock-frequency", 25*1000*1000);
+ sc->sc_clockfreq = getpropint(node, "clock-frequency", -1);
+ if (sc->sc_clockfreq <= 0)
+ sc->sc_clockfreq = getpropint(findroot(), "clock-frequency",
+ 25 * 1000 * 1000);
printf(": clock = %s MHz\n", clockfreq(sc->sc_clockfreq));
/*
@@ -199,6 +202,10 @@ sbus_attach(parent, self, aux)
*/
for (node = firstchild(node); node; node = nextsibling(node)) {
name = getpropstring(node, "name");
+#ifdef SUN4E
+ if (CPU_ISSUN4E && strcmp(name, "vm") == 0)
+ continue;
+#endif
if (!romprop(&oca.ca_ra, name, node))
continue;
@@ -224,7 +231,7 @@ sbus_translate(dev, ca)
ca->ca_slot = SBUS_ABS_TO_SLOT(base);
ca->ca_offset = SBUS_ABS_TO_OFFSET(base);
} else {
- if (!CPU_ISSUN4C)
+ if (!CPU_ISSUN4C && !CPU_ISSUN4E)
panic("relative sbus addressing not supported");
ca->ca_slot = slot = ca->ca_ra.ra_iospace;
ca->ca_offset = base;