Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/xscale Move the DMA tag initialization function...
details: https://anonhg.NetBSD.org/src/rev/f4be9c715f85
branches: trunk
changeset: 534673:f4be9c715f85
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Aug 01 19:40:07 2002 +0000
description:
Move the DMA tag initialization functions into i80321.c.
diffstat:
sys/arch/arm/xscale/files.i80321 | 4 +-
sys/arch/arm/xscale/i80321.c | 81 ++++++++++++++++++++++++++++++--
sys/arch/arm/xscale/i80321_local_dma.c | 77 -------------------------------
sys/arch/arm/xscale/i80321_pci_dma.c | 83 ----------------------------------
sys/arch/arm/xscale/i80321var.h | 6 +--
5 files changed, 76 insertions(+), 175 deletions(-)
diffs (truncated from 341 to 300 lines):
diff -r d5a01b7670c1 -r f4be9c715f85 sys/arch/arm/xscale/files.i80321
--- a/sys/arch/arm/xscale/files.i80321 Thu Aug 01 18:52:06 2002 +0000
+++ b/sys/arch/arm/xscale/files.i80321 Thu Aug 01 19:40:07 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.i80321,v 1.5 2002/07/29 18:40:04 thorpej Exp $
+# $NetBSD: files.i80321,v 1.6 2002/08/01 19:40:07 thorpej Exp $
#
# Configuration info for Intel i80321 XScale I/O Processor support
#
@@ -12,9 +12,7 @@
# Board-specific front-end provides attachment.
file arch/arm/xscale/i80321.c iopxs
file arch/arm/xscale/i80321_pci.c iopxs
-file arch/arm/xscale/i80321_pci_dma.c iopxs
file arch/arm/xscale/i80321_space.c iopxs
-file arch/arm/xscale/i80321_local_dma.c iopxs
# Watchdog timer
device iopwdog: sysmon_wdog
diff -r d5a01b7670c1 -r f4be9c715f85 sys/arch/arm/xscale/i80321.c
--- a/sys/arch/arm/xscale/i80321.c Thu Aug 01 18:52:06 2002 +0000
+++ b/sys/arch/arm/xscale/i80321.c Thu Aug 01 19:40:07 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i80321.c,v 1.5 2002/07/31 17:34:25 thorpej Exp $ */
+/* $NetBSD: i80321.c,v 1.6 2002/08/01 19:40:08 thorpej Exp $ */
/*
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -43,6 +43,7 @@
#include <sys/systm.h>
#include <sys/device.h>
+#define _ARM32_BUS_DMA_PRIVATE
#include <machine/bus.h>
#include <arm/xscale/i80321reg.h>
@@ -61,8 +62,8 @@
*/
struct i80321_softc *i80321_softc;
-int i80321_iopxs_print(void *, const char *);
-int i80321_pcibus_print(void *, const char *);
+static int i80321_iopxs_print(void *, const char *);
+static int i80321_pcibus_print(void *, const char *);
/* Built-in devices. */
static const struct iopxs_device {
@@ -77,6 +78,9 @@
{ NULL, 0, 0 }
};
+static void i80321_pci_dma_init(struct i80321_softc *);
+static void i80321_local_dma_init(struct i80321_softc *);
+
/*
* i80321_attach:
*
@@ -204,8 +208,8 @@
i80321_pci_init(&sc->sc_pci_chipset, sc);
/* Initialize the DMA tags. */
- i80321_pci_dma_init(&sc->sc_pci_dmat, sc);
- i80321_local_dma_init(&sc->sc_local_dmat, sc);
+ i80321_pci_dma_init(sc);
+ i80321_local_dma_init(sc);
/*
* Attach all the IOP built-ins.
@@ -248,7 +252,7 @@
* Autoconfiguration cfprint routine when attaching
* to the "iopxs" device.
*/
-int
+static int
i80321_iopxs_print(void *aux, const char *pnp)
{
@@ -261,7 +265,7 @@
* Autoconfiguration cfprint routine when attaching
* to the "pcibus" attribute.
*/
-int
+static int
i80321_pcibus_print(void *aux, const char *pnp)
{
struct pcibus_attach_args *pba = aux;
@@ -273,3 +277,66 @@
return (UNCONF);
}
+
+/*
+ * i80321_pci_dma_init:
+ *
+ * Initialize the PCI DMA tag.
+ */
+static void
+i80321_pci_dma_init(struct i80321_softc *sc)
+{
+ bus_dma_tag_t dmat = &sc->sc_pci_dmat;
+ struct arm32_dma_range *dr = &sc->sc_pci_dma_range;
+
+ dr->dr_sysbase = sc->sc_iwin[2].iwin_xlate;
+ dr->dr_busbase = PCI_MAPREG_MEM_ADDR(sc->sc_iwin[2].iwin_base_lo);
+ dr->dr_len = sc->sc_iwin[2].iwin_size;
+
+ dmat->_ranges = dr;
+ dmat->_nranges = 1;
+
+ dmat->_dmamap_create = _bus_dmamap_create;
+ dmat->_dmamap_destroy = _bus_dmamap_destroy;
+ dmat->_dmamap_load = _bus_dmamap_load;
+ dmat->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
+ dmat->_dmamap_load_uio = _bus_dmamap_load_uio;
+ dmat->_dmamap_load_raw = _bus_dmamap_load_raw;
+ dmat->_dmamap_unload = _bus_dmamap_unload;
+ dmat->_dmamap_sync = _bus_dmamap_sync;
+
+ dmat->_dmamem_alloc = _bus_dmamem_alloc;
+ dmat->_dmamem_free = _bus_dmamem_free;
+ dmat->_dmamem_map = _bus_dmamem_map;
+ dmat->_dmamem_unmap = _bus_dmamem_unmap;
+ dmat->_dmamem_mmap = _bus_dmamem_mmap;
+}
+
+/*
+ * i80321_local_dma_init:
+ *
+ * Initialize the local DMA tag.
+ */
+static void
+i80321_local_dma_init(struct i80321_softc *sc)
+{
+ bus_dma_tag_t dmat = &sc->sc_local_dmat;
+
+ dmat->_ranges = NULL;
+ dmat->_nranges = 0;
+
+ dmat->_dmamap_create = _bus_dmamap_create;
+ dmat->_dmamap_destroy = _bus_dmamap_destroy;
+ dmat->_dmamap_load = _bus_dmamap_load;
+ dmat->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
+ dmat->_dmamap_load_uio = _bus_dmamap_load_uio;
+ dmat->_dmamap_load_raw = _bus_dmamap_load_raw;
+ dmat->_dmamap_unload = _bus_dmamap_unload;
+ dmat->_dmamap_sync = _bus_dmamap_sync;
+
+ dmat->_dmamem_alloc = _bus_dmamem_alloc;
+ dmat->_dmamem_free = _bus_dmamem_free;
+ dmat->_dmamem_map = _bus_dmamem_map;
+ dmat->_dmamem_unmap = _bus_dmamem_unmap;
+ dmat->_dmamem_mmap = _bus_dmamem_mmap;
+}
diff -r d5a01b7670c1 -r f4be9c715f85 sys/arch/arm/xscale/i80321_local_dma.c
--- a/sys/arch/arm/xscale/i80321_local_dma.c Thu Aug 01 18:52:06 2002 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/* $NetBSD: i80321_local_dma.c,v 1.3 2002/07/31 17:34:25 thorpej Exp $ */
-
-/*
- * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Jason R. Thorpe for Wasabi Systems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Local DMA support for i80321 I/O Processor chip.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-
-#include <uvm/uvm_extern.h>
-
-#define _ARM32_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-
-#include <arm/xscale/i80321reg.h>
-#include <arm/xscale/i80321var.h>
-
-void
-i80321_local_dma_init(bus_dma_tag_t dmat, void *cookie)
-{
-
- dmat->_ranges = NULL;
- dmat->_nranges = 0;
-
- dmat->_dmamap_create = _bus_dmamap_create;
- dmat->_dmamap_destroy = _bus_dmamap_destroy;
- dmat->_dmamap_load = _bus_dmamap_load;
- dmat->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
- dmat->_dmamap_load_uio = _bus_dmamap_load_uio;
- dmat->_dmamap_load_raw = _bus_dmamap_load_raw;
- dmat->_dmamap_unload = _bus_dmamap_unload;
- dmat->_dmamap_sync = _bus_dmamap_sync;
-
- dmat->_dmamem_alloc = _bus_dmamem_alloc;
- dmat->_dmamem_free = _bus_dmamem_free;
- dmat->_dmamem_map = _bus_dmamem_map;
- dmat->_dmamem_unmap = _bus_dmamem_unmap;
- dmat->_dmamem_mmap = _bus_dmamem_mmap;
-}
diff -r d5a01b7670c1 -r f4be9c715f85 sys/arch/arm/xscale/i80321_pci_dma.c
--- a/sys/arch/arm/xscale/i80321_pci_dma.c Thu Aug 01 18:52:06 2002 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/* $NetBSD: i80321_pci_dma.c,v 1.5 2002/07/31 17:34:25 thorpej Exp $ */
-
-/*
- * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Jason R. Thorpe for Wasabi Systems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * PCI DMA support for i80321 I/O Processor chip.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-
-#include <uvm/uvm_extern.h>
-
-#define _ARM32_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-
-#include <arm/xscale/i80321reg.h>
-#include <arm/xscale/i80321var.h>
-
-void
-i80321_pci_dma_init(bus_dma_tag_t dmat, void *cookie)
-{
- struct i80321_softc *sc = cookie;
- struct arm32_dma_range *dr = &sc->sc_pci_dma_range;
-
- dr->dr_sysbase = sc->sc_iwin[2].iwin_xlate;
Home |
Main Index |
Thread Index |
Old Index