summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarx Wang <marx.wang@intel.corp-partner.google.com>2023-11-10 17:00:23 +0800
committerShelley Chen <shchen@google.com>2023-12-26 17:29:22 +0000
commit708a11c5c72fd76ca5983b856b02c408e1826c5e (patch)
treee132fbfd6ab629643e9f5e1f8585b0b84a245388
parentbf639605aa371c3569002d7d3b870d77e2715220 (diff)
drivers/intel/fsp2_0: Add boot mode strings
The FSP boot mode showing in serial log is a magic number. In order to let user understand its meaning directly, add the strings to describe the modes. TEST=build, boot the device and check the logs: without this change, the log is like: [SPEW ] bootmode is set to: 2 with this change: [SPEW ] bootmode is set to: 2 (boot assuming no config change) Change-Id: I49a409edcde7f6ccb95eafb0b250f86329817cba Signed-off-by: Marx Wang <marx.wang@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78683 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <ericllai@google.com> Reviewed-by: Kapil Porwal <kapilporwal@google.com> Reviewed-by: Subrata Banik <subratabanik@google.com>
-rw-r--r--src/drivers/intel/fsp2_0/memory_init.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c
index d0ddeafeee..f5de5c345d 100644
--- a/src/drivers/intel/fsp2_0/memory_init.c
+++ b/src/drivers/intel/fsp2_0/memory_init.c
@@ -160,6 +160,16 @@ static enum cb_err fsp_fill_common_arch_params(FSPM_ARCH_UPD *arch_upd,
* and are not related to FSP stack at all.
* Non-CAR FSP 2.0 platforms pass a DRAM location for the FSP stack.
*/
+ static const char * const fsp_bootmode_strings[] = {
+ [FSP_BOOT_WITH_FULL_CONFIGURATION] = "boot with full config",
+ [FSP_BOOT_WITH_MINIMAL_CONFIGURATION] = "boot with minimal config",
+ [FSP_BOOT_ASSUMING_NO_CONFIGURATION_CHANGES] = "boot assuming no config change",
+ [FSP_BOOT_ON_S4_RESUME] = "boot on s4 resume",
+ [FSP_BOOT_ON_S3_RESUME] = "boot on s3 resume",
+ [FSP_BOOT_ON_FLASH_UPDATE] = "boot on flash update",
+ [FSP_BOOT_IN_RECOVERY_MODE] = "boot in recovery mode",
+ };
+
if (CONFIG(FSP_USES_CB_STACK) || !ENV_CACHE_AS_RAM) {
arch_upd->StackBase = (uintptr_t)temp_ram;
arch_upd->StackSize = sizeof(temp_ram);
@@ -180,7 +190,12 @@ static enum cb_err fsp_fill_common_arch_params(FSPM_ARCH_UPD *arch_upd,
arch_upd->BootMode = FSP_BOOT_WITH_FULL_CONFIGURATION;
}
- printk(BIOS_SPEW, "bootmode is set to: %d\n", arch_upd->BootMode);
+ if (arch_upd->BootMode < ARRAY_SIZE(fsp_bootmode_strings) &&
+ fsp_bootmode_strings[arch_upd->BootMode] != NULL)
+ printk(BIOS_SPEW, "bootmode is set to: %d (%s)\n", arch_upd->BootMode,
+ fsp_bootmode_strings[arch_upd->BootMode]);
+ else
+ printk(BIOS_SPEW, "bootmode is set to: %d (unknown mode)\n", arch_upd->BootMode);
return CB_SUCCESS;
}