Skip to contentSkip to conversation

arm64: dts: qcom: sa8775p: add more IOMMUs

PATCH Superseded Bartosz Golaszewski 6 participants 20 messages Mar 28, 2023 – Apr 10, 2023

Subsystems (7)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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.

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

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

 .../bindings/clock/qcom,sa8775p-gpucc.yaml    |  61 ++
 .../devicetree/bindings/iommu/arm,smmu.yaml   |   1 -
 arch/arm64/boot/dts/qcom/sa8775p.dtsi         | 115 ++++
 arch/arm64/configs/defconfig                  |   1 +
 drivers/clk/qcom/Kconfig                      |   8 +
 drivers/clk/qcom/Makefile                     |   1 +
 drivers/clk/qcom/gpucc-sa8775p.c              | 633 ++++++++++++++++++
 .../dt-bindings/clock/qcom,sa8775p-gpucc.h    |  50 ++
 8 files changed, 869 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sa8775p-gpucc.yaml
 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 1/7 dt-bindings: clock: qcom: describe the GPUCC clock for SA8775P

From: Bartosz Golaszewski <[email protected]>

Add bindings for the Qualcomm Graphics Clock control module present on sa8775p platforms.

Cc Stephen Boyd <[email protected]>
Cc Michael Turquette <[email protected]>
---
 .../bindings/clock/qcom,sa8775p-gpucc.yaml    | 61 +++++++++++++++++++
 .../dt-bindings/clock/qcom,sa8775p-gpucc.h    | 50 +++++++++++++++
 2 files changed, 111 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sa8775p-gpucc.yaml
 create mode 100644 include/dt-bindings/clock/qcom,sa8775p-gpucc.h
Documentation/devicetree/bindings/clock/qcom,sa8775p-gpucc.yaml new file +61 -0
new file mode 100644
index 000000000000..203802f81738
@@ -0,0 +1,61 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sa8775p-gpucc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Graphics Clock & Reset Controller on SA8775P
+
+maintainers:
+  - Bjorn Andersson <[email protected]>
+  - Bartosz Golaszewski <[email protected]>
+
+description: |
+  Qualcomm graphics clock control module provides clocks, resets and power
+  domains on Qualcomm SoCs.
+
+  See also:: include/dt-bindings/clock/qcom,sa8775p-gpucc.h
+
+properties:
+  compatible:
+    enum:
+      - qcom,sa8775p-gpucc
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: GPLL0 main branch source
+      - description: GPLL0 div branch source
+      - description: SNoC DVM GFX source
+
+required:
+  - compatible
+  - clocks
+
+allOf:
+  - $ref: qcom,gcc.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,sa8775p-gcc.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        clock-controller@3d90000 {
+            compatible = "qcom,sa8775p-gpucc";
+            reg = <0x0 0x03d90000 0x0 0xa000>;
+            clocks = <&gcc GCC_GPU_CFG_AHB_CLK>,
+                     <&rpmhcc RPMH_CXO_CLK>,
+                     <&gcc GCC_GPU_GPLL0_CLK_SRC>,
+                     <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>;
+            #clock-cells = <1>;
+            #reset-cells = <1>;
+            #power-domain-cells = <1>;
+        };
+    };
+...
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
#3 lore raw

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

Cc Stephen Boyd <[email protected]>
Cc Michael Turquette <[email protected]>
[Bartosz: make ready for upstream]
---
 drivers/clk/qcom/Kconfig         |   8 +
 drivers/clk/qcom/Makefile        |   1 +
 drivers/clk/qcom/gpucc-sa8775p.c | 633 +++++++++++++++++++++++++++++++
 3 files changed, 642 insertions(+)
 create mode 100644 drivers/clk/qcom/gpucc-sa8775p.c
drivers/clk/qcom/Kconfig +8 -0
index 449bc8314d21..5e1919738aeb 100644
@@ -437,6 +437,14 @@ 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 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 c1adb427d1ef..525e0172a1ef 100644
@@ -71,6 +71,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 +633 -0

633 lines not on this page · raw message

Signature · 1 line
2.37.2
#8 lore raw

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

