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>
This commit is contained in:
Subrata Banik 2025-04-07 17:43:08 +05:30
commit 7f6e43851e

View file

@ -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>
@ -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 */