mb/google/bluey: Check for battery presence in off-mode charging

Verify that a battery is actually present before setting the boot
mode to LB_BOOT_MODE_OFFMODE_CHARGING. This prevents the system
from incorrectly entering a charging state when running on AC power
without a battery connected.

TEST=Build and boot on bluey with and without battery present.
Verify boot mode transitions correctly.

Change-Id: I67098bc06b34c25429daf516f3891c50930209fe
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91290
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
Subrata Banik 2026-02-17 00:33:35 +05:30
commit 968c60c0d9

View file

@ -40,7 +40,7 @@ static enum boot_mode_t set_boot_mode(void)
enum boot_mode_t boot_mode_new;
if (is_off_mode()) {
if (is_off_mode() && google_chromeec_is_battery_present()) {
boot_mode_new = LB_BOOT_MODE_OFFMODE_CHARGING;
} else if (google_chromeec_is_below_critical_threshold()) {
if (google_chromeec_is_charger_present())