Changeset 5546 for i2c-tools/trunk/eeprom/decode-dimms
- Timestamp:
- 12/09/08 21:43:52 (3 years ago)
- Files:
-
- 1 modified
-
i2c-tools/trunk/eeprom/decode-dimms (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c-tools/trunk/eeprom/decode-dimms
r5545 r5546 283 283 } 284 284 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! 288 sub 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 285 297 sub manufacturer(@) 286 298 { … … 297 309 return ("Invalid", []) unless defined $first; 298 310 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); 302 315 } 303 316
