1 This document describes the generic device tree binding for describing the
2 relationship between PCI(e) devices and IOMMU(s).
4 Each PCI(e) device under a root complex is uniquely identified by its Requester
5 ID (AKA RID). A Requester ID is a triplet of a Bus number, Device number, and
8 For the purpose of this document, when treated as a numeric value, a RID is
11 * Bits [15:8] are the Bus number.
12 * Bits [7:3] are the Device number.
13 * Bits [2:0] are the Function number.
14 * Any other bits required for padding must be zero.
16 IOMMUs may distinguish PCI devices through sideband data derived from the
17 Requester ID. While a given PCI device can only master through one IOMMU, a
18 root complex may split masters across a set of IOMMUs (e.g. with one IOMMU per
21 The generic 'iommus' property is insufficient to describe this relationship,
22 and a mechanism is required to map from a PCI device to its IOMMU and sideband
25 For generic IOMMU bindings, see
26 Documentation/devicetree/bindings/iommu/iommu.txt.
35 - iommu-map: Maps a Requester ID to an IOMMU and associated IOMMU specifier
38 The property is an arbitrary number of tuples of
39 (rid-base,iommu,iommu-base,length).
41 Any RID r in the interval [rid-base, rid-base + length) is associated with
42 the listed IOMMU, with the IOMMU specifier (r - rid-base + iommu-base).
44 - iommu-map-mask: A mask to be applied to each Requester ID prior to being
45 mapped to an IOMMU specifier per the iommu-map property.
57 compatible = "vendor,some-iommu";
63 compatible = "vendor,pcie-root-complex";
67 * The sideband data provided to the IOMMU is the RID,
70 iommu-map = <0x0 &iommu 0x0 0x10000>;
84 compatible = "vendor,some-iommu";
90 compatible = "vendor,pcie-root-complex";
94 * The sideband data provided to the IOMMU is the RID with the
95 * function bits masked out.
97 iommu-map = <0x0 &iommu 0x0 0x10000>;
98 iommu-map-mask = <0xfff8>;
107 #address-cells = <1>;
112 compatible = "vendor,some-iommu";
118 compatible = "vendor,pcie-root-complex";
122 * The sideband data provided to the IOMMU is the RID,
123 * but the high bits of the bus number are flipped.
125 iommu-map = <0x0000 &iommu 0x8000 0x8000>,
126 <0x8000 &iommu 0x0000 0x8000>;
135 #address-cells = <1>;
140 compatible = "vendor,some-iommu";
146 compatible = "vendor,some-iommu";
152 compatible = "vendor,some-iommu";
158 compatible = "vendor,pcie-root-complex";
162 * Devices with bus number 0-127 are mastered via IOMMU
163 * a, with sideband data being RID[14:0].
164 * Devices with bus number 128-255 are mastered via
165 * IOMMU b, with sideband data being RID[14:0].
166 * No devices master via IOMMU c.
168 iommu-map = <0x0000 &iommu_a 0x0000 0x8000>,
169 <0x8000 &iommu_b 0x0000 0x8000>;