mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor
@ 2022-01-24  8:28 Francesco Dolcini
  2022-01-24  8:28 ` [PATCH v2 1/2] ARM: dts: imx7s: Define operating points table for cpufreq Francesco Dolcini
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Francesco Dolcini @ 2022-01-24  8:28 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger
  Cc: Francesco Dolcini, devicetree, linux-arm-kernel, linux-pm,
	linux-kernel, Marcel Ziswiler, Denys Drozdov, Stefan Agner

To be able to read the T junction on i.MX CPU the imx-cpufreq-dt needs to be
loaded, however this is currently not the case for i.MX7S given that it does
have only one operating frequency.

Add "fsl,imx7s" to cpufreq-dt-platdev blocklist and a single frequency
operating point to the CPU.

With that it is now possible to correctly read the CPU T junction.

Tested on Toradex Colibri iMX7S

[    6.232577] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 0 mkt segment 1 supported-hw 0x1 0x2
...
[    6.880624] imx_thermal 30360000.anatop:tempmon: Extended Commercial CPU temperature grade - max:105C critical:100C passive:95C

root@colibri-imx7-02983025:~# cat /sys/class/thermal/thermal_zone0/temp 
38000

v2:
 - removed empty new line
 - rebased and tested on v5.17-rc1


Denys Drozdov (1):
  ARM: dts: imx7s: Define operating points table for cpufreq

Stefan Agner (1):
  cpufreq: Add i.MX7S to cpufreq-dt-platdev blocklist

 arch/arm/boot/dts/imx7s.dtsi         | 16 ++++++++++++++++
 drivers/cpufreq/cpufreq-dt-platdev.c |  1 +
 2 files changed, 17 insertions(+)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/2] ARM: dts: imx7s: Define operating points table for cpufreq
  2022-01-24  8:28 [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor Francesco Dolcini
@ 2022-01-24  8:28 ` Francesco Dolcini
  2022-02-02 18:15   ` Fabio Estevam
  2022-01-24  8:28 ` [PATCH v2 2/2] cpufreq: Add i.MX7S to cpufreq-dt-platdev blocklist Francesco Dolcini
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Francesco Dolcini @ 2022-01-24  8:28 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger
  Cc: Denys Drozdov, devicetree, linux-arm-kernel, linux-pm,
	linux-kernel, Marcel Ziswiler, Francesco Dolcini

From: Denys Drozdov <denys.drozdov@toradex.com>

Processor operating points for imx7s.dtsi should be properly defined to
perform correct imx-cpufreq-dt probe and registration and provide an
access to the temperature sensors using the i.MX thermal driver.

Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---

v2: no changes

---
 arch/arm/boot/dts/imx7s.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 52a9aeecdbb2..5af6d58666f4 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -76,6 +76,22 @@ cpu0: cpu@0 {
 			clock-latency = <61036>; /* two CLK32 periods */
 			clocks = <&clks IMX7D_CLK_ARM>;
 			cpu-idle-states = <&cpu_sleep_wait>;
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>;
+			nvmem-cells = <&fuse_grade>;
+			nvmem-cell-names = "speed_grade";
+		};
+	};
+
+	cpu0_opp_table: opp-table {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp-792000000 {
+			opp-hz = /bits/ 64 <792000000>;
+			opp-microvolt = <1000000>;
+			clock-latency-ns = <150000>;
+			opp-supported-hw = <0xf>, <0xf>;
 		};
 	};
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 2/2] cpufreq: Add i.MX7S to cpufreq-dt-platdev blocklist
  2022-01-24  8:28 [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor Francesco Dolcini
  2022-01-24  8:28 ` [PATCH v2 1/2] ARM: dts: imx7s: Define operating points table for cpufreq Francesco Dolcini
@ 2022-01-24  8:28 ` Francesco Dolcini
  2022-02-02 18:15   ` Fabio Estevam
  2022-02-01 13:37 ` [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor Francesco Dolcini
  2022-02-09  6:37 ` Viresh Kumar
  3 siblings, 1 reply; 7+ messages in thread
From: Francesco Dolcini @ 2022-01-24  8:28 UTC (permalink / raw)
  To: Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger
  Cc: Stefan Agner, devicetree, linux-arm-kernel, linux-pm,
	linux-kernel, Marcel Ziswiler, Denys Drozdov, Stefan Agner,
	Francesco Dolcini

From: Stefan Agner <stefan.agner@toradex.com>

The i.MX 7Solo currently does not have multiple operating points,
however, in order for the i.MX Thermal driver to successfully probe
a cpufreq device is required. Add it to the cpufreq-dt-platdev
driver's blocklist to allow using imx-cpufreq-dt.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Cc: Stefan Agner <stefan@agner.ch>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: removed empty line
---
 drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index ca1d103ec449..6b808f805eab 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -110,6 +110,7 @@ static const struct of_device_id blocklist[] __initconst = {
 
 	{ .compatible = "fsl,imx7ulp", },
 	{ .compatible = "fsl,imx7d", },
+	{ .compatible = "fsl,imx7s", },
 	{ .compatible = "fsl,imx8mq", },
 	{ .compatible = "fsl,imx8mm", },
 	{ .compatible = "fsl,imx8mn", },
-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor
  2022-01-24  8:28 [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor Francesco Dolcini
  2022-01-24  8:28 ` [PATCH v2 1/2] ARM: dts: imx7s: Define operating points table for cpufreq Francesco Dolcini
  2022-01-24  8:28 ` [PATCH v2 2/2] cpufreq: Add i.MX7S to cpufreq-dt-platdev blocklist Francesco Dolcini
@ 2022-02-01 13:37 ` Francesco Dolcini
  2022-02-09  6:37 ` Viresh Kumar
  3 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2022-02-01 13:37 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Rafael J. Wysocki, Viresh Kumar
  Cc: Rob Herring, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Matthias Brugger, devicetree, linux-arm-kernel,
	linux-pm, linux-kernel, Marcel Ziswiler, Denys Drozdov,
	Stefan Agner

Hello, just a gently ping on this series. Thanks!

Francesco

On Mon, Jan 24, 2022 at 09:28:01AM +0100, Francesco Dolcini wrote:
> To be able to read the T junction on i.MX CPU the imx-cpufreq-dt needs to be
> loaded, however this is currently not the case for i.MX7S given that it does
> have only one operating frequency.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/2] ARM: dts: imx7s: Define operating points table for cpufreq
  2022-01-24  8:28 ` [PATCH v2 1/2] ARM: dts: imx7s: Define operating points table for cpufreq Francesco Dolcini
@ 2022-02-02 18:15   ` Fabio Estevam
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2022-02-02 18:15 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, Denys Drozdov,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-pm, linux-kernel, Marcel Ziswiler

Hi Francesco,

On Mon, Jan 24, 2022 at 5:28 AM Francesco Dolcini
<francesco.dolcini@toradex.com> wrote:
>
> From: Denys Drozdov <denys.drozdov@toradex.com>
>
> Processor operating points for imx7s.dtsi should be properly defined to
> perform correct imx-cpufreq-dt probe and registration and provide an
> access to the temperature sensors using the i.MX thermal driver.
>
> Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/2] cpufreq: Add i.MX7S to cpufreq-dt-platdev blocklist
  2022-01-24  8:28 ` [PATCH v2 2/2] cpufreq: Add i.MX7S to cpufreq-dt-platdev blocklist Francesco Dolcini
@ 2022-02-02 18:15   ` Fabio Estevam
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2022-02-02 18:15 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, Stefan Agner,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-pm, linux-kernel, Marcel Ziswiler, Denys Drozdov,
	Stefan Agner

On Mon, Jan 24, 2022 at 5:28 AM Francesco Dolcini
<francesco.dolcini@toradex.com> wrote:
>
> From: Stefan Agner <stefan.agner@toradex.com>
>
> The i.MX 7Solo currently does not have multiple operating points,
> however, in order for the i.MX Thermal driver to successfully probe
> a cpufreq device is required. Add it to the cpufreq-dt-platdev
> driver's blocklist to allow using imx-cpufreq-dt.
>
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor
  2022-01-24  8:28 [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor Francesco Dolcini
                   ` (2 preceding siblings ...)
  2022-02-01 13:37 ` [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor Francesco Dolcini
@ 2022-02-09  6:37 ` Viresh Kumar
  3 siblings, 0 replies; 7+ messages in thread
From: Viresh Kumar @ 2022-02-09  6:37 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rafael J. Wysocki,
	Matthias Brugger, devicetree, linux-arm-kernel, linux-pm,
	linux-kernel, Marcel Ziswiler, Denys Drozdov, Stefan Agner

On 24-01-22, 09:28, Francesco Dolcini wrote:
> To be able to read the T junction on i.MX CPU the imx-cpufreq-dt needs to be
> loaded, however this is currently not the case for i.MX7S given that it does
> have only one operating frequency.
> 
> Add "fsl,imx7s" to cpufreq-dt-platdev blocklist and a single frequency
> operating point to the CPU.
> 
> With that it is now possible to correctly read the CPU T junction.
> 
> Tested on Toradex Colibri iMX7S
> 
> [    6.232577] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 0 mkt segment 1 supported-hw 0x1 0x2
> ...
> [    6.880624] imx_thermal 30360000.anatop:tempmon: Extended Commercial CPU temperature grade - max:105C critical:100C passive:95C
> 
> root@colibri-imx7-02983025:~# cat /sys/class/thermal/thermal_zone0/temp 
> 38000
> 
> v2:
>  - removed empty new line
>  - rebased and tested on v5.17-rc1

Applied. Thanks.

-- 
viresh

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-09  6:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24  8:28 [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor Francesco Dolcini
2022-01-24  8:28 ` [PATCH v2 1/2] ARM: dts: imx7s: Define operating points table for cpufreq Francesco Dolcini
2022-02-02 18:15   ` Fabio Estevam
2022-01-24  8:28 ` [PATCH v2 2/2] cpufreq: Add i.MX7S to cpufreq-dt-platdev blocklist Francesco Dolcini
2022-02-02 18:15   ` Fabio Estevam
2022-02-01 13:37 ` [PATCH v2 0/2] Enable i.MX7 SOLO temperature sensor Francesco Dolcini
2022-02-09  6:37 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®