Skip to contentSkip to conversation

Add GCC for SM4250 and SM6115

PATCH Superseded Iskren Chernev 1 participant 3 messages Jun 22, 2021

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Add GCC for SM4250 and SM6115

This patch adds support for the Global Clock Controller on QCom SM4250 and SM6115, codename bengal. The code is taken from OnePlus repo [1], and the keyword bengal corresponds to sm4250 and sm6115, so I'm adding both compat strings.

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

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       |   74 +
 drivers/clk/qcom/Kconfig                      |    7 +
 drivers/clk/qcom/Makefile                     |    1 +
 drivers/clk/qcom/gcc-sm6115.c                 | 3624 +++++++++++++++++
 include/dt-bindings/clock/qcom,gcc-sm4250.h   |   11 +
 include/dt-bindings/clock/qcom,gcc-sm6115.h   |  201 +
 6 files changed, 3918 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-sm4250.h
 create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h

base-commit: e71e3a48a7e89fa71fb70bf4602367528864d2ff --
2.31.1

#1 lore raw

PATCH 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       |  74 +++++++
 include/dt-bindings/clock/qcom,gcc-sm4250.h   |  11 +
 include/dt-bindings/clock/qcom,gcc-sm6115.h   | 201 ++++++++++++++++++
 3 files changed, 286 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
 create mode 100644 include/dt-bindings/clock/qcom,gcc-sm4250.h
 create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h
Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml new file +74 -0
new file mode 100644
index 000000000000..6ed0f9a994fe
@@ -0,0 +1,74 @@
+# 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 SM6115 and SM4250.
+
+  See also:
+  - dt-bindings/clock/qcom,gcc-sm6115.h
+
+properties:
+  compatible:
+    enum:
+      - qcom,gcc-sm4250
+      - 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-sm4250.h new file +11 -0
new file mode 100644
index 000000000000..5cd381fcca8b
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_GCC_SM4250_H
+#define _DT_BINDINGS_CLK_QCOM_GCC_SM4250_H
+
+#include <dt-bindings/clock/qcom,gcc-sm6115.h>
+
+#endif
include/dt-bindings/clock/qcom,gcc-sm6115.h new file +201 -0

201 lines not on this page · raw message

Signature · 1 line
2.31.1
#2 lore raw

PATCH 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 with GDSCs ported from downstream DT.

---
 drivers/clk/qcom/Kconfig      |    7 +
 drivers/clk/qcom/Makefile     |    1 +
 drivers/clk/qcom/gcc-sm6115.c | 3624 +++++++++++++++++++++++++++++++++
 3 files changed, 3632 insertions(+)
 create mode 100644 drivers/clk/qcom/gcc-sm6115.c
drivers/clk/qcom/Kconfig +7 -0
index c84b2c896a27..de35191412c5 100644
@@ -499,6 +499,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_8150
 	tristate "SM8150 Global Clock Controller"
 	help
drivers/clk/qcom/Makefile +1 -0
index 9495bf6a18d0..c42ea466cb7a 100644
@@ -75,6 +75,7 @@ obj-$(CONFIG_SDM_LPASSCC_845) += lpasscc-sdm845.o
 obj-$(CONFIG_SDM_VIDEOCC_845) += videocc-sdm845.o
 obj-$(CONFIG_SDX_GCC_55) += gcc-sdx55.o
 obj-$(CONFIG_SM_DISPCC_8250) += dispcc-sm8250.o
+obj-$(CONFIG_SM_GCC_6115) += gcc-sm6115.o
 obj-$(CONFIG_SM_GCC_8150) += gcc-sm8150.o
 obj-$(CONFIG_SM_GCC_8250) += gcc-sm8250.o
 obj-$(CONFIG_SM_GCC_8350) += gcc-sm8350.o
drivers/clk/qcom/gcc-sm6115.c new file +3624 -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.31.1

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