AnsweredAssumed Answered

thermal issue on I.MX8M-EVK

Question asked by coin du on Feb 24, 2019
Latest reply on Feb 27, 2019 by coin du

      When we try to test the evk board under the zero temperature. we find the value of temperature always above zero.the code get_temp as  follows.

      qoriq_thermal.c

      

static int tmu_get_temp(void *p, int *temp)
{
      u32 val;
      struct qoriq_tmu_data *data = p;

      val = tmu_read(data, &data->regs->site[data->sensor_id].tritsr);
      *temp = (val & 0xff) * 1000;

      return 0;
}

 

   so when the temperature of cpu under zero, the obtain value will more then the critical value ,lead to system too hot to reboot.

   

  After found this , I print the "val". when the value is above zero,it like this [80000042] and when the value was zero it will be [80000000] or [0]. under the zero will be [70].  then modify the code like this 

static int tmu_get_temp(void *p, int *temp)
{
u32 val;
struct qoriq_tmu_data *data = p;

val = tmu_read(data, &data->regs->site[data->sensor_id].tritsr);
*temp = (val & 0xff) * 1000;
/* when the sensor temperature was 0x80000042, we think of it hight the zero,
if the temperature was 0x00000054, we think of it low the zero*/
      if(!(val&(1<<31))){
      *temp = (-1)*(*temp);
      }

return 0;
}

 

Unfortunately the val is still reverse like this 

-----------------------------------------------------------------------------

[ 976.994694] last_temperature=-105000, current_temperature=-105000
[ 979.010619] last_temperature=-105000, current_temperature=-105000
[ 981.026642] last_temperature=-105000, current_temperature=-105000
[ 983.042617] last_temperature=-105000, current_temperature=-105000
[ 985.058700] last_temperature=-105000, current_temperature=105000
[ 985.064762] hantro receive hot notification event: 1
[ 985.069951] System is too hot. GPU3D will work at 1/64 clock.
[ 985.075912] thermal thermal_zone0: critical temperature reached(105 C),shutting down

Message from syslogd@imx8mqevk at Mon Jul 30 10:22:57 2018 ...
imx8mqevk kernel: [ 985.075912] thermal thermal_zone0: critical temperature reached(105 C),shutting down

 

can you please fix the value of sensor?

Outcomes