lib/cbfs: Disable cbfs_preload in romstage when VBOOT_STARTS_IN_ROMSTAGE

Preloading files before vboot runs and using them after vboot has
finished will result in the wrong files getting used. Disable
cbfs_preload to avoid this behavior.

BUG=b:179699789
TEST=none

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I7698b481a73fb24eecf4c810ff8be8b6826528ca
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59876
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index d2a4b84..5bbbe6a 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -307,6 +307,10 @@
 	if (!CONFIG(CBFS_PRELOAD))
 		dead_code();
 
+	/* We don't want to cross the vboot boundary */
+	if (ENV_ROMSTAGE && CONFIG(VBOOT_STARTS_IN_ROMSTAGE))
+		return;
+
 	DEBUG("%s(name='%s')\n", __func__, name);
 
 	if (_cbfs_boot_lookup(name, force_ro, &mdata, &rdev))