Changeset 3305 for lm-sensors/trunk/prog/eeprom/decode-dimms.pl
- Timestamp:
- 05/26/06 10:39:20 (7 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/eeprom/decode-dimms.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/eeprom/decode-dimms.pl
r3303 r3305 61 61 # check that the manufacturing date is proper BCD, else fall back to 62 62 # hexadecimal display 63 # Version 1.4 2006-05-26 Jean Delvare <khali@linux-fr.org> 64 # fix latencies decoding (SDRAM) 65 # fix CAS latency decoding (DDR SDRAM) 66 # decode latencies, timings and module height (DDR SDRAM) 63 67 # 64 68 # … … 436 440 437 441 my @cas; 438 for ($ii = 0; $ii < 6; $ii++) {442 for ($ii = 0; $ii < 7; $ii++) { 439 443 push(@cas, $ii + 1) if ($bytes->[18] & (1 << $ii)); 440 444 } … … 555 559 $l = "Supported CS Latencies"; 556 560 @array = (); 557 for ($ii = 0; $ii < 6; $ii++) {561 for ($ii = 0; $ii < 7; $ii++) { 558 562 push(@array, $ii) if ($bytes->[19] & (1 << $ii)); 559 563 } … … 564 568 $l = "Supported WE Latencies"; 565 569 @array = (); 566 for ($ii = 0; $ii < 6; $ii++) {570 for ($ii = 0; $ii < 7; $ii++) { 567 571 push(@array, $ii) if ($bytes->[20] & (1 << $ii)); 568 572 } … … 709 713 #size computation 710 714 711 my $a = $bytes->[3];712 my $b = $bytes->[4];713 my $c = $bytes->[5];714 my $d = $bytes->[17];715 715 my $k=0; 716 716 my $ii=0; 717 717 718 $ii = ( ($a) & 0x0f) + (( $b)& 0x0f) - 17;719 if (( $c <= 8) && ( $d<= 8)) {720 $k = ( $c) * ( $d);718 $ii = ($bytes->[3] & 0x0f) + ($bytes->[4] & 0x0f) - 17; 719 if (($bytes->[5] <= 8) && ($bytes->[17] <= 8)) { 720 $k = $bytes->[5] * $bytes->[17]; 721 721 } 722 722 … … 724 724 printl "Size", ((1 << $ii) * $k) . " MB"; } 725 725 else { 726 printl "INVALID SIZE", $a . "," . $b . "," . $c . "," . $d; 726 printl "INVALID SIZE", $bytes->[3] . ", " . $bytes->[4] . ", " . 727 $bytes->[5] . ", " . $bytes->[17]; 727 728 } 728 729 729 730 my $highestCAS = 0; 731 my %cas; 732 for ($ii = 0; $ii < 7; $ii++) { 733 if ($bytes->[18] & (1 << $ii)) { 734 $highestCAS = 1+$ii*0.5; 735 $cas{$highestCAS}++; 736 } 737 } 738 730 739 my $trcd; 731 740 my $trp; … … 733 742 my $ctime = ($bytes->[9] >> 4) + ($bytes->[9] & 0xf) * 0.1; 734 743 735 if ($bytes->[18] & 1) { $highestCAS = 1; }736 if ($bytes->[18] & 2) { $highestCAS = 1.5; }737 if ($bytes->[18] & 4) { $highestCAS = 2; }738 if ($bytes->[18] & 8) { $highestCAS = 2.5; }739 if ($bytes->[18] & 16) { $highestCAS = 3.5; }740 if ($bytes->[18] & 32) { $highestCAS = 4; }741 if ($bytes->[18] & 64) { $highestCAS = 4.5; }742 if ($bytes->[18] & 128) { $highestCAS = 5; }743 744 744 $trcd =($bytes->[29] >> 2)+(($bytes->[29] & 3)*0.25); 745 745 $trp =($bytes->[27] >> 2)+(($bytes->[27] & 3)*0.25); … … 751 751 ceil($trp/$ctime) . "-" . 752 752 ceil($tras/$ctime); 753 754 # latencies 755 if (keys %cas) { $temp = join ', ', sort { $b <=> $a } keys %cas; } 756 else { $temp = "None"; } 757 printl "Supported CAS Latencies", $temp; 758 759 my @array; 760 for ($ii = 0; $ii < 7; $ii++) { 761 push(@array, $ii) if ($bytes->[19] & (1 << $ii)); 762 } 763 if (@array) { $temp = join ', ', @array; } 764 else { $temp = "None"; } 765 printl "Supported CS Latencies", $temp; 766 767 @array = (); 768 for ($ii = 0; $ii < 7; $ii++) { 769 push(@array, $ii) if ($bytes->[20] & (1 << $ii)); 770 } 771 if (@array) { $temp = join ', ', @array; } 772 else { $temp = "None"; } 773 printl "Supported WE Latencies", $temp; 774 775 # timings 776 if (exists $cas{$highestCAS}) { 777 printl "Minimum Cycle Time (CAS $highestCAS)", 778 "$ctime ns"; 779 780 printl "Maximum Access Time (CAS $highestCAS)", 781 (($bytes->[10] >> 4) * 0.1 + ($bytes->[10] & 0xf) * 0.01) . " ns"; 782 } 783 784 if (exists $cas{$highestCAS-0.5} && spd_written(@$bytes[23..24])) { 785 printl "Minimum Cycle Time (CAS ".($highestCAS-0.5).")", 786 (($bytes->[23] >> 4) + ($bytes->[23] & 0xf) * 0.1) . " ns"; 787 788 printl "Maximum Access Time (CAS ".($highestCAS-0.5).")", 789 (($bytes->[24] >> 4) * 0.1 + ($bytes->[24] & 0xf) * 0.01) . " ns"; 790 } 791 792 if (exists $cas{$highestCAS-1} && spd_written(@$bytes[25..26])) { 793 printl "Minimum Cycle Time (CAS ".($highestCAS-1).")", 794 (($bytes->[25] >> 4) + ($bytes->[25] & 0xf) * 0.1) . " ns"; 795 796 printl "Maximum Access Time (CAS ".($highestCAS-1).")", 797 (($bytes->[26] >> 4) * 0.1 + ($bytes->[26] & 0xf) * 0.01) . " ns"; 798 } 799 800 # module attributes 801 if ($bytes->[47] & 0x03) { 802 if (($bytes->[47] & 0x03) == 0x01) { $temp = "1.125\" to 1.25\""; } 803 elsif (($bytes->[47] & 0x03) == 0x02) { $temp = "1.7\""; } 804 elsif (($bytes->[47] & 0x03) == 0x03) { $temp = "Other"; } 805 printl "Module Height", $temp; 806 } 753 807 } 754 808
