diff options
author | Rob Barnes <robbarnes@google.com> | 2020-07-27 09:27:31 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-07-29 09:35:05 +0000 |
commit | ce036bd1769d018af88df95c0e871d8da1f30556 (patch) | |
tree | a4a77bf6ee975062fd52063d6b11c408aff8b04a | |
parent | 7884c22f1f2232005aa745596cddc789ea7b8130 (diff) |
util/apcb: Strip SPD manufacturer information
Strip manufacturer information from SPDs before injecting into APCB.
This allows more flexibility around changing DRAM modules in the future.
BUG=b:162098961
TEST=Boot, dump memory info
Signed-off-by: Rob Barnes <robbarnes@google.com>
Change-Id: I1bbc81a858f381f62dbd38bb57b3df0e6707d647
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43832
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r-- | src/soc/amd/picasso/Makefile.inc | 2 | ||||
-rwxr-xr-x | util/apcb/apcb_edit.py | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc index aa9d8c9955..4c1d726804 100644 --- a/src/soc/amd/picasso/Makefile.inc +++ b/src/soc/amd/picasso/Makefile.inc @@ -395,6 +395,7 @@ $(obj)/APCB_%_x1.bin: $$(SPD_SOURCES_DIR)/%.spd.hex \ $(APCB_MAGIC_BLOB) \ $@ \ --hex \ + --strip_manufacturer_information \ --spd_0_0 $< \ --board_id_gpio0 $(APCB_BOARD_ID_GPIO0) \ --board_id_gpio1 $(APCB_BOARD_ID_GPIO1) \ @@ -408,6 +409,7 @@ $(obj)/APCB_%_x2.bin: $$(SPD_SOURCES_DIR)/%.spd.hex \ $(APCB_MAGIC_BLOB) \ $@ \ --hex \ + --strip_manufacturer_information \ --spd_0_0 $< \ --spd_1_0 $< \ --board_id_gpio0 $(APCB_BOARD_ID_GPIO0) \ diff --git a/util/apcb/apcb_edit.py b/util/apcb/apcb_edit.py index 54d59d6fcc..388b18ad73 100755 --- a/util/apcb/apcb_edit.py +++ b/util/apcb/apcb_edit.py @@ -59,6 +59,10 @@ def parseargs(): action='store_true', help='SPD input file is hex encoded, binary otherwise') parser.add_argument( + '--strip_manufacturer_information', + action='store_true', + help='Strip all manufacturer information from SPD') + parser.add_argument( '--board_id_gpio0', type=int, required=True, @@ -155,6 +159,13 @@ def main(): assert len(spd) == 512, \ "Expected SPD to be 512 bytes, got %d" % len(spd) + if args.strip_manufacturer_information: + print("Stripping manufacturer information from SPD") + spd = spd[0:320] + b'\x00'*64 + spd[320+64:] + + assert len(spd) == 512, \ + "Error while stripping SPD manufacurer information" + print("Enabling channel %d, dimm %d and injecting SPD" % (spd_ssp.ChannelNumber, spd_ssp.DimmNumber)) spd_ssp = spd_ssp._replace(SpdValid=True, DimmPresent=True) |