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 dc09dfab6c7e08e4455e6ce3c1392025d15421a7 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
Also removes stage_cache allocation from CBMEM, if board does not have HAVE_ACPI_RESUME enabled. We have weak stub for stage_cache_add() that does nothing.
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 | 5 +++++ src/lib/prog_loaders.c | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 55d19d0..7ea039d 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..05558af 100644 --- a/src/lib/cbmem_stage_cache.c +++ b/src/lib/cbmem_stage_cache.c @@ -60,6 +60,11 @@ 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) && + (stage_id == STAGE_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))