xref: /freebsd/sys/powerpc/pseries/plpar_iommu.h (revision 95ee2897)
17a8d25c0SNathan Whitehorn /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
371e3c308SPedro F. Giffuni  *
47a8d25c0SNathan Whitehorn  * Copyright (c) 2013, Nathan Whitehorn <nwhitehorn@FreeBSD.org>
57a8d25c0SNathan Whitehorn  * All rights reserved.
67a8d25c0SNathan Whitehorn  *
77a8d25c0SNathan Whitehorn  * Redistribution and use in source and binary forms, with or without
87a8d25c0SNathan Whitehorn  * modification, are permitted provided that the following conditions
97a8d25c0SNathan Whitehorn  * are met:
107a8d25c0SNathan Whitehorn  * 1. Redistributions of source code must retain the above copyright
117a8d25c0SNathan Whitehorn  *    notice unmodified, this list of conditions, and the following
127a8d25c0SNathan Whitehorn  *    disclaimer.
137a8d25c0SNathan Whitehorn  * 2. Redistributions in binary form must reproduce the above copyright
147a8d25c0SNathan Whitehorn  *    notice, this list of conditions and the following disclaimer in the
157a8d25c0SNathan Whitehorn  *    documentation and/or other materials provided with the distribution.
167a8d25c0SNathan Whitehorn  *
177a8d25c0SNathan Whitehorn  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
187a8d25c0SNathan Whitehorn  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
197a8d25c0SNathan Whitehorn  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
207a8d25c0SNathan Whitehorn  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
217a8d25c0SNathan Whitehorn  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
227a8d25c0SNathan Whitehorn  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
237a8d25c0SNathan Whitehorn  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
247a8d25c0SNathan Whitehorn  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
257a8d25c0SNathan Whitehorn  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
267a8d25c0SNathan Whitehorn  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
277a8d25c0SNathan Whitehorn  */
287a8d25c0SNathan Whitehorn 
297a8d25c0SNathan Whitehorn #ifndef _PSERIES_PHYP_IOMMU_H_
307a8d25c0SNathan Whitehorn #define _PSERIES_PHYP_IOMMU_H_
317a8d25c0SNathan Whitehorn 
327a8d25c0SNathan Whitehorn #include <sys/types.h>
337a8d25c0SNathan Whitehorn #include <sys/bus_dma.h>
347a8d25c0SNathan Whitehorn 
357a8d25c0SNathan Whitehorn int phyp_iommu_set_dma_tag(device_t dev, device_t child, bus_dma_tag_t tag);
367a8d25c0SNathan Whitehorn int phyp_iommu_map(device_t dev, bus_dma_segment_t *segs, int *nsegs,
377a8d25c0SNathan Whitehorn     bus_addr_t min, bus_addr_t max, bus_size_t alignment, bus_addr_t boundary,
387a8d25c0SNathan Whitehorn     void *cookie);
397a8d25c0SNathan Whitehorn int phyp_iommu_unmap(device_t dev, bus_dma_segment_t *segs, int nsegs,
407a8d25c0SNathan Whitehorn     void *cookie);
417a8d25c0SNathan Whitehorn 
427a8d25c0SNathan Whitehorn #endif
43