Skip to contentSkip to conversation

CPUFREQ OPP's and Tegra30 support by tegra20-cpufreq driver

PATCH Superseded Dmitry Osipenko 4 participants 30 messages Aug 30, 2018 – Oct 17, 2018

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover CPUFREQ OPP's and Tegra30 support by tegra20-cpufreq driver

Hello,

This series adds support for CPU frequency scaling on Tegra30 and device tree support that allows to implement thermal throttling and customize available CPU frequencies per-board. The tegra20-cpufreq driver has been re-worked to support that all.

Note that Tegra30 support not strictly depends on the clock patches that are under review now, CPUFREQ driver will fail to probe until CCLKG clock will get exposed by the clock driver. Hence this series can be applied independently of the clock patches, CPUFREQ will start to work on Tegra30 once both patchsets will be applied.

Dmitry Osipenko (5):
dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30
cpufreq: tegra20: Support OPP, thermal cooling and Tegra30
ARM: tegra: Create tegra20-cpufreq device on Tegra30
ARM: dts: tegra20: Add CPU Operating Performance Points
ARM: dts: tegra30: Add CPU Operating Performance Points

 .../cpufreq/nvidia,tegra20-cpufreq.txt        |  38 ++
 arch/arm/boot/dts/tegra20.dtsi                |  58 +++
 arch/arm/boot/dts/tegra30.dtsi                |  65 ++++
 arch/arm/mach-tegra/tegra.c                   |   4 +
 drivers/cpufreq/Kconfig.arm                   |   2 +
 drivers/cpufreq/cpufreq-dt-platdev.c          |   2 +
 drivers/cpufreq/tegra20-cpufreq.c             | 334 +++++++++++++-----
 7 files changed, 422 insertions(+), 81 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/5 dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +38 -0
new file mode 100644
index 000000000000..2c51f676e958
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock
+- operating-points-v2: See ../bindings/opp/opp.txt for details.
+- #cooling-cells: Should be 2. See ../thermal/thermal.txt for details.
+
+Example:
+	cpu0_opp_table: opp_table0 {
+		compatible = "operating-points-v2";
+
+		opp@216000000 {
+			clock-latency-ns = <300000>;
+			opp-hz = /bits/ 64 <216000000>;
+			opp-microvolt = <7500000>;
+			opp-suspend;
+		};
+
+		...
+	};
+
+	cpus {
+		cpu@0 {
+			compatible = "arm,cortex-a9";
+			clocks = <&tegra_car TEGRA20_CLK_PLL_X>,
+				 <&tegra_car TEGRA20_CLK_PLL_P>,
+				 <&tegra_car TEGRA20_CLK_CCLK>;
+			clock-names = "pll_x", "backup", "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>;
+		};
+	};
Signature · 1 line
2.18.0
#18 lore raw

PATCH 2/5 cpufreq: tegra20: Support OPP, thermal cooling and Tegra30

In reply to Dmitry Osipenko

Add support for thermal throttling and Operating Performance Points. Driver now relies on OPP's supplied via device tree and therefore will work only on devices that use the updated device tree. The generalization of the driver allows to transparently support Tegra30.

---
 drivers/cpufreq/Kconfig.arm          |   2 +
 drivers/cpufreq/cpufreq-dt-platdev.c |   2 +
 drivers/cpufreq/tegra20-cpufreq.c    | 334 ++++++++++++++++++++-------
 3 files changed, 257 insertions(+), 81 deletions(-)
drivers/cpufreq/Kconfig.arm +2 -0
index 0cd8eb76ad59..78795d108f5e 100644
@@ -262,7 +262,9 @@ config ARM_TANGO_CPUFREQ
 
 config ARM_TEGRA20_CPUFREQ
 	tristate "Tegra20 CPUFreq support"
+	depends on !CPU_THERMAL || THERMAL
 	depends on ARCH_TEGRA
+	select PM_OPP
 	default y
 	help
 	  This adds the CPUFreq driver support for Tegra20 SOCs.
drivers/cpufreq/cpufreq-dt-platdev.c +2 -0
index fe14c57de6ca..3c4709159995 100644
@@ -114,6 +114,8 @@ static const struct of_device_id blacklist[] __initconst = {
 	{ .compatible = "mediatek,mt8173", },
 	{ .compatible = "mediatek,mt8176", },
 
+	{ .compatible = "nvidia,tegra20", },
+	{ .compatible = "nvidia,tegra30", },
 	{ .compatible = "nvidia,tegra124", },
 
 	{ .compatible = "qcom,apq8096", },
drivers/cpufreq/tegra20-cpufreq.c +253 -81

452 lines not on this page · raw message

Signature · 1 line
2.18.0
#20 lore raw

PATCH 3/5 ARM: tegra: Create tegra20-cpufreq device on Tegra30

In reply to Dmitry Osipenko

Tegra20-cpufreq driver require a platform device in order to be loaded, instantiate a simple platform device for the driver during of the machines late initialization. Driver now supports Tegra30 SoC's, hence create the device on Tegra30 machines.

---
 arch/arm/mach-tegra/tegra.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-tegra/tegra.c +4 -0
index 67d8ae60ac67..b559e22eab76 100644
@@ -111,6 +111,10 @@ static void __init tegra_dt_init_late(void)
 	if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
 	    of_machine_is_compatible("nvidia,tegra20"))
 		platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
