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 <kapilporwal@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91611 Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
657bd42548
commit
86b3901ba5
1 changed files with 9 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <reset.h>
|
||||
#include <soc/pmic.h>
|
||||
#include <soc/qcom_spmi.h>
|
||||
#include <soc/qcom_tsens.h>
|
||||
#include <timer.h>
|
||||
#include <types.h>
|
||||
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue