summaryrefslogtreecommitdiff
path: root/src/mainboard/google/poppy/spd
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-03-02 14:36:56 -0800
committerFurquan Shaikh <furquan@google.com>2018-03-05 17:56:08 +0000
commit908ea9132b2a53470292ac1a346a28a1453f4d7c (patch)
tree7ef504e4ac6c7aaa92af4c39701e1baf63dc22e1 /src/mainboard/google/poppy/spd
parent39d3021b164429da00f4c4c79b2eccb42f416382 (diff)
downloadcoreboot-908ea9132b2a53470292ac1a346a28a1453f4d7c.tar.xz
mb/google/poppy: Allow use of optional secondary SPD
This change adds support for variants to use secondary SPD if required. This enables a variant to have different types of memory supported using the same image. BUG=b:73514687 Change-Id: I3add65ead99c510f2d6ec899fbf2cb9a06c79b0c Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/24972 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard/google/poppy/spd')
-rw-r--r--src/mainboard/google/poppy/spd/Makefile.inc38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/mainboard/google/poppy/spd/Makefile.inc b/src/mainboard/google/poppy/spd/Makefile.inc
index 30e632ded0..444ac00b92 100644
--- a/src/mainboard/google/poppy/spd/Makefile.inc
+++ b/src/mainboard/google/poppy/spd/Makefile.inc
@@ -1,5 +1,19 @@
SPD_BIN = $(obj)/spd.bin
+SEC_SPD_BIN = $(obj)/sec-spd.bin
+
+define gen_spd_bin
+ for f in $2; \
+ do for c in $$(cat $$f | grep -v ^#); \
+ do printf $$(printf '\%o' 0x$$c); \
+ done; \
+ done > $1
+endef
+
+add_spd_to_cbfs= \
+ $(eval cbfs-files-y += $1) \
+ $(eval $1-file := $2) \
+ $(eval $1-type := spd)
ifeq ($(SPD_SOURCES),)
SPD_DEPS := $(error SPD_SOURCES is not set. Variant must provide this)
@@ -7,14 +21,20 @@ else
SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).spd.hex)
endif
-# Include spd ROM data
+# Include SPD ROM data
$(SPD_BIN): $(SPD_DEPS)
- for f in $+; \
- do for c in $$(cat $$f | grep -v ^#); \
- do printf $$(printf '\%o' 0x$$c); \
- done; \
- done > $@
+ $(call gen_spd_bin, $@, $+)
+
+$(call add_spd_to_cbfs, spd.bin, $(SPD_BIN))
+
+# Add optional secondary SPD ROM data if present
+ifneq ($(SEC_SPD_SOURCES),)
+
+SEC_SPD_DEPS := $(foreach f, $(SEC_SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).spd.hex)
-cbfs-files-y += spd.bin
-spd.bin-file := $(SPD_BIN)
-spd.bin-type := spd
+$(SEC_SPD_BIN): $(SEC_SPD_DEPS)
+ $(call gen_spd_bin, $@, $+)
+
+$(call add_spd_to_cbfs, sec-spd.bin, $(SEC_SPD_BIN))
+
+endif