diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index 6cb2558f3a..9864c2b5d4 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -458,6 +458,8 @@ struct cb_panel_poweroff { enum boot_mode_t { /* Regular boot scenarios */ CB_BOOT_MODE_NORMAL, + /* Device is booting in low-batter w/o charger attached */ + CB_BOOT_MODE_LOW_BATTERY, /* Device is booting in low-batter w/ charger attached */ CB_BOOT_MODE_LOW_BATTERY_CHARGING, /* Device is booting in due to charger insertion */ diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h index d4582559df..cb16e65c5c 100644 --- a/src/commonlib/include/commonlib/coreboot_tables.h +++ b/src/commonlib/include/commonlib/coreboot_tables.h @@ -641,6 +641,8 @@ struct lb_panel_poweroff { enum boot_mode_t { /* Regular boot scenarios */ LB_BOOT_MODE_NORMAL, + /* Device is booting in low-batter w/o charger attached */ + LB_BOOT_MODE_LOW_BATTERY, /* Device is booting in low-batter w/ charger attached */ LB_BOOT_MODE_LOW_BATTERY_CHARGING, /* Device is booting in due to charger insertion */ diff --git a/src/mainboard/google/bluey/romstage.c b/src/mainboard/google/bluey/romstage.c index c25704f077..12b1479801 100644 --- a/src/mainboard/google/bluey/romstage.c +++ b/src/mainboard/google/bluey/romstage.c @@ -36,12 +36,19 @@ static enum boot_mode_t set_boot_mode(void) if (!CONFIG(EC_GOOGLE_CHROMEEC)) return boot_mode; - enum boot_mode_t boot_mode_new = LB_BOOT_MODE_NORMAL; - if (is_off_mode()) + enum boot_mode_t boot_mode_new; + + if (is_off_mode()) { boot_mode_new = LB_BOOT_MODE_OFFMODE_CHARGING; - else if (google_chromeec_is_below_critical_threshold() && - google_chromeec_is_charger_present()) - boot_mode_new = LB_BOOT_MODE_LOW_BATTERY_CHARGING; + } else if (google_chromeec_is_below_critical_threshold()) { + if (google_chromeec_is_charger_present()) + boot_mode_new = LB_BOOT_MODE_LOW_BATTERY_CHARGING; + else + boot_mode_new = LB_BOOT_MODE_LOW_BATTERY; + } else { + boot_mode_new = LB_BOOT_MODE_NORMAL; + } + boot_mode = boot_mode_new; return boot_mode_new; }