devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Varun Sethi <Varun.Sethi@freescale.com>
To: devicetree@vger.kernel.org, iommu@lists.linux-foundation.org,
	thierry.reding@gmail.com, Mark.Rutland@arm.com,
	will.deacon@arm.com, hdoyu@nvidia.com, swarren@nvidia.com,
	arnd@arndb.de, robh+dt@kernel.org,
	linux-arm-kernel@lists.infradead.org, stuart.yoder@freescale.com
Cc: Varun Sethi <Varun.Sethi@freescale.com>
Subject: [RFC][PATCH] devicetree: Add master-id-bits property to the iommu device
Date: Sun, 14 Sep 2014 23:47:26 +0530	[thread overview]
Message-ID: <1410718646-9710-1-git-send-email-Varun.Sethi@freescale.com> (raw)

"master-id-bits" property added to the IOMMU device node. This property can
be used by the IOMMU driver to match relevan bits in the master id expressed
by a DMA master.

This can be used to mask out certain bits that get added to the device master id
due to IOMMU topology. For example, in case of MMU-500 the TBUID gets appended to
the master id. This prevents sharing of a stream ID, amongst devices which are
connected to different TBUs. 

Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
---
 Documentation/devicetree/bindings/iommu/iommu.txt |   29 +++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/Documentation/devicetree/bindings/iommu/iommu.txt b/Documentation/devicetree/bindings/iommu/iommu.txt
index 5a8b462..f7c8623 100644
--- a/Documentation/devicetree/bindings/iommu/iommu.txt
+++ b/Documentation/devicetree/bindings/iommu/iommu.txt
@@ -63,6 +63,23 @@ Note that these are merely examples and real-world use-cases may use different
 definitions to represent their individual needs. Always refer to the specific
 IOMMU binding for the exact meaning of the cells that make up the specifier.
 
+Optional properties:
+--------------------
+- master-id-bits: This specifies number of master id bits used by the iommu, to
+  match master id expressed by the DMA master device. This would be typically used
+  in cases where we need DMA memory isolation between multiple masters. Each master
+  would specify a master id associated with a DMA trasaction.
+
+  The IOMMU driver can use this property to generate a mask to match only relevant
+  bits in the master id. This can be used for masking out certain bits that get
+  added to the master id as a part of the IOMMU topology.
+
+  For example, in case of MMU-500 the TBU identifier is also appended to the master id.
+  This posese issues for software implementations requiring dynamic master id allocation
+  for supporting hot pluggable devices. It's possible to have a device group, with
+  devices connected to different TBUs. Without masking the additional TBU ID bits, we
+  can't share the master id across all devices in the device group.
+
 
 IOMMU master node:
 ==================
@@ -147,6 +164,12 @@ Multiple-master IOMMU:
 	iommu {
 		/* the specifier represents the ID of the master */
 		#iommu-cells = <1>;
+
+		/*
+		 * This specifies number of master id bits used by
+		 * the iommu for matching the master id.
+		 */
+		master-id-bits = <7>
 	};
 
 	master@1 {
@@ -173,6 +196,12 @@ Multiple-master IOMMU with configurable DMA window:
 			 * master (i.e. the I/O virtual address space).
 			 */
 			#iommu-cells = <4>;
+
+			/*
+			 * This specifies number of master id bits used by
+			 * the iommu for matching the master id.
+			 */
+			master-id-bits = <7>
 		};
 
 		master {
-- 
1.7.9.5

             reply	other threads:[~2014-09-14 18:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-14 18:17 Varun Sethi [this message]
     [not found] ` <1410718646-9710-1-git-send-email-Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-09-15  2:38   ` [RFC][PATCH] devicetree: Add master-id-bits property to the iommu device Arnd Bergmann
     [not found]     ` <201409150438.29649.arnd-r2nGTMty4D4@public.gmane.org>
2014-09-15 10:37       ` Varun Sethi
     [not found]         ` <bfdff6494d7f46ab9a9f00f94159e9e1-AZ66ij2kwaacCcN9WK45f+O6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-09-15 16:57           ` Arnd Bergmann
     [not found]             ` <201409151857.05463.arnd-r2nGTMty4D4@public.gmane.org>
2014-09-16 18:04               ` Varun Sethi
     [not found]                 ` <febe4a288f2f438ca95988929ee71580-AZ66ij2kwaacCcN9WK45f+O6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-09-22  9:23                   ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410718646-9710-1-git-send-email-Varun.Sethi@freescale.com \
    --to=varun.sethi@freescale.com \
    --cc=Mark.Rutland@arm.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=hdoyu@nvidia.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=stuart.yoder@freescale.com \
    --cc=swarren@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).