linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Linux I2C <linux-i2c@vger.kernel.org>
Subject: [PATCH 4/6] decode-dimms: Decode physical characteristics of DDR4
Date: Sun, 19 Nov 2017 13:35:22 +0100	[thread overview]
Message-ID: <20171119133522.1f2046af@endymion> (raw)
In-Reply-To: <20171119133309.67d4c596@endymion>

Print the physical characteristics of unbuffered, registered and
load-reduced DDR4 SDRAM modules.
---
 eeprom/decode-dimms |   22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

--- i2c-tools.orig/eeprom/decode-dimms	2017-11-17 11:25:15.453970328 +0100
+++ i2c-tools/eeprom/decode-dimms	2017-11-17 11:27:11.401380668 +0100
@@ -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)

-- 
Jean Delvare
SUSE L3 Support

  parent reply	other threads:[~2017-11-19 12:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19 12:33 [PATCH 0/6] decode-dimms: Add support for DDR4 SDRAM memory Jean Delvare
2017-11-19 12:33 ` [PATCH 1/6] decode-dimms: Add preliminary DDR4 support Jean Delvare
2017-11-19 12:34 ` [PATCH 2/6] decode-dimms: Decode size and timings of DDR4 Jean Delvare
2017-11-19 12:34 ` [PATCH 3/6] decode-dimms: Decode misc parameters " Jean Delvare
2017-11-19 12:35 ` Jean Delvare [this message]
2017-11-19 12:36 ` [PATCH 5/6] decode-dimms: Documentation update for DDR4 Jean Delvare
2017-11-19 12:37 ` [PATCH 6/6] decode-dimms: Verify the CRC of DDR4 data block 1 Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171119133522.1f2046af@endymion \
    --to=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).