summaryrefslogtreecommitdiffstats
path: root/src/include/memlayout.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-12-11 17:09:39 -0800
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2020-11-21 10:43:53 +0000
commit1e37c9ca465a14d55adeacb332354771543437b5 (patch)
tree6b38606a32261cb99a4518b925278e97c8f120a6 /src/include/memlayout.h
parent7d11513ab3281ef3bee83b4b523219b683d3ddc1 (diff)
downloadcoreboot-1e37c9ca465a14d55adeacb332354771543437b5.tar.gz
coreboot-1e37c9ca465a14d55adeacb332354771543437b5.tar.bz2
coreboot-1e37c9ca465a14d55adeacb332354771543437b5.zip
cbfs: Add metadata cache
This patch adds a new CBFS "mcache" (metadata cache) -- a memory buffer that stores the headers of all CBFS files. Similar to the existing FMAP cache, this cache should reduce the amount of SPI accesses we need to do every boot: rather than having to re-read all CBFS headers from SPI flash every time we're looking for a file, we can just walk the same list in this in-memory copy and finally use it to directly access the flash at the right position for the file data. This patch adds the code to support the cache but doesn't enable it on any platform. The next one will turn it on by default. Change-Id: I5b1084bfdad1c6ab0ee1b143ed8dd796827f4c65 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38423 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include/memlayout.h')
-rw-r--r--src/include/memlayout.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/memlayout.h b/src/include/memlayout.h
index bd1d6846f086..bf830b7d24f1 100644
--- a/src/include/memlayout.h
+++ b/src/include/memlayout.h
@@ -71,6 +71,9 @@
_ = ASSERT(sz >= FMAP_SIZE, \
STR(FMAP does not fit in FMAP_CACHE! (sz < FMAP_SIZE)));
+#define CBFS_MCACHE(addr, sz) \
+ REGION(cbfs_mcache, addr, sz, 4)
+
#if ENV_ROMSTAGE_OR_BEFORE
#define PRERAM_CBFS_CACHE(addr, size) \
REGION(preram_cbfs_cache, addr, size, 4) \