Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48283 )
Change subject: lib/cbfs.c: Update the ro bootdevice in CBMEM init in romstage ......................................................................
lib/cbfs.c: Update the ro bootdevice in CBMEM init in romstage
Use the cbmem mcache in romstage when cbmem is online.
Change-Id: I8d05c38ad0a1dc4b275efc71b0db8b8a7e7c27ec Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/lib/cbfs.c 1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/48283/1
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 5df1d8b..646f912 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -439,9 +439,10 @@ return err; }
+static struct cbfs_boot_device ro; + const struct cbfs_boot_device *cbfs_get_boot_device(bool force_ro) { - static struct cbfs_boot_device ro;
/* Ensure we always init RO mcache, even if first file is from RW. Otherwise it may not be available when needed in later stages. */ @@ -485,12 +486,16 @@
size_t real_size = cbfs_mcache_real_size(cbd->mcache, cbd->mcache_size); void *cbmem_mcache = cbmem_add(cbmem_id, real_size); + printk(BIOS_DEBUG, "CBMEM_MCACHE 0x%08lx\n", (uintptr_t)cbmem_mcache); if (!cbmem_mcache) { printk(BIOS_ERR, "ERROR: Cannot allocate CBMEM mcache %#x (%#zx bytes)!\n", cbmem_id, real_size); return; } memcpy(cbmem_mcache, cbd->mcache, real_size); + + ro.mcache = cbmem_mcache; + ro.mcache_size = real_size; }
static void cbfs_mcache_migrate(int unused)