Skip to contentSkip to conversation

qcom: sa8775p: add the GCC clock driver for Qualcomm SA8775P platforms

PATCH Applied Bartosz Golaszewski 4 participants 6 messages Jan 17, 2023 – Jan 18, 2023

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover qcom: sa8775p: add the GCC clock driver for Qualcomm SA8775P platforms

From: Bartosz Golaszewski <[email protected]>

Add the DT bindings and driver for the GCC clock on the sa8775p platform from Qualcomm.

v1 -> v2:
- fix examples in DT bindings and make sure they pass tests
- use lowercase letters in hex numbers
- fix the name of DT compatible and headers (gcc-sa8775p -> sa8775p-gcc)
- fix licensing of DT bindings
- fix the regmap's max_register property
- use clk_regmap_phy_mux_ops where applicable
- other minor tweaks and improvements

Bartosz Golaszewski (1):
dt-bindings: clock: qcom: document the GCC clock on Qualcomm sa8775p

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

 .../bindings/clock/qcom,sa8775p-gcc.yaml      |   79 +
 drivers/clk/qcom/Kconfig                      |    9 +
 drivers/clk/qcom/Makefile                     |    1 +
 drivers/clk/qcom/gcc-sa8775p.c                | 4805 +++++++++++++++++
 include/dt-bindings/clock/qcom,sa8775p-gcc.h  |  320 ++
 5 files changed, 5214 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sa8775p-gcc.yaml
 create mode 100644 drivers/clk/qcom/gcc-sa8775p.c
 create mode 100644 include/dt-bindings/clock/qcom,sa8775p-gcc.h
Signature · 1 line
2.37.2
#1 lore raw

PATCH v2 1/2 dt-bindings: clock: qcom: document the GCC clock on Qualcomm sa8775p

From: Bartosz Golaszewski <[email protected]>

Add DT bindings for the GCC clock on SA8775P platforms. Add relevant DT include definitions as well.

---
 .../bindings/clock/qcom,sa8775p-gcc.yaml      |  79 +++++
 include/dt-bindings/clock/qcom,sa8775p-gcc.h  | 320 ++++++++++++++++++
 2 files changed, 399 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sa8775p-gcc.yaml
 create mode 100644 include/dt-bindings/clock/qcom,sa8775p-gcc.h
Documentation/devicetree/bindings/clock/qcom,sa8775p-gcc.yaml new file +79 -0
new file mode 100644
index 000000000000..dae65ebc5557
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sa8775p-gcc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Global Clock & Reset Controller on sa8775p
+
+maintainers:
+  - Bartosz Golaszewski <[email protected]>
+
+description: |
+  Qualcomm global clock control module provides the clocks, resets and
+  power domains on sa8775p.
+
+  See also:: include/dt-bindings/clock/qcom,sa8775p-gcc.h
+
+properties:
+  compatible:
+    const: qcom,sa8775p-gcc
+
+  clocks:
+    items:
+      - description: XO reference clock
+      - description: Sleep clock
+      - description: UFS memory first RX symbol clock
+      - description: UFS memory second RX symbol clock
+      - description: UFS memory first TX symbol clock
+      - description: UFS card first RX symbol clock
+      - description: UFS card second RX symbol clock
+      - description: UFS card first TX symbol clock
+      - description: Primary USB3 PHY wrapper pipe clock
+      - description: Secondary USB3 PHY wrapper pipe clock
+      - description: PCIe 0 pipe clock
+      - description: PCIe 1 pipe clock
+      - description: PCIe PHY clock
+      - description: First EMAC controller reference clock
+      - description: Second EMAC controller reference clock
+
+  protected-clocks:
+    maxItems: 240
+
+required:
+  - compatible
+  - clocks
+
+allOf:
+  - $ref: qcom,gcc.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,rpmh.h>
+
+    gcc: clock-controller@100000 {
+        compatible = "qcom,sa8775p-gcc";
+        reg = <0x100000 0xc7018>;
+        clocks = <&rpmhcc RPMH_CXO_CLK>,
+                 <&sleep_clk>,
+                 <&ufs_phy_rx_symbol_0_clk>,
+                 <&ufs_phy_rx_symbol_1_clk>,
+                 <&ufs_phy_tx_symbol_0_clk>,
+                 <&ufs_card_rx_symbol_0_clk>,
+                 <&ufs_card_rx_symbol_1_clk>,
+                 <&ufs_card_tx_symbol_0_clk>,
+                 <&usb_0_ssphy>,
+                 <&usb_1_ssphy>,
+                 <&pcie_0_pipe_clk>,
+                 <&pcie_1_pipe_clk>,
+                 <&pcie_phy_pipe_clk>,
+                 <&rxc0_ref_clk>,
+                 <&rxc1_ref_clk>;
+
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+        #power-domain-cells = <1>;
+    };
+...
include/dt-bindings/clock/qcom,sa8775p-gcc.h new file +320 -0

