Changeset 5546

Show
Ignore:
Timestamp:
12/09/08 21:43:52 (6 years ago)
Author:
khali
Message:

New manufacturer decoding for DDR3 modules. Patch from Paul Goyette.

Files:
1 modified

Legend:

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

    r5545 r5546  
    283283} 
    284284 
     285# New encoding format (as of DDR3) for manufacturer just has a count of 
     286# leading 0x7F rather than all the individual bytes.  The count bytes includes 
     287# parity! 
     288sub manufacturer_ddr3($$) 
     289{ 
     290        my ($count, $code) = @_; 
     291        return "Invalid" if parity($count) != 1; 
     292        return "Invalid" if parity($code) != 1; 
     293        return (($code & 0x7F) - 1 > $vendors[$count & 0x7F]) ? "Unknown" : 
     294                $vendors[$count & 0x7F][($code & 0x7F) - 1]; 
     295} 
     296 
    285297sub manufacturer(@) 
    286298{ 
     
    297309        return ("Invalid", []) unless defined $first; 
    298310        return ("Invalid", [$first, @bytes]) if parity($first) != 1; 
    299         return ("Unknown", \@bytes) unless (($first & 0x7F) - 1 <= $vendors[$ai]); 
    300  
    301         return ($vendors[$ai][($first & 0x7F) - 1], \@bytes); 
     311        if (parity($ai) == 0) { 
     312                $ai |= 0x80; 
     313        } 
     314        return (manufacturer_ddr3($ai, $first), \@bytes); 
    302315} 
    303316