From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Hector Yuan <hector.yuan@mediatek.com>
Cc: kernel@collabora.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org,
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Subject: [PATCH 2/5] dt-bindings: cpufreq: mediatek-hw: add mt8196 cpufreq binding
Date: Fri, 11 Jul 2025 16:57:34 +0200 [thread overview]
Message-ID: <20250711-mt8196-cpufreq-v1-2-e1b0a3b4ac61@collabora.com> (raw)
In-Reply-To: <20250711-mt8196-cpufreq-v1-0-e1b0a3b4ac61@collabora.com>
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@collabora.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@c2c0f20 {
+ 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
next prev parent reply other threads:[~2025-07-11 16:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 14:57 [PATCH 0/5] MT8196 CPUFreq Support Nicolas Frattaroli
2025-07-11 14:57 ` [PATCH 1/5] dt-bindings: mfd: syscon: Add mt8196 fdvfs syscons Nicolas Frattaroli
2025-07-14 8:47 ` AngeloGioacchino Del Regno
2025-07-14 11:58 ` Nicolas Frattaroli
2025-07-14 12:33 ` AngeloGioacchino Del Regno
2025-07-11 14:57 ` Nicolas Frattaroli [this message]
2025-07-11 14:57 ` [PATCH 3/5] cpufreq: mediatek-hw: Refactor match data into struct Nicolas Frattaroli
2025-07-11 14:57 ` [PATCH 4/5] cpufreq: mediatek-hw: Separate per-domain and per-instance data Nicolas Frattaroli
2025-07-11 14:57 ` [PATCH 5/5] cpufreq: mediatek-hw: Add support for MT8196 Nicolas Frattaroli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250711-mt8196-cpufreq-v1-2-e1b0a3b4ac61@collabora.com \
--to=nicolas.frattaroli@collabora.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hector.yuan@mediatek.com \
--cc=kernel@collabora.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox