devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v18 0/4] iommu/arm-smmu: Add adreno-smmu implementation and bindings
@ 2020-11-02 17:14 Jordan Crouse
  2020-11-02 17:14 ` [PATCH v18 3/4] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU Jordan Crouse
  2020-11-02 17:14 ` [PATCH v18 4/4] arm: dts: qcom: sm845: Set the compatible string for the " Jordan Crouse
  0 siblings, 2 replies; 6+ messages in thread
From: Jordan Crouse @ 2020-11-02 17:14 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: iommu, Will Deacon, Robin Murphy, Andy Gross, Bjorn Andersson,
	Greg Kroah-Hartman, Joerg Roedel, Krishna Reddy, Rob Clark,
	Rob Herring, Sai Prakash Ranjan, Sibi Sankar, Stephen Boyd,
	Thierry Reding, Vivek Gautam, devicetree, linux-arm-kernel,
	linux-kernel

(resend with expanded CC list so everybody can see all the patches)

This short series adds support for the adreno-smmu implementation of the
arm-smmu driver and the device-tree bindings to turn on the implementation
for the sm845 and sc7180 GPUs. These changes are the last ones needed to enable
per-instance pagetables in the drm/msm driver.

No deltas in this patchset since the last go-around for 5.10 [1].

[1] https://patchwork.freedesktop.org/series/81393/

Jordan Crouse (3):
  iommu/arm-smmu-qcom: Add implementation for the adreno GPU SMMU
  dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU
  arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU

Rob Clark (1):
  iommu/arm-smmu: Add a way for implementations to influence SCTLR

 .../devicetree/bindings/iommu/arm,smmu.yaml   |   9 +-
 arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi    |   9 +
 arch/arm64/boot/dts/qcom/sdm845.dtsi          |   2 +-
 drivers/iommu/arm/arm-smmu/arm-smmu-impl.c    |   3 +
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c    | 157 +++++++++++++++++-
 drivers/iommu/arm/arm-smmu/arm-smmu.c         |   3 +
 drivers/iommu/arm/arm-smmu/arm-smmu.h         |   4 +
 7 files changed, 182 insertions(+), 5 deletions(-)

-- 
2.25.1


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

* [PATCH v18 3/4] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU
  2020-11-02 17:14 [PATCH v18 0/4] iommu/arm-smmu: Add adreno-smmu implementation and bindings Jordan Crouse
@ 2020-11-02 17:14 ` Jordan Crouse
  2020-11-02 18:22   ` Robin Murphy
  2020-11-02 17:14 ` [PATCH v18 4/4] arm: dts: qcom: sm845: Set the compatible string for the " Jordan Crouse
  1 sibling, 1 reply; 6+ messages in thread
From: Jordan Crouse @ 2020-11-02 17:14 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: iommu, Will Deacon, Robin Murphy, Rob Herring, Rob Clark,
	Bjorn Andersson, Joerg Roedel, Rob Herring, devicetree,
	linux-arm-kernel, linux-kernel

Every Qcom Adreno GPU has an embedded SMMU for its own use. These
devices depend on unique features such as split pagetables,
different stall/halt requirements and other settings. Identify them
with a compatible string so that they can be identified in the
arm-smmu implementation specific code.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
index 503160a7b9a0..3b63f2ae24db 100644
--- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
+++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
@@ -28,8 +28,6 @@ properties:
           - enum:
               - qcom,msm8996-smmu-v2
               - qcom,msm8998-smmu-v2
-              - qcom,sc7180-smmu-v2
-              - qcom,sdm845-smmu-v2
           - const: qcom,smmu-v2
 
       - description: Qcom SoCs implementing "arm,mmu-500"
@@ -40,6 +38,13 @@ properties:
               - qcom,sm8150-smmu-500
               - qcom,sm8250-smmu-500
           - const: arm,mmu-500
+      - description: Qcom Adreno GPUs implementing "arm,smmu-v2"
+        items:
+          - enum:
+              - qcom,sc7180-smmu-v2
+              - qcom,sdm845-smmu-v2
+          - const: qcom,adreno-smmu
+          - const: qcom,smmu-v2
       - description: Marvell SoCs implementing "arm,mmu-500"
         items:
           - const: marvell,ap806-smmu-500
-- 
2.25.1


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

* [PATCH v18 4/4] arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU
  2020-11-02 17:14 [PATCH v18 0/4] iommu/arm-smmu: Add adreno-smmu implementation and bindings Jordan Crouse
  2020-11-02 17:14 ` [PATCH v18 3/4] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU Jordan Crouse
