haswell: Fix MRC cache to use CBFS

Place the mrc.cache file at top of CBFS. There is no real requirement
for it to have a fixed location though.

Change-Id: Ibebe848a573b41788c9d84388be8ced68957f367
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/7962
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This commit is contained in:
Kyösti Mälkki 2014-12-27 21:04:53 +02:00
parent 1682b8d97a
commit 2fcf6f1caf
3 changed files with 17 additions and 17 deletions

View File

@ -42,16 +42,6 @@ config CACHE_MRC_SIZE_KB
int int
default 512 default 512
# FIXME: build from rom size
config MRC_CACHE_BASE
hex
default 0xff800000
config MRC_CACHE_LOCATION
hex
depends on !CHROMEOS
default 0x370000
config MRC_CACHE_SIZE config MRC_CACHE_SIZE
hex hex
depends on !CHROMEOS depends on !CHROMEOS

View File

@ -40,3 +40,15 @@ mrc.bin-file := $(call strip_quotes,$(CONFIG_MRC_FILE))
mrc.bin-position := 0xfffa0000 mrc.bin-position := 0xfffa0000
mrc.bin-type := 0xab mrc.bin-type := 0xab
ifneq ($(CONFIG_CHROMEOS),y)
$(obj)/mrc.cache: $(obj)/config.h
dd if=/dev/zero count=1 \
bs=$(shell printf "%d" $(CONFIG_MRC_CACHE_SIZE) ) | \
tr '\000' '\377' > $@
cbfs-files-y += mrc.cache
mrc.cache-file := $(obj)/mrc.cache
mrc.cache-position := 0xfffe0000
mrc.cache-type := 0xac
endif

View File

@ -66,16 +66,14 @@ static int is_mrc_cache(struct mrc_data_container *mrc_cache)
*/ */
static u32 get_mrc_cache_region(struct mrc_data_container **mrc_region_ptr) static u32 get_mrc_cache_region(struct mrc_data_container **mrc_region_ptr)
{ {
u32 region_size;
#if CONFIG_CHROMEOS #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 #else
region_size = CONFIG_MRC_CACHE_SIZE; size_t region_size;
*mrc_region_ptr = (struct mrc_data_container *) *mrc_region_ptr = cbfs_get_file_content(CBFS_DEFAULT_MEDIA,
(CONFIG_MRC_CACHE_BASE + CONFIG_MRC_CACHE_LOCATION); "mrc.cache", 0xac, &region_size);
#endif
return region_size; return region_size;
#endif
} }
/* /*