Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci For ICH4/ICH5, use native BARs instead of compat...



details:   https://anonhg.NetBSD.org/src/rev/095a809bac84
branches:  trunk
changeset: 555578:095a809bac84
user:      kent <kent%NetBSD.org@localhost>
date:      Sat Nov 22 08:49:41 2003 +0000

description:
For ICH4/ICH5, use native BARs instead of compatible BARs.
The patch was provided by Lars Heidieker.

diffstat:

 sys/dev/pci/auich.c    |  51 +++++++++++++++++++++++++++++--------------------
 sys/dev/pci/auichreg.h |   4 ++-
 2 files changed, 33 insertions(+), 22 deletions(-)

diffs (94 lines):

diff -r 2f9c3792ef84 -r 095a809bac84 sys/dev/pci/auich.c
--- a/sys/dev/pci/auich.c       Sat Nov 22 08:32:12 2003 +0000
+++ b/sys/dev/pci/auich.c       Sat Nov 22 08:49:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auich.c,v 1.54 2003/11/06 07:13:33 mycroft Exp $       */
+/*     $NetBSD: auich.c,v 1.55 2003/11/22 08:49:41 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.54 2003/11/06 07:13:33 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.55 2003/11/22 08:49:41 kent Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -409,29 +409,38 @@
 
        aprint_normal(": %s\n", d->name);
 
-       /*
-        * For ICH4/ICH5, make sure the compatible BARs are writable.
-        * We can not access all registers of ICH4/ICH5 with NAMBAR
-        * and NABMBAR.  But they are sufficient for the current driver.
-        */
        if ((d->vendor == PCI_VENDOR_INTEL
             && d->product == PCI_PRODUCT_INTEL_82801DB_AC)
            || (d->vendor == PCI_VENDOR_INTEL
                && d->product == PCI_PRODUCT_INTEL_82801EB_AC)) {
-               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 codec i/o space\n",
-                   sc->sc_dev.dv_xname);
-               return;
-       }
-       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 device i/o space\n",
-                   sc->sc_dev.dv_xname);
-               return;
+               /*
+                * Use native mode for ICH4/ICH5
+                */
+               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",
+                                    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",
+                                    sc->sc_dev.dv_xname);
+                       return;
+               }
+       } else {
+               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 codec i/o space\n",
+                                    sc->sc_dev.dv_xname);
+                       return;
+               }
+               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 device i/o space\n",
+                                    sc->sc_dev.dv_xname);
+                       return;
+               }
        }
        sc->dmat = pa->pa_dmat;
 
diff -r 2f9c3792ef84 -r 095a809bac84 sys/dev/pci/auichreg.h
--- a/sys/dev/pci/auichreg.h    Sat Nov 22 08:32:12 2003 +0000
+++ b/sys/dev/pci/auichreg.h    Sat Nov 22 08:49:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auichreg.h,v 1.6 2003/10/30 19:33:51 kent Exp $        */
+/*     $NetBSD: auichreg.h,v 1.7 2003/11/22 08:49:41 kent Exp $        */
 
 /*
  * Copyright (c) 2000 Michael Shalayeff
@@ -43,6 +43,8 @@
 #define        ICH_NAMBAR      0x10
 /* 12.1.11 NABMBAR - native audio bus mastering base address register */
 #define        ICH_NABMBAR     0x14
+#define ICH_MMBAR      0x18    /* ICH4/ICH5 native audio mixer BAR */
+#define ICH_MBBAR      0x1c    /* ICH4/ICH5 native bus mastering BAR */
 #define ICH_CFG                0x41
 #define                ICH_CFG_IOSE    0x01
 



Home | Main Index | Thread Index | Old Index