Skip to contentSkip to conversation

arm64: dts: qcom: sa8775p: add more IOMMUs

PATCH Applied Bartosz Golaszewski 4 participants 13 messages Apr 11, 2023 – Apr 14, 2023

Subsystems (7)

v3 of 4 Applied Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover arm64: dts: qcom: sa8775p: add more IOMMUs

From: Bartosz Golaszewski <[email protected]>

Add the GPU and PCIe IOMMUs for sa8775p platforms as well as the required GPU clock controller driver.

NOTE: I didn't pick up Krzysztof's tag for patch 4/7 as the patch changed significantly.

v2 -> v3:
- select QCOM_GDSC in Kconfig for the GPUCC module
- the GPU SMMU is actually an adreno SMMU so describe it as such and fix the DT
- fix the mapped memory size for the PCIe SMMU

v1 -> v2:
- remove unused include in the GPUCC driver
- remove unused clock from the GPUCC driver and make it compatible with the generic QCom GPUCC bindings
- put the new defconfig option in the right place (as per savedefconfig) and make the GPUCC driver a module rather than built-in
- describe the smmu clocks for sa8775p in dt-bindings

Bartosz Golaszewski (6):
dt-bindings: clock: qcom: describe the GPUCC clock for SA8775P
arm64: defconfig: enable the SA8775P GPUCC driver
arm64: dts: qcom: sa8775p: add the pcie smmu node
arm64: dts: qcom: sa8775p: add the GPU clock controller node
dt-bindings: iommu: arm,smmu: enable clocks for sa8775p Adreno SMMU
arm64: dts: qcom: sa8775p: add the GPU IOMMU node

Shazad Hussain (1):
clk: qcom: add the GPUCC driver for sa8775p

 .../devicetree/bindings/clock/qcom,gpucc.yaml |   2 +
 .../devicetree/bindings/iommu/arm,smmu.yaml   |   6 +-
 arch/arm64/boot/dts/qcom/sa8775p.dtsi         | 125 ++++
 arch/arm64/configs/defconfig                  |   1 +
 drivers/clk/qcom/Kconfig                      |   9 +
 drivers/clk/qcom/Makefile                     |   1 +
 drivers/clk/qcom/gpucc-sa8775p.c              | 625 ++++++++++++++++++
 .../dt-bindings/clock/qcom,sa8775p-gpucc.h    |  50 ++
 8 files changed, 817 insertions(+), 2 deletions(-)
 create mode 100644 drivers/clk/qcom/gpucc-sa8775p.c
 create mode 100644 include/dt-bindings/clock/qcom,sa8775p-gpucc.h
Signature · 1 line
2.37.2
#1 lore raw

PATCH v3 1/7 dt-bindings: clock: qcom: describe the GPUCC clock for SA8775P

From: Bartosz Golaszewski <[email protected]>

Add the compatible for the Qualcomm Graphics Clock control module present on sa8775p platforms. It matches the generic QCom GPUCC description. Add device-specific DT bindings defines as well.

---
 .../devicetree/bindings/clock/qcom,gpucc.yaml |  2 +
 .../dt-bindings/clock/qcom,sa8775p-gpucc.h    | 50 +++++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 include/dt-bindings/clock/qcom,sa8775p-gpucc.h
Documentation/devicetree/bindings/clock/qcom,gpucc.yaml +2 -0
index db53eb288995..1e3dc9deded9 100644
@@ -15,6 +15,7 @@ description: |
 
   See also::
     include/dt-bindings/clock/qcom,gpucc-sdm845.h
+    include/dt-bindings/clock/qcom,gpucc-sa8775p.h
     include/dt-bindings/clock/qcom,gpucc-sc7180.h
     include/dt-bindings/clock/qcom,gpucc-sc7280.h
     include/dt-bindings/clock/qcom,gpucc-sc8280xp.h
@@ -27,6 +28,7 @@ properties:
   compatible:
     enum:
       - qcom,sdm845-gpucc
+      - qcom,sa8775p-gpucc
       - qcom,sc7180-gpucc
       - qcom,sc7280-gpucc
       - qcom,sc8180x-gpucc
include/dt-bindings/clock/qcom,sa8775p-gpucc.h new file +50 -0

50 lines not on this page · raw message

Signature · 1 line
2.37.2
#2 lore raw

PATCH v3 2/7 clk: qcom: add the GPUCC driver for sa8775p