@ 2020-11-02 17:14 ` Jordan Crouse
  1 sibling, 0 replies; 6+ messages in thread
From: Jordan Crouse @ 2020-11-02 17:14 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: iommu, Will Deacon, Robin Murphy, Rob Clark, Bjorn Andersson,
	Andy Gross, Rob Herring, devicetree, linux-kernel

Set the qcom,adreno-smmu compatible string for the GPU SMMU to enable
split pagetables and per-instance pagetables for drm/msm.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

 arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 9 +++++++++
 arch/arm64/boot/dts/qcom/sdm845.dtsi       | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
index 64fc1bfd66fa..39f23cdcbd02 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
@@ -633,6 +633,15 @@ &mdss_mdp {
 	status = "okay";
 };
 
+/*
+ * Cheza fw does not properly program the GPU aperture to allow the
+ * GPU to update the SMMU pagetables for context switches.  Work
+ * around this by dropping the "qcom,adreno-smmu" compat string.
+ */
+&adreno_smmu {
+	compatible = "qcom,sdm845-smmu-v2", "qcom,smmu-v2";
+};
+
 &mss_pil {
 	iommus = <&apps_smmu 0x781 0x0>,
 		 <&apps_smmu 0x724 0x3>;
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 40e8c11f23ab..0508e86140bd 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -4103,7 +4103,7 @@ opp-257000000 {
 		};
 
 		adreno_smmu: iommu@5040000 {
-			compatible = "qcom,sdm845-smmu-v2", "qcom,smmu-v2";
+			compatible = "qcom,sdm845-smmu-v2", "qcom,adreno-smmu", "qcom,smmu-v2";
 			reg = <0 0x5040000 0 0x10000>;
 			#iommu-cells = <1>;
 			#global-interrupts = <2>;
-- 
2.25.1


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

* Re: [PATCH v18 3/4] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU
  2020-11-02 17:14 ` [PATCH v18 3/4] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU Jordan Crouse
@ 2020-11-02 18:22   ` Robin Murphy
  2020-11-02 18:32     ` Robin Murphy
  0 siblings, 1 reply; 6+ messages in thread
From: Robin Murphy @ 2020-11-02 18:22 UTC (permalink / raw)
  To: Jordan Crouse, linux-arm-msm
  Cc: iommu, Will Deacon, Rob Herring, Rob Clark, Bjorn Andersson,
	Joerg Roedel, Rob Herring, devicetree, linux-arm-kernel,
	linux-kernel

On 2020-11-02 17:14, Jordan Crouse wrote:
> Every Qcom Adreno GPU has an embedded SMMU for its own use. These
> devices depend on unique features such as split pagetables,
> different stall/halt requirements and other settings. Identify them
> with a compatible string so that they can be identified in the
> arm-smmu implementation specific code.
> 
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
>   Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> index 503160a7b9a0..3b63f2ae24db 100644
> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> @@ -28,8 +28,6 @@ properties:
>             - enum:
>                 - qcom,msm8996-smmu-v2
>                 - qcom,msm8998-smmu-v2
> -              - qcom,sc7180-smmu-v2
> -              - qcom,sdm845-smmu-v2

What about the "Apps SMMU" instances? Those are distinct and don't 
have/need the GPU special behaviour, right?

Robin.

>             - const: qcom,smmu-v2
>   
>         - description: Qcom SoCs implementing "arm,mmu-500"
> @@ -40,6 +38,13 @@ properties:
>                 - qcom,sm8150-smmu-500
>                 - qcom,sm8250-smmu-500
>             - const: arm,mmu-500
> +      - description: Qcom Adreno GPUs implementing "arm,smmu-v2"
> +        items:
> +          - enum:
> +              - qcom,sc7180-smmu-v2
> +              - qcom,sdm845-smmu-v2
> +          - const: qcom,adreno-smmu
> +          - const: qcom,smmu-v2
>         - description: Marvell SoCs implementing "arm,mmu-500"
>           items:
>             - const: marvell,ap806-smmu-500
> 

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

* Re: [PATCH v18 3/4] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU
  2020-11-02 18:22   ` Robin Murphy
@ 2020-11-02 18:32     ` Robin Murphy
  0 siblings, 0 replies; 6+ messages in thread
From: Robin Murphy @ 2020-11-02 18:32 UTC (permalink / raw)
  To: Jordan Crouse, linux-arm-msm
  Cc: iommu, Will Deacon, Rob Herring, Rob Clark, Bjorn Andersson,
	Joerg Roedel, Rob Herring, devicetree, linux-arm-kernel,
	linux-kernel

