Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci ICH4/ICH5:



details:   https://anonhg.NetBSD.org/src/rev/5e1a2689cc99
branches:  trunk
changeset: 556816:5e1a2689cc99
user:      kent <kent%NetBSD.org@localhost>
date:      Sun Dec 28 12:31:30 2003 +0000

description:
ICH4/ICH5:
When native i/o mapping fails, try compatible i/o mapping.

diffstat:

 sys/dev/pci/auich.c |  32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r 599515ee0769 -r 5e1a2689cc99 sys/dev/pci/auich.c
--- a/sys/dev/pci/auich.c       Sun Dec 28 09:27:41 2003 +0000
+++ b/sys/dev/pci/auich.c       Sun Dec 28 12:31:30 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auich.c,v 1.55 2003/11/22 08:49:41 kent Exp $  */
+/*     $NetBSD: auich.c,v 1.56 2003/12/28 12:31:30 kent Exp $  */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.55 2003/11/22 08:49:41 kent Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.56 2003/12/28 12:31:30 kent Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -418,15 +418,35 @@
                 */
                if (pci_mapreg_map(pa, ICH_MMBAR, PCI_MAPREG_TYPE_MEM, 0,
                                   &sc->iot, &sc->mix_ioh, NULL, &mix_size)) {
-                       aprint_error("%s: can't map codec i/o space\n",
+                       aprint_error("%s: can't map native codec i/o space\n",
                                     sc->sc_dev.dv_xname);
-                       return;
+                       v = pci_conf_read(pa->pa_pc, pa->pa_tag, ICH_CFG);
+                       pci_conf_write(pa->pa_pc, pa->pa_tag, ICH_CFG,
+                                      v | ICH_CFG_IOSE);
+                       if (pci_mapreg_map(pa, ICH_NAMBAR, PCI_MAPREG_TYPE_IO,
+                                          0, &sc->iot, &sc->mix_ioh, NULL,
+                                          &mix_size)) {
+                               aprint_error("%s: can't map compatible codec "
+                                            "i/o space\n",
+                                            sc->sc_dev.dv_xname);
+                               return;
+                       }
                }
                if (pci_mapreg_map(pa, ICH_MBBAR, PCI_MAPREG_TYPE_MEM, 0,
                                   &sc->iot, &sc->aud_ioh, NULL, &aud_size)) {
-                       aprint_error("%s: can't map device i/o space\n",
+                       aprint_error("%s: can't map native device i/o space\n",
                                     sc->sc_dev.dv_xname);
-                       return;
+                       v = pci_conf_read(pa->pa_pc, pa->pa_tag, ICH_CFG);
+                       pci_conf_write(pa->pa_pc, pa->pa_tag, ICH_CFG,
+                                      v | ICH_CFG_IOSE);
+                       if (pci_mapreg_map(pa, ICH_NABMBAR, PCI_MAPREG_TYPE_IO,
+                                          0, &sc->iot, &sc->aud_ioh, NULL,
+                                          &aud_size)) {
+                               aprint_error("%s: can't map compatible device "
+                                            "i/o space\n",
+                                            sc->sc_dev.dv_xname);
+                               return;
+                       }
                }
        } else {
                if (pci_mapreg_map(pa, ICH_NAMBAR, PCI_MAPREG_TYPE_IO, 0,



Home | Main Index | Thread Index | Old Index