Browse Source

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

git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5546 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.3
Jean Delvare 17 years ago
parent
commit
f54bbc420d
  1. 19
      eeprom/decode-dimms

19
eeprom/decode-dimms

@ -282,6 +282,18 @@ sub parity($)
return ($parity & 1);
}
# New encoding format (as of DDR3) for manufacturer just has a count of
# leading 0x7F rather than all the individual bytes. The count bytes includes
# parity!
sub manufacturer_ddr3($$)
{
my ($count, $code) = @_;
return "Invalid" if parity($count) != 1;
return "Invalid" if parity($code) != 1;
return (($code & 0x7F) - 1 > $vendors[$count & 0x7F]) ? "Unknown" :
$vendors[$count & 0x7F][($code & 0x7F) - 1];
}
sub manufacturer(@)
{
my @bytes = @_;
@ -296,9 +308,10 @@ sub manufacturer(@)
return ("Invalid", []) unless defined $first;
return ("Invalid", [$first, @bytes]) if parity($first) != 1;
return ("Unknown", \@bytes) unless (($first & 0x7F) - 1 <= $vendors[$ai]);
return ($vendors[$ai][($first & 0x7F) - 1], \@bytes);
if (parity($ai) == 0) {
$ai |= 0x80;
}
return (manufacturer_ddr3($ai, $first), \@bytes);
}
sub manufacturer_data(@)

Loading…
Cancel
Save