All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Improvements to decode-dimms
@ 2012-11-15 10:52 Jean Delvare
       [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Jean Delvare @ 2012-11-15 10:52 UTC (permalink / raw)
  To: Linux I2C

Here is a patch series improving decode-dimms:
* Show timings at all standard DDR and DDR2 speeds.
* Code refactoring.
* New manufacturer names from JEP106AJ.
* Smarter decoding of manufacturer names.

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/7] sensors-detect: Print timings at standard DDR2 speeds
       [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-11-15 11:00   ` Jean Delvare
  2012-11-15 11:48   ` [PATCH 2/7] decode-dimms: Print timings at standard DDR speeds Jean Delvare
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2012-11-15 11:00 UTC (permalink / raw)
  To: Linux I2C

Print timings at standard DDR2 speeds. The minimum cycle times for the
3 supported CAS latency values do not necessarily match standard
speeds, and even if they do, they may not cover all standard speeds.
Display the timings at all standard supported speeds. This makes it
easier to figure out which memory modules will work well together
without tinkering with BIOS options.
---
 eeprom/decode-dimms |   51 ++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 36 insertions(+), 15 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2012-10-25 14:02:21.000000000 +0200
+++ i2c-tools/eeprom/decode-dimms	2012-11-15 09:37:36.686924305 +0100
@@ -1074,7 +1074,7 @@ sub ddr2_core_timings($$$$$)
 	my ($cas, $ctime, $trcd, $trp, $tras) = @_;
 
 	return $cas . "-" . ceil($trcd/$ctime) . "-" . ceil($trp/$ctime) .
-		"-" . ceil($tras/$ctime) . " as DDR2-" . int(2000 / $ctime);
+		"-" . ceil($tras/$ctime);
 }
 
 # Parameter: EEPROM bytes 0-127 (using 3-62)
