Skip to content

Commit 0dea4e3

Browse files
committed
Merge tag 'qcom-clk-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom
Pull Qualcomm clk driver updates from Bjorn Andersson: - Initial support for the SM4450 Global Clock Controller and RPMh clock controllers - Drop CLK_SET_RATE_PARENT for clocks with fixed-rate GPLLs across a variety of IPQ platforms - Add missing parent of APCS PLL on IPQ6018 - Add I2C QUP6 clk on IPQ6018 but mark it critical to avoid problems with RPM - Implement safe source switching for a53pll and use on IPQ5332 - Add support for Stromer Plus PLLs - Switch SM8550 Video and GPU clock controllers to use OLE PLL configure method - Non critical fixes to halt bit checks - Add SMMU GDSC for MSM8998 - Fix possible integer overflow in RCG frequency calculation code - Remove RPM managed clks from MSM8996 GCC driver - Add Camera Clock Controller on SM8550 - Add HFPLL configuration for the three HFPLLs in MSM8976 - Switch MSM8996 CBF clock driver's remove function to return void * tag 'qcom-clk-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (36 commits) clk: qcom: apss-ipq6018: add the GPLL0 clock also as clock provider clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq5018: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks clk: qcom: gcc-ipq6018: add QUP6 I2C clock clk: qcom: apss-ipq6018: ipq5332: add safe source switch for a53pll clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll clk: qcom: clk-alpha-pll: introduce stromer plus ops clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM clk: qcom: videocc-sm8550: switch to clk_lucid_ole_pll_configure clk: qcom: gpucc-sm8550: switch to clk_lucid_ole_pll_configure clk: qcom: Replace of_device.h with explicit includes clk: qcom: smd-rpm: Move CPUSS_GNoC clock to interconnect clk: qcom: cbf-msm8996: Convert to platform remove callback returning void clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src clk: qcom: Add GCC driver support for SM4450 dt-bindings: clock: qcom: Add GCC clocks for SM4450 ...
2 parents 0bb80ec + e0e6373 commit 0dea4e3

33 files changed

+7235
-317
lines changed

Documentation/devicetree/bindings/clock/qcom,hfpll.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ PROPERTIES
1212
"qcom,hfpll-apq8064", "qcom,hfpll"
1313
"qcom,hfpll-msm8974", "qcom,hfpll"
1414
"qcom,hfpll-msm8960", "qcom,hfpll"
15+
"qcom,msm8976-hfpll-a53", "qcom,hfpll"
16+
"qcom,msm8976-hfpll-a72", "qcom,hfpll"
17+
"qcom,msm8976-hfpll-cci", "qcom,hfpll"
1518

1619
- reg:
1720
Usage: required

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
- qcom,sdx55-rpmh-clk
2929
- qcom,sdx65-rpmh-clk
3030
- qcom,sdx75-rpmh-clk
31+
- qcom,sm4450-rpmh-clk
3132
- qcom,sm6350-rpmh-clk
3233
- qcom,sm8150-rpmh-clk
3334
- qcom,sm8250-rpmh-clk
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/qcom,sm4450-gcc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm Global Clock & Reset Controller on SM4450
8+
9+
maintainers:
10+
- Ajit Pandey <[email protected]>
11+
- Taniya Das <[email protected]>
12+
13+
description: |
14+
Qualcomm global clock control module provides the clocks, resets and power
15+
domains on SM4450
16+
17+
See also:: include/dt-bindings/clock/qcom,sm4450-gcc.h
18+
19+
properties:
20+
compatible:
21+
const: qcom,sm4450-gcc
22+
23+
clocks:
24+
items:
25+
- description: Board XO source
26+
- description: Sleep clock source
27+
- description: UFS Phy Rx symbol 0 clock source
28+
- description: UFS Phy Rx symbol 1 clock source
29+
- description: UFS Phy Tx symbol 0 clock source
30+
- description: USB3 Phy wrapper pipe clock source
31+
32+
required:
33+
- compatible
34+
- clocks
35+
36+
allOf:
37+
- $ref: qcom,gcc.yaml#
38+
39+
unevaluatedProperties: false
40+
41+
examples:
42+
- |
43+
#include <dt-bindings/clock/qcom,rpmh.h>
44+
clock-controller@100000 {
45+
compatible = "qcom,sm4450-gcc";
46+
reg = <0x00100000 0x001f4200>;
47+
clocks = <&rpmhcc RPMH_CXO_CLK>, <&sleep_clk>,
48+
<&ufs_mem_phy 0>, <&ufs_mem_phy 1>,
49+
<&ufs_mem_phy 2>, <&usb_1_qmpphy>;
50+
#clock-cells = <1>;
51+
#reset-cells = <1>;
52+
#power-domain-cells = <1>;
53+
};
54+
55+
...

Documentation/devicetree/bindings/clock/qcom,sm8450-camcc.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ description: |
1313
Qualcomm camera clock control module provides the clocks, resets and power
1414
domains on SM8450.
1515
16-
See also:: include/dt-bindings/clock/qcom,sm8450-camcc.h
16+
See also::
17+
include/dt-bindings/clock/qcom,sm8450-camcc.h
18+
include/dt-bindings/clock/qcom,sm8550-camcc.h
1719
1820
properties:
1921
compatible:
20-
const: qcom,sm8450-camcc
22+
enum:
23+
- qcom,sm8450-camcc
24+
- qcom,sm8550-camcc
2125

2226
clocks:
2327
items:

drivers/clk/qcom/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ config IPQ_APSS_6018
131131
tristate "IPQ APSS Clock Controller"
132132
select IPQ_APSS_PLL
133133
depends on QCOM_APCS_IPC || COMPILE_TEST
134+
depends on QCOM_SMEM
134135
help
135136
Support for APSS clock controller on IPQ platforms. The
136137
APSS clock controller manages the Mux and enable block that feeds the
@@ -764,6 +765,13 @@ config SM_CAMCC_8450
764765
Support for the camera clock controller on SM8450 devices.
765766
Say Y if you want to support camera devices and camera functionality.
766767

768+
config SM_CAMCC_8550
769+
tristate "SM8550 Camera Clock Controller"
770+
select SM_GCC_8550
771+
help
772+
Support for the camera clock controller on SM8550 devices.
773+
Say Y if you want to support camera devices and camera functionality.
774+
767775
config SM_DISPCC_6115
768776
tristate "SM6115 Display Clock Controller"
769777
depends on ARM64 || COMPILE_TEST
@@ -834,6 +842,15 @@ config SM_DISPCC_8550
834842
Say Y if you want to support display devices and functionality such as
835843
splash screen.
836844

845+
config SM_GCC_4450
846+
tristate "SM4450 Global Clock Controller"
847+
depends on ARM64 || COMPILE_TEST
848+
select QCOM_GDSC
849+
help
850+
Support for the global clock controller on SM4450 devices.
851+
Say Y if you want to use peripheral devices such as UART, SPI,
852+
I2C, USB, SD/UFS, PCIe, etc.
853+
837854
config SM_GCC_6115
838855
tristate "SM6115 and SM4250 Global Clock Controller"
839856
depends on ARM64 || COMPILE_TEST

drivers/clk/qcom/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@ obj-$(CONFIG_SDX_GCC_75) += gcc-sdx75.o
102102
obj-$(CONFIG_SM_CAMCC_6350) += camcc-sm6350.o
103103
obj-$(CONFIG_SM_CAMCC_8250) += camcc-sm8250.o
104104
obj-$(CONFIG_SM_CAMCC_8450) += camcc-sm8450.o
105+
obj-$(CONFIG_SM_CAMCC_8550) += camcc-sm8550.o
105106
obj-$(CONFIG_SM_DISPCC_6115) += dispcc-sm6115.o
106107
obj-$(CONFIG_SM_DISPCC_6125) += dispcc-sm6125.o
107108
obj-$(CONFIG_SM_DISPCC_6350) += dispcc-sm6350.o
108109
obj-$(CONFIG_SM_DISPCC_6375) += dispcc-sm6375.o
109110
obj-$(CONFIG_SM_DISPCC_8250) += dispcc-sm8250.o
110111
obj-$(CONFIG_SM_DISPCC_8450) += dispcc-sm8450.o
111112
obj-$(CONFIG_SM_DISPCC_8550) += dispcc-sm8550.o
113+
obj-$(CONFIG_SM_GCC_4450) += gcc-sm4450.o
112114
obj-$(CONFIG_SM_GCC_6115) += gcc-sm6115.o
113115
obj-$(CONFIG_SM_GCC_6125) += gcc-sm6125.o
114116
obj-$(CONFIG_SM_GCC_6350) += gcc-sm6350.o

drivers/clk/qcom/apss-ipq-pll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ static struct clk_alpha_pll ipq_pll_stromer_plus = {
6868
.fw_name = "xo",
6969
},
7070
.num_parents = 1,
71-
.ops = &clk_alpha_pll_stromer_ops,
71+
.ops = &clk_alpha_pll_stromer_plus_ops,
7272
},
7373
},
7474
};
7575

7676
static const struct alpha_pll_config ipq5332_pll_config = {
77-
.l = 0x3e,
77+
.l = 0x2d,
7878
.config_ctl_val = 0x4001075b,
7979
.config_ctl_hi_val = 0x304,
8080
.main_output_mask = BIT(0),

drivers/clk/qcom/apss-ipq6018.c

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
#include <linux/clk-provider.h>
1010
#include <linux/regmap.h>
1111
#include <linux/module.h>
12+
#include <linux/clk.h>
13+
#include <linux/soc/qcom/smem.h>
1214

1315
#include <dt-bindings/clock/qcom,apss-ipq.h>
16+
#include <dt-bindings/arm/qcom,ids.h>
1417

1518
#include "common.h"
1619
#include "clk-regmap.h"
@@ -20,16 +23,19 @@
2023

2124
enum {
2225
P_XO,
26+
P_GPLL0,
2327
P_APSS_PLL_EARLY,
2428
};
2529

2630
static const struct clk_parent_data parents_apcs_alias0_clk_src[] = {
2731
{ .fw_name = "xo" },
32+
{ .fw_name = "gpll0" },
2833
{ .fw_name = "pll" },
2934
};
3035

3136
static const struct parent_map parents_apcs_alias0_clk_src_map[] = {
3237
{ P_XO, 0 },
38+
{ P_GPLL0, 4 },
3339
{ P_APSS_PLL_EARLY, 5 },
3440
};
3541

@@ -81,15 +87,68 @@ static const struct qcom_cc_desc apss_ipq6018_desc = {
8187
.num_clks = ARRAY_SIZE(apss_ipq6018_clks),
8288
};
8389

90+
static int cpu_clk_notifier_fn(struct notifier_block *nb, unsigned long action,
91+
void *data)
92+
{
93+
struct clk_hw *hw;
94+
u8 index;
95+
int err;
96+
97+
if (action == PRE_RATE_CHANGE)
98+
index = P_GPLL0;
99+
else if (action == POST_RATE_CHANGE || action == ABORT_RATE_CHANGE)
100+
index = P_APSS_PLL_EARLY;
101+
else
102+
return NOTIFY_OK;
103+
104+
hw = &apcs_alias0_clk_src.clkr.hw;
105+
err = clk_rcg2_mux_closest_ops.set_parent(hw, index);
106+
107+
return notifier_from_errno(err);
108+
}
109+
84110
static int apss_ipq6018_probe(struct platform_device *pdev)
85111
{
112+
struct clk_hw *hw = &apcs_alias0_clk_src.clkr.hw;
113+
struct notifier_block *cpu_clk_notifier;
86114
struct regmap *regmap;
115+
u32 soc_id;
116+
int ret;
117+
118+
ret = qcom_smem_get_soc_id(&soc_id);
119+
if (ret)
120+
return ret;
87121

88122
regmap = dev_get_regmap(pdev->dev.parent, NULL);
89123
if (!regmap)
90124
return -ENODEV;
91125

92-
return qcom_cc_really_probe(pdev, &apss_ipq6018_desc, regmap);
126+
ret = qcom_cc_really_probe(pdev, &apss_ipq6018_desc, regmap);
127+
if (ret)
128+
return ret;
129+
130+
switch (soc_id) {
131+
/* Only below variants of IPQ53xx support scaling */
132+
case QCOM_ID_IPQ5332:
133+
case QCOM_ID_IPQ5322:
134+
case QCOM_ID_IPQ5300:
135+
cpu_clk_notifier = devm_kzalloc(&pdev->dev,
136+
sizeof(*cpu_clk_notifier),
137+
GFP_KERNEL);
138+
if (!cpu_clk_notifier)
139+
return -ENOMEM;
140+
141+
cpu_clk_notifier->notifier_call = cpu_clk_notifier_fn;
142+
143+
ret = devm_clk_notifier_register(&pdev->dev, hw->clk, cpu_clk_notifier);
144+
if (ret)
145+
return ret;
146+
break;
147+
default:
148+
break;
149+
}
150+
151+
return 0;
93152
}
94153

95154
static struct platform_driver apss_ipq6018_driver = {

0 commit comments

Comments
 (0)