Skip to content

Commit 522ba45

Browse files
committed
Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk updates from Stephen Boyd: "There's a bunch of patches here across drivers/clk/ to migrate drivers to use struct clk_ops::determine_rate() instead of the round_rate() one so that we can remove the round_rate clk_op entirely. Brian has taken up that task which nobody else has wanted to do for close to a decade. Thanks Brian! This is all prerequisite work to get to the real task of improving the clk rate setting process. Once we have determine_rate() used everywhere, we'll be able to do things like chain the rate request structs in linked lists to order the rate setting operations or add more parameters without having to change every clk driver in existence. It's also nice to not have multiple ways to do something which just causes confusion for clk driver authors. Overall I'm glad this is getting done. Beyond this change we also have a tweak to the clk_lookup() function in the core framework to use hashing on the clk name instead of a clk tree walk with string comparisons. We _still_ rely on the clk name to be unique, because historically we've used globally unique strings to describe the clk tree topology. This tree walk becomes increasingly slow as more clks are added to the system. Searching from the roots for a duplicate is simple but pretty dumb and it wastes boot time so we're using a hash table as an improvement. Ideally we wouldn't rely on the strings to be unique at all, relegating them to simply debug information, but that is future work that will likely require some sort of Kconfig knob indicating strings aren't used for topology description. Outside of the core framework changes we have the usual new SoC support and fixes to clk drivers for things that were discovered once the clks were used by consumer drivers. Nothing in particular is jumping out at me in the "misc" pile, except maybe the Amlogic driver that has gone through a refactoring. That series got a fix from testing in -next though so it seems likely that things have been getting good test coverage for a couple weeks already" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (299 commits) clk: microchip: core: remove duplicate roclk_determine_rate() reset: aspeed: register AST2700 reset auxiliary bus device dt-bindings: clock: ast2700: modify soc0/1 clock define clk: tegra: do not overallocate memory for bpmp clocks clk: ep93xx: Use int type to store negative error codes clk: nxp: Fix pll0 rate check condition in LPC18xx CGU driver clk: loongson2: Add clock definitions for Loongson-2K0300 SoC clk: loongson2: Avoid hardcoding firmware name of the reference clock clk: loongson2: Allow zero divisors for dividers clk: loongson2: Support scale clocks with an alternative mode clk: loongson2: Allow specifying clock flags for gate clock dt-bindings: clock: loongson2: Add Loongson-2K0300 compatible clk: clocking-wizard: Fix output clock register offset for Versal platforms clk: xilinx: Optimize divisor search in clk_wzrd_get_divisors_ver() clk: mmp: pxa1908: Instantiate power driver through auxiliary bus clk: s2mps11: add support for S2MPG10 PMIC clock dt-bindings: clock: samsung,s2mps11: add s2mpg10 dt-bindings: stm32: cosmetic fixes for STM32MP25 clock and reset bindings clk: stm32: introduce clocks for STM32MP21 platform dt-bindings: stm32: add STM32MP21 clocks and reset bindings ...
2 parents 971199a + 112104e commit 522ba45

324 files changed

Lines changed: 33110 additions & 8543 deletions

File tree

Some content is hidden

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

Documentation/devicetree/bindings/clock/adi,axi-clkgen.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ properties:
4242
- const: clkin2
4343
- const: s_axi_aclk
4444

45+
clock-output-names:
46+
maxItems: 1
47+
4548
'#clock-cells':
4649
const: 0
4750

@@ -65,4 +68,5 @@ examples:
6568
reg = <0xff000000 0x1000>;
6669
clocks = <&osc 1>, <&clkc 15>;
6770
clock-names = "clkin1", "s_axi_aclk";
71+
clock-output-names = "spi_sclk";
6872
};

Documentation/devicetree/bindings/clock/fujitsu,mb86s70-crg11.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

Documentation/devicetree/bindings/clock/loongson,ls2k-clk.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description: |
1616
properties:
1717
compatible:
1818
enum:
19+
- loongson,ls2k0300-clk
1920
- loongson,ls2k0500-clk
2021
- loongson,ls2k-clk # This is for Loongson-2K1000
2122
- loongson,ls2k2000-clk
@@ -24,8 +25,7 @@ properties:
2425
maxItems: 1
2526

2627
clocks:
27-
items:
28-
- description: 100m ref
28+
maxItems: 1
2929

3030
clock-names:
3131
items:
@@ -38,11 +38,23 @@ properties:
3838
ID in its "clocks" phandle cell. See include/dt-bindings/clock/loongson,ls2k-clk.h
3939
for the full list of Loongson-2 SoC clock IDs.
4040

41+
allOf:
42+
- if:
43+
properties:
44+
compatible:
45+
contains:
46+
const: loongson,ls2k0300-clk
47+
then:
48+
properties:
49+
clock-names: false
50+
else:
51+
required:
52+
- clock-names
53+
4154
required:
4255
- compatible
4356
- reg
4457
- clocks
45-
- clock-names
4658
- '#clock-cells'
4759

