aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2018-12-14 16:27:39 -0500
committerStephen Boyd <sboyd@kernel.org>2018-12-14 16:27:53 -0500
commit3315fe5faff4e38fafba8434ea75d90ed66a44c6 (patch)
tree1fd419860852e75df3256c2a4335f7b49faee975
parentf4ad7fba066f70ccd50816476e2f8700013c0724 (diff)
parent8d3e5b9c1f2cdb9c81073e1f51643617078076ed (diff)
Merge branch 'clk-qcom-sdm845-lpass' into clk-next
- Qualcomm SDM845 audio subsystem clks * clk-qcom-sdm845-lpass: clk: qcom: Add lpass clock controller driver for SDM845 dt-bindings: clock: Introduce QCOM LPASS clock bindings dt-bindings: clock: Update GCC bindings for protected-clocks
-rw-r--r--Documentation/devicetree/bindings/clock/qcom,gcc.txt16
-rw-r--r--Documentation/devicetree/bindings/clock/qcom,lpasscc.txt26
-rw-r--r--drivers/clk/qcom/Kconfig8
-rw-r--r--drivers/clk/qcom/Makefile1
-rw-r--r--drivers/clk/qcom/gcc-sdm845.c35
-rw-r--r--drivers/clk/qcom/lpasscc-sdm845.c179
-rw-r--r--include/dt-bindings/clock/qcom,gcc-sdm845.h2
-rw-r--r--include/dt-bindings/clock/qcom,lpass-sdm845.h15
8 files changed, 282 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc.txt b/Documentation/devicetree/bindings/clock/qcom,gcc.txt
index 52d9345c9927..8661c3cd3ccf 100644
--- a/Documentation/devicetree/bindings/clock/qcom,gcc.txt
+++ b/Documentation/devicetree/bindings/clock/qcom,gcc.txt
@@ -35,6 +35,8 @@ be part of GCC and hence the TSENS properties can also be
35part of the GCC/clock-controller node. 35part of the GCC/clock-controller node.
36For more details on the TSENS properties please refer 36For more details on the TSENS properties please refer
37Documentation/devicetree/bindings/thermal/qcom-tsens.txt 37Documentation/devicetree/bindings/thermal/qcom-tsens.txt
38- protected-clocks : Protected clock specifier list as per common clock
39 binding.
38 40
39Example: 41Example:
40 clock-controller@900000 { 42 clock-controller@900000 {
@@ -55,3 +57,17 @@ Example of GCC with TSENS properties:
55 #reset-cells = <1>; 57 #reset-cells = <1>;
56 #thermal-sensor-cells = <1>; 58 #thermal-sensor-cells = <1>;
57 }; 59 };
60
61Example of GCC with protected-clocks properties:
62 clock-controller@100000 {
63 compatible = "qcom,gcc-sdm845";
64 reg = <0x100000 0x1f0000>;
65 #clock-cells = <1>;
66 #reset-cells = <1>;
67 #power-domain-cells = <1>;
68 protected-clocks = <GCC_QSPI_CORE_CLK>,
69 <GCC_QSPI_CORE_CLK_SRC>,
70 <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
71 <GCC_LPASS_Q6_AXI_CLK>,
72 <GCC_LPASS_SWAY_CLK>;
73 };
diff --git a/Documentation/devicetree/bindings/clock/qcom,lpasscc.txt b/Documentation/devicetree/bindings/clock/qcom,lpasscc.txt
new file mode 100644
index 000000000000..b9e9787045b9
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,lpasscc.txt
@@ -0,0 +1,26 @@
1Qualcomm LPASS Clock Controller Binding
2-----------------------------------------------
3
4Required properties :
5- compatible : shall contain "qcom,sdm845-lpasscc"
6- #clock-cells : from common clock binding, shall contain 1.
7- reg : shall contain base register address and size,
8 in the order
9 Index-0 maps to LPASS_CC register region
10 Index-1 maps to LPASS_QDSP6SS register region
11
12Optional properties :
13- reg-names : register names of LPASS domain
14 "cc", "qdsp6ss".
15
16Example:
17
18The below node has to be defined in the cases where the LPASS peripheral loader
19would bring the subsystem out of reset.
20
21 lpasscc: clock-controller@17014000 {
22 compatible = "qcom,sdm845-lpasscc";
23 reg = <0x17014000 0x1f004>, <0x17300000 0x200>;
24 reg-names = "cc", "qdsp6ss";
25 #clock-cells = <1>;
26 };
diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
index aca754f09817..1b1ba54e33dd 100644
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
@@ -276,6 +276,14 @@ config SDM_DISPCC_845
276 Say Y if you want to support display devices and functionality such as 276 Say Y if you want to support display devices and functionality such as
277 splash screen. 277 splash screen.
278 278
279config SDM_LPASSCC_845
280 tristate "SDM845 Low Power Audio Subsystem (LPAAS) Clock Controller"
281 select SDM_GCC_845
282 help
283 Support for the LPASS clock controller on SDM845 devices.
284 Say Y if you want to use the LPASS branch clocks of the LPASS clock
285 controller to reset the LPASS subsystem.
286
279config SPMI_PMIC_CLKDIV 287config SPMI_PMIC_CLKDIV
280 tristate "SPMI PMIC clkdiv Support" 288 tristate "SPMI PMIC clkdiv Support"
281 depends on SPMI || COMPILE_TEST 289 depends on SPMI || COMPILE_TEST
diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
index 6ed28272e176..ee8d0698e370 100644
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
@@ -47,6 +47,7 @@ obj-$(CONFIG_SDM_DISPCC_845) += dispcc-sdm845.o
47obj-$(CONFIG_SDM_GCC_660) += gcc-sdm660.o 47obj-$(CONFIG_SDM_GCC_660) += gcc-sdm660.o
48obj-$(CONFIG_SDM_GCC_845) += gcc-sdm845.o 48obj-$(CONFIG_SDM_GCC_845) += gcc-sdm845.o
49obj-$(CONFIG_SDM_GPUCC_845) += gpucc-sdm845.o 49obj-$(CONFIG_SDM_GPUCC_845) += gpucc-sdm845.o
50obj-$(CONFIG_SDM_LPASSCC_845) += lpasscc-sdm845.o
50obj-$(CONFIG_SDM_VIDEOCC_845) += videocc-sdm845.o 51obj-$(CONFIG_SDM_VIDEOCC_845) += videocc-sdm845.o
51obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o 52obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o
52obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o 53obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o
diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c
index f133b7f5652f..c782e62dd98b 100644
--- a/drivers/clk/qcom/gcc-sdm845.c
+++ b/drivers/clk/qcom/gcc-sdm845.c
@@ -3153,6 +3153,37 @@ static struct clk_branch gcc_cpuss_gnoc_clk = {
3153 }, 3153 },
3154}; 3154};
3155 3155
3156/* TODO: Remove after DTS updated to protect these */
3157#ifdef CONFIG_SDM_LPASSCC_845
3158static struct clk_branch gcc_lpass_q6_axi_clk = {
3159 .halt_reg = 0x47000,
3160 .halt_check = BRANCH_HALT,
3161 .clkr = {
3162 .enable_reg = 0x47000,
3163 .enable_mask = BIT(0),
3164 .hw.init = &(struct clk_init_data){
3165 .name = "gcc_lpass_q6_axi_clk",
3166 .flags = CLK_IS_CRITICAL,
3167 .ops = &clk_branch2_ops,
3168 },
3169 },
3170};
3171
3172static struct clk_branch gcc_lpass_sway_clk = {
3173 .halt_reg = 0x47008,
3174 .halt_check = BRANCH_HALT,
3175 .clkr = {
3176 .enable_reg = 0x47008,
3177 .enable_mask = BIT(0),
3178 .hw.init = &(struct clk_init_data){
3179 .name = "gcc_lpass_sway_clk",
3180 .flags = CLK_IS_CRITICAL,
3181 .ops = &clk_branch2_ops,
3182 },
3183 },
3184};
3185#endif
3186
3156static struct gdsc pcie_0_gdsc = { 3187static struct gdsc pcie_0_gdsc = {
3157 .gdscr = 0x6b004, 3188 .gdscr = 0x6b004,
3158 .pd = { 3189 .pd = {
@@ -3453,6 +3484,10 @@ static struct clk_regmap *gcc_sdm845_clocks[] = {
3453 [GCC_QSPI_CORE_CLK_SRC] = &gcc_qspi_core_clk_src.clkr, 3484 [GCC_QSPI_CORE_CLK_SRC] = &gcc_qspi_core_clk_src.clkr,
3454 [GCC_QSPI_CORE_CLK] = &gcc_qspi_core_clk.clkr, 3485 [GCC_QSPI_CORE_CLK] = &gcc_qspi_core_clk.clkr,
3455 [GCC_QSPI_CNOC_PERIPH_AHB_CLK] = &gcc_qspi_cnoc_periph_ahb_clk.clkr, 3486 [GCC_QSPI_CNOC_PERIPH_AHB_CLK] = &gcc_qspi_cnoc_periph_ahb_clk.clkr,
3487#ifdef CONFIG_SDM_LPASSCC_845
3488 [GCC_LPASS_Q6_AXI_CLK] = &gcc_lpass_q6_axi_clk.clkr,
3489 [GCC_LPASS_SWAY_CLK] = &gcc_lpass_sway_clk.clkr,
3490#endif
3456}; 3491};
3457 3492
3458static const struct qcom_reset_map gcc_sdm845_resets[] = { 3493static const struct qcom_reset_map gcc_sdm845_resets[] = {
diff --git a/drivers/clk/qcom/lpasscc-sdm845.c b/drivers/clk/qcom/lpasscc-sdm845.c
new file mode 100644
index 000000000000..e246b99dfbc6
--- /dev/null
+++ b/drivers/clk/qcom/lpasscc-sdm845.c
@@ -0,0 +1,179 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
4 */
5
6#include <linux/platform_device.h>
7#include <linux/module.h>
8#include <linux/of_address.h>
9#include <linux/regmap.h>
10
11#include <dt-bindings/clock/qcom,lpass-sdm845.h>
12
13#include "clk-regmap.h"
14#include "clk-branch.h"
15#include "common.h"
16
17static struct clk_branch lpass_q6ss_ahbm_aon_clk = {
18 .halt_reg = 0x12000,
19 .halt_check = BRANCH_VOTED,
20 .clkr = {
21 .enable_reg = 0x12000,
22 .enable_mask = BIT(0),
23 .hw.init = &(struct clk_init_data){
24 .name = "lpass_q6ss_ahbm_aon_clk",
25 .ops = &clk_branch2_ops,
26 },
27 },
28};
29
30static struct clk_branch lpass_q6ss_ahbs_aon_clk = {
31 .halt_reg = 0x1f000,
32 .halt_check = BRANCH_VOTED,
33 .clkr = {
34 .enable_reg = 0x1f000,
35 .enable_mask = BIT(0),
36 .hw.init = &(struct clk_init_data){
37 .name = "lpass_q6ss_ahbs_aon_clk",
38