devicetree: Add master-id-bits property to the iommu device
Subsystems (2)
RFC PATCH 1/1 devicetree: Add master-id-bits property to the iommu device
"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.
--- Documentation/devicetree/bindings/iommu/iommu.txt | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+)
Documentation/devicetree/bindings/iommu/iommu.txt +29 -0
@@ -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 at 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 {
Signature · 1 line
1.7.9.5
RFC PATCH 1/1 devicetree: Add master-id-bits property to the iommu device
Quoted 10 lines · Varun Sethi
"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 <[email protected]>
This seems rather specific to MMU-500. I don't think that most IOMMUs would use the term 'master ID', 'stream ID' or even the general concept, and you don't expand the acronym 'TBU'. I've seen many IOMMUs and I don't even know what that means.
Why do you think this is something that is needed to be known at the global level, rather than a property for some individual drivers?
Arnd
RFC PATCH 1/1 devicetree: Add master-id-bits property to the iommu device
Hi Arnd,
Quoted 21 lines
-----Original Message-----
From: Arnd Bergmann [mailto:arnd at arndb.de]
Sent: Monday, September 15, 2014 8:08 AM
To: Sethi Varun-B16395
Cc: devicetree at vger.kernel.org; iommu at lists.linux-foundation.org; thierry.reding at gmail.com; Mark.Rutland at arm.com; will.deacon at arm.com; hdoyu at nvidia.com; swarren at nvidia.com; robh+dt at kernel.org; linux-arm- kernel at lists.infradead.org; Yoder Stuart-B08248
Subject: Re: [RFC][PATCH] devicetree: Add master-id-bits property to the iommu deviceQuoted 9 lines · Varun Sethi
"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.
Quoted 6 lines
Quoted 1 line
Signed-off-by Varun Sethi <[email protected]>This seems rather specific to MMU-500. I don't think that most IOMMUs would use the term 'master ID', 'stream ID' or even the general concept, and you don't expand the acronym 'TBU'. I've seen many IOMMUs and I don't even know what that means.
TBU refers to the translation buffer unit, which is responsible for caching page translations. In case of translation miss in the cache, translation request is forwarded to the TCU (Translation control unit). The master id forwarded to TCU would also contain the TBU ID. Using the master-id-bits property we can mask out the additional TBU bits at the TCU. This is a cause of concern when we want to share master id for devices which are connected to different TBUs. We have a hot pluggable bus architecture, where a device group can have multiple devices connected to different TBUs. So, we need a mechanism to mask out additional TBIU bits.
Quoted 4 lines
Why do you think this is something that is needed to be known at the global level, rather than a property for some individual drivers?
In case of Freescale Layerscape SOCs, number of bits used for defining a stream id are specific to a given platform.
Are you suggesting that this property should be added to the master device node, rather than the iommu node?
-Varun
RFC PATCH 1/1 devicetree: Add master-id-bits property to the iommu device
Quoted 7 lines · Varun Sethi
Quoted 5 lines
This seems rather specific to MMU-500. I don't think that most IOMMUs would use the term 'master ID', 'stream ID' or even the general concept, and you don't expand the acronym 'TBU'. I've seen many IOMMUs and I don't even know what that means.
TBU refers to the translation buffer unit, which is responsible for caching page translations. In case of translation miss in the cache, translation request is forwarded to the TCU (Translation control unit). The master id forwarded to TCU would also contain the TBU ID. Using the master-id-bits property we can mask out the additional TBU bits at the TCU. This is a cause of concern when we want to share master id for devices which are connected to different TBUs. We have a hot pluggable bus architecture, where a device group can have multiple devices connected to different TBUs. So, we need a mechanism to mask out additional TBIU bits.
Ok, I think I understand now
Quoted 6 lines
Quoted 3 lines
Why do you think this is something that is needed to be known at the global level, rather than a property for some individual drivers?
In case of Freescale Layerscape SOCs, number of bits used for defining a stream id are specific to a given platform.
Are you suggesting that this property should be added to the master device node, rather than the iommu node?
Most importantly, I think this needs to be part of the (iommu) device specific binding, not the generic binding that is used for all iommus that may or may not have this concept.
I believe in case of the ARM SMMU, it should actually go into the master node as part of the 'iommus' property, because the mask can be different for each master. If your IOMMU has a fixed mask that is used for all devices, that's fine and you can put it into the iommu node itself but document it in the binding for your IOMMU.
For hot-pluggable buses, you probably need to have the 'iommus' property in the node that corresponds to the bus controller, and that will have a mask that is used for all devices plugged into it.
Arnd
RFC PATCH 1/1 devicetree: Add master-id-bits property to the iommu device
Hi Arnd,
Quoted 50 lines
-----Original Message-----
From: iommu-bounces at lists.linux-foundation.org [mailto:iommu- bounces at lists.linux-foundation.org] On Behalf Of Arnd Bergmann
Sent: Monday, September 15, 2014 10:27 PM
To: Sethi Varun-B16395
Cc: Mark.Rutland at arm.com; devicetree at vger.kernel.org; swarren at nvidia.com; will.deacon at arm.com; Yoder Stuart-B08248; robh+dt at kernel.org; iommu at lists.linux-foundation.org; thierry.reding at gmail.com; linux-arm-kernel at lists.infradead.org
Subject: Re: [RFC][PATCH] devicetree: Add master-id-bits property to the iommu deviceQuoted 7 lines · Varun Sethi
Quoted 5 lines
This seems rather specific to MMU-500. I don't think that most IOMMUs would use the term 'master ID', 'stream ID' or even the general concept, and you don't expand the acronym 'TBU'. I've seen many IOMMUs and I don't even know what that means.
TBU refers to the translation buffer unit, which is responsible for caching
page translations. In case of translation miss in the cache, translation request is forwarded to the TCU (Translation control unit). The master id forwarded to TCU would also contain the TBU ID. Using the master-id-bits property we can mask out the additional TBU bits at the TCU. This is a cause of concern when we want to share master id for devices which are connected to different TBUs. We have a hot pluggable bus architecture, where a device group can have multiple devices connected to different TBUs. So, we need a mechanism to mask out additional TBIU bits.
Ok, I think I understand now
Quoted 4 lines
Quoted 3 lines
Why do you think this is something that is needed to be known at the global level, rather than a property for some individual drivers?
In case of Freescale Layerscape SOCs, number of bits used for defining a
stream id are specific to a given platform.
Quoted 2 lines
Are you suggesting that this property should be added to the master device
node, rather than the iommu node?
Most importantly, I think this needs to be part of the (iommu) device specific binding, not the generic binding that is used for all iommus that may or may not have this concept.
I believe in case of the ARM SMMU, it should actually go into the master node as part of the 'iommus' property, because the mask can be different for each master. If your IOMMU has a fixed mask that is used for all devices, that's fine and you can put it into the iommu node itself but document it in the binding for your IOMMU.
Quoted 3 lines
For hot-pluggable buses, you probably need to have the 'iommus' property in the node that corresponds to the bus controller, and that will have a mask that is used for all devices plugged into it.
Can I add a note to the generic binding about representing the "mask" as a part of the "iommus" property. This would similar to the note about the "dma-ranges"
-Varun
RFC PATCH 1/1 devicetree: Add master-id-bits property to the iommu device
Quoted 52 lines · Varun Sethi
Hi Arnd,
Quoted 50 lines
-----Original Message-----
From: iommu-bounces at lists.linux-foundation.org [mailto:iommu- bounces at lists.linux-foundation.org] On Behalf Of Arnd Bergmann
Sent: Monday, September 15, 2014 10:27 PM
To: Sethi Varun-B16395
Cc: Mark.Rutland at arm.com; devicetree at vger.kernel.org; swarren at nvidia.com; will.deacon at arm.com; Yoder Stuart-B08248; robh+dt at kernel.org; iommu at lists.linux-foundation.org; thierry.reding at gmail.com; linux-arm-kernel at lists.infradead.org
Subject: Re: [RFC][PATCH] devicetree: Add master-id-bits property to the iommu deviceQuoted 7 lines · Varun Sethi
Quoted 5 lines
This seems rather specific to MMU-500. I don't think that most IOMMUs would use the term 'master ID', 'stream ID' or even the general concept, and you don't expand the acronym 'TBU'. I've seen many IOMMUs and I don't even know what that means.
TBU refers to the translation buffer unit, which is responsible for caching
page translations. In case of translation miss in the cache, translation request is forwarded to the TCU (Translation control unit). The master id forwarded to TCU would also contain the TBU ID. Using the master-id-bits property we can mask out the additional TBU bits at the TCU. This is a cause of concern when we want to share master id for devices which are connected to different TBUs. We have a hot pluggable bus architecture, where a device group can have multiple devices connected to different TBUs. So, we need a mechanism to mask out additional TBIU bits.
Ok, I think I understand now
Quoted 4 lines
Quoted 3 lines
Why do you think this is something that is needed to be known at the global level, rather than a property for some individual drivers?
In case of Freescale Layerscape SOCs, number of bits used for defining a
stream id are specific to a given platform.
Quoted 2 lines
Are you suggesting that this property should be added to the master device
node, rather than the iommu node?
Most importantly, I think this needs to be part of the (iommu) device specific binding, not the generic binding that is used for all iommus that may or may not have this concept.
I believe in case of the ARM SMMU, it should actually go into the master node as part of the 'iommus' property, because the mask can be different for each master. If your IOMMU has a fixed mask that is used for all devices, that's fine and you can put it into the iommu node itself but document it in the binding for your IOMMU.
Quoted 6 lines
Quoted 3 lines
For hot-pluggable buses, you probably need to have the 'iommus' property in the node that corresponds to the bus controller, and that will have a mask that is used for all devices plugged into it.
Can I add a note to the generic binding about representing the "mask" as a part of the "iommus" property. This would similar to the note about the "dma-ranges"
I think the concept of a mask is fairly device-specific. Adding a note to it in the generic binding could be confusing to people working with IOMMUs that don't know the concept.
dma-ranges on the other hand is a generic property, so referring to it in the generic binding makes sense.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140922/edd47503/attachment-0001.sig>