xref: /openbmc/qemu/include/hw/sparc/sun4m_iommu.h (revision 1527f488)
1*1527f488SMark Cave-Ayland /*
2*1527f488SMark Cave-Ayland  * QEMU Sun4m iommu emulation
3*1527f488SMark Cave-Ayland  *
4*1527f488SMark Cave-Ayland  * Copyright (c) 2003-2005 Fabrice Bellard
5*1527f488SMark Cave-Ayland  *
6*1527f488SMark Cave-Ayland  * Permission is hereby granted, free of charge, to any person obtaining a copy
7*1527f488SMark Cave-Ayland  * of this software and associated documentation files (the "Software"), to deal
8*1527f488SMark Cave-Ayland  * in the Software without restriction, including without limitation the rights
9*1527f488SMark Cave-Ayland  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10*1527f488SMark Cave-Ayland  * copies of the Software, and to permit persons to whom the Software is
11*1527f488SMark Cave-Ayland  * furnished to do so, subject to the following conditions:
12*1527f488SMark Cave-Ayland  *
13*1527f488SMark Cave-Ayland  * The above copyright notice and this permission notice shall be included in
14*1527f488SMark Cave-Ayland  * all copies or substantial portions of the Software.
15*1527f488SMark Cave-Ayland  *
16*1527f488SMark Cave-Ayland  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*1527f488SMark Cave-Ayland  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*1527f488SMark Cave-Ayland  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19*1527f488SMark Cave-Ayland  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20*1527f488SMark Cave-Ayland  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21*1527f488SMark Cave-Ayland  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22*1527f488SMark Cave-Ayland  * THE SOFTWARE.
23*1527f488SMark Cave-Ayland  */
24*1527f488SMark Cave-Ayland 
25*1527f488SMark Cave-Ayland #ifndef SUN4M_IOMMU_H
26*1527f488SMark Cave-Ayland #define SUN4M_IOMMU_H
27*1527f488SMark Cave-Ayland 
28*1527f488SMark Cave-Ayland #include "qemu-common.h"
29*1527f488SMark Cave-Ayland #include "hw/sysbus.h"
30*1527f488SMark Cave-Ayland 
31*1527f488SMark Cave-Ayland #define IOMMU_NREGS         (4 * 4096 / 4)
32*1527f488SMark Cave-Ayland 
33*1527f488SMark Cave-Ayland typedef struct IOMMUState {
34*1527f488SMark Cave-Ayland     SysBusDevice parent_obj;
35*1527f488SMark Cave-Ayland 
36*1527f488SMark Cave-Ayland     AddressSpace iommu_as;
37*1527f488SMark Cave-Ayland     IOMMUMemoryRegion iommu;
38*1527f488SMark Cave-Ayland 
39*1527f488SMark Cave-Ayland     MemoryRegion iomem;
40*1527f488SMark Cave-Ayland     uint32_t regs[IOMMU_NREGS];
41*1527f488SMark Cave-Ayland     hwaddr iostart;
42*1527f488SMark Cave-Ayland     qemu_irq irq;
43*1527f488SMark Cave-Ayland     uint32_t version;
44*1527f488SMark Cave-Ayland } IOMMUState;
45*1527f488SMark Cave-Ayland 
46*1527f488SMark Cave-Ayland #define TYPE_SUN4M_IOMMU "sun4m-iommu"
47*1527f488SMark Cave-Ayland #define SUN4M_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4M_IOMMU)
48*1527f488SMark Cave-Ayland 
49*1527f488SMark Cave-Ayland #define TYPE_SUN4M_IOMMU_MEMORY_REGION "sun4m-iommu-memory-region"
50*1527f488SMark Cave-Ayland 
51*1527f488SMark Cave-Ayland #endif
52