summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2021-04-13 10:15:25 +0800
committerCommit Bot <commit-bot@chromium.org>2021-04-19 18:29:12 +0000
commitea8e0c634bc9af5dad950f3b30d01330a096268e (patch)
treeb97f9ae705a607aed10abb32167b2a99992824e0
parent6aa3189c89b459996f3f9712202c5527f59ad05b (diff)
downloadchrome-ec-ea8e0c634bc9af5dad950f3b30d01330a096268e.tar.gz
careena: Add thermal protection
This patch adds thermal protection to prevent AP runaway. BUG=b:185082703 BRANCH=firmware-grunt-11031.B TEST=Verify thermal halt/alert as expected. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I4fccc93b0cb89a2e5d2784dfc0a41aa866f691f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2822269 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit 0d11b2f71e40e0147cc1dfc0a53b76758d318c77) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2834496
-rw-r--r--board/careena/board.c17
-rw-r--r--board/careena/board.h5
-rw-r--r--board/careena/gpio.inc2
3 files changed, 23 insertions, 1 deletions
diff --git a/board/careena/board.c b/board/careena/board.c
index 4e601ba532..c8236ea12b 100644
--- a/board/careena/board.c
+++ b/board/careena/board.c
@@ -15,6 +15,7 @@
#include "pwm.h"
#include "pwm_chip.h"
#include "switch.h"
+#include "thermal.h"
#include "gpio_list.h"
@@ -46,6 +47,22 @@ const struct pwm_t pwm_channels[] = {
};
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT] = {
+ [TEMP_SENSOR_SOC] = {
+ .temp_host = {
+ [EC_TEMP_THRESH_WARN] = 0,
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(74),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(79),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_WARN] = 0,
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(71),
+ [EC_TEMP_THRESH_HALT] = 0,
+ },
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+
#ifdef CONFIG_KEYBOARD_FACTORY_TEST
/*
* We have total 24 pins for keyboard connecter, {-1, -1} mean
diff --git a/board/careena/board.h b/board/careena/board.h
index a0fe7ca6ce..f6a47072fe 100644
--- a/board/careena/board.h
+++ b/board/careena/board.h
@@ -26,6 +26,11 @@
#define CONFIG_CMD_LEDTEST
#define CONFIG_KEYBOARD_FACTORY_TEST
+/* Thermal */
+#define CONFIG_CHIPSET_CAN_THROTTLE
+#define CONFIG_CPU_PROCHOT_ACTIVE_LOW
+#define CONFIG_THROTTLE_AP
+
#define CONFIG_BATTERY_MEASURE_IMBALANCE
#define CONFIG_BATTERY_BQ4050
diff --git a/board/careena/gpio.inc b/board/careena/gpio.inc
index eeccf9f50d..c84c81a68e 100644
--- a/board/careena/gpio.inc
+++ b/board/careena/gpio.inc
@@ -38,7 +38,7 @@ GPIO(CCD_MODE_ODL, PIN(E, 3), GPIO_INPUT) /* Case Closed Debug Mode */
GPIO(ENTERING_RW, PIN(E, 1), GPIO_OUT_LOW) /* EC Entering RW */
GPIO(EC_BATT_PRES_L, PIN(E, 5), GPIO_INPUT | GPIO_PULL_UP) /* Battery Present */
GPIO(PCH_SYS_PWROK, PIN(D, 6), GPIO_OUT_LOW) /* Power OK to SOC */
-GPIO(CPU_PROCHOT, PIN(3, 4), GPIO_INPUT | GPIO_SEL_1P8V) /* PROCHOT to SOC */
+GPIO(CPU_PROCHOT, PIN(3, 4), GPIO_ODR_HIGH | GPIO_SEL_1P8V) /* PROCHOT to SOC */
GPIO(APU_ALERT_L, PIN(A, 2), GPIO_INPUT) /* Alert to SOC */
GPIO(3AXIS_INT_L, PIN(5, 0), GPIO_INPUT | GPIO_SEL_1P8V) /* 3 Axis Accel */
GPIO(TCPC_ID, PIN(E, 0), GPIO_INPUT | GPIO_PULL_DOWN) /* TCPC ID pin */