Cc Arnd Bergmann <[email protected]>
Cc Catalin Marinas <[email protected]>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index d206a9120ee4..fa0a145defe2 100644
@@ -1161,6 +1161,7 @@ CONFIG_MSM_MMCC_8998=m
 CONFIG_MSM_GCC_8998=y
 CONFIG_QCS_GCC_404=y
 CONFIG_SA_GCC_8775P=y
+CONFIG_SA_GPUCC_8775P=y
 CONFIG_SC_DISPCC_8280XP=m
 CONFIG_SC_GCC_7180=y
 CONFIG_SC_GCC_7280=y
Signature · 1 line
2.37.2
#11 lore raw

PATCH 4/7 dt-bindings: iommu: arm,smmu: enable clocks for sa8775p

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The KGSL iommu will require the clocks property to be set. Enable it for sa8775p in the bindings.

Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Joerg Roedel <[email protected]>
---
 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +0 -1
index 807cb511fe18..74d5164ed1e8 100644
@@ -375,7 +375,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
#15 lore raw

PATCH 5/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..9ab630c7d81b 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 0x800000>;
+			#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
#19 lore raw

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

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the GPU IOMMU for sa8775p-based platforms.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 29 +++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +29 -0
index 4c45ad1cc7ff..de5e8449397c 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>
@@ -603,6 +604,34 @@ gpucc: clock-controller@3d90000 {
 			#power-domain-cells = <1>;
 		};
 
