Changeset 5544

Show
Ignore:
Timestamp:
12/09/08 14:26:58 (3 years ago)
Author:
khali
Message:

Fix handling of Rambus memory modules.

Files:
1 modified

Legend:

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

    r5543 r5544  
    12231223 
    12241224# Returns the (total, used) number of bytes in the EEPROM, 
    1225 # assuming it is an SPD EEPROM. 
     1225# assuming it is a non-Rambus SPD EEPROM. 
    12261226sub spd_sizes($) 
    12271227{ 
     
    14101410         || $use_hexdump) { 
    14111411                my @bytes = readspd(128, $dimm_list[$i]); 
    1412                 my ($spd_size, $spd_used) = spd_sizes(\@bytes); 
     1412                my $is_rambus = $bytes[0] < 4;          # Simple heuristic 
    14131413                my ($l, $chk_valid, $chk_spd, $chk_calc); 
    14141414                if ($bytes[2] < 9) { 
     
    14461446                                $chk_spd, $chk_calc)); 
    14471447 
    1448                 # Simple heuristic to detect Rambus 
    1449                 my $is_rambus = $bytes[0] < 4; 
    14501448                my $temp; 
    14511449                if ($is_rambus) { 
    14521450                        if ($bytes[0] == 1) { $temp = "0.7"; } 
    14531451                        elsif ($bytes[0] == 2) { $temp = "1.0"; } 
    1454                         elsif ($bytes[0] == 0 || $bytes[0] == 255) { $temp = "Invalid"; } 
     1452                        elsif ($bytes[0] == 0) { $temp = "Invalid"; } 
    14551453                        else { $temp = "Reserved"; } 
    14561454                        printl "SPD Revision", $temp; 
    14571455                } else { 
     1456                        my ($spd_size, $spd_used) = spd_sizes(\@bytes); 
    14581457                        printl "# of bytes written to SDRAM EEPROM", $spd_used; 
     1458                        printl "Total number of bytes in EEPROM", $spd_size; 
    14591459                } 
    1460  
    1461                 $l = "Total number of bytes in EEPROM"; 
    1462                 printl $l, $spd_size; 
    14631460 
    14641461                $l = "Fundamental Memory type";