summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/metaknight/board.c37
-rw-r--r--board/metaknight/board.h1
2 files changed, 38 insertions, 0 deletions
diff --git a/board/metaknight/board.c b/board/metaknight/board.c
index 6d8a49bd8d..a99499695c 100644
--- a/board/metaknight/board.c
+++ b/board/metaknight/board.c
@@ -222,6 +222,40 @@ 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(70),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(85),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_WARN] = 0,
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
+ [EC_TEMP_THRESH_HALT] = 0,
+ },
+};
+
+const static struct ec_thermal_config thermal_b = {
+ .temp_host = {
+ [EC_TEMP_THRESH_WARN] = 0,
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(75),
+ [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_b;
+}
+
/* Enable HDMI any time the SoC is on */
static void hdmi_enable(void)
{
@@ -670,6 +704,9 @@ void board_init(void)
} else
ccprints("LID_ACCEL is BMA253");
+ /* Initial thermal */
+ setup_thermal();
+
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
diff --git a/board/metaknight/board.h b/board/metaknight/board.h
index 1f7fcdaa98..abbdf906b6 100644
--- a/board/metaknight/board.h
+++ b/board/metaknight/board.h
@@ -46,6 +46,7 @@
/* Temp sensor */
#define CONFIG_TEMP_SENSOR
+#define CONFIG_THROTTLE_AP
#define CONFIG_THERMISTOR_NCP15WB
#define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_PP3300_A