Qualcomm QCS404 Turing Clock Controller
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
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
@@ -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
@@ -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
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.
Signed-off-by Bjorn Andersson <[email protected]>--- .../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
Re: [PATCH 1/3] dt-bindings: clock: Introduce Qualcomm Turing Clock controller
In reply to Bjorn AnderssonQuoting Bjorn Andersson (2019-03-06 09:47:56)
Quoted 4 lines
Add devicetree binding for the turing clock controller found in QCS404.
Signed-off-by Bjorn Andersson <[email protected]>---
Applied to clk-next
PATCH 2/3 clk: qcom: branch: Add AON clock ops
In reply to Bjorn AnderssonSome 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
@@ -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
@@ -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
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.
Signed-off-by Bjorn Andersson <[email protected]>---
Applied to clk-next
PATCH 3/3 clk: qcom: Add QCS404 TuringCC
In reply to Bjorn AnderssonThe 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
@@ -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
@@ -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
Stephen Boyd
maintainerRe: [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 );
Re: [PATCH 3/3] clk: qcom: Add QCS404 TuringCC
In reply to Bjorn AnderssonQuoting 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.
Signed-off-by Bjorn Andersson <[email protected]>---
Applied to clk-next