Skip to content

Commit 8c88e56

Browse files
committed
Merge branches 'clk-tegra', 'clk-imx', 'clk-zynq', 'clk-socfpga', 'clk-at91' and 'clk-ti' into clk-next
- Support custom flags in Xilinx zynq firmware - Various small fixes to the Xilinx clk driver - Support for Intel Agilex clks * clk-tegra: clk: tegra: Add Tegra210 CSI TPG clock gate clk: tegra30: Use custom CCLK implementation clk: tegra20: Use custom CCLK implementation clk: tegra: cclk: Add helpers for handling PLLX rate changes clk: tegra: pll: Add pre/post rate-change hooks clk: tegra: Add custom CCLK implementation clk: tegra: Remove the old emc_mux clock for Tegra210 clk: tegra: Implement Tegra210 EMC clock clk: tegra: Export functions for EMC clock scaling clk: tegra: Add PLLP_UD and PLLMB_UD for Tegra210 clk: tegra: Rename Tegra124 EMC clock source file dt-bindings: clock: tegra: Add clock ID for CSI TPG clock * clk-imx: clk: imx: use imx8m_clk_hw_composite_bus for i.MX8M bus clk slice clk: imx: add imx8m_clk_hw_composite_bus clk: imx: add mux ops for i.MX8M composite clk clk: imx8m: migrate A53 clk root to use composite core clk: imx8mp: use imx8m_clk_hw_composite_core to simplify code clk: imx8mp: Define gates for pll1/2 fixed dividers clk: imx: imx8mp: fix pll mux bit clk: imx8m: drop clk_hw_set_parent for A53 dt-bindings: clocks: imx8mp: Add ids for audiomix clocks clk: imx: Add helpers for passing the device as argument clk: imx: pll14xx: Add the device as argument when registering clk: imx: gate2: Allow single bit gating clock clk: imx: clk-pllv3: Use readl_relaxed_poll_timeout() for PLL lock wait clk: imx: clk-sscg-pll: Remove unnecessary blank lines clk: imx: drop the dependency on ARM64 for i.MX8M clk: imx7ulp: make it easy to change ARM core clk clk: imx: imx6ul: change flexcan clock to support CiA bitrates * clk-zynq: clk: zynqmp: Make zynqmp_clk_get_max_divisor static clk: zynqmp: Update fraction clock check from custom type flags clk: zynqmp: Add support for custom type flags clk: zynqmp: fix memory leak in zynqmp_register_clocks clk: zynqmp: Fix invalid clock name queries clk: zynqmp: Fix divider2 calculation clk: zynqmp: Limit bestdiv with maxdiv * clk-socfpga: clk: socfpga: agilex: add clock driver for the Agilex platform dt-bindings: documentation: add clock bindings information for Agilex clk: socfpga: add const to _ops data structures clk: socfpga: remove clk_ops enable/disable methods clk: socfpga: stratix10: use new parent data scheme * clk-at91: clk: at91: allow setting all PMC clock parents via DT clk: at91: allow setting PCKx parent via DT clk: at91: optimize pmc data allocation clk: at91: pmc: decrement node's refcount clk: at91: pmc: do not continue if compatible not located clk: at91: Add peripheral clock for PTC * clk-ti: clk: ti: dra7: remove two unused symbols clk: ti: dra7xx: fix RNG clock parent clk: ti: dra7xx: mark MCAN clock as DRA76x only clk: ti: dra7xx: fix gpu clkctrl parent clk: ti: omap5: Add proper parent clocks for l4-secure clocks clk: ti: omap4: Add proper parent clocks for l4-secure clocks clk: ti: composite: fix memory leak
7 parents 3a57530 + c60037f + 5484bb8 + 9d66e85 + 80c6b7a + 03a1ee1 + c5bd76d commit 8c88e56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2048
-351
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/intel,agilex.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Intel SoCFPGA Agilex platform clock controller binding
8+
9+
maintainers:
10+
- Dinh Nguyen <[email protected]>
11+
12+
description:
13+
The Intel Agilex Clock controller is an integrated clock controller, which
14+
generates and supplies to all modules.
15+
16+
properties:
17+
compatible:
18+
const: intel,agilex-clkmgr
19+
20+
'#clock-cells':
21+
const: 1
22+
23+
reg:
24+
maxItems: 1
25+
26+
clocks:
27+
maxItems: 1
28+
29+
required:
30+
- compatible
31+
- reg
32+
- clocks
33+
- '#clock-cells'
34+
35+
additionalProperties: false
36+
37+
examples:
38+
# Clock controller node:
39+
- |
40+
clkmgr: clock-controller@ffd10000 {
41+
compatible = "intel,agilex-clkmgr";
42+
reg = <0xffd10000 0x1000>;
43+
clocks = <&osc1>;
44+
#clock-cells = <1>;
45+
};
46+
...

drivers/clk/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/
104104
obj-$(CONFIG_CLK_SIFIVE) += sifive/
105105
obj-$(CONFIG_ARCH_SIRF) += sirf/
106106
obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/
107+
obj-$(CONFIG_ARCH_AGILEX) += socfpga/
108+
obj-$(CONFIG_ARCH_STRATIX10) += socfpga/
107109
obj-$(CONFIG_PLAT_SPEAR) += spear/
108110
obj-$(CONFIG_ARCH_SPRD) += sprd/
109111
obj-$(CONFIG_ARCH_STI) += st/
110-
obj-$(CONFIG_ARCH_STRATIX10) += socfpga/
111112
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
112113
obj-$(CONFIG_SUNXI_CCU) += sunxi-ng/
113114
obj-$(CONFIG_ARCH_TEGRA) += tegra/

drivers/clk/at91/at91rm9200.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
9898
if (IS_ERR(regmap))
9999
return;
100100

101-
at91rm9200_pmc = pmc_data_allocate(PMC_MAIN + 1,
101+
at91rm9200_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
102102
nck(at91rm9200_systemck),
103-
nck(at91rm9200_periphck), 0);
103+
nck(at91rm9200_periphck), 0, 4);
104104
if (!at91rm9200_pmc)
105105
return;
106106

@@ -123,12 +123,16 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
123123
if (IS_ERR(hw))
124124
goto err_free;
125125

126+
at91rm9200_pmc->chws[PMC_PLLACK] = hw;
127+
126128
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
127129
&at91rm9200_pll_layout,
128130
&rm9200_pll_characteristics);
129131
if (IS_ERR(hw))
130132
goto err_free;
131133

134+
at91rm9200_pmc->chws[PMC_PLLBCK] = hw;
135+
132136
parent_names[0] = slowxtal_name;
133137
parent_names[1] = "mainck";
134138
parent_names[2] = "pllack";
@@ -159,6 +163,8 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
159163
&at91rm9200_programmable_layout);
160164
if (IS_ERR(hw))
161165
goto err_free;
166+
167+
at91rm9200_pmc->pchws[i] = hw;
162168
}
163169

