summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-10-07 05:39:49 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-10-07 05:39:49 +0000
commit378671f9f69d0e1b7b2d9c443584f084bbae7804 (patch)
tree8ed88f12d4b5c09fabe5b6f8339f8a81d4aeda3c /sys
parentc0af872518bb1ede0a1ebd3b2dbb9bfc6bb4948c (diff)
Improved workaround for cardbus support on macppc. This allows mappings to
be put in the cardbus register which really work instead of crashing the machine. if_dc @cardbus now works, xl@cardbus will configure, but does not work properly (endian?) wdc should work fine, but has not been tested recently.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/macppc/conf/GENERIC7
-rw-r--r--sys/arch/macppc/include/bus.h3
-rw-r--r--sys/arch/macppc/include/rbus_machdep.h5
-rw-r--r--sys/arch/macppc/pci/mpcpcibus.c4
-rw-r--r--sys/arch/macppc/pci/pci_addr_fixup.c11
5 files changed, 15 insertions, 15 deletions
diff --git a/sys/arch/macppc/conf/GENERIC b/sys/arch/macppc/conf/GENERIC
index 0d92da4d9eb..fc20520a28d 100644
--- a/sys/arch/macppc/conf/GENERIC
+++ b/sys/arch/macppc/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.32 2002/09/24 19:08:14 nate Exp $g
+# $OpenBSD: GENERIC,v 1.33 2002/10/07 05:39:48 drahn Exp $g
#
# PPC GENERIC config file
#
@@ -58,6 +58,7 @@ macobio0 at pci? dev ? function ?
gem* at pci? dev ? function ? # GMAC ethernet
hme* at pci? dev ? function ? # HME ethernet
dc* at pci? dev ? function ? # DEC Tulip 21143 clones
+#xl* at pci? dev ? function ? # 3C9xx ethernet
em* at pci? dev ? function ? # Intel Pro/1000 ethernet
an* at pci? dev ? function ? # Cisco/Aironet
wi* at pci? dev ? function ? # WaveLAN IEEE 802.11DS
@@ -171,11 +172,11 @@ pcmcia* at cardslot?
cbb* at pci? dev ? function ?
cardslot* at cbb?
wi* at pcmcia? function ? # WaveLAN IEEE 802.11DS
-#dc* at cardbus? dev ? function ? # 21143, "tulip" clone ethernet
+dc* at cardbus? dev ? function ? # 21143, "tulip" clone ethernet
#fxp* at cardbus? dev ? function ? # Intel PRO/100 ethernet
#xl* at cardbus? dev ? function ? # 3C575/3C656 ethernet
#rl* at cardbus? dev ? function ? # RealTek 81[23]9 ethernet
-#wdc* at pcmcia? function ?
+wdc* at pcmcia? function ?
wsdisplay* at vgafb?
wskbd* at ukbd? console ? mux 1
diff --git a/sys/arch/macppc/include/bus.h b/sys/arch/macppc/include/bus.h
index b863ccaa57e..80e124928d0 100644
--- a/sys/arch/macppc/include/bus.h
+++ b/sys/arch/macppc/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.8 2002/09/15 09:01:58 deraadt Exp $ */
+/* $OpenBSD: bus.h,v 1.9 2002/10/07 05:39:48 drahn Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom. All rights reserved.
@@ -56,6 +56,7 @@ struct ppc_bus_space {
u_int32_t bus_base;
u_int32_t bus_size;
u_int8_t bus_reverse; /* Reverse bytes */
+ u_int8_t bus_io; /* IO or memory */
};
#define POWERPC_BUS_TAG_BASE(x) ((x)->bus_base)
diff --git a/sys/arch/macppc/include/rbus_machdep.h b/sys/arch/macppc/include/rbus_machdep.h
index 42bb0cc022b..723ef45dfdd 100644
--- a/sys/arch/macppc/include/rbus_machdep.h
+++ b/sys/arch/macppc/include/rbus_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rbus_machdep.h,v 1.1 2002/07/23 17:53:24 drahn Exp $ */
+/* $OpenBSD: rbus_machdep.h,v 1.2 2002/10/07 05:39:48 drahn Exp $ */
/* $NetBSD: rbus_machdep.h,v 1.2 1999/10/15 06:43:05 haya Exp $ */
/*
@@ -51,6 +51,9 @@ bus_addr_t bus_space_unmap_p(bus_space_tag_t t, bus_space_handle_t bsh,
#define md_space_unmap(bt, bsh, size, adrp) \
do { \
*adrp = bus_space_unmap_p((bt), (bsh), (size)); \
+ if (bt->bus_io) { \
+ *adrp = *adrp & 0xffff; \
+ } \
} while (0)
rbus_tag_t rbus_pccbb_parent_io(struct device *self,
diff --git a/sys/arch/macppc/pci/mpcpcibus.c b/sys/arch/macppc/pci/mpcpcibus.c
index 4677bb82b5c..d7e3d994f17 100644
--- a/sys/arch/macppc/pci/mpcpcibus.c
+++ b/sys/arch/macppc/pci/mpcpcibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpcpcibus.c,v 1.14 2002/09/15 09:01:59 deraadt Exp $ */
+/* $OpenBSD: mpcpcibus.c,v 1.15 2002/10/07 05:39:48 drahn Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -367,8 +367,10 @@ mpcpcibrattach(parent, self, aux)
sc->sc_membus_space.bus_base = 0;
sc->sc_membus_space.bus_reverse = 1;
+ sc->sc_membus_space.bus_io = 0;
sc->sc_iobus_space.bus_base = 0;
sc->sc_iobus_space.bus_reverse = 1;
+ sc->sc_iobus_space.bus_io = 1;
/* find io(config) base, flag == 0x01000000 */
found = 0;
diff --git a/sys/arch/macppc/pci/pci_addr_fixup.c b/sys/arch/macppc/pci/pci_addr_fixup.c
index 7604bcedde5..9ac4a74fe3d 100644
--- a/sys/arch/macppc/pci/pci_addr_fixup.c
+++ b/sys/arch/macppc/pci/pci_addr_fixup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_addr_fixup.c,v 1.4 2002/09/23 04:24:58 drahn Exp $ */
+/* $OpenBSD: pci_addr_fixup.c,v 1.5 2002/10/07 05:39:48 drahn Exp $ */
/* $NetBSD: pci_addr_fixup.c,v 1.7 2000/08/03 20:10:45 nathanw Exp $ */
/*-
@@ -99,12 +99,7 @@ pci_addr_fixup(sc, pc, maxbus)
M_DEVBUF, 0, 0, EX_NOWAIT);
KASSERT(sc->extent_mem);
sc->extent_port = extent_create("PCI I/O port space",
-#if 1
- sc->sc_iobus_space.bus_base,
- sc->sc_iobus_space.bus_base + sc->sc_iobus_space.bus_size,
-#else
PCIADDR_PORT_START, PCIADDR_PORT_END,
-#endif
M_DEVBUF, 0, 0, EX_NOWAIT);
KASSERT(sc->extent_port);
@@ -228,9 +223,7 @@ pciaddr_resource_manage(sc, pc, tag, func)
ex = sc->extent_mem;
} else {
/* XXX some devices give 32bit value */
- addr = (PCI_MAPREG_IO_ADDR(val) & PCIADDR_PORT_END) |
- sc->sc_iobus_space.bus_base,
-
+ addr = PCI_MAPREG_IO_ADDR(val) & PCIADDR_PORT_END;
size = PCI_MAPREG_IO_SIZE(mask);
ex = sc->extent_port;
}