+
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) &&
+	    of_machine_is_compatible("nvidia,tegra30"))
+		platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
 }
 
 static const char * const tegra_dt_board_compat[] = {
Signature · 1 line
2.18.0
#24 lore raw

PATCH 4/5 ARM: dts: tegra20: Add CPU Operating Performance Points

In reply to Dmitry Osipenko

Add CPU's Operating Performance Points to the device tree, they are used by the CPUFreq driver and allow to setup thermal throttling for the boards by linking the cooling device (CPU) with thermal sensors via thermal-zones description.

---
 arch/arm/boot/dts/tegra20.dtsi | 58 ++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
arch/arm/boot/dts/tegra20.dtsi +58 -0
index 01398db0c9c7..4415de0f7c65 100644
@@ -859,6 +859,52 @@
 		status = "disabled";
 	};
 
+	cpu0_opp_table: opp_table0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp@216000000 {
+			clock-latency-ns = <2000>;
+			opp-hz = /bits/ 64 <216000000>;
+			opp-suspend;
+		};
+
+		opp@312000000 {
+			clock-latency-ns = <125000>;
+			opp-hz = /bits/ 64 <312000000>;
+		};
+
+		opp@456000000 {
+			clock-latency-ns = <125000>;
+			opp-hz = /bits/ 64 <456000000>;
+		};
+
+		opp@608000000 {
+			clock-latency-ns = <125000>;
+			opp-hz = /bits/ 64 <608000000>;
+		};
+
+		opp@760000000 {
+			clock-latency-ns = <125000>;
+			opp-hz = /bits/ 64 <760000000>;
+		};
+
+		opp@816000000 {
+			clock-latency-ns = <125000>;
+			opp-hz = /bits/ 64 <816000000>;
+		};
+
+		opp@912000000 {
+			clock-latency-ns = <125000>;
+			opp-hz = /bits/ 64 <912000000>;
+		};
+
+		opp@1000000000 {
+			clock-latency-ns = <125000>;
+			opp-hz = /bits/ 64 <1000000000>;
+		};
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -867,12 +913,24 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <0>;
+			clocks = <&tegra_car TEGRA20_CLK_PLL_X>,
+				 <&tegra_car TEGRA20_CLK_PLL_P>,
+				 <&tegra_car TEGRA20_CLK_CCLK>;
+			clock-names = "pll_x", "backup", "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@1 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <1>;
+			clocks = <&tegra_car TEGRA20_CLK_PLL_X>,
+				 <&tegra_car TEGRA20_CLK_PLL_P>,
+				 <&tegra_car TEGRA20_CLK_CCLK>;
+			clock-names = "pll_x", "backup", "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>;
 		};
 	};
 
Signature · 1 line
2.18.0
#25 lore raw

PATCH 5/5 ARM: dts: tegra30: Add CPU Operating Performance Points

In reply to Dmitry Osipenko

Add CPU's Operating Performance Points to the device tree, they are used by the CPUFreq driver and allow to setup thermal throttling for the boards by linking the cooling device (CPU) with thermal sensors via thermal-zones description.

---
 arch/arm/boot/dts/tegra30.dtsi | 65 ++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
arch/arm/boot/dts/tegra30.dtsi +65 -0
index 37c4757516d2..5c8098bdfb2a 100644
@@ -980,6 +980,47 @@
 		status = "disabled";
 	};
 
+	cpu0_opp_table: opp_table0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp@408000000 {
+			clock-latency-ns = <2000>;
+			opp-hz = /bits/ 64 <408000000>;
+			opp-suspend;
+		};
+
+		opp@456000000 {
+			clock-latency-ns = <50000>;
+			opp-hz = /bits/ 64 <456000000>;
+		};
+
+		opp@608000000 {
+			clock-latency-ns = <50000>;
+			opp-hz = /bits/ 64 <608000000>;
+		};
+
+		opp@760000000 {
+			clock-latency-ns = <50000>;
+			opp-hz = /bits/ 64 <760000000>;
+		};
+
+		opp@816000000 {
+			clock-latency-ns = <50000>;
+			opp-hz = /bits/ 64 <816000000>;
+		};
+
+		opp@912000000 {
+			clock-latency-ns = <50000>;
+			opp-hz = /bits/ 64 <912000000>;
+		};
+
+		opp@1000000000 {
+			clock-latency-ns = <50000>;
+			opp-hz = /bits/ 64 <1000000000>;
+		};
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -988,24 +1029,48 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <0>;
+			clocks = <&tegra_car TEGRA30_CLK_PLL_X>,
+				 <&tegra_car TEGRA30_CLK_PLL_P>,
+				 <&tegra_car TEGRA30_CLK_CCLK_G>;
+			clock-names = "pll_x", "backup", "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@1 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <1>;
+			clocks = <&tegra_car TEGRA30_CLK_PLL_X>,
+				 <&tegra_car TEGRA30_CLK_PLL_P>,
+				 <&tegra_car TEGRA30_CLK_CCLK_G>;
+			clock-names = "pll_x", "backup", "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@2 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <2>;
+			clocks = <&tegra_car TEGRA30_CLK_PLL_X>,
+				 <&tegra_car TEGRA30_CLK_PLL_P>,
+				 <&tegra_car TEGRA30_CLK_CCLK_G>;
+			clock-names = "pll_x", "backup", "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@3 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <3>;
+			clocks = <&tegra_car TEGRA30_CLK_PLL_X>,
+				 <&tegra_car TEGRA30_CLK_PLL_P>,
+				 <&tegra_car TEGRA30_CLK_CCLK_G>;
+			clock-names = "pll_x", "backup", "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>;
 		};
 	};
 
Signature · 1 line
2.18.0
Tested-by on the v1 series
#26 lore raw
In reply to Dmitry Osipenko
Quoted 10 lines · Dmitry Osipenko

Hello,

This series adds support for CPU frequency scaling on Tegra30 and device
tree support that allows to implement thermal throttling and customize
available CPU frequencies per-board. The tegra20-cpufreq driver has been
re-worked to support that all.

Quoted 9 lines

Note that Tegra30 support not strictly depends on the clock patches that
are under review now, CPUFREQ driver will fail to probe until CCLKG clock
will get exposed by the clock driver. Hence this series can be applied
independently of the clock patches, CPUFREQ will start to work on Tegra30
once both patchsets will be applied.

In general this seems to work fine both on Colibri T20 as well as Apalis/Colibri T30. However I did notice a few things plus have some additional questions:

- Both T20 as well as T30 currently limit the max frequency to 1 GHz while there are clearly T30 SKUs which may allow higher frequencies (e.g. our regular T30 aka Embedded SKU 1.3 GHz max resp. 1.4 GHz single core only, commercial T30 aka AP33 or T33 or whatever it is called up to 1.6 GHz max resp. 1.7 GHz single core only). Would I have to allow this via custom OPPs in my device tree?

- However, certain OPPs may also require adjusting core/cpu voltages which is not yet taken care of as far as I can tell, correct?

- I believe in downstream certain OPPs also take silicon parameters aka speedo whatever into account. Any comments/plans concerning this?

- With "cpufreq-info -f" I could only observe like the top 3-4 OPPs while it does not to go further down even when idling. Why could that be resp. what could cause this?

- Unfortunately "cpufreq-info --stats" currently does not seem to output anything. Would that require something special to be implemented?

Other than that you may add the following to the whole series:

Quoted 18 lines

Dmitry Osipenko (5):
dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30
cpufreq: tegra20: Support OPP, thermal cooling and Tegra30
ARM: tegra: Create tegra20-cpufreq device on Tegra30
ARM: dts: tegra20: Add CPU Operating Performance Points
ARM: dts: tegra30: Add CPU Operating Performance Points

 .../cpufreq/nvidia,tegra20-cpufreq.txt        |  38 ++
 arch/arm/boot/dts/tegra20.dtsi                |  58 +++
 arch/arm/boot/dts/tegra30.dtsi                |  65 ++++
 arch/arm/mach-tegra/tegra.c                   |   4 +
 drivers/cpufreq/Kconfig.arm                   |   2 +
 drivers/cpufreq/cpufreq-dt-platdev.c          |   2 +
 drivers/cpufreq/tegra20-cpufreq.c             | 334 +++++++++++++---
--
 7 files changed, 422 insertions(+), 81 deletions(-)
 create mode 100644

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt

#27 lore raw
Quoted 25 lines · Marcel Ziswiler
Quoted 10 lines · Dmitry Osipenko

Hello,

This series adds support for CPU frequency scaling on Tegra30 and device
tree support that allows to implement thermal throttling and customize
available CPU frequencies per-board. The tegra20-cpufreq driver has been
re-worked to support that all.

Quoted 9 lines

Note that Tegra30 support not strictly depends on the clock patches that
are under review now, CPUFREQ driver will fail to probe until CCLKG clock
will get exposed by the clock driver. Hence this series can be applied
independently of the clock patches, CPUFREQ will start to work on Tegra30
once both patchsets will be applied.

In general this seems to work fine both on Colibri T20 as well as Apalis/Colibri T30. However I did notice a few things plus have some additional questions:

Quoted 6 lines

- Both T20 as well as T30 currently limit the max frequency to 1 GHz while there are clearly T30 SKUs which may allow higher frequencies (e.g. our regular T30 aka Embedded SKU 1.3 GHz max resp. 1.4 GHz single core only, commercial T30 aka AP33 or T33 or whatever it is called up to 1.6 GHz max resp. 1.7 GHz single core only). Would I have to allow this via custom OPPs in my device tree?

Yes.

Quoted 2 lines

- However, certain OPPs may also require adjusting core/cpu voltages which is not yet taken care of as far as I can tell, correct?

Yes, DVFS isn't implemented yet. That could be supported later.

Quoted 2 lines

- I believe in downstream certain OPPs also take silicon parameters aka speedo whatever into account. Any comments/plans concerning this?

Good point. There is 'opp-supported-hw' device-tree property which seems is intended for that purpose. I'll take a look at making use of the property in the next revision, alternatively that could be implemented later in a distinct patch.

