Skip to content

Commit e221138

Browse files
committed
Merge tag 'qcom-clk-for-6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom
Pull Qualcomm clk driver updates from Bjorn Andersson: - Add support in qcom RCG and RCG2 for multiple configurations for the same frequency - Use above support for IPQ8074 NSS port 5 and 6 clocks to resolve issues - Fix the Qualcomm APSS IPQ5018 PLL to fix boot failures of some boards - Cleanups and fixes for Qualcomm Stromer PLLs - Reduce max CPU frequency on Qualcomm APSS IPQ5018 - Fix Kconfig dependencies of Qualcomm SM8650 GPU and SC8280XP camera clk drivers - Make Qualcomm MSM8998 Venus clocks functional - Cleanup downstream remnants related to DisplayPort across Qualcomm SM8450, SM6350, SM8550, and SM8650 - Reuse the Huayra APSS register map on Qualcomm MSM8996 CBF PLL - Use a specific Qualcomm QCS404 compatible for the otherwise generic HFPLL - Remove Qualcomm SM8150 CPUSS AHB clk as it is unused - Remove an unused field in the Qualcomm RPM clk driver - Add missing MODULE_DEVICE_TABLE to Qualcomm MSM8917 and MSM8953 global clock controller drivers * tag 'qcom-clk-for-6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (27 commits) clk: qcom: clk-alpha-pll: fix rate setting for Stromer PLLs clk: qcom: apss-ipq-pll: fix PLL rate for IPQ5018 clk: qcom: Fix SM_GPUCC_8650 dependencies clk: qcom: Fix SC_CAMCC_8280XP dependencies clk: qcom: mmcc-msm8998: fix venus clock issue clk: qcom: dispcc-sm8650: fix DisplayPort clocks clk: qcom: dispcc-sm8550: fix DisplayPort clocks clk: qcom: dispcc-sm6350: fix DisplayPort clocks clk: qcom: dispcc-sm8450: fix DisplayPort clocks clk: qcom: clk-cbf-8996: use HUAYRA_APSS register map for cbf_pll clk: qcom: apss-ipq-pll: constify clk_init_data structures clk: qcom: apss-ipq-pll: constify match data structures clk: qcom: apss-ipq-pll: move Huayra register map to 'clk_alpha_pll_regs' clk: qcom: apss-ipq-pll: reuse Stromer reg offsets from 'clk_alpha_pll_regs' clk: qcom: apss-ipq-pll: use stromer ops for IPQ5018 to fix boot failure clk: qcom: gcc-ipq8074: rework nss_port5/6 clock to multiple conf clk: qcom: clk-rcg2: add support for rcg2 freq multi ops clk: qcom: clk-rcg: introduce support for multiple conf for same freq clk: qcom: hfpll: Add QCS404-specific compatible dt-bindings: clock: qcom,hfpll: Convert to YAML ...
2 parents 4cece76 + 3c5b3e1 commit e221138

22 files changed

+445
-285
lines changed

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

Lines changed: 0 additions & 63 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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,hfpll.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm High-Frequency PLL
8+
9+
maintainers:
10+
- Bjorn Andersson <andersson@kernel.org>
11+
12+
description:
13+
The HFPLL is used as CPU PLL on various Qualcomm SoCs.
14+
15+
properties:
16+
compatible:
17+
oneOf:
18+
- enum:
19+
- qcom,msm8974-hfpll
20+
- qcom,msm8976-hfpll-a53
21+
- qcom,msm8976-hfpll-a72
22+
- qcom,msm8976-hfpll-cci
23+
- qcom,qcs404-hfpll
24+
- const: qcom,hfpll
25+
deprecated: true
26+
27+
reg:
28+
items:
29+
- description: HFPLL registers
30+
- description: Alias register region
31+
minItems: 1
32+
33+
'#clock-cells':
34+
const: 0
35+
36+
clocks:
37+
items:
38+
- description: board XO clock
39+
40+
clock-names:
41+
items:
42+
- const: xo
43+
44+
clock-output-names:
45+
description:
46+
Name of the PLL. Typically hfpllX where X is a CPU number starting at 0.
47+
Otherwise hfpll_Y where Y is more specific such as "l2".
48+
maxItems: 1
49+
50+
required:
51+
- compatible
52+
- reg
53+
- '#clock-cells'
54+
- clocks
55+
- clock-names
56+
- clock-output-names
57+
58+
additionalProperties: false
59+
60+
examples:
61+
- |
62+
clock-controller@f908a000 {
63+
compatible = "qcom,msm8974-hfpll";
64+
reg = <0xf908a000 0x30>, <0xf900a000 0x30>;
65+
#clock-cells = <0>;
66+
clock-output-names = "hfpll0";
67+
clocks = <&xo_board>;
68+
clock-names = "xo";
69+
};

