How to enable temperature monitoring in IMX7D?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable temperature monitoring in IMX7D?

3,045 Views
javerv
Contributor I

Hello,

I just want to check how to enable temp monitoring in imx7d?

I have a custom im7d board and I cant seem to find where to enable temp monitoring in /sys/class/thermal

In my menuconfig, I can confirm that below is enabled.

Device Drivers > Generic Thermal sysfs driver >Temperature sensor driver for i.MX SoCs

However, after loading the kernel no thermal zone was loaded in sysfs.

root@myboard:~# ls /sys/class/thermal/ 

root@myboard:~#

I'm expecting something like below  (based from my imx7dsabresd board)

root@imx7dsabresd:~# ls /sys/class/thermal/                                                                         
cooling_device0/ cooling_device1/ thermal_zone0/

root@imx7dsabresd:~#

BTW, I'm using Yocto Zeus.

Thanks

Javer

Labels (1)
0 Kudos
14 Replies

247 Views
henneond
Contributor I

I had a similar problem. For me, the issue was that the cpufreq driver was not working and that caused imx_thermal driver probe to fail. Cpufreq driver probe was failing because of a missing cpu-supply property on CPU DT node. This property needs to reference a regulator which supplies the CPU. I am using the TechNexion pico-pi board and a pmic was already defined in imx7d-pico.dtsi like this: 

&i2c4 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c4>;
	status = "okay";

	pmic: pfuze3000@8 {
		compatible = "fsl,pfuze3000";
		reg = <0x08>;

		regulators {
			sw1a_reg: sw1a {
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
				regulator-ramp-delay = <6250>;
			};
			/* use sw1c_reg to align with pfuze100/pfuze200 */
			sw1c_reg: sw1b {
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1475000>;
				regulator-boot-on;
				regulator-always-on;
				regulator-ramp-delay = <6250>;
			};

			sw2_reg: sw2 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1850000>;
				regulator-boot-on;
				regulator-always-on;
			};

			sw3a_reg: sw3 {
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1650000>;
				regulator-boot-on;
				regulator-always-on;
			};

			swbst_reg: swbst {
				regulator-min-microvolt = <5000000>;
				regulator-max-microvolt = <5150000>;
			};

			snvs_reg: vsnvs {
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <3000000>;
				regulator-boot-on;
				regulator-always-on;
			};

			vref_reg: vrefddr {
				regulator-boot-on;
				regulator-always-on;
			};

			vgen1_reg: vldo1 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vgen2_reg: vldo2 {
				regulator-min-microvolt = <800000>;
				regulator-max-microvolt = <1550000>;
			};

			vgen3_reg: vccsd {
				regulator-min-microvolt = <2850000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vgen4_reg: v33 {
				regulator-min-microvolt = <2850000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vgen5_reg: vldo3 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vgen6_reg: vldo4 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};
		};
	};
};

So I did this in my dts:

&cpu0 {
	cpu-supply = <&sw1a_reg>;
};

&cpu1 {
	cpu-supply = <&sw1a_reg>;
};

 And both the CPU frequency scaling and temperature monitoring started working.

0 Kudos

1,939 Views
HelbertPaulino
Contributor I

Hello,

I'm new here and using Yocto project to make custom Linux. I did the recommended procedures described in Toradex User Manual, but I'm not having success.

Have somebody some explanation about this temperature sensor issue?
Thanks very much and have a great 2022!

0 Kudos

1,909 Views
Florens
Contributor I

For us activating "CONFIG_ARM_IMX_CPUFREQ_DT=y" helped.

0 Kudos

1,931 Views
javerv
Contributor I

Hello Helbert,

 

Could you advise what u-boot and kernel version are you using?

BTW, can you check if you can detect the temperature in u-boot?

 

Thanks,

Javer

0 Kudos

2,943 Views
igorpadykov
NXP Employee
NXP Employee

Hi Javer

one can try settings described in sect.2.9.4 Menu Configuration Options

i.MX Linux Reference Manual

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,943 Views
javerv
Contributor I

Hello Igor,

Good day!

Yes, I already implemented that as I have explained above.

pastedImage_1.png

I'm thinking if there is any pin that can affect this?

Or is there any modification in device-tree I need to implement?

Thanks,

Javer

0 Kudos

2,943 Views
igorpadykov
NXP Employee
NXP Employee

Hi Javer

 

what bsp used in the case, suggest to try nxp releases from

source.codeaurora.org/external/imx/linux-imx  repository

linux-imx - i.MX Linux kernel 

 

Best regards
igor

0 Kudos

2,943 Views
javerv
Contributor I

Hello Igor,

Additional information:

I put my software build in an SD card and put in imx7dsabre board.

There I can find below.

root@myboard:~# ls /sys/class/thermal/                                                                         
cooling_device0/ cooling_device1/ thermal_zone0/

root@myboard:~#

But everytime I put the SD card in our custom board.

I cant find anything insie thermal folder

root@myboard:~# ls /sys/class/thermal/

root@myboard:~#

The difference between my board and sabresd board is the PMIC.

Is that affects the driver for thermal?

Thanks,

Javer

0 Kudos

2,942 Views
igorpadykov
NXP Employee
NXP Employee

Hi Javer

>The difference between my board and sabresd board is the PMIC.

>Is that affects the driver for thermal?

I think yes as all these drivers :  thermal, pmic, pmic regulator, cpu frequency scaling

(CPUFREQ) are tightly coupled with each other. So it is necessary to port new

pmic using sect.2.5 Power Management  i.MX Linux Reference Manual

i.MX Porting Guide

Best regards
igor

0 Kudos

2,943 Views
javerv
Contributor I

Hello Igor,

Below is what I'm currently using.

https://source.codeaurora.org/external/imx/imx-manifest  -b imx-linux-zeus -m imx-5.4.3-2.0.0.xml

Thanks,

Javer

0 Kudos

2,751 Views
michael_pavlovi
Contributor I

Hi,

Did you ever resolve this issue?  I'm experiencing the same problem where it appears the driver code is not starting even though it is configured properly in the Linux Menu Config.

Thanks very much!

Michael

0 Kudos

2,578 Views
javerv
Contributor I

Hello Michael,

 

This issue is still not resolved on our end.

 

Thanks,

Javer

0 Kudos

2,726 Views
Florens
Contributor I

Same Problem on linux-mainline 5.4. cpufreq_driver is not set resulting in no thermal_zone in sysfs. In 4.19 it works. Any Ideas?

0 Kudos

2,577 Views
javerv
Contributor I

Hello Florens,

 

This issue is still not resolved on our end.

 

Thanks,

Javer

0 Kudos