From 444691603df5cb6a925072daa475b6b2a66a9da6 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 19 Mar 2026 19:04:52 +0000 Subject: [PATCH] mb/google/bluey: Support RTC wake-up boot mode Implement the logic to detect, set, and handle RTC wake-up events on the Bluey mainboard. Key changes: - romstage: Use the new google_chromeec_is_rtc_event() API to set the boot mode to LB_BOOT_MODE_RTC_WAKE when an RTC alarm triggers the boot. - mainboard: Update is_low_power_boot_with_charger() to include RTC_WAKE, ensuring the system follows the low-power initialization path (e.g., entering the charging applet). - mainboard: Update display_startup() to skip display initialization during an RTC wake event to conserve power and maintain a "dark" wake-up state where appropriate. BUG=b:493760057 BRANCH=none TEST=Set an RTC alarm via the EC, verify the system boots into the charging applet path and skips display initialization on Bluey. Change-Id: Iaa9d1acffa0da014775e3397b877178c9c820ad5 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91765 Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) --- src/mainboard/google/bluey/mainboard.c | 6 ++++-- src/mainboard/google/bluey/romstage.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mainboard/google/bluey/mainboard.c b/src/mainboard/google/bluey/mainboard.c index 8b3fb9d6b6..1b9b9955a2 100644 --- a/src/mainboard/google/bluey/mainboard.c +++ b/src/mainboard/google/bluey/mainboard.c @@ -70,7 +70,8 @@ static bool is_low_power_boot_with_charger(void) bool ret = false; enum boot_mode_t boot_mode = get_boot_mode(); if ((boot_mode == LB_BOOT_MODE_LOW_BATTERY_CHARGING) || - (boot_mode == LB_BOOT_MODE_OFFMODE_CHARGING)) + (boot_mode == LB_BOOT_MODE_OFFMODE_CHARGING) || + (boot_mode == LB_BOOT_MODE_RTC_WAKE)) ret = true; return ret; @@ -155,7 +156,8 @@ bool mainboard_needs_pcie_init(void) static void display_startup(void) { - if (!display_init_required() || (CONFIG(VBOOT_LID_SWITCH) && !get_lid_switch())) { + if ((get_boot_mode() == LB_BOOT_MODE_RTC_WAKE) || !display_init_required() || + (CONFIG(VBOOT_LID_SWITCH) && !get_lid_switch())) { printk(BIOS_INFO, "Skipping display init.\n"); return; } diff --git a/src/mainboard/google/bluey/romstage.c b/src/mainboard/google/bluey/romstage.c index 042e69b9f0..8fe088e350 100644 --- a/src/mainboard/google/bluey/romstage.c +++ b/src/mainboard/google/bluey/romstage.c @@ -41,7 +41,9 @@ static enum boot_mode_t set_boot_mode(void) enum boot_mode_t boot_mode_new; - if (is_off_mode() && google_chromeec_is_battery_present()) { + if (google_chromeec_is_rtc_event()) { + boot_mode_new = LB_BOOT_MODE_RTC_WAKE; + } else 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())