Index: sys/arch/x86/isa/isa_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/x86/isa/isa_machdep.c,v retrieving revision 1.22 diff -u -p -r1.22 isa_machdep.c --- sys/arch/x86/isa/isa_machdep.c 27 Jun 2008 11:03:14 -0000 1.22 +++ sys/arch/x86/isa/isa_machdep.c 27 Jun 2008 11:40:52 -0000 @@ -88,6 +88,12 @@ __KERNEL_RCSID(0, "$NetBSD: isa_machdep. #include #include "ioapic.h" +#include "acpi.h" + +#if NACPI > 0 +#include +#include +#endif #if NIOAPIC > 0 #include @@ -289,6 +295,10 @@ isa_attach_hook(device_t parent, device_ * now. */ iba->iba_ic = &x86_isa_chipset; + +#if NACPI > 0 + acpi_isa_get_knowndevs(device_private(self)); +#endif } int Index: sys/dev/acpi/acpi.c =================================================================== RCS file: /cvsroot/src/sys/dev/acpi/acpi.c,v retrieving revision 1.117 diff -u -p -r1.117 acpi.c --- sys/dev/acpi/acpi.c 1 Jun 2008 19:01:57 -0000 1.117 +++ sys/dev/acpi/acpi.c 27 Jun 2008 11:40:52 -0000 @@ -89,6 +89,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.1 #include #include #include +#include #ifdef ACPIVERBOSE #include #endif @@ -647,8 +648,11 @@ acpi_build_tree(struct acpi_softc *sc) if (acpi_match_hid(ad->ad_devinfo, acpi_ignored_ids)) continue; - ad->ad_device = config_found_ia(sc->sc_dev, - "acpinodebus", &aa, acpi_print); + if (acpi_isa_is_knowndev(ad)) + acpi_isa_add_knowndev(ad, sc->sc_dev); + else + ad->ad_device = config_found_ia(sc->sc_dev, + "acpinodebus", &aa, acpi_print); } } config_found_ia(sc->sc_dev, "acpiapmbus", NULL, NULL); Index: sys/dev/acpi/acpi_isa.c =================================================================== RCS file: sys/dev/acpi/acpi_isa.c diff -N sys/dev/acpi/acpi_isa.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/acpi/acpi_isa.c 27 Jun 2008 11:40:52 -0000 @@ -0,0 +1,207 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2007, 2008 Jared D. McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +TAILQ_HEAD(acpi_isa_knowndevshead, acpi_isa_knowndevs) acpi_isa_devices = + TAILQ_HEAD_INITIALIZER(acpi_isa_devices); + +struct acpi_isa_knowndevs { + struct acpi_devnode *aik_ad; + struct isa_knowndev aik_ik; + TAILQ_ENTRY(acpi_isa_knowndevs) aik_list; +}; + +bool +acpi_isa_is_knowndev(struct acpi_devnode *ad) +{ + int i; + + if (ad->ad_type != ACPI_TYPE_DEVICE) + return false; + + /* Consult our list of known device HIDs */ + if (ad->ad_devinfo->Valid & ACPI_VALID_HID) + if (isa_match_hid(NULL, ad->ad_devinfo->HardwareId.Value, NULL)) + return true; + + if (ad->ad_devinfo->Valid & ACPI_VALID_CID) + for (i = 0; i < ad->ad_devinfo->CompatibilityId.Count; i++) { + if (isa_match_hid(NULL, + ad->ad_devinfo->CompatibilityId.Id[i].Value, NULL)) + return true; + } + + /* No match */ + return false; +} + +void +acpi_isa_add_knowndev(struct acpi_devnode *ad, device_t dev) +{ + static int key = 0; + struct acpi_isa_knowndevs *aik; + struct isa_pnpname *ipn; + struct acpi_resources res; + struct acpi_io *io; + struct acpi_irq *irq; + struct acpi_mem *mem; + struct acpi_drq *drq; + ACPI_STATUS rv; + int i, cnt; + + aik = kmem_alloc(sizeof(struct acpi_isa_knowndevs), KM_SLEEP); + aik->aik_ad = ad; + aik->aik_ik.ik_key = key++; + aik->aik_ik.ik_claimed = NULL; + + if (ad->ad_devinfo->Valid & ACPI_VALID_HID) + aik->aik_ik.ik_pnpname = ad->ad_devinfo->HardwareId.Value; + else + aik->aik_ik.ik_pnpname = NULL; + + if ((ad->ad_devinfo->Valid & ACPI_VALID_CID) && + ad->ad_devinfo->CompatibilityId.Count > 0) { + ipn = kmem_alloc(sizeof(struct isa_pnpname) * + ad->ad_devinfo->CompatibilityId.Count, KM_SLEEP); + for (i = 0; i < ad->ad_devinfo->CompatibilityId.Count; i++) + ipn[i].ipn_name = + ad->ad_devinfo->CompatibilityId.Id[i].Value; + } else + ipn = NULL; + aik->aik_ik.ik_pnpcompatnames = ipn; + + rv = acpi_resource_parse(dev, ad->ad_handle, "_CRS", &res, + &acpi_resource_parse_ops_default); + if (ACPI_FAILURE(rv)) { + aprint_error_dev(dev, "Couldn't parse resources for %s\n", + aik->aik_ik.ik_pnpname); + return; + } + + /* Generate ISA IO resources from ACPI IO resources */ + i = cnt = 0; + do { + io = acpi_res_io(&res, cnt); + if (io) + ++cnt; + } while (io != NULL); + if (cnt) + aik->aik_ik.ik_io = + kmem_alloc(sizeof(struct isa_io) * cnt, KM_NOSLEEP); + aik->aik_ik.ik_nio = cnt; + for (i = 0; i < cnt; i++) { + io = acpi_res_io(&res, i); + KASSERT(io != NULL); + aik->aik_ik.ik_io[i].ir_addr = io->ar_base; + aik->aik_ik.ik_io[i].ir_size = io->ar_length; + } + + /* Generate ISA IOMEM resources from ACPI MEM resources */ + i = cnt = 0; + do { + mem = acpi_res_mem(&res, cnt); + if (mem) + ++cnt; + } while (mem != NULL); + if (cnt) + aik->aik_ik.ik_iomem = + kmem_alloc(sizeof(struct isa_iomem) * cnt, KM_NOSLEEP); + aik->aik_ik.ik_niomem = cnt; + for (i = 0; i < cnt; i++) { + mem = acpi_res_mem(&res, i); + KASSERT(mem != NULL); + aik->aik_ik.ik_iomem[i].ir_addr = mem->ar_base; + aik->aik_ik.ik_iomem[i].ir_size = mem->ar_length; + } + + /* Generate ISA IRQ resources from ACPI IRQ resources */ + i = cnt = 0; + do { + irq = acpi_res_irq(&res, cnt); + if (irq) + ++cnt; + } while (irq != NULL); + if (cnt) + aik->aik_ik.ik_irq = + kmem_alloc(sizeof(struct isa_irq) * cnt, KM_NOSLEEP); + aik->aik_ik.ik_nirq = cnt; + for (i = 0; i < cnt; i++) { + irq = acpi_res_irq(&res, i); + KASSERT(irq != NULL); + aik->aik_ik.ik_irq[i].ir_irq = irq->ar_irq; + } + + /* Generate ISA DRQ resources from ACPI DRQ resources */ + i = cnt = 0; + do { + drq = acpi_res_drq(&res, cnt); + if (drq) + ++cnt; + } while (drq != NULL); + if (cnt) + aik->aik_ik.ik_drq = + kmem_alloc(sizeof(struct isa_drq) * cnt, KM_NOSLEEP); + aik->aik_ik.ik_ndrq = cnt; + for (i = 0; i < cnt; i++) { + drq = acpi_res_drq(&res, i); + KASSERT(drq != NULL); + aik->aik_ik.ik_drq[i].ir_drq = drq->ar_drq; + } + + aprint_debug("ACPI: Found ISA device %s\n", aik->aik_ik.ik_pnpname); + TAILQ_INSERT_TAIL(&acpi_isa_devices, aik, aik_list); + + return; +} + +void +acpi_isa_get_knowndevs(struct isa_softc *sc) +{ + struct acpi_isa_knowndevs *aik; + + TAILQ_FOREACH(aik, &acpi_isa_devices, aik_list) + TAILQ_INSERT_TAIL(&sc->sc_knowndevs, &aik->aik_ik, ik_list); + + return; +} Index: sys/dev/acpi/acpi_isa.h =================================================================== RCS file: sys/dev/acpi/acpi_isa.h diff -N sys/dev/acpi/acpi_isa.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/acpi/acpi_isa.h 27 Jun 2008 11:40:52 -0000 @@ -0,0 +1,36 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2007, 2008 Jared D. McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_DEV_ACPI_ACPI_ISA_H +#define _SYS_DEV_ACPI_ACPI_ISA_H + +bool acpi_isa_is_knowndev(struct acpi_devnode *); +void acpi_isa_add_knowndev(struct acpi_devnode *, device_t); +void acpi_isa_get_knowndevs(struct isa_softc *); + +#endif /* !_SYS_DEV_ACPI_ACPI_ISA_H */ Index: sys/dev/acpi/acpi_resource.c =================================================================== RCS file: /cvsroot/src/sys/dev/acpi/acpi_resource.c,v retrieving revision 1.26 diff -u -p -r1.26 acpi_resource.c --- sys/dev/acpi/acpi_resource.c 7 Apr 2008 10:16:59 -0000 1.26 +++ sys/dev/acpi/acpi_resource.c 27 Jun 2008 11:40:52 -0000 @@ -638,7 +638,8 @@ acpi_res_parse_fini(struct device *dev, struct acpi_resources *res = context; /* Print the resources we're using. */ - acpi_resource_print(dev, res); + if (dev) + acpi_resource_print(dev, res); } static void Index: sys/dev/acpi/files.acpi =================================================================== RCS file: /cvsroot/src/sys/dev/acpi/files.acpi,v retrieving revision 1.52 diff -u -p -r1.52 files.acpi --- sys/dev/acpi/files.acpi 18 May 2008 22:05:59 -0000 1.52 +++ sys/dev/acpi/files.acpi 27 Jun 2008 11:40:52 -0000 @@ -19,6 +19,7 @@ file dev/acpi/acpi_madt.c acpi file dev/acpi/acpi_pci_link.c acpi file dev/acpi/acpi_quirks.c acpi file dev/acpi/acpi_timer.c acpi +file dev/acpi/acpi_isa.c acpi # ACPI/apm emulation. attach apm at acpiapmbus with acpiapm: sysmon_envsys Index: sys/dev/isa/Makefile.isadevs =================================================================== RCS file: sys/dev/isa/Makefile.isadevs diff -N sys/dev/isa/Makefile.isadevs --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/isa/Makefile.isadevs 27 Jun 2008 11:40:52 -0000 @@ -0,0 +1,7 @@ +# $NetBSD$ + +.c: + +isadevs.c: isadevs devlist2h.sh + /bin/rm -f isadevs.c + /bin/sh devlist2h.sh isadevs >isadevs.c Index: sys/dev/isa/attimer_isa.c =================================================================== RCS file: /cvsroot/src/sys/dev/isa/attimer_isa.c,v retrieving revision 1.11 diff -u -p -r1.11 attimer_isa.c --- sys/dev/isa/attimer_isa.c 29 Apr 2008 06:53:03 -0000 1.11 +++ sys/dev/isa/attimer_isa.c 27 Jun 2008 11:40:52 -0000 @@ -86,8 +86,8 @@ attimer_isa_match(device_t parent, cfdat struct isa_attach_args *ia = aux; bus_space_handle_t att_ioh; - if (ISA_DIRECT_CONFIG(ia)) - return (0); + if (ISA_DIRECT_CONFIG(ia) && isa_match_direct("attimer", ia)) + return (1); /* If values are hardwired to something that they can't be, punt. */ if (ia->ia_nio < 1 || Index: sys/dev/isa/com_isa.c =================================================================== RCS file: /cvsroot/src/sys/dev/isa/com_isa.c,v retrieving revision 1.34 diff -u -p -r1.34 com_isa.c --- sys/dev/isa/com_isa.c 28 Apr 2008 20:23:52 -0000 1.34 +++ sys/dev/isa/com_isa.c 27 Jun 2008 11:40:52 -0000 @@ -124,8 +124,8 @@ com_isa_probe(device_t parent, cfdata_t if (ia->ia_nirq < 1) return (0); - if (ISA_DIRECT_CONFIG(ia)) - return (0); + if (ISA_DIRECT_CONFIG(ia) && isa_match_direct("com", ia)) + return (1); /* Disallow wildcarded i/o address. */ if (ia->ia_io[0].ir_addr == ISA_UNKNOWN_PORT) Index: sys/dev/isa/devlist2h.sh =================================================================== RCS file: sys/dev/isa/devlist2h.sh diff -N sys/dev/isa/devlist2h.sh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/isa/devlist2h.sh 27 Jun 2008 11:40:52 -0000 @@ -0,0 +1,60 @@ +#!/bin/sh +# $NetBSD$ +#- +# Copyright (c) 2007, 2008 Jared D. McNeill +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +usage() { + echo "usage: $0 isadevs" + exit 1 +} + +devlist="$1" + +if [ x"$devlist" = x"" ]; then + usage +fi + +echo "/* \$NetBSD\$ */" +echo "/*" +echo " * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT." +echo " */" +echo +echo "#include " +echo "__KERNEL_RCSID(0, \"\$NetBSD\$\");" +echo "#include " +echo "#include " +echo "#include " +echo "#include " +echo "#include " +echo "#include " +echo "#include " +echo +echo "const struct isa_devinfo isa_devinfo[] = {" +egrep -v '^#|^$' "$devlist" | while read drv pnp; do + echo " { \"$pnp\", \"$drv\" }," +done +echo " { NULL, NULL }," +echo "};" Index: sys/dev/isa/files.isa =================================================================== RCS file: /cvsroot/src/sys/dev/isa/files.isa,v retrieving revision 1.157 diff -u -p -r1.157 files.isa --- sys/dev/isa/files.isa 3 Apr 2008 22:46:22 -0000 1.157 +++ sys/dev/isa/files.isa 27 Jun 2008 11:40:52 -0000 @@ -13,6 +13,7 @@ device isa {[port = -1], [size = 0], [irq = -1], [drq = -1], [drq2 = -1]} attach isa at isabus file dev/isa/isa.c isa needs-flag +file dev/isa/isadevs.c isa file dev/isa/isabusprint.c isabus Index: sys/dev/isa/isa.c =================================================================== RCS file: /cvsroot/src/sys/dev/isa/isa.c,v retrieving revision 1.134 diff -u -p -r1.134 isa.c --- sys/dev/isa/isa.c 28 Apr 2008 20:23:52 -0000 1.134 +++ sys/dev/isa/isa.c 27 Jun 2008 11:40:52 -0000 @@ -71,6 +71,8 @@ int isasearch(device_t, cfdata_t, const static int isa_slotcount = -1; /* -1 == don't know how many */ +extern const struct isa_devinfo isa_devinfo[]; + int isamatch(device_t parent, cfdata_t cf, void *aux) { @@ -91,7 +93,7 @@ isaattach(device_t parent, device_t self }; TAILQ_INIT(&sc->sc_knowndevs); - sc->sc_dynamicdevs = 0; + sc->sc_dynamicdevs = 1; sc->sc_dev = self; @@ -302,6 +304,7 @@ int isaprint(void *aux, const char *isa) { struct isa_attach_args *ia = aux; + struct isa_pnpname *ipn; const char *sep; int i; @@ -309,21 +312,23 @@ isaprint(void *aux, const char *isa) * This block of code only fires if we have a direct-config'd * device for which there is no driver match. */ - if (isa != NULL) { - struct isa_pnpname *ipn; - - if (ia->ia_pnpname != NULL) - aprint_normal("%s", ia->ia_pnpname); - if ((ipn = ia->ia_pnpcompatnames) != NULL) { - aprint_normal(" ("); /* ) */ - for (sep = ""; ipn != NULL; - ipn = ipn->ipn_next, sep = " ") { - aprint_normal("%s%s", sep, ipn->ipn_name); - } - /* ( */ aprint_normal(")"); + if (ia->ia_pnpname != NULL) { + if (!isa) + aprint_normal(" ("); + aprint_normal("%s", ia->ia_pnpname); + } + if ((ipn = ia->ia_pnpcompatnames) != NULL) { + aprint_normal(" ("); /* ) */ + for (sep = ""; ipn != NULL; + ipn = ipn->ipn_next, sep = " ") { + aprint_normal("%s%s", sep, ipn->ipn_name); } - aprint_normal(" at %s", isa); + /* ( */ aprint_normal(")"); } + if (isa) + aprint_normal(" at %s", isa); + else if (ia->ia_pnpname != NULL) + aprint_normal(")"); if (ia->ia_nio) { sep = ""; @@ -465,6 +470,46 @@ isa_intr_typename(int type) } } +const char * +isa_match_hid(const char *driver, const char *hid, int *flags) +{ + int i; + + for (i = 0; isa_devinfo[i].id_driver != NULL; i++) { + if (driver != NULL && strcmp(driver, isa_devinfo[i].id_driver)) + continue; + if (pmatch(hid, isa_devinfo[i].id_hid, NULL) == 2) { + if (flags) + *flags = isa_devinfo[i].id_flags; + return isa_devinfo[i].id_driver; + } + } + + return NULL; +} + +bool +isa_match_direct(const char *driver, struct isa_attach_args *ia) +{ + struct isa_pnpname *ipn; + + if (ia->ia_pnpname != NULL) + if (isa_match_hid(driver, ia->ia_pnpname, NULL) != NULL) + return true; + + if (ia->ia_pnpcompatnames != NULL) { + ipn = ia->ia_pnpcompatnames; + do { + if (ipn->ipn_name == NULL) + continue; + if (isa_match_hid(driver, ipn->ipn_name, NULL) != NULL) + return true; + } while ((ipn = ipn->ipn_next) != NULL); + } + + return false; +} + int isa_get_slotcount(void) { Index: sys/dev/isa/isadevs =================================================================== RCS file: sys/dev/isa/isadevs diff -N sys/dev/isa/isadevs --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/isa/isadevs 27 Jun 2008 11:40:52 -0000 @@ -0,0 +1,48 @@ +# $NetBSD$ + +#- +# Copyright (c) 2007, 2008 Jared D. McNeill +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +lpt PNP04?? +attimer PNP0100 +com PNP0500 +com PNP0501 +com PNP0511 +com IBM0071 +com SMCF010 +com NSC6001 +com FUJ02E6 +fdc PNP07?? +joy PNPB02F +mpu PNPB006 +pckbc PNP03?? +pckbc PNP0F?? +pcppi PNP0800 +ug ABT2005 +wss NMX2210 +wss CSC0000 +wss CSC0100 +ym YHM0021 Index: sys/dev/isa/isadevs.c =================================================================== RCS file: sys/dev/isa/isadevs.c diff -N sys/dev/isa/isadevs.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/isa/isadevs.c 27 Jun 2008 11:40:52 -0000 @@ -0,0 +1,38 @@ +/* $NetBSD$ */ +/* + * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD$"); +#include +#include +#include +#include +#include +#include +#include + +const struct isa_devinfo isa_devinfo[] = { + { "PNP04??", "lpt" }, + { "PNP0100", "attimer" }, + { "PNP0500", "com" }, + { "PNP0501", "com" }, + { "PNP0511", "com" }, + { "IBM0071", "com" }, + { "SMCF010", "com" }, + { "NSC6001", "com" }, + { "FUJ02E6", "com" }, + { "PNP07??", "fdc" }, + { "PNPB02F", "joy" }, + { "PNPB006", "mpu" }, + { "PNP03??", "pckbc" }, + { "PNP0F??", "pckbc" }, + { "PNP0800", "pcppi" }, + { "ABT2005", "ug" }, + { "NMX2210", "wss" }, + { "CSC0000", "wss" }, + { "CSC0100", "wss" }, + { "YHM0021", "ym" }, + { NULL, NULL }, +}; Index: sys/dev/isa/isavar.h =================================================================== RCS file: /cvsroot/src/sys/dev/isa/isavar.h,v retrieving revision 1.52 diff -u -p -r1.52 isavar.h --- sys/dev/isa/isavar.h 28 Apr 2008 20:23:52 -0000 1.52 +++ sys/dev/isa/isavar.h 27 Jun 2008 11:40:52 -0000 @@ -142,6 +142,7 @@ struct isa_knowndev { TAILQ_ENTRY(isa_knowndev) ik_list; uintptr_t ik_key; struct device *ik_claimed; + const char *ik_driver; /* * The rest of these fields correspond to isa_attach_args @@ -163,6 +164,13 @@ struct isa_knowndev { int ik_ndrq; }; +struct isa_devinfo { + const char *id_hid; + const char *id_driver; + int id_flags; +#define ISADEVS_ONCE 0x01 +}; + /* * ISA driver attach arguments */ @@ -271,6 +279,12 @@ const char *isa_intr_typename(int); */ #define ISABUS_DMA_DEFERCHAN BUS_DMA_BUS2 +/* + * Match an ISA knowndev to the isadevs table + */ +const char * isa_match_hid(const char *, const char *, int *); +bool isa_match_direct(const char *, struct isa_attach_args *); + void isa_set_slotcount(int); int isa_get_slotcount(void); Index: sys/dev/isa/pckbc_isa.c =================================================================== RCS file: /cvsroot/src/sys/dev/isa/pckbc_isa.c,v retrieving revision 1.25 diff -u -p -r1.25 pckbc_isa.c --- sys/dev/isa/pckbc_isa.c 25 May 2008 16:19:12 -0000 1.25 +++ sys/dev/isa/pckbc_isa.c 27 Jun 2008 11:40:52 -0000 @@ -70,8 +70,8 @@ pckbc_isa_match(device_t parent, cfdata_ bus_space_handle_t ioh_d, ioh_c; int res, ok = 1; - if (ISA_DIRECT_CONFIG(ia)) - return (0); + if (ISA_DIRECT_CONFIG(ia) && isa_match_direct("pckbc", ia)) + return (1); /* If values are hardwired to something that they can't be, punt. */ if (ia->ia_nio < 1 || Index: sys/dev/isa/pcppi.c =================================================================== RCS file: /cvsroot/src/sys/dev/isa/pcppi.c,v retrieving revision 1.32 diff -u -p -r1.32 pcppi.c --- sys/dev/isa/pcppi.c 5 Mar 2008 22:46:43 -0000 1.32 +++ sys/dev/isa/pcppi.c 27 Jun 2008 11:40:52 -0000 @@ -80,8 +80,8 @@ pcppi_match(device_t parent, cfdata_t ma int have_ppi, rv; u_int8_t v, nv; - if (ISA_DIRECT_CONFIG(ia)) - return (0); + if (ISA_DIRECT_CONFIG(ia) && isa_match_direct("pcppi", ia)) + return (1); /* If values are hardwired to something that they can't be, punt. */ if (ia->ia_nio < 1 ||