Skip to contentSkip to conversation

Qualcomm QCS404 Turing Clock Controller

PATCH Applied Bjorn Andersson 3 participants 9 messages Mar 6, 2019 – Apr 11, 2019

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

cover Qualcomm QCS404 Turing Clock Controller

The turing clock controller provides clocks necessary to run the compute subsystem in QCS404.

Bjorn Andersson (3):
dt-bindings: clock: Introduce Qualcomm Turing Clock controller
clk: qcom: branch: Add AON clock ops
clk: qcom: Add QCS404 TuringCC

 .../bindings/clock/qcom,turingcc.txt          |  19 ++
 drivers/clk/qcom/Kconfig                      |   6 +
 drivers/clk/qcom/Makefile                     |   1 +
 drivers/clk/qcom/clk-branch.c                 |   6 +
 drivers/clk/qcom/clk-branch.h                 |   1 +
 drivers/clk/qcom/turingcc-qcs404.c            | 170 ++++++++++++++++++
 .../dt-bindings/clock/qcom,turingcc-qcs404.h  |  15 ++
 7 files changed, 218 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,turingcc.txt
 create mode 100644 drivers/clk/qcom/turingcc-qcs404.c
 create mode 100644 include/dt-bindings/clock/qcom,turingcc-qcs404.h
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/3 dt-bindings: clock: Introduce Qualcomm Turing Clock controller

Add devicetree binding for the turing clock controller found in QCS404.

---
 .../bindings/clock/qcom,turingcc.txt          | 19 +++++++++++++++++++
 .../dt-bindings/clock/qcom,turingcc-qcs404.h  | 15 +++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,turingcc.txt
 create mode 100644 include/dt-bindings/clock/qcom,turingcc-qcs404.h
Documentation/devicetree/bindings/clock/qcom,turingcc.txt new file +19 -0
new file mode 100644
index 000000000000..126517de5f9a
@@ -0,0 +1,19 @@
+Qualcomm Turing Clock & Reset Controller Binding
+------------------------------------------------
+
+Required properties :
+- compatible: shall contain "qcom,qcs404-turingcc".
+- reg: shall contain base register location and length.
+- clocks: ahb clock for the TuringCC
+- #clock-cells: from common clock binding, shall contain 1.
+- #reset-cells: from common reset binding, shall contain 1.
+
+Example:
+	turingcc: clock-controller@800000 {
+		compatible = "qcom,qcs404-turingcc";
+		reg = <0x00800000 0x30000>;
+		clocks = <&gcc GCC_CDSP_CFG_AHB_CLK>;
+
+		#clock-cells = <1>;
+		#reset-cells = <1>;
+	};
include/dt-bindings/clock/qcom,turingcc-qcs404.h new file +15 -0
new file mode 100644
index 000000000000..838faef57c67
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2019, Linaro Ltd
+ */
+
+#ifndef _DT_BINDINGS_CLK_TURING_QCS404_H
+#define _DT_BINDINGS_CLK_TURING_QCS404_H
+
+#define TURING_Q6SS_Q6_AXIM_CLK		0
+#define TURING_Q6SS_AHBM_AON_CLK	1
+#define TURING_WRAPPER_AON_CLK		2
+#define TURING_Q6SS_AHBS_AON_CLK	3
+#define TURING_WRAPPER_QOS_AHBS_AON_CLK	4
+
+#endif
Signature · 1 line
2.18.0
maintainer Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] dt-bindings: clock: Introduce Qualcomm Turing Clock controller

Quoted 10 lines · Bjorn Andersson

Add devicetree binding for the turing clock controller found in QCS404.

---
 .../bindings/clock/qcom,turingcc.txt          | 19 +++++++++++++++++++
 .../dt-bindings/clock/qcom,turingcc-qcs404.h  | 15 +++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,turingcc.txt
 create mode 100644 include/dt-bindings/clock/qcom,turingcc-qcs404.h
#4 lore raw

PATCH 2/3 clk: qcom: branch: Add AON clock ops

In reply to Bjorn Andersson

Some clocks can only be turned on by resetting the block containing them, provide a clock type that allow us to reference these clocks and have the client drivers enable and "disable" them.

---
 drivers/clk/qcom/clk-branch.c | 6 ++++++
 drivers/clk/qcom/clk-branch.h | 1 +
 2 files changed, 7 insertions(+)
drivers/clk/qcom/clk-branch.c +6 -0
index 99446bf630aa..f869fc6aaed6 100644
@@ -146,6 +146,12 @@ const struct clk_ops clk_branch2_ops = {
 };
 EXPORT_SYMBOL_GPL(clk_branch2_ops);
 