@@ -1082,7 +1082,7 @@ sub decode_ddr2_sdram($)
 {
 	my $bytes = shift;
 	my $temp;
-	my $ctime;
+	my ($ctime, $ctime1, $ctime2, $ctime_min, $ctime_max);
 
 # SPD revision
 	printl_cond($bytes->[62] != 0xff, "SPD Revision",
@@ -1091,7 +1091,7 @@ sub decode_ddr2_sdram($)
 # speed
 	prints("Memory Characteristics");
 
-	$ctime = ddr2_sdram_ctime($bytes->[9]);
+	$ctime_min = $ctime = ddr2_sdram_ctime($bytes->[9]);
 	my $ddrclk = 2 * (1000 / $ctime);
 	my $tbits = ($bytes->[7] * 256) + $bytes->[6];
 	if ($bytes->[11] & 0x03) { $tbits = $tbits - 8; }
@@ -1168,7 +1168,7 @@ sub decode_ddr2_sdram($)
 
 	if (exists $cas{$highestCAS}) {
 		$core_timings = ddr2_core_timings($highestCAS, $ctime,
-			$trcd, $trp, $tras);
+			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime);
 
 		$cycle_time = tns($ctime) . " at CAS $highestCAS (tCK min)";
 		$access_time = tns(ddr2_sdram_atime($bytes->[10]))
@@ -1176,35 +1176,56 @@ sub decode_ddr2_sdram($)
 	}
 
 	if (exists $cas{$highestCAS-1} && spd_written(@$bytes[23..24])) {
-		$ctime = ddr2_sdram_ctime($bytes->[23]);
-		$core_timings .= "\n".ddr2_core_timings($highestCAS-1, $ctime,
-			$trcd, $trp, $tras);
+		$ctime1 = ddr2_sdram_ctime($bytes->[23]);
+		$core_timings .= "\n".ddr2_core_timings($highestCAS-1, $ctime1,
+			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime1);
 
-		$cycle_time .= "\n".tns($ctime)
+		$cycle_time .= "\n".tns($ctime1)
 			     . " at CAS ".($highestCAS-1);
 		$access_time .= "\n".tns(ddr2_sdram_atime($bytes->[24]))
 			      . " at CAS ".($highestCAS-1);
 	}
 
 	if (exists $cas{$highestCAS-2} && spd_written(@$bytes[25..26])) {
-		$ctime = ddr2_sdram_ctime($bytes->[25]);
-		$core_timings .= "\n".ddr2_core_timings($highestCAS-2, $ctime,
-			$trcd, $trp, $tras);
+		$ctime2 = ddr2_sdram_ctime($bytes->[25]);
+		$core_timings .= "\n".ddr2_core_timings($highestCAS-2, $ctime2,
+			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime2);
 
-		$cycle_time .= "\n".tns($ctime)
+		$cycle_time .= "\n".tns($ctime2)
 			     . " at CAS ".($highestCAS-2);
 		$access_time .= "\n".tns(ddr2_sdram_atime($bytes->[26]))
 			      . " at CAS ".($highestCAS-2);
 	}
 
+	$ctime_max = ddr2_sdram_ctime($bytes->[43]);
+
 	printl_cond(defined $core_timings, "tCL-tRCD-tRP-tRAS", $core_timings);
 	printl_cond(defined $cycle_time, "Minimum Cycle Time", $cycle_time);
 	printl_cond(defined $access_time, "Maximum Access Time", $access_time);
-	$temp = ddr2_sdram_ctime($bytes->[43]);
 	printl_cond(($bytes->[43] & 0xf0) && $bytes->[43] != 0xff,
 		    "Maximum Cycle Time (tCK max)",
-		    $temp == 0 ? "" : # Wouldn't be displayed, prevent div by 0
-		    tns($temp)." (DDR2-".int(2000 / $temp).")");
+		    $ctime_max == 0 ? "" : # Wouldn't be displayed, prevent div by 0
+		    tns($ctime_max)." (DDR2-".int(2000 / $ctime_max).")");
+
+# standard DDR2 speeds
+	prints("Timings at Standard Speeds");
+	foreach $ctime (1.875, 2.5, 3, 3.75, 5) {
+		my $best_cas;
+
+		# Find min CAS latency at this speed
+		if (defined $ctime2 && $ctime >= $ctime2) {
+			$best_cas = $highestCAS-2;
+		} elsif (defined $ctime1 && $ctime >= $ctime1) {
+			$best_cas = $highestCAS-1;
+		} else {
+			$best_cas = $highestCAS;
+		}
+
+		printl_cond($ctime >= $ctime_min && $ctime <= $ctime_max,
+			    "tCL-tRCD-tRP-tRAS as DDR2-".int(2000 / $ctime),
+			    ddr2_core_timings($best_cas, $ctime,
+					      $trcd, $trp, $tras));
+	}
 
 # more timing information
 	prints("Timing Parameters");

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/7] decode-dimms: Print timings at standard DDR speeds
       [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
  2012-11-15 11:00   ` [PATCH 1/7] sensors-detect: Print timings at standard DDR2 speeds Jean Delvare
@ 2012-11-15 11:48   ` Jean Delvare
  2012-11-15 11:49   ` [PATCH 3/7] decode-dimms: Delete ddr2_core_timings Jean Delvare
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2012-11-15 11:48 UTC (permalink / raw)
  To: Linux I2C

Print timings at standard DDR speeds. The minimum cycle times for the
3 supported CAS latency values do not necessarily match standard
speeds, and even if they do, they may not cover all standard speeds.
Display the timings at all standard supported speeds. This makes it
easier to figure out which memory modules will work well together
without tinkering with BIOS options.
---
 eeprom/decode-dimms |   46 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 12 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2012-11-15 09:37:36.000000000 +0100
+++ i2c-tools/eeprom/decode-dimms	2012-11-15 10:40:13.765625180 +0100
@@ -835,7 +835,7 @@ sub ddr_core_timings($$$$$)
 	my ($cas, $ctime, $trcd, $trp, $tras) = @_;
 
 	return $cas . "-" . ceil($trcd/$ctime) . "-" . ceil($trp/$ctime) .
-		"-" . ceil($tras/$ctime) . " as DDR-" . int(2000 / $ctime);
+		"-" . ceil($tras/$ctime);
 }
 
 # Parameter: EEPROM bytes 0-127 (using 3-62)
@@ -843,6 +843,7 @@ sub decode_ddr_sdram($)
 {
 	my $bytes = shift;
 	my $temp;
+	my ($ctime, $ctime1, $ctime2, $ctime_min, $ctime_max);
 
 # SPD revision
 	printl_cond($bytes->[62] != 0xff, "SPD Revision",
@@ -851,7 +852,7 @@ sub decode_ddr_sdram($)
 # speed
 	prints("Memory Characteristics");
 
-	my $ctime = ($bytes->[9] >> 4) + ($bytes->[9] & 0xf) * 0.1;
+	$ctime_min = $ctime = ($bytes->[9] >> 4) + ($bytes->[9] & 0xf) * 0.1;
 	my $ddrclk = 2 * (1000 / $ctime);
 	my $tbits = ($bytes->[7] * 256) + $bytes->[6];
 	if (($bytes->[11] == 2) || ($bytes->[11] == 1)) { $tbits = $tbits - 8; }
@@ -930,7 +931,7 @@ sub decode_ddr_sdram($)
 
 	if (exists $cas{$highestCAS}) {
 		$core_timings = ddr_core_timings($highestCAS, $ctime,
-			$trcd, $trp, $tras);
+			$trcd, $trp, $tras) . " as DDR-" . int(2000 / $ctime);
 
 		$cycle_time = "$ctime ns at CAS $highestCAS";
 		$access_time = (($bytes->[10] >> 4) * 0.1 + ($bytes->[10] & 0xf) * 0.01)
@@ -938,25 +939,27 @@ sub decode_ddr_sdram($)
 	}
 
 	if (exists $cas{$highestCAS-0.5} && spd_written(@$bytes[23..24])) {
-		$ctime = ($bytes->[23] >> 4) + ($bytes->[23] & 0xf) * 0.1;
-		$core_timings .= "\n".ddr_core_timings($highestCAS-0.5, $ctime,
-			$trcd, $trp, $tras);
+		$ctime1 = ($bytes->[23] >> 4) + ($bytes->[23] & 0xf) * 0.1;
+		$core_timings .= "\n".ddr_core_timings($highestCAS-0.5, $ctime1,
+			$trcd, $trp, $tras) . " as DDR-" . int(2000 / $ctime1);
 
-		$cycle_time .= "\n$ctime ns at CAS ".($highestCAS-0.5);
+		$cycle_time .= "\n$ctime1 ns at CAS ".($highestCAS-0.5);
 		$access_time .= "\n".(($bytes->[24] >> 4) * 0.1 + ($bytes->[24] & 0xf) * 0.01)
 			      . " ns at CAS ".($highestCAS-0.5);
 	}
 
 	if (exists $cas{$highestCAS-1} && spd_written(@$bytes[25..26])) {
-		$ctime = ($bytes->[25] >> 4) + ($bytes->[25] & 0xf) * 0.1,
-		$core_timings .= "\n".ddr_core_timings($highestCAS-1, $ctime,
-			$trcd, $trp, $tras);
+		$ctime2 = ($bytes->[25] >> 4) + ($bytes->[25] & 0xf) * 0.1,
+		$core_timings .= "\n".ddr_core_timings($highestCAS-1, $ctime2,
+			$trcd, $trp, $tras) . " as DDR-" . int(2000 / $ctime2);
 
-		$cycle_time .= "\n$ctime ns at CAS ".($highestCAS-1);
+		$cycle_time .= "\n$ctime2 ns at CAS ".($highestCAS-1);
 		$access_time .= "\n".(($bytes->[26] >> 4) * 0.1 + ($bytes->[26] & 0xf) * 0.01)
 			      . " ns at CAS ".($highestCAS-1);
 	}
 
+	$ctime_max = $bytes->[43] == 0xff ? 0 : $bytes->[43]/4;
+
 	printl_cond(defined $core_timings, "tCL-tRCD-tRP-tRAS", $core_timings);
 	printl_cond(defined $cycle_time, "Minimum Cycle Time", $cycle_time);
 	printl_cond(defined $access_time, "Maximum Access Time", $access_time);
@@ -964,8 +967,27 @@ sub decode_ddr_sdram($)
 		    "Maximum Cycle Time (tCK max)",
 		    $bytes->[43] == 0xff ? "No minimum frequency" :
 		    $bytes->[43] == 0 ? "" : # Wouldn't be displayed, prevent div by 0
-		    tns1($bytes->[43]/4)." (DDR-".int(8000 / $bytes->[43]).")");
+		    tns1($ctime_max)." (DDR-".int(8000 / $bytes->[43]).")");
+
+# standard DDR speeds
+	prints("Timings at Standard Speeds");
+	foreach $ctime (5, 6, 7.5, 10) {
+		my $best_cas;
 
+		# Find min CAS latency at this speed
+		if (defined $ctime2 && $ctime >= $ctime2) {
+			$best_cas = $highestCAS-1;
+		} elsif (defined $ctime1 && $ctime >= $ctime1) {
+			$best_cas = $highestCAS-0.5;
+		} else {
+			$best_cas = $highestCAS;
+		}
+
+		printl_cond($ctime >= $ctime_min && ($ctime_max < 1 || $ctime <= $ctime_max),
+			    "tCL-tRCD-tRP-tRAS as DDR-".int(2000 / $ctime),
+			    ddr_core_timings($best_cas, $ctime,
+					     $trcd, $trp, $tras));
+	}
 
 # more timing information
 	prints("Timing Parameters");

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/7] decode-dimms: Delete ddr2_core_timings
       [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
  2012-11-15 11:00   ` [PATCH 1/7] sensors-detect: Print timings at standard DDR2 speeds Jean Delvare
  2012-11-15 11:48   ` [PATCH 2/7] decode-dimms: Print timings at standard DDR speeds Jean Delvare
@ 2012-11-15 11:49   ` Jean Delvare
  2012-11-15 11:50   ` [PATCH 4/7] decode-dimms: Introduce helper function as_ddr Jean Delvare
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2012-11-15 11:49 UTC (permalink / raw)
  To: Linux I2C

ddr2_core_timings is now the exact same function as ddr_core_timings
so delete the former and user the latter everywhere.
---
 eeprom/decode-dimms |   18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2012-11-15 09:59:02.000000000 +0100
+++ i2c-tools/eeprom/decode-dimms	2012-11-15 09:59:33.500544032 +0100
@@ -1091,14 +1091,6 @@ sub ddr2_refresh_rate($)
 	       ($byte & 0x80 ? " - Self Refresh" : "");
 }
 
-sub ddr2_core_timings($$$$$)
-{
-	my ($cas, $ctime, $trcd, $trp, $tras) = @_;
-
-	return $cas . "-" . ceil($trcd/$ctime) . "-" . ceil($trp/$ctime) .
-		"-" . ceil($tras/$ctime);
-}
-
 # Parameter: EEPROM bytes 0-127 (using 3-62)
 sub decode_ddr2_sdram($)
 {
@@ -1189,7 +1181,7 @@ sub decode_ddr2_sdram($)
 	my ($cycle_time, $access_time, $core_timings);
 
 	if (exists $cas{$highestCAS}) {
-		$core_timings = ddr2_core_timings($highestCAS, $ctime,
+		$core_timings = ddr_core_timings($highestCAS, $ctime,
 			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime);
 
 		$cycle_time = tns($ctime) . " at CAS $highestCAS (tCK min)";
@@ -1199,7 +1191,7 @@ sub decode_ddr2_sdram($)
 
 	if (exists $cas{$highestCAS-1} && spd_written(@$bytes[23..24])) {
 		$ctime1 = ddr2_sdram_ctime($bytes->[23]);
-		$core_timings .= "\n".ddr2_core_timings($highestCAS-1, $ctime1,
+		$core_timings .= "\n".ddr_core_timings($highestCAS-1, $ctime1,
 			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime1);
 
 		$cycle_time .= "\n".tns($ctime1)
@@ -1210,7 +1202,7 @@ sub decode_ddr2_sdram($)
 
 	if (exists $cas{$highestCAS-2} && spd_written(@$bytes[25..26])) {
 		$ctime2 = ddr2_sdram_ctime($bytes->[25]);
-		$core_timings .= "\n".ddr2_core_timings($highestCAS-2, $ctime2,
+		$core_timings .= "\n".ddr_core_timings($highestCAS-2, $ctime2,
 			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime2);
 
 		$cycle_time .= "\n".tns($ctime2)
@@ -1245,8 +1237,8 @@ sub decode_ddr2_sdram($)
 
 		printl_cond($ctime >= $ctime_min && $ctime <= $ctime_max,
 			    "tCL-tRCD-tRP-tRAS as DDR2-".int(2000 / $ctime),
-			    ddr2_core_timings($best_cas, $ctime,
-					      $trcd, $trp, $tras));
+			    ddr_core_timings($best_cas, $ctime,
+					     $trcd, $trp, $tras));
 	}
 
 # more timing information


-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/7] decode-dimms: Introduce helper function as_ddr
       [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
                     ` (2 preceding siblings ...)
  2012-11-15 11:49   ` [PATCH 3/7] decode-dimms: Delete ddr2_core_timings Jean Delvare
@ 2012-11-15 11:50   ` Jean Delvare
  2012-11-15 11:52   ` [PATCH 5/7] decode-dimms: Manufacturer names from Jedec JEP106AJ Jean Delvare
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2012-11-15 11:50 UTC (permalink / raw)
  To: Linux I2C

Introduce helper function as_ddr(), hopefully this makes the code a
little more readable. 
---
 eeprom/decode-dimms |   24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2012-11-15 10:52:06.000000000 +0100
+++ i2c-tools/eeprom/decode-dimms	2012-11-15 10:57:57.171530598 +0100
@@ -830,6 +830,14 @@ sub decode_sdr_sdram($)
 		    (($bytes->[35] >> 7) ? -$temp : $temp) . " ns");
 }
 
+sub as_ddr($$)
+{
+	my ($gen, $ctime) = @_;
+
+	return " as DDR" . ($gen == 1 ? "" : $gen) . "-" .
+	       int(2000 / $ctime);
+}
+
 sub ddr_core_timings($$$$$)
 {
 	my ($cas, $ctime, $trcd, $trp, $tras) = @_;
@@ -931,7 +939,7 @@ sub decode_ddr_sdram($)
 
 	if (exists $cas{$highestCAS}) {
 		$core_timings = ddr_core_timings($highestCAS, $ctime,
-			$trcd, $trp, $tras) . " as DDR-" . int(2000 / $ctime);
+			$trcd, $trp, $tras) . as_ddr(1, $ctime);
 
 		$cycle_time = "$ctime ns at CAS $highestCAS";
 		$access_time = (($bytes->[10] >> 4) * 0.1 + ($bytes->[10] & 0xf) * 0.01)
@@ -941,7 +949,7 @@ sub decode_ddr_sdram($)
 	if (exists $cas{$highestCAS-0.5} && spd_written(@$bytes[23..24])) {
 		$ctime1 = ($bytes->[23] >> 4) + ($bytes->[23] & 0xf) * 0.1;
 		$core_timings .= "\n".ddr_core_timings($highestCAS-0.5, $ctime1,
-			$trcd, $trp, $tras) . " as DDR-" . int(2000 / $ctime1);
+			$trcd, $trp, $tras) . as_ddr(1, $ctime1);
 
 		$cycle_time .= "\n$ctime1 ns at CAS ".($highestCAS-0.5);
 		$access_time .= "\n".(($bytes->[24] >> 4) * 0.1 + ($bytes->[24] & 0xf) * 0.01)
@@ -951,7 +959,7 @@ sub decode_ddr_sdram($)
 	if (exists $cas{$highestCAS-1} && spd_written(@$bytes[25..26])) {
 		$ctime2 = ($bytes->[25] >> 4) + ($bytes->[25] & 0xf) * 0.1,
 		$core_timings .= "\n".ddr_core_timings($highestCAS-1, $ctime2,
-			$trcd, $trp, $tras) . " as DDR-" . int(2000 / $ctime2);
+			$trcd, $trp, $tras) . as_ddr(1, $ctime2);
 
 		$cycle_time .= "\n$ctime2 ns at CAS ".($highestCAS-1);
 		$access_time .= "\n".(($bytes->[26] >> 4) * 0.1 + ($bytes->[26] & 0xf) * 0.01)
@@ -984,7 +992,7 @@ sub decode_ddr_sdram($)
 		}
 
 		printl_cond($ctime >= $ctime_min && ($ctime_max < 1 || $ctime <= $ctime_max),
-			    "tCL-tRCD-tRP-tRAS as DDR-".int(2000 / $ctime),
+			    "tCL-tRCD-tRP-tRAS" . as_ddr(1, $ctime),
 			    ddr_core_timings($best_cas, $ctime,
 					     $trcd, $trp, $tras));
 	}
@@ -1182,7 +1190,7 @@ sub decode_ddr2_sdram($)
 
 	if (exists $cas{$highestCAS}) {
 		$core_timings = ddr_core_timings($highestCAS, $ctime,
-			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime);
+			$trcd, $trp, $tras) . as_ddr(2, $ctime);
 
 		$cycle_time = tns($ctime) . " at CAS $highestCAS (tCK min)";
 		$access_time = tns(ddr2_sdram_atime($bytes->[10]))
@@ -1192,7 +1200,7 @@ sub decode_ddr2_sdram($)
 	if (exists $cas{$highestCAS-1} && spd_written(@$bytes[23..24])) {
 		$ctime1 = ddr2_sdram_ctime($bytes->[23]);
 		$core_timings .= "\n".ddr_core_timings($highestCAS-1, $ctime1,
-			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime1);
+			$trcd, $trp, $tras) . as_ddr(2, $ctime1);
 
 		$cycle_time .= "\n".tns($ctime1)
 			     . " at CAS ".($highestCAS-1);
@@ -1203,7 +1211,7 @@ sub decode_ddr2_sdram($)
 	if (exists $cas{$highestCAS-2} && spd_written(@$bytes[25..26])) {
 		$ctime2 = ddr2_sdram_ctime($bytes->[25]);
 		$core_timings .= "\n".ddr_core_timings($highestCAS-2, $ctime2,
-			$trcd, $trp, $tras) . " as DDR2-" . int(2000 / $ctime2);
+			$trcd, $trp, $tras) . as_ddr(2, $ctime2);
 
 		$cycle_time .= "\n".tns($ctime2)
 			     . " at CAS ".($highestCAS-2);
@@ -1236,7 +1244,7 @@ sub decode_ddr2_sdram($)
 		}
 
 		printl_cond($ctime >= $ctime_min && $ctime <= $ctime_max,
-			    "tCL-tRCD-tRP-tRAS as DDR2-".int(2000 / $ctime),
+			    "tCL-tRCD-tRP-tRAS" . as_ddr(2,$ctime),
 			    ddr_core_timings($best_cas, $ctime,
 					     $trcd, $trp, $tras));
 	}

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/7] decode-dimms: Manufacturer names from Jedec JEP106AJ
       [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
                     ` (3 preceding siblings ...)
  2012-11-15 11:50   ` [PATCH 4/7] decode-dimms: Introduce helper function as_ddr Jean Delvare
@ 2012-11-15 11:52   ` Jean Delvare
  2012-11-15 11:58   ` [PATCH 6/7] decode-dimms: Bad manufacturer page count parity is not fatal Jean Delvare
  2012-11-15 11:59   ` [PATCH 7/7] decode-dimms: Strip former manufacturer name in side-by-side mode Jean Delvare
  6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2012-11-15 11:52 UTC (permalink / raw)
  To: Linux I2C

Add manufacturer names from Jedec document JEP106AJ.
---
 eeprom/decode-dimms |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2012-11-15 11:11:22.000000000 +0100
+++ i2c-tools/eeprom/decode-dimms	2012-11-15 11:45:52.020974740 +0100
@@ -64,7 +64,7 @@ $revision =~ s/ \([^()]*\)//;
  "Lattice Semi.", "NCR", "Wafer Scale Integration", "IBM",
  "Tristar", "Visic", "Intl. CMOS Technology", "SSSI",
  "MicrochipTechnology", "Ricoh Ltd.", "VLSI", "Micron Technology",
- "Hynix Semiconductor Inc. (former Hyundai Electronics)", "OKI Semiconductor", "ACTEL", "Sharp",
+ "SK Hynix (former Hyundai Electronics)", "OKI Semiconductor", "ACTEL", "Sharp",
  "Catalyst", "Panasonic", "IDT", "Cypress",
  "DEC", "LSI Logic", "Zarlink (former Plessey)", "UTMC",
  "Thinking Machine", "Thomson CSF", "Integrated CMOS (Vertex)", "Honeywell",
@@ -293,7 +293,11 @@ $revision =~ s/ \([^()]*\)//;
  "Accord Software & Systems Pvt. Ltd.", "Active-Semi Inc.", "Denso Corporation", "TLSI Inc.",
  "Shenzhen Daling Electronic Co. Ltd.", "Mustang", "Orca Systems", "Passif Semiconductor",
  "GigaDevice Semiconductor (Beijing) Inc.", "Memphis Electronic", "Beckhoff Automation GmbH",
- "Harmony Semiconductor Corp (former ProPlus Design Solutions)", "Air Computers SRL", "TMT Memory"]
+ "Harmony Semiconductor Corp (former ProPlus Design Solutions)", "Air Computers SRL", "TMT Memory",
+ "Eorex Corporation", "Xingtera", "Netsol", "Bestdon Technology Co. Ltd.", "Baysand Inc.",
+ "Uroad Technology Co. Ltd. (former Triple Grow Industrial Ltd.)", "Wilk Elektronik S.A.",
+ "AAI", "Harman", "Berg Microelectronics Inc.", "ASSIA, Inc.", "Visiontek Products LLC",
+ "OCMEMORY", "Welink Solution Inc."]
 );
 
 $use_sysfs = -d '/sys/bus';

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/7] decode-dimms: Bad manufacturer page count parity is not fatal
       [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
                     ` (4 preceding siblings ...)
  2012-11-15 11:52   ` [PATCH 5/7] decode-dimms: Manufacturer names from Jedec JEP106AJ Jean Delvare
@ 2012-11-15 11:58   ` Jean Delvare
  2012-11-15 11:59   ` [PATCH 7/7] decode-dimms: Strip former manufacturer name in side-by-side mode Jean Delvare
  6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2012-11-15 11:58 UTC (permalink / raw)
  To: Linux I2C

If DDR3 manufacturer page count parity is wrong, still print the
manufacturer name (if valid) but add a question mark.
---
 eeprom/decode-dimms |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2012-11-15 11:45:52.020974740 +0100
+++ i2c-tools/eeprom/decode-dimms	2012-11-15 11:47:17.878976012 +0100
@@ -337,10 +337,13 @@ sub parity($)
 sub manufacturer_ddr3($$)
 {
 	my ($count, $code) = @_;
-	return "Invalid" if parity($count) != 1;
+	my $manufacturer;
+
 	return "Invalid" if parity($code) != 1;
-	return (($code & 0x7F) - 1 > $vendors[$count & 0x7F]) ? "Unknown" :
-		$vendors[$count & 0x7F][($code & 0x7F) - 1];
+	return "Unknown" if ($code & 0x7F) - 1 > $vendors[$count & 0x7F];
+	$manufacturer = $vendors[$count & 0x7F][($code & 0x7F) - 1];
+	$manufacturer .= "? (Invalid parity)" if parity($count) != 1;
+	return $manufacturer;
 }
 
 sub manufacturer(@)

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 7/7] decode-dimms: Strip former manufacturer name in side-by-side mode
       [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
                     ` (5 preceding siblings ...)
  2012-11-15 11:58   ` [PATCH 6/7] decode-dimms: Bad manufacturer page count parity is not fatal Jean Delvare
@ 2012-11-15 11:59   ` Jean Delvare
  6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2012-11-15 11:59 UTC (permalink / raw)
  To: Linux I2C

Strip former manufacturer name in side-by-side output mode, to avoid
overly large columns.
---
 eeprom/decode-dimms |    1 +
 1 file changed, 1 insertion(+)

--- i2c-tools.orig/eeprom/decode-dimms	2012-11-15 11:47:17.878976012 +0100
+++ i2c-tools/eeprom/decode-dimms	2012-11-15 11:47:19.684976039 +0100
@@ -342,6 +342,7 @@ sub manufacturer_ddr3($$)
 	return "Invalid" if parity($code) != 1;
 	return "Unknown" if ($code & 0x7F) - 1 > $vendors[$count & 0x7F];
 	$manufacturer = $vendors[$count & 0x7F][($code & 0x7F) - 1];
+	$manufacturer =~ s/ \(former .*\)$// if $opt_side_by_side;
 	$manufacturer .= "? (Invalid parity)" if parity($count) != 1;
 	return $manufacturer;
 }

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-11-15 11:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 10:52 [PATCH 0/7] Improvements to decode-dimms Jean Delvare
     [not found] ` <20121115115231.341ac0c9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-11-15 11:00   ` [PATCH 1/7] sensors-detect: Print timings at standard DDR2 speeds Jean Delvare
2012-11-15 11:48   ` [PATCH 2/7] decode-dimms: Print timings at standard DDR speeds Jean Delvare
2012-11-15 11:49   ` [PATCH 3/7] decode-dimms: Delete ddr2_core_timings Jean Delvare
2012-11-15 11:50   ` [PATCH 4/7] decode-dimms: Introduce helper function as_ddr Jean Delvare
2012-11-15 11:52   ` [PATCH 5/7] decode-dimms: Manufacturer names from Jedec JEP106AJ Jean Delvare
2012-11-15 11:58   ` [PATCH 6/7] decode-dimms: Bad manufacturer page count parity is not fatal Jean Delvare
2012-11-15 11:59   ` [PATCH 7/7] decode-dimms: Strip former manufacturer name in side-by-side mode Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.