From 1611927d5f5cee29b8089575b5ebe55217da51ab Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 18 Apr 2012 07:20:04 +0000 Subject: [PATCH] Decode and print module configuration type (parity, ECC) of DDR2 memory modules. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@6041 7894878c-1315-0410-8ee3-d5d059ff63e0 --- eeprom/decode-dimms | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/eeprom/decode-dimms b/eeprom/decode-dimms index d996a7b..5f0f666 100755 --- a/eeprom/decode-dimms +++ b/eeprom/decode-dimms @@ -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 "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 ($_[0] < @types) ? $types[$_[0]] : "Undefined!"; + 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;