From 52cd6c60d6db0e39f00a67f5931c06cccb63e178 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 5 Dec 2017 07:45:17 +0100 Subject: [PATCH] decode-dimms: Decode physical characteristics of DDR4 Print the physical characteristics of unbuffered, registered and load-reduced DDR4 SDRAM modules. --- CHANGES | 1 + eeprom/decode-dimms | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c0d2e2b..8fb666f 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ master decode-dimms: Add preliminary DDR4 support Decode size and timings of DDR4 Decode misc parameters of DDR4 + Decode physical characteristics of DDR4 4.0 (2017-10-30) tools: Fix build with recent compilers (gcc 4.6+) diff --git a/eeprom/decode-dimms b/eeprom/decode-dimms index 2779ae4..6173192 100755 --- a/eeprom/decode-dimms +++ b/eeprom/decode-dimms @@ -1404,6 +1404,7 @@ sub ddr3_mtb_ftb($$$$) return $byte1 * $mtb + $byte2 * $ftb / 1000; } +# Also works for DDR4 sub ddr3_reference_card($$) { my ($rrc, $ext) = @_; @@ -1727,7 +1728,7 @@ use constant DDR4_UNBUFFERED => 1; use constant DDR4_REGISTERED => 2; use constant DDR4_LOAD_REDUCED => 4; -# Parameter: EEPROM bytes 0-383 (using 1-125) +# Parameter: EEPROM bytes 0-383 (using 1-130) sub decode_ddr4_sdram($) { my $bytes = shift; @@ -1915,6 +1916,25 @@ sub decode_ddr4_sdram($) printl("Thermal Sensor", $bytes->[14] & 0x80 ? "TSE2004 compliant" : "No"); + +# type-specific settings + if ($module_types[$bytes->[3] & 0x0f]->{family} == DDR4_UNBUFFERED || + $module_types[$bytes->[3] & 0x0f]->{family} == DDR4_REGISTERED || + $module_types[$bytes->[3] & 0x0f]->{family} == DDR4_LOAD_REDUCED) { + prints("Physical Characteristics"); + + my $height = $bytes->[128] & 0x1f; + printl("Module Height", + $height == 0x00 ? "15 mm or less" : + $height == 0x1f ? "more than 45 mm" : + sprintf("%u mm", $height + 15)); + printl("Module Thickness", + sprintf("%d mm front, %d mm back", + ($bytes->[129] & 0x0f) + 1, + (($bytes->[129] >> 4) & 15) + 1)); + printl("Module Reference Card", + ddr3_reference_card($bytes->[130], $bytes->[128])); + } } # Parameter: EEPROM bytes 0-127 (using 4-5)