Vladimir Serbinenko (phcoder@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4659
-gerrit
commit fec5757807cbc3cdf8fd34018aee3f4aefd9c1fa Author: Vladimir Serbinenko phcoder@gmail.com Date: Sat Jan 11 07:52:17 2014 +0100
sandybridge/nehalem: Determine mrc.cache size from CBFS rather than hardcoding
The hardcoded value was 0 on X201. There shouldn't be hardcoding at all, hence this patch.
Change-Id: I5b93e5321e470f19ad22ca2cfdb1ebf3b340b252 Signed-off-by: Vladimir Serbinenko phcoder@gmail.com --- src/northbridge/intel/sandybridge/mrccache.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/northbridge/intel/sandybridge/mrccache.c b/src/northbridge/intel/sandybridge/mrccache.c index b8120a8..a37a5ea 100644 --- a/src/northbridge/intel/sandybridge/mrccache.c +++ b/src/northbridge/intel/sandybridge/mrccache.c @@ -66,16 +66,29 @@ static int is_mrc_cache(struct mrc_data_container *mrc_cache) */ static u32 get_mrc_cache_region(struct mrc_data_container **mrc_region_ptr) { - u32 region_size; #if CONFIG_CHROMEOS - region_size = find_fmap_entry("RW_MRC_CACHE", (void **)mrc_region_ptr); + return find_fmap_entry("RW_MRC_CACHE", (void **)mrc_region_ptr); #else - region_size = CONFIG_MRC_CACHE_SIZE; - *mrc_region_ptr = cbfs_get_file_content(CBFS_DEFAULT_MEDIA, - "mrc.cache", 0xac); -#endif + struct cbfs_file *file; + const char *cache_name = "mrc.cache"; + + *mrc_region_ptr = NULL; + file = cbfs_get_file(CBFS_DEFAULT_MEDIA, cache_name); + + if (file == NULL) { + printk(BIOS_ERR, "Could not find file '%s'.\n", cache_name); + return 0; + }
- return region_size; + if (ntohl(file->type) != 0xac) { + printk(BIOS_ERR, + "File '%s' is of type %x, but we requested %x.\n", + cache_name, ntohl(file->type), 0xac); + return 0; + } + *mrc_region_ptr = (void *)CBFS_SUBHEADER(file); + return ntohl(file->len); +#endif }
/*