Quoted 3 lines

- With "cpufreq-info -f" I could only observe like the top 3-4 OPPs while it does not to go further down even when idling. Why could that be resp. what could cause this?

What cpufreq governor are you using?

Here is my 'cpufreq-info --stats' output from Tegra30 after a several minutes of idling after boot:

408000:245884, 456000:445, 608000:251, 760000:151, 816000:82, 912000:75, 1000000:163 (561)

And full cpufreq-info:

cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: 50.0 us.
hardware limits: 408 MHz - 1000 MHz
available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816 MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware).
cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760 MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563)
analyzing CPU 1:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: 50.0 us.
hardware limits: 408 MHz - 1000 MHz
available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816 MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware).
cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760 MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563)
analyzing CPU 2:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: 50.0 us.
hardware limits: 408 MHz - 1000 MHz
available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816 MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware).
cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760 MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563)
analyzing CPU 3:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: 50.0 us.
hardware limits: 408 MHz - 1000 MHz
available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816 MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware).
cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760 MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563)

Quoted 3 lines

- Unfortunately "cpufreq-info --stats" currently does not seem to output anything. Would that require something special to be implemented?

Make sure that CONFIG_CPU_FREQ_STAT is enabled in the kernels config.

Quoted 3 lines

Other than that you may add the following to the whole series:

Thank you very much!

#28 lore raw

On Fri, 2018-09-07 at 19:59 +0300, Dmitry Osipenko wrote:

- snip -

Quoted 6 lines
Quoted 4 lines

- With "cpufreq-info -f" I could only observe like the top 3-4 OPPs while it does not to go further down even when idling. Why could that
be resp. what could cause this?

What cpufreq governor are you using?

ondemand

Quoted 84 lines

Here is my 'cpufreq-info --stats' output from Tegra30 after a several minutes of idling after boot:

408000:245884, 456000:445, 608000:251, 760000:151, 816000:82, 912000:75, 1000000:163 (561)

And full cpufreq-info:

cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009 Report errors and bugs to [email protected], please. analyzing CPU 0:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 0
1 2 3
maximum transition latency: 50.0 us.
hardware limits: 408 MHz - 1000 MHz
available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816
MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave,
ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to
use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware). cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760
MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563) analyzing CPU 1:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 0
1 2 3
maximum transition latency: 50.0 us.
hardware limits: 408 MHz - 1000 MHz
available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816
MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave,
ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to
use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware). cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760
MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563) analyzing CPU 2:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 0
1 2 3
maximum transition latency: 50.0 us.
hardware limits: 408 MHz - 1000 MHz
available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816
MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave,
ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to
use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware). cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760
MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563) analyzing CPU 3:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 0
1 2 3
maximum transition latency: 50.0 us.
hardware limits: 408 MHz - 1000 MHz
available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816
MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave,
ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to
use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware). cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760
MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563)

Quoted 5 lines
Quoted 3 lines

- Unfortunately "cpufreq-info --stats" currently does not seem to output anything. Would that require something special to be implemented?

Make sure that CONFIG_CPU_FREQ_STAT is enabled in the kernels config.

Yes, sorry. That was it, of course. Just wondering why that one isn't enabled in tegra_defconfig...

Quoted 5 lines
Quoted 3 lines

Other than that you may add the following to the whole series:

Thank you very much!

You are very welcome. Thank you!

#29 lore raw
Quoted 97 lines · Marcel Ziswiler

On Fri, 2018-09-07 at 19:59 +0300, Dmitry Osipenko wrote:

- snip -

Quoted 6 lines
Quoted 4 lines

- With "cpufreq-info -f" I could only observe like the top 3-4 OPPs while it does not to go further down even when idling. Why could that
be resp. what could cause this?

What cpufreq governor are you using?

ondemand

Quoted 84 lines

Here is my 'cpufreq-info --stats' output from Tegra30 after a several minutes of idling after boot:

408000:245884, 456000:445, 608000:251, 760000:151, 816000:82, 912000:75, 1000000:163 (561)

And full cpufreq-info:

cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009 Report errors and bugs to [email protected], please. analyzing CPU 0:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 0
1 2 3

    maximum transition latency: 50.0 us.
    hardware limits: 408 MHz - 1000 MHz
    available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816

MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave,
ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to
use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware). cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760
MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563) analyzing CPU 1:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 0
1 2 3

    maximum transition latency: 50.0 us.
    hardware limits: 408 MHz - 1000 MHz
    available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816

MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave,
ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to
use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware). cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760
MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563) analyzing CPU 2:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 0
1 2 3

    maximum transition latency: 50.0 us.
    hardware limits: 408 MHz - 1000 MHz
    available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816

MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave,
ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to
use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware). cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760
MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563) analyzing CPU 3:
driver: tegra
CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 0
1 2 3

    maximum transition latency: 50.0 us.
    hardware limits: 408 MHz - 1000 MHz
    available frequency steps: 408 MHz, 456 MHz, 608 MHz, 760 MHz, 816

MHz, 912 MHz, 1000 MHz
available cpufreq governors: conservative, userspace, powersave,
ondemand, performance, schedutil
current policy: frequency should be within 408 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to
use
within this range.
current CPU frequency is 608 MHz (asserted by call to hardware). cpufreq stats: 408 MHz:99.53%, 456 MHz:0.18%, 608 MHz:0.10%, 760
MHz:0.06%, 816 MHz:0.03%, 912 MHz:0.03%, 1000 MHz:0.07% (563)

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

- Unfortunately "cpufreq-info --stats" currently does not seem to output anything. Would that require something special to be implemented?

Make sure that CONFIG_CPU_FREQ_STAT is enabled in the kernels config.

Yes, sorry. That was it, of course. Just wondering why that one isn't enabled in tegra_defconfig...

That option isn't essential for the kernel, though usually such useful and low-overhead features are welcome. IIRC, tegra_defconfig misses more important options (like namespaces) that are required by Linux distro's to work properly.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Other than that you may add the following to the whole series:

Thank you very much!

You are very welcome. Thank you!

maintainer
#2 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

In reply to Dmitry Osipenko
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

The Cortex A9 has CLK, PERIPHCLK, and PERIPHCLKEN clocks and only CLK is used for the cpu core. You can't just define your own clocks that you happen to want access to.

Otherwise, you're not defining anything new here, so a binding document isn't required.

Rob

#3 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 31 lines · Rob Herring
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

The Cortex A9 has CLK, PERIPHCLK, and PERIPHCLKEN clocks and only CLK is used for the cpu core. You can't just define your own clocks that you happen to want access to.

Quoted 2 lines

Otherwise, you're not defining anything new here, so a binding document isn't required.

PERIPHCLK is a different thing. Here we are defining the CPU clock and its *parent* sources, the PLLX (main) and backup (intermediate clock that is used while PLLX changes its rate). These are not some random clocks "that you happen to want access to", they are essential for the Tegra CPUFreq driver, CPU is running off them.

I assume that PERIPHCLK and other clocks are derived from the "CPU" clock and their configuration is hardwired. Probably Peter knows how it's implemented in HW.

I'm now working on v2 that will include more Tegra-specific stuff in the binding, like custom "opp-supported-hw" property and probably some more.

maintainer
#4 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 33 lines · Dmitry Osipenko
Quoted 31 lines · Rob Herring
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

The Cortex A9 has CLK, PERIPHCLK, and PERIPHCLKEN clocks and only CLK is used for the cpu core. You can't just define your own clocks that you happen to want access to.

Quoted 4 lines
Quoted 2 lines

Otherwise, you're not defining anything new here, so a binding document isn't required.

PERIPHCLK is a different thing.

Right, that's what I meant. Only CLK is used.

Quoted 5 lines

Here we are defining the CPU clock and
its *parent* sources, the PLLX (main) and backup (intermediate clock that is used while PLLX changes its rate). These are not some random clocks "that you happen to want access to", they are essential for the Tegra CPUFreq driver, CPU is running off them.

assigned-clocks is generally how we get parent clocks in this situation. "clocks" is for what physical clocks are attached to a given block. ARM very clearly documents the clocks for their IP blocks.

Quoted 3 lines

I assume that PERIPHCLK and other clocks are derived from the "CPU" clock and their configuration is hardwired. Probably Peter knows how it's implemented in HW.

Yes, because PERIPHCLK must be synchronous. In any case, it is irrelevant to cpu nodes and applies to timer, SCU, and GIC nodes.

Quoted 2 lines

I'm now working on v2 that will include more Tegra-specific stuff in the binding, like custom "opp-supported-hw" property and probably some more.

#5 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 47 lines · Rob Herring
Quoted 33 lines · Dmitry Osipenko
Quoted 31 lines · Rob Herring
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

The Cortex A9 has CLK, PERIPHCLK, and PERIPHCLKEN clocks and only CLK is used for the cpu core. You can't just define your own clocks that you happen to want access to.

Quoted 4 lines
Quoted 2 lines

Otherwise, you're not defining anything new here, so a binding document isn't required.

PERIPHCLK is a different thing.

Right, that's what I meant. Only CLK is used.

Quoted 5 lines

Here we are defining the CPU clock and
its *parent* sources, the PLLX (main) and backup (intermediate clock that is used while PLLX changes its rate). These are not some random clocks "that you happen to want access to", they are essential for the Tegra CPUFreq driver, CPU is running off them.

Quoted 4 lines

assigned-clocks is generally how we get parent clocks in this situation. "clocks" is for what physical clocks are attached to a given block. ARM very clearly documents the clocks for their IP blocks.

Okay, seems I see now what you're meaning. The PLLX is specifically dedicated to CPU HW on Tegra, so it shouldn't be questioning to put it within the CPU node, unlike the backup.

The assigned-clocks are about static clocks configuration, that is exactly opposite to what is needed. I'm not sure what you are trying to convey.. we don't need to get the parent clock, but set it.

How the backup/intermediate clock should be represented then? It is a part of HW description which potentially may vary depending on the board configuration.

maintainer
#6 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 65 lines · Dmitry Osipenko
Quoted 47 lines · Rob Herring
Quoted 33 lines · Dmitry Osipenko
Quoted 31 lines · Rob Herring
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

