34 #ifdef ENABLE_THERMAL_PROTECTION
42 #include "mfr_temperature.h"
43 #include "plat_power.h"
44 #include "pwrlogger.h"
48 #define STANDBY_REASON_FILE "/opt/standbyReason.txt"
49 #define THERMAL_PROTECTION_GROUP "Thermal_Config"
50 #define THERMAL_SHUTDOWN_REASON "THERMAL_SHUTDOWN"
52 #define RFC_ENABLE_ThermalProtection
53 #define RFC_DATA_ThermalProtection_POLL_INTERVAL
55 #define RFC_DATA_ThermalProtection_REBOOT_CRITICAL_THRESHOLD
56 #define RFC_DATA_ThermalProtection_REBOOT_CONCERN_THRESHOLD
57 #define RFC_DATA_ThermalProtection_REBOOT_GRACE_INTERVAL
58 #define RFC_DATA_ThermalProtection_REBOOT_SAFE_THRESHOLD
60 #define RFC_DATA_ThermalProtection_DEEPSLEEP_CRITICAL_THRESHOLD
61 #define RFC_DATA_ThermalProtection_DEEPSLEEP_CONCERN_THRESHOLD
62 #define RFC_DATA_ThermalProtection_DEEPSLEEP_GRACE_INTERVAL
63 #define RFC_DATA_ThermalProtection_DEEPSLEEP_SAFE_THRESHOLD
65 #define RFC_DATA_ThermalProtection_DECLOCK_CRITICAL_THRESHOLD
66 #define RFC_DATA_ThermalProtection_DECLOCK_CONCERN_THRESHOLD
67 #define RFC_DATA_ThermalProtection_DECLOCK_GRACE_INTERVAL
68 #define RFC_DATA_ThermalProtection_DECLOCK_SAFE_THRESHOLD
72 static int thermal_reboot_critical_threshold = 120;
75 static int thermal_reboot_concern_threshold = 112;
77 static int thermal_reboot_safe_threshold = 110;
82 static int thermal_reboot_grace_interval = 600;
86 static int thermal_deepsleep_critical_threshold = 115;
88 static int thermal_deepsleep_concern_threshold = 110;
90 static int thermal_deepsleep_safe_threshold = 100;
95 static int thermal_deepsleep_grace_interval = 600;
99 static int thermal_declock_critical_threshold = 110;
101 static int thermal_declock_concern_threshold = 100;
103 static int thermal_declock_safe_threshold = 90;
107 static int thermal_declock_grace_interval = 60;
111 static int thermal_poll_interval = 30;
115 static bool read_config_param = FALSE;
118 static bool isFeatureEnabled =
TRUE;
122 static volatile int cur_Thermal_Value =0;
124 static uint32_t cur_Cpu_Speed = 0;
127 static uint32_t PLAT_CPU_SPEED_NORMAL = 0;
128 static uint32_t PLAT_CPU_SPEED_SCALED = 0;
129 static uint32_t PLAT_CPU_SPEED_MINIMAL = 0;
132 static pthread_t thermalThreadId = NULL;
135 #define MAX_THERMAL_RFC 16
136 static char valueBuf[MAX_THERMAL_RFC];
142 static void *_PollThermalLevels(
void *);
146 void initializeThermalProtection();
150 static IARM_Result_t _GetThermalState(
void *arg);
154 static IARM_Result_t _SetTemperatureThresholds(
void *arg);
158 static IARM_Result_t _GetTemperatureThresholds(
void *arg);
162 static IARM_Result_t _SetOvertempGraceInterval(
void *arg);
166 static IARM_Result_t _GetOvertempGraceInterval(
void *arg);
170 static bool read_ConfigProps();
174 static bool updateRFCStatus();
181 static bool isThermalProtectionEnabled()
183 if (!read_config_param)
185 if (updateRFCStatus())
190 read_config_param=
TRUE;
193 return isFeatureEnabled;
196 void initializeThermalProtection()
198 if (isThermalProtectionEnabled())
206 LOG(
"[%s] Thermal Monitor [REBOOT] Enabled: %s\n", __FUNCTION__, (thermal_reboot_grace_interval > 0) ?
"TRUE" :
"FALSE");
207 if (thermal_reboot_grace_interval > 0) {
208 LOG(
"[%s] Thermal Monitor [REBOOT] Thresholds -- Critical:%d Concern:%d Safe:%d Grace Interval:%d\n", __FUNCTION__,
209 thermal_reboot_critical_threshold, thermal_reboot_concern_threshold, thermal_reboot_safe_threshold, thermal_reboot_grace_interval);
212 LOG(
"[%s] Thermal Monitor [DEEP SLEEP] Enabled: %s\n", __FUNCTION__, (thermal_deepsleep_grace_interval > 0) ?
"TRUE" :
"FALSE");
213 if (thermal_deepsleep_grace_interval > 0) {
214 LOG(
"[%s] Thermal Monitor [DEEP SLEEP] Thresholds -- Critical:%d Concern:%d Safe:%d Grace Interval:%d\n", __FUNCTION__,
215 thermal_deepsleep_critical_threshold, thermal_deepsleep_concern_threshold, thermal_deepsleep_safe_threshold, thermal_deepsleep_grace_interval);
218 #ifndef DISABLE_DECLOCKING_LOGIC
219 LOG(
"[%s] Thermal Monitor [DECLOCK] Enabled: %s\n", __FUNCTION__, (thermal_declock_grace_interval > 0) ?
"TRUE" :
"FALSE");
220 if (thermal_declock_grace_interval > 0) {
221 LOG(
"[%s] Thermal Monitor [DECLOCK] Thresholds -- Critical:%d Concern:%d Safe:%d Grace Interval:%d\n", __FUNCTION__,
222 thermal_declock_critical_threshold, thermal_declock_concern_threshold, thermal_declock_safe_threshold, thermal_declock_grace_interval);
223 PLAT_API_GetClockSpeed(&cur_Cpu_Speed);
224 LOG(
"[%s] Thermal Monitor [DECLOCK] Default Frequency %d\n", __FUNCTION__, cur_Cpu_Speed);
226 PLAT_API_DetemineClockSpeeds(
227 (PLAT_CPU_SPEED_NORMAL == 0 ) ? &PLAT_CPU_SPEED_NORMAL : NULL,
228 (PLAT_CPU_SPEED_SCALED == 0 ) ? &PLAT_CPU_SPEED_SCALED : NULL,
229 (PLAT_CPU_SPEED_MINIMAL == 0 ) ? &PLAT_CPU_SPEED_MINIMAL : NULL);
230 LOG(
"[%s] Thermal Monitor [DECLOCK] Frequencies -- Normal:%d Scaled:%d Minimal:%d\n", __FUNCTION__, PLAT_CPU_SPEED_NORMAL, PLAT_CPU_SPEED_SCALED, PLAT_CPU_SPEED_MINIMAL);
231 if (PLAT_CPU_SPEED_NORMAL == 0 || PLAT_CPU_SPEED_SCALED == 0 || PLAT_CPU_SPEED_MINIMAL == 0) {
232 LOG(
"[%s] Thermal Monitor [DECLOCK] **ERROR** At least one clock speed is 0. Disabling declocking!\n", __FUNCTION__);
233 thermal_declock_grace_interval = 0;
238 if(!PLAT_API_SetTempThresholds(thermal_declock_concern_threshold, thermal_declock_critical_threshold))
240 LOG(
"*****Critical*** Fails to set temperature thresholds.. \n");
243 if (pthread_create(&thermalThreadId, NULL, _PollThermalLevels, NULL))
245 LOG(
"*****Critical*** Fails to Create temperature monitor thread \n");
250 LOG(
"[%s] Thermal protection is disabled from RFC \n",__FUNCTION__);
254 static void logThermalShutdownReason()
257 int cmdSize = strlen(THERMAL_SHUTDOWN_REASON) + strlen(STANDBY_REASON_FILE) + 10;
258 char logCommand[cmdSize]= {
'0'};
259 snprintf(logCommand,cmdSize,
"echo %s > %s",THERMAL_SHUTDOWN_REASON, STANDBY_REASON_FILE);
263 static void rebootIfNeeded()
267 static struct timeval monitorTime;
268 static bool rebootZone =
false;
270 if (thermal_reboot_grace_interval == 0) {
275 if (cur_Thermal_Value >= thermal_reboot_critical_threshold)
277 LOG(
"[%s] Rebooting is being forced!\n", __FUNCTION__);
278 system(
"/rebootNow.sh -s Power_Thermmgr -o 'Rebooting the box due to stb temperature greater than thermal_reboot_critical_threshold...'");
280 else if (!rebootZone && cur_Thermal_Value >= thermal_reboot_concern_threshold)
282 LOG(
"[%s] Temperature threshold crossed (%d) ENTERING reboot zone\n", __FUNCTION__, cur_Thermal_Value );
283 gettimeofday(&monitorTime, NULL);
286 else if (rebootZone && cur_Thermal_Value < thermal_reboot_safe_threshold) {
287 LOG(
"[%s] Temperature threshold crossed (%d) EXITING reboot zone\n", __FUNCTION__, cur_Thermal_Value );
293 gettimeofday(&tv, NULL);
294 difftime = tv.tv_sec - monitorTime.tv_sec;
296 if (difftime >= thermal_reboot_grace_interval)
298 LOG(
"[%s] - Rebooting since the temperature is still above critical level after %d seconds !! : \n",
299 __FUNCTION__,thermal_reboot_grace_interval);
300 system(
"/rebootNow.sh -s Power_Thermmgr -o 'Rebooting the box as the stb temperature is still above critical level after 20 seconds...'");
303 LOG(
"[%s] Still in the reboot zone! Will go for reboot in %u seconds unless the temperature falls below %u!\n", __FUNCTION__, thermal_reboot_grace_interval-difftime, thermal_reboot_safe_threshold );
309 static void deepSleepIfNeeded()
313 static struct timeval monitorTime;
314 static bool deepSleepZone =
false;
316 if (thermal_deepsleep_grace_interval == 0) {
321 if (cur_Thermal_Value >= thermal_deepsleep_critical_threshold)
323 logThermalShutdownReason();
324 LOG(
"[%s] Going to deepsleep since the temperature is above %d\n", __FUNCTION__, thermal_deepsleep_critical_threshold);
325 system(
"/lib/rdk/alertSystem.sh pwrMgrMain \"Going to deepsleep due to temperature runaway\"");
326 system(
"/SetPowerState DEEPSLEEP");
328 else if (!deepSleepZone && cur_Thermal_Value >= thermal_deepsleep_concern_threshold)
330 LOG(
"[%s] Temperature threshold crossed (%d) ENTERING deepsleep zone\n", __FUNCTION__, cur_Thermal_Value );
331 gettimeofday(&monitorTime, NULL);
332 deepSleepZone =
true;
334 else if (deepSleepZone && cur_Thermal_Value < thermal_deepsleep_safe_threshold) {
335 LOG(
"[%s] Temperature threshold crossed (%d) EXITING deepsleep zone\n", __FUNCTION__, cur_Thermal_Value );
336 deepSleepZone =
false;
341 gettimeofday(&tv, NULL);
342 difftime = tv.tv_sec - monitorTime.tv_sec;
344 if (difftime >= thermal_deepsleep_grace_interval)
346 logThermalShutdownReason();
347 LOG(
"[%s] Going to deepsleep since the temperature reached %d and stayed above %d for %d seconds\n",
348 __FUNCTION__, thermal_deepsleep_concern_threshold, thermal_deepsleep_safe_threshold, thermal_deepsleep_grace_interval);
349 system(
"/lib/rdk/alertSystem.sh pwrMgrMain \"Going to deepsleep due to over temperature\"");
350 system(
"/SetPowerState DEEPSLEEP");
353 LOG(
"[%s] Still in the deep sleep zone! Entering deep sleep in %u seconds unless the temperature falls below %u!\n", __FUNCTION__, thermal_deepsleep_grace_interval-difftime, thermal_deepsleep_safe_threshold );
359 static void declockIfNeeded()
361 #ifndef DISABLE_DECLOCKING_LOGIC
364 static struct timeval monitorTime;
366 if (thermal_declock_grace_interval == 0) {
371 if (cur_Thermal_Value >= thermal_declock_critical_threshold)
373 if (cur_Cpu_Speed != PLAT_CPU_SPEED_MINIMAL) {
374 LOG(
"[%s] - Temperature threshold crossed (%d) !!!! Switching to minimal mode !!\n",
375 __FUNCTION__, cur_Thermal_Value);
376 PLAT_API_SetClockSpeed(PLAT_CPU_SPEED_MINIMAL);
377 cur_Cpu_Speed = PLAT_CPU_SPEED_MINIMAL;
380 gettimeofday(&monitorTime, NULL);
382 else if (cur_Thermal_Value >= thermal_declock_concern_threshold)
384 if (cur_Cpu_Speed == PLAT_CPU_SPEED_NORMAL) {
386 LOG(
"[%s] - CPU Scaling threshold crossed (%d) !!!! Switching to scaled mode (%d) from normal mode(%d) !!\n",
387 __FUNCTION__,cur_Thermal_Value,PLAT_CPU_SPEED_SCALED,PLAT_CPU_SPEED_NORMAL );
388 PLAT_API_SetClockSpeed(PLAT_CPU_SPEED_SCALED);
389 cur_Cpu_Speed = PLAT_CPU_SPEED_SCALED;
391 gettimeofday(&monitorTime, NULL);
393 else if (cur_Thermal_Value > thermal_declock_safe_threshold)
396 if (cur_Cpu_Speed == PLAT_CPU_SPEED_MINIMAL) {
398 gettimeofday(&tv, NULL);
399 difftime = tv.tv_sec - monitorTime.tv_sec;
401 if (difftime >= thermal_declock_grace_interval)
403 LOG(
"[%s] - CPU Scaling threshold crossed (%d) !!!! Switching to scaled mode (%d) from minimal mode(%d) !!\n",
404 __FUNCTION__,cur_Thermal_Value,PLAT_CPU_SPEED_SCALED,PLAT_CPU_SPEED_MINIMAL );
405 PLAT_API_SetClockSpeed(PLAT_CPU_SPEED_SCALED);
406 cur_Cpu_Speed = PLAT_CPU_SPEED_SCALED;
407 gettimeofday(&monitorTime, NULL);
412 gettimeofday(&monitorTime, NULL);
417 if (cur_Cpu_Speed != PLAT_CPU_SPEED_NORMAL) {
419 gettimeofday(&tv, NULL);
420 difftime = tv.tv_sec - monitorTime.tv_sec;
422 if (difftime >= thermal_declock_grace_interval)
424 LOG(
"[%s] - CPU rescaling threshold crossed (%d) !!!! Switching to normal mode !!\n",
425 __FUNCTION__,cur_Thermal_Value );
426 PLAT_API_SetClockSpeed(PLAT_CPU_SPEED_NORMAL);
427 cur_Cpu_Speed = PLAT_CPU_SPEED_NORMAL;
437 static void *_PollThermalLevels(
void *)
440 float current_Temp = 0;
441 float current_WifiTemp = 0;
443 unsigned int pollCount = 0;
444 int thermalLogInterval = 300/thermal_poll_interval;
447 int fifteenMinInterval = 900/thermal_poll_interval;
450 LOG(
"Entering [%s] - [%s] - Start monitoring temeperature every %d seconds log interval: %d\n",
455 int result = PLAT_API_GetTemperature(&state, ¤t_Temp, ¤t_WifiTemp);
458 if(cur_Thermal_Level != state)
460 LOG(
"[%s] - Temeperature level changed %d -> %d : \n", __FUNCTION__,cur_Thermal_Level,state );
463 _eventData.data.therm.curLevel = cur_Thermal_Level;
464 _eventData.data.therm.newLevel = state;
465 _eventData.data.therm.curTemperature = current_Temp;
470 cur_Thermal_Level = state;
473 if(0 == (pollCount % fifteenMinInterval))
475 LOG(
"[%s] - CURRENT_CPU_SCALE_MODE:%s \n", __FUNCTION__,
476 (cur_Cpu_Speed == PLAT_CPU_SPEED_NORMAL)?
"Normal":
477 ((cur_Cpu_Speed == PLAT_CPU_SPEED_SCALED)?
"Scaled":
"Minimal"));
480 if (0 == pollCount % thermalLogInterval)
482 LOG(
"[%s] - Current Temperature %d\n", __FUNCTION__, (
int)current_Temp );
484 cur_Thermal_Value = (int)current_Temp;
497 LOG(
"Warning [%s] - Failed to retrieve temperature from OEM\n", __FUNCTION__);
499 sleep(thermal_poll_interval);
504 static IARM_Result_t _GetThermalState(
void *arg)
506 IARM_Result_t retCode = IARM_RESULT_SUCCESS;
508 LOG(
"[PwrMgr] thermal state is queried: \n");
511 IARM_Bus_PWRMgr_GetThermalState_Param_t *param = (IARM_Bus_PWRMgr_GetThermalState_Param_t *)arg;
512 param->curLevel = cur_Thermal_Level;
513 param->curTemperature = cur_Thermal_Value;
514 LOG(
"[PwrMgr] thermal state is queried: returning %d \n", cur_Thermal_Value);
518 retCode = IARM_RESULT_INVALID_PARAM;
523 static IARM_Result_t _GetTemperatureThresholds(
void *arg)
525 IARM_Result_t retCode = IARM_RESULT_IPCCORE_FAIL;
530 IARM_Bus_PWRMgr_GetTempThresholds_Param_t * param = (IARM_Bus_PWRMgr_GetTempThresholds_Param_t *) arg;
531 float high, critical;
532 result = PLAT_API_GetTempThresholds(&high,&critical);
535 retCode = IARM_RESULT_SUCCESS;
536 param->tempHigh = high;
537 param->tempCritical = critical;
538 LOG(
"[PwrMgr] Current thermal threshold : %f , %f \n", param->tempHigh,param->tempCritical);
543 retCode = IARM_RESULT_INVALID_PARAM;
548 static IARM_Result_t _SetTemperatureThresholds(
void *arg)
550 IARM_Result_t retCode = IARM_RESULT_SUCCESS;
554 IARM_Bus_PWRMgr_SetTempThresholds_Param_t * param = (IARM_Bus_PWRMgr_SetTempThresholds_Param_t *) arg;
555 LOG(
"[PwrMgr] Setting thermal threshold : %f , %f \n", param->tempHigh,param->tempCritical);
556 result = PLAT_API_SetTempThresholds(param->tempHigh,param->tempCritical);
557 retCode = result?IARM_RESULT_SUCCESS:IARM_RESULT_IPCCORE_FAIL;
561 retCode = IARM_RESULT_INVALID_PARAM;
567 static IARM_Result_t _GetOvertempGraceInterval(
void *arg)
569 IARM_Result_t retCode = IARM_RESULT_SUCCESS;
573 IARM_Bus_PWRMgr_GetOvertempGraceInterval_Param_t * param = (IARM_Bus_PWRMgr_GetOvertempGraceInterval_Param_t *) arg;
575 param->graceInterval = thermal_reboot_grace_interval;
576 retCode = IARM_RESULT_SUCCESS;
577 LOG(
"[PwrMgr] Current over temparature grace interval : %d\n", param->graceInterval);
582 retCode = IARM_RESULT_INVALID_PARAM;
587 static IARM_Result_t _SetOvertempGraceInterval(
void *arg)
589 IARM_Result_t retCode = IARM_RESULT_SUCCESS;
592 IARM_Bus_PWRMgr_SetOvertempGraceInterval_Param_t * param = (IARM_Bus_PWRMgr_SetOvertempGraceInterval_Param_t *) arg;
593 if(param->graceInterval >= 0 )
595 LOG(
"[PwrMgr] Setting over temparature grace interval : %d\n", param->graceInterval);
596 thermal_reboot_grace_interval = param->graceInterval;
597 thermal_deepsleep_grace_interval = param->graceInterval;
598 retCode = IARM_RESULT_SUCCESS;
602 retCode = IARM_RESULT_INVALID_PARAM;
607 retCode = IARM_RESULT_INVALID_PARAM;
612 static bool updateRFCStatus()
615 RFC_ParamData_t param;
617 isFeatureEnabled =
TRUE;
619 WDMP_STATUS status = getRFCParameter(THERMAL_PROTECTION_GROUP,
"RFC_ENABLE_ThermalProtection", ¶m);
621 if (status == WDMP_SUCCESS)
623 LOG(
"[%s:%d] Key: RFC_ENABLE_ThermalProtection,Value %s \n", __FUNCTION__, __LINE__, param.value);
624 if (0 == strncasecmp(param.value,
"false",5))
626 isFeatureEnabled = FALSE;
635 LOG(
"[%s:%d] Key: RFC_ENABLE_ThermalProtection is not configured, Status %d \n", __FUNCTION__, __LINE__, status);
641 static char * read_ConfigProperty(
const char* key)
645 RFC_ParamData_t param;
648 WDMP_STATUS status = getRFCParameter(THERMAL_PROTECTION_GROUP, key, ¶m);
652 if (status == WDMP_SUCCESS)
654 dataLen = strlen(param.value);
655 if (dataLen > MAX_THERMAL_RFC-1)
657 dataLen = MAX_THERMAL_RFC-1;
660 if ( (param.value[0] ==
'"') && (param.value[dataLen-1] ==
'"'))
663 strncpy (valueBuf, ¶m.value[1], dataLen-2);
664 valueBuf[dataLen-2] =
'\0';
668 strncpy (valueBuf, param.value, MAX_THERMAL_RFC-1);
669 valueBuf[MAX_THERMAL_RFC-1] =
'\0';
672 LOG(
"name = %s, type = %d, value = %s, status = %d\n", param.name, param.type, param.value, status);
676 LOG(
"[%s:%d] Key: property %s is not configured, Status %d \n", __FUNCTION__, __LINE__, key, status);
686 LOG(
"[%s:%d] Unable to find key %s in group %s \n", __FUNCTION__, __LINE__, key, THERMAL_PROTECTION_GROUP);
692 static bool read_ConfigProps()
697 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_REBOOT_CRITICAL_THRESHOLD");
700 thermal_reboot_critical_threshold = atoi(value);
703 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_REBOOT_CONCERN_THRESHOLD");
706 thermal_reboot_concern_threshold = atoi(value);
709 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_REBOOT_SAFE_THRESHOLD");
712 thermal_reboot_safe_threshold = atoi(value);
715 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_REBOOT_GRACE_INTERVAL");
718 thermal_reboot_grace_interval = atoi(value);
722 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_DECLOCK_CRITICAL_THRESHOLD");
725 thermal_declock_critical_threshold = atoi(value);
728 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_DECLOCK_CONCERN_THRESHOLD");
731 thermal_declock_concern_threshold = atoi(value);
734 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_DECLOCK_SAFE_THRESHOLD");
737 thermal_declock_safe_threshold = atoi(value);
740 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_DECLOCK_GRACE_INTERVAL");
743 thermal_declock_grace_interval = atoi(value);
746 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_DEEPSLEEP_CRITICAL_THRESHOLD");
749 thermal_deepsleep_critical_threshold =atoi(value);
752 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_DEEPSLEEP_CONCERN_THRESHOLD");
755 thermal_deepsleep_concern_threshold = atoi(value);
758 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_DEEPSLEEP_SAFE_THRESHOLD");
761 thermal_deepsleep_safe_threshold = atoi(value);
764 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_DEEPSLEEP_GRACE_INTERVAL");
767 thermal_deepsleep_grace_interval = atoi(value);
771 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_POLL_INTERVAL");
774 thermal_poll_interval = atoi(value);
777 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_PLAT_CPU_SPEED_NORMAL");
780 PLAT_CPU_SPEED_NORMAL =atoi(value);
783 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_PLAT_CPU_SPEED_SCALED");
786 PLAT_CPU_SPEED_SCALED =atoi(value);
789 value = read_ConfigProperty(
"RFC_DATA_ThermalProtection_PLAT_CPU_SPEED_MINIMAL");
792 PLAT_CPU_SPEED_MINIMAL =atoi(value);
798 #endif//ENABLE_THERMAL_PROTECTION