summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2000-03-15 23:50:31 +0000
committermjacob <mjacob@FreeBSD.org>2000-03-15 23:50:31 +0000
commita0447a00849801b1ae76539c3dc2b4d93b3a91d6 (patch)
treef595ccf8bd78c2e242d8735626dd270e409b853e /sys/pci
parent2b8f5a2c4888230d3d0ac21aa652a0b62a2580b4 (diff)
downloadFreeBSD-src-a0447a00849801b1ae76539c3dc2b4d93b3a91d6.zip
FreeBSD-src-a0447a00849801b1ae76539c3dc2b4d93b3a91d6.tar.gz
Alpha 8200 port: Until we fix things better, determine which alpha CPU
platform we're running on so we know how many bits to reserve at the top end for the 'hose' value. It turns out that there's *just* enough room to support all possible hoses on TurboLaser. Reviewed by: gallatin@freebsd.org, dfr@free3bsd.org
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/pci.c46
1 files changed, 37 insertions, 9 deletions
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index bbb9dff..349778f 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -56,6 +56,10 @@
#include <pci/pcivar.h>
#include <sys/pciio.h>
+#ifdef __alpha__
+#include <machine/rpb.h>
+#endif
+
#ifdef APIC_IO
#include <machine/smp.h>
#endif /* APIC_IO */
@@ -1034,17 +1038,41 @@ pci_add_map(device_t dev, pcicfgregs* cfg, int reg)
* can deal with multiple hoses
*/
- if(cfg->hose){
- if (base & 0x80000000) {
- printf("base addr = 0x%lx\n", base);
- printf("hacked addr = 0x%lx\n",
- base | ((u_int64_t)cfg->hose << 31));
-
+ if (cfg->hose) {
+ u_int32_t mask, shift, maxh;
+
+ switch (hwrpb->rpb_type) {
+ case ST_DEC_21000:
+ case ST_DEC_4100:
+ mask = 0xf8000000;
+ shift = 27;
+ maxh = 32;
+ break;
+ case ST_DEC_6600:
+ mask = 0x80000000;
+ shift = 31;
+ maxh = 2;
+ break;
+ default:
+ mask = 0;
+ shift = 0;
+ maxh = 0;
+ break;
+ }
+ if (base & mask) {
+ printf("base addr = 0x%llx\n", (long long) base);
+ printf("mask addr = 0x%lx\n", (long) mask);
+ printf("hacked addr = 0x%llx\n", (long long)
+ (base | ((u_int64_t)cfg->hose << shift)));
panic("hose encoding hack would clobber base addr");
+ /* NOTREACHED */
+ }
+ if (cfg->hose >= maxh) {
+ panic("Hose %d - can only encode %d hose(s)",
+ cfg->hose, maxh);
+ /* NOTREACHED */
}
- if (cfg->hose > 1)
- panic("only one hose supported!");
- base |= ((u_int64_t)cfg->hose << 31);
+ base |= ((u_int64_t)cfg->hose << shift);
}
#endif
if (type == SYS_RES_IOPORT && !pci_porten(cfg))
OpenPOWER on IntegriCloud