+const struct clk_ops clk_branch2_aon_ops = {
+	.enable = clk_branch2_enable,
+	.is_enabled = clk_is_enabled_regmap,
+};
+EXPORT_SYMBOL_GPL(clk_branch2_aon_ops);
+
 const struct clk_ops clk_branch_simple_ops = {
 	.enable = clk_enable_regmap,
 	.disable = clk_disable_regmap,
drivers/clk/qcom/clk-branch.h +1 -0
index b3561e0a3984..17a58119165e 100644
@@ -40,6 +40,7 @@ struct clk_branch {
 extern const struct clk_ops clk_branch_ops;
 extern const struct clk_ops clk_branch2_ops;
 extern const struct clk_ops clk_branch_simple_ops;
+extern const struct clk_ops clk_branch2_aon_ops;
 
 #define to_clk_branch(_hw) \
 	container_of(to_clk_regmap(_hw), struct clk_branch, clkr)
Signature · 1 line
2.18.0
maintainer Applied
#5 lore raw

Re: [PATCH 2/3] clk: qcom: branch: Add AON clock ops

Quoting Bjorn Andersson (2019-03-06 09:47:57)

Quoted 6 lines

Some clocks can only be turned on by resetting the block containing them, provide a clock type that allow us to reference these clocks and have the client drivers enable and "disable" them.

---

Applied to clk-next

#6 lore raw

PATCH 3/3 clk: qcom: Add QCS404 TuringCC

In reply to Bjorn Andersson

The Turing Clock Controller provides resources related to running the Turing subsystem.

PM runtime is used to ensure that the associated AHB clock is ticking while the clock framework is accessing the registers in the Turing clock controller.

---
 drivers/clk/qcom/Kconfig           |   6 +
 drivers/clk/qcom/Makefile          |   1 +
 drivers/clk/qcom/turingcc-qcs404.c | 170 +++++++++++++++++++++++++++++
 3 files changed, 177 insertions(+)
 create mode 100644 drivers/clk/qcom/turingcc-qcs404.c
drivers/clk/qcom/Kconfig +6 -0
index 1c04575c118f..18bdf34d5e64 100644
@@ -243,6 +243,12 @@ config SDM_GCC_660
 	  Say Y if you want to use peripheral devices such as UART, SPI,
 	  i2C, USB, UFS, SDDC, PCIe, etc.
 
+config QCS_TURING_404
+	tristate "QCS404 Turing Clock Controller"
+	help
+	  Support for the Turing Clock Controller on QCS404, provides clocks
+	  and resets for the Turing subsystem.
+
 config SDM_GCC_845
 	tristate "SDM845 Global Clock Controller"
 	select QCOM_GDSC
drivers/clk/qcom/Makefile +1 -0
index ee8d0698e370..f0768fb1f037 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_QCOM_CLK_RPM) += clk-rpm.o
 obj-$(CONFIG_QCOM_CLK_RPMH) += clk-rpmh.o
 obj-$(CONFIG_QCOM_CLK_SMD_RPM) += clk-smd-rpm.o
 obj-$(CONFIG_QCS_GCC_404) += gcc-qcs404.o
+obj-$(CONFIG_QCS_TURING_404) += turingcc-qcs404.o
 obj-$(CONFIG_SDM_CAMCC_845) += camcc-sdm845.o
 obj-$(CONFIG_SDM_DISPCC_845) += dispcc-sdm845.o
 obj-$(CONFIG_SDM_GCC_660) += gcc-sdm660.o
drivers/clk/qcom/turingcc-qcs404.c new file +170 -0

170 lines not on this page · raw message

Signature · 1 line
2.18.0
maintainer
#7 lore raw

Re: [PATCH 3/3] clk: qcom: Add QCS404 TuringCC

Quoting Bjorn Andersson (2019-03-06 09:47:58)

drivers/clk/qcom/turingcc-qcs404.c line 114

Quoted 7 lines
drivers/clk/qcom/turingcc-qcs404.c new file +7 -0
+
+static int turingcc_probe(struct platform_device *pdev)
+{
+       int ret;
+
+       pm_runtime_enable(&pdev->dev);
+       ret = pm_clk_create(&pdev->dev);

Neat solution. Thanks!

Quoted 4 lines
drivers/clk/qcom/turingcc-qcs404.c new file +4 -0
+       if (ret)
+               goto disable_pm_runtime;
+
+       ret = pm_clk_add(&pdev->dev, NULL);
maintainer Applied
#8 lore raw

Re: [PATCH 3/3] clk: qcom: Add QCS404 TuringCC

In reply to Bjorn Andersson

Quoting Bjorn Andersson (2019-03-06 09:47:58)

Quoted 9 lines

The Turing Clock Controller provides resources related to running the Turing subsystem.

PM runtime is used to ensure that the associated AHB clock is ticking while the clock framework is accessing the registers in the Turing clock controller.

---

Applied to clk-next