devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC: extend iommu-map binding to support #iommu-cells > 1
@ 2016-12-16  2:36 Stuart Yoder
       [not found] ` <VI1PR0401MB2638DE2D30F8423F6F8C7A6E8D9C0-9IDQY6o3qQjcXZ0H4ZLnAo3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Stuart Yoder @ 2016-12-16  2:36 UTC (permalink / raw)
  To: Mark Rutland, robin.murphy-5wv7dgnIgG8@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

For context, please see the thread:
https://www.spinics.net/lists/arm-kernel/msg539066.html

The existing iommu-map binding did not account for the situation where
#iommu-cells == 2, as permitted in the ARM SMMU binding.  The 2nd cell
of the IOMMU specifier being the SMR mask.  The existing binding defines
the mapping as:
   Any RID r in the interval [rid-base, rid-base + length) is associated with
   the listed IOMMU, with the iommu-specifier (r - rid-base + iommu-base).

...and that does not work if iommu-base is 2 cells, the second being the
SMR mask.

While this can be worked around by always having length=1, it seems we
can get this cleaned up by updating the binding definition for iommu-map.

See patch below.  Thoughts?

Thanks,
Stuart

-------------------------------------------------------------------------

diff --git a/Documentation/devicetree/bindings/pci/pci-iommu.txt b/Documentation/devicetree/bindings/pci/pci-iommu.txt
index 56c8296..e81b461 100644
--- a/Documentation/devicetree/bindings/pci/pci-iommu.txt
+++ b/Documentation/devicetree/bindings/pci/pci-iommu.txt
@@ -38,8 +38,20 @@ Optional properties
   The property is an arbitrary number of tuples of
   (rid-base,iommu,iommu-base,length).

-  Any RID r in the interval [rid-base, rid-base + length) is associated with
-  the listed IOMMU, with the iommu-specifier (r - rid-base + iommu-base).
+  If the associated IOMMU has an #iommu-cells value of 1, any RID r in the
+  interval [rid-base, rid-base + length) is associated with the listed IOMMU,
+  with the iommu-specifier (r - rid-base + iommu-base).
+
+  ARM SMMU Note:
+    The ARM SMMU binding permits an #iommu-cells value of 2 and in this
+    case defines an IOMMU specifier to be: (stream-id,smr-mask)
+
+    In an iommu-map this means the iommu-base consists of 2 cells:
+        (rid-base,iommu,[stream-id,smr-mask],length).
+
+    In this case the RID to IOMMU specifier mapping is defined to be:
+    any RID r in the interval [rid-base, rid-base + length) is associated
+    with the listed IOMMU, with the iommu-specifier (r - rid-base + stream-id).

 - iommu-map-mask: A mask to be applied to each Requester ID prior to being
   mapped to an iommu-specifier per the iommu-map property.

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-12-16 17:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-16  2:36 RFC: extend iommu-map binding to support #iommu-cells > 1 Stuart Yoder
     [not found] ` <VI1PR0401MB2638DE2D30F8423F6F8C7A6E8D9C0-9IDQY6o3qQjcXZ0H4ZLnAo3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-12-16  3:46   ` Bharat Bhushan
     [not found]     ` <AM5PR0401MB25455AE3850ED6E724B025EF9A9C0-oQ3wXcTHOqrg6d/1FbYcvI3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-12-16 15:06       ` Stuart Yoder
2016-12-16 11:34   ` Robin Murphy
2016-12-16 11:39   ` Mark Rutland
2016-12-16 14:21     ` Stuart Yoder
     [not found]       ` <VI1PR0401MB26387C2712FC4BF74B4B96028D9C0-9IDQY6o3qQjcXZ0H4ZLnAo3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-12-16 14:50         ` Robin Murphy
     [not found]           ` <07c70fde-2bce-a517-0f5f-a2405049c87c-5wv7dgnIgG8@public.gmane.org>
2016-12-16 15:07             ` Bharat Bhushan
2016-12-16 15:56             ` Stuart Yoder
     [not found]               ` <VI1PR0401MB2638870C58173D5906AE0D9E8D9C0-9IDQY6o3qQjcXZ0H4ZLnAo3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-12-16 16:49                 ` Robin Murphy
     [not found]                   ` <41edab27-c73a-7a1a-4369-fb43d7f57f78-5wv7dgnIgG8@public.gmane.org>
2016-12-16 17:05                     ` Stuart Yoder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).