Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84538?usp=email )
Change subject: soc/intel: Support interface-independent FSP reset status ......................................................................
soc/intel: Support interface-independent FSP reset status
The FSP reset status handling in coreboot was previously limited to 32-bit interfaces, causing incompatibility with newer 64-bit platforms using FSP 2.4. This change refactors the reset handler to support both 32-bit and 64-bit interfaces without requiring SoC-specific global reset status values.
Instead of relying on specific status codes, which vary between FSP versions and interfaces, the reset handler now directly triggers a global reset when a platform-specific reset with the global reset GUID is detected. This simplifies the logic and eliminates the need for SoC-specific configuration.
Key changes:
- Define an enum for FSP reset status values using macros from vendorcode/edk2 to avoid redundant definitions. - Introduce `is_fsp_reset_status_valid()` to validate the reset status received from FSP. - Update `chipset_handle_reset()` to use the new helper function. - Modify `fsp_get_pch_reset_status()` to directly trigger a global reset upon detecting a platform-specific reset with the global reset GUID.
This approach deprecates the `FSP_STATUS_GLOBAL_RESET` and `FSP_STATUS_GLOBAL_RESET_REQUIRED_X` Kconfigs, simplifying global reset handling across different platforms.
BUG=b:347669091 TEST=Verified FSP requested global reset functionality on google/rex0 (32-bit) and google/rex64 (64-bit) platforms.
w/ 32-bit FSP:
``` (Wdt) AllowKnownReset [FspResetSystem2] FSP Reset Initiated FSP returning control to Bootloader with reset required return status 40000003 FSPS, status=0x40000003 FSP: handling reset type, status=0x40000003 GLOBAL RESET! global_reset() called! HECI: Global Reset(Type:1) Command ```
w/ 64-bit FSP:
``` (Wdt) AllowKnownReset [FspResetSystem2] FSP Reset Initiated FSP returning control to Bootloader with reset required return status 3 FSPS, status=0x4000000000000003 FSP: handling reset type, status=0x4000000000000003 GLOBAL RESET! global_reset() called! HECI: Global Reset(Type:1) Command ```
Change-Id: I8bcdd6d82c66318757032913c002aa67e6301ae6 Signed-off-by: Subrata Banik subratabanik@google.com --- M src/soc/intel/common/fsp_reset.c 1 file changed, 29 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/84538/1
diff --git a/src/soc/intel/common/fsp_reset.c b/src/soc/intel/common/fsp_reset.c index 2626c39..42281f4 100644 --- a/src/soc/intel/common/fsp_reset.c +++ b/src/soc/intel/common/fsp_reset.c @@ -6,6 +6,18 @@ #include <soc/intel/common/reset.h> #include <stdint.h>
+enum { + FSP_RESET_REQUIRED_COLD = FSP_STATUS_RESET_REQUIRED_COLD, + FSP_RESET_REQUIRED_WARM = FSP_STATUS_RESET_REQUIRED_WARM, + FSP_RESET_REQUIRED_3 = FSP_STATUS_RESET_REQUIRED_3, + FSP_RESET_REQUIRED_4 = FSP_STATUS_RESET_REQUIRED_4, + FSP_RESET_REQUIRED_5 = FSP_STATUS_RESET_REQUIRED_5, + FSP_RESET_REQUIRED_6 = FSP_STATUS_RESET_REQUIRED_6, + FSP_RESET_REQUIRED_7 = FSP_STATUS_RESET_REQUIRED_7, + FSP_RESET_REQUIRED_8 = FSP_STATUS_RESET_REQUIRED_8, + FSP_RESET_MAX, +}; + static const uint8_t fsp_reset_guid[16] = { 0xff, 0x97, 0x05, 0xea, 0x58, 0x88, 0xca, 0x41, 0xbb, 0xc1, 0xfe, 0x18, 0xfc, 0xd2, 0x8e, 0x22 @@ -30,9 +42,20 @@ struct pch_reset_data reset_data; };
+static bool is_fsp_reset_status_valid(efi_return_status_t status) +{ + for (efi_return_status_t reset_status = FSP_RESET_REQUIRED_3; reset_status < FSP_RESET_MAX; + reset_status++) { + if (status == reset_status) + return true; + } + + return false; +} + void chipset_handle_reset(efi_return_status_t status) { - if (status == CONFIG_FSP_STATUS_GLOBAL_RESET) { + if (is_fsp_reset_status_valid(status)) { printk(BIOS_DEBUG, "GLOBAL RESET!\n"); global_reset(); } @@ -77,8 +100,11 @@
if ((hob->reset_type == EfiResetPlatformSpecific) && fsp_guid_compare((void *)&(hob->reset_data.global_reset_uid), - fsp_global_reset_guid)) - return CONFIG_FSP_STATUS_GLOBAL_RESET; + fsp_global_reset_guid)) { + printk(BIOS_DEBUG, "GLOBAL RESET!\n"); + global_reset(); + return -1; /* Control shouldn't return here */ + }
return fsp_reset_type_to_status(hob->reset_type); }