diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-05-15 15:28:10 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-05-15 15:28:10 +0000 |
commit | d5f2f6c0be6eb025bfcb033beae8281fc6a8315b (patch) | |
tree | bc62ec7fb4e4a66a3969c4b64417f326c240a83d /sys | |
parent | 0e009d92fd0a95bae80fd6b734e8510b4edd8038 (diff) |
Repair identification of P4 bwtwo on 4/330 and 4/370 models, which got broken
in 1.36.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc/dev/bwtwo.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sys/arch/sparc/dev/bwtwo.c b/sys/arch/sparc/dev/bwtwo.c index 1a81df15709..7fbfc83e439 100644 --- a/sys/arch/sparc/dev/bwtwo.c +++ b/sys/arch/sparc/dev/bwtwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwtwo.c,v 1.35 2008/12/26 22:30:21 miod Exp $ */ +/* $OpenBSD: bwtwo.c,v 1.36 2010/05/15 15:28:09 miod Exp $ */ /* $NetBSD: bwtwo.c,v 1.33 1997/05/24 20:16:02 pk Exp $ */ /* @@ -186,15 +186,27 @@ bwtwoattach(struct device *parent, struct device *self, void *args) printf(": "); /* - * Map the control register. + * Check if this is a P4 attachment, and map the P4 control + * register if necessary. */ #if defined(SUN4) - if (CPU_ISSUN4 && ca->ca_bustype == BUS_OBIO && - fb_pfour_id(ca->ca_ra.ra_vaddr) != PFOUR_NOTPFOUR) { - SET(sc->sc_sunfb.sf_flags, FB_PFOUR); + if (CPU_ISSUN4 && ca->ca_bustype == BUS_OBIO) { sc->sc_sunfb.sf_pfour = (volatile u_int32_t *) mapiodev(ca->ca_ra.ra_reg, 0, sizeof(u_int32_t)); - } else + if (fb_pfour_id(sc->sc_sunfb.sf_pfour) != PFOUR_NOTPFOUR) + SET(sc->sc_sunfb.sf_flags, FB_PFOUR); + else { + /* XXX unmapiodev */ + sc->sc_sunfb.sf_pfour = NULL; + } + } +#endif + + /* + * Map the control register (unless done above for a P4 device). + */ +#if defined(SUN4) + if (!CPU_ISSUN4 || !ISSET(sc->sc_sunfb.sf_flags, FB_PFOUR)) #endif { sc->sc_reg = (volatile struct fbcontrol *) |