temperature value in /sy/class/thermal/thermal_zone0/temp is looks like incorrect

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

temperature value in /sy/class/thermal/thermal_zone0/temp is looks like incorrect

4,238 Views
kiransingjparadeshi
Contributor I

I applied backport thermal and dtsi patches  for thermal driver for imx7solo / imx7dual and done kernel configuration but in /sys/class/thermal/thermal_zone0/temp value showing 272000, it's in millidegree Celsius  i.e 272 degree Celsius, it looks like not correct.

why it showing too large value, what am I missing?

Thanks

Kiransing

0 Kudos
Reply
10 Replies

4,070 Views
kiransingjparadeshi
Contributor I

--

0 Kudos
Reply

4,096 Views
kiransingjparadeshi
Contributor I

--

0 Kudos
Reply

4,146 Views
kiransingjparadeshi
Contributor I

--

0 Kudos
Reply

4,141 Views
igorpadykov
NXP Employee
NXP Employee

nxp has special service for helping customers with porting:   https://contact.nxp.com/new-prof-svcs-sw-tech

 

Best regards
igor

0 Kudos
Reply

4,151 Views
kiransingjparadeshi
Contributor I

--

0 Kudos
Reply

4,218 Views
igorpadykov
NXP Employee
NXP Employee

Hi Kiransing

 

what bsp used in the case, thermal driver works fine in nxp linux releases, one can look at

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm/boot/dts/imx7s.dtsi?h=lf-5.10.y

and sect.2.9 Thermal  i.MX Linux Reference Manual​

 

Best regards
igor

0 Kudos
Reply

4,203 Views
kiransingjparadeshi
Contributor I

Hi

Thanks for reply.

I am using kernel version 4.9.274 and Soc  imx7solo/imx7dual.

pls find 2 patch on dtsi file:

From 9f29183fa344704f7317e421d47b149ab38224f2 Mon Sep 17 00:00:00 2001
From: Peng Fan <peng.fan@nxp.com>
Date: Wed, 1 Mar 2017 14:40:53 +0800
Subject: [PATCH] ARM: dts: imx7s: enable ocotp

Enable ocotp for i.mx7D/S.
Correct the clock entry and compatible string.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
---
arch/arm/boot/dts/imx7s.dtsi | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 5d3a43b8de20..a7d48e785d34 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -493,10 +493,9 @@
};

ocotp: ocotp-ctrl@30350000 {
- compatible = "syscon";
+ compatible = "fsl,imx7d-ocotp", "syscon";
reg = <0x30350000 0x10000>;
- clocks = <&clks IMX7D_CLK_DUMMY>;
- status = "disabled";
+ clocks = <&clks IMX7D_OCOTP_CLK>;
};

anatop: anatop@30360000 {
--
2.17.1

From de25b9bb4a40c571718180a870e6d3087da11f80 Mon Sep 17 00:00:00 2001
From: Anson Huang <Anson.Huang@nxp.com>
Date: Fri, 2 Mar 2018 09:59:29 +0800
Subject: [PATCH] ARM: dts: imx7s: add temperature monitor support

Add i.MX7 temperature monitor support.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
---
arch/arm/boot/dts/imx7s.dtsi | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index fec2af9de039..cd6964f658c0 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -517,9 +517,29 @@
};

ocotp: ocotp-ctrl@30350000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
compatible = "fsl,imx7d-ocotp", "syscon";
reg = <0x30350000 0x10000>;
clocks = <&clks IMX7D_OCOTP_CLK>;
+
+ tempmon_calib: calib@3c {
+ reg = <0x3c 0x4>;
+ };
+
+ tempmon_temp_grade: temp-grade@10 {
+ reg = <0x10 0x4>;
+ };
+ };
+
+ tempmon: tempmon {
+ compatible = "fsl,imx7d-tempmon";
+ interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
+ fsl,tempmon =<&anatop>;
+ nvmem-cells = <&tempmon_calib>,
+ <&tempmon_temp_grade>;
+ nvmem-cell-names = "calib", "temp_grade";
+ clocks = <&clks IMX7D_PLL_SYS_MAIN_CLK>;
};

anatop: anatop@30360000 {
--
2.17.1

0 Kudos
Reply

4,196 Views
igorpadykov
NXP Employee
NXP Employee

>I am using kernel version 4.9.274..

 

sorry NXP does not officially support this kernel version. Please try with official NXP

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


https://source.codeaurora.org/external/imx/linux-imx/tree/?h=lf-5.10.y

 

Best regards
igor

0 Kudos
Reply

4,145 Views
kiransingjparadeshi
Contributor I

Many people done backport from v4.18 to their previous version for nxp and  i have done same and getting all files and directory in /sys/class/thermal, only issue i am getting very high temperature value i. 270000, it should be 27000.

some thing got missed from my side, pls suggest and mean while will check with v5.10

 

--Kiransing

0 Kudos
Reply

4,068 Views
kiransingjparadeshi
Contributor I

Hi As mentioned above i built from https://source.codeaurora.org/external/imx/linux-imx/tree/?h=lf-5.10.y and also tried with kernel.org for same version (5.10) in yocto but board could not boot, it got hanged. (Observed in HMI screen). so is their any other solution for to get correct temperature value?

Kiransing

0 Kudos
Reply