Skip to contentSkip to conversation

SM8350 Display/GPU clock enablement

PATCH Superseded Robert Foss 2 participants 11 messages Jun 22, 2022 – Jun 23, 2022

Subsystems (5)

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v7 cover SM8350 Display/GPU clock enablement

Changes since v2
- Dropped "clk: Introduce CLK_ASSUME_ENABLED_WHEN_UNUSED"
- Dropped "clk: qcom: sm8250-dispcc: Flag shared RCGs as assumed enable"
- Dropped "clk: qcom: rcg2: Cache rate changes for parked RCGs"

Changes since v3:
- Dropped RBs & SoBs for bigger changes
- Changed author to me for patches with big changes

Changes since v5:
- Reverted dispcc-sm8350 split from dispcc-sm8250 and related .index changes - Bjorn
- Re-added Tags that were thrown out due to the above revert

Jonathan Marek (2):
clk: qcom: add support for SM8350 DISPCC
dt-bindings: clock: Add Qcom SM8350 DISPCC bindings

Robert Foss (4):
arm64: dts: qcom: sm8350: Replace integers with rpmpd defines
clk: qcom: add support for SM8350 GPUCC
dt-bindings: clock: Add Qcom SM8350 GPUCC bindings
arm64: dts: qcom: sm8350: Add DISPCC node

 .../bindings/clock/qcom,dispcc-sm8x50.yaml    |   6 +-
 .../bindings/clock/qcom,gpucc-sm8350.yaml     |  72 ++
 arch/arm64/boot/dts/qcom/sm8350.dtsi          |  42 +-
 drivers/clk/qcom/Kconfig                      |  14 +-
 drivers/clk/qcom/Makefile                     |   1 +
 drivers/clk/qcom/dispcc-sm8250.c              |  63 +-
 drivers/clk/qcom/gpucc-sm8350.c               | 637 ++++++++++++++++++
 .../dt-bindings/clock/qcom,dispcc-sm8350.h    |   1 +
 include/dt-bindings/clock/qcom,gpucc-sm8350.h |  52 ++
 9 files changed, 874 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,gpucc-sm8350.yaml
 create mode 100644 drivers/clk/qcom/gpucc-sm8350.c
 create mode 120000 include/dt-bindings/clock/qcom,dispcc-sm8350.h
 create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8350.h
Signature · 1 line
2.34.1
#1 lore raw

PATCH v7 1/6 arm64: dts: qcom: sm8350: Replace integers with rpmpd defines

Replace &rpmhpd power domain integers with their respective defines in order to improve legibility.

---

Changes since v6
- Add r-b - Konrad

 arch/arm64/boot/dts/qcom/sm8350.dtsi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/sm8350.dtsi +8 -8
