Skip to content

Commit b3f7b21

Browse files
Josua-SRlizthegrey
authored andcommitted
nxp: ddr: dump SPD EEPROM content on debug builds
When building with DDR_DEBUG=yes dump the raw SPD EEPROM byte for byte on each DIMM. Signed-off-by: Josua Mayer <josua@solid-run.com>
1 parent eef680a commit b3f7b21

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • drivers/nxp/ddr/nxp-ddr

drivers/nxp/ddr/nxp-ddr/ddr.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,19 @@ static int parse_spd(struct ddr_info *priv)
550550
continue;
551551
}
552552

553+
#ifdef DDR_DEBUG
554+
/* dump SPD */
555+
printf("RAW SPD:");
556+
for (size_t k = 0; k < sizeof(struct ddr4_spd); k++) {
557+
unsigned char byte = ((unsigned char *)&spd[spd_idx])[k];
558+
if (!(k % 16))
559+
printf("\n%02x", byte);
560+
else
561+
printf(" %02x", byte);
562+
}
563+
printf("\n");
564+
#endif
565+
553566
spd_checksum[spd_idx] =
554567
(spd[spd_idx].crc[1] << 24) |
555568
(spd[spd_idx].crc[0] << 16) |

0 commit comments

Comments
 (0)