From 86b3901ba5034c624b1a4a771adffe272200a293 Mon Sep 17 00:00:00 2001 From: Kapil Porwal Date: Mon, 9 Mar 2026 18:03:59 +0530 Subject: [PATCH] mb/google/bluey: Monitor thermal sensors during charging Integrate thermal monitoring into the low-battery and off-mode charging flow. During battery charging in the ramstage, the system now scans all thermal zones. If any sensor trips its defined threshold, the system executes an emergency power-off to protect the hardware from thermal damage. TEST=Verify all x1p42100 thermal zones are readable on Google/Quartz. TEST=Verify system shutdown on a thermal trip on Google/Quartz. Change-Id: Id45d5f097dfb0c7b01e0541e116f5356f59f8269 Signed-off-by: Kapil Porwal Reviewed-on: https://review.coreboot.org/c/coreboot/+/91611 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/mainboard/google/bluey/charging.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/bluey/charging.c b/src/mainboard/google/bluey/charging.c index 2e0fcb2baf..cb4ecf2855 100644 --- a/src/mainboard/google/bluey/charging.c +++ b/src/mainboard/google/bluey/charging.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -130,6 +131,7 @@ void launch_charger_applet(void) static const long charging_enable_timeout_ms = CHARGING_RAIL_STABILIZATION_DELAY_MS; struct stopwatch sw; + bool has_crossed_threshold = false; printk(BIOS_INFO, "Inside %s. Initiating charging\n", __func__); @@ -187,7 +189,13 @@ void launch_charger_applet(void) do_board_reset(); } - /* TODO: add Tsense support and issue a shutdown in the event of temperature trip */ + /* Issue a shutdown in the event of temperature trip */ + qcom_tsens_monitor_all(&has_crossed_threshold); + if (has_crossed_threshold) { + printk(BIOS_INFO, "Issuing power-off due to temperature trip.\n"); + google_chromeec_offmode_heartbeat(); + google_chromeec_ap_poweroff(); + } } while (true); }