index c0137bdcf94b..52428b6df64e 100644
@@ -1656,8 +1656,8 @@ mpss: remoteproc@4080000 {
 			clocks = <&rpmhcc RPMH_CXO_CLK>;
 			clock-names = "xo";
 
-			power-domains = <&rpmhpd 0>,
-					<&rpmhpd 12>;
+			power-domains = <&rpmhpd SM8350_CX>,
+					<&rpmhpd SM8350_MSS>;
 			power-domain-names = "cx", "mss";
 
 			interconnects = <&mc_virt MASTER_LLCC &mc_virt SLAVE_EBI1>;
@@ -2167,8 +2167,8 @@ slpi: remoteproc@5c00000 {
 			clocks = <&rpmhcc RPMH_CXO_CLK>;
 			clock-names = "xo";
 
-			power-domains = <&rpmhpd 4>,
-					<&rpmhpd 5>;
+			power-domains = <&rpmhpd SM8350_LCX>,
+					<&rpmhpd SM8350_LMX>;
 			power-domain-names = "lcx", "lmx";
 
 			memory-region = <&pil_slpi_mem>;
@@ -2235,8 +2235,8 @@ cdsp: remoteproc@98900000 {
 			clocks = <&rpmhcc RPMH_CXO_CLK>;
 			clock-names = "xo";
 
-			power-domains = <&rpmhpd 0>,
-					<&rpmhpd 10>;
+			power-domains = <&rpmhpd SM8350_CX>,
+					<&rpmhpd SM8350_MXC>;
 			power-domain-names = "cx", "mxc";
 
 			interconnects = <&compute_noc MASTER_CDSP_PROC &mc_virt SLAVE_EBI1>;
@@ -2540,8 +2540,8 @@ adsp: remoteproc@17300000 {
 			clocks = <&rpmhcc RPMH_CXO_CLK>;
 			clock-names = "xo";
 
-			power-domains = <&rpmhpd 4>,
-					<&rpmhpd 5>;
+			power-domains = <&rpmhpd SM8350_LCX>,
+					<&rpmhpd SM8350_LMX>;
 			power-domain-names = "lcx", "lmx";
 
 			memory-region = <&pil_adsp_mem>;
Signature · 1 line
2.34.1
Reviewed-by on v7 1/6
#2 lore raw

Re: [PATCH v7 1/6] arm64: dts: qcom: sm8350: Replace integers with rpmpd defines

Quoted 2 lines · Robert Foss

Replace &rpmhpd power domain integers with their respective defines in order to improve legibility.

This can go separately as well...

Signature · 1 line
~Vinod
#3 lore raw

PATCH v7 2/6 clk: qcom: add support for SM8350 GPUCC

In reply to Robert Foss

The GPUCC manages the clocks for the Adreno GPU found on the sm8350 SoCs.

---

Changes since v1
- Remove .name assignments for clk_parent_data - Dmitry
- Use ARRAY_SIZE where possible - Dmitry
- Remove commented out code - Dmitry
- Set CLAMP_IO flag for gpu_gx_gdsc - Dmitry
- Assign .parent_hws instead of .hw - Dmitry

Changes since v2
- Switch license to dual BSD/GPL - Bjorn
- Add Jonathans SoB - Jonathan
- Add Linaro to copyright statement - Bjorn
- Make .hw.init assignment const - Bjorn
- Extract & deduplicate bi_tcxo parent_data - Bjorn
- Removed further .name assignment - Bjorn
- Move of_device_id declaration - Bjorn

Changes since v3
- Change license to BSD/GPL - Rob/Bjorn
- Switch from .fw_name to .index

Changes since v4
- Change year of copyright statement
- Change to dual license for header file - Rob

Changes since v5
- Change hex to lower case - Konrad

Changes since v6
- Change hex to lower case - Konrad
- Change license go GPL 2.0 only - Konrad

 drivers/clk/qcom/Kconfig        |   8 +
 drivers/clk/qcom/Makefile       |   1 +
 drivers/clk/qcom/gpucc-sm8350.c | 637 ++++++++++++++++++++++++++++++++
 3 files changed, 646 insertions(+)
 create mode 100644 drivers/clk/qcom/gpucc-sm8350.c
drivers/clk/qcom/Kconfig +8 -0
index bc4dcf356d82..b11235c21952 100644
@@ -712,6 +712,14 @@ config SM_GPUCC_8250
 	  Say Y if you want to support graphics controller devices and
 	  functionality such as 3D graphics.
 
+config SM_GPUCC_8350
+	tristate "SM8350 Graphics Clock Controller"
+	select SM_GCC_8350
+	help
+	  Support for the graphics clock controller on SM8350 devices.
+	  Say Y if you want to support graphics controller devices and
+	  functionality such as 3D graphics.
+
 config SM_VIDEOCC_8150
 	tristate "SM8150 Video Clock Controller"
 	select SM_GCC_8150
drivers/clk/qcom/Makefile +1 -0
index 36789f5233ef..ef9c64824424 100644
@@ -101,6 +101,7 @@ obj-$(CONFIG_SM_GCC_8450) += gcc-sm8450.o
 obj-$(CONFIG_SM_GPUCC_6350) += gpucc-sm6350.o
 obj-$(CONFIG_SM_GPUCC_8150) += gpucc-sm8150.o
 obj-$(CONFIG_SM_GPUCC_8250) += gpucc-sm8250.o
+obj-$(CONFIG_SM_GPUCC_8350) += gpucc-sm8350.o
 obj-$(CONFIG_SM_VIDEOCC_8150) += videocc-sm8150.o
 obj-$(CONFIG_SM_VIDEOCC_8250) += videocc-sm8250.o
 obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o
drivers/clk/qcom/gpucc-sm8350.c new file +637 -0

637 lines not on this page · raw message

Signature · 1 line
2.34.1
Reviewed-by on v7 2/6
#4 lore raw

Re: [PATCH v7 2/6] clk: qcom: add support for SM8350 GPUCC

Quoted 98 lines · Robert Foss

The GPUCC manages the clocks for the Adreno GPU found on the sm8350 SoCs.

---

Changes since v1
- Remove .name assignments for clk_parent_data - Dmitry
- Use ARRAY_SIZE where possible - Dmitry
- Remove commented out code - Dmitry
- Set CLAMP_IO flag for gpu_gx_gdsc - Dmitry
- Assign .parent_hws instead of .hw - Dmitry

Changes since v2
- Switch license to dual BSD/GPL - Bjorn
- Add Jonathans SoB - Jonathan
- Add Linaro to copyright statement - Bjorn
- Make .hw.init assignment const - Bjorn
- Extract & deduplicate bi_tcxo parent_data - Bjorn
- Removed further .name assignment - Bjorn
- Move of_device_id declaration - Bjorn

Changes since v3
- Change license to BSD/GPL - Rob/Bjorn
- Switch from .fw_name to .index

Changes since v4
- Change year of copyright statement
- Change to dual license for header file - Rob

Changes since v5
- Change hex to lower case - Konrad

Changes since v6
- Change hex to lower case - Konrad
- Change license go GPL 2.0 only - Konrad

 drivers/clk/qcom/Kconfig        |   8 +
 drivers/clk/qcom/Makefile       |   1 +
 drivers/clk/qcom/gpucc-sm8350.c | 637 ++++++++++++++++++++++++++++++++
 3 files changed, 646 insertions(+)
 create mode 100644 drivers/clk/qcom/gpucc-sm8350.c
drivers/clk/qcom/Kconfig +8 -0
index bc4dcf356d82..b11235c21952 100644
@@ -712,6 +712,14 @@ config SM_GPUCC_8250
 	  Say Y if you want to support graphics controller devices and
 	  functionality such as 3D graphics.
 
+config SM_GPUCC_8350
+	tristate "SM8350 Graphics Clock Controller"
+	select SM_GCC_8350
+	help
+	  Support for the graphics clock controller on SM8350 devices.
+	  Say Y if you want to support graphics controller devices and
+	  functionality such as 3D graphics.
+
 config SM_VIDEOCC_8150
 	tristate "SM8150 Video Clock Controller"
 	select SM_GCC_8150
drivers/clk/qcom/Makefile +1 -0
index 36789f5233ef..ef9c64824424 100644
@@ -101,6 +101,7 @@ obj-$(CONFIG_SM_GCC_8450) += gcc-sm8450.o
 obj-$(CONFIG_SM_GPUCC_6350) += gpucc-sm6350.o
 obj-$(CONFIG_SM_GPUCC_8150) += gpucc-sm8150.o
 obj-$(CONFIG_SM_GPUCC_8250) += gpucc-sm8250.o
+obj-$(CONFIG_SM_GPUCC_8350) += gpucc-sm8350.o
 obj-$(CONFIG_SM_VIDEOCC_8150) += videocc-sm8150.o
 obj-$(CONFIG_SM_VIDEOCC_8250) += videocc-sm8250.o
 obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o
drivers/clk/qcom/gpucc-sm8350.c new file +16 -0
new file mode 100644
index 000000000000..d13fa813d190
@@ -0,0 +1,637 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited
+ */
+
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/regmap.h>
+
+#include <dt-bindings/clock/qcom,gpucc-sm8350.h>
+

drivers/clk/qcom/gpucc-sm8350.c line 26

Quoted 10 lines
drivers/clk/qcom/gpucc-sm8350.c new file +10 -0
+#include "clk-alpha-pll.h"
+#include "clk-branch.h"
+#include "clk-pll.h"
+#include "clk-rcg.h"
+#include "clk-regmap.h"
+#include "common.h"
+#include "clk-regmap-mux.h"
+#include "clk-regmap-divider.h"
+#include "gdsc.h"
+#include "reset.h"

nit: this could be sorted alphabetically. Otherwise looks good to me

Signature · 1 line
~Vinod
#5 lore raw

PATCH v7 3/6 dt-bindings: clock: Add Qcom SM8350 GPUCC bindings

In reply to Robert Foss

Add device tree bindings for graphics clock controller for Qualcomm Technology Inc's SM8350 SoCs.

---

Changes since v3
- Separate from qcom,gpucc
- Remove clock-names
- Make example sm8350 based
- Changed author to me due to size of changes

Changes since v5
- Add Ack - Rob

Changes since v5
- Reverted split from dispcc-sm8250
- Re-added tags from v3

 .../bindings/clock/qcom,gpucc-sm8350.yaml     | 72 +++++++++++++++++++
 include/dt-bindings/clock/qcom,gpucc-sm8350.h | 52 ++++++++++++++
 2 files changed, 124 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,gpucc-sm8350.yaml
 create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8350.h
Documentation/devicetree/bindings/clock/qcom,gpucc-sm8350.yaml new file +72 -0
new file mode 100644
index 000000000000..0a0546c079a9
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,gpucc-sm8350.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Graphics Clock & Reset Controller Binding
+
+maintainers:
+  - Robert Foss <[email protected]>
+
+description: |
+  Qualcomm graphics clock control module which supports the clocks, resets and
+  power domains on Qualcomm SoCs.
+
+  See also:
+    dt-bindings/clock/qcom,gpucc-sm8350.h
+
+properties:
+  compatible:
+    enum:
+      - qcom,sm8350-gpucc
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: GPLL0 main branch source
+      - description: GPLL0 div branch source
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - '#clock-cells'
+  - '#reset-cells'
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-sm8350.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        clock-controller@3d90000 {
+            compatible = "qcom,sm8350-gpucc";
+            reg = <0 0x03d90000 0 0x9000>;
+            clocks = <&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,gpucc-sm8350.h new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.34.1
#6 lore raw

PATCH v7 4/6 clk: qcom: add support for SM8350 DISPCC

In reply to Robert Foss

From: Jonathan Marek <[email protected]>

Add support to the SM8350 display clock controller by extending the SM8250 display clock controller, which is almost identical but has some minor differences.

---

Changes since v1
- Remove comment - Dmitry

Changes since v2
- Add my SoB - Bjorn
- Remove CLK_ASSUME_ENABLED_WHEN_UNUSED flag

Changes since v3
- Add kconfig dependency on SM_GCC_8350 - Konrad
- Change hex to lowercase - Konrad
- Split from dispcc-sm8250.c implementation
- Switch from .fw_name to .index

Changes since v4
- Hex to lowercase - Konrad
- Remove bad match table entries - Konrad

Changes since v5
- Reverted split from dispcc-sm8250
- Re-added tags from v3

Changes since v6
- Added kconfig dependency - Konrad
- Don't remove comment - Konrad

 drivers/clk/qcom/Kconfig         |  6 +--
 drivers/clk/qcom/dispcc-sm8250.c | 63 +++++++++++++++++++++++++++++++-
 2 files changed, 65 insertions(+), 4 deletions(-)
drivers/clk/qcom/Kconfig +3 -3
index b11235c21952..efdef8fbf008 100644
@@ -618,11 +618,11 @@ config SM_DISPCC_6125
 	  splash screen
 
 config SM_DISPCC_8250
-	tristate "SM8150 and SM8250 Display Clock Controller"
-	depends on SM_GCC_8150 || SM_GCC_8250
+	tristate "SM8150/SM8250/SM8350 Display Clock Controller"
+	depends on SM_GCC_8150 || SM_GCC_8250 || SM_GCC_8350
 	help
 	  Support for the display clock controller on Qualcomm Technologies, Inc
-	  SM8150 and SM8250 devices.
+	  SM8150/SM8250/SM8350 devices.
 	  Say Y if you want to support display devices and functionality such as
 	  splash screen.
 
drivers/clk/qcom/dispcc-sm8250.c +62 -1

87 lines not on this page · raw message

Signature · 1 line
2.34.1
Reviewed-by on v7 4/6
#7 lore raw

Re: [PATCH v7 4/6] clk: qcom: add support for SM8350 DISPCC

Quoted 5 lines · Robert Foss

From: Jonathan Marek <[email protected]>

Add support to the SM8350 display clock controller by extending the SM8250 display clock controller, which is almost identical but has some minor differences.

Signature · 1 line
~Vinod
#8 lore raw

PATCH v7 5/6 dt-bindings: clock: Add Qcom SM8350 DISPCC bindings

In reply to Robert Foss

From: Jonathan Marek <[email protected]>

Add sm8350 DISPCC bindings, which are simply a symlink to the sm8250 bindings. Update the documentation with the new compatible.

---

Changes since v2
- Add SoB - Bjorn

Changes since v3
- Separate from qcom,dispcc-sm8x50
- Remove clock-names
- Make example sm8350 based
- Changed author to me due to size of changes

Changes since v4
- Add RB - Rob

Changes since v5
- Reverted split from dispcc-sm8250
- Re-added tags from v3

 .../devicetree/bindings/clock/qcom,dispcc-sm8x50.yaml       | 6 ++++--
 include/dt-bindings/clock/qcom,dispcc-sm8350.h              | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
 create mode 120000 include/dt-bindings/clock/qcom,dispcc-sm8350.h
Documentation/devicetree/bindings/clock/qcom,dispcc-sm8x50.yaml +4 -2
index 31497677e8de..7a8d375e055e 100644
@@ -4,18 +4,19 @@
 $id: http://devicetree.org/schemas/clock/qcom,dispcc-sm8x50.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Qualcomm Display Clock & Reset Controller Binding for SM8150/SM8250
+title: Qualcomm Display Clock & Reset Controller Binding for SM8150/SM8250/SM8350
 
 maintainers:
   - Jonathan Marek <[email protected]>
 
 description: |
   Qualcomm display clock control module which supports the clocks, resets and
-  power domains on SM8150 and SM8250.
+  power domains on SM8150/SM8250/SM8350.
 
   See also:
     dt-bindings/clock/qcom,dispcc-sm8150.h
     dt-bindings/clock/qcom,dispcc-sm8250.h
+    dt-bindings/clock/qcom,dispcc-sm8350.h
 
 properties:
   compatible:
@@ -23,6 +24,7 @@ properties:
       - qcom,sc8180x-dispcc
       - qcom,sm8150-dispcc
       - qcom,sm8250-dispcc
+      - qcom,sm8350-dispcc
 
   clocks:
     items:
include/dt-bindings/clock/qcom,dispcc-sm8350.h new file +1 -0
new file mode 120000
index 000000000000..0312b4544acb
@@ -0,0 +1 @@
+qcom,dispcc-sm8250.h
\ No newline at end of file
Signature · 1 line
2.34.1
Reviewed-by on v7 5/6
#9 lore raw

Re: [PATCH v7 5/6] dt-bindings: clock: Add Qcom SM8350 DISPCC bindings

Quoted 4 lines · Robert Foss

From: Jonathan Marek <[email protected]>

Add sm8350 DISPCC bindings, which are simply a symlink to the sm8250 bindings. Update the documentation with the new compatible.

But, this should be patch 2, before the driver one please

Signature · 1 line
~Vinod
#10 lore raw

PATCH v7 6/6 arm64: dts: qcom: sm8350: Add DISPCC node

In reply to Robert Foss

Add the dispcc clock-controller DT node for sm8350.

---

Changes since v2
- Remove interconnect include - Bjorn

Changes since v3
- Switch from .fw_name to .index

Changes since v5
- Revert .fw_name to .index change

Changes since v6
- Add r-b - Konrad

 arch/arm64/boot/dts/qcom/sm8350.dtsi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/qcom/sm8350.dtsi +26 -0
index 52428b6df64e..99464cd1299e 100644
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/qcom,dispcc-sm8350.h>
 #include <dt-bindings/clock/qcom,gcc-sm8350.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/dma/qcom-gpi.h>
@@ -2525,6 +2526,31 @@ usb_2_dwc3: usb@a800000 {
 			};
 		};
 
+		dispcc: clock-controller@af00000 {
+			compatible = "qcom,sm8350-dispcc";
+			reg = <0 0x0af00000 0 0x10000>;
+			clocks = <&rpmhcc RPMH_CXO_CLK>,
+				 <0>,
+				 <0>,
+				 <0>,
+				 <0>,
+				 <0>,
+				 <0>;
+			clock-names = "bi_tcxo",
+				      "dsi0_phy_pll_out_byteclk",
+				      "dsi0_phy_pll_out_dsiclk",
+				      "dsi1_phy_pll_out_byteclk",
+				      "dsi1_phy_pll_out_dsiclk",
+				      "dp_phy_pll_link_clk",
+				      "dp_phy_pll_vco_div_clk";
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+			#power-domain-cells = <1>;
+
+			power-domains = <&rpmhpd SM8350_MMCX>;
+			power-domain-names = "mmcx";
+		};
+
 		adsp: remoteproc@17300000 {
 			compatible = "qcom,sm8350-adsp-pas";
 			reg = <0 0x17300000 0 0x100>;
Signature · 1 line
2.34.1