Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/pci Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/693c2f26b47f
branches:  netbsd-8
changeset: 851997:693c2f26b47f
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 23 17:22:51 2018 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1022):

        sys/dev/pci/hdaudio_pci.c: revision 1.9
        sys/dev/pci/hdaudio_pci.c: revision 1.10

use pci_mapreg_type() instead of assuming PCI_MAPREG_TYPE_MEM.
suggested by riastradh@.

fixes hdaudio on thinkpad P51 where the registers are mapped
over 4GB range.  probably fixes intel X10-based systems that
map hdaudio high as well, but i was able to work around that
in the BIOS.  not so for the P51.

XXX: pullup-7, pullup-8.

use pa_dmat64 if pci_dma64_available().

diffstat:

 sys/dev/pci/hdaudio_pci.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r 494bec5aa21d -r 693c2f26b47f sys/dev/pci/hdaudio_pci.c
--- a/sys/dev/pci/hdaudio_pci.c Sun Sep 23 17:20:08 2018 +0000
+++ b/sys/dev/pci/hdaudio_pci.c Sun Sep 23 17:22:51 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_pci.c,v 1.7.2.1 2017/06/05 08:13:05 snj Exp $ */
+/* $NetBSD: hdaudio_pci.c,v 1.7.2.2 2018/09/23 17:22:51 martin Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.7.2.1 2017/06/05 08:13:05 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.7.2.2 2018/09/23 17:22:51 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -107,8 +107,8 @@
        struct hdaudio_pci_softc *sc = device_private(self);
        struct pci_attach_args *pa = opaque;
        const char *intrstr;
-       pcireg_t csr;
-       int err;
+       pcireg_t csr, maptype;
+       int err, reg;
        char intrbuf[PCI_INTRSTR_LEN];
 
        aprint_naive("\n");
@@ -127,7 +127,9 @@
        pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG, csr);
 
        /* Map MMIO registers */
-       err = pci_mapreg_map(pa, HDAUDIO_PCI_AZBARL, PCI_MAPREG_TYPE_MEM, 0,
+       reg = HDAUDIO_PCI_AZBARL;
+       maptype = pci_mapreg_type(sc->sc_pc, sc->sc_tag, reg);
+       err = pci_mapreg_map(pa, reg, maptype, 0,
                             &sc->sc_hdaudio.sc_memt,
                             &sc->sc_hdaudio.sc_memh,
                             &sc->sc_hdaudio.sc_membase,
@@ -137,7 +139,10 @@
                return;
        }
        sc->sc_hdaudio.sc_memvalid = true;
-       sc->sc_hdaudio.sc_dmat = pa->pa_dmat;
+       if (pci_dma64_available(pa))
+               sc->sc_hdaudio.sc_dmat = pa->pa_dmat64;
+       else
+               sc->sc_hdaudio.sc_dmat = pa->pa_dmat;
 
        /* Map interrupt and establish handler */
        if (pci_intr_alloc(pa, &sc->sc_pihp, NULL, 0)) {



Home | Main Index | Thread Index | Old Index