summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chen <ben.chen2@quanta.corp-partner.google.com>2020-09-25 13:17:06 +0800
committerCommit Bot <commit-bot@chromium.org>2020-09-30 13:31:59 +0000
commitc5ec264d26024e0d63550d5aaaa645495fcc5744 (patch)
tree755c9e0cfd25327408e54d5ba383b9532fb1d603
parentaf6b49fa103231ce0b5a535573f67a57a2b42fdd (diff)
downloadchrome-ec-c5ec264d26024e0d63550d5aaaa645495fcc5744.tar.gz
magolor: add thermal table
Add setup_thermal for setting thermal table BUG=b:168353037 BRANCH=master TEST=thermal team verify value on AP Change-Id: I32e009aa8c81a8fbf5a925f009df54c467288e9d Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2428352 Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--board/magolor/board.c25
-rw-r--r--board/magolor/board.h2
2 files changed, 27 insertions, 0 deletions
diff --git a/board/magolor/board.c b/board/magolor/board.c
index 4335141881..c2e510af1b 100644
--- a/board/magolor/board.c
+++ b/board/magolor/board.c
@@ -129,6 +129,28 @@ const struct temp_sensor_t temp_sensors[] = {
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+
+const static struct ec_thermal_config thermal_a = {
+ .temp_host = {
+ [EC_TEMP_THRESH_WARN] = 0,
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(73),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(80),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_WARN] = 0,
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
+ [EC_TEMP_THRESH_HALT] = 0,
+ },
+};
+
+struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT];
+
+static void setup_thermal(void)
+{
+ thermal_params[TEMP_SENSOR_1] = thermal_a;
+ thermal_params[TEMP_SENSOR_2] = thermal_a;
+}
+
void board_init(void)
{
int on;
@@ -141,6 +163,9 @@ void board_init(void)
/* Turn on 5V if the system is on, otherwise turn it off. */
on = chipset_in_state(CHIPSET_STATE_ON | CHIPSET_STATE_ANY_SUSPEND);
board_power_5v_enable(on);
+
+ /* Initialize THERMAL */
+ setup_thermal();
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
diff --git a/board/magolor/board.h b/board/magolor/board.h
index 102b9b37a5..f875e172ac 100644
--- a/board/magolor/board.h
+++ b/board/magolor/board.h
@@ -11,6 +11,7 @@
#define VARIANT_DEDEDE_EC_NPCX796FC
#include "baseboard.h"
+#define CONFIG_USB_PD_DEBUG_LEVEL 2
/* this change saves 1656 bytes of RW flash space */
#define CONFIG_CHIP_INIT_ROM_REGION
@@ -50,6 +51,7 @@
/* Temp sensor */
#define CONFIG_TEMP_SENSOR
+#define CONFIG_THROTTLE_AP
#define CONFIG_THERMISTOR_NCP15WB
#define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B