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 <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91598
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
Subrata Banik 2026-03-08 09:02:16 +00:00
commit b7ca29ba92

View file

@ -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);
}