summaryrefslogtreecommitdiff
path: root/src/lib/fmap.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-11-18 13:01:06 -0800
committerPatrick Georgi <pgeorgi@google.com>2019-11-19 11:26:21 +0000
commit7fc928656e791064c46a4748f86466930bdf2de6 (patch)
treea201d9efaf2a33e9a71709698ac7db0d47b92fc5 /src/lib/fmap.c
parentceb7e68c48eafbfa9b735842159e01e8d2123a93 (diff)
downloadcoreboot-7fc928656e791064c46a4748f86466930bdf2de6.tar.xz
lib/fmap: Disable pre-RAM cache for FSP 1.0
Due to the way CAR teardown is handled in FSP 1.0, the results of car_get_var_ptr() aren't always reliable, which can break things when running with FMAP cache. It might be possible to fix this but would make the code rather complicated, so let's just disable the feature on these platforms and hope they die out soon. Also allow this option to be used by platforms that don't have space for the cache and want to save a little more code. Change-Id: I7ffb1b8b08a7ca3fe8d53dc827e2c8521da064c7 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36937 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/lib/fmap.c')
-rw-r--r--src/lib/fmap.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/fmap.c b/src/lib/fmap.c
index 4b4179c769..48aab8f3d5 100644
--- a/src/lib/fmap.c
+++ b/src/lib/fmap.c
@@ -60,6 +60,9 @@ static void report(const struct fmap *fmap)
static void setup_preram_cache(struct mem_region_device *cache_mrdev)
{
+ if (CONFIG(NO_FMAP_CACHE))
+ return;
+
if (!ENV_ROMSTAGE_OR_BEFORE) {
/* We get here if ramstage makes an FMAP access before calling
cbmem_initialize(). We should avoid letting it come to that,
@@ -70,10 +73,10 @@ static void setup_preram_cache(struct mem_region_device *cache_mrdev)
}
if (REGION_SIZE(fmap_cache) == 0) {
- /* If you see this you really want to add an FMAP_CACHE to your
- memlayout, unless you absolutely can't affort the 2K. */
- print_once(BIOS_NOTICE,
- "NOTE: Running without FMAP_CACHE, should add it!\n");
+ /* If you see this you should add FMAP_CACHE() to your memlayout
+ (or select NO_FMAP_CACHE if you can't afford the 2K). */
+ print_once(BIOS_ERR,
+ "ERROR: FMAP_CACHE enabled but no region provided!\n");
return;
}