On 2020-11-02 18:22, Robin Murphy wrote:
> On 2020-11-02 17:14, Jordan Crouse wrote:
>> Every Qcom Adreno GPU has an embedded SMMU for its own use. These
>> devices depend on unique features such as split pagetables,
>> different stall/halt requirements and other settings. Identify them
>> with a compatible string so that they can be identified in the
>> arm-smmu implementation specific code.
>>
>> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
>> Reviewed-by: Rob Herring <robh@kernel.org>
>> Signed-off-by: Rob Clark <robdclark@chromium.org>
>> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>> ---
>>
>>   Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml 
>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> index 503160a7b9a0..3b63f2ae24db 100644
>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> @@ -28,8 +28,6 @@ properties:
>>             - enum:
>>                 - qcom,msm8996-smmu-v2
>>                 - qcom,msm8998-smmu-v2
>> -              - qcom,sc7180-smmu-v2
>> -              - qcom,sdm845-smmu-v2
> 
> What about the "Apps SMMU" instances? Those are distinct and don't 
> have/need the GPU special behaviour, right?

Oh, having looked at patch #4, which prompted me go and look at the 845 
DTSI in context, now I realise the subtlety I overlooked. So I guess it 
really was worth resending, ha! Sorry for being thick :)

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> 
> Robin.
> 
>>             - const: qcom,smmu-v2
>>         - description: Qcom SoCs implementing "arm,mmu-500"
>> @@ -40,6 +38,13 @@ properties:
>>                 - qcom,sm8150-smmu-500
>>                 - qcom,sm8250-smmu-500
>>             - const: arm,mmu-500
>> +      - description: Qcom Adreno GPUs implementing "arm,smmu-v2"
>> +        items:
>> +          - enum:
>> +              - qcom,sc7180-smmu-v2
>> +              - qcom,sdm845-smmu-v2
>> +          - const: qcom,adreno-smmu
>> +          - const: qcom,smmu-v2
>>         - description: Marvell SoCs implementing "arm,mmu-500"
>>           items:
>>             - const: marvell,ap806-smmu-500
>>

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

* [PATCH v18 4/4] arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU
  2020-10-27 22:34 [PATCH v18 0/4] iommu/arm-smmu: Add adreno-smmu implementation and bindings Jordan Crouse
@ 2020-10-27 22:34 ` Jordan Crouse
  0 siblings, 0 replies; 6+ messages in thread
From: Jordan Crouse @ 2020-10-27 22:34 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Rob Clark, Bjorn Andersson, Andy Gross, Rob Herring, devicetree,
	linux-kernel

Set the qcom,adreno-smmu compatible string for the GPU SMMU to enable
split pagetables and per-instance pagetables for drm/msm.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

 arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 9 +++++++++
 arch/arm64/boot/dts/qcom/sdm845.dtsi       | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
index 64fc1bfd66fa..39f23cdcbd02 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
@@ -633,6 +633,15 @@ &mdss_mdp {
 	status = "okay";
 };
 
+/*
+ * Cheza fw does not properly program the GPU aperture to allow the
+ * GPU to update the SMMU pagetables for context switches.  Work
+ * around this by dropping the "qcom,adreno-smmu" compat string.
+ */
+&adreno_smmu {
+	compatible = "qcom,sdm845-smmu-v2", "qcom,smmu-v2";
+};
+
 &mss_pil {
 	iommus = <&apps_smmu 0x781 0x0>,
 		 <&apps_smmu 0x724 0x3>;
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 40e8c11f23ab..0508e86140bd 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -4103,7 +4103,7 @@ opp-257000000 {
 		};
 
 		adreno_smmu: iommu@5040000 {
-			compatible = "qcom,sdm845-smmu-v2", "qcom,smmu-v2";
+			compatible = "qcom,sdm845-smmu-v2", "qcom,adreno-smmu", "qcom,smmu-v2";
 			reg = <0 0x5040000 0 0x10000>;
 			#iommu-cells = <1>;
 			#global-interrupts = <2>;
-- 
2.25.1


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

end of thread, other threads:[~2020-11-02 18:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 17:14 [PATCH v18 0/4] iommu/arm-smmu: Add adreno-smmu implementation and bindings Jordan Crouse
2020-11-02 17:14 ` [PATCH v18 3/4] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU Jordan Crouse
2020-11-02 18:22   ` Robin Murphy
2020-11-02 18:32     ` Robin Murphy
2020-11-02 17:14 ` [PATCH v18 4/4] arm: dts: qcom: sm845: Set the compatible string for the " Jordan Crouse
  -- strict thread matches above, loose matches on Subject: below --
2020-10-27 22:34 [PATCH v18 0/4] iommu/arm-smmu: Add adreno-smmu implementation and bindings Jordan Crouse
2020-10-27 22:34 ` [PATCH v18 4/4] arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU Jordan Crouse

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).