Attention is currently required from: Andrey Petrov.
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74784 )
Change subject: drivers/intel/fsp2_0: Apply FSP Reset Status W/A for MultiPhaseSiInit
......................................................................
drivers/intel/fsp2_0: Apply FSP Reset Status W/A for MultiPhaseSiInit
This patch calls into fsp_get_pch_reset_status() to get the
MultiPhaseSiInit API return status if
FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN is enabled.
Ideally FSP API should be able to return the status (both success and
error code) upon exiting the FSP API but unfortunately there are some
scenarios in ADL/RPL FSP where MultiPhaseSiInit API is unable to return
any ERROR status. Hence, this function can be considered as an
additional hook to read the FSP reset status by reading the dedicated
HOB without relying on the FSP API exit status code.
Any SoC platform that selects the FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN
config will call into this newly added API to get the FSP return status
from MultiPhaseSiInit.
BUG=b:278665768
TEST=Able to select FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN for ADL/RPL SoC
code and call into this API to know the return status from
MultiPhaseSiInit FSP API.
Signed-off-by: Subrata Banik <subratabanik(a)google.com>
Change-Id: I749c9986e17e4cbab333b29425c9a4a4ba4128fa
---
M src/drivers/intel/fsp2_0/silicon_init.c
1 file changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/74784/1
diff --git a/src/drivers/intel/fsp2_0/silicon_init.c b/src/drivers/intel/fsp2_0/silicon_init.c
index 678892a..9505e1d 100644
--- a/src/drivers/intel/fsp2_0/silicon_init.c
+++ b/src/drivers/intel/fsp2_0/silicon_init.c
@@ -10,6 +10,7 @@
#include <fsp/api.h>
#include <fsp/util.h>
#include <program_loading.h>
+#include <soc/intel/common/reset.h>
#include <soc/intel/common/vbt.h>
#include <stage_cache.h>
#include <string.h>
@@ -194,6 +195,8 @@
multi_phase_params.phase_index = i;
multi_phase_params.multi_phase_param_ptr = NULL;
status = multi_phase_si_init(&multi_phase_params);
+ if (CONFIG(FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN))
+ status = fsp_get_pch_reset_status();
fsps_return_value_handler(FSP_MULTI_PHASE_SI_INIT_EXECUTE_PHASE_API, status);
}
timestamp_add_now(TS_FSP_MULTI_PHASE_SI_INIT_END);
--
To view, visit https://review.coreboot.org/c/coreboot/+/74784
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I749c9986e17e4cbab333b29425c9a4a4ba4128fa
Gerrit-Change-Number: 74784
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Attention: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-MessageType: newchange
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74783 )
Change subject: soc/intel/common: Introduce API to get the FSP Reset Status
......................................................................
soc/intel/common: Introduce API to get the FSP Reset Status
This patch creates a function to read the FSP API Reset Status. This
function relies on the FSP Scheduled Reset HOB which holds the reset
type (warm/cold/shutdown) information along with any platform specific
reset need (like global reset).
Ideally FSP API should be able to return the status (both success and
error code) upon exiting the FSP API but unfortunately there are some
scenarios in ADL/RPL FSP where MultiPhaseSiInit API is unable to return
any ERROR status. Hence, this function provides an additional hook to
read the FSP reset status by reading the dedicated HOB without relying
on the FSP API exit status code.
Any SoC platform that selects the `FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN`
config will call into this newly added API to get the FSP return status
from MultiPhaseSiInit.
BUG=b:278665768
TEST=Able to select FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN for ADL/RPL SoC
code and call into this API to know the return status from
MultiPhaseSiInit FSP API.
Signed-off-by: Subrata Banik <subratabanik(a)google.com>
Change-Id: Ief5d79736cc11a0a31ca2889128285795f8b5aae
---
M src/soc/intel/common/fsp_reset.c
M src/soc/intel/common/reset.h
2 files changed, 92 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/74783/1
diff --git a/src/soc/intel/common/fsp_reset.c b/src/soc/intel/common/fsp_reset.c
index bf265515..d6319f0 100644
--- a/src/soc/intel/common/fsp_reset.c
+++ b/src/soc/intel/common/fsp_reset.c
@@ -1,10 +1,35 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <console/console.h>
+#include <fsp/api.h>
#include <fsp/util.h>
#include <soc/intel/common/reset.h>
#include <stdint.h>
+static const uint8_t fsp_reset_guid[16] = {
+ 0xff, 0x97, 0x05, 0xea, 0x58, 0x88, 0xca, 0x41,
+ 0xbb, 0xc1, 0xfe, 0x18, 0xfc, 0xd2, 0x8e, 0x22
+};
+
+static const uint8_t fsp_global_reset_guid[16] = {
+ 0x4c, 0x1b, 0xb3, 0x9d, 0xef, 0xf5, 0xbb, 0x48,
+ 0x94, 0x2b, 0x18, 0x1f, 0x7e, 0x3a, 0x3e, 0x40
+};
+
+/* Platform Reset String as per Intel FSP is "PCH RESET" in unicode */
+#define PLATFORM_RESET_STRING_LENGTH 20
+
+struct pch_reset_data {
+ char reserved[PLATFORM_RESET_STRING_LENGTH];
+ efi_guid_t global_reset_uid;
+};
+
+/* This structure is used to provide information about PCH Reset */
+struct fsp_reset_hob {
+ EFI_RESET_TYPE reset_type;
+ struct pch_reset_data reset_data;
+};
+
void chipset_handle_reset(uint32_t status)
{
if (status == CONFIG_FSP_STATUS_GLOBAL_RESET) {
@@ -15,3 +40,29 @@
printk(BIOS_ERR, "unhandled reset type %x\n", status);
die("unknown reset type");
}
+
+/*
+ * Return PCH Reset Status
+ * The return status can be between EfiResetCold, EfiResetWarm, EfiResetShutdown
+ * or EfiResetPlatformSpecific.
+ *
+ * If reset type if `EfiResetPlatformSpecific` then relying on pch_reset_data structure
+ * to know if th reset type is a global reset.
+ */
+uint32_t fsp_get_pch_reset_status(void)
+{
+ if (!CONFIG(FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN))
+ return 0;
+
+ size_t size = 0;
+ const struct fsp_reset_hob *hob = fsp_find_extension_hob_by_guid(fsp_reset_guid, &size);
+ if (!hob)
+ return 0;
+
+ 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;
+
+ return hob->reset_type;
+}
diff --git a/src/soc/intel/common/reset.h b/src/soc/intel/common/reset.h
index e1f6aab..df541c8 100644
--- a/src/soc/intel/common/reset.h
+++ b/src/soc/intel/common/reset.h
@@ -13,4 +13,14 @@
/* Prepare for reset, run do_global_reset(), halt. */
__noreturn void global_reset(void);
+/*
+ * Return PCH Reset Status
+ * The return status can be between EfiResetCold, EfiResetWarm, EfiResetShutdown
+ * or EfiResetPlatformSpecific.
+ *
+ * If reset type if `EfiResetPlatformSpecific` then relying on pch_reset_data structure
+ * to know if th reset type is a global reset.
+ */
+uint32_t fsp_get_pch_reset_status(void);
+
#endif /* _INTEL_COMMON_RESET_H_ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/74783
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ief5d79736cc11a0a31ca2889128285795f8b5aae
Gerrit-Change-Number: 74783
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subratabanik(a)google.com>
Gerrit-MessageType: newchange
Attention is currently required from: Andrey Petrov.
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74782 )
Change subject: drivers/intel/fsp2_0: Create config option to handle broken FSP API
......................................................................
drivers/intel/fsp2_0: Create config option to handle broken FSP API
This patch applies a workaround to fix an issue where FSP
MultiPhaseSIInit API is unable to return the ERROR status to the
bootloader upon exiting. As a result, it affects the platform stability
where silicon reference code is expecting a reset (warm/cold/global) to
complete the chipset initialization process but unfortunately as
bootloader is unable to understand the return status in proper, it
failed to take required action to meet the silicon reference code
requirement.
This patch is the base code which just adds the config option to allow
the target SoC platform to apply this W/A if the problem existed inside
the FSP MultiPhaseSiInit.
At present the problem has only been reported with Alder Lake and
Raptor Lake FSP where MultiPhaseSiInit API is unable to return any
ERROR status.
ADL/RPL FSP is already in the post PV phase where the ETA to fix
problems properly inside the FSP is not known. Additionally, MTL FSP
doesn't exhibit this problem hence, most likely this solution is only
for ADL/RPL SoC based platform.
BUG=b:278665768
TEST=No functional impact as this patch just added the config option.
Signed-off-by: Subrata Banik <subratabanik(a)google.com>
Change-Id: I3b15ef5b50fe1fe73bf9ad0aa4be90aae07ebf73
---
M src/drivers/intel/fsp2_0/Kconfig
1 file changed, 48 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/74782/1
diff --git a/src/drivers/intel/fsp2_0/Kconfig b/src/drivers/intel/fsp2_0/Kconfig
index 2132737..378f4fb 100644
--- a/src/drivers/intel/fsp2_0/Kconfig
+++ b/src/drivers/intel/fsp2_0/Kconfig
@@ -389,4 +389,17 @@
Save MRC training data after FSP-S. Select this on platforms that generate MRC
cache HOB data as part of FSP-S rather than FSP-M.
+config FSP_MULTIPHASE_SI_INIT_RETURN_BROKEN
+ bool
+ default n
+ depends on PLATFORM_USES_FSP2_2
+ help
+ Select this config for Intel SoC platform where FSP MultiPhaseSiInit API is unable
+ to return ERROR status properly.
+
+ The config option will be selected based on the target SoC platform and if the
+ problem existed inside the FSP MultiPhaseSiInit. At present the problem has only
+ reported with Alder Lake and Raptor Lake FSP where MultiPhaseSiInit API is unable
+ to return any ERROR status.
+
endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/74782
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3b15ef5b50fe1fe73bf9ad0aa4be90aae07ebf73
Gerrit-Change-Number: 74782
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Attention: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-MessageType: newchange