Skip to contentSkip to conversation

iommu/arm-smmu: Add support for multiple TBU child devices

RFC PATCH In review Vivek Gautam 2 participants 3 messages Sep 12, 2017 – Sep 27, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 iommu/arm-smmu: Add support for multiple TBU child devices

ARM MMU-500 implements a TBU (uTLB) for each connected master besides a single TCU which controls and manages the address translations. Each of these TBUs can either be in the same power domain as the master, or they can have a independent power switch.
This design addresses the challenges to control TBU power. Adding child devices for each TBUs present in the configuration lets us control the power and clocks to TLBs having individual power domains. The device link between master devices (such as, display, and GPU) and TBU devices ensures that the master takes care of powering the smmu as long as it's available. When the master is not available, the TBUs are identified with sid and powered on.

---

- The idea behind this patch is to handle the distributed smmu architectures, similar to MMU-500.
- Untested yet.
- There are still few instances where the correct tbu device has to be referenced and thus powered on to handle TLB maintenance operations.

 .../devicetree/bindings/iommu/arm,smmu.txt         |  27 +++
 drivers/iommu/arm-smmu.c                           | 191 +++++++++++++++++++--
 2 files changed, 205 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/iommu/arm,smmu.txt +27 -0
index d97a6bc8e608..7cf67e75022e 100644
@@ -98,6 +98,18 @@ conditions.
                   accessed before master gets enabled and linked to its
                   SMMU.
 
+- child nodes:    ARM MMU-500 implements a TBU (page table cache or TLB) for
+                  each connected master besides a single TCU that controls
+                  and manages the address translations.
+                  Each of the child nodes represents a TBU that is attached to
+                  the master. This child node will have following property:
+
+  - compatibe:       must be "arm,mmu-500-tbu" for TBU child nodes of arm,mmu-500
+                     smmu.
+  - stream-id-range: array representing the starting stream id and the number
+                     of supported stream-ids. This gives information about
+                     the range of stream-ids that are supported by this TBU.
+
 ** Deprecated properties:
 
 - mmu-masters (deprecated in favour of the generic "iommus" binding) :
@@ -187,3 +199,18 @@ conditions.
 			 <&mmcc SMMU_MDP_AHB_CLK>;
 		clock-names = "bus", "iface";
 	};
+
+	smmu4: iommu {
+		compatible = "arm,mmu-500";
+		reg = <0xd00000 0x10000>;
+                ...
+                ...
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                tbu: tbu at 0 {
+                         compatible = "arm,mmu-500-tbu";
+                         reg = <0>;
+                         stream-id-range = <0x0 0x400>;
+                };
+        };
drivers/iommu/arm-smmu.c +178 -13

313 lines not on this page · raw message

Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
maintainer
#1 lore raw
Quoted 37 lines · Vivek Gautam

ARM MMU-500 implements a TBU (uTLB) for each connected master besides a single TCU which controls and manages the address translations. Each of these TBUs can either be in the same power domain as the master, or they can have a independent power switch.
This design addresses the challenges to control TBU power. Adding child devices for each TBUs present in the configuration lets us control the power and clocks to TLBs having individual power domains. The device link between master devices (such as, display, and GPU) and TBU devices ensures that the master takes care of powering the smmu as long as it's available. When the master is not available, the TBUs are identified with sid and powered on.

---

- The idea behind this patch is to handle the distributed smmu architectures, similar to MMU-500.
- Untested yet.
- There are still few instances where the correct tbu device has to be referenced and thus powered on to handle TLB maintenance operations.

 .../devicetree/bindings/iommu/arm,smmu.txt         |  27 +++
 drivers/iommu/arm-smmu.c                           | 191 +++++++++++++++++++--
 2 files changed, 205 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/iommu/arm,smmu.txt +1 -0
index d97a6bc8e608..7cf67e75022e 100644
@@ -98,6 +98,18 @@ conditions.
                   accessed before master gets enabled and linked to its
                   SMMU.
 
+- child nodes:    ARM MMU-500 implements a TBU (page table cache or TLB) for

Documentation/devicetree/bindings/iommu/arm,smmu.txt conditions. · line 111

Quoted 10 lines
Documentation/devicetree/bindings/iommu/arm,smmu.txt +10 -0
+                  each connected master besides a single TCU that controls
+                  and manages the address translations.
+                  Each of the child nodes represents a TBU that is attached to
+                  the master. This child node will have following property:
+
+  - compatibe:       must be "arm,mmu-500-tbu" for TBU child nodes of arm,mmu-500
+                     smmu.
+  - stream-id-range: array representing the starting stream id and the number
+                     of supported stream-ids. This gives information about
+                     the range of stream-ids that are supported by this TBU.

Needs a vendor prefix.

Also need to document reg property. What does reg represent? If just an index with no correlation to h/w numbering, then perhaps stream ids could be put into reg instead.

Rob

#2 lore raw

Hi Rob,

On 09/19/2017 07:40 PM, Rob Herring wrote:

Thanks for reviewing the patch.

Quoted 37 lines · Vivek Gautam
Quoted 36 lines

ARM MMU-500 implements a TBU (uTLB) for each connected master besides a single TCU which controls and manages the address translations. Each of these TBUs can either be in the same power domain as the master, or they can have a independent power switch.
This design addresses the challenges to control TBU power. Adding child devices for each TBUs present in the configuration lets us control the power and clocks to TLBs having individual power domains. The device link between master devices (such as, display, and GPU) and TBU devices ensures that the master takes care of powering the smmu as long as it's available. When the master is not available, the TBUs are identified with sid and powered on.

---

- The idea behind this patch is to handle the distributed smmu architectures, similar to MMU-500.
- Untested yet.
- There are still few instances where the correct tbu device has to be referenced and thus powered on to handle TLB maintenance operations.

  .../devicetree/bindings/iommu/arm,smmu.txt         |  27 +++
  drivers/iommu/arm-smmu.c                           | 191 +++++++++++++++++++--
  2 files changed, 205 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/iommu/arm,smmu.txt +0 -0
index d97a6bc8e608..7cf67e75022e 100644
@@ -98,6 +98,18 @@ conditions.
                    accessed before master gets enabled and linked to its
                    SMMU.
 
Quoted 12 lines

Documentation/devicetree/bindings/iommu/arm,smmu.txt conditions. · line 111

Quoted 11 lines
Documentation/devicetree/bindings/iommu/arm,smmu.txt +11 -0
+- child nodes:    ARM MMU-500 implements a TBU (page table cache or TLB) for
+                  each connected master besides a single TCU that controls
+                  and manages the address translations.
+                  Each of the child nodes represents a TBU that is attached to
+                  the master. This child node will have following property:
+
+  - compatibe:       must be "arm,mmu-500-tbu" for TBU child nodes of arm,mmu-500
+                     smmu.
+  - stream-id-range: array representing the starting stream id and the number
+                     of supported stream-ids. This gives information about
+                     the range of stream-ids that are supported by this TBU.

Needs a vendor prefix.

Sure will add the vendor prefix.
This can be a generic arm-mmu500 implementation where, a range of stream-ids are serviced by a TBU. Would "arm,stream-id-range" make sense?

Quoted 4 lines

Also need to document reg property. What does reg represent? If just an index with no correlation to h/w numbering, then perhaps stream ids could be put into reg instead.

Okay. Stream-ids make sense, since the reg doesn't necessarily represent any hardware number such as channel number, etc.

Best regards
Vivek

Quoted 6 lines

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project