[coreboot-gerrit] New patch to review for coreboot: soc/intel/common/mrc_cache: Do not hardcode location of MRC cache

Alexandru Gagniuc (alexandrux.gagniuc@intel.com) gerrit at coreboot.org
Tue May 10 18:24:41 CEST 2016


Alexandru Gagniuc (alexandrux.gagniuc at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14758

-gerrit

commit 8b5d1ede1cc2abae53e7ddf25b6216bdb9b82a95
Author: Alexandru Gagniuc <alexandrux.gagniuc at intel.com>
Date:   Tue Apr 12 14:59:40 2016 -0700

    soc/intel/common/mrc_cache: Do not hardcode location of MRC cache
    
    We can't assume top 4G mapping of the boot media, and thus we can't
    pass hard-coded values for the base address of the MRC cache region.
    Instead, we need to use the CBFS APIs, which do the necessarry address
    translation, depending on the platform.
    The old approach would fail on Apollolake, as it would provide the
    wrong base address. Whith this change CBFS-based MRC cache works as
    expected on Apollolake.
    
    Change-Id: If79461c792fe7b0a14b364790f9d937a8f387129
    Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc at intel.com>
---
 src/soc/intel/common/mrc_cache.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/soc/intel/common/mrc_cache.c b/src/soc/intel/common/mrc_cache.c
index 4ad4158..e6ef961 100644
--- a/src/soc/intel/common/mrc_cache.c
+++ b/src/soc/intel/common/mrc_cache.c
@@ -16,6 +16,7 @@
 #include <string.h>
 #include <bootstate.h>
 #include <console/console.h>
+#include <cbfs.h>
 #include <cbmem.h>
 #include <fmap.h>
 #include <ip_checksum.h>
@@ -35,6 +36,7 @@ struct mrc_data_region {
 /* common code */
 static int mrc_cache_get_region(struct mrc_data_region *region)
 {
+	size_t size;
 	bool located_by_fmap = true;
 	struct region_device rdev;
 
@@ -52,8 +54,10 @@ static int mrc_cache_get_region(struct mrc_data_region *region)
 		if (region->base == NULL)
 			return -1;
 	} else {
-		region->base = (void *)CONFIG_MRC_SETTINGS_CACHE_BASE;
-		region->size = CONFIG_MRC_SETTINGS_CACHE_SIZE;
+		region->base = cbfs_boot_map_with_leak("mrc.cache",
+						       CBFS_TYPE_MRC_CACHE,
+						       &size);
+		region->size = size;
 	}
 
 	return 0;



More information about the coreboot-gerrit mailing list