From 24782bc4fb22c1bbe08fd458abac637adcc60788 Mon Sep 17 00:00:00 2001 From: Puthikorn Voravootivat Date: Fri, 21 Sep 2018 16:25:24 -0700 Subject: CHERRY-PICK: nocturne: Enable CONFIG_THROTTLE_AP We need thermal profile to make the surface temperature cool. BUG=b:115924459, b:112550414 BRANCH=firmware-nocturne-10984.B TEST=Cool device down, verify that once temp sensor crosses threshold, cpu frequencies lower. TEST=Verify cpu frequencies when device cools down. Signed-off-by: Puthikorn Voravootivat Reviewed-on: https://chromium-review.googlesource.com/1239628 Reviewed-by: Aseda Aboagye Reviewed-by: Duncan Laurie Change-Id: I2f1235c134cfaf0e235b1642aab0adde0303a242 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2157062 Tested-by: Patryk Duda Commit-Queue: Patryk Duda --- board/nocturne/board.c | 16 ++++++++++++++++ board/nocturne/board.h | 2 ++ 2 files changed, 18 insertions(+) (limited to 'board/nocturne') diff --git a/board/nocturne/board.c b/board/nocturne/board.c index d03ac39822..066a55eb8a 100644 --- a/board/nocturne/board.c +++ b/board/nocturne/board.c @@ -638,6 +638,22 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); +/* + * Thermal limits for each temp sensor. All temps are in degrees K. Must be in + * same order as enum temp_sensor_id. To always ignore any temp, use 0. + */ +struct ec_thermal_config thermal_params[] = { + /* {Twarn, Thigh, Thalt}, fan_off, fan_max */ + {{0, 0, 0}, {0, 0, 0}, 0, 0}, /* Battery */ + {{0, 0, 0}, {0, 0, 0}, 0, 0}, /* Ambient */ + {{0, 0, 0}, {0, 0, 0}, 0, 0}, /* Charger */ + {{0, C_TO_K(52), 0}, {0, 0, 0}, 0, 0}, /* DRAM */ + {{0, 0, 0}, {0, 0, 0}, 0, 0}, /* eMMC */ + {{0, 0, 0}, {0, 0, 0}, 0, 0} /* Gyro */ +}; +BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); + + /* * Check if PMIC fault registers indicate VR fault. If yes, print out fault * register info to console. Additionally, set panic reason so that the OS can diff --git a/board/nocturne/board.h b/board/nocturne/board.h index 868dde09ad..7e728b492a 100644 --- a/board/nocturne/board.h +++ b/board/nocturne/board.h @@ -40,6 +40,7 @@ #define CONFIG_I2C_MASTER #define CONFIG_LOW_POWER_IDLE #define CONFIG_PWM +#define CONFIG_THROTTLE_AP #define CONFIG_VBOOT_HASH #define CONFIG_VSTORE #define CONFIG_VSTORE_SLOT_COUNT 1 @@ -113,6 +114,7 @@ /* SoC */ #define CONFIG_BOARD_HAS_RTC_RESET +#define CONFIG_CHIPSET_CAN_THROTTLE #define CONFIG_CHIPSET_SKYLAKE #define CONFIG_CHIPSET_HAS_PLATFORM_PMIC_RESET #define CONFIG_CHIPSET_RESET_HOOK -- cgit v1.2.1