Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74530 )
Change subject: lib: Perform early initialization of FW config in ramstage ......................................................................
lib: Perform early initialization of FW config in ramstage
This patch moves the fw_config_init() function from `BS_DEV_INIT_CHIPS` boot state to its prior state aka `BS_PRE_DEVICE`.
Without this patch the early ramstage code (running from BS_PRE_DEVICE boot state) is unable to probe PCI devices using FW_CONFIG.
For example: below sample code is unable to give the correct state of the UFS PCI device with FW_CONFIG `STORAGE_UFS = 0` at early ramstage function:
device ref ufs on probe STORAGE STORAGE_UFS end
Without this patch: The results is UFS device is enable
With this patch: The results is UFS device is disable
Signed-off-by: Subrata Banik subratabanik@google.com Change-Id: If36e7c7d2edc74a2b7fcc192690af73651e87183 --- M src/lib/fw_config.c 1 file changed, 29 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/74530/1
diff --git a/src/lib/fw_config.c b/src/lib/fw_config.c index e1fbe74..d7d4484 100644 --- a/src/lib/fw_config.c +++ b/src/lib/fw_config.c @@ -175,5 +175,5 @@ cached_configs[probe_index(probe->mask)] = probe; } } -BOOT_STATE_INIT_ENTRY(BS_DEV_INIT_CHIPS, BS_ON_ENTRY, fw_config_init, NULL); +BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, fw_config_init, NULL); #endif