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 * 20143598Sscottl * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21143598Sscottl * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22143598Sscottl * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23143598Sscottl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24143598Sscottl * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25143598Sscottl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26143598Sscottl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27143598Sscottl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28143598Sscottl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29143598Sscottl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30143598Sscottl * POSSIBILITY OF SUCH DAMAGE. 31143598Sscottl */ 32143598Sscottl 33143598Sscottl/*- 34143598Sscottl * Copyright (c) 1996 Charles M. Hannum. All rights reserved. 35143598Sscottl * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 36143598Sscottl * 37143598Sscottl * Redistribution and use in source and binary forms, with or without 38143598Sscottl * modification, are permitted provided that the following conditions 39143598Sscottl * are met: 40143598Sscottl * 1. Redistributions of source code must retain the above copyright 41143598Sscottl * notice, this list of conditions and the following disclaimer. 42143598Sscottl * 2. Redistributions in binary form must reproduce the above copyright 43143598Sscottl * notice, this list of conditions and the following disclaimer in the 44143598Sscottl * documentation and/or other materials provided with the distribution. 45143598Sscottl * 3. All advertising materials mentioning features or use of this software 46143598Sscottl * must display the following acknowledgement: 47143598Sscottl * This product includes software developed by Christopher G. Demetriou 48143598Sscottl * for the NetBSD Project. 49143598Sscottl * 4. The name of the author may not be used to endorse or promote products 50143598Sscottl * derived from this software without specific prior written permission 51143598Sscottl * 52143598Sscottl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 53143598Sscottl * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 54143598Sscottl * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 55143598Sscottl * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 56143598Sscottl * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 57143598Sscottl * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 58143598Sscottl * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 59143598Sscottl * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 60143598Sscottl * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 61143598Sscottl * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 62143598Sscottl * 63143598Sscottl * $FreeBSD: stable/11/sys/arm/include/bus_dma.h 314506 2017-03-01 19:55:04Z ian $ 64143598Sscottl */ 65143598Sscottl 66143598Sscottl#ifndef _ARM_BUS_DMA_H 67143598Sscottl#define _ARM_BUS_DMA_H 68143598Sscottl 69143598Sscottl#include <sys/bus_dma.h> 70143598Sscottl 71143598Sscottl/* Bus Space DMA macros */ 72143598Sscottl 73143598Sscottl#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) 74143598Sscottl 75314506Sian#if defined(_ARM32_BUS_DMA_PRIVATE) && __ARM_ARCH < 6 76143598Sscottl/* 77143598Sscottl * arm32_dma_range 78143598Sscottl * 79143598Sscottl * This structure describes a valid DMA range. 80143598Sscottl */ 81143598Sscottlstruct arm32_dma_range { 82143598Sscottl bus_addr_t dr_sysbase; /* system base address */ 83143598Sscottl bus_addr_t dr_busbase; /* appears here on bus */ 84143598Sscottl bus_size_t dr_len; /* length of range */ 85143598Sscottl}; 86143598Sscottl 87143598Sscottl/* _dm_buftype */ 88143598Sscottl#define ARM32_BUFTYPE_INVALID 0 89143598Sscottl#define ARM32_BUFTYPE_LINEAR 1 90143598Sscottl#define ARM32_BUFTYPE_MBUF 2 91143598Sscottl#define ARM32_BUFTYPE_UIO 3 92143598Sscottl#define ARM32_BUFTYPE_RAW 4 93143598Sscottl 94143598Sscottlstruct arm32_dma_range *bus_dma_get_range(void); 95143598Sscottlint bus_dma_get_range_nb(void); 96143598Sscottl 97143598Sscottl#endif /* _ARM32_BUS_DMA_PRIVATE */ 98143598Sscottl 99143598Sscottl#endif /* _ARM_BUS_DMA_H */ 100