164170
for (i = 0; i < ARRAY_SIZE(at91rm9200_systemck); i++) {
@@ -187,7 +193,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
187193
return;
188194

189195
err_free:
190-
pmc_data_free(at91rm9200_pmc);
196+
kfree(at91rm9200_pmc);
191197
}
192198
/*
193199
* While the TCB can be used as the clocksource, the system timer is most likely

drivers/clk/at91/at91sam9260.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,10 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
352352
if (IS_ERR(regmap))
353353
return;
354354

355-
at91sam9260_pmc = pmc_data_allocate(PMC_MAIN + 1,
355+
at91sam9260_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
356356
ndck(data->sck, data->num_sck),
357-
ndck(data->pck, data->num_pck), 0);
357+
ndck(data->pck, data->num_pck),
358+
0, data->num_progck);
358359
if (!at91sam9260_pmc)
359360
return;
360361

@@ -398,12 +399,16 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
398399
if (IS_ERR(hw))
399400
goto err_free;
400401

402+
at91sam9260_pmc->chws[PMC_PLLACK] = hw;
403+
401404
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
402405
data->pllb_layout,
403406
data->pllb_characteristics);
404407
if (IS_ERR(hw))
405408
goto err_free;
406409

410+
at91sam9260_pmc->chws[PMC_PLLBCK] = hw;
411+
407412
parent_names[0] = slck_name;
408413
parent_names[1] = "mainck";
409414
parent_names[2] = "pllack";
@@ -434,6 +439,8 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
434439
&at91rm9200_programmable_layout);
435440
if (IS_ERR(hw))
436441
goto err_free;
442+
443+
at91sam9260_pmc->pchws[i] = hw;
437444
}
438445

439446
for (i = 0; i < data->num_sck; i++) {
@@ -462,7 +469,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
462469
return;
463470

464471
err_free:
465-
pmc_data_free(at91sam9260_pmc);
472+
kfree(at91sam9260_pmc);
466473
}
467474

468475
static void __init at91sam9260_pmc_setup(struct device_node *np)

drivers/clk/at91/at91sam9g45.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
115115
if (IS_ERR(regmap))
116116
return;
117117

118-
at91sam9g45_pmc = pmc_data_allocate(PMC_MAIN + 1,
118+
at91sam9g45_pmc = pmc_data_allocate(PMC_PLLACK + 1,
119119
nck(at91sam9g45_systemck),
120-
nck(at91sam9g45_periphck), 0);
120+
nck(at91sam9g45_periphck), 0, 2);
121121
if (!at91sam9g45_pmc)
122122
return;
123123

@@ -143,6 +143,8 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
143143
if (IS_ERR(hw))
144144
goto err_free;
145145

146+
at91sam9g45_pmc->chws[PMC_PLLACK] = hw;
147+
146148
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
147149
if (IS_ERR(hw))
148150
goto err_free;
@@ -182,6 +184,8 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
182184
&at91sam9g45_programmable_layout);
183185
if (IS_ERR(hw))
184186
goto err_free;
187+
188+
at91sam9g45_pmc->pchws[i] = hw;
185189
}
186190

187191
for (i = 0; i < ARRAY_SIZE(at91sam9g45_systemck); i++) {
@@ -210,7 +214,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
210214
return;
211215

212216
err_free:
213-
pmc_data_free(at91sam9g45_pmc);
217+
kfree(at91sam9g45_pmc);
214218
}
215219
/*
216220
* The TCB is used as the clocksource so its clock is needed early. This means

drivers/clk/at91/at91sam9n12.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
128128
if (IS_ERR(regmap))
129129
return;
130130

131-
at91sam9n12_pmc = pmc_data_allocate(PMC_MAIN + 1,
132-
nck(at91sam9n12_systemck), 31, 0);
131+
at91sam9n12_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
132+
nck(at91sam9n12_systemck), 31, 0, 2);
133133
if (!at91sam9n12_pmc)
134134
return;
135135

@@ -162,11 +162,15 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
162162
if (IS_ERR(hw))
163163
goto err_free;
164164

165+
at91sam9n12_pmc->chws[PMC_PLLACK] = hw;
166+
165167
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
166168
&at91rm9200_pll_layout, &pllb_characteristics);
167169
if (IS_ERR(hw))
168170
goto err_free;
169171

172+
at91sam9n12_pmc->chws[PMC_PLLBCK] = hw;
173+
170174
parent_names[0] = slck_name;
171175
parent_names[1] = "mainck";
172176
parent_names[2] = "plladivck";
@@ -198,6 +202,8 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
198202
&at91sam9x5_programmable_layout);
199203
if (IS_ERR(hw))
200204
goto err_free;
205+
206+
at91sam9n12_pmc->pchws[i] = hw;
201207
}
202208

203209
for (i = 0; i < ARRAY_SIZE(at91sam9n12_systemck); i++) {
@@ -228,7 +234,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
228234
return;
229235

230236
err_free:
231-
pmc_data_free(at91sam9n12_pmc);
237+
kfree(at91sam9n12_pmc);
232238
}
233239
/*
234240
* The TCB is used as the clocksource so its clock is needed early. This means

drivers/clk/at91/at91sam9rl.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
8787
if (IS_ERR(regmap))
8888
return;
8989

90-
at91sam9rl_pmc = pmc_data_allocate(PMC_MAIN + 1,
90+
at91sam9rl_pmc = pmc_data_allocate(PMC_PLLACK + 1,
9191
nck(at91sam9rl_systemck),
92-
nck(at91sam9rl_periphck), 0);
92+
nck(at91sam9rl_periphck), 0, 2);
9393
if (!at91sam9rl_pmc)
9494
return;
9595

@@ -105,6 +105,8 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
105105
if (IS_ERR(hw))
106106
goto err_free;
107107

108+
at91sam9rl_pmc->chws[PMC_PLLACK] = hw;
109+
108110
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
109111
if (IS_ERR(hw))
110112
goto err_free;
@@ -138,6 +140,8 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
138140
&at91rm9200_programmable_layout);
139141
if (IS_ERR(hw))
140142
goto err_free;
143+
144+
at91sam9rl_pmc->pchws[i] = hw;
141145
}
142146

143147
for (i = 0; i < ARRAY_SIZE(at91sam9rl_systemck); i++) {
@@ -166,6 +170,6 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
166170
return;
167171

168172
err_free:
169-
pmc_data_free(at91sam9rl_pmc);
173+
kfree(at91sam9rl_pmc);
170174
}
171175
CLK_OF_DECLARE_DRIVER(at91sam9rl_pmc, "atmel,at91sam9rl-pmc", at91sam9rl_pmc_setup);

drivers/clk/at91/at91sam9x5.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
150150
if (IS_ERR(regmap))
151151
return;
152152

153-
at91sam9x5_pmc = pmc_data_allocate(PMC_MAIN + 1,
154-
nck(at91sam9x5_systemck), 31, 0);
153+
at91sam9x5_pmc = pmc_data_allocate(PMC_PLLACK + 1,
154+
nck(at91sam9x5_systemck), 31, 0, 2);
155155
if (!at91sam9x5_pmc)
156156
return;
157157

@@ -184,6 +184,8 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
184184
if (IS_ERR(hw))
185185
goto err_free;
186186

187+
at91sam9x5_pmc->chws[PMC_PLLACK] = hw;
188+
187189
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
188190
if (IS_ERR(hw))
189191
goto err_free;
@@ -227,6 +229,8 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
227229
&at91sam9x5_programmable_layout);
228230
if (IS_ERR(hw))
229231
goto err_free;
232+
233+
at91sam9x5_pmc->pchws[i] = hw;
230234
}
231235

232236
for (i = 0; i < ARRAY_SIZE(at91sam9x5_systemck); i++) {
@@ -278,7 +282,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
278282
return;
279283

280284
err_free:
281-
pmc_data_free(at91sam9x5_pmc);
285+
kfree(at91sam9x5_pmc);
282286
}
283287

284288
static void __init at91sam9g15_pmc_setup(struct device_node *np)

drivers/clk/at91/pmc.c

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ struct clk_hw *of_clk_hw_pmc_get(struct of_phandle_args *clkspec, void *data)
6767
if (idx < pmc_data->ngck)
6868
return pmc_data->ghws[idx];
6969
break;
70+
case PMC_TYPE_PROGRAMMABLE:
71+
if (idx < pmc_data->npck)
72+
return pmc_data->pchws[idx];
73+
break;
7074
default:
7175
break;
7276
}
@@ -76,48 +80,34 @@ struct clk_hw *of_clk_hw_pmc_get(struct of_phandle_args *clkspec, void *data)
7680
return ERR_PTR(-EINVAL);
7781
}
7882

79-
void pmc_data_free(struct pmc_data *pmc_data)
80-
{
81-
kfree(pmc_data->chws);
82-
kfree(pmc_data->shws);
83-
kfree(pmc_data->phws);
84-
kfree(pmc_data->ghws);
85-
}
86-
8783
struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem,
88-
unsigned int nperiph, unsigned int ngck)
84+
unsigned int nperiph, unsigned int ngck,
85+
unsigned int npck)
8986
{
90-
struct pmc_data *pmc_data = kzalloc(sizeof(*pmc_data), GFP_KERNEL);
87+
unsigned int num_clks = ncore + nsystem + nperiph + ngck + npck;
88+
struct pmc_data *pmc_data;
9189

90+
pmc_data = kzalloc(struct_size(pmc_data, hwtable, num_clks),
91+
GFP_KERNEL);
9292
if (!pmc_data)
9393
return NULL;
9494

9595
pmc_data->ncore = ncore;
96-
pmc_data->chws = kcalloc(ncore, sizeof(struct clk_hw *), GFP_KERNEL);
97-
if (!pmc_data->chws)
98-
goto err;
96+
pmc_data->chws = pmc_data->hwtable;
9997

10098
pmc_data->nsystem = nsystem;
101-
pmc_data->shws = kcalloc(nsystem, sizeof(struct clk_hw *), GFP_KERNEL);
102-
if (!pmc_data->shws)
103-
goto err;
99+
pmc_data->shws = pmc_data->chws + ncore;
104100

105101
pmc_data->nperiph = nperiph;
106-
pmc_data->phws = kcalloc(nperiph, sizeof(struct clk_hw *), GFP_KERNEL);
107-
if (!pmc_data->phws)
108-
goto err;
102+
pmc_data->phws = pmc_data->shws + nsystem;
109103

110104
pmc_data->ngck = ngck;
111-
pmc_data->ghws = kcalloc(ngck, sizeof(struct clk_hw *), GFP_KERNEL);
112-
if (!pmc_data->ghws)
113-
goto err;
105+
pmc_data->ghws = pmc_data->phws + nperiph;
114106

115-
return pmc_data;
116-
117-
err:
118-
pmc_data_free(pmc_data);
107+
pmc_data->npck = npck;
108+
pmc_data->pchws = pmc_data->ghws + ngck;
119109

120-
return NULL;
110+
return pmc_data;
121111
}
122112

123113
#ifdef CONFIG_PM
@@ -274,8 +264,11 @@ static int __init pmc_register_ops(void)
274264
struct device_node *np;
275265

276266
np = of_find_matching_node(NULL, sama5d2_pmc_dt_ids);
267+
if (!np)
268+
return -ENODEV;
277269

278270
pmcreg = device_node_to_regmap(np);
271+
of_node_put(np);
279272
if (IS_ERR(pmcreg))
280273
return PTR_ERR(pmcreg);
281274

0 commit comments

Comments
 (0)