Module Name: src
Committed By: cliff
Date: Sat Apr 17 07:34:08 UTC 2010
Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_pcix.c
Log Message:
- in rmixl_pcix_attach() use bus_dmatag_subregion() to set up
bounce buffering for non-DMA-accessible RAM addrs
To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_pcix.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/arch/mips/rmi/rmixl_pcix.c
diff -u src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.4 src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.5
--- src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.4 Fri Apr 16 23:44:17 2010
+++ src/sys/arch/mips/rmi/rmixl_pcix.c Sat Apr 17 07:34:08 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: rmixl_pcix.c,v 1.1.2.4 2010/04/16 23:44:17 cliff Exp $ */
+/* $NetBSD: rmixl_pcix.c,v 1.1.2.5 2010/04/17 07:34:08 cliff Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_pcix.c,v 1.1.2.4 2010/04/16 23:44:17 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_pcix.c,v 1.1.2.5 2010/04/17 07:34:08 cliff Exp $");
#include "opt_pci.h"
#include "pci.h"
@@ -351,6 +351,8 @@
hbar_size |= (uint64_t)hbar_size_hi << 32;
}
if ((hbar_addr != 0) || (hbar_size < mem_cluster_maxaddr)) {
+ int error;
+
aprint_error_dev(self, "HostBAR0 addr %#x, size %#x\n",
hbar_addr_lo, hbar_size_lo);
if ((hbar_size_lo & PCI_MAPREG_MEM_TYPE_64BIT) != 0)
@@ -361,12 +363,24 @@
"enabling DMA bounce buffers\n",
hbar_size, mem_cluster_maxaddr-1);
- /* force use of bouce buffers for uncovered RAM */
+ /*
+ * force use of bouce buffers for inaccessible RAM addrs
+ */
if (hbar_size < ((uint64_t)1 << 32)) {
+ error = bus_dmatag_subregion(sc->sc_32bit_dmat,
+ 0, (bus_addr_t)hbar_size, &sc->sc_32bit_dmat,
+ BUS_DMA_NOWAIT);
+ if (error)
+ panic("%s: failed to subregion 32-bit dma tag:"
+ " error %d", __func__, error);
sc->sc_64bit_dmat = NULL;
- sc->sc_32bit_dmat->_bounce_alloc_hi = hbar_size;
} else {
- sc->sc_64bit_dmat->_bounce_alloc_hi = hbar_size;
+ error = bus_dmatag_subregion(sc->sc_64bit_dmat,
+ 0, (bus_addr_t)hbar_size, &sc->sc_64bit_dmat,
+ BUS_DMA_NOWAIT);
+ if (error)
+ panic("%s: failed to subregion 64-bit dma tag:"
+ " error %d", __func__, error);
}
}