Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/87191?usp=email )
Change subject: mb/google/fatcat: Perform early post-memory GPIO configuration ......................................................................
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 subratabanik@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/87191 Reviewed-by: Kapil Porwal kapilporwal@google.com Reviewed-by: Dinesh Gehlot digehlot@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Jayvik Desai jayvik@google.com Reviewed-by: Wonkyu Kim wonkyu.kim@intel.com --- M src/mainboard/google/fatcat/mainboard.c 1 file changed, 9 insertions(+), 1 deletion(-)
Approvals: Dinesh Gehlot: Looks good to me, approved Wonkyu Kim: Looks good to me, but someone else must approve Jayvik Desai: Looks good to me, approved build bot (Jenkins): Verified Kapil Porwal: Looks good to me, approved
diff --git a/src/mainboard/google/fatcat/mainboard.c b/src/mainboard/google/fatcat/mainboard.c index e14c5ac..5bd9892 100644 --- a/src/mainboard/google/fatcat/mainboard.c +++ b/src/mainboard/google/fatcat/mainboard.c @@ -4,6 +4,7 @@ #include <acpi/acpigen.h> #include <baseboard/gpio.h> #include <baseboard/variants.h> +#include <bootstate.h> #include <device/device.h> #include <ec/ec.h> #include <soc/ramstage.h> @@ -27,6 +28,12 @@
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; size_t base_num; @@ -37,9 +44,10 @@ 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 */