Skip to content

Commit 80739b6

Browse files
vijayanandjitta-ossrobherring
authored andcommitted
schemas: pci: pci-iommu: support variable-length iommu-specifier
The iommu-map tuple size is variable: the iommu-specifier length is determined by the #iommu-cells property of the referenced IOMMU node (e.g. 4 cells total for #iommu-cells = <1>, 5 cells for #iommu-cells = <2>). Update the iommu-map description to document the tuple format (rid-base, iommu, iommu-specifier, rid-length) and clarify that the iommu-specifier length depends on #iommu-cells. Remove the items validation as it cannot handle variable-length rows. Add an example with a 2-cell iommu-specifier and multiple iommu-map entries. [1] https://lore.kernel.org/all/20260331-parse_iommu_cells-v12-3-decfd305eea9@oss.qualcomm.com/ Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
1 parent e56d0c4 commit 80739b6

1 file changed

Lines changed: 33 additions & 11 deletions

File tree

dtschema/schemas/pci/pci-iommu.yaml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,14 @@ properties:
4343
Maps a Requester ID to an IOMMU and associated IOMMU specifier data.
4444
4545
The property is an arbitrary number of tuples of
46-
(rid-base,iommu,iommu-base,length).
46+
(rid-base, iommu, iommu-specifier, rid-length).
4747
48-
Any RID r in the interval [rid-base, rid-base + length) is associated with
49-
the listed IOMMU, with the IOMMU specifier (r - rid-base + iommu-base).
48+
The length of the iommu-specifier is determined by the #iommu-cells
49+
property of the associated IOMMU node.
50+
51+
Any RID r in the interval [rid-base, rid-base + length) is associated
52+
with the listed IOMMU, with the IOMMU specifier (r - rid-base + iommu-base).
5053
$ref: /schemas/types.yaml#/definitions/uint32-matrix
51-
items:
52-
items:
53-
- description: RID base
54-
maximum: 0xffff
55-
- description: phandle to IOMMU
56-
- description: IOMMU specifier base (currently always 1 cell)
57-
- description: Number of RIDs
58-
maximum: 0x10000
5954

6055
iommu-map-mask:
6156
description:
@@ -180,4 +175,31 @@ examples:
180175
<0x8000 &iommu_b 0x0000 0x8000>;
181176
};
182177
};
178+
179+
- |
180+
/ {
181+
#address-cells = <1>;
182+
#size-cells = <1>;
183+
184+
iommu: iommu@a {
185+
reg = <0xa 0x1>;
186+
compatible = "foo,some-iommu";
187+
#iommu-cells = <2>;
188+
};
189+
190+
pci: pci@f {
191+
reg = <0xf 0x1>;
192+
compatible = "foo,pcie-root-complex";
193+
device_type = "pci";
194+
195+
/*
196+
* The IOMMU uses 2-cell specifiers (#iommu-cells = <2>).
197+
* Each iommu-map entry has 5 cells:
198+
* (rid-base, iommu, iommu-specifier[0], iommu-specifier[1], length)
199+
* Multiple entries are supported.
200+
*/
201+
iommu-map = <0x0000 &iommu 0x0 0x0 0x8000>,
202+
<0x8000 &iommu 0x0 0x1 0x8000>;
203+
};
204+
};
183205
...

0 commit comments

Comments
 (0)