* [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency
2025-09-03 19:30 [PATCH v2 0/4] Properly Limit Tegra210 Clock Rates Aaron Kling via B4 Relay
@ 2025-09-03 19:30 ` Aaron Kling via B4 Relay
2025-09-03 20:03 ` Aaron Kling
` (2 more replies)
2025-09-03 19:30 ` [PATCH v2 2/4] soc: tegra: fuse: speedo-tegra210: Update speedo ids Aaron Kling via B4 Relay
` (2 subsequent siblings)
3 siblings, 3 replies; 8+ messages in thread
From: Aaron Kling via B4 Relay @ 2025-09-03 19:30 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Jonathan Hunter, Joseph Lo,
Peter De Schrijver, Prashant Gaikwad
Cc: linux-clk, devicetree, linux-tegra, linux-kernel, Thierry Reding,
Aaron Kling
From: Aaron Kling <webgeek1234@gmail.com>
The dfll driver generates opp tables based on internal CVB tables
instead of using dt opp tables. Some devices such as the Jetson Nano
require limiting the max frequency even further than the corresponding
CVB table allows in order to maintain thermal limits.
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
index f7d347385b5775ddd702ecbb9821acfc9d4b9ff2..8a049b684f962f2b06209a47866711b92c15c085 100644
--- a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
+++ b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
@@ -70,6 +70,9 @@ Required properties for PWM mode:
- dvfs_pwm_enable: I/O pad configuration when PWM control is enabled.
- dvfs_pwm_disable: I/O pad configuration when PWM control is disabled.
+Optional properties for limiting frequency:
+- nvidia,dfll-max-freq: Maximum scaling frequency in hertz.
+
Example for I2C:
clock@70110000 {
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency
2025-09-03 19:30 ` [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency Aaron Kling via B4 Relay
@ 2025-09-03 20:03 ` Aaron Kling
2025-09-04 19:34 ` Rob Herring
2025-09-04 21:49 ` Rob Herring
2 siblings, 0 replies; 8+ messages in thread
From: Aaron Kling @ 2025-09-03 20:03 UTC (permalink / raw)
To: webgeek1234
Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Jonathan Hunter, Joseph Lo,
Peter De Schrijver, Prashant Gaikwad, linux-clk, devicetree,
linux-tegra, linux-kernel, Thierry Reding
On Wed, Sep 3, 2025 at 2:30 PM Aaron Kling via B4 Relay
<devnull+webgeek1234.gmail.com@kernel.org> wrote:
>
> From: Aaron Kling <webgeek1234@gmail.com>
>
> The dfll driver generates opp tables based on internal CVB tables
> instead of using dt opp tables. Some devices such as the Jetson Nano
> require limiting the max frequency even further than the corresponding
> CVB table allows in order to maintain thermal limits.
>
> Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
> ---
> Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> index f7d347385b5775ddd702ecbb9821acfc9d4b9ff2..8a049b684f962f2b06209a47866711b92c15c085 100644
> --- a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> +++ b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> @@ -70,6 +70,9 @@ Required properties for PWM mode:
> - dvfs_pwm_enable: I/O pad configuration when PWM control is enabled.
> - dvfs_pwm_disable: I/O pad configuration when PWM control is disabled.
>
> +Optional properties for limiting frequency:
> +- nvidia,dfll-max-freq: Maximum scaling frequency in hertz.
> +
> Example for I2C:
>
> clock@70110000 {
>
> --
> 2.50.1
>
>
Yes, I know this still needs to be converted to json before it can be
merged, but I wanted to get an updated revision of this and another
series that depends on it out for everything else to be reviewed. I'd
still like to see Thierry's conversion pushed, then I can stack this
on top of that.
Aaron
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency
2025-09-03 19:30 ` [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency Aaron Kling via B4 Relay
2025-09-03 20:03 ` Aaron Kling
@ 2025-09-04 19:34 ` Rob Herring
2025-09-04 21:49 ` Rob Herring
2 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2025-09-04 19:34 UTC (permalink / raw)
To: Aaron Kling
Cc: Michael Turquette, Stephen Boyd, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Jonathan Hunter, Joseph Lo,
Peter De Schrijver, Prashant Gaikwad, linux-clk, devicetree,
linux-tegra, linux-kernel, Thierry Reding
On Wed, Sep 03, 2025 at 02:30:16PM -0500, Aaron Kling wrote:
> The dfll driver generates opp tables based on internal CVB tables
> instead of using dt opp tables. Some devices such as the Jetson Nano
> require limiting the max frequency even further than the corresponding
> CVB table allows in order to maintain thermal limits.
>
> Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
> ---
> Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> index f7d347385b5775ddd702ecbb9821acfc9d4b9ff2..8a049b684f962f2b06209a47866711b92c15c085 100644
> --- a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> +++ b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> @@ -70,6 +70,9 @@ Required properties for PWM mode:
> - dvfs_pwm_enable: I/O pad configuration when PWM control is enabled.
> - dvfs_pwm_disable: I/O pad configuration when PWM control is disabled.
>
> +Optional properties for limiting frequency:
> +- nvidia,dfll-max-freq: Maximum scaling frequency in hertz.
Use standard unit suffix: nvidia,dfll-max-hz
> +
> Example for I2C:
>
> clock@70110000 {
>
> --
> 2.50.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency
2025-09-03 19:30 ` [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency Aaron Kling via B4 Relay
2025-09-03 20:03 ` Aaron Kling
2025-09-04 19:34 ` Rob Herring
@ 2025-09-04 21:49 ` Rob Herring
2 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2025-09-04 21:49 UTC (permalink / raw)
To: Aaron Kling
Cc: Michael Turquette, Stephen Boyd, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Jonathan Hunter, Joseph Lo,
Peter De Schrijver, Prashant Gaikwad, linux-clk, devicetree,
linux-tegra, linux-kernel, Thierry Reding
On Wed, Sep 03, 2025 at 02:30:16PM -0500, Aaron Kling wrote:
> The dfll driver generates opp tables based on internal CVB tables
> instead of using dt opp tables. Some devices such as the Jetson Nano
> require limiting the max frequency even further than the corresponding
> CVB table allows in order to maintain thermal limits.
>
> Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
> ---
> Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> index f7d347385b5775ddd702ecbb9821acfc9d4b9ff2..8a049b684f962f2b06209a47866711b92c15c085 100644
> --- a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> +++ b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
> @@ -70,6 +70,9 @@ Required properties for PWM mode:
> - dvfs_pwm_enable: I/O pad configuration when PWM control is enabled.
> - dvfs_pwm_disable: I/O pad configuration when PWM control is disabled.
>
> +Optional properties for limiting frequency:
> +- nvidia,dfll-max-freq: Maximum scaling frequency in hertz.
Use standard unit suffix: nvidia,dfll-max-hz
> +
> Example for I2C:
>
> clock@70110000 {
>
> --
> 2.50.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] soc: tegra: fuse: speedo-tegra210: Update speedo ids
2025-09-03 19:30 [PATCH v2 0/4] Properly Limit Tegra210 Clock Rates Aaron Kling via B4 Relay
2025-09-03 19:30 ` [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency Aaron Kling via B4 Relay
@ 2025-09-03 19:30 ` Aaron Kling via B4 Relay
2025-09-03 19:30 ` [PATCH v2 3/4] clk: tegra: dfll: Support limiting max clock per device Aaron Kling via B4 Relay
2025-09-03 19:30 ` [PATCH v2 4/4] arm64: tegra: Limit max cpu frequency on P3450 Aaron Kling via B4 Relay
3 siblings, 0 replies; 8+ messages in thread
From: Aaron Kling via B4 Relay @ 2025-09-03 19:30 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Jonathan Hunter, Joseph Lo,
Peter De Schrijver, Prashant Gaikwad
Cc: linux-clk, devicetree, linux-tegra, linux-kernel, Thierry Reding,
Aaron Kling
From: Aaron Kling <webgeek1234@gmail.com>
Existing code only sets cpu and gpu speedo ids 0 and 1. The cpu dvfs
code supports 11 ids and nouveau supports 5. This aligns with what the
downstream vendor kernel supports. Align skus with the downstream list.
The Tegra210 CVB tables were added in the first referenced fixes commit.
Since then, all Tegra210 socs have tried to scale to 1.9 GHz, when the
supported devkits are only supposed to scale to 1.5 or 1.7 GHZ.
Overclocking should not be the default state.
Fixes: 2b2dbc2f94e5 ("clk: tegra: dfll: add CVB tables for Tegra210")
Fixes: 579db6e5d9b8 ("arm64: tegra: Enable DFLL support on Jetson Nano")
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
drivers/soc/tegra/fuse/speedo-tegra210.c | 62 ++++++++++++++++++++++----------
1 file changed, 43 insertions(+), 19 deletions(-)
diff --git a/drivers/soc/tegra/fuse/speedo-tegra210.c b/drivers/soc/tegra/fuse/speedo-tegra210.c
index 695d0b7f9a8abe53c497155603147420cda40b63..60356159e00d2059e55eaacba27b5ca63bf96c90 100644
--- a/drivers/soc/tegra/fuse/speedo-tegra210.c
+++ b/drivers/soc/tegra/fuse/speedo-tegra210.c
@@ -65,27 +65,51 @@ static void __init rev_sku_to_speedo_ids(struct tegra_sku_info *sku_info,
sku_info->gpu_speedo_id = 0;
*threshold = THRESHOLD_INDEX_0;
- switch (sku) {
- case 0x00: /* Engineering SKU */
- case 0x01: /* Engineering SKU */
- case 0x07:
- case 0x17:
- case 0x27:
- if (speedo_rev >= 2)
+ if (speedo_rev >= 2) {
+ switch (sku) {
+ case 0x00: /* Engineering SKU */
+ case 0x01: /* Engineering SKU */
+ case 0x13:
+ sku_info->cpu_speedo_id = 5;
+ sku_info->gpu_speedo_id = 2;
+ break;
+
+ case 0x07:
+ case 0x17:
+ case 0x1F:
+ sku_info->cpu_speedo_id = 7;
+ sku_info->gpu_speedo_id = 2;
+ break;
+
+ case 0x27:
+ sku_info->cpu_speedo_id = 1;
+ sku_info->gpu_speedo_id = 2;
+ break;
+
+ case 0x83:
+ sku_info->cpu_speedo_id = 3;
+ sku_info->gpu_speedo_id = 3;
+ break;
+
+ case 0x87:
+ sku_info->cpu_speedo_id = 2;
sku_info->gpu_speedo_id = 1;
- break;
-
- case 0x13:
- if (speedo_rev >= 2)
- sku_info->gpu_speedo_id = 1;
-
- sku_info->cpu_speedo_id = 1;
- break;
-
- default:
+ break;
+
+ case 0x8F:
+ sku_info->cpu_speedo_id = 9;
+ sku_info->gpu_speedo_id = 2;
+ break;
+
+ default:
+ pr_err("Tegra210: unknown revision 2 or newer SKU %#04x\n", sku);
+ /* Using the default for the error case */
+ break;
+ }
+ } else if (sku == 0x00 || sku == 0x01 || sku == 0x07 || sku == 0x13 || sku == 0x17) {
+ sku_info->gpu_speedo_id = 1;
+ } else {
pr_err("Tegra210: unknown SKU %#04x\n", sku);
- /* Using the default for the error case */
- break;
}
}
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] clk: tegra: dfll: Support limiting max clock per device
2025-09-03 19:30 [PATCH v2 0/4] Properly Limit Tegra210 Clock Rates Aaron Kling via B4 Relay
2025-09-03 19:30 ` [PATCH v2 1/4] dt-bindings: clock: tegra124-dfll: Add property to limit frequency Aaron Kling via B4 Relay
2025-09-03 19:30 ` [PATCH v2 2/4] soc: tegra: fuse: speedo-tegra210: Update speedo ids Aaron Kling via B4 Relay
@ 2025-09-03 19:30 ` Aaron Kling via B4 Relay
2025-09-03 19:30 ` [PATCH v2 4/4] arm64: tegra: Limit max cpu frequency on P3450 Aaron Kling via B4 Relay
3 siblings, 0 replies; 8+ messages in thread
From: Aaron Kling via B4 Relay @ 2025-09-03 19:30 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Jonathan Hunter, Joseph Lo,
Peter De Schrijver, Prashant Gaikwad
Cc: linux-clk, devicetree, linux-tegra, linux-kernel, Thierry Reding,
Aaron Kling
From: Aaron Kling <webgeek1234@gmail.com>
Some devices like the Jetson Nano report a cpu speedo value that scales
past the thermal limits of the device. This allows limiting the maximum
scaling to a lower value within the table.
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
drivers/clk/tegra/clk-tegra124-dfll-fcpu.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
index 0251618b82c8321724ba0aec7a5bd90b2c2ffaf2..0c84f7e85baaa96fee005a1c9a5dd6afbd1875fa 100644
--- a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
+++ b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
@@ -556,6 +556,7 @@ static int tegra124_dfll_fcpu_probe(struct platform_device *pdev)
struct tegra_dfll_soc_data *soc;
const struct dfll_fcpu_data *fcpu_data;
struct rail_alignment align;
+ u32 max_freq;
fcpu_data = of_device_get_match_data(&pdev->dev);
if (!fcpu_data)
@@ -589,7 +590,12 @@ static int tegra124_dfll_fcpu_probe(struct platform_device *pdev)
return err;
}
- soc->max_freq = fcpu_data->cpu_max_freq_table[speedo_id];
+ if (!of_property_read_u32(pdev->dev.of_node,
+ "nvidia,dfll-max-freq",
+ &max_freq))
+ soc->max_freq = max_freq;
+ else
+ soc->max_freq = fcpu_data->cpu_max_freq_table[speedo_id];
soc->cvb = tegra_cvb_add_opp_table(soc->dev, fcpu_data->cpu_cvb_tables,
fcpu_data->cpu_cvb_tables_size,
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] arm64: tegra: Limit max cpu frequency on P3450
2025-09-03 19:30 [PATCH v2 0/4] Properly Limit Tegra210 Clock Rates Aaron Kling via B4 Relay
` (2 preceding siblings ...)
2025-09-03 19:30 ` [PATCH v2 3/4] clk: tegra: dfll: Support limiting max clock per device Aaron Kling via B4 Relay
@ 2025-09-03 19:30 ` Aaron Kling via B4 Relay
3 siblings, 0 replies; 8+ messages in thread
From: Aaron Kling via B4 Relay @ 2025-09-03 19:30 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Jonathan Hunter, Joseph Lo,
Peter De Schrijver, Prashant Gaikwad
Cc: linux-clk, devicetree, linux-tegra, linux-kernel, Thierry Reding,
Aaron Kling
From: Aaron Kling <webgeek1234@gmail.com>
P3450's cpu is rated for 1.5 GHz, but due to the passive cooling on the
devkit, the maximum frequency needs limited to 1.4 GHz to maintain
reasonable thermals. Ideally, the dfll driver would adjust based on
temperature reporting, but in the absence of that, this will have to do.
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
index ec0e84cb83ef9bf8f0e52e2958db33666813917c..10f878d3f50815d1f0297d15669048ab9cad73ee 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
@@ -594,6 +594,7 @@ clock@70110000 {
nvidia,droop-ctrl = <0x00000f00>;
nvidia,force-mode = <1>;
nvidia,sample-rate = <25000>;
+ nvidia,dfll-max-freq = <1479000000>;
nvidia,pwm-min-microvolts = <708000>;
nvidia,pwm-period-nanoseconds = <2500>; /* 2.5us */
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread