Changeset 6041

Show
Ignore:
Timestamp:
04/18/12 09:20:04 (14 months ago)
Author:
khali
Message:

Decode and print module configuration type (parity, ECC) of DDR2 memory
modules.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/trunk/eeprom/decode-dimms

    r5929 r6041  
    526526} 
    527527 
    528 # Common to SDR and DDR SDRAM 
     528# Common to SDR, DDR and DDR2 SDRAM 
    529529sub sdram_module_configuration_type($) 
    530530{ 
    531         my @types = ( 
    532                 "No Parity",                    # 0 
    533                 "Parity",                       # 1 
    534                 "ECC",                          # 2 
    535         ); 
    536  
    537         return ($_[0] < @types) ? $types[$_[0]] : "Undefined!"; 
     531        my $byte = $_[0] & 0x07; 
     532        my @edc; 
     533 
     534        return "No Parity" if $byte == 0; 
     535 
     536        # Data ECC includes Data Parity so don't print both 
     537        push @edc, "Data Parity" if ($byte & 0x03) == 0x01; 
     538        push @edc, "Data ECC" if ($byte & 0x02); 
     539        # New in DDR2 specification 
     540        push @edc, "Address/Command Parity" if ($byte & 0x04); 
     541 
     542        return join ", ", @edc; 
    538543} 
    539544 
     
    10191024        printl("Voltage Interface Level", 
    10201025               sdram_voltage_interface_level($bytes->[8])); 
     1026 
     1027        printl("Module Configuration Type", 
     1028               sdram_module_configuration_type($bytes->[11])); 
    10211029 
    10221030        printl("Refresh Rate", ddr2_refresh_rate($bytes->[12]));