From 993fd0c509ec6d52d9f187f58ed4e5567f0d1b4d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 7 Dec 2004 05:30:02 +0000 Subject: [PATCH] PNP BIOS devices are fundamentally different than ISA PNP devices. These devices should be probed first because they are at fixed locations and cannot be turned off. ISA PNP devices, on the other hand, can be turned off and often can be flexible in the resources they use. Probe them last, as always. --- sys/dev/sound/isa/es1888.c | 2 +- sys/i386/i386/bios.c | 2 +- sys/isa/isavar.h | 17 +++++++++-------- sys/sparc64/isa/isa.c | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/dev/sound/isa/es1888.c b/sys/dev/sound/isa/es1888.c index 22e1bb06862..24830a258ed 100644 --- a/sys/dev/sound/isa/es1888.c +++ b/sys/dev/sound/isa/es1888.c @@ -148,7 +148,7 @@ es1888_identify(driver_t *driver, device_t parent) /* * Create the device and program its resources. */ - dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1); + dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNPBIOS, NULL, -1); bus_set_resource(dev, SYS_RES_IOPORT, 0, 0x220, 0x10); bus_set_resource(dev, SYS_RES_IRQ, 0, 5, 1); bus_set_resource(dev, SYS_RES_DRQ, 0, 1, 1); diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index 3bee94fdd5d..ca434cbd30b 100644 --- a/sys/i386/i386/bios.c +++ b/sys/i386/i386/bios.c @@ -611,7 +611,7 @@ pnpbios_identify(driver_t *driver, device_t parent) continue; /* Add the device and parse its resources */ - dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1); + dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNPBIOS, NULL, -1); isa_set_vendorid(dev, pd->devid); isa_set_logicalid(dev, pd->devid); /* diff --git a/sys/isa/isavar.h b/sys/isa/isavar.h index 811a7210bc4..57fad23a5e9 100644 --- a/sys/isa/isavar.h +++ b/sys/isa/isavar.h @@ -39,15 +39,16 @@ typedef void isa_config_cb(void *arg, struct isa_config *config, int enable); #ifdef _KERNEL /* - * ISA devices are partially ordered to ensure that devices which are - * sensitive to other driver probe routines are probed first. Plug and - * Play devices are added after devices with speculative probes so that - * the legacy hardware can claim resources allowing the Plug and Play - * hardware to choose different resources. + * ISA devices are partially ordered. This is to ensure that hardwired + * devices the BIOS tells us are there appear first, then speculative + * devices that are sensitive to the probe order, then devices that + * are hinted to be there, then the most flexible devices which support + * the ISA bus PNP standard. */ -#define ISA_ORDER_SENSITIVE 0 /* legacy sensitive hardware */ -#define ISA_ORDER_SPECULATIVE 1 /* legacy non-sensitive hardware */ -#define ISA_ORDER_PNP 2 /* plug-and-play hardware */ +#define ISA_ORDER_PNPBIOS 10 /* plug-and-play BIOS inflexible hardware */ +#define ISA_ORDER_SENSITIVE 20 /* legacy sensitive hardware */ +#define ISA_ORDER_SPECULATIVE 30 /* legacy non-sensitive hardware */ +#define ISA_ORDER_PNP 40 /* plug-and-play hardware */ /* * Limits on resources that we can manage diff --git a/sys/sparc64/isa/isa.c b/sys/sparc64/isa/isa.c index 229af4071bc..b849dfc079a 100644 --- a/sys/sparc64/isa/isa.c +++ b/sys/sparc64/isa/isa.c @@ -217,7 +217,7 @@ isa_setup_children(device_t dev, phandle_t parent) continue; } - if ((cdev = BUS_ADD_CHILD(dev, ISA_ORDER_PNP, NULL, -1)) == + if ((cdev = BUS_ADD_CHILD(dev, ISA_ORDER_PNPBIOS, NULL, -1)) == NULL) panic("isa_setup_children: BUS_ADD_CHILD failed"); isa_set_logicalid(cdev, pnp_map[i].id);