[coreboot-gerrit] Change in coreboot[master]: mainboard/google/zoombini: fix spd makefiles

Nick Vaccaro (Code Review) gerrit at coreboot.org
Tue Jan 9 23:41:31 CET 2018


Hello Nick Vaccaro,

I'd like you to do a code review. Please visit

    https://review.coreboot.org/23190

to review the following change.


Change subject: mainboard/google/zoombini: fix spd makefiles
......................................................................

mainboard/google/zoombini: fix spd makefiles

The spd.bin file was not getting generated properly, so moved logic
to variant's makefile.

BUG=b:64395641
BRANCH=none
TEST=Verify "./util/abuild/abuild -p none -t google/zoombini -x -a"
compiles successfully and spd.bin is found when booting.

Change-Id: I4642d6ddb5e65f721d1bde31ca0ca5b4438da554
Signed-off-by: Nick Vaccaro <nvaccaro at chromium.org>
---
M src/mainboard/google/zoombini/Makefile.inc
M src/mainboard/google/zoombini/variants/meowth/spd/Makefile.inc
M src/mainboard/google/zoombini/variants/zoombini/spd/Makefile.inc
3 files changed, 40 insertions(+), 19 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/23190/1

diff --git a/src/mainboard/google/zoombini/Makefile.inc b/src/mainboard/google/zoombini/Makefile.inc
index a361dce..10ba0eb0 100644
--- a/src/mainboard/google/zoombini/Makefile.inc
+++ b/src/mainboard/google/zoombini/Makefile.inc
@@ -35,23 +35,4 @@
 
 subdirs-y += variants/$(VARIANT_DIR)
 CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
-
-# If variant using SPD files, include them in the CBFS
-ifneq ($(SPD_SOURCES),)
-        SPD_BIN = $(obj)/spd.bin
-        SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/spd/$(f).spd.hex)
-
-# 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 > $@
-
-cbfs-files-y += spd.bin
-spd.bin-file := $(SPD_BIN)
-spd.bin-type := spd
-endif
-
 subdirs-y += variants/$(VARIANT_DIR)/spd
diff --git a/src/mainboard/google/zoombini/variants/meowth/spd/Makefile.inc b/src/mainboard/google/zoombini/variants/meowth/spd/Makefile.inc
index ff88a20b..cca4351 100644
--- a/src/mainboard/google/zoombini/variants/meowth/spd/Makefile.inc
+++ b/src/mainboard/google/zoombini/variants/meowth/spd/Makefile.inc
@@ -14,4 +14,24 @@
 ## GNU General Public License for more details.
 ##
 
+SPD_BIN = $(obj)/spd.bin
+
 SPD_SOURCES = Samsung_K4F8E304HB_1GB		# 0b000
+
+ifeq ($(SPD_SOURCES),)
+        SPD_DEPS := $(error SPD_SOURCES is not set. Variant must provide this)
+else
+        SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/meowth/spd/$(f).spd.hex)
+endif
+
+# 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 > $@
+
+cbfs-files-y += spd.bin
+spd.bin-file := $(SPD_BIN)
+spd.bin-type := spd
diff --git a/src/mainboard/google/zoombini/variants/zoombini/spd/Makefile.inc b/src/mainboard/google/zoombini/variants/zoombini/spd/Makefile.inc
index d55b5db..6942cb8 100644
--- a/src/mainboard/google/zoombini/variants/zoombini/spd/Makefile.inc
+++ b/src/mainboard/google/zoombini/variants/zoombini/spd/Makefile.inc
@@ -13,6 +13,26 @@
 ## GNU General Public License for more details.
 ##
 
+SPD_BIN = $(obj)/spd.bin
+
 SPD_SOURCES = Hynix_H9HCNNN8KUMLHR_1GB		# 0b000
 SPD_SOURCES += Micron_MT53B512M32D2_2GB		# 1b001
 SPD_SOURCES += Micron_MT53B1024M32D4_4GB	# 2b010
+
+ifeq ($(SPD_SOURCES),)
+        SPD_DEPS := $(error SPD_SOURCES is not set. Variant must provide this)
+else
+        SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/zoombini/spd/$(f).spd.hex)
+endif
+
+# 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 > $@
+
+cbfs-files-y += spd.bin
+spd.bin-file := $(SPD_BIN)
+spd.bin-type := spd

-- 
To view, visit https://review.coreboot.org/23190
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4642d6ddb5e65f721d1bde31ca0ca5b4438da554
Gerrit-Change-Number: 23190
Gerrit-PatchSet: 1
Gerrit-Owner: Nick Vaccaro <nvaccaro at google.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180109/45dd4629/attachment-0001.html>


More information about the coreboot-gerrit mailing list