1 /* $NetBSD: ixp425_pci_dma.c,v 1.3 2005/12/11 12:16:51 christos Exp $ */
5 * Ichiro FUKUHARA <ichiro@ichiro.org>.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 #include <sys/cdefs.h>
31 __KERNEL_RCSID(0, "$NetBSD: ixp425_pci_dma.c,v 1.3 2005/12/11 12:16:51 christos Exp $");
33 #include <sys/param.h>
34 #include <sys/systm.h>
35 #include <sys/device.h>
36 #include <sys/malloc.h>
39 #include <uvm/uvm_extern.h>
41 #define _ARM32_BUS_DMA_PRIVATE
42 #include <machine/bus.h>
44 #include <arm/xscale/ixp425reg.h>
45 #include <arm/xscale/ixp425var.h>
48 ixp425_pci_dma_init(struct ixp425_softc
*sc
)
50 extern paddr_t physical_start
, physical_end
;
52 bus_dma_tag_t dmat
= &sc
->ia_pci_dmat
;
53 struct arm32_dma_range
*dr
= &sc
->ia_pci_dma_range
;
58 dr
->dr_sysbase
= physical_start
;
59 dr
->dr_busbase
= physical_start
;
60 dr
->dr_len
= physical_end
- physical_start
;
62 dmat
->_dmamap_create
= _bus_dmamap_create
;
63 dmat
->_dmamap_destroy
= _bus_dmamap_destroy
;
64 dmat
->_dmamap_load
= _bus_dmamap_load
;
65 dmat
->_dmamap_load_mbuf
= _bus_dmamap_load_mbuf
;
66 dmat
->_dmamap_load_uio
= _bus_dmamap_load_uio
;
67 dmat
->_dmamap_load_raw
= _bus_dmamap_load_raw
;
68 dmat
->_dmamap_unload
= _bus_dmamap_unload
;
69 dmat
->_dmamap_sync_pre
= _bus_dmamap_sync
;
70 dmat
->_dmamap_sync_post
= NULL
;
72 dmat
->_dmamem_alloc
= _bus_dmamem_alloc
;
73 dmat
->_dmamem_free
= _bus_dmamem_free
;
74 dmat
->_dmamem_map
= _bus_dmamem_map
;
75 dmat
->_dmamem_unmap
= _bus_dmamem_unmap
;
76 dmat
->_dmamem_mmap
= _bus_dmamem_mmap
;