diff options
author | Rob Barnes <robbarnes@google.com> | 2021-11-08 06:43:07 -0700 |
---|---|---|
committer | Paul Fagerburg <pfagerburg@chromium.org> | 2021-11-13 00:19:52 +0000 |
commit | c30a1fade80f2c64d9ab7c95aab54a2db2fca3a6 (patch) | |
tree | 262ebaccc00819c242b2a0cead48f42bac1e6920 /src | |
parent | 999f9e348789476d1b9befd9ce410f52f841c0ef (diff) |
soc/amd/psp_verstage: Reboot on verstage_soc_early_init fail
Calling reboot_into_recovery with NULL context fails. Initializing ctx
early also fails because the cmos is not ready until after
verstage_soc_early_init. So just reboot and hope for the best.
BUG=None
TEST=Boot guybrush, suspend/resume guybrush
BRANCH=None
Change-Id: I7267a14ab048781b8998d3a6f4220de10e7df250
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59017
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/common/psp_verstage/include/psp_verstage.h | 1 | ||||
-rw-r--r-- | src/soc/amd/common/psp_verstage/psp_verstage.c | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/soc/amd/common/psp_verstage/include/psp_verstage.h b/src/soc/amd/common/psp_verstage/include/psp_verstage.h index 7687ac6da0..f5890d4286 100644 --- a/src/soc/amd/common/psp_verstage/include/psp_verstage.h +++ b/src/soc/amd/common/psp_verstage/include/psp_verstage.h @@ -35,6 +35,7 @@ #define POSTCODE_FMAP_REGION_MISSING 0xC8 #define POSTCODE_AMD_FW_MISSING 0xC9 #define POSTCODE_CMOS_RECOVERY 0xCA +#define POSTCODE_EARLY_INIT_ERROR 0xCB #define POSTCODE_UNMAP_SPI_ROM 0xF0 #define POSTCODE_UNMAP_FCH_DEVICES 0xF1 diff --git a/src/soc/amd/common/psp_verstage/psp_verstage.c b/src/soc/amd/common/psp_verstage/psp_verstage.c index 9f27159d69..3bfa3e9984 100644 --- a/src/soc/amd/common/psp_verstage/psp_verstage.c +++ b/src/soc/amd/common/psp_verstage/psp_verstage.c @@ -224,8 +224,14 @@ void Main(void) svc_write_postcode(POSTCODE_EARLY_INIT); retval = verstage_soc_early_init(); if (retval) { - svc_debug_print("verstage_soc_early_init failed\n"); - reboot_into_recovery(NULL, retval); + /* + * If verstage_soc_early_init fails, cmos is probably not + * accessible, so rebooting into recovery is not an option. + * Just reboot and hope for the best. + */ + svc_write_postcode(POSTCODE_EARLY_INIT_ERROR); + svc_debug_print("verstage_soc_early_init failed! -- rebooting\n"); + vboot_reboot(); } svc_debug_print("calling verstage_mainboard_early_init\n"); |