Make the PCI code actually work.
This commit is contained in:
parent
ac0772ab66
commit
a48bd3e3b4
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pci_machdep.c,v 1.30 2002/05/16 01:01:45 thorpej Exp $ */
|
||||
/* $NetBSD: pci_machdep.c,v 1.31 2002/05/16 20:28:33 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 Matthew R. Green
|
||||
|
@ -96,20 +96,6 @@ pci_attach_hook(parent, self, pba)
|
|||
struct device *self;
|
||||
struct pcibus_attach_args *pba;
|
||||
{
|
||||
struct sparc_pci_chipset *npc;
|
||||
pcitag_t btag;
|
||||
|
||||
/*
|
||||
* If we're attaching at a bridge, create a new PCI chipset
|
||||
* tag that points at the bridge's node.
|
||||
*/
|
||||
if (pba->pba_bridgetag != NULL) {
|
||||
btag = *pba->pba_bridgetag;
|
||||
npc = malloc(sizeof(*npc), M_DEVBUF, M_WAITOK);
|
||||
*npc = *pba->pba_pc;
|
||||
npc->curnode = PCITAG_NODE(btag);
|
||||
pba->pba_pc = npc;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -265,7 +251,12 @@ pci_enumerate_bus(struct pci_softc *sc,
|
|||
int node, b, d, f, ret;
|
||||
char name[30];
|
||||
|
||||
for (node = OF_child(pc->curnode); node != 0 && node != -1;
|
||||
if (sc->sc_bridgetag)
|
||||
node = PCITAG_NODE(*sc->sc_bridgetag);
|
||||
else
|
||||
node = pc->rootnode;
|
||||
|
||||
for (node = OF_child(node); node != 0 && node != -1;
|
||||
node = OF_peer(node)) {
|
||||
name[0] = name[29] = 0;
|
||||
OF_getprop(node, "name", name, sizeof(name));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: psycho.c,v 1.47 2002/05/16 01:01:45 thorpej Exp $ */
|
||||
/* $NetBSD: psycho.c,v 1.48 2002/05/16 20:28:33 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002 Eduardo E. Horvath
|
||||
|
@ -398,6 +398,7 @@ found:
|
|||
psycho_get_bus_range(sc->sc_node, psycho_br);
|
||||
|
||||
pba.pba_bus = psycho_br[0];
|
||||
pba.pba_bridgetag = NULL;
|
||||
|
||||
printf("bus range %u to %u", psycho_br[0], psycho_br[1]);
|
||||
printf("; PCI bus %d", psycho_br[0]);
|
||||
|
@ -593,7 +594,6 @@ psycho_alloc_chipset(pp, node, pc)
|
|||
memcpy(npc, pc, sizeof *pc);
|
||||
npc->cookie = pp;
|
||||
npc->rootnode = node;
|
||||
npc->curnode = node;
|
||||
|
||||
return (npc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pci_machdep.h,v 1.13 2002/05/16 01:01:47 thorpej Exp $ */
|
||||
/* $NetBSD: pci_machdep.h,v 1.14 2002/05/16 20:28:34 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Matthew R. Green
|
||||
|
@ -46,7 +46,6 @@ typedef u_int pci_intr_handle_t;
|
|||
struct sparc_pci_chipset {
|
||||
void *cookie; /* psycho_pbm, but sssh! */
|
||||
int rootnode; /* PCI controller */
|
||||
int curnode; /* Current OFW node */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue