diff --git a/src/mainboard/google/bluey/mainboard.c b/src/mainboard/google/bluey/mainboard.c index 1ff845c541..6d2f705a41 100644 --- a/src/mainboard/google/bluey/mainboard.c +++ b/src/mainboard/google/bluey/mainboard.c @@ -1,14 +1,32 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include #include +#include #include #include #include #include #include "board.h" +void lb_add_boot_mode(struct lb_header *header) +{ + if (!CONFIG(EC_GOOGLE_CHROMEEC)) + return; + + struct lb_boot_mode *mode = (struct lb_boot_mode *)lb_new_record(header); + memset(mode, 0, sizeof(*mode)); + + mode->tag = LB_TAG_BOOT_MODE; + mode->size = sizeof(*mode); + mode->boot_mode = LB_BOOT_MODE_NORMAL; + + if (google_chromeec_is_below_critical_threshold()) + mode->boot_mode = LB_BOOT_MODE_LOW_BATTERY; +} + bool mainboard_needs_pcie_init(void) { return true;