summaryrefslogtreecommitdiff
path: root/src/include/cbmem.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-08-19 16:20:40 -0700
committerJulius Werner <jwerner@chromium.org>2016-08-27 01:16:34 +0200
commit3c814b2e2b8e053da352f4746a4914fb43af09d7 (patch)
treebf8d6840ae09fa89eb3e5e164046bfa90d7eee3d /src/include/cbmem.h
parentf975e55dcdbeb31e39449d22a9c04ff861dae8dd (diff)
downloadcoreboot-3c814b2e2b8e053da352f4746a4914fb43af09d7.tar.xz
cbmem: Always maintain backing store struct in a global on non-x86
The current CBMEM code contains an optimization that maintains the structure with information about the CBMEM backing store in a global variable, so that we don't have to recover it from cbmem_top() again every single time we access CBMEM. However, due to the problems with using globals in x86 romstage, this optimization has only been enabled in ramstage. However, all non-x86 platforms are SRAM-based (at least for now) and can use globals perfectly fine in earlier stages. Therefore, this patch extends the optimization on those platforms to all stages. This also allows us to remove the requirement that cbmem_top() needs to return NULL before its backing store has been initialized from those boards, since the CBMEM code can now keep track of whether it has been initialized by itself. Change-Id: Ia6c1db00ae01dee485d5e96e4315cb399dc63696 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/16273 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include/cbmem.h')
-rw-r--r--src/include/cbmem.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/include/cbmem.h b/src/include/cbmem.h
index 5b75db0342..6a41ec7615 100644
--- a/src/include/cbmem.h
+++ b/src/include/cbmem.h
@@ -67,9 +67,8 @@ void cbmem_initialize_empty_id_size(u32 id, u64 size);
/* Return the top address for dynamic cbmem. The address returned needs to
* be consistent across romstage and ramstage, and it is required to be
* below 4GiB.
- * Board or chipset should return NULL if any interface that might rely on cbmem
- * (e.g. cbfs, vboot) is used before the cbmem backing store has been
- * initialized. */
+ * x86 boards or chipsets must return NULL before the cbmem backing store has
+ * been initialized. */
void *cbmem_top(void);
/* Add a cbmem entry of a given size and id. These return NULL on failure. The