From b8ed516097bda64f75f9e0e35e25c846bfcdf97c Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 25 Mar 2026 14:08:14 +0530 Subject: [PATCH] mb/google/bluey: Defer display initialization based on boot mode Currently, display_startup() is called unconditionally during mainboard_init(). For normal boot paths, this can lead to unnecessary latency (40ms) issues. Modify the initialization flow to: 1. Initialize display early only for low-battery or off-mode charging paths to ensure the user sees the charging UI. 2. Defer display initialization for all other modes to a new mainboard_late_init() function. 3. Use a static flag (display_init_done) to ensure display_startup() is only executed once regardless of the entry point. TEST=Verified bluey still shows charging animation when low on battery and boots to OS normally. Able to save 40ms of the boot time. Change-Id: Id6bdda90b7f67c13cd7334ba17131a8243af0cdb Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91845 Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) --- src/mainboard/google/bluey/mainboard.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/bluey/mainboard.c b/src/mainboard/google/bluey/mainboard.c index 5bb9ecd21d..20710b1742 100644 --- a/src/mainboard/google/bluey/mainboard.c +++ b/src/mainboard/google/bluey/mainboard.c @@ -220,7 +220,9 @@ static void mainboard_init(void *chip_info) configure_parallel_charging(); configure_debug_access_port(); - display_startup(); + /* Do early display init for low/off-mode charging */ + if (get_boot_mode() != LB_BOOT_MODE_NORMAL) + display_startup(); /* * Low-battery boot indicator is done. Therefore, power off if battery @@ -270,10 +272,13 @@ static void load_qc_se_firmware_late(void) qupv3_se_fw_load_and_init(QUPV3_2_SE2, SE_PROTOCOL_SPI, MIXED); /* Fingerprint SPI */ } -static void mainboard_enable(struct device *dev) +static void mainboard_late_init(struct device *dev) { load_qc_se_firmware_late(); + /* Do late display init in normal boot mode */ + display_startup(); + /* Enable touchpad power */ if (CONFIG_MAINBOARD_GPIO_PIN_FOR_TOUCHPAD_POWER) gpio_output(GPIO_TP_POWER_EN, 1); @@ -289,6 +294,11 @@ static void mainboard_enable(struct device *dev) setup_audio(); } +static void mainboard_enable(struct device *dev) +{ + dev->ops->init = &mainboard_late_init; +} + struct chip_operations mainboard_ops = { .enable_dev = mainboard_enable, .init = mainboard_init,