Skip to contentSkip to conversation

Enable smmu support on sdm845

PATCH Superseded Vivek Gautam 4 participants 13 messages Jul 19, 2018 – Aug 13, 2018

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Enable smmu support on sdm845

This series enables apps-smmu (arm,mmu-500) and gpu-smmu (qcom,smmu-v2) on sdm845. gpu-smmu needs one power domain from gpu clock controller whose driver was sent by Amit [1].

This series also contains a patch to split the check for num_context_irqs and num_context_banks in two. We now error out only if num_context_irqs is greater than num_context_banks.
There are cases such as on sdm845, in which few of the context banks are reserved by the bootloader (secure software), and thus kernel view lesser number than the total available context banks.
So, we shouldn't error out simply when the num_context_irqs is not equal to num_context_banks.

[1] https://lore.kernel.org/patchwork/cover/962208/

Vivek Gautam (3):
dts: arm64/sdm845: Add node for arm,mmu-500
dts: arm64/sdm845: Add node for qcom,smmu-v2 iommu/arm-smmu: Error out only if not enough context interrupts

 arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  8 +++
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 96 +++++++++++++++++++++++++++++++++
 drivers/iommu/arm-smmu.c                | 19 ++++---
 3 files changed, 117 insertions(+), 6 deletions(-)
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
#1 lore raw

PATCH 1/3 dts: arm64/sdm845: Add node for arm,mmu-500

Add device node for arm,mmu-500 available on sdm845. This MMU-500 with single TCU and multiple TBU architecture is shared among all the peripherals except gpu on sdm845.

---
 arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  4 ++
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 73 +++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +4 -0
index 6d651f314193..13b50dff440f 100644
@@ -58,3 +58,7 @@
 		bias-pull-up;
 	};
 };
+
+&apps_smmu {
+	status = "okay";
+};
arch/arm64/boot/dts/qcom/sdm845.dtsi +73 -0

79 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
#7 lore raw

PATCH 2/3 dts: arm64/sdm845: Add node for qcom,smmu-v2

In reply to Vivek Gautam

Add device node for qcom,smmu-v2 available on sdm845. This smmu is available only to GPU device.

---

One power domain required for this GPU smmu - GPU_CX_GDSC, commented out in the node is coming from gpu clock controller [1].

[1] https://lore.kernel.org/patchwork/cover/962208/

 arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  4 ++++
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +4 -0
index 13b50dff440f..969aa76bdceb 100644
@@ -62,3 +62,7 @@
 &apps_smmu {
 	status = "okay";
 };
+
+&gpu_smmu {
+	status = "okay";
+};
arch/arm64/boot/dts/qcom/sdm845.dtsi +23 -0
index 70ca18ae6cb3..db9f9e84d162 100644
@@ -980,6 +980,29 @@
 			cell-index = <0>;
 		};
 
