xref: /qemu/include/hw/riscv/iommu.h (revision 60a07d4a6e65f51916a417adb5e56b3f7b38ed22)
10c54acb8STomasz Jeznach /*
20c54acb8STomasz Jeznach  * QEMU emulation of an RISC-V IOMMU
30c54acb8STomasz Jeznach  *
40c54acb8STomasz Jeznach  * Copyright (C) 2022-2023 Rivos Inc.
50c54acb8STomasz Jeznach  *
60c54acb8STomasz Jeznach  * This program is free software; you can redistribute it and/or modify it
70c54acb8STomasz Jeznach  * under the terms and conditions of the GNU General Public License,
80c54acb8STomasz Jeznach  * version 2 or later, as published by the Free Software Foundation.
90c54acb8STomasz Jeznach  *
100c54acb8STomasz Jeznach  * This program is distributed in the hope that it will be useful,
110c54acb8STomasz Jeznach  * but WITHOUT ANY WARRANTY; without even the implied warranty of
120c54acb8STomasz Jeznach  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
130c54acb8STomasz Jeznach  * GNU General Public License for more details.
140c54acb8STomasz Jeznach  *
150c54acb8STomasz Jeznach  * You should have received a copy of the GNU General Public License along
160c54acb8STomasz Jeznach  * with this program; if not, see <http://www.gnu.org/licenses/>.
170c54acb8STomasz Jeznach  */
180c54acb8STomasz Jeznach 
190c54acb8STomasz Jeznach #ifndef HW_RISCV_IOMMU_H
200c54acb8STomasz Jeznach #define HW_RISCV_IOMMU_H
210c54acb8STomasz Jeznach 
220c54acb8STomasz Jeznach #include "qemu/osdep.h"
230c54acb8STomasz Jeznach #include "qom/object.h"
240c54acb8STomasz Jeznach 
250c54acb8STomasz Jeznach #define TYPE_RISCV_IOMMU "riscv-iommu"
260c54acb8STomasz Jeznach OBJECT_DECLARE_SIMPLE_TYPE(RISCVIOMMUState, RISCV_IOMMU)
270c54acb8STomasz Jeznach typedef struct RISCVIOMMUState RISCVIOMMUState;
280c54acb8STomasz Jeznach 
290c54acb8STomasz Jeznach #define TYPE_RISCV_IOMMU_MEMORY_REGION "riscv-iommu-mr"
300c54acb8STomasz Jeznach typedef struct RISCVIOMMUSpace RISCVIOMMUSpace;
310c54acb8STomasz Jeznach 
320c54acb8STomasz Jeznach #define TYPE_RISCV_IOMMU_PCI "riscv-iommu-pci"
33*9afd2671SDaniel Henrique Barboza OBJECT_DECLARE_TYPE(RISCVIOMMUStatePci, RISCVIOMMUPciClass, RISCV_IOMMU_PCI)
340c54acb8STomasz Jeznach typedef struct RISCVIOMMUStatePci RISCVIOMMUStatePci;
35*9afd2671SDaniel Henrique Barboza typedef struct RISCVIOMMUPciClass RISCVIOMMUPciClass;
360c54acb8STomasz Jeznach 
375b128435STomasz Jeznach #define TYPE_RISCV_IOMMU_SYS "riscv-iommu-device"
38*9afd2671SDaniel Henrique Barboza OBJECT_DECLARE_TYPE(RISCVIOMMUStateSys, RISCVIOMMUSysClass, RISCV_IOMMU_SYS)
395b128435STomasz Jeznach typedef struct RISCVIOMMUStateSys RISCVIOMMUStateSys;
40*9afd2671SDaniel Henrique Barboza typedef struct RISCVIOMMUSysClass RISCVIOMMUSysClass;
415b128435STomasz Jeznach 
422c12de14SSunil V L #define FDT_IRQ_TYPE_EDGE_LOW 1
432c12de14SSunil V L 
440c54acb8STomasz Jeznach #endif
45