Changeset 3306
- Timestamp:
- 05/26/06 11:23:10 (7 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/eeprom/decode-dimms.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/eeprom/decode-dimms.pl
r3305 r3306 420 420 421 421 #size computation 422 423 my $a = $bytes->[3];424 my $b = $bytes->[4];425 my $c = $bytes->[5];426 my $d = $bytes->[17];427 422 my $k=0; 428 423 my $ii=0; 429 424 430 $ii = ( ($a) & 0x0f) + (( $b)& 0x0f) - 17;431 if (( $c <= 8) && ( $d<= 8)) {432 $k = ( $c) * ( $d);425 $ii = ($bytes->[3] & 0x0f) + ($bytes->[4] & 0x0f) - 17; 426 if (($bytes->[5] <= 8) && ($bytes->[17] <= 8)) { 427 $k = $bytes->[5] * $bytes->[17]; 433 428 } 434 429 … … 436 431 printl "Size", ((1 << $ii) * $k) . " MB"; } 437 432 else { 438 printl "INVALID SIZE", $a . "," . $b . "," . $c . "," . $d; 433 printl "INVALID SIZE", $bytes->[3] . "," . $bytes->[4] . "," . 434 $bytes->[5] . "," . $bytes->[17]; 439 435 } 440 436 … … 577 573 if (@cas >= 1) { 578 574 $l = "Cycle Time (CAS ".$cas[$#cas].")"; 579 $temp = ($bytes->[9] >> 4) + ($bytes->[9] & 0xf) * 0.1; 580 printl $l, "$temp ns"; 575 printl $l, "$ctime ns"; 581 576 582 577 $l = "Access Time (CAS ".$cas[$#cas].")"; … … 712 707 713 708 #size computation 714 715 709 my $k=0; 716 710 my $ii=0; … … 825 819 826 820 #size computation 827 my $a = $bytes->[3];828 my $b = $bytes->[4];829 my $c = $bytes->[5];830 my $d = $bytes->[17];831 821 my $k=0; 832 822 my $ii=0; 833 823 834 $ii = ($ a & 0x0f) + ($b& 0x0f) - 17;835 $k = (($ c & 0x7) + 1) * $d;824 $ii = ($bytes->[3] & 0x0f) + ($bytes->[4] & 0x0f) - 17; 825 $k = (($bytes->[5] & 0x7) + 1) * $bytes->[17]; 836 826 837 827 if($ii > 0 && $ii <= 12 && $k > 0) { 838 828 printl "Size", ((1 << $ii) * $k) . " MB"; 839 829 } else { 840 printl "INVALID SIZE", $a . "," . $b . "," . $c . "," . $d; 830 printl "INVALID SIZE", $bytes->[3] . "," . $bytes->[4] . "," . 831 $bytes->[5] . "," . $bytes->[17]; 841 832 } 842 833 … … 863 854 } 864 855 856 # Parameter: bytes 0-63 857 sub decode_direct_rambus($) 858 { 859 my $bytes = shift; 860 861 #size computation 862 my $ii; 863 864 $ii = ($bytes->[4] & 0x0f) + ($bytes->[4] >> 4) + ($bytes->[5] & 0x07) - 13; 865 866 if ($ii > 0 && $ii < 16) { 867 printl "Size", (1 << $ii) . " MB"; 868 } else { 869 printl "INVALID SIZE", sprintf("0x%02x, 0x%02x", 870 $bytes->[4], $bytes->[5]); 871 } 872 } 873 874 # Parameter: bytes 0-63 875 sub decode_rambus($) 876 { 877 my $bytes = shift; 878 879 #size computation 880 my $ii; 881 882 $ii = ($bytes->[3] & 0x0f) + ($bytes->[3] >> 4) + ($bytes->[5] & 0x07) - 13; 883 884 if ($ii > 0 && $ii < 16) { 885 printl "Size", (1 << $ii) . " MB"; 886 } else { 887 printl "INVALID SIZE", sprintf("0x%02x, 0x%02x", 888 $bytes->[3], $bytes->[5]); 889 } 890 } 891 865 892 %decode_callback = ( 866 893 "SDR SDRAM" => \&decode_sdr_sdram, 867 894 "DDR SDRAM" => \&decode_ddr_sdram, 868 895 "DDR2 SDRAM" => \&decode_ddr2_sdram, 896 "Direct Rambus" => \&decode_direct_rambus, 897 "Rambus" => \&decode_rambus, 869 898 ); 870 899
