Martin Roth (martinroth@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11269
-gerrit
commit 246777ed4498cdff37d1275c1a01b896939fca5e Author: Martin Roth martinroth@google.com Date: Tue Aug 18 15:48:44 2015 -0600
broadwell/raminit.c: Only use MRC functions when available
Put a guard on the calls to mrc_cache_get_current and mrc_cache_stash_data so they only get called when they're getting built into the binary.
These calls are in soc/intel/common/cache.c which gets included by the makefile with the lines: romstage-$(CONFIG_CACHE_MRC_SETTINGS) += mrc_cache.c ramstage-$(CONFIG_CACHE_MRC_SETTINGS) += mrc_cache.c
Change-Id: Ia0a446e70bac4b292fef7f8b3fcea09992a4e397 Signed-off-by: Martin Roth martinroth@google.com --- src/soc/intel/broadwell/romstage/raminit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/soc/intel/broadwell/romstage/raminit.c b/src/soc/intel/broadwell/romstage/raminit.c index 82c88cb..ea14e2b 100644 --- a/src/soc/intel/broadwell/romstage/raminit.c +++ b/src/soc/intel/broadwell/romstage/raminit.c @@ -55,7 +55,8 @@ void raminit(struct pei_data *pei_data) if (recovery_mode_enabled()) { /* Recovery mode does not use MRC cache */ printk(BIOS_DEBUG, "Recovery mode: not using MRC cache.\n"); - } else if (!mrc_cache_get_current(&cache)) { + } else if ((IS_ENABLED(CONFIG_CACHE_MRC_SETTINGS)) && + (!mrc_cache_get_current(&cache))) { /* MRC cache found */ pei_data->saved_data_size = cache->size; pei_data->saved_data = &cache->data[0]; @@ -121,7 +122,9 @@ void raminit(struct pei_data *pei_data) printk(BIOS_DEBUG, "MRC data at %p %d bytes\n", pei_data->data_to_save, pei_data->data_to_save_size);
- if (pei_data->data_to_save != NULL && pei_data->data_to_save_size > 0) + if ((IS_ENABLED(CONFIG_CACHE_MRC_SETTINGS)) && + (pei_data->data_to_save != NULL && + pei_data->data_to_save_size > 0)) mrc_cache_stash_data(pei_data->data_to_save, pei_data->data_to_save_size);