+		kgsl_smmu: iommu@3da0000 {
+			compatible = "qcom,sa8775p-smmu-500", "qcom,smmu-500", "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>;
+			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
#17 lore raw

PATCH 6/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 | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +12 -0
index 9ab630c7d81b..4c45ad1cc7ff 100644
@@ -591,6 +591,18 @@ tcsr_mutex: hwlock@1f40000 {
 			#hwlock-cells = <1>;
 		};
 
+		gpucc: clock-controller@3d90000 {
+			compatible = "qcom,sa8775p-gpucc";
+			reg = <0x0 0x03d90000 0x0 0xa000>;
+			clocks = <&gcc GCC_GPU_CFG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>,
+				 <&gcc GCC_GPU_GPLL0_CLK_SRC>,
+				 <&gcc 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
maintainer
#4 lore raw

Re: [PATCH 2/7] clk: qcom: add the GPUCC driver for sa8775p

In reply to Bartosz Golaszewski

Quoting Bartosz Golaszewski (2023-03-28 12:36:27)

drivers/clk/qcom/Kconfig config SA_GCC_8775P · line 442

Quoted 11 lines
drivers/clk/qcom/Kconfig +3 -0
index 449bc8314d21..5e1919738aeb 100644
@@ -437,6 +437,14 @@ 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 SA_GCC_8775P

Should select QCOM_GDSC as well.

Quoted 14 lines
drivers/clk/qcom/Kconfig +5 -0
+       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/gpucc-sa8775p.c new file +0 -0
new file mode 100644
index 000000000000..46d73bd0199b

drivers/clk/qcom/gpucc-sa8775p.c line 7

Quoted 7 lines
drivers/clk/qcom/gpucc-sa8775p.c new file +7 -0
@@ -0,0 +1,633 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2023, Linaro Limited
+ */
+
+#include <linux/clk.h>

Is this include used? If not, remove it as this is a clk provider and not a clk consumer.

Reviewed-by on v1 1/7
#2 lore raw

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

In reply to Bartosz Golaszewski
Quoted 7 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add bindings for the Qualcomm Graphics Clock control module present on sa8775p platforms.

Cc Stephen Boyd <[email protected]>
Cc Michael Turquette <[email protected]>

Please drop the autogenerated scripts/get_maintainer.pl CC-entries from commit msg. There is no single need to store automated output of get_maintainers.pl in the git log. It can be easily re-created at any given time, thus its presence in the git history is redundant and obfuscates the log.

If you need it for your own patch management purposes, keep it under the --- separator.

Quoted 1 line

Best regards,
Krzysztof

#12 lore raw

Re: [PATCH 4/7] dt-bindings: iommu: arm,smmu: enable clocks for sa8775p

In reply to Bartosz Golaszewski
Quoted 18 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The KGSL iommu will require the clocks property to be set. Enable it for sa8775p in the bindings.

Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Joerg Roedel <[email protected]>
---
 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +0 -0
index 807cb511fe18..74d5164ed1e8 100644

Documentation/devicetree/bindings/iommu/arm,smmu.yaml allOf: · line 378

Quoted 4 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +0 -1
@@ -375,7 +375,6 @@ allOf:
               - nvidia,smmu-500
               - qcom,qcm2290-smmu-500
               - qcom,qdu1000-smmu-500
-              - qcom,sa8775p-smmu-500

Then you need to describe them, like other variants are doing.

Best regards,
Krzysztof

#9 lore raw

Re: [PATCH 3/7] arm64: defconfig: enable the SA8775P GPUCC driver

In reply to Bartosz Golaszewski
Quoted 3 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

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

...for Qualcomm SA8775P platforms...

(you know, this is defconfig for every ARMv8 SoC)

Quoted 13 lines
Cc Arnd Bergmann <[email protected]>
Cc Catalin Marinas <[email protected]>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +0 -0
index d206a9120ee4..fa0a145defe2 100644

arch/arm64/configs/defconfig CONFIG_MSM_MMCC_8998=m · line 1164

Quoted 4 lines
arch/arm64/configs/defconfig +1 -0
@@ -1161,6 +1161,7 @@ CONFIG_MSM_MMCC_8998=m
 CONFIG_MSM_GCC_8998=y
 CONFIG_QCS_GCC_404=y
 CONFIG_SA_GCC_8775P=y
+CONFIG_SA_GPUCC_8775P=y

Are you sure this is correct place? Your Kconfig has it in different location.

arch/arm64/configs/defconfig CONFIG_MSM_MMCC_8998=m · line 1167

Quoted 3 lines
arch/arm64/configs/defconfig +0 -0
 CONFIG_SC_DISPCC_8280XP=m
 CONFIG_SC_GCC_7180=y
 CONFIG_SC_GCC_7280=y

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH 2/7] clk: qcom: add the GPUCC driver for sa8775p

In reply to Bartosz Golaszewski
Quoted 11 lines · Bartosz Golaszewski

From: Shazad Hussain <[email protected]>

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

Cc Stephen Boyd <[email protected]>
Cc Michael Turquette <[email protected]>
[Bartosz: make ready for upstream]

---

[...]

drivers/clk/qcom/gpucc-sa8775p.c line 29

Quoted 3 lines
drivers/clk/qcom/gpucc-sa8775p.c new file +3 -0
+/* Need to match the order of clocks in DT binding */
+enum {
+	DT_IFACE,

I think it's never used?

[...]

Quoted 6 lines
drivers/clk/qcom/gpucc-sa8775p.c new file +6 -0
+static int gpu_cc_sa8775p_probe(struct platform_device *pdev)
+{
+	struct regmap *regmap;
+
+	regmap = qcom_cc_map(pdev, &gpu_cc_sa8775p_desc);
+	if (IS_ERR(regmap))

drivers/clk/qcom/gpucc-sa8775p.c line 607

Quoted 10 lines
drivers/clk/qcom/gpucc-sa8775p.c new file +10 -0
+		return PTR_ERR(regmap);
+
+	clk_lucid_evo_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config);
+	clk_lucid_evo_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config);
+
+	/*
+	 * Keep the clocks always-ON
+	 * GPU_CC_CB_CLK
+	 */
+	regmap_update_bits(regmap, 0x93a4, BIT(0), BIT(0));

You set it as CRITICAL, this should be unnecessary now.

Konrad

Quoted 26 lines
drivers/clk/qcom/gpucc-sa8775p.c new file +26 -0
+
+	return qcom_cc_really_probe(pdev, &gpu_cc_sa8775p_desc, regmap);
+}
+
+static struct platform_driver gpu_cc_sa8775p_driver = {
+	.probe = gpu_cc_sa8775p_probe,
+	.driver = {
+		.name = "gpu_cc-sa8775p",
+		.of_match_table = gpu_cc_sa8775p_match_table,
+	},
+};
+
+static int __init gpu_cc_sa8775p_init(void)
+{
+	return platform_driver_register(&gpu_cc_sa8775p_driver);
+}
+subsys_initcall(gpu_cc_sa8775p_init);
+
+static void __exit gpu_cc_sa8775p_exit(void)
+{
+	platform_driver_unregister(&gpu_cc_sa8775p_driver);
+}
+module_exit(gpu_cc_sa8775p_exit);
+
+MODULE_DESCRIPTION("SA8775P GPUCC driver");
+MODULE_LICENSE("GPL");
Reviewed-by on v1 6/7
#18 lore raw

Re: [PATCH 6/7] arm64: dts: qcom: sa8775p: add the GPU clock controller node

In reply to Bartosz Golaszewski
Quoted 14 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the GPUCC node for sa8775p platforms.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +0 -0
index 9ab630c7d81b..4c45ad1cc7ff 100644

arch/arm64/boot/dts/qcom/sa8775p.dtsi tcsr_mutex: hwlock@1f40000 { · line 600

Quoted 10 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +7 -0
@@ -591,6 +591,18 @@ tcsr_mutex: hwlock@1f40000 {
 			#hwlock-cells = <1>;
 		};
 
+		gpucc: clock-controller@3d90000 {
+			compatible = "qcom,sa8775p-gpucc";
+			reg = <0x0 0x03d90000 0x0 0xa000>;
+			clocks = <&gcc GCC_GPU_CFG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>,
+				 <&gcc GCC_GPU_GPLL0_CLK_SRC>,
+				 <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>;

Without the first clock, as pointed out in the clk review:

(that also makes it compatible with the generic gpucc bindings!)

Konrad

Quoted 8 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +5 -0
+			#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>,
Reviewed-by on v1 5/7
#16 lore raw

Re: [PATCH 5/7] arm64: dts: qcom: sa8775p: add the pcie smmu node

In reply to Bartosz Golaszewski
Quoted 15 lines · 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 +0 -0
index 2343df7e0ea4..9ab630c7d81b 100644
@@ -809,6 +809,80 @@ apps_smmu: iommu@15000000 {
 				     <GIC_SPI 891 IRQ_TYPE_LEVEL_HIGH>;

arch/arm64/boot/dts/qcom/sa8775p.dtsi apps_smmu: iommu@15000000 { · line 819

Quoted 10 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +8 -0
 		};
 
+		pcie_smmu: iommu@15200000 {
+			compatible = "qcom,sa8775p-smmu-500", "qcom,smmu-500", "arm,mmu-500";
+			reg = <0x0 0x15200000 0x0 0x800000>;
+			#iommu-cells = <2>;
+			#global-interrupts = <2>;
+
+			interrupts = <GIC_SPI 920 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 921 IRQ_TYPE_LEVEL_HIGH>,

That's a lot of interrupts!

Konrad

Quoted 69 lines
arch/arm64/boot/dts/qcom/sa8775p.dtsi +66 -0
+				     <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 */
maintainer
#13 lore raw

Re: [PATCH 4/7] dt-bindings: iommu: arm,smmu: enable clocks for sa8775p

In reply to Bartosz Golaszewski
Quoted 3 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The KGSL iommu will require the clocks property to be set. Enable it for

Isn't KGSL the name for QCom's adreno vendor driver? What does that have to do with bindings?

Quoted 25 lines

sa8775p in the bindings.

Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Joerg Roedel <[email protected]>
---
 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +0 -1
index 807cb511fe18..74d5164ed1e8 100644
@@ -375,7 +375,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
#14 lore raw

Re: [PATCH 4/7] dt-bindings: iommu: arm,smmu: enable clocks for sa8775p

Quoted 7 lines · Rob Herring
Quoted 3 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The KGSL iommu will require the clocks property to be set. Enable it for

Isn't KGSL the name for QCom's adreno vendor driver? What does that have to do with bindings?

It's called "KGSL SMMU" (as opposed to the other "APPS SMMU" (Application Processor SubSystem) in some places in Qualcommland

Konrad

Quoted 26 lines
Quoted 26 lines

sa8775p in the bindings.

Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Joerg Roedel <[email protected]>
---
 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +0 -1
index 807cb511fe18..74d5164ed1e8 100644
@@ -375,7 +375,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
#5 lore raw

Re: [PATCH 2/7] clk: qcom: add the GPUCC driver for sa8775p

In reply to Stephen Boyd
Quoted 10 lines · Stephen Boyd

Quoting Bartosz Golaszewski (2023-03-28 12:36:27)

Quoted 8 lines
drivers/clk/qcom/Kconfig +0 -0
index 449bc8314d21..5e1919738aeb 100644
@@ -437,6 +437,14 @@ config SA_GCC_8775P
          Say Y if you want to use peripheral devices such as UART, SPI,
          I2C, USB, UFS, SDCC, etc.
 
Quoted 6 lines

drivers/clk/qcom/Kconfig config SA_GCC_8775P · line 442

Quoted 3 lines
drivers/clk/qcom/Kconfig +3 -0
+config SA_GPUCC_8775P
+       tristate "SA8775P Graphics clock controller"
+       select SA_GCC_8775P

Should select QCOM_GDSC as well.

Why if it's already selected indirectly by SA_GCC_8775P? Other GPUCCs in here don't select it either.

Bart

Quoted 24 lines
Quoted 14 lines
drivers/clk/qcom/Kconfig +5 -0
+       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/gpucc-sa8775p.c new file +0 -0
new file mode 100644
index 000000000000..46d73bd0199b

drivers/clk/qcom/gpucc-sa8775p.c line 7

Quoted 7 lines
drivers/clk/qcom/gpucc-sa8775p.c new file +7 -0
@@ -0,0 +1,633 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2023, Linaro Limited
+ */
+
+#include <linux/clk.h>

Is this include used? If not, remove it as this is a clk provider and not a clk consumer.

#10 lore raw

Re: [PATCH 3/7] arm64: defconfig: enable the SA8775P GPUCC driver

In reply to Bartosz Golaszewski
Quoted 16 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

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

Cc Arnd Bergmann <[email protected]>
Cc Catalin Marinas <[email protected]>
---
  arch/arm64/configs/defconfig | 1 +
  1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +0 -0
index d206a9120ee4..fa0a145defe2 100644

arch/arm64/configs/defconfig CONFIG_MSM_MMCC_8998=m · line 1164

Quoted 4 lines
arch/arm64/configs/defconfig +1 -0
@@ -1161,6 +1161,7 @@ CONFIG_MSM_MMCC_8998=m
  CONFIG_MSM_GCC_8998=y
  CONFIG_QCS_GCC_404=y
  CONFIG_SA_GCC_8775P=y
+CONFIG_SA_GPUCC_8775P=y

=m, please.

Quoted 3 lines
arch/arm64/configs/defconfig +0 -0
  CONFIG_SC_DISPCC_8280XP=m
  CONFIG_SC_GCC_7180=y
  CONFIG_SC_GCC_7280=y
Signature · 2 lines
With best wishes
Dmitry
maintainer
#6 lore raw

Re: [PATCH 2/7] clk: qcom: add the GPUCC driver for sa8775p

In reply to Bartosz Golaszewski

Quoting Bartosz Golaszewski (2023-04-06 04:20:33)

Quoted 18 lines · Stephen Boyd
Quoted 10 lines

Quoting Bartosz Golaszewski (2023-03-28 12:36:27)

Quoted 8 lines
drivers/clk/qcom/Kconfig +0 -0
index 449bc8314d21..5e1919738aeb 100644
@@ -437,6 +437,14 @@ config SA_GCC_8775P
          Say Y if you want to use peripheral devices such as UART, SPI,
          I2C, USB, UFS, SDCC, etc.
 
Quoted 6 lines

drivers/clk/qcom/Kconfig config SA_GCC_8775P · line 442

Quoted 3 lines
drivers/clk/qcom/Kconfig +3 -0
+config SA_GPUCC_8775P
+       tristate "SA8775P Graphics clock controller"
+       select SA_GCC_8775P

Should select QCOM_GDSC as well.

Quoted 2 lines

Why if it's already selected indirectly by SA_GCC_8775P? Other GPUCCs in here don't select it either.

For completeness.