Browse Source

Fix handling of Rambus memory modules.

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

13
eeprom/decode-dimms

@ -1222,7 +1222,7 @@ sub read_hexdump($)
} }
# Returns the (total, used) number of bytes in the EEPROM, # Returns the (total, used) number of bytes in the EEPROM,
# assuming it is an SPD EEPROM.
# assuming it is a non-Rambus SPD EEPROM.
sub spd_sizes($) sub spd_sizes($)
{ {
my $bytes = shift; my $bytes = shift;
@ -1409,7 +1409,7 @@ for my $i ( 0 .. $#dimm_list ) {
|| (!$use_sysfs && /^eeprom-/) || (!$use_sysfs && /^eeprom-/)
|| $use_hexdump) { || $use_hexdump) {
my @bytes = readspd(128, $dimm_list[$i]); my @bytes = readspd(128, $dimm_list[$i]);
my ($spd_size, $spd_used) = spd_sizes(\@bytes);
my $is_rambus = $bytes[0] < 4; # Simple heuristic
my ($l, $chk_valid, $chk_spd, $chk_calc); my ($l, $chk_valid, $chk_spd, $chk_calc);
if ($bytes[2] < 9) { if ($bytes[2] < 9) {
($l, $chk_valid, $chk_spd, $chk_calc) = ($l, $chk_valid, $chk_spd, $chk_calc) =
@ -1445,22 +1445,19 @@ for my $i ( 0 .. $#dimm_list ) {
sprintf("Bad\n(found %s, calculated %s)\n", sprintf("Bad\n(found %s, calculated %s)\n",
$chk_spd, $chk_calc)); $chk_spd, $chk_calc));
# Simple heuristic to detect Rambus
my $is_rambus = $bytes[0] < 4;
my $temp; my $temp;
if ($is_rambus) { if ($is_rambus) {
if ($bytes[0] == 1) { $temp = "0.7"; } if ($bytes[0] == 1) { $temp = "0.7"; }
elsif ($bytes[0] == 2) { $temp = "1.0"; } elsif ($bytes[0] == 2) { $temp = "1.0"; }
elsif ($bytes[0] == 0 || $bytes[0] == 255) { $temp = "Invalid"; }
elsif ($bytes[0] == 0) { $temp = "Invalid"; }
else { $temp = "Reserved"; } else { $temp = "Reserved"; }
printl "SPD Revision", $temp; printl "SPD Revision", $temp;
} else { } else {
my ($spd_size, $spd_used) = spd_sizes(\@bytes);
printl "# of bytes written to SDRAM EEPROM", $spd_used; printl "# of bytes written to SDRAM EEPROM", $spd_used;
printl "Total number of bytes in EEPROM", $spd_size;
} }
$l = "Total number of bytes in EEPROM";
printl $l, $spd_size;
$l = "Fundamental Memory type"; $l = "Fundamental Memory type";
my $type = sprintf("Unknown (0x%02x)", $bytes[2]); my $type = sprintf("Unknown (0x%02x)", $bytes[2]);
if ($is_rambus) { if ($is_rambus) {

Loading…
Cancel
Save