From b7ca29ba92873deae2c21614214c763909dc3a32 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Sun, 8 Mar 2026 09:02:16 +0000 Subject: [PATCH] mb/google/bluey: Power off if charger applet fails to enable charging When the charger applet times out waiting for charging to enable, the previous behavior was to simply return. This caused a boot hang because the system would attempt to continue mainboard initialization without properly initialized IPs or sufficient power. Update the timeout handler to trigger a system power-off via google_chromeec_ap_poweroff(). This ensures the device enters a clean G3 state if charging cannot be established, preventing a partial-boot hang and unnecessary power drain. BUG=none BRANCH=none TEST=Verified on Bluey that a charging timeout results in a clean power-off instead of a system hang. Change-Id: Iae00e6df39e9d78cd5d27770b871ff2e8c4c9b7c Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91598 Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal --- src/mainboard/google/bluey/charging.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/bluey/charging.c b/src/mainboard/google/bluey/charging.c index f81d5b9650..f6f1c9f376 100644 --- a/src/mainboard/google/bluey/charging.c +++ b/src/mainboard/google/bluey/charging.c @@ -101,7 +101,14 @@ void launch_charger_applet(void) if (stopwatch_expired(&sw)) { printk(BIOS_WARNING, "Charging not enabled %ld ms. Abort.\n", charging_enable_timeout_ms); - return; + /* + * If firmware-based charging fails to enable within the timeout, + * do not simply return, as this leaves IPs uninitialized and + * causes a boot hang. Instead, issue a shutdown if not charging. + */ + printk(BIOS_INFO, "Issuing power-off.\n"); + google_chromeec_offmode_heartbeat(); + google_chromeec_ap_poweroff(); } mdelay(200); }