+		gpu_smmu: arm,smmu at 5040000 {
+			compatible = "qcom,sdm845-smmu-v2", "qcom,smmu-v2";
+			reg = <0x5040000 0x10000>;
+			#iommu-cells = <1>;
+			#global-interrupts = <2>;
+			interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 364 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 365 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 366 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 367 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 368 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 369 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 370 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 371 IRQ_TYPE_EDGE_RISING>;
+			clock-names = "bus", "iface";
+			clocks = <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
+				 <&gcc GCC_GPU_CFG_AHB_CLK>;
+
+			/* power-domains = <&gpucc GPU_CX_GDSC>; */
+			status = "disabled";
+		};
+
 		apps_smmu: arm,smmu at 15000000 {
 			compatible = "arm,mmu-500";
 			reg = <0x15000000 0x80000>;
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
#8 lore raw

PATCH 3/3 iommu/arm-smmu: Error out only if not enough context interrupts

In reply to Vivek Gautam

Currently we check if the number of context banks is not equal to num_context_interrupts. However, there are booloaders such as, one on sdm845 that reserves few context banks and thus kernel views less than the total available context banks.
So, although the hardware definition in device tree would mention the correct number of context interrupts, this number can be greater than the number of context banks visible to smmu in kernel. We should therefore error out only when the number of context banks is greater than the available number of context interrupts.

---
 drivers/iommu/arm-smmu.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/iommu/arm-smmu.c +13 -6
index 7c69736a30f8..4cb53bf4f423 100644
@@ -2229,12 +2229,19 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	if (smmu->version == ARM_SMMU_V2 &&
-	    smmu->num_context_banks != smmu->num_context_irqs) {
-		dev_err(dev,
-			"found only %d context interrupt(s) but %d required\n",
-			smmu->num_context_irqs, smmu->num_context_banks);
-		return -ENODEV;
+	if (smmu->version == ARM_SMMU_V2) {
+		if (smmu->num_context_banks > smmu->num_context_irqs) {
+			dev_err(dev,
+			      "found only %d context irq(s) but %d required\n",
+			      smmu->num_context_irqs, smmu->num_context_banks);
+			return -ENODEV;
+		} else if (smmu->num_context_banks < smmu->num_context_irqs) {
+			/* loose extra context interrupts */
+			dev_notice(dev,
+			      "found %d context irq(s) but only %d required\n",
+			      smmu->num_context_irqs, smmu->num_context_banks);
+			smmu->num_context_irqs = smmu->num_context_banks;
+		}
 	}
 
 	for (i = 0; i < smmu->num_global_irqs; ++i) {
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
#2 lore raw

Re: [PATCH 1/3] dts: arm64/sdm845: Add node for arm,mmu-500

In reply to Vivek Gautam
Quoted 28 lines · Vivek Gautam

Add device node for arm,mmu-500 available on sdm845. This MMU-500 with single TCU and multiple TBU architecture is shared among all the peripherals except gpu on sdm845.

---
 arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  4 ++
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 73 +++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +4 -0
index 6d651f314193..13b50dff440f 100644
@@ -58,3 +58,7 @@
                bias-pull-up;
        };
 };
+
+&apps_smmu {
+       status = "okay";
+};
arch/arm64/boot/dts/qcom/sdm845.dtsi +0 -0
index 00722b533a92..70ca18ae6cb3 100644

arch/arm64/boot/dts/qcom/sdm845.dtsi line 983

Quoted 4 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -0
@@ -980,6 +980,79 @@
                        cell-index = <0>;
                };
 
+               apps_smmu: arm,smmu at 15000000 {

iommu at ...

arch/arm64/boot/dts/qcom/sdm845.dtsi line 984

Quoted 1 line
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -0
+                       compatible = "arm,mmu-500";

Really unmodified by QCom? Would be better to have SoC specific compatible.

Rob

#3 lore raw

Re: [PATCH 1/3] dts: arm64/sdm845: Add node for arm,mmu-500

Hi Rob,

Quoted 33 lines · Rob Herring
Quoted 31 lines · Vivek Gautam

Add device node for arm,mmu-500 available on sdm845. This MMU-500 with single TCU and multiple TBU architecture is shared among all the peripherals except gpu on sdm845.

---
 arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  4 ++
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 73 +++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +4 -0
index 6d651f314193..13b50dff440f 100644
@@ -58,3 +58,7 @@
                bias-pull-up;
        };
 };
+
+&apps_smmu {
+       status = "okay";
+};
arch/arm64/boot/dts/qcom/sdm845.dtsi +0 -0
index 00722b533a92..70ca18ae6cb3 100644
@@ -980,6 +980,79 @@
                        cell-index = <0>;
                };
 
Quoted 3 lines

arch/arm64/boot/dts/qcom/sdm845.dtsi line 983

Quoted 1 line
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -0
+               apps_smmu: arm,smmu at 15000000 {

iommu at ...

Thanks for the review.
Sure, will modify this.

Quoted 4 lines

arch/arm64/boot/dts/qcom/sdm845.dtsi line 984

Quoted 2 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -0
+                       compatible = "arm,mmu-500";

Really unmodified by QCom? Would be better to have SoC specific compatible.

Yes, at this point we are able to use the driver as is on 845. But, will add a SoC specific compatible as suggested to make bindings future proof.

Best regards
Vivek

Quoted 6 lines

Rob
_______________________________________________
iommu mailing list
iommu at lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

Re: [PATCH 3/3] iommu/arm-smmu: Error out only if not enough context interrupts

In reply to Vivek Gautam
Quoted 35 lines · Vivek Gautam

Currently we check if the number of context banks is not equal to num_context_interrupts. However, there are booloaders such as, one on sdm845 that reserves few context banks and thus kernel views less than the total available context banks.
So, although the hardware definition in device tree would mention the correct number of context interrupts, this number can be greater than the number of context banks visible to smmu in kernel. We should therefore error out only when the number of context banks is greater than the available number of context interrupts.

---
 drivers/iommu/arm-smmu.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/iommu/arm-smmu.c +3 -6
index 7c69736a30f8..4cb53bf4f423 100644
@@ -2229,12 +2229,19 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	if (smmu->version == ARM_SMMU_V2 &&
-	    smmu->num_context_banks != smmu->num_context_irqs) {
-		dev_err(dev,
-			"found only %d context interrupt(s) but %d required\n",
-			smmu->num_context_irqs, smmu->num_context_banks);
-		return -ENODEV;
+	if (smmu->version == ARM_SMMU_V2) {
+		if (smmu->num_context_banks > smmu->num_context_irqs) {
+			dev_err(dev,

drivers/iommu/arm-smmu.c static int arm_smmu_device_probe(struct platform_device *pdev) · line 2244

Quoted 10 lines
drivers/iommu/arm-smmu.c +10 -0
+			      "found only %d context irq(s) but %d required\n",
+			      smmu->num_context_irqs, smmu->num_context_banks);
+			return -ENODEV;
+		} else if (smmu->num_context_banks < smmu->num_context_irqs) {
+			/* loose extra context interrupts */
+			dev_notice(dev,
+			      "found %d context irq(s) but only %d required\n",
+			      smmu->num_context_irqs, smmu->num_context_banks);
+			smmu->num_context_irqs = smmu->num_context_banks;
+		}

I don't see the utility in the new message. Can you simplify with the patch below on top? It's a bit weird that we only decide to ignore the extra irqs after calling platform_get_irq() on them, but that seems to be harmless.

Will

--->8

drivers/iommu/arm-smmu.c +3 -6
index aa46c1ed5bf9..5349e22b5c78 100644
@@ -2109,13 +2109,10 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 			      "found only %d context irq(s) but %d required\n",
 			      smmu->num_context_irqs, smmu->num_context_banks);
 			return -ENODEV;
-		} else if (smmu->num_context_banks < smmu->num_context_irqs) {
-			/* loose extra context interrupts */
-			dev_notice(dev,
-			      "found %d context irq(s) but only %d required\n",
-			      smmu->num_context_irqs, smmu->num_context_banks);
-			smmu->num_context_irqs = smmu->num_context_banks;
 		}
+
+		/* Ignore superfluous interrupts */
+		smmu->num_context_irqs = smmu->num_context_banks;
 	}
 
 	for (i = 0; i < smmu->num_global_irqs; ++i) {
#10 lore raw

Re: [PATCH 3/3] iommu/arm-smmu: Error out only if not enough context interrupts

Hi Will,

Quoted 41 lines · Will Deacon
Quoted 40 lines · Vivek Gautam

Currently we check if the number of context banks is not equal to num_context_interrupts. However, there are booloaders such as, one on sdm845 that reserves few context banks and thus kernel views less than the total available context banks.
So, although the hardware definition in device tree would mention the correct number of context interrupts, this number can be greater than the number of context banks visible to smmu in kernel. We should therefore error out only when the number of context banks is greater than the available number of context interrupts.

---
  drivers/iommu/arm-smmu.c | 19 +++++++++++++------
  1 file changed, 13 insertions(+), 6 deletions(-)
drivers/iommu/arm-smmu.c +8 -6
index 7c69736a30f8..4cb53bf4f423 100644
@@ -2229,12 +2229,19 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
  	if (err)
  		return err;
 
-	if (smmu->version == ARM_SMMU_V2 &&
-	    smmu->num_context_banks != smmu->num_context_irqs) {
-		dev_err(dev,
-			"found only %d context interrupt(s) but %d required\n",
-			smmu->num_context_irqs, smmu->num_context_banks);
-		return -ENODEV;
+	if (smmu->version == ARM_SMMU_V2) {
+		if (smmu->num_context_banks > smmu->num_context_irqs) {
+			dev_err(dev,
+			      "found only %d context irq(s) but %d required\n",
+			      smmu->num_context_irqs, smmu->num_context_banks);
+			return -ENODEV;
+		} else if (smmu->num_context_banks < smmu->num_context_irqs) {
+			/* loose extra context interrupts */
Quoted 8 lines

drivers/iommu/arm-smmu.c static int arm_smmu_device_probe(struct platform_device *pdev) · line 2244

Quoted 5 lines
drivers/iommu/arm-smmu.c +5 -0
+			dev_notice(dev,
+			      "found %d context irq(s) but only %d required\n",
+			      smmu->num_context_irqs, smmu->num_context_banks);
+			smmu->num_context_irqs = smmu->num_context_banks;
+		}

I don't see the utility in the new message. Can you simplify with the patch below on top? It's a bit weird that we only decide to ignore the extra irqs after calling platform_get_irq() on them, but that seems to be harmless.

Thanks. I will modify as suggested below and respin.

Best regards
Vivek

Quoted 30 lines

Will

--->8

drivers/iommu/arm-smmu.c +3 -7
index aa46c1ed5bf9..5349e22b5c78 100644
@@ -2109,13 +2109,10 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
  			      "found only %d context irq(s) but %d required\n",
  			      smmu->num_context_irqs, smmu->num_context_banks);
  			return -ENODEV;
-		} else if (smmu->num_context_banks < smmu->num_context_irqs) {
-			/* loose extra context interrupts */
-			dev_notice(dev,
-			      "found %d context irq(s) but only %d required\n",
-			      smmu->num_context_irqs, smmu->num_context_banks);
-			smmu->num_context_irqs = smmu->num_context_banks;
  		}
+
+		/* Ignore superfluous interrupts */
+		smmu->num_context_irqs = smmu->num_context_banks;
  	}
 
  	for (i = 0; i < smmu->num_global_irqs; ++i) {
--

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

#11 lore raw

Re: [PATCH 3/3] iommu/arm-smmu: Error out only if not enough context interrupts

Quoted 32 lines · Vivek Gautam
Quoted 22 lines · Will Deacon
Quoted 21 lines · Vivek Gautam
drivers/iommu/arm-smmu.c +8 -6
index 7c69736a30f8..4cb53bf4f423 100644
@@ -2229,12 +2229,19 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	if (err)
 		return err;
-	if (smmu->version == ARM_SMMU_V2 &&
-	    smmu->num_context_banks != smmu->num_context_irqs) {
-		dev_err(dev,
-			"found only %d context interrupt(s) but %d required\n",
-			smmu->num_context_irqs, smmu->num_context_banks);
-		return -ENODEV;
+	if (smmu->version == ARM_SMMU_V2) {
+		if (smmu->num_context_banks > smmu->num_context_irqs) {
+			dev_err(dev,
+			      "found only %d context irq(s) but %d required\n",
+			      smmu->num_context_irqs, smmu->num_context_banks);
+			return -ENODEV;
+		} else if (smmu->num_context_banks < smmu->num_context_irqs) {
+			/* loose extra context interrupts */
Quoted 8 lines

drivers/iommu/arm-smmu.c static int arm_smmu_device_probe(struct platform_device *pdev) · line 2243

Quoted 5 lines
drivers/iommu/arm-smmu.c +5 -0
+			dev_notice(dev,
+			      "found %d context irq(s) but only %d required\n",
+			      smmu->num_context_irqs, smmu->num_context_banks);
+			smmu->num_context_irqs = smmu->num_context_banks;
+		}

I don't see the utility in the new message. Can you simplify with the patch below on top? It's a bit weird that we only decide to ignore the extra irqs after calling platform_get_irq() on them, but that seems to be harmless.

Quoted 1 line

Thanks. I will modify as suggested below and respin.

It's ok, I can make the change locally.

Will

#12 lore raw

Re: [PATCH 3/3] iommu/arm-smmu: Error out only if not enough context interrupts

Quoted 33 lines · Will Deacon
Quoted 32 lines · Vivek Gautam
Quoted 30 lines · Will Deacon
Quoted 16 lines · Vivek Gautam
drivers/iommu/arm-smmu.c +3 -6
index 7c69736a30f8..4cb53bf4f423 100644
@@ -2229,12 +2229,19 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
   if (err)
           return err;
-   if (smmu->version == ARM_SMMU_V2 &&
-       smmu->num_context_banks != smmu->num_context_irqs) {
-           dev_err(dev,
-                   "found only %d context interrupt(s) but %d required\n",
-                   smmu->num_context_irqs, smmu->num_context_banks);
-           return -ENODEV;
+   if (smmu->version == ARM_SMMU_V2) {
+           if (smmu->num_context_banks > smmu->num_context_irqs) {
+                   dev_err(dev,

drivers/iommu/arm-smmu.c static int arm_smmu_device_probe(struct platform_device *pdev) · line 2243

Quoted 10 lines
drivers/iommu/arm-smmu.c +10 -0
+                         "found only %d context irq(s) but %d required\n",
+                         smmu->num_context_irqs, smmu->num_context_banks);
+                   return -ENODEV;
+           } else if (smmu->num_context_banks < smmu->num_context_irqs) {
+                   /* loose extra context interrupts */
+                   dev_notice(dev,
+                         "found %d context irq(s) but only %d required\n",
+                         smmu->num_context_irqs, smmu->num_context_banks);
+                   smmu->num_context_irqs = smmu->num_context_banks;
+           }

I don't see the utility in the new message. Can you simplify with the patch below on top? It's a bit weird that we only decide to ignore the extra irqs after calling platform_get_irq() on them, but that seems to be harmless.

Quoted 3 lines
Quoted 1 line

Thanks. I will modify as suggested below and respin.

It's ok, I can make the change locally.

Thanks Will for making the changes, and picking this.

Best regards
Vivek

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

Re: [PATCH 1/3] dts: arm64/sdm845: Add node for arm,mmu-500

In reply to Vivek Gautam

Hi,

Quoted 15 lines · Vivek Gautam

Add device node for arm,mmu-500 available on sdm845. This MMU-500 with single TCU and multiple TBU architecture is shared among all the peripherals except gpu on sdm845.

---
 arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  4 ++
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 73 +++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +0 -0
index 6d651f314193..13b50dff440f 100644

arch/arm64/boot/dts/qcom/sdm845-mtp.dts line 64

Quoted 7 lines
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +4 -0
@@ -58,3 +58,7 @@
                bias-pull-up;
        };
 };
+
+&apps_smmu {
+       status = "okay";
+};

When you spin this patch please put the above in the correct place. Since "a" sorts alphabetically before "i" then this should be just before the line:

&i2c10 {

Thanks!

-Doug

#5 lore raw

Re: [PATCH 1/3] dts: arm64/sdm845: Add node for arm,mmu-500

Hi,

Quoted 31 lines · Doug Anderson

Hi,

Quoted 15 lines · Vivek Gautam

Add device node for arm,mmu-500 available on sdm845. This MMU-500 with single TCU and multiple TBU architecture is shared among all the peripherals except gpu on sdm845.

---
 arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  4 ++
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 73 +++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +0 -0
index 6d651f314193..13b50dff440f 100644

arch/arm64/boot/dts/qcom/sdm845-mtp.dts line 64

Quoted 7 lines
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +4 -0
@@ -58,3 +58,7 @@
                bias-pull-up;
        };
 };
+
+&apps_smmu {
+       status = "okay";
+};

When you spin this patch please put the above in the correct place. Since "a" sorts alphabetically before "i" then this should be just before the line:

Quoted 1 line

&i2c10 {

Sorry--one more thing I thought of after I sent this out...

Possibly you can drop this part of the patch completely and get rid of the 'status = "disabled";' in sdm845.dtsi. As I understand it you really only want to mark things as disabled in the SoC dtsi file if some boards might use this device and other boards wouldn't. For instance not all boards will have the SD card controller hooked up / enabled so having that set to "disabled" in the SoC device tree file makes sense. ...but it's not a board-level question about whether the SMMU is present--it's always there. You don't gain anything by forcing all boards to set status to "okay".

-Doug

#6 lore raw

Re: [PATCH 1/3] dts: arm64/sdm845: Add node for arm,mmu-500

Hi Doug,

Quoted 36 lines · Doug Anderson

Hi,

Quoted 30 lines · Doug Anderson

Hi,

Quoted 15 lines · Vivek Gautam

Add device node for arm,mmu-500 available on sdm845. This MMU-500 with single TCU and multiple TBU architecture is shared among all the peripherals except gpu on sdm845.

---
  arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  4 ++
  arch/arm64/boot/dts/qcom/sdm845.dtsi    | 73 +++++++++++++++++++++++++++++++++
  2 files changed, 77 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +0 -0
index 6d651f314193..13b50dff440f 100644

arch/arm64/boot/dts/qcom/sdm845-mtp.dts line 64

Quoted 7 lines
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +4 -0
@@ -58,3 +58,7 @@
                 bias-pull-up;
         };
  };
+
+&apps_smmu {
+       status = "okay";
+};

When you spin this patch please put the above in the correct place. Since "a" sorts alphabetically before "i" then this should be just before the line:

Quoted 1 line

&i2c10 {

Sorry--one more thing I thought of after I sent this out...

Quoted 9 lines

Possibly you can drop this part of the patch completely and get rid of the 'status = "disabled";' in sdm845.dtsi. As I understand it you really only want to mark things as disabled in the SoC dtsi file if some boards might use this device and other boards wouldn't. For instance not all boards will have the SD card controller hooked up / enabled so having that set to "disabled" in the SoC device tree file makes sense. ...but it's not a board-level question about whether the SMMU is present--it's always there. You don't gain anything by forcing all boards to set status to "okay".

Thanks for reviewing the patches.
Will sort the node as per alphabetical order.
Also as you pointed, it makes sense to not have the 'status' property in SMMU. Will remove that. Thanks.

Best regards
Vivek

Quoted 3 lines

-Doug