@@ -32,15 +32,51 @@
#include <asm/arch/pinmux.h>
#include <asm/arch/sromc.h>
#include <pmic.h>
+#include <tmu.h>
+#include <asm/arch/exynos-tmu.h>
+#include <asm/arch/power.h>
DECLARE_GLOBAL_DATA_PTR;
+/*
+ * 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
+}
+
int board_init(void)
{
gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
#if defined(CONFIG_PMIC)
pmic_init();
#endif
+
+#if defined CONFIG_EXYNOS_TMU
+ if (tmu_init(gd->fdt_blob)) {
+ debug("%s: Failed to init TMU\n", __func__);
+ return -1;
+ }
+#endif
+
#ifdef CONFIG_EXYNOS_SPI
spi_init();
#endif