From 7f6e43851eb8efda31818bf313ece47e1436f483 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Mon, 7 Apr 2025 17:43:08 +0530 Subject: [PATCH] mb/google/fatcat: Perform early post-memory GPIO configuration This commit restructures the GPIO configuration for google/fatcat devices as below. - Phase 1: GPIO configuration at pre-memory phase. This phase configures essential GPIOs like WWAN and storage power sequencing, This aligns with the initial power-up requirements of these critical components. - Phase 2: This phase handles GPIO configurations for various peripherals like storage type, audio codec, WiFi, cellular interface (post initial power sequence), SD card slot, touchpad, touchscreen, ISH, PEG/x4 slot wake disable, and fingerprint enable/disable based early in post-memory phase (before MPInit). This phased approach: - Improves power sequencing by ordering GPIO configuration for proper IP power enablement. - Optimizes boot time by performing more GPIO configuration before MPInit and FSP-S, allowing earlier IP stabilization and potentially saving ~20ms during device setup and PCIe scan. `baseboard_devtree_update` remains in `mainboard_init` for baseboard- specific device tree updates. TEST=Boot time improved by ~20ms on google/fatcat. Before: 70:device setup done 1,339,599 (95,023) After: 70:device setup done 1,319,613 (72,381) Change-Id: I9c2e58ae012cad06f8e498c75745efaa9bad4a25 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/87191 Reviewed-by: Kapil Porwal Reviewed-by: Dinesh Gehlot Tested-by: build bot (Jenkins) Reviewed-by: Jayvik Desai Reviewed-by: Wonkyu Kim --- src/mainboard/google/fatcat/mainboard.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/fatcat/mainboard.c b/src/mainboard/google/fatcat/mainboard.c index e14c5ace79..5bd9892480 100644 --- a/src/mainboard/google/fatcat/mainboard.c +++ b/src/mainboard/google/fatcat/mainboard.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,12 @@ void __weak variant_update_soc_chip_config(struct soc_intel_pantherlake_config * } static void mainboard_init(void *chip_info) +{ + baseboard_devtree_update(); +} + +/* Must happen before MPinit */ +static void mainboard_early(void *unused) { struct pad_config *padbased_table; const struct pad_config *base_pads; @@ -37,9 +44,10 @@ static void mainboard_init(void *chip_info) fw_config_gpio_padbased_override(padbased_table); gpio_configure_pads_with_padbased(padbased_table); free(padbased_table); - baseboard_devtree_update(); } +BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_EXIT, mainboard_early, NULL); + void __weak baseboard_devtree_update(void) { /* Override dev tree settings per baseboard */