drivers/mrc_cache: only add mrc.cache when CACHE_MRC_SETTINGS is set

In commit decd0628 (drivers/mrc_cache: move mrc_cache support to
drivers) mrc.cache is always added, but CONFIG_MRC_SETTINGS_CACHE_SIZE
is not used in Sandy Bridge, which makes mrc.cache have zero size and
the machine will fail to boot after the first boot.

Change-Id: Iab3ac87e43408ef51f0158f319eb1c8ccfce8a55
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/22925
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Iru Cai 2017-12-18 16:01:49 +08:00 committed by Arthur Heymans
parent 6c2ab060a2
commit 1d2aed2367
1 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,7 @@
ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)
romstage-$(CONFIG_CACHE_MRC_SETTINGS) += mrc_cache.c
ramstage-$(CONFIG_CACHE_MRC_SETTINGS) += mrc_cache.c
romstage-y += mrc_cache.c
ramstage-y += mrc_cache.c
# Create and add the MRC cache to the cbfs image
ifneq ($(CONFIG_CHROMEOS),y)
@ -9,8 +10,10 @@ $(obj)/mrc.cache: $(obj)/config.h
bs=$(shell printf "%d" $(CONFIG_MRC_SETTINGS_CACHE_SIZE) ) | \
tr '\000' '\377' > $@
cbfs-files-$(CONFIG_CACHE_MRC_SETTINGS) += mrc.cache
cbfs-files-y += mrc.cache
mrc.cache-file := $(obj)/mrc.cache
mrc.cache-position := $(CONFIG_MRC_SETTINGS_CACHE_BASE)
mrc.cache-type := mrc_cache
endif
endif # ifneq ($(CONFIG_CHROMEOS),y)
endif # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)