Skip to content

Commit 8447d84

Browse files
Jean-Philippe Bruckermstsirkin
authored andcommitted
dt-bindings: virtio-mmio: Add IOMMU description
The nature of a virtio-mmio node is discovered by the virtio driver at probe time. However the DMA relation between devices must be described statically. When a virtio-mmio node is a virtio-iommu device, it needs an "#iommu-cells" property as specified by bindings/iommu/iommu.txt. Otherwise, the virtio-mmio device may perform DMA through an IOMMU, which requires an "iommus" property. Describe these requirements in the device-tree bindings documentation. Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 0b4a709 commit 8447d84

File tree

1 file changed

+30
-0
lines changed
  • Documentation/devicetree/bindings/virtio

1 file changed

+30
-0
lines changed

Documentation/devicetree/bindings/virtio/mmio.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,40 @@ Required properties:
88
- reg: control registers base address and size including configuration space
99
- interrupts: interrupt generated by the device
1010

11+
Required properties for virtio-iommu:
12+
13+
- #iommu-cells: When the node corresponds to a virtio-iommu device, it is
14+
linked to DMA masters using the "iommus" or "iommu-map"
15+
properties [1][2]. #iommu-cells specifies the size of the
16+
"iommus" property. For virtio-iommu #iommu-cells must be
17+
1, each cell describing a single endpoint ID.
18+
19+
Optional properties:
20+
21+
- iommus: If the device accesses memory through an IOMMU, it should
22+
have an "iommus" property [1]. Since virtio-iommu itself
23+
does not access memory through an IOMMU, the "virtio,mmio"
24+
node cannot have both an "#iommu-cells" and an "iommus"
25+
property.
26+
1127
Example:
1228

1329
virtio_block@3000 {
1430
compatible = "virtio,mmio";
1531
reg = <0x3000 0x100>;
1632
interrupts = <41>;
33+
34+
/* Device has endpoint ID 23 */
35+
iommus = <&viommu 23>
1736
}
37+
38+
viommu: iommu@3100 {
39+
compatible = "virtio,mmio";
40+
reg = <0x3100 0x100>;
41+
interrupts = <42>;
42+
43+
#iommu-cells = <1>
44+
}
45+
46+
[1] Documentation/devicetree/bindings/iommu/iommu.txt
47+
[2] Documentation/devicetree/bindings/pci/pci-iommu.txt

0 commit comments

Comments
 (0)