summaryrefslogtreecommitdiff
path: root/src/lib/Makefile.inc
diff options
context:
space:
mode:
authorNaresh G Solanki <naresh.solanki@intel.com>2016-10-26 19:43:14 +0530
committerAaron Durbin <adurbin@chromium.org>2016-11-30 17:02:19 +0100
commit335781ad53cd4988425e922cc24c966958484f0f (patch)
tree14cd51d39a8de9c271cef7ea461d515ea5b351e2 /src/lib/Makefile.inc
parent500ba45b2c18a2742188d603808e2812fe6ed437 (diff)
downloadcoreboot-335781ad53cd4988425e922cc24c966958484f0f.tar.xz
lib: Add library to handle SPD data in CBFS or DIMM
Add library to: 1. add spd.bin in cbfs, generated from mainboard/spd/*.spd.hex files. 2. runtime get spd data with spd index as input. 3. fetch spd over smbus using early smbus functions. Change-Id: I44fe1cdb883dd1037484d4bb5c87d2d4f9862bf8 Signed-off-by: Naresh G Solanki <naresh.solanki@intel.com> Reviewed-on: https://review.coreboot.org/17434 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/lib/Makefile.inc')
-rw-r--r--src/lib/Makefile.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index ddade2be1c..0480eec529 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -279,3 +279,21 @@ subdirs-y += ../../3rdparty/libhwbase
ramstage-$(CONFIG_HAVE_MONOTONIC_TIMER) += hw-time-timer.adb
endif # CONFIG_RAMSTAGE_LIBHWBASE
+
+romstage-$(CONFIG_GENERIC_SPD_BIN) += spd_bin.c
+
+LIB_SPD_BIN = $(obj)/spd.bin
+
+LIB_SPD_DEPS = $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).spd.hex)
+
+# Include spd ROM data
+$(LIB_SPD_BIN): $(LIB_SPD_DEPS)
+ for f in $(LIB_SPD_DEPS); \
+ do for c in $$(cat $$f | grep -v ^#); \
+ do printf $$(printf '\%o' 0x$$c); \
+ done; \
+ done > $@
+
+cbfs-files-$(CONFIG_GENERIC_SPD_BIN) += spd.bin
+spd.bin-file := $(LIB_SPD_BIN)
+spd.bin-type := spd