In reply to Bartosz Golaszewski

From: Shazad Hussain <[email protected]>

Add the clock driver for the Qualcomm Graphics Clock control module.

[Bartosz: make ready for upstream]
---
 drivers/clk/qcom/Kconfig         |   9 +
 drivers/clk/qcom/Makefile        |   1 +
 drivers/clk/qcom/gpucc-sa8775p.c | 625 +++++++++++++++++++++++++++++++
 3 files changed, 635 insertions(+)
 create mode 100644 drivers/clk/qcom/gpucc-sa8775p.c
drivers/clk/qcom/Kconfig +9 -0
index d71c9d6036bb..12be3e2371b3 100644
@@ -445,6 +445,15 @@ config SA_GCC_8775P
 	  Say Y if you want to use peripheral devices such as UART, SPI,
 	  I2C, USB, UFS, SDCC, etc.
 
+config SA_GPUCC_8775P
+	tristate "SA8775P Graphics clock controller"
+	select QCOM_GDSC
+	select SA_GCC_8775P
+	help
+	  Support for the graphics clock controller on SA8775P devices.
+	  Say Y if you want to support graphics controller devices and
+	  functionality such as 3D graphics.
+
 config SC_GCC_7180
 	tristate "SC7180 Global Clock Controller"
 	select QCOM_GDSC
drivers/clk/qcom/Makefile +1 -0
index b54085e579a0..9ff4c373ad95 100644
@@ -72,6 +72,7 @@ obj-$(CONFIG_SC_DISPCC_7180) += dispcc-sc7180.o
 obj-$(CONFIG_SC_DISPCC_7280) += dispcc-sc7280.o
 obj-$(CONFIG_SC_DISPCC_8280XP) += dispcc-sc8280xp.o
 obj-$(CONFIG_SA_GCC_8775P) += gcc-sa8775p.o
+obj-$(CONFIG_SA_GPUCC_8775P) += gpucc-sa8775p.o
 obj-$(CONFIG_SC_GCC_7180) += gcc-sc7180.o
 obj-$(CONFIG_SC_GCC_7280) += gcc-sc7280.o
 obj-$(CONFIG_SC_GCC_8180X) += gcc-sc8180x.o
drivers/clk/qcom/gpucc-sa8775p.c new file +625 -0

625 lines not on this page · raw message

Signature · 1 line
2.37.2
#3 lore raw

PATCH v3 3/7 arm64: defconfig: enable the SA8775P GPUCC driver

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Enable the GPUCC module for SA8775P platforms in the arm64 defconfig.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index b6342b40c600..e1063ab32658 100644
@@ -1164,6 +1164,7 @@ CONFIG_MSM_GCC_8998=y
 CONFIG_QCS_GCC_404=y
 CONFIG_SA_GCC_8775P=y
 CONFIG_SC_DISPCC_8280XP=m
+CONFIG_SA_GPUCC_8775P=m
 CONFIG_SC_GCC_7180=y
 CONFIG_SC_GCC_7280=y
 CONFIG_SC_GCC_8180X=y
Signature · 1 line
2.37.2
#4 lore raw