4860
additionalProperties: false
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/mediatek,mt8196-clock.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek Functional Clock Controller for MT8196
8+
9+
maintainers:
10+
- Guangjie Song <guangjie.song@mediatek.com>
11+
- Laura Nao <laura.nao@collabora.com>
12+
13+
description: |
14+
The clock architecture in MediaTek SoCs is structured like below:
15+
PLLs -->
16+
dividers -->
17+
muxes
18+
-->
19+
clock gate
20+
21+
The device nodes provide clock gate control in different IP blocks.
22+
23+
properties:
24+
compatible:
25+
items:
26+
- enum:
27+
- mediatek,mt8196-imp-iic-wrap-c
28+
- mediatek,mt8196-imp-iic-wrap-e
29+
- mediatek,mt8196-imp-iic-wrap-n
30+
- mediatek,mt8196-imp-iic-wrap-w
31+
- mediatek,mt8196-mdpsys0
32+
- mediatek,mt8196-mdpsys1
33+
- mediatek,mt8196-pericfg-ao
34+
- mediatek,mt8196-pextp0cfg-ao
35+
- mediatek,mt8196-pextp1cfg-ao
36+
- mediatek,mt8196-ufscfg-ao
37+
- mediatek,mt8196-vencsys
38+
- mediatek,mt8196-vencsys-c1
39+
- mediatek,mt8196-vencsys-c2
40+
- mediatek,mt8196-vdecsys
41+
- mediatek,mt8196-vdecsys-soc
42+
- mediatek,mt8196-vdisp-ao
43+
- const: syscon
44+
45+
reg:
46+
maxItems: 1
47+
48+
'#clock-cells':
49+
const: 1
50+
51+
'#reset-cells':
52+
const: 1
53+
description:
54+
Reset lines for PEXTP0/1 and UFS blocks.
55+
56+
mediatek,hardware-voter:
57+
$ref: /schemas/types.yaml#/definitions/phandle
58+
description: |
59+
Phandle to the "Hardware Voter" (HWV), as named in the vendor
60+
documentation for MT8196/MT6991.
61+
62+
The HWV is a SoC-internal fixed-function MCU used to collect votes from
63+
both the Application Processor and other remote processors within the SoC.
64+
It is intended to transparently enable or disable hardware resources (such
65+
as power domains or clocks) based on internal vote aggregation handled by
66+
the MCU's internal state machine.
67+
68+
However, in practice, this design is incomplete. While the HWV performs
69+
some internal vote aggregation,software is still required to
70+
- Manually enable power supplies externally, if present and if required
71+
- Manually enable parent clocks via direct MMIO writes to clock controllers
72+
- Enable the FENC after the clock has been ungated via direct MMIO
73+
writes to clock controllers
74+
75+
As such, the HWV behaves more like a hardware-managed clock reference
76+
counter than a true voter. Furthermore, it is not a separate
77+
controller. It merely serves as an alternative interface to the same
78+
underlying clock or power controller. Actual control still requires
79+
direct access to the controller's own MMIO register space, in
80+
addition to writing to the HWV's MMIO region.
81+
82+
For this reason, a custom phandle is used here - drivers need to directly
83+
access the HWV MMIO region in a syscon-like fashion, due to how the
84+
hardware is wired. This differs from true hardware voting systems, which
85+
typically do not require custom phandles and rely instead on generic APIs
86+
(clocks, power domains, interconnects).
87+
88+
The name "hardware-voter" is retained to match vendor documentation, but
89+
this should not be reused or misunderstood as a proper voting mechanism.
90+
91+
required:
92+
- compatible
93+
- reg
94+
- '#clock-cells'
95+
96+
additionalProperties: false
97+
98+
examples:
99+
- |
100+
pericfg_ao: clock-controller@16640000 {
101+
compatible = "mediatek,mt8196-pericfg-ao", "syscon";
102+
reg = <0x16640000 0x1000>;
103+
mediatek,hardware-voter = <&scp_hwv>;
104+
#clock-cells = <1>;
105+
};
106+
- |
107+
pextp0cfg_ao: clock-controller@169b0000 {
108+
compatible = "mediatek,mt8196-pextp0cfg-ao", "syscon";
109+
reg = <0x169b0000 0x1000>;
110+
#clock-cells = <1>;
111+
#reset-cells = <1>;
112+
};
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/mediatek,mt8196-sys-clock.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek System Clock Controller for MT8196
8+
9+
maintainers:
10+
- Guangjie Song <guangjie.song@mediatek.com>
11+
- Laura Nao <laura.nao@collabora.com>
12+
13+
description: |
14+
The clock architecture in MediaTek SoCs is structured like below:
15+
PLLs -->
16+
dividers -->
17+
muxes
18+
-->
19+
clock gate
20+
21+
The apmixedsys, apmixedsys_gp2, vlpckgen, armpll, ccipll, mfgpll and ptppll
22+
provide most of the PLLs which are generated from the SoC's 26MHZ crystal oscillator.
23+
The topckgen, topckgen_gp2 and vlpckgen provide dividers and muxes which
24+
provide the clock source to other IP blocks.
25+
26+
properties:
27+
compatible:
28+
items:
29+
- enum:
30+
- mediatek,mt8196-apmixedsys
31+
- mediatek,mt8196-armpll-b-pll-ctrl
32+
- mediatek,mt8196-armpll-bl-pll-ctrl
33+
- mediatek,mt8196-armpll-ll-pll-ctrl
34+
- mediatek,mt8196-apmixedsys-gp2
35+
- mediatek,mt8196-ccipll-pll-ctrl
36+
- mediatek,mt8196-mfgpll-pll-ctrl
37+
- mediatek,mt8196-mfgpll-sc0-pll-ctrl
38+
- mediatek,mt8196-mfgpll-sc1-pll-ctrl
39+
- mediatek,mt8196-ptppll-pll-ctrl
40+
- mediatek,mt8196-topckgen
41+
- mediatek,mt8196-topckgen-gp2
42+
- mediatek,mt8196-vlpckgen
43+
- const: syscon
44+
45+
reg:
46+
maxItems: 1
47+
48+
'#clock-cells':
49+
const: 1
50+
51+
mediatek,hardware-voter:
52+
$ref: /schemas/types.yaml#/definitions/phandle
53+
description: |
54+
Phandle to the "Hardware Voter" (HWV), as named in the vendor
55+
documentation for MT8196/MT6991.
56+
57+
The HWV is a SoC-internal fixed-function MCU used to collect votes from
58+
both the Application Processor and other remote processors within the SoC.
59+
It is intended to transparently enable or disable hardware resources (such
60+
as power domains or clocks) based on internal vote aggregation handled by
61+
the MCU's internal state machine.
62+
63+
However, in practice, this design is incomplete. While the HWV performs
64+
some internal vote aggregation,software is still required to
65+
- Manually enable power supplies externally, if present and if required
66+
- Manually enable parent clocks via direct MMIO writes to clock controllers
67+
- Enable the FENC after the clock has been ungated via direct MMIO
68+
writes to clock controllers
69+
70+
As such, the HWV behaves more like a hardware-managed clock reference
71+
counter than a true voter. Furthermore, it is not a separate
72+
controller. It merely serves as an alternative interface to the same
73+
underlying clock or power controller. Actual control still requires
74+
direct access to the controller's own MMIO register space, in
75+
addition to writing to the HWV's MMIO region.
76+
77+
For this reason, a custom phandle is used here - drivers need to directly
78+
access the HWV MMIO region in a syscon-like fashion, due to how the
79+
hardware is wired. This differs from true hardware voting systems, which
80+
typically do not require custom phandles and rely instead on generic APIs
81+
(clocks, power domains, interconnects).
82+
83+
The name "hardware-voter" is retained to match vendor documentation, but
84+
this should not be reused or misunderstood as a proper voting mechanism.
85+
86+
required:
87+
- compatible
88+
- reg
89+
- '#clock-cells'
90+
91+
additionalProperties: false
92+
93+
examples:
94+
- |
95+
apmixedsys_clk: syscon@10000800 {
96+
compatible = "mediatek,mt8196-apmixedsys", "syscon";
97+
reg = <0x10000800 0x1000>;
98+
#clock-cells = <1>;
99+
};
100+
- |
101+
topckgen: syscon@10000000 {
102+
compatible = "mediatek,mt8196-topckgen", "syscon";
103+
reg = <0x10000000 0x800>;
104+
mediatek,hardware-voter = <&scp_hwv>;
105+
#clock-cells = <1>;
106+
};
107+

Documentation/devicetree/bindings/clock/mediatek,syscon.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ properties:
7676
- const: mediatek,mt2701-vdecsys
7777
- const: syscon
7878

79+
power-domains:
80+
maxItems: 1
81+
7982
reg:
8083
maxItems: 1
8184

@@ -86,6 +89,18 @@ required:
8689
- compatible
8790
- '#clock-cells'
8891

92+
if:
93+
properties:
94+
compatible:
95+
contains:
96+
const: mediatek,mt8183-mfgcfg
97+
then:
98+
properties:
99+
power-domains: true
100+
else:
101+
properties:
102+
power-domains: false
103+
89104
additionalProperties: false
90105

91106
examples:

Documentation/devicetree/bindings/clock/qcom,gcc-msm8953.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@ title: Qualcomm Global Clock & Reset Controller on MSM8953
99
maintainers:
1010
- Adam Skladowski <a_skl39@protonmail.com>
1111
- Sireesh Kodali <sireeshkodali@protonmail.com>
12+
- Barnabas Czeman <barnabas.czeman@mainlining.org>
1213

1314
description: |
1415
Qualcomm global clock control module provides the clocks, resets and power
15-
domains on MSM8953.
16+
domains on MSM8937 or MSM8953.
1617
17-
See also: include/dt-bindings/clock/qcom,gcc-msm8953.h
18+
See also::
19+
include/dt-bindings/clock/qcom,gcc-msm8917.h
20+
include/dt-bindings/clock/qcom,gcc-msm8953.h
1821
1922
properties:
2023
compatible:
21-
const: qcom,gcc-msm8953
24+
enum:
25+
- qcom,gcc-msm8937
26+
- qcom,gcc-msm8953
2227

2328
clocks:
2429
items:

0 commit comments

Comments
 (0)