diff options
author | Dale S. Rahn <rahnds@cvs.openbsd.org> | 2000-03-31 04:25:42 +0000 |
---|---|---|
committer | Dale S. Rahn <rahnds@cvs.openbsd.org> | 2000-03-31 04:25:42 +0000 |
commit | 6c120fcc03f8793851c29f3d266cb6f6e1a3b9c6 (patch) | |
tree | 21d633d9527cb69483c4fd8525a4014304e358f1 /sys/arch/powerpc/pci/mpcpcibus.c | |
parent | d32e154ea9747bf744e53b0c7efe4a91e658361a (diff) |
Find last memory or io segment, in case multiple happen to be found,
allows imac to configure ohci.
Diffstat (limited to 'sys/arch/powerpc/pci/mpcpcibus.c')
-rw-r--r-- | sys/arch/powerpc/pci/mpcpcibus.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/arch/powerpc/pci/mpcpcibus.c b/sys/arch/powerpc/pci/mpcpcibus.c index 274b6df5e45..cb7dea20641 100644 --- a/sys/arch/powerpc/pci/mpcpcibus.c +++ b/sys/arch/powerpc/pci/mpcpcibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpcpcibus.c,v 1.14 2000/03/24 06:56:41 rahnds Exp $ */ +/* $OpenBSD: mpcpcibus.c,v 1.15 2000/03/31 04:25:41 rahnds Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -386,6 +386,7 @@ mpcpcibrattach(parent, self, aux) } else #endif { + int found; /* mac configs */ @@ -395,29 +396,31 @@ mpcpcibrattach(parent, self, aux) sc->sc_iobus_space.bus_reverse = 1; /* find io(config) base, flag == 0x01000000 */ + found = 0; for (i = 0; prange[i].flags != 0; i++) { if (prange[i].flags == 0x01000000) { - /* find first? */ - break; + /* find last? */ + found = i; } } /* found the io space ranges */ - if (prange[i].flags == 0x01000000) { + if (prange[found].flags == 0x01000000) { sc->sc_iobus_space.bus_base = - prange[i].base; + prange[found].base; } + found = 0; /* find mem base, flag == 0x02000000 */ for (i = 0; prange[i].flags != 0; i++) { if (prange[i].flags == 0x02000000) { - /* find first? */ - break; + /* find last? */ + found = i; } } /* found the mem space ranges */ - if (prange[i].flags == 0x02000000) { + if (prange[found].flags == 0x02000000) { sc->sc_membus_space.bus_base = - prange[i].base; + prange[found].base; } if ( (sc->sc_iobus_space.bus_base == 0) || (sc->sc_membus_space.bus_base == 0)) { |