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 a04e9a8b34f329271f915675b8c303c1e150b8de 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 | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/src/northbridge/intel/sandybridge/mrccache.c b/src/northbridge/intel/sandybridge/mrccache.c index b8120a8..7ea0a5b 100644 --- a/src/northbridge/intel/sandybridge/mrccache.c +++ b/src/northbridge/intel/sandybridge/mrccache.c @@ -66,16 +66,30 @@ 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; + + *mrc_region_ptr = NULL; + file = cbfs_get_file(CBFS_DEFAULT_MEDIA, + "mrc.cache"); + + if (file == NULL) { + printk(BIOS_ERR, "Could not find file '%s'.\n", "mrc.cache"); + return 0; + }
- return region_size; + if (ntohl(file->type) != 0xac) { + printk(BIOS_ERR, + "File '%s' is of type %x, but we requested %x.\n", + "mrc.cache", + ntohl(file->type), 0xac); + return 0; + } + *mrc_region_ptr = (void *)CBFS_SUBHEADER(file); + return ntohl(file->len); +#endif }
/*