linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Andriy Gapon <avg-+43SdJ71VxTsG83rWm+8vg@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: decode-dimms: Module Configuration Type not reported for DDR2/3
Date: Tue, 17 Apr 2012 13:18:57 +0200	[thread overview]
Message-ID: <20120417131857.4e05c67b@endymion.delvare> (raw)
In-Reply-To: <4F8C8A74.90804-+43SdJ71VxTsG83rWm+8vg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 979 bytes --]

Hi Andriy,

On Tue, 17 Apr 2012 00:09:08 +0300, Andriy Gapon wrote:
> It seems that Module Configuration Type ("ECC", "No Parity", etc) is not
> reported for DDR2 and DDR3 module types.  Not sure if resolution could be as
> easy as adding sdram_module_configuration_type() calls in the corresponding
> decode procedures.

Won't be so easy. For DDR2 there is one new bit to decode
(Address/Command Parity). For DDR3 byte 11 has a completely different
meaning, and the information seem to be no longer available. As I read
the specification, the only way to tell if a DDR3 module has any form
of parity or ECC is to check the extra bus width in bits 4-3 of byte 8.
But this is a boolean type of information then, telling "there is some
form of data error detection/correction". No way to tell between parity
and ECC AFAICS, and information about Address/Command Parity is gone
too.

I am attaching two patches, one for DDR2, one for DDR3, please give
them a try.

-- 
Jean Delvare

[-- Attachment #2: decode-dimms-ddr2-module-config.patch --]
[-- Type: text/x-patch, Size: 1328 bytes --]

---
 eeprom/decode-dimms |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2011-02-16 14:58:41.000000000 +0100
+++ i2c-tools/eeprom/decode-dimms	2012-04-17 10:22:06.784083856 +0200
@@ -525,16 +525,21 @@ sub sdram_voltage_interface_level($)
 	return ($_[0] < @levels) ? $levels[$_[0]] : "Undefined!";
 }
 
-# Common to SDR and DDR SDRAM
+# Common to SDR, DDR and DDR2 SDRAM
 sub sdram_module_configuration_type($)
 {
-	my @types = (
-		"No Parity",			# 0
-		"Parity",			# 1
-		"ECC",				# 2
-	);
+	my $byte = $_[0] & 0x07;
+	my @edc;
 
-	return ($_[0] < @types) ? $types[$_[0]] : "Undefined!";
+	return "No Parity" if $byte == 0;
+
+	# Data ECC includes Data Parity so don't print both
+	push @edc, "Data Parity" if ($byte & 0x03) == 0x01;
+	push @edc, "Data ECC" if ($byte & 0x02);
+	# New in DDR2 specification
+	push @edc, "Address/Command Parity" if ($byte & 0x04);
+
+	return join ", ", @edc;
 }
 
 # Parameter: EEPROM bytes 0-127 (using 3-62)
@@ -1019,6 +1024,9 @@ sub decode_ddr2_sdram($)
 	printl("Voltage Interface Level",
 	       sdram_voltage_interface_level($bytes->[8]));
 
+	printl("Module Configuration Type",
+	       sdram_module_configuration_type($bytes->[11]));
+
 	printl("Refresh Rate", ddr2_refresh_rate($bytes->[12]));
 
 	my @burst;

[-- Attachment #3: decode-dimms-ddr3-module-config.patch --]
[-- Type: text/x-patch, Size: 434 bytes --]

---
 eeprom/decode-dimms |    2 ++
 1 file changed, 2 insertions(+)

--- i2c-tools.orig/eeprom/decode-dimms	2012-04-17 10:22:06.000000000 +0200
+++ i2c-tools/eeprom/decode-dimms	2012-04-17 10:42:10.205990901 +0200
@@ -1169,6 +1169,8 @@ sub decode_ddr3_sdram($)
 
 	printl("SDRAM Device Width", (1 << (($bytes->[7] & 7) + 2))." bits");
 
+	printl("Bus Width Extension", ($bytes->[8] & 24)." bits");
+
 	my $taa;
 	my $trcd;
 	my $trp;

  parent reply	other threads:[~2012-04-17 11:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 21:09 decode-dimms: Module Configuration Type not reported for DDR2/3 Andriy Gapon
     [not found] ` <4F8C8A74.90804-+43SdJ71VxTsG83rWm+8vg@public.gmane.org>
2012-04-17 11:18   ` Jean Delvare [this message]
     [not found]     ` <20120417131857.4e05c67b-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-04-17 20:03       ` Andriy Gapon
     [not found]         ` <4F8DCC84.2040206-+43SdJ71VxTsG83rWm+8vg@public.gmane.org>
2012-04-18  8:30           ` Jean Delvare
     [not found]             ` <20120418103025.46ab7446-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-05-13 19:13               ` Andriy Gapon

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=20120417131857.4e05c67b@endymion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=avg-+43SdJ71VxTsG83rWm+8vg@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).