bus_dma.h revision 143598
1143598Sscottl/*	$NetBSD: bus.h,v 1.11 2003/07/28 17:35:54 thorpej Exp $	*/
2143598Sscottl
3143598Sscottl/*-
4143598Sscottl * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
5143598Sscottl * All rights reserved.
6143598Sscottl *
7143598Sscottl * This code is derived from software contributed to The NetBSD Foundation
8143598Sscottl * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9143598Sscottl * NASA Ames Research Center.
10143598Sscottl *
11143598Sscottl * Redistribution and use in source and binary forms, with or without
12143598Sscottl * modification, are permitted provided that the following conditions
13143598Sscottl * are met:
14143598Sscottl * 1. Redistributions of source code must retain the above copyright
15143598Sscottl *    notice, this list of conditions and the following disclaimer.
16143598Sscottl * 2. Redistributions in binary form must reproduce the above copyright
17143598Sscottl *    notice, this list of conditions and the following disclaimer in the
18143598Sscottl *    documentation and/or other materials provided with the distribution.
19143598Sscottl * 3. All advertising materials mentioning features or use of this software
20143598Sscottl *    must display the following acknowledgement:
21143598Sscottl *	This product includes software developed by the NetBSD
22143598Sscottl *	Foundation, Inc. and its contributors.
23143598Sscottl * 4. Neither the name of The NetBSD Foundation nor the names of its
24143598Sscottl *    contributors may be used to endorse or promote products derived
25143598Sscottl *    from this software without specific prior written permission.
26143598Sscottl *
27143598Sscottl * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28143598Sscottl * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29143598Sscottl * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30143598Sscottl * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31143598Sscottl * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32143598Sscottl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33143598Sscottl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34143598Sscottl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35143598Sscottl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36143598Sscottl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37143598Sscottl * POSSIBILITY OF SUCH DAMAGE.
38143598Sscottl */
39143598Sscottl
40143598Sscottl/*-
41143598Sscottl * Copyright (c) 1996 Charles M. Hannum.  All rights reserved.
42143598Sscottl * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
43143598Sscottl *
44143598Sscottl * Redistribution and use in source and binary forms, with or without
45143598Sscottl * modification, are permitted provided that the following conditions
46143598Sscottl * are met:
47143598Sscottl * 1. Redistributions of source code must retain the above copyright
48143598Sscottl *    notice, this list of conditions and the following disclaimer.
49143598Sscottl * 2. Redistributions in binary form must reproduce the above copyright
50143598Sscottl *    notice, this list of conditions and the following disclaimer in the
51143598Sscottl *    documentation and/or other materials provided with the distribution.
52143598Sscottl * 3. All advertising materials mentioning features or use of this software
53143598Sscottl *    must display the following acknowledgement:
54143598Sscottl *      This product includes software developed by Christopher G. Demetriou
55143598Sscottl *	for the NetBSD Project.
56143598Sscottl * 4. The name of the author may not be used to endorse or promote products
57143598Sscottl *    derived from this software without specific prior written permission
58143598Sscottl *
59143598Sscottl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
60143598Sscottl * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
61143598Sscottl * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
62143598Sscottl * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
63143598Sscottl * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
64143598Sscottl * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
65143598Sscottl * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
66143598Sscottl * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
67143598Sscottl * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
68143598Sscottl * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
69143598Sscottl *
70143598Sscottl * $FreeBSD: head/sys/arm/include/bus_dma.h 143598 2005-03-14 16:46:28Z scottl $
71143598Sscottl */
72143598Sscottl
73143598Sscottl#ifndef _ARM_BUS_DMA_H
74143598Sscottl#define _ARM_BUS_DMA_H
75143598Sscottl
76143598Sscottl#include <sys/bus_dma.h>
77143598Sscottl
78143598Sscottl/* Bus Space DMA macros */
79143598Sscottl
80143598Sscottl#define BUS_DMA_TAG_VALID(t)    ((t) != (bus_dma_tag_t)0)
81143598Sscottl
82143598Sscottl#ifdef _ARM32_BUS_DMA_PRIVATE
83143598Sscottl/*
84143598Sscottl *	arm32_dma_range
85143598Sscottl *
86143598Sscottl *	This structure describes a valid DMA range.
87143598Sscottl */
88143598Sscottlstruct arm32_dma_range {
89143598Sscottl	bus_addr_t	dr_sysbase;	/* system base address */
90143598Sscottl	bus_addr_t	dr_busbase;	/* appears here on bus */
91143598Sscottl	bus_size_t	dr_len;		/* length of range */
92143598Sscottl};
93143598Sscottl
94143598Sscottl/* _dm_buftype */
95143598Sscottl#define	ARM32_BUFTYPE_INVALID		0
96143598Sscottl#define	ARM32_BUFTYPE_LINEAR		1
97143598Sscottl#define	ARM32_BUFTYPE_MBUF		2
98143598Sscottl#define	ARM32_BUFTYPE_UIO		3
99143598Sscottl#define	ARM32_BUFTYPE_RAW		4
100143598Sscottl
101143598Sscottlstruct arm32_dma_range	*bus_dma_get_range(void);
102143598Sscottlint	bus_dma_get_range_nb(void);
103143598Sscottl
104143598Sscottl#endif /* _ARM32_BUS_DMA_PRIVATE */
105143598Sscottl
106143598Sscottl#endif /* _ARM_BUS_DMA_H */
107