RISC-V IOMMU Architecture Implementation
Schema identifier ($id): "http://devicetree.org/schemas/iommu/riscv,iommu.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Tomasz Jeznach <tjeznach@rivosinc.com>"
The RISC-V IOMMU provides memory address translation and isolation for input and output devices, supporting per-device translation context, shared process address spaces including the ATS and PRI components of the PCIe specification, two stage address translation and MSI remapping. It supports identical translation table format to the RISC-V address translation tables with page level access and protection attributes. Hardware uses in-memory command and fault reporting queues with wired interrupt or MSI notifications.
Visit https://github.com/riscv-non-isa/riscv-iommu for more details.
For information on assigning RISC-V IOMMU to its peripheral devices, see generic IOMMU bindings.
Properties and child nodes (properties) #
compatible — required here #
Exactly one of these rules must match (oneOf) #
Rule 1
Array item rules (
items)Item 1
Item 2
Exact value (
const):"riscv,iommu"
Rule 2
Array item rules (
items)Item 1
Item 2
Exact value (
const):"riscv,pci-iommu"
reg — required here #
Maximum number of items (maxItems): 1
For non-PCI devices this represents base address and size of for the IOMMU memory mapped registers interface. For PCI IOMMU hardware implementation this should represent an address of the IOMMU, as defined in the PCI Bus Binding reference.
#iommu-cells — required here #
Exact value (const): 1
The single cell describes the requester id emitted by a master to the IOMMU.
interrupts — not listed as required here #
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 4
Wired interrupt vectors available for RISC-V IOMMU to notify the RISC-V HARTS. The cause to interrupt vector is software defined using IVEC IOMMU register.
msi-parent — not listed as required here #
true — No constraints added by this property rule.
power-domains — not listed as required here #
Maximum number of items (maxItems): 1
Required in this object (required): "compatible", "reg", "#iommu-cells"
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Examples (examples) #
/* Example 1 (IOMMU device with wired interrupts) */
#include <dt-bindings/interrupt-controller/irq.h>
iommu1: iommu@1bccd000 {
compatible = "qemu,riscv-iommu", "riscv,iommu";
reg = <0x1bccd000 0x1000>;
interrupt-parent = <&aplic_smode>;
interrupts = <32 IRQ_TYPE_LEVEL_HIGH>,
<33 IRQ_TYPE_LEVEL_HIGH>,
<34 IRQ_TYPE_LEVEL_HIGH>,
<35 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
};
/* Device with two IOMMU device IDs, 0 and 7 */
master1 {
iommus = <&iommu1 0>, <&iommu1 7>;
};
/* Example 2 (IOMMU device with shared wired interrupt) */
#include <dt-bindings/interrupt-controller/irq.h>
iommu2: iommu@1bccd000 {
compatible = "qemu,riscv-iommu", "riscv,iommu";
reg = <0x1bccd000 0x1000>;
interrupt-parent = <&aplic_smode>;
interrupts = <32 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
};
/* Example 3 (IOMMU device with MSIs) */
iommu3: iommu@1bcdd000 {
compatible = "qemu,riscv-iommu", "riscv,iommu";
reg = <0x1bccd000 0x1000>;
msi-parent = <&imsics_smode>;
#iommu-cells = <1>;
};
/* Example 4 (IOMMU PCIe device with MSIs) */
bus {
#address-cells = <2>;
#size-cells = <2>;
pcie@30000000 {
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
reg = <0x0 0x30000000 0x0 0x1000000>;
ranges = <0x02000000 0x0 0x41000000 0x0 0x41000000 0x0 0x0f000000>;
/*
* The IOMMU manages all functions in this PCI domain except
* itself. Omit BDF 00:01.0.
*/
iommu-map = <0x0 &iommu0 0x0 0x8>,
<0x9 &iommu0 0x9 0xfff7>;
/* The IOMMU programming interface uses slot 00:01.0 */
iommu0: iommu@1,0 {
compatible = "pci1efd,edf1", "riscv,pci-iommu";
reg = <0x800 0 0 0 0>;
#iommu-cells = <1>;
};
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
Line 28: For PCIe IOMMU hardware compatible property should contain the vendor
Line 29: and device ID according to the PCI Bus Binding specification.
Line 30: Since PCI provides built-in identification methods, compatible is not
Line 31: actually required. For non-PCIe hardware implementations 'riscv,iommu'
Line 32: should be specified along with 'reg' property providing MMIO location.