Set PCI bus number correctly.
This commit is contained in:
parent
28b3386649
commit
810fcde7eb
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mainbus.c,v 1.3 1998/07/21 18:01:30 tsubai Exp $ */
|
||||
/* $NetBSD: mainbus.c,v 1.4 1998/10/15 14:39:53 tsubai Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
|
||||
@ -98,7 +98,7 @@ mainbus_attach(parent, self, aux)
|
||||
pba.pba_iot = pci_bridges[n].iot;
|
||||
pba.pba_memt = (bus_space_tag_t)0;
|
||||
pba.pba_dmat = &pci_bus_dma_tag;
|
||||
pba.pba_bus = 0;
|
||||
pba.pba_bus = pci_bridges[n].bus;
|
||||
pba.pba_pc = pci_bridges[n].pc;
|
||||
pba.pba_flags =
|
||||
PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bandit.c,v 1.4 1998/07/24 20:53:57 tsubai Exp $ */
|
||||
/* $NetBSD: bandit.c,v 1.5 1998/10/15 14:39:53 tsubai Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1991-1998 by Open Software Foundation, Inc.
|
||||
@ -43,6 +43,7 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <dev/pci/pcireg.h>
|
||||
#include <dev/pci/pcivar.h>
|
||||
@ -126,6 +127,14 @@ scan_pci_devs()
|
||||
pci_bridges[n].addr = mapiodev(reg[0] + 0x800000, 4);
|
||||
pci_bridges[n].data = mapiodev(reg[0] + 0xc00000, 4);
|
||||
pci_bridges[n].pc = n;
|
||||
|
||||
if (OF_getprop(node, "bus-range",
|
||||
reg, sizeof(reg)) != 8) {
|
||||
pci_bridges[n].addr = NULL;
|
||||
continue;
|
||||
}
|
||||
pci_bridges[n].bus = reg[0];
|
||||
|
||||
bandit_init(n);
|
||||
|
||||
child = OF_child(node);
|
||||
@ -146,11 +155,19 @@ scan_pci_devs()
|
||||
pci_bridges[n].data = mapiodev(0xfee00000, 4); /* XXX */
|
||||
pci_bridges[n].pc = PCI_CHIPSET_MPC106; /* for now */
|
||||
|
||||
if (OF_getprop(node, "bus-range",
|
||||
reg, sizeof(reg)) != 8) {
|
||||
pci_bridges[n].addr = NULL;
|
||||
continue;
|
||||
}
|
||||
pci_bridges[n].bus = reg[0];
|
||||
|
||||
child = OF_child(node);
|
||||
while (child) {
|
||||
config_slot(child, pci_bridges[n].pc);
|
||||
child = OF_peer(child);
|
||||
}
|
||||
n++;
|
||||
}
|
||||
|
||||
node = OF_peer(node);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pci_machdep.h,v 1.4 1998/08/15 03:02:41 mycroft Exp $ */
|
||||
/* $NetBSD: pci_machdep.h,v 1.5 1998/10/15 14:39:53 tsubai Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
|
||||
@ -54,6 +54,7 @@ typedef int pci_intr_handle_t;
|
||||
struct pci_bridge {
|
||||
u_int *addr;
|
||||
u_int *data;
|
||||
int bus;
|
||||
bus_space_tag_t iot;
|
||||
pci_chipset_tag_t pc;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user