The Cortex A9 has CLK, PERIPHCLK, and PERIPHCLKEN clocks and only CLK is used for the cpu core. You can't just define your own clocks that you happen to want access to.

Quoted 4 lines
Quoted 2 lines

Otherwise, you're not defining anything new here, so a binding document isn't required.

PERIPHCLK is a different thing.

Right, that's what I meant. Only CLK is used.

Quoted 5 lines

Here we are defining the CPU clock and
its *parent* sources, the PLLX (main) and backup (intermediate clock that is used while PLLX changes its rate). These are not some random clocks "that you happen to want access to", they are essential for the Tegra CPUFreq driver, CPU is running off them.

Quoted 4 lines

assigned-clocks is generally how we get parent clocks in this situation. "clocks" is for what physical clocks are attached to a given block. ARM very clearly documents the clocks for their IP blocks.

Okay, seems I see now what you're meaning. The PLLX is specifically dedicated to CPU HW on Tegra, so it shouldn't be questioning to put it within the CPU node, unlike the backup.

The assigned-clocks are about static clocks configuration, that is exactly opposite to what is needed. I'm not sure what you are trying to convey.. we don't need to get the parent clock, but set it.

How the backup/intermediate clock should be represented then? It is a part of HW description which potentially may vary depending on the board configuration.

maintainer
#7 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

In reply to Dmitry Osipenko
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

Cheers
Jon

Signature · 1 line
nvpublic
maintainer
#19 lore raw

Re: [PATCH v1 2/5] cpufreq: tegra20: Support OPP, thermal cooling and Tegra30

In reply to Dmitry Osipenko
Quoted 4 lines · Dmitry Osipenko

Add support for thermal throttling and Operating Performance Points. Driver now relies on OPP's supplied via device tree and therefore will work only on devices that use the updated device tree. The generalization of the driver allows to transparently support Tegra30.

Thierry, can we or should we do this?

Cheers
Jon

Signature · 1 line
nvpublic
maintainer
#21 lore raw

Re: [PATCH v1 3/5] ARM: tegra: Create tegra20-cpufreq device on Tegra30

In reply to Dmitry Osipenko
Quoted 15 lines · Dmitry Osipenko

Tegra20-cpufreq driver require a platform device in order to be loaded, instantiate a simple platform device for the driver during of the machines late initialization. Driver now supports Tegra30 SoC's, hence create the device on Tegra30 machines.

---
 arch/arm/mach-tegra/tegra.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-tegra/tegra.c +0 -0
index 67d8ae60ac67..b559e22eab76 100644

arch/arm/mach-tegra/tegra.c static void __init tegra_dt_init_late(void) · line 120

Quoted 10 lines
arch/arm/mach-tegra/tegra.c +4 -0
@@ -111,6 +111,10 @@ static void __init tegra_dt_init_late(void)
 	if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
 	    of_machine_is_compatible("nvidia,tegra20"))
 		platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
+
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) &&
+	    of_machine_is_compatible("nvidia,tegra30"))
+		platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
 }
 
 static const char * const tegra_dt_board_compat[] = {

Not sure why you would do this if now the driver only works with DT. Am I missing something?

Cheers
Jon

Signature · 1 line
nvpublic
maintainer
#22 lore raw

Re: [PATCH v1 3/5] ARM: tegra: Create tegra20-cpufreq device on Tegra30

Quoted 26 lines · Jon Hunter
Quoted 24 lines · Dmitry Osipenko

Tegra20-cpufreq driver require a platform device in order to be loaded, instantiate a simple platform device for the driver during of the machines late initialization. Driver now supports Tegra30 SoC's, hence create the device on Tegra30 machines.

---
 arch/arm/mach-tegra/tegra.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-tegra/tegra.c +4 -0
index 67d8ae60ac67..b559e22eab76 100644
@@ -111,6 +111,10 @@ static void __init tegra_dt_init_late(void)
 	if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
 	    of_machine_is_compatible("nvidia,tegra20"))
 		platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
+
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) &&
+	    of_machine_is_compatible("nvidia,tegra30"))
+		platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
 }
 
Quoted 4 lines

arch/arm/mach-tegra/tegra.c static void __init tegra_dt_init_late(void) · line 120

Quoted 1 line
arch/arm/mach-tegra/tegra.c +0 -0
 static const char * const tegra_dt_board_compat[] = {

Not sure why you would do this if now the driver only works with DT. Am I missing something?

Actually, not sure why we just don't move this into the actual driver itself like we have for tegra124.

Cheers
Jon

Signature · 1 line
nvpublic
#23 lore raw

Re: [PATCH v1 3/5] ARM: tegra: Create tegra20-cpufreq device on Tegra30

Quoted 28 lines · Jon Hunter
Quoted 26 lines · Jon Hunter
Quoted 24 lines · Dmitry Osipenko

Tegra20-cpufreq driver require a platform device in order to be loaded, instantiate a simple platform device for the driver during of the machines late initialization. Driver now supports Tegra30 SoC's, hence create the device on Tegra30 machines.

---
 arch/arm/mach-tegra/tegra.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-tegra/tegra.c +4 -0
index 67d8ae60ac67..b559e22eab76 100644
@@ -111,6 +111,10 @@ static void __init tegra_dt_init_late(void)
 	if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
 	    of_machine_is_compatible("nvidia,tegra20"))
 		platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
