Skip to contentSkip to conversation

Add GCC for SM4250/6115

PATCH Applied Iskren Chernev 3 participants 6 messages Aug 5, 2021 – Aug 29, 2021

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

v4 cover Add GCC for SM4250/6115

This patch adds support for the Global Clock Controller on QCom SM4250 and SM6115, codename bengal. The code is taken from OnePlus repo [1]. The two platforms are identical so there is only one compat string.

[1]: https://github.com/OnePlusOSS/android_kernel_oneplus_sm4250

v1: https://lkml.org/lkml/2021/6/22/1131
v2: https://lkml.org/lkml/2021/6/27/157
v3: https://lkml.org/lkml/2021/8/1/68

Changes from v3:
- removed test clock from driver/binding
- fix GCC_SDCC2_BCR value as spotted by Konrad
- simplified probe function

Changes from v2:
- Suggested by Stephen Boyd
- switch to parent_data in place of parent_names
- other
- drop parent refs to invalid clocks
- use pll-alpha regs when possible
- drop unused parent defs
- add pll test clock to bindings

Changes from v1:
- remove sm4250 compat, there will be a single sm6115.dtsi for both platforms

Iskren Chernev (2):
dt-bindings: clk: qcom: gcc-sm6115: Document SM6115 GCC
clk: qcom: Add Global Clock controller (GCC) driver for SM6115

 .../bindings/clock/qcom,gcc-sm6115.yaml       |   72 +
 drivers/clk/qcom/Kconfig                      |    7 +
 drivers/clk/qcom/Makefile                     |    1 +
 drivers/clk/qcom/gcc-sm6115.c                 | 3544 +++++++++++++++++
 include/dt-bindings/clock/qcom,gcc-sm6115.h   |  201 +
 5 files changed, 3825 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
 create mode 100644 drivers/clk/qcom/gcc-sm6115.c
 create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h

base-commit: 8d4b477da1a807199ca60e0829357ce7aa6758d5

Signature · 1 line
2.32.0
#1 lore raw

PATCH v4 1/2 dt-bindings: clk: qcom: gcc-sm6115: Document SM6115 GCC

Add device tree bindings for global clock controller on SM6115 and SM4250 SoCs (pin and software compatible).

---
 .../bindings/clock/qcom,gcc-sm6115.yaml       |  72 +++++++
 include/dt-bindings/clock/qcom,gcc-sm6115.h   | 201 ++++++++++++++++++
 2 files changed, 273 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
 create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h
Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml new file +72 -0
new file mode 100644
index 000000000000..26050da844d5
@@ -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,gcc-sm6115.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Global Clock & Reset Controller Binding for SM6115 and SM4250
+
+maintainers:
+  - Iskren Chernev <[email protected]>
+
+description: |
+  Qualcomm global clock control module which supports the clocks, resets and
+  power domains on SM4250/6115.
+
+  See also:
+  - dt-bindings/clock/qcom,gcc-sm6115.h
+
+properties:
+  compatible:
+    const: qcom,gcc-sm6115
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: Sleep clock source
+
+  clock-names:
+    items:
+      - const: bi_tcxo
+      - const: sleep_clk
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  reg:
+    maxItems: 1
+
+  protected-clocks:
+    description:
+      Protected clock specifier list as per common clock binding.
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+  - reg
+  - '#clock-cells'
+  - '#reset-cells'
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,rpmcc.h>
+    clock-controller@1400000 {
+        compatible = "qcom,gcc-sm6115";
+        reg = <0x01400000 0x1f0000>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+        #power-domain-cells = <1>;
+        clock-names = "bi_tcxo", "sleep_clk";
+        clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, <&sleep_clk>;
+    };
+...
include/dt-bindings/clock/qcom,gcc-sm6115.h new file +201 -0

201 lines not on this page · raw message

Signature · 1 line
2.32.0
maintainer Reviewed-by on v4 1/2
#2 lore raw

Re: [PATCH v4 1/2] dt-bindings: clk: qcom: gcc-sm6115: Document SM6115 GCC

Quoted 11 lines · Iskren Chernev

Add device tree bindings for global clock controller on SM6115 and SM4250 SoCs (pin and software compatible).

---
 .../bindings/clock/qcom,gcc-sm6115.yaml       |  72 +++++++
 include/dt-bindings/clock/qcom,gcc-sm6115.h   | 201 ++++++++++++++++++
 2 files changed, 273 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
 create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h
#4 lore raw

PATCH v4 2/2 clk: qcom: Add Global Clock controller (GCC) driver for SM6115

In reply to Iskren Chernev

Add support for the global clock controller found on SM6115 based devices. This should allow most non-multimedia device drivers to probe and control their clocks.

Based on CAF implementation. GDSCs ported from downstream DT.

---
 drivers/clk/qcom/Kconfig      |    7 +
 drivers/clk/qcom/Makefile     |    1 +
 drivers/clk/qcom/gcc-sm6115.c | 3544 +++++++++++++++++++++++++++++++++
 3 files changed, 3552 insertions(+)
 create mode 100644 drivers/clk/qcom/gcc-sm6115.c
drivers/clk/qcom/Kconfig +7 -0
index 85b090a8d9c6..4809972905f9 100644
@@ -531,6 +531,13 @@ config SM_DISPCC_8250
 	  Say Y if you want to support display devices and functionality such as
 	  splash screen.
 
+config SM_GCC_6115
+	tristate "SM6115 and SM4250 Global Clock Controller"
+	help
+	  Support for the global clock controller on SM6115 and SM4250 devices.
+	  Say Y if you want to use peripheral devices such as UART, SPI,
+	  i2C, USB, UFS, SDDC, PCIe, etc.
+
 config SM_GCC_6125
 	tristate "SM6125 Global Clock Controller"
 	help
drivers/clk/qcom/Makefile +1 -0
index 27cefe572ac2..a784688485d1 100644
@@ -79,6 +79,7 @@ obj-$(CONFIG_SDM_VIDEOCC_845) += videocc-sdm845.o
 obj-$(CONFIG_SDX_GCC_55) += gcc-sdx55.o
 obj-$(CONFIG_SM_CAMCC_8250) += camcc-sm8250.o
 obj-$(CONFIG_SM_DISPCC_8250) += dispcc-sm8250.o
+obj-$(CONFIG_SM_GCC_6115) += gcc-sm6115.o
 obj-$(CONFIG_SM_GCC_6125) += gcc-sm6125.o
 obj-$(CONFIG_SM_GCC_8150) += gcc-sm8150.o
 obj-$(CONFIG_SM_GCC_8250) += gcc-sm8250.o
drivers/clk/qcom/gcc-sm6115.c new file +3544 -0

2,980 lines not on this page · raw message

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

Signature · 1 line
2.32.0

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

maintainer Applied
#5 lore raw

Re: [PATCH v4 2/2] clk: qcom: Add Global Clock controller (GCC) driver for SM6115

Quoting Iskren Chernev (2021-08-05 09:11:07)

Quoted 8 lines

Add support for the global clock controller found on SM6115 based devices. This should allow most non-multimedia device drivers to probe and control their clocks.

Based on CAF implementation. GDSCs ported from downstream DT.

---

Applied to clk-next