320 lines not on this page · raw message

Signature · 1 line
2.37.2
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: clock: qcom: document the GCC clock on Qualcomm sa8775p

Quoted 4 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add DT bindings for the GCC clock on SA8775P platforms. Add relevant DT include definitions as well.

Previously you had nice, clean and short "add ...." in the subject. Now it became long "document" while no one asked for that change? What happened? Subject space is precious, so why changing it?

"document" is a bit redundant because bindings are documentation. So basically "document documentation"...

This applies also to other patches like the interconnect.

With fixed subject as I asked in your v1:

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/2 clk: qcom: add the GCC driver for sa8775p

In reply to Bartosz Golaszewski

From: Shazad Hussain <[email protected]>

Add support for the Global Clock Controller found in the QTI SA8775P platforms.

[Bartosz: made the driver ready for upstream]
---
 drivers/clk/qcom/Kconfig       |    9 +
 drivers/clk/qcom/Makefile      |    1 +
 drivers/clk/qcom/gcc-sa8775p.c | 4805 ++++++++++++++++++++++++++++++++
 3 files changed, 4815 insertions(+)
 create mode 100644 drivers/clk/qcom/gcc-sa8775p.c
drivers/clk/qcom/Kconfig +9 -0
index 1b6615fe1dba..33a220aae618 100644
@@ -410,6 +410,15 @@ config SC_DISPCC_8280XP
 	  Say Y if you want to support display devices and functionality such as
 	  splash screen.
 
+config SA_GCC_8775P
+	tristate "SA8775 Global Clock Controller"
+	select QCOM_GDSC
+	depends on COMMON_CLK_QCOM
+	help
+	  Support for the global clock controller on SA8775 devices.
+	  Say Y if you want to use peripheral devices such as UART, SPI,
+	  I2C, USB, UFS, SDCC, etc.
+
 config SC_GCC_7180
 	tristate "SC7180 Global Clock Controller"
 	select QCOM_GDSC
drivers/clk/qcom/Makefile +1 -0
index 6c589f671003..fd4a531d9bc9 100644
@@ -67,6 +67,7 @@ obj-$(CONFIG_SC_CAMCC_7280) += camcc-sc7280.o
 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_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/gcc-sa8775p.c new file +4805 -0

2,978 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.37.2

Part of the diff is not shown here. View the raw message.

Reviewed-by on v2 2/2
#4 lore raw

Re: [PATCH v2 2/2] clk: qcom: add the GCC driver for sa8775p

Quoted 10 lines · Bartosz Golaszewski

From: Shazad Hussain <[email protected]>

Add support for the Global Clock Controller found in the QTI SA8775P platforms.

[Bartosz: made the driver ready for upstream]

---

[...]

drivers/clk/qcom/gcc-sa8775p.c line 4796

Quoted 6 lines
drivers/clk/qcom/gcc-sa8775p.c new file +6 -0
+
+static int __init gcc_sa8775p_init(void)
+{
+	return platform_driver_register(&gcc_sa8775p_driver);
+}
+subsys_initcall(gcc_sa8775p_init);

core_initcall, otherwise you'll be waiting for years :P

Konrad

Quoted 9 lines
drivers/clk/qcom/gcc-sa8775p.c new file +9 -0
+
+static void __exit gcc_sa8775p_exit(void)
+{
+	platform_driver_unregister(&gcc_sa8775p_driver);
+}
+module_exit(gcc_sa8775p_exit);
+
+MODULE_DESCRIPTION("Qualcomm SA8775P GCC driver");
+MODULE_LICENSE("GPL");
maintainer Applied
#5 lore raw
In reply to Bartosz Golaszewski
Quoted 14 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the DT bindings and driver for the GCC clock on the sa8775p platform from Qualcomm.

v1 -> v2:
- fix examples in DT bindings and make sure they pass tests
- use lowercase letters in hex numbers
- fix the name of DT compatible and headers (gcc-sa8775p -> sa8775p-gcc)
- fix licensing of DT bindings
- fix the regmap's max_register property
- use clk_regmap_phy_mux_ops where applicable
- other minor tweaks and improvements

Quoted 1 line

[...]

Applied, thanks!

[1/2] dt-bindings: clock: qcom: document the GCC clock on Qualcomm sa8775p

      commit: 0fff9fa043f972b83935016b0e81d44d9a2229bd
[2/2] clk: qcom: add the GCC driver for sa8775p
      commit: 08c51ceb12f7ce2252513a38ad8a8ed26103a4e2

Best regards,

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