/* * Polling various devices on board for details and status monitoring purposes */ void board_poll_devices(void) { #if defined CONFIG_EXYNOS_TMU int temp; switch (tmu_monitor(&temp)) { case TMU_STATUS_TRIPPED: puts("EXYNOS_TMU: TRIPPING! Device power going down ...\n"); power_shutdown(); break; case TMU_STATUS_WARNING: puts("EXYNOS_TMU: WARNING! Temperature very high\n"); break; case TMU_STATUS_INIT: case TMU_STATUS_NORMAL: break; default: debug("Unknown TMU state\n"); } #endif /* CONFIG_EXYNOS_TMU */ #ifdef CONFIG_EXYNOS_CPUFREQ cpufreq_loop_count++; if (cpufreq_loop_count == 10000000) { /* User is idle, decrease ARM frequency*/ exynos5250_set_frequency(CPU_FREQ_L200); } #endif /* CONFIG_EXYNOS_CPUFREQ */ }
/* Boot Time Thermal Analysis for SoC temperature threshold breach */ static void boot_temp_check(void) { int temp; switch (tmu_monitor(&temp)) { case TMU_STATUS_NORMAL: break; case TMU_STATUS_TRIPPED: /* * Status TRIPPED ans WARNING means corresponding threshold * breach */ puts("EXYNOS_TMU: TRIPPING! Device power going down ...\n"); set_ps_hold_ctrl(); hang(); break; case TMU_STATUS_WARNING: puts("EXYNOS_TMU: WARNING! Temperature very high\n"); break; case TMU_STATUS_INIT: /* * TMU_STATUS_INIT means something is wrong with temperature * sensing and TMU status was changed back from NORMAL to INIT. */ puts("EXYNOS_TMU: WARNING! Temperature sensing not done\n"); break; default: debug("EXYNOS_TMU: Unknown TMU state\n"); } }
int dtt_tmu(void) { #if defined CONFIG_TMU_CMD_DTT int cur_temp; /* Sense and return latest thermal info */ if (tmu_monitor(&cur_temp) == TMU_STATUS_INIT) { puts("TMU is in unknown state, temperature is invalid\n"); return -1; } printf("Current temperature: %u degrees Celsius\n", cur_temp); #endif return 0; }
int do_tmu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int cur_temp; if (argc < 2) return CMD_RET_USAGE; if (strcmp(argv[1], "curtemp") == 0) { if (tmu_monitor(&cur_temp) == -1) printf("tmu is in unknow state, temp is invalid\n"); else printf("Current Temp: %u degrees Celsius\n", cur_temp); } else { return CMD_RET_USAGE; } return 0; }