PATCH v3 4/7 arm64: dts: qcom: sa8775p: add the pcie smmu node

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the PCIe SMMU node for sa8775p platforms.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 74 +++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +74 -0
index 2343df7e0ea4..a23175352a20 100644
@@ -809,6 +809,80 @@ apps_smmu: iommu@15000000 {
 				     <GIC_SPI 891 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		pcie_smmu: iommu@15200000 {
+			compatible = "qcom,sa8775p-smmu-500", "qcom,smmu-500", "arm,mmu-500";
+			reg = <0x0 0x15200000 0x0 0x80000>;
+			#iommu-cells = <2>;
+			#global-interrupts = <2>;
+
+			interrupts = <GIC_SPI 920 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 921 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 925 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 926 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 927 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 928 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 950 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 951 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 952 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 953 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 954 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 955 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 956 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 957 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 958 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 885 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 886 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 887 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 888 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 820 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 822 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 823 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 446 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 447 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 452 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 840 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 841 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 842 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 843 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 844 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 845 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 846 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 847 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 848 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 849 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 802 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 803 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 804 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 805 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 806 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 807 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 808 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 809 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 810 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 811 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 812 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 813 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 814 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 836 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 837 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 838 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 839 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 854 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 855 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 856 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 790 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 791 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 792 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 793 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 794 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 795 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 796 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 639 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 640 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
 		intc: interrupt-controller@17a00000 {
 			compatible = "arm,gic-v3";
 			reg = <0x0 0x17a00000 0x0 0x10000>,     /* GICD */
Signature · 1 line
2.37.2
#5 lore raw

PATCH v3 5/7 arm64: dts: qcom: sa8775p: add the GPU clock controller node

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the GPUCC node for sa8775p platforms.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +14 -0
index a23175352a20..191b510b5a1a 100644
@@ -591,6 +591,20 @@ tcsr_mutex: hwlock@1f40000 {
 			#hwlock-cells = <1>;
 		};
 
+		gpucc: clock-controller@3d90000 {
+			compatible = "qcom,sa8775p-gpucc";
+			reg = <0x0 0x03d90000 0x0 0xa000>;
+			clocks = <&rpmhcc RPMH_CXO_CLK>,
+				 <&gcc GCC_GPU_GPLL0_CLK_SRC>,
+				 <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>;
+			clock-names = "bi_tcxo",
+				      "gcc_gpu_gpll0_clk_src",
+				      "gcc_gpu_gpll0_div_clk_src";
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+			#power-domain-cells = <1>;
+		};
+
 		pdc: interrupt-controller@b220000 {
 			compatible = "qcom,sa8775p-pdc", "qcom,pdc";
 			reg = <0x0 0x0b220000 0x0 0x30000>,
Signature · 1 line
2.37.2
#6 lore raw

PATCH v3 6/7 dt-bindings: iommu: arm,smmu: enable clocks for sa8775p Adreno SMMU

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The GPU SMMU will require the clocks property to be set so put the relevant compatible into the adreno if-then block.

---
 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +4 -2
index 807cb511fe18..d966dc65ce10 100644
@@ -79,6 +79,7 @@ properties:
       - description: Qcom Adreno GPUs implementing "arm,smmu-500"
         items:
           - enum:
+              - qcom,sa8775p-smmu-500
               - qcom,sc7280-smmu-500
               - qcom,sm8150-smmu-500
               - qcom,sm8250-smmu-500
@@ -317,7 +318,9 @@ allOf:
       properties:
         compatible:
           contains:
-            const: qcom,sc7280-smmu-500
+            enum:
+              - qcom,sa8775p-smmu-500
+              - qcom,sc7280-smmu-500
     then:
       properties:
         clock-names:
@@ -375,7 +378,6 @@ allOf:
               - nvidia,smmu-500
               - qcom,qcm2290-smmu-500
               - qcom,qdu1000-smmu-500
-              - qcom,sa8775p-smmu-500
               - qcom,sc7180-smmu-500
               - qcom,sc8180x-smmu-500
               - qcom,sc8280xp-smmu-500
Signature · 1 line
2.37.2
#8 lore raw

PATCH v3 7/7 arm64: dts: qcom: sa8775p: add the GPU IOMMU node

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the Adreno GPU IOMMU for sa8775p-based platforms.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 37 +++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +37 -0
index 191b510b5a1a..11f3d80dd869 100644
@@ -7,6 +7,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/clock/qcom,sa8775p-gcc.h>
+#include <dt-bindings/clock/qcom,sa8775p-gpucc.h>
 #include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>
@@ -605,6 +606,42 @@ gpucc: clock-controller@3d90000 {
 			#power-domain-cells = <1>;
 		};
 
+		adreno_smmu: iommu@3da0000 {
+			compatible = "qcom,sa8775p-smmu-500", "qcom,adreno-smmu",
+				     "arm,mmu-500";
+			reg = <0x0 0x03da0000 0x0 0x20000>;
+			#iommu-cells = <2>;
+			#global-interrupts = <2>;
+			dma-coherent;
+			power-domains = <&gpucc GPU_CC_CX_GDSC>;
+			clocks = <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
+				 <&gcc GCC_GPU_SNOC_DVM_GFX_CLK>,
+				 <&gpucc GPU_CC_AHB_CLK>,
+				 <&gpucc GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK>,
+				 <&gpucc GPU_CC_CX_GMU_CLK>,
+				 <&gpucc GPU_CC_HUB_CX_INT_CLK>,
+				 <&gpucc GPU_CC_HUB_AON_CLK>;
+			clock-names = "gcc_gpu_memnoc_gfx_clk",
+				      "gcc_gpu_snoc_dvm_gfx_clk",
+				      "gpu_cc_ahb_clk",
+				      "gpu_cc_hlos1_vote_gpu_smmu_clk",
+				      "gpu_cc_cx_gmu_clk",
+				      "gpu_cc_hub_cx_int_clk",
+				      "gpu_cc_hub_aon_clk";
+			interrupts = <GIC_SPI 673 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 674 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 678 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 679 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 680 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 681 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 682 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 683 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 684 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 685 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 686 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 687 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
 		pdc: interrupt-controller@b220000 {
 			compatible = "qcom,sa8775p-pdc", "qcom,pdc";
 			reg = <0x0 0x0b220000 0x0 0x30000>,
Signature · 1 line
2.37.2
#9 lore raw

Re: [PATCH v3 7/7] arm64: dts: qcom: sa8775p: add the GPU IOMMU node

Quoted 22 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the Adreno GPU IOMMU for sa8775p-based platforms.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 37 +++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +1 -0
index 191b510b5a1a..11f3d80dd869 100644
@@ -7,6 +7,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/clock/qcom,sa8775p-gcc.h>
+#include <dt-bindings/clock/qcom,sa8775p-gpucc.h>
 #include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>

arch/arm64/boot/dts/qcom/sa8775p.dtsi gpucc: clock-controller@3d90000 { · line 611

Quoted 6 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +3 -0
@@ -605,6 +606,42 @@ gpucc: clock-controller@3d90000 {
 			#power-domain-cells = <1>;
 		};
 
+		adreno_smmu: iommu@3da0000 {
+			compatible = "qcom,sa8775p-smmu-500", "qcom,adreno-smmu",
+				     "arm,mmu-500";

Err.. does it even boot like this? You dropped the qcom,smmu-500 compatible which means it's getting bound to the generic SMMU driver (without QC quirks). If that was a mistake, you should have had all 4

"qcom,sa8775p-smmu-500", qcom,adreno-smmu, "qcom,smmu-500", "arm,mmu-500"

Without falling into the qc-specific codepaths, the Adreno compat does nothing.

Konrad

Quoted 36 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +33 -0
+			reg = <0x0 0x03da0000 0x0 0x20000>;
+			#iommu-cells = <2>;
+			#global-interrupts = <2>;
+			dma-coherent;
+			power-domains = <&gpucc GPU_CC_CX_GDSC>;
+			clocks = <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
+				 <&gcc GCC_GPU_SNOC_DVM_GFX_CLK>,
+				 <&gpucc GPU_CC_AHB_CLK>,
+				 <&gpucc GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK>,
+				 <&gpucc GPU_CC_CX_GMU_CLK>,
+				 <&gpucc GPU_CC_HUB_CX_INT_CLK>,
+				 <&gpucc GPU_CC_HUB_AON_CLK>;
+			clock-names = "gcc_gpu_memnoc_gfx_clk",
+				      "gcc_gpu_snoc_dvm_gfx_clk",
+				      "gpu_cc_ahb_clk",
+				      "gpu_cc_hlos1_vote_gpu_smmu_clk",
+				      "gpu_cc_cx_gmu_clk",
+				      "gpu_cc_hub_cx_int_clk",
+				      "gpu_cc_hub_aon_clk";
+			interrupts = <GIC_SPI 673 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 674 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 678 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 679 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 680 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 681 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 682 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 683 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 684 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 685 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 686 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 687 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
 		pdc: interrupt-controller@b220000 {
 			compatible = "qcom,sa8775p-pdc", "qcom,pdc";
 			reg = <0x0 0x0b220000 0x0 0x30000>,
#10 lore raw

Re: [PATCH v3 7/7] arm64: dts: qcom: sa8775p: add the GPU IOMMU node

Quoted 36 lines · Konrad Dybcio
Quoted 22 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the Adreno GPU IOMMU for sa8775p-based platforms.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 37 +++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +1 -0
index 191b510b5a1a..11f3d80dd869 100644
@@ -7,6 +7,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/clock/qcom,sa8775p-gcc.h>
+#include <dt-bindings/clock/qcom,sa8775p-gpucc.h>
 #include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>

arch/arm64/boot/dts/qcom/sa8775p.dtsi gpucc: clock-controller@3d90000 { · line 611

Quoted 6 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +3 -0
@@ -605,6 +606,42 @@ gpucc: clock-controller@3d90000 {
                      #power-domain-cells = <1>;
              };
 
+             adreno_smmu: iommu@3da0000 {
+                     compatible = "qcom,sa8775p-smmu-500", "qcom,adreno-smmu",
+                                  "arm,mmu-500";

Err.. does it even boot like this? You dropped the qcom,smmu-500 compatible which means it's getting bound to the generic SMMU driver (without QC quirks). If that was a mistake, you should have had all 4

Quoted 5 lines

"qcom,sa8775p-smmu-500", qcom,adreno-smmu, "qcom,smmu-500", "arm,mmu-500"

Without falling into the qc-specific codepaths, the Adreno compat does nothing.

I did that initially, then noticed dtbs_check fails because the existing adreno GPUs implementing "arm,smmu-500" expect three compatibles like in this commit. I did that and the driver still probed the same so I assumed all's good. You're right of course, the adreno impl is not being assigned without "qcom,smmu-500". Are the bindings wrong in this case and should it be something like the following?

(quoted diff) +0 -0

b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml index d966dc65ce10..cd1b052a7242 100644

Documentation/devicetree/bindings/iommu/arm,smmu.yaml +1 -0
@@ -84,6 +84,7 @@ properties:
               - qcom,sm8150-smmu-500
               - qcom,sm8250-smmu-500
           - const: qcom,adreno-smmu
+          - const: qcom,smmu-500
           - const: arm,mmu-500
       - description: Qcom Adreno GPUs implementing "arm,smmu-v2"
         items:

Bartosz

Quoted 37 lines

Konrad

Quoted 36 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +33 -0
+                     reg = <0x0 0x03da0000 0x0 0x20000>;
+                     #iommu-cells = <2>;
+                     #global-interrupts = <2>;
+                     dma-coherent;
+                     power-domains = <&gpucc GPU_CC_CX_GDSC>;
+                     clocks = <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
+                              <&gcc GCC_GPU_SNOC_DVM_GFX_CLK>,
+                              <&gpucc GPU_CC_AHB_CLK>,
+                              <&gpucc GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK>,
+                              <&gpucc GPU_CC_CX_GMU_CLK>,
+                              <&gpucc GPU_CC_HUB_CX_INT_CLK>,
+                              <&gpucc GPU_CC_HUB_AON_CLK>;
+                     clock-names = "gcc_gpu_memnoc_gfx_clk",
+                                   "gcc_gpu_snoc_dvm_gfx_clk",
+                                   "gpu_cc_ahb_clk",
+                                   "gpu_cc_hlos1_vote_gpu_smmu_clk",
+                                   "gpu_cc_cx_gmu_clk",
+                                   "gpu_cc_hub_cx_int_clk",
+                                   "gpu_cc_hub_aon_clk";
+                     interrupts = <GIC_SPI 673 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 674 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 678 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 679 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 680 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 681 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 682 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 683 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 684 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 685 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 686 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 687 IRQ_TYPE_LEVEL_HIGH>;
+             };
+
              pdc: interrupt-controller@b220000 {
                      compatible = "qcom,sa8775p-pdc", "qcom,pdc";
                      reg = <0x0 0x0b220000 0x0 0x30000>,
#11 lore raw

Re: [PATCH v3 7/7] arm64: dts: qcom: sa8775p: add the GPU IOMMU node

Quoted 65 lines · Bartosz Golaszewski
Quoted 36 lines · Konrad Dybcio
Quoted 22 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the Adreno GPU IOMMU for sa8775p-based platforms.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 37 +++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +1 -0
index 191b510b5a1a..11f3d80dd869 100644
@@ -7,6 +7,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/clock/qcom,sa8775p-gcc.h>
+#include <dt-bindings/clock/qcom,sa8775p-gpucc.h>
 #include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>

arch/arm64/boot/dts/qcom/sa8775p.dtsi gpucc: clock-controller@3d90000 { · line 611

Quoted 6 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +3 -0
@@ -605,6 +606,42 @@ gpucc: clock-controller@3d90000 {
                      #power-domain-cells = <1>;
              };
 
+             adreno_smmu: iommu@3da0000 {
+                     compatible = "qcom,sa8775p-smmu-500", "qcom,adreno-smmu",
+                                  "arm,mmu-500";

Err.. does it even boot like this? You dropped the qcom,smmu-500 compatible which means it's getting bound to the generic SMMU driver (without QC quirks). If that was a mistake, you should have had all 4

Quoted 5 lines

"qcom,sa8775p-smmu-500", qcom,adreno-smmu, "qcom,smmu-500", "arm,mmu-500"

Without falling into the qc-specific codepaths, the Adreno compat does nothing.

I did that initially, then noticed dtbs_check fails because the existing adreno GPUs implementing "arm,smmu-500" expect three compatibles like in this commit. I did that and the driver still probed the same so I assumed all's good. You're right of course, the adreno impl is not being assigned without "qcom,smmu-500". Are the bindings wrong in this case and should it be something like the following?

Documentation/devicetree/bindings/iommu/arm,smmu.yaml +1 -0
index d966dc65ce10..cd1b052a7242 100644
@@ -84,6 +84,7 @@ properties:
               - qcom,sm8150-smmu-500
               - qcom,sm8250-smmu-500
           - const: qcom,adreno-smmu
+          - const: qcom,smmu-500
           - const: arm,mmu-500
       - description: Qcom Adreno GPUs implementing "arm,smmu-v2"
         items:
Quoted 1 line

Bartosz

Check

https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/commit/?h=for-joerg/arm-smmu/bindings&id=5c3686616b1840b3143b227eb58fb1c1621d204e

Konrad

Quoted 38 lines
Quoted 38 lines

Konrad

Quoted 36 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +33 -0
+                     reg = <0x0 0x03da0000 0x0 0x20000>;
+                     #iommu-cells = <2>;
+                     #global-interrupts = <2>;
+                     dma-coherent;
+                     power-domains = <&gpucc GPU_CC_CX_GDSC>;
+                     clocks = <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
+                              <&gcc GCC_GPU_SNOC_DVM_GFX_CLK>,
+                              <&gpucc GPU_CC_AHB_CLK>,
+                              <&gpucc GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK>,
+                              <&gpucc GPU_CC_CX_GMU_CLK>,
+                              <&gpucc GPU_CC_HUB_CX_INT_CLK>,
+                              <&gpucc GPU_CC_HUB_AON_CLK>;
+                     clock-names = "gcc_gpu_memnoc_gfx_clk",
+                                   "gcc_gpu_snoc_dvm_gfx_clk",
+                                   "gpu_cc_ahb_clk",
+                                   "gpu_cc_hlos1_vote_gpu_smmu_clk",
+                                   "gpu_cc_cx_gmu_clk",
+                                   "gpu_cc_hub_cx_int_clk",
+                                   "gpu_cc_hub_aon_clk";
+                     interrupts = <GIC_SPI 673 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 674 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 678 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 679 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 680 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 681 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 682 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 683 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 684 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 685 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 686 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 687 IRQ_TYPE_LEVEL_HIGH>;
+             };
+
              pdc: interrupt-controller@b220000 {
                      compatible = "qcom,sa8775p-pdc", "qcom,pdc";
                      reg = <0x0 0x0b220000 0x0 0x30000>,
Acked-by on v3 6/7
#7 lore raw

Re: [PATCH v3 6/7] dt-bindings: iommu: arm,smmu: enable clocks for sa8775p Adreno SMMU

In reply to Bartosz Golaszewski
Quoted 7 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The GPU SMMU will require the clocks property to be set so put the relevant compatible into the adreno if-then block.

---

This is a friendly reminder during the review process.

It looks like you received a tag and forgot to add it.

If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply.

https://elixir.bootlin.com/linux/v5.17/source/Documentation/process/submitting-patches.rst#L540

If a tag was not added on purpose, please state why and what changed.

Best regards,
Krzysztof

maintainer Applied
#12 lore raw

Re: (subset) [PATCH v3 0/7] arm64: dts: qcom: sa8775p: add more IOMMUs

In reply to Bartosz Golaszewski
Quoted 9 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the GPU and PCIe IOMMUs for sa8775p platforms as well as the required GPU clock controller driver.

NOTE: I didn't pick up Krzysztof's tag for patch 4/7 as the patch changed significantly.

[...]

Applied, thanks!

[1/7] dt-bindings: clock: qcom: describe the GPUCC clock for SA8775P

      commit: daa9e76d17570cdd2dbec28244e60e2cb0eafb36
[2/7] clk: qcom: add the GPUCC driver for sa8775p
      commit: 0afa16afc36d0e462c7f815b0131d2e9013849ac

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>