Always create attach points for the various child busses that can be

attached to the nexus.  With one exception, this (for example) allows
you to do wierd things like kldload the eisa bus on the fly and then
drivers, and have it auto probe the eisa bus when the drivers come online.

The one exception being pci, it only adds the pcib after the presence of
the pci bus is detected and that's #if'ed code.

A side effect of this is that isa and eisa will be attached to the nexus
directly rather than the PCI->ISA or PCI->EISA bridges.  I'm not sure if
this is good or bad at this point, but it seems to be closer to the way
things are for the i386 family...  This is likely to be followed up.

This also fixes compilation without a PCI bus configured and will allow
eisa to work without PCI too.
This commit is contained in:
peter 1999-04-19 08:04:19 +00:00
parent 715f7f0d75
commit 562d6cadcb
4 changed files with 56 additions and 120 deletions

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.1 1999/04/16 21:22:14 peter Exp $
* $Id: nexus.c,v 1.2 1999/04/18 14:30:55 kato Exp $
*/
/*
@ -71,13 +71,10 @@
#include <i386/isa/icu.h>
#include <i386/isa/intr_machdep.h>
#include <pci/pcivar.h>
#include "eisa.h"
#include "isa.h"
#include "pci.h"
#include "npx.h"
#include "apm.h"
#if NPCI > 0
#include <pci/pcivar.h>
#endif
static struct rman irq_rman, drq_rman, port_rman, mem_rman;
@ -174,44 +171,31 @@ nexus_probe(device_t dev)
|| rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
#if NNPX > 0
child = device_add_child(dev, "npx", 0, 0);
if (child == 0)
panic("nexus_probe npx");
#endif /* NNPX > 0 */
#if NAPM > 0
printf("nexus_probe npx\n");
child = device_add_child(dev, "apm", 0, 0);
if (child == 0)
panic("nexus_probe apm");
#endif /* NAPM > 0 */
printf("nexus_probe apm\n");
#if NPCI > 0
/* Add a PCI bridge if pci bus is present */
/* pci_cfgopen() should come out of here so it could be loadable */
if (pci_cfgopen() != 0) {
child = device_add_child(dev, "pcib", 0, 0);
if (child == 0)
panic("nexus_probe pcib");
printf("nexus_probe pcib\n");
}
#endif
#if 0 && NEISA > 0
child = device_add_child(dev, "eisa", 0, 0);
if (child == 0)
panic("nexus_probe eisa");
#endif
#if NISA > 0
#ifdef PC98
/* Add an ISA bus directly */
printf("nexus_probe eisa\n");
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
#else
/* Add an ISA bus directly if pci bus is not present */
if (pci_cfgopen() == 0) {
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
}
#endif
#endif
return 0;
}

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.1 1999/04/16 21:22:14 peter Exp $
* $Id: nexus.c,v 1.2 1999/04/18 14:30:55 kato Exp $
*/
/*
@ -71,13 +71,10 @@
#include <i386/isa/icu.h>
#include <i386/isa/intr_machdep.h>
#include <pci/pcivar.h>
#include "eisa.h"
#include "isa.h"
#include "pci.h"
#include "npx.h"
#include "apm.h"
#if NPCI > 0
#include <pci/pcivar.h>
#endif
static struct rman irq_rman, drq_rman, port_rman, mem_rman;
@ -174,44 +171,31 @@ nexus_probe(device_t dev)
|| rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
#if NNPX > 0
child = device_add_child(dev, "npx", 0, 0);
if (child == 0)
panic("nexus_probe npx");
#endif /* NNPX > 0 */
#if NAPM > 0
printf("nexus_probe npx\n");
child = device_add_child(dev, "apm", 0, 0);
if (child == 0)
panic("nexus_probe apm");
#endif /* NAPM > 0 */
printf("nexus_probe apm\n");
#if NPCI > 0
/* Add a PCI bridge if pci bus is present */
/* pci_cfgopen() should come out of here so it could be loadable */
if (pci_cfgopen() != 0) {
child = device_add_child(dev, "pcib", 0, 0);
if (child == 0)
panic("nexus_probe pcib");
printf("nexus_probe pcib\n");
}
#endif
#if 0 && NEISA > 0
child = device_add_child(dev, "eisa", 0, 0);
if (child == 0)
panic("nexus_probe eisa");
#endif
#if NISA > 0
#ifdef PC98
/* Add an ISA bus directly */
printf("nexus_probe eisa\n");
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
#else
/* Add an ISA bus directly if pci bus is not present */
if (pci_cfgopen() == 0) {
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
}
#endif
#endif
return 0;
}

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.1 1999/04/16 21:22:14 peter Exp $
* $Id: nexus.c,v 1.2 1999/04/18 14:30:55 kato Exp $
*/
/*
@ -71,13 +71,10 @@
#include <i386/isa/icu.h>
#include <i386/isa/intr_machdep.h>
#include <pci/pcivar.h>
#include "eisa.h"
#include "isa.h"
#include "pci.h"
#include "npx.h"
#include "apm.h"
#if NPCI > 0
#include <pci/pcivar.h>
#endif
static struct rman irq_rman, drq_rman, port_rman, mem_rman;
@ -174,44 +171,31 @@ nexus_probe(device_t dev)
|| rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
#if NNPX > 0
child = device_add_child(dev, "npx", 0, 0);
if (child == 0)
panic("nexus_probe npx");
#endif /* NNPX > 0 */
#if NAPM > 0
printf("nexus_probe npx\n");
child = device_add_child(dev, "apm", 0, 0);
if (child == 0)
panic("nexus_probe apm");
#endif /* NAPM > 0 */
printf("nexus_probe apm\n");
#if NPCI > 0
/* Add a PCI bridge if pci bus is present */
/* pci_cfgopen() should come out of here so it could be loadable */
if (pci_cfgopen() != 0) {
child = device_add_child(dev, "pcib", 0, 0);
if (child == 0)
panic("nexus_probe pcib");
printf("nexus_probe pcib\n");
}
#endif
#if 0 && NEISA > 0
child = device_add_child(dev, "eisa", 0, 0);
if (child == 0)
panic("nexus_probe eisa");
#endif
#if NISA > 0
#ifdef PC98
/* Add an ISA bus directly */
printf("nexus_probe eisa\n");
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
#else
/* Add an ISA bus directly if pci bus is not present */
if (pci_cfgopen() == 0) {
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
}
#endif
#endif
return 0;
}

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.1 1999/04/16 21:22:14 peter Exp $
* $Id: nexus.c,v 1.2 1999/04/18 14:30:55 kato Exp $
*/
/*
@ -71,13 +71,10 @@
#include <i386/isa/icu.h>
#include <i386/isa/intr_machdep.h>
#include <pci/pcivar.h>
#include "eisa.h"
#include "isa.h"
#include "pci.h"
#include "npx.h"
#include "apm.h"
#if NPCI > 0
#include <pci/pcivar.h>
#endif
static struct rman irq_rman, drq_rman, port_rman, mem_rman;
@ -174,44 +171,31 @@ nexus_probe(device_t dev)
|| rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
#if NNPX > 0
child = device_add_child(dev, "npx", 0, 0);
if (child == 0)
panic("nexus_probe npx");
#endif /* NNPX > 0 */
#if NAPM > 0
printf("nexus_probe npx\n");
child = device_add_child(dev, "apm", 0, 0);
if (child == 0)
panic("nexus_probe apm");
#endif /* NAPM > 0 */
printf("nexus_probe apm\n");
#if NPCI > 0
/* Add a PCI bridge if pci bus is present */
/* pci_cfgopen() should come out of here so it could be loadable */
if (pci_cfgopen() != 0) {
child = device_add_child(dev, "pcib", 0, 0);
if (child == 0)
panic("nexus_probe pcib");
printf("nexus_probe pcib\n");
}
#endif
#if 0 && NEISA > 0
child = device_add_child(dev, "eisa", 0, 0);
if (child == 0)
panic("nexus_probe eisa");
#endif
#if NISA > 0
#ifdef PC98
/* Add an ISA bus directly */
printf("nexus_probe eisa\n");
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
#else
/* Add an ISA bus directly if pci bus is not present */
if (pci_cfgopen() == 0) {
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
}
#endif
#endif
return 0;
}