mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-13 05:55:02 -04:00
Exynos5: TMU: Add TMU init and status check
This adds call to tmu_init() and TMU boot time analysis for the SoC temperature threshold breach. Signed-off-by: Akshay Saraswat <akshay.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
parent
618766c098
commit
7e30ad8bf3
@ -37,9 +37,39 @@
|
|||||||
#include <asm/arch/dp_info.h>
|
#include <asm/arch/dp_info.h>
|
||||||
#include <power/pmic.h>
|
#include <power/pmic.h>
|
||||||
#include <power/max77686_pmic.h>
|
#include <power/max77686_pmic.h>
|
||||||
|
#include <tmu.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
#if defined CONFIG_EXYNOS_TMU
|
||||||
|
/*
|
||||||
|
* Boot Time Thermal Analysis for SoC temperature threshold breach
|
||||||
|
*/
|
||||||
|
static void boot_temp_check(void)
|
||||||
|
{
|
||||||
|
int temp;
|
||||||
|
|
||||||
|
switch (tmu_monitor(&temp)) {
|
||||||
|
/* Status TRIPPED ans WARNING means corresponding threshold breach */
|
||||||
|
case TMU_STATUS_TRIPPED:
|
||||||
|
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;
|
||||||
|
/*
|
||||||
|
* TMU_STATUS_INIT means something is wrong with temperature sensing
|
||||||
|
* and TMU status was changed back from NORMAL to INIT.
|
||||||
|
*/
|
||||||
|
case TMU_STATUS_INIT:
|
||||||
|
default:
|
||||||
|
debug("EXYNOS_TMU: Unknown TMU state\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_USB_EHCI_EXYNOS
|
#ifdef CONFIG_USB_EHCI_EXYNOS
|
||||||
int board_usb_vbus_init(void)
|
int board_usb_vbus_init(void)
|
||||||
{
|
{
|
||||||
@ -71,6 +101,15 @@ static void board_enable_audio_codec(void)
|
|||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
|
gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
|
||||||
|
|
||||||
|
#if defined CONFIG_EXYNOS_TMU
|
||||||
|
if (tmu_init(gd->fdt_blob) != TMU_STATUS_NORMAL) {
|
||||||
|
debug("%s: Failed to init TMU\n", __func__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
boot_temp_check();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_EXYNOS_SPI
|
#ifdef CONFIG_EXYNOS_SPI
|
||||||
spi_init();
|
spi_init();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user