Aaron Durbin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/43488 )
Change subject: lib: Update fmap cache error for psp_verstage ......................................................................
lib: Update fmap cache error for psp_verstage
The assumption was that the fmap cache would be initialized in bootblock, otherwise an error is shown. This error is showing up in psp_verstage when the fmap cache is initialized there, so create a new ENV value for ENV_INITIAL_STAGE.
BUG=None TEST=Boot, see that error message is gone from psp_verstage
Signed-off-by: Martin Roth martinroth@chromium.org Change-Id: I142f2092ade7b4327780d423d121728bfbdab247 Reviewed-on: https://review.coreboot.org/c/coreboot/+/43488 Reviewed-by: Julius Werner jwerner@chromium.org Reviewed-by: Raul Rangel rrangel@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/include/rules.h M src/lib/fmap.c 2 files changed, 9 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved Raul Rangel: Looks good to me, approved
diff --git a/src/include/rules.h b/src/include/rules.h index be72e9e..39836b1 100644 --- a/src/include/rules.h +++ b/src/include/rules.h @@ -274,6 +274,13 @@ #define ENV_USER_SPACE 0 #endif
+/* Define the first stage to run */ +#if CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK) +#define ENV_INITIAL_STAGE ENV_SEPARATE_VERSTAGE +#else +#define ENV_INITIAL_STAGE ENV_BOOTBLOCK +#endif + /** * For pre-DRAM stages and post-CAR always build with simple device model, ie. * PCI, PNP and CPU functions operate without use of devicetree. The reason diff --git a/src/lib/fmap.c b/src/lib/fmap.c index 671a962..e1e6a57 100644 --- a/src/lib/fmap.c +++ b/src/lib/fmap.c @@ -56,9 +56,8 @@ }
struct fmap *fmap = (struct fmap *)_fmap_cache; - if (!ENV_BOOTBLOCK) { - /* NOTE: This assumes that for all platforms running this code, - the bootblock is the first stage and the bootblock will make + if (!(ENV_INITIAL_STAGE)) { + /* NOTE: This assumes that the first stage will make at least one FMAP access (usually from finding CBFS). */ if (!check_signature(fmap)) goto register_cache;