Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17666
-gerrit
commit b23fa1572debad036c109d23ffe736ca4ed8e6c0 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Thu Dec 1 07:03:51 2016 +0200
prog_loaders: Enable stage cache without RELOCATABLE_RAMSTAGE
Change-Id: Ib6729b37c97939a39076f75bbf5d9f0abcb1201d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/lib/Makefile.inc | 4 ++-- src/lib/cbmem_stage_cache.c | 4 ++++ src/lib/prog_loaders.c | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 4157091..962ebff 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -172,8 +172,8 @@ ramstage-y += ext_stage_cache.c romstage-y += ext_stage_cache.c postcar-y += ext_stage_cache.c else -ramstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += cbmem_stage_cache.c -romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += cbmem_stage_cache.c +ramstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem_stage_cache.c +romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem_stage_cache.c endif
diff --git a/src/lib/cbmem_stage_cache.c b/src/lib/cbmem_stage_cache.c index 3fc99db..547c377 100644 --- a/src/lib/cbmem_stage_cache.c +++ b/src/lib/cbmem_stage_cache.c @@ -60,6 +60,10 @@ void stage_cache_load_stage(int stage_id, struct prog *stage) size = cbmem_entry_size(e); load_addr = (void *)(uintptr_t)meta->load_addr;
+ /* Ramstage fills low memory, need to backup OS first.*/ + if (!IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE)) + backup_ramstage_section(meta->load_addr, size); + memcpy(load_addr, c, size);
prog_set_area(stage, load_addr, size); diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index 58c1a8a..525b373 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -134,8 +134,7 @@ void run_ramstage(void) * firmware path on resume. */ if (IS_ENABLED(CONFIG_ARCH_X86) && - !IS_ENABLED(CONFIG_NO_STAGE_CACHE) && - IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)) + !IS_ENABLED(CONFIG_NO_STAGE_CACHE)) run_ramstage_from_resume(&ramstage);
if (prog_locate(&ramstage))