Skip to content

Commit dd240e9

Browse files
laura-naobebarino
authored andcommitted
dt-bindings: clock: mediatek: Describe MT8196 clock controllers
Introduce binding documentation for system clocks, functional clocks, and PEXTP0/1 and UFS reset controllers on MediaTek MT8196. This binding also includes a handle to the hardware voter, a fixed-function MCU designed to aggregate votes from the application processor and other remote processors to manage clocks and power domains. The HWV on MT8196/MT6991 is incomplete and requires software to manually enable power supplies, parent clocks, and FENC, as well as write to both the HWV MMIO and the controller registers. Because of these constraints, the HWV cannot be modeled using generic clock, power domain, or interconnect APIs. Instead, a custom phandle is exceptionally used to provide direct, syscon-like register access to drivers. Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Co-developed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Laura Nao <laura.nao@collabora.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent a94737a commit dd240e9

4 files changed

Lines changed: 1048 additions & 0 deletions

File tree

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+

0 commit comments

Comments
 (0)