Module Name: src
Committed By: mrg
Date: Wed Sep 12 03:23:38 UTC 2018
Modified Files:
src/sys/dev/pci: hdaudio_pci.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/hdaudio_pci.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/hdaudio_pci.c
diff -u src/sys/dev/pci/hdaudio_pci.c:1.8 src/sys/dev/pci/hdaudio_pci.c:1.9
--- src/sys/dev/pci/hdaudio_pci.c:1.8 Sun Jun 4 23:34:55 2017
+++ src/sys/dev/pci/hdaudio_pci.c Wed Sep 12 03:23:38 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_pci.c,v 1.8 2017/06/04 23:34:55 pgoyette Exp $ */
+/* $NetBSD: hdaudio_pci.c,v 1.9 2018/09/12 03:23:38 mrg Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <[email protected]>
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.8 2017/06/04 23:34:55 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.9 2018/09/12 03:23:38 mrg Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -107,8 +107,8 @@ hdaudio_pci_attach(device_t parent, devi
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 @@ hdaudio_pci_attach(device_t parent, devi
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,