[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250711-mt8196-cpufreq-v1-2-e1b0a3b4ac61@collabora.com>
Date: Fri, 11 Jul 2025 16:57:34 +0200
From: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
To: Lee Jones <lee@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
Hector Yuan <hector.yuan@...iatek.com>
Cc: kernel@...labora.com, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-pm@...r.kernel.org,
Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
Subject: [PATCH 2/5] dt-bindings: cpufreq: mediatek-hw: add mt8196 cpufreq
binding
The MediaTek MT8196 SoC's cpufreq has three performance domains, each
with their own reg item, compared to the existing mediatek,cpufreq-hw
compatible that only uses two.
In addition, the hardware requires special handling by driver
implementations, so the new compatible is needed for more than just the
difference in regs.
Add the mediatek,mt8196-cpufreq-hw compatible, increase the maxItems of
reg, and reduce it back down to 2 for mediatek,cpufreq-hw in an if
condition.
A second example is added to help verify the binding's correctness and
document its use appropriately, though some awkward label names had to
be chosen as dt-extract-example concatenates the entire list of examples
for each binding into a single file, so naming conflicts between them
can occur.
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
---
.../bindings/cpufreq/cpufreq-mediatek-hw.yaml | 64 +++++++++++++++++++++-
1 file changed, 62 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml b/Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml
index d0aecde2b89b1896c01ea8ae24f26032d8075a11..cee2678b926f845ab131cecef403e127a63fabb2 100644
--- a/Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml
+++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml
@@ -16,11 +16,14 @@ description:
properties:
compatible:
- const: mediatek,cpufreq-hw
+ contains:
+ enum:
+ - mediatek,cpufreq-hw
+ - mediatek,mt8196-cpufreq-hw
reg:
minItems: 1
- maxItems: 2
+ maxItems: 3
description:
Addresses and sizes for the memory of the HW bases in
each frequency domain. Each entry corresponds to
@@ -40,6 +43,18 @@ required:
additionalProperties: false
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mediatek,cpufreq-hw
+ then:
+ properties:
+ regs:
+ maxItems: 2
+
examples:
- |
cpus {
@@ -68,3 +83,48 @@ examples:
#performance-domain-cells = <1>;
};
};
+ - |
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ mt8196_cpu0: cpu@0 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a720";
+ enable-method = "psci";
+ performance-domains = <&mt8196_performance 0>;
+ reg = <0x000>;
+ };
+
+ /* ... */
+
+ mt8196_cpu6: cpu@600 {
+ device_type = "cpu";
+ compatible = "arm,cortex-x4";
+ enable-method = "psci";
+ performance-domains = <&mt8196_performance 1>;
+ reg = <0x600>;
+ };
+
+ mt8196_cpu7: cpu@700 {
+ device_type = "cpu";
+ compatible = "arm,cortex-x925";
+ enable-method = "psci";
+ performance-domains = <&mt8196_performance 2>;
+ reg = <0x700>;
+ };
+ };
+
+ /* ... */
+
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ mt8196_performance: performance-controller@...0f20 {
+ compatible = "mediatek,mt8196-cpufreq-hw";
+ reg = <0 0xc2c0f20 0 0x120>, <0 0xc2c1040 0 0x120>,
+ <0 0xc2c1160 0 0x120>;
+ #performance-domain-cells = <1>;
+ };
+ };
--
2.50.0
Powered by blists - more mailing lists