mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00

The RISC-V IOMMU specification is now ratified as-per the RISC-V international process. The latest frozen specifcation can be found at: https://github.com/riscv-non-isa/riscv-iommu/releases/download/v1.0/riscv-iommu.pdf Add the foundation of the device emulation for RISC-V IOMMU. It includes support for s-stage (sv32, sv39, sv48, sv57 caps) and g-stage (sv32x4, sv39x4, sv48x4, sv57x4 caps). Other capabilities like ATS and DBG support will be added incrementally in the next patches. Co-developed-by: Sebastien Boeuf <seb@rivosinc.com> Signed-off-by: Sebastien Boeuf <seb@rivosinc.com> Signed-off-by: Tomasz Jeznach <tjeznach@rivosinc.com> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Jason Chien <jason.chien@sifive.com> Message-ID: <20241016204038.649340-4-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
36 lines
1.2 KiB
C
36 lines
1.2 KiB
C
/*
|
|
* QEMU emulation of an RISC-V IOMMU
|
|
*
|
|
* Copyright (C) 2022-2023 Rivos Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU General Public License,
|
|
* version 2 or later, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef HW_RISCV_IOMMU_H
|
|
#define HW_RISCV_IOMMU_H
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "qom/object.h"
|
|
|
|
#define TYPE_RISCV_IOMMU "riscv-iommu"
|
|
OBJECT_DECLARE_SIMPLE_TYPE(RISCVIOMMUState, RISCV_IOMMU)
|
|
typedef struct RISCVIOMMUState RISCVIOMMUState;
|
|
|
|
#define TYPE_RISCV_IOMMU_MEMORY_REGION "riscv-iommu-mr"
|
|
typedef struct RISCVIOMMUSpace RISCVIOMMUSpace;
|
|
|
|
#define TYPE_RISCV_IOMMU_PCI "riscv-iommu-pci"
|
|
OBJECT_DECLARE_SIMPLE_TYPE(RISCVIOMMUStatePci, RISCV_IOMMU_PCI)
|
|
typedef struct RISCVIOMMUStatePci RISCVIOMMUStatePci;
|
|
|
|
#endif
|