lib/cbfs: Enable cbfs_cache for x86

The reason cbfs_cache was disabled on x86 was due to the lack of
.data sections in the pre-RAM stages. By using
ENV_STAGE_HAS_DATA_SECTION we enable x86 to start using the cbfs_cache.

We still need to add a cbfs_cache region into the memlayout for it to
be enabled.

BUG=b:179699789
TEST=Build guybrush and verify cbfs_cache.size == 0.

Suggested-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I74434ef9250ff059e7587147b1456aeabbee33aa
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56577
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
Raul E Rangel 2021-10-08 13:10:38 -06:00 committed by Raul Rangel
commit 3d7b984f77
2 changed files with 12 additions and 11 deletions

View file

@ -111,12 +111,7 @@ int cbfs_prog_stage_load(struct prog *prog);
/*
* The shared memory pool for backing mapped CBFS files, and other CBFS allocation needs.
* On x86 platforms, this would only be needed to transparently map compressed files, but it
* would require a permanent CBMEM carveout to be safe to use during S3 resume. Since it's not
* clear whether this feature is necessary or worth the wasted memory, it is currently disabled
* but could be added behind a Kconfig later if desired.
*/
#define CBFS_CACHE_AVAILABLE (!CONFIG(ARCH_X86))
extern struct mem_pool cbfs_cache;
/*