diff mbox series

decode-dimms: Move SDR-specific code

Message ID 20181207105150.510c48dd@endymion
State Awaiting Upstream
Headers show
Series decode-dimms: Move SDR-specific code | expand

Commit Message

Jean Delvare Dec. 7, 2018, 9:51 a.m. UTC
SDR-specific code should go to its type-specific decoding function.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 eeprom/decode-dimms |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

--- i2c-tools.orig/eeprom/decode-dimms	2018-12-07 10:12:24.157535276 +0100
+++ i2c-tools/eeprom/decode-dimms	2018-12-07 10:46:39.795154479 +0100
@@ -741,7 +741,7 @@  sub sdram_module_configuration_type($)
 	return join ", ", @edc;
 }
 
-# Parameter: EEPROM bytes 0-127 (using 3-62)
+# Parameter: EEPROM bytes 0-127 (using 3-62 and 126-127)
 sub decode_sdr_sdram($)
 {
 	my $bytes = shift;
@@ -1000,6 +1000,9 @@  sub decode_sdr_sdram($)
 	$temp = (($bytes->[35] & 0x7f) >> 4) + ($bytes->[35] & 0xf) * 0.1;
 	printl_cond(($bytes->[35] & 0xf) <= 9, "Data Signal Hold Time",
 		    (($bytes->[35] >> 7) ? -$temp : $temp) . " ns");
+
+# Last 2 bytes (126-127) are reserved, Intel used them as an extension
+	decode_intel_spec_freq($bytes);
 }
 
 sub as_ddr($$)
@@ -2693,13 +2696,6 @@  for $current (0 .. $#dimm) {
 		# memory types)
 		decode_manufacturing_information(\@bytes);
 	}
-
-# Next 27 bytes (99-125) are manufacturer specific, can't decode
-
-# Last 2 bytes (126-127) are reserved, Intel used them as an extension
-	if ($type eq "SDR SDRAM") {
-		decode_intel_spec_freq(\@bytes);
-	}
 }
 
 # Side-by-side output format is only possible if all DIMMs have a similar