+
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) &&
+	    of_machine_is_compatible("nvidia,tegra30"))
+		platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
 }
 
Quoted 7 lines
Quoted 4 lines

arch/arm/mach-tegra/tegra.c static void __init tegra_dt_init_late(void) · line 120

Quoted 1 line
arch/arm/mach-tegra/tegra.c +0 -0
 static const char * const tegra_dt_board_compat[] = {

Not sure why you would do this if now the driver only works with DT. Am I missing something?

Actually, not sure why we just don't move this into the actual driver itself like we have for tegra124.

Tegra124 has specific HW for the CPUFreq, T20/30 do not. Hence on T20/30 CPUFreq control is implemented purely in software and there is no real HW device for the driver.

#8 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

In reply to Jon Hunter
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

#9 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 33 lines · Dmitry Osipenko
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 6 lines
Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

Though indeed it is unlikely that anything else other than pll_p will be used, so it is a software/firmware description anyway.

maintainer
#10 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

In reply to Dmitry Osipenko
Quoted 33 lines · Dmitry Osipenko
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 5 lines
Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

Hmm ... well that's my point exactly. So why call it 'backup'? Sounds like a software description to me.

Jon

Signature · 1 line
nvpublic
#11 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 35 lines · Jon Hunter
Quoted 33 lines · Dmitry Osipenko
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

Hmm ... well that's my point exactly. So why call it 'backup'? Sounds like a software description to me.

Because HW is designed the way that CPU parent need to be switched to the backup clock source while main clock changes its rate. HW also allow to select among different parents, pll_p is one of those parents.

I think cpufreq-mediatek has a similar description, see Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek.txt

maintainer
#12 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 40 lines · Dmitry Osipenko
Quoted 39 lines · Jon Hunter
Quoted 37 lines · Dmitry Osipenko
Quoted 35 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

That won't describe HW, but software. And device tree should describe HW.

Hmm ... well that's my point exactly. So why call it 'backup'? Sounds like a software description to me.

Because HW is designed the way that CPU parent need to be switched to the backup clock source while main clock changes its rate. HW also allow to select among different parents, pll_p is one of those parents.

Yes that part is understood. I am just splitting hairs over the actual name. We do the same for tegra124 but we just call it 'pll_p'. See ...

Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt

Cheers
Jon

Signature · 1 line
nvpublic
#13 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 47 lines · Jon Hunter
Quoted 45 lines · Dmitry Osipenko
Quoted 43 lines · Jon Hunter
Quoted 33 lines · Dmitry Osipenko
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 5 lines
Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

Hmm ... well that's my point exactly. So why call it 'backup'? Sounds like a software description to me.

Quoted 6 lines
Quoted 1 line

Because HW is designed the way that CPU parent need to be switched to the backup clock source while main clock changes its rate. HW also allow to select among different parents, pll_p is one of those parents.

Yes that part is understood. I am just splitting hairs over the actual name. We do the same for tegra124 but we just call it 'pll_p'. See ...

Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt

tegra124-cpufreq choose to hardwire to the pll_p, but it could be other clocks. Technically abstracting backup clock should be more correct, but result is the same in the end.

maintainer
#14 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 48 lines · Dmitry Osipenko
Quoted 47 lines · Jon Hunter
Quoted 45 lines · Dmitry Osipenko
Quoted 43 lines · Jon Hunter
Quoted 33 lines · Dmitry Osipenko
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 5 lines
Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

Hmm ... well that's my point exactly. So why call it 'backup'? Sounds like a software description to me.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Because HW is designed the way that CPU parent need to be switched to the backup clock source while main clock changes its rate. HW also allow to select among different parents, pll_p is one of those parents.

Yes that part is understood. I am just splitting hairs over the actual name. We do the same for tegra124 but we just call it 'pll_p'. See ...

Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt

tegra124-cpufreq choose to hardwire to the pll_p, but it could be other clocks. Technically abstracting backup clock should be more correct, but result is the same in the end.

Yes and that is probably intentional as that is the configuration that has been validated. So unless we are planning to test and verify every possibility, my preference is to keep it simple. But yes the result is the same.

I was simply curious of your intention here because of the other series you posted with regard to the cpu clocks.

Cheers
Jon

Signature · 1 line
nvpublic
#15 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 59 lines · Jon Hunter
Quoted 48 lines · Dmitry Osipenko
Quoted 47 lines · Jon Hunter
Quoted 45 lines · Dmitry Osipenko
Quoted 43 lines · Jon Hunter
Quoted 33 lines · Dmitry Osipenko
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 5 lines
Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

Hmm ... well that's my point exactly. So why call it 'backup'? Sounds like a software description to me.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Because HW is designed the way that CPU parent need to be switched to the backup clock source while main clock changes its rate. HW also allow to select among different parents, pll_p is one of those parents.

Yes that part is understood. I am just splitting hairs over the actual name. We do the same for tegra124 but we just call it 'pll_p'. See ...

Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt

tegra124-cpufreq choose to hardwire to the pll_p, but it could be other clocks. Technically abstracting backup clock should be more correct, but result is the same in the end.

Quoted 7 lines

Yes and that is probably intentional as that is the configuration that has been validated. So unless we are planning to test and verify every possibility, my preference is to keep it simple. But yes the result is the same.

I was simply curious of your intention here because of the other series you posted with regard to the cpu clocks.

Actually I tried other parents on T30 and they worked with no problems. The intention of having 'backup' is to describe HW properly in the device tree, that's it. We'll have backup set to pll_p by default. ACK?

maintainer
#16 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 65 lines · Dmitry Osipenko
Quoted 64 lines · Jon Hunter
Quoted 48 lines · Dmitry Osipenko
Quoted 47 lines · Jon Hunter
Quoted 45 lines · Dmitry Osipenko
Quoted 43 lines · Jon Hunter
Quoted 33 lines · Dmitry Osipenko
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 5 lines
Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

Hmm ... well that's my point exactly. So why call it 'backup'? Sounds like a software description to me.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Because HW is designed the way that CPU parent need to be switched to the backup clock source while main clock changes its rate. HW also allow to select among different parents, pll_p is one of those parents.

Yes that part is understood. I am just splitting hairs over the actual name. We do the same for tegra124 but we just call it 'pll_p'. See ...

Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt

tegra124-cpufreq choose to hardwire to the pll_p, but it could be other clocks. Technically abstracting backup clock should be more correct, but result is the same in the end.

Yes and that is probably intentional as that is the configuration that has been validated. So unless we are planning to test and verify every possibility, my preference is to keep it simple. But yes the result is the same.

Quoted 4 lines
Quoted 2 lines

I was simply curious of your intention here because of the other series you posted with regard to the cpu clocks.

Actually I tried other parents on T30 and they worked with no problems. The intention of having 'backup' is to describe HW properly in the device tree, that's it. We'll have backup set to pll_p by default. ACK?

Yes but I don't find the name 'backup' very descriptive because like you say it is an intermediate clock for switching frequency. But at the same time I don't have a good suggestion. Anyway it is more of a bike-shedding comment.

Cheers
Jon

Signature · 1 line
nvpublic
#17 lore raw

Re: [PATCH v1 1/5] dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30

Quoted 70 lines · Jon Hunter
Quoted 68 lines · Dmitry Osipenko
Quoted 66 lines · Jon Hunter
Quoted 48 lines · Dmitry Osipenko
Quoted 47 lines · Jon Hunter
Quoted 45 lines · Dmitry Osipenko
Quoted 43 lines · Jon Hunter
Quoted 33 lines · Dmitry Osipenko
Quoted 32 lines · Jon Hunter
Quoted 15 lines · Dmitry Osipenko

Add device-tree binding that describes CPU frequency-scaling hardware found on NVIDIA Tegra20/30 SoC's.

---
 .../cpufreq/nvidia,tegra20-cpufreq.txt        | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +0 -0
new file mode 100644
index 000000000000..2c51f676e958

Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/cpufreq/nvidia,tegra20-cpufreq.txt new file +10 -0
@@ -0,0 +1,38 @@
+Binding for NVIDIA Tegra20 CPUFreq
+==================================
+
+Required properties:
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - pll_x: main-parent for CPU clock, must be the first entry
+  - backup: intermediate-parent for CPU clock
+  - cpu: the CPU clock

Is it likely that 'backup' will be anything other that pll_p? If not why not just call it pll_p? Personally, I don't 'backup' to descriptive even though I can see what you mean.

Quoted 5 lines
Quoted 3 lines

I can see that you want to make this flexible, but if the likelihood is that we will just use pll_p then I am not sure it is warranted at this point.

That won't describe HW, but software. And device tree should describe HW.

Hmm ... well that's my point exactly. So why call it 'backup'? Sounds like a software description to me.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Because HW is designed the way that CPU parent need to be switched to the backup clock source while main clock changes its rate. HW also allow to select among different parents, pll_p is one of those parents.

Yes that part is understood. I am just splitting hairs over the actual name. We do the same for tegra124 but we just call it 'pll_p'. See ...

Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt

tegra124-cpufreq choose to hardwire to the pll_p, but it could be other clocks. Technically abstracting backup clock should be more correct, but result is the same in the end.

Yes and that is probably intentional as that is the configuration that has been validated. So unless we are planning to test and verify every possibility, my preference is to keep it simple. But yes the result is the same.

I was simply curious of your intention here because of the other series you posted with regard to the cpu clocks.

Quoted 6 lines
Quoted 1 line

Actually I tried other parents on T30 and they worked with no problems. The intention of having 'backup' is to describe HW properly in the device tree, that's it. We'll have backup set to pll_p by default. ACK?

Yes but I don't find the name 'backup' very descriptive because like you say it is an intermediate clock for switching frequency. But at the same time I don't have a good suggestion. Anyway it is more of a bike-shedding comment.

I'll consider renaming 'backup' to 'intermediate' in the v2 which I'll probably manage to send out tomorrow as RFC (CPUFreq now depends on yet-not-reviewed coupled-regulators patches).