summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohanna Schander <coreboot@mimoja.de>2020-01-15 09:06:48 +0100
committerPatrick Georgi <pgeorgi@google.com>2020-01-27 07:41:00 +0000
commit36a0bb823f22c80e2c849e1e988f2c9c2121cb4f (patch)
treebc583954e54f99e2acd90804cd66bce3314907a7
parent501e3c1837ba527ba8e49753688ca73af022df51 (diff)
downloadcoreboot-36a0bb823f22c80e2c849e1e988f2c9c2121cb4f.tar.xz
lib: Always read SPD sources as text file
Under some circumstances grep detects the input of a spd hex file as binary resulting in an spd source not beeing added to the resulting spd.bin. This appears to be especially the case with heavily commented files. This commit forces grep to read the input as text file. Example SPD that would else be detected as binary (regardless of stripped zero blocks). ```hex \# TotalBytes: 512 ; BytesUsed: 384 23 \# SPD Revision 1.1 11 \# DDR Ramtype: LPDDR4X 11 \# Config Rest 0E 16 21 95 08 00 00 00 00 0A 22 00 00 49 00 04 0F 92 54 05 00 84 00 90 A8 90 C0 08 60 04 00 00 [...] \# CRC Is: 0x1EB4 Calculated: 0x1EB4 Match! 1E B4 \# ModuleSpecificParameter [...] \# HybridMemoryParameter [...] \# ExtendedFunctionParameter [...] \# ManufactoringInformation \## Module Manufactoring ID 00 00 \## Module Manufactoring Location and Date 00 00 00 \## Module Manufactoring Serial 00 00 00 00 \## Module Manufactoring Part Number: "K4UBE3D4AA-MGCL" 4B 34 55 42 45 33 44 34 41 41 2D 4D 47 43 4C 00 00 00 00 00 \## Module Manufactoring Revision Code 00 \## Module Manufactor: "Samsung" (0xCE80) CE 80 \## Module Stepping 00 \## Module Manufactoring Data [..] \## Module Reserved 00 00 \# EndUserProgrammable [...] ``` Thanks to Patrick Georgi for checking that this grep option is widely available. Change-Id: I7e5bad069531630b36dc3702c8c4bd94ba0946c1 Signed-off-by: Johanna Schander <coreboot@mimoja.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38426 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/lib/Makefile.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index 748f55aae8..2333f64468 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -338,7 +338,7 @@ LIB_SPD_DEPS = $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(
# 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 for c in $$(cat $$f | grep --binary-files=text -v ^#); \
do printf $$(printf '\%o' 0x$$c); \
done; \
done > $@