drivers/clk/qcom/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ config SC_CAMCC_7280
474474

475475
config SC_CAMCC_8280XP
476476
tristate "SC8280XP Camera Clock Controller"
477+
depends on ARM64 || COMPILE_TEST
477478
select SC_GCC_8280XP
478479
help
479480
Support for the camera clock controller on Qualcomm Technologies, Inc
@@ -1094,6 +1095,7 @@ config SM_GPUCC_8550
10941095

10951096
config SM_GPUCC_8650
10961097
tristate "SM8650 Graphics Clock Controller"
1098+
depends on ARM64 || COMPILE_TEST
10971099
select SM_GCC_8650
10981100
help
10991101
Support for the graphics clock controller on SM8650 devices.

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

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,61 +8,54 @@
88

99
#include "clk-alpha-pll.h"
1010

11-
/*
12-
* Even though APSS PLL type is of existing one (like Huayra), its offsets
13-
* are different from the one mentioned in the clk-alpha-pll.c, since the
14-
* PLL is specific to APSS, so lets the define the same.
15-
*/
16-
static const u8 ipq_pll_offsets[][PLL_OFF_MAX_REGS] = {
17-
[CLK_ALPHA_PLL_TYPE_HUAYRA] = {
18-
[PLL_OFF_L_VAL] = 0x08,
19-
[PLL_OFF_ALPHA_VAL] = 0x10,
20-
[PLL_OFF_USER_CTL] = 0x18,
21-
[PLL_OFF_CONFIG_CTL] = 0x20,
22-
[PLL_OFF_CONFIG_CTL_U] = 0x24,
23-
[PLL_OFF_STATUS] = 0x28,
24-
[PLL_OFF_TEST_CTL] = 0x30,
25-
[PLL_OFF_TEST_CTL_U] = 0x34,
26-
},
27-
[CLK_ALPHA_PLL_TYPE_STROMER_PLUS] = {
28-
[PLL_OFF_L_VAL] = 0x08,
29-
[PLL_OFF_ALPHA_VAL] = 0x10,
30-
[PLL_OFF_ALPHA_VAL_U] = 0x14,
31-
[PLL_OFF_USER_CTL] = 0x18,
32-
[PLL_OFF_USER_CTL_U] = 0x1c,
33-
[PLL_OFF_CONFIG_CTL] = 0x20,
34-
[PLL_OFF_STATUS] = 0x28,
35-
[PLL_OFF_TEST_CTL] = 0x30,
36-
[PLL_OFF_TEST_CTL_U] = 0x34,
11+
static struct clk_alpha_pll ipq_pll_huayra = {
12+
.offset = 0x0,
13+
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_HUAYRA_APSS],
14+
.flags = SUPPORTS_DYNAMIC_UPDATE,
15+
.clkr = {
16+
.enable_reg = 0x0,
17+
.enable_mask = BIT(0),
18+
.hw.init = &(const struct clk_init_data) {
19+
.name = "a53pll",
20+
.parent_data = &(const struct clk_parent_data) {
21+
.fw_name = "xo",
22+
},
23+
.num_parents = 1,
24+
.ops = &clk_alpha_pll_huayra_ops,
25+
},
3726
},
3827
};
3928

40-
static struct clk_alpha_pll ipq_pll_huayra = {
29+
static struct clk_alpha_pll ipq_pll_stromer = {
4130
.offset = 0x0,
42-
.regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_HUAYRA],
31+
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_STROMER],
4332
.flags = SUPPORTS_DYNAMIC_UPDATE,
4433
.clkr = {
4534
.enable_reg = 0x0,
4635
.enable_mask = BIT(0),
47-
.hw.init = &(struct clk_init_data){
36+
.hw.init = &(const struct clk_init_data) {
4837
.name = "a53pll",
4938
.parent_data = &(const struct clk_parent_data) {
5039
.fw_name = "xo",
5140
},
5241
.num_parents = 1,
53-
.ops = &clk_alpha_pll_huayra_ops,
42+
.ops = &clk_alpha_pll_stromer_ops,
5443
},
5544
},
5645
};
5746

5847
static struct clk_alpha_pll ipq_pll_stromer_plus = {
5948
.offset = 0x0,
60-
.regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_STROMER_PLUS],
49+
/*
50+
* The register offsets of the Stromer Plus PLL used in IPQ5332
51+
* are the same as the Stromer PLL's offsets.
52+
*/
53+
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_STROMER],
6154
.flags = SUPPORTS_DYNAMIC_UPDATE,
6255
.clkr = {
6356
.enable_reg = 0x0,
6457
.enable_mask = BIT(0),
65-
.hw.init = &(struct clk_init_data){
58+
.hw.init = &(const struct clk_init_data) {
6659
.name = "a53pll",
6760
.parent_data = &(const struct clk_parent_data) {
6861
.fw_name = "xo",
@@ -73,8 +66,9 @@ static struct clk_alpha_pll ipq_pll_stromer_plus = {
7366
},
7467
};
7568

69+
/* 1.008 GHz configuration */
7670
static const struct alpha_pll_config ipq5018_pll_config = {
77-
.l = 0x32,
71+
.l = 0x2a,
7872
.config_ctl_val = 0x4001075b,
7973
.config_ctl_hi_val = 0x304,
8074
.main_output_mask = BIT(0),
@@ -144,30 +138,30 @@ struct apss_pll_data {
144138
};
145139

146140
static const struct apss_pll_data ipq5018_pll_data = {
147-
.pll_type = CLK_ALPHA_PLL_TYPE_STROMER_PLUS,
148-
.pll = &ipq_pll_stromer_plus,
141+
.pll_type = CLK_ALPHA_PLL_TYPE_STROMER,
142+
.pll = &ipq_pll_stromer,
149143
.pll_config = &ipq5018_pll_config,
150144
};
151145

152-
static struct apss_pll_data ipq5332_pll_data = {
146+
static const struct apss_pll_data ipq5332_pll_data = {
153147
.pll_type = CLK_ALPHA_PLL_TYPE_STROMER_PLUS,
154148
.pll = &ipq_pll_stromer_plus,
155149
.pll_config = &ipq5332_pll_config,
156150
};
157151

158-
static struct apss_pll_data ipq8074_pll_data = {
152+
static const struct apss_pll_data ipq8074_pll_data = {
159153
.pll_type = CLK_ALPHA_PLL_TYPE_HUAYRA,
160154
.pll = &ipq_pll_huayra,
161155
.pll_config = &ipq8074_pll_config,
162156
};
163157

164-
static struct apss_pll_data ipq6018_pll_data = {
158+
static const struct apss_pll_data ipq6018_pll_data = {
165159
.pll_type = CLK_ALPHA_PLL_TYPE_HUAYRA,
166160
.pll = &ipq_pll_huayra,
167161
.pll_config = &ipq6018_pll_config,
168162
};
169163

170-
static struct apss_pll_data ipq9574_pll_data = {
164+
static const struct apss_pll_data ipq9574_pll_data = {
171165
.pll_type = CLK_ALPHA_PLL_TYPE_HUAYRA,
172166
.pll = &ipq_pll_huayra,
173167
.pll_config = &ipq9574_pll_config,
@@ -203,7 +197,8 @@ static int apss_ipq_pll_probe(struct platform_device *pdev)
203197

204198
if (data->pll_type == CLK_ALPHA_PLL_TYPE_HUAYRA)
205199
clk_alpha_pll_configure(data->pll, regmap, data->pll_config);
206-
else if (data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER_PLUS)
200+
else if (data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER ||
201+
data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER_PLUS)
207202
clk_stromer_pll_configure(data->pll, regmap, data->pll_config);
208203

209204
ret = devm_clk_register_regmap(dev, &data->pll->clkr);

drivers/clk/qcom/clk-alpha-pll.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
8383
[PLL_OFF_TEST_CTL_U] = 0x20,
8484
[PLL_OFF_STATUS] = 0x24,
8585
},
86+
[CLK_ALPHA_PLL_TYPE_HUAYRA_APSS] = {
87+
[PLL_OFF_L_VAL] = 0x08,
88+
[PLL_OFF_ALPHA_VAL] = 0x10,
89+
[PLL_OFF_USER_CTL] = 0x18,
90+
[PLL_OFF_CONFIG_CTL] = 0x20,
91+
[PLL_OFF_CONFIG_CTL_U] = 0x24,
92+
[PLL_OFF_STATUS] = 0x28,
93+
[PLL_OFF_TEST_CTL] = 0x30,
94+
[PLL_OFF_TEST_CTL_U] = 0x34,
95+
},
8696
[CLK_ALPHA_PLL_TYPE_BRAMMO] = {
8797
[PLL_OFF_L_VAL] = 0x04,
8898
[PLL_OFF_ALPHA_VAL] = 0x08,
@@ -213,10 +223,9 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
213223
[PLL_OFF_USER_CTL] = 0x18,
214224
[PLL_OFF_USER_CTL_U] = 0x1c,
215225
[PLL_OFF_CONFIG_CTL] = 0x20,
216-
[PLL_OFF_CONFIG_CTL_U] = 0xff,
226+
[PLL_OFF_STATUS] = 0x28,
217227
[PLL_OFF_TEST_CTL] = 0x30,
218228
[PLL_OFF_TEST_CTL_U] = 0x34,
219-
[PLL_OFF_STATUS] = 0x28,
220229
},
221230
[CLK_ALPHA_PLL_TYPE_STROMER_PLUS] = {
222231
[PLL_OFF_L_VAL] = 0x04,
@@ -2114,6 +2123,15 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma
21142123
{
21152124
u32 lval = config->l;
21162125

2126+
/*
2127+
* If the bootloader left the PLL enabled it's likely that there are
2128+
* RCGs that will lock up if we disable the PLL below.
2129+
*/
2130+
if (trion_pll_is_enabled(pll, regmap)) {
2131+
pr_debug("Lucid Evo PLL is already enabled, skipping configuration\n");
2132+
return;
2133+
}
2134+
21172135
lval |= TRION_PLL_CAL_VAL << LUCID_EVO_PLL_CAL_L_VAL_SHIFT;
21182136
clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), lval);
21192137
clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
@@ -2490,6 +2508,8 @@ static int clk_alpha_pll_stromer_set_rate(struct clk_hw *hw, unsigned long rate,
24902508
rate = alpha_pll_round_rate(rate, prate, &l, &a, ALPHA_REG_BITWIDTH);
24912509

24922510
regmap_write(pll->clkr.regmap, PLL_L_VAL(pll), l);
2511+
2512+
a <<= ALPHA_REG_BITWIDTH - ALPHA_BITWIDTH;
24932513
regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL(pll), a);
24942514
regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL_U(pll),
24952515
a >> ALPHA_BITWIDTH);

drivers/clk/qcom/clk-alpha-pll.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
enum {
1616
CLK_ALPHA_PLL_TYPE_DEFAULT,
1717
CLK_ALPHA_PLL_TYPE_HUAYRA,
18+
CLK_ALPHA_PLL_TYPE_HUAYRA_APSS,
1819
CLK_ALPHA_PLL_TYPE_BRAMMO,
1920
CLK_ALPHA_PLL_TYPE_FABIA,
2021
CLK_ALPHA_PLL_TYPE_TRION,
@@ -73,8 +74,10 @@ struct pll_vco {
7374
/**
7475
* struct clk_alpha_pll - phase locked loop (PLL)
7576
* @offset: base address of registers
76-
* @vco_table: array of VCO settings
7777
* @regs: alpha pll register map (see @clk_alpha_pll_regs)
78+
* @vco_table: array of VCO settings
79+
* @num_vco: number of VCO settings in @vco_table
80+
* @flags: bitmask to indicate features supported by the hardware
7881
* @clkr: regmap clock handle
7982
*/
8083
struct clk_alpha_pll {

drivers/clk/qcom/clk-cbf-8996.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@ enum {
4141

4242
#define CBF_PLL_OFFSET 0xf000
4343

44-
static const u8 cbf_pll_regs[PLL_OFF_MAX_REGS] = {
45-
[PLL_OFF_L_VAL] = 0x08,
46-
[PLL_OFF_ALPHA_VAL] = 0x10,
47-
[PLL_OFF_USER_CTL] = 0x18,
48-
[PLL_OFF_CONFIG_CTL] = 0x20,
49-
[PLL_OFF_CONFIG_CTL_U] = 0x24,
50-
[PLL_OFF_TEST_CTL] = 0x30,
51-
[PLL_OFF_TEST_CTL_U] = 0x34,
52-
[PLL_OFF_STATUS] = 0x28,
53-
};
54-
5544
static struct alpha_pll_config cbfpll_config = {
5645
.l = 72,
5746
.config_ctl_val = 0x200d4828,
@@ -67,7 +56,7 @@ static struct alpha_pll_config cbfpll_config = {
6756

6857
static struct clk_alpha_pll cbf_pll = {
6958
.offset = CBF_PLL_OFFSET,
70-
.regs = cbf_pll_regs,
59+
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_HUAYRA_APSS],
7160
.flags = SUPPORTS_DYNAMIC_UPDATE | SUPPORTS_FSM_MODE,
7261
.clkr.hw.init = &(struct clk_init_data){
7362
.name = "cbf_pll",

0 commit comments

Comments
 (0)