Changeset 5556
- Timestamp:
- 12/11/08 14:46:28 (3 years ago)
- Files:
-
- 1 modified
-
i2c-tools/trunk/eeprom/decode-dimms (modified) (48 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c-tools/trunk/eeprom/decode-dimms
r5555 r5556 440 440 441 441 # SPD revision 442 printl "SPD Revision", $bytes->[62];442 printl("SPD Revision", $bytes->[62]); 443 443 444 444 #size computation 445 445 446 prints "Memory Characteristics";446 prints("Memory Characteristics"); 447 447 448 448 my $k = 0; … … 455 455 456 456 if ($ii > 0 && $ii <= 12 && $k > 0) { 457 printl "Size", ((1 << $ii) * $k) . " MB";457 printl("Size", ((1 << $ii) * $k) . " MB"); 458 458 } else { 459 printl "INVALID SIZE", $bytes->[3] . "," . $bytes->[4] . "," .460 $bytes->[5] . "," . $bytes->[17] ;459 printl("INVALID SIZE", $bytes->[3] . "," . $bytes->[4] . "," . 460 $bytes->[5] . "," . $bytes->[17]); 461 461 } 462 462 … … 475 475 $tras = $bytes->[30]; 476 476 477 printl "tCL-tRCD-tRP-tRAS",477 printl("tCL-tRCD-tRP-tRAS", 478 478 $cas[$#cas] . "-" . 479 479 ceil($trcd/$ctime) . "-" . 480 480 ceil($trp/$ctime) . "-" . 481 ceil($tras/$ctime) ;481 ceil($tras/$ctime)); 482 482 483 483 $l = "Number of Row Address Bits"; 484 if ($bytes->[3] == 0) { printl $l, "Undefined!"; }485 elsif ($bytes->[3] == 1) { printl $l, "1/16"; }486 elsif ($bytes->[3] == 2) { printl $l, "2/17"; }487 elsif ($bytes->[3] == 3) { printl $l, "3/18"; }488 else { printl $l, $bytes->[3]; }484 if ($bytes->[3] == 0) { printl($l, "Undefined!"); } 485 elsif ($bytes->[3] == 1) { printl($l, "1/16"); } 486 elsif ($bytes->[3] == 2) { printl($l, "2/17"); } 487 elsif ($bytes->[3] == 3) { printl($l, "3/18"); } 488 else { printl($l, $bytes->[3]); } 489 489 490 490 $l = "Number of Col Address Bits"; 491 if ($bytes->[4] == 0) { printl $l, "Undefined!"; }492 elsif ($bytes->[4] == 1) { printl $l, "1/16"; }493 elsif ($bytes->[4] == 2) { printl $l, "2/17"; }494 elsif ($bytes->[4] == 3) { printl $l, "3/18"; }495 else { printl $l, $bytes->[4]; }491 if ($bytes->[4] == 0) { printl($l, "Undefined!"); } 492 elsif ($bytes->[4] == 1) { printl($l, "1/16"); } 493 elsif ($bytes->[4] == 2) { printl($l, "2/17"); } 494 elsif ($bytes->[4] == 3) { printl($l, "3/18"); } 495 else { printl($l, $bytes->[4]); } 496 496 497 497 $l = "Number of Module Rows"; 498 if ($bytes->[5] == 0 ) { printl $l, "Undefined!"; }499 else { printl $l, $bytes->[5]; }498 if ($bytes->[5] == 0 ) { printl($l, "Undefined!"); } 499 else { printl($l, $bytes->[5]); } 500 500 501 501 $l = "Data Width"; 502 502 if ($bytes->[7] > 1) { 503 printl $l, "Undefined!"503 printl($l, "Undefined!"); 504 504 } else { 505 505 $temp = ($bytes->[7] * 256) + $bytes->[6]; 506 printl $l, $temp;506 printl($l, $temp); 507 507 } 508 508 509 509 $l = "Module Interface Signal Levels"; 510 if ($bytes->[8] == 0) { printl $l, "5.0 Volt/TTL"; }511 elsif ($bytes->[8] == 1) { printl $l, "LVTTL"; }512 elsif ($bytes->[8] == 2) { printl $l, "HSTL 1.5"; }513 elsif ($bytes->[8] == 3) { printl $l, "SSTL 3.3"; }514 elsif ($bytes->[8] == 4) { printl $l, "SSTL 2.5"; }515 elsif ($bytes->[8] == 255) { printl $l, "New Table"; }516 else { printl $l, "Undefined!"; }510 if ($bytes->[8] == 0) { printl($l, "5.0 Volt/TTL"); } 511 elsif ($bytes->[8] == 1) { printl($l, "LVTTL"); } 512 elsif ($bytes->[8] == 2) { printl($l, "HSTL 1.5"); } 513 elsif ($bytes->[8] == 3) { printl($l, "SSTL 3.3"); } 514 elsif ($bytes->[8] == 4) { printl($l, "SSTL 2.5"); } 515 elsif ($bytes->[8] == 255) { printl($l, "New Table"); } 516 else { printl($l, "Undefined!"); } 517 517 518 518 $l = "Module Configuration Type"; 519 if ($bytes->[11] == 0) { printl $l, "No Parity"; }520 elsif ($bytes->[11] == 1) { printl $l, "Parity"; }521 elsif ($bytes->[11] == 2) { printl $l, "ECC";}522 else { printl $l, "Undefined!"; }519 if ($bytes->[11] == 0) { printl($l, "No Parity"); } 520 elsif ($bytes->[11] == 1) { printl($l, "Parity"); } 521 elsif ($bytes->[11] == 2) { printl($l, "ECC"); } 522 else { printl($l, "Undefined!"); } 523 523 524 524 $l = "Refresh Type"; 525 if ($bytes->[12] > 126) { printl $l, "Self Refreshing"; }526 else { printl $l, "Not Self Refreshing"; }525 if ($bytes->[12] > 126) { printl($l, "Self Refreshing"); } 526 else { printl($l, "Not Self Refreshing"); } 527 527 528 528 $l = "Refresh Rate"; 529 529 $temp = $bytes->[12] & 0x7f; 530 if ($temp == 0) { printl $l, "Normal (15.625 us)"; }531 elsif ($temp == 1) { printl $l, "Reduced (3.9 us)"; }532 elsif ($temp == 2) { printl $l, "Reduced (7.8 us)"; }533 elsif ($temp == 3) { printl $l, "Extended (31.3 us)"; }534 elsif ($temp == 4) { printl $l, "Extended (62.5 us)"; }535 elsif ($temp == 5) { printl $l, "Extended (125 us)"; }536 else { printl $l, "Undefined!"; }530 if ($temp == 0) { printl($l, "Normal (15.625 us)"); } 531 elsif ($temp == 1) { printl($l, "Reduced (3.9 us)"); } 532 elsif ($temp == 2) { printl($l, "Reduced (7.8 us)"); } 533 elsif ($temp == 3) { printl($l, "Extended (31.3 us)"); } 534 elsif ($temp == 4) { printl($l, "Extended (62.5 us)"); } 535 elsif ($temp == 5) { printl($l, "Extended (125 us)"); } 536 else { printl($l, "Undefined!"); } 537 537 538 538 $l = "Primary SDRAM Component Bank Config"; 539 if ($bytes->[13] > 126) { printl $l, "Bank2 = 2 x Bank1"; }540 else { printl $l, "No Bank2 OR Bank2 = Bank1 width"; }539 if ($bytes->[13] > 126) { printl($l, "Bank2 = 2 x Bank1"); } 540 else { printl($l, "No Bank2 OR Bank2 = Bank1 width"); } 541 541 542 542 $l = "Primary SDRAM Component Widths"; 543 543 $temp = $bytes->[13] & 0x7f; 544 if ($temp == 0) { printl $l, "Undefined!"; }545 else { printl $l, $temp; }544 if ($temp == 0) { printl($l, "Undefined!"); } 545 else { printl($l, $temp); } 546 546 547 547 $l = "Error Checking SDRAM Component Bank Config"; 548 if ($bytes->[14] > 126) { printl $l, "Bank2 = 2 x Bank1"; }549 else { printl $l, "No Bank2 OR Bank2 = Bank1 width"; }548 if ($bytes->[14] > 126) { printl($l, "Bank2 = 2 x Bank1"); } 549 else { printl($l, "No Bank2 OR Bank2 = Bank1 width"); } 550 550 551 551 $l = "Error Checking SDRAM Component Widths"; 552 552 $temp = $bytes->[14] & 0x7f; 553 if ($temp == 0) { printl $l, "Undefined!"; }554 else { printl $l, $temp; }553 if ($temp == 0) { printl($l, "Undefined!"); } 554 else { printl($l, $temp); } 555 555 556 556 $l = "Min Clock Delay for Back to Back Random Access"; 557 if ($bytes->[15] == 0) { printl $l, "Undefined!"; }558 else { printl $l, $bytes->[15]; }557 if ($bytes->[15] == 0) { printl($l, "Undefined!"); } 558 else { printl($l, $bytes->[15]); } 559 559 560 560 $l = "Supported Burst Lengths"; … … 566 566 if (@array) { $temp = join ', ', @array; } 567 567 else { $temp = "None"; } 568 printl $l, $temp;568 printl($l, $temp); 569 569 570 570 $l = "Number of Device Banks"; 571 if ($bytes->[17] == 0) { printl $l, "Undefined/Reserved!"; }572 else { printl $l, $bytes->[17]; }571 if ($bytes->[17] == 0) { printl($l, "Undefined/Reserved!"); } 572 else { printl($l, $bytes->[17]); } 573 573 574 574 $l = "Supported CAS Latencies"; 575 printl $l, cas_latencies(@cas);575 printl($l, cas_latencies(@cas)); 576 576 577 577 $l = "Supported CS Latencies"; … … 582 582 if (@array) { $temp = join ', ', @array; } 583 583 else { $temp = "None"; } 584 printl $l, $temp;584 printl($l, $temp); 585 585 586 586 $l = "Supported WE Latencies"; … … 591 591 if (@array) { $temp = join ', ', @array; } 592 592 else { $temp = "None"; } 593 printl $l, $temp;593 printl($l, $temp); 594 594 595 595 if (@cas >= 1) { 596 596 $l = "Cycle Time at CAS ".$cas[$#cas]; 597 printl $l, "$ctime ns";597 printl($l, "$ctime ns"); 598 598 599 599 $l = "Access Time at CAS ".$cas[$#cas]; 600 600 $temp = ($bytes->[10] >> 4) + ($bytes->[10] & 0xf) * 0.1; 601 printl $l, "$temp ns";601 printl($l, "$temp ns"); 602 602 } 603 603 … … 605 605 $l = "Cycle Time at CAS ".$cas[$#cas-1]; 606 606 $temp = $bytes->[23] >> 4; 607 if ($temp == 0) { printl $l, "Undefined!"; }607 if ($temp == 0) { printl($l, "Undefined!"); } 608 608 else { 609 609 if ($temp < 4 ) { $temp += 15; } 610 printl $l, $temp + (($bytes->[23] & 0xf) * 0.1) . " ns";610 printl($l, $temp + (($bytes->[23] & 0xf) * 0.1) . " ns"); 611 611 } 612 612 613 613 $l = "Access Time at CAS ".$cas[$#cas-1]; 614 614 $temp = $bytes->[24] >> 4; 615 if ($temp == 0) { printl $l, "Undefined!"; }615 if ($temp == 0) { printl($l, "Undefined!"); } 616 616 else { 617 617 if ($temp < 4 ) { $temp += 15; } 618 printl $l, $temp + (($bytes->[24] & 0xf) * 0.1) . " ns";618 printl($l, $temp + (($bytes->[24] & 0xf) * 0.1) . " ns"); 619 619 } 620 620 } … … 623 623 $l = "Cycle Time at CAS ".$cas[$#cas-2]; 624 624 $temp = $bytes->[25] >> 2; 625 if ($temp == 0) { printl $l, "Undefined!"; }626 else { printl $l, $temp + ($bytes->[25] & 0x3) * 0.25 . " ns"; }625 if ($temp == 0) { printl($l, "Undefined!"); } 626 else { printl($l, $temp + ($bytes->[25] & 0x3) * 0.25 . " ns"); } 627 627 628 628 $l = "Access Time at CAS ".$cas[$#cas-2]; 629 629 $temp = $bytes->[26] >> 2; 630 if ($temp == 0) { printl $l, "Undefined!"; }631 else { printl $l, $temp + ($bytes->[26] & 0x3) * 0.25 . " ns"; }630 if ($temp == 0) { printl($l, "Undefined!"); } 631 else { printl($l, $temp + ($bytes->[26] & 0x3) * 0.25 . " ns"); } 632 632 } 633 633 … … 643 643 if ($bytes->[21] & 128) { $temp .= "Undefined (bit 7)\n"; } 644 644 if ($bytes->[21] == 0) { $temp .= "(None Reported)\n"; } 645 printl $l, $temp;645 printl($l, $temp); 646 646 647 647 $l = "SDRAM Device Attributes (General)"; … … 657 657 if ($bytes->[22] & 64) { $temp .= "Undefined (bit 6)\n"; } 658 658 if ($bytes->[22] & 128) { $temp .= "Undefined (bit 7)\n"; } 659 printl $l, $temp;659 printl($l, $temp); 660 660 661 661 $l = "Minimum Row Precharge Time"; 662 if ($bytes->[27] == 0) { printl $l, "Undefined!"; }663 else { printl $l, "$bytes->[27] ns"; }662 if ($bytes->[27] == 0) { printl($l, "Undefined!"); } 663 else { printl($l, "$bytes->[27] ns"); } 664 664 665 665 $l = "Row Active to Row Active Min"; 666 if ($bytes->[28] == 0) { printl $l, "Undefined!"; }667 else { printl $l, "$bytes->[28] ns"; }666 if ($bytes->[28] == 0) { printl($l, "Undefined!"); } 667 else { printl($l, "$bytes->[28] ns"); } 668 668 669 669 $l = "RAS to CAS Delay"; 670 if ($bytes->[29] == 0) { printl $l, "Undefined!"; }671 else { printl $l, "$bytes->[29] ns"; }670 if ($bytes->[29] == 0) { printl($l, "Undefined!"); } 671 else { printl($l, "$bytes->[29] ns"); } 672 672 673 673 $l = "Min RAS Pulse Width"; 674 if ($bytes->[30] == 0) { printl $l, "Undefined!"; }675 else { printl $l, "$bytes->[30] ns"; }674 if ($bytes->[30] == 0) { printl($l, "Undefined!"); } 675 else { printl($l, "$bytes->[30] ns"); } 676 676 677 677 $l = "Row Densities"; … … 686 686 if ($bytes->[31] & 128) { $temp .= "512 MByte\n"; } 687 687 if ($bytes->[31] == 0) { $temp .= "(Undefined! -- None Reported!)\n"; } 688 printl $l, $temp;688 printl($l, $temp); 689 689 690 690 if (($bytes->[32] & 0xf) <= 9) { 691 691 $l = "Command and Address Signal Setup Time"; 692 692 $temp = (($bytes->[32] & 0x7f) >> 4) + ($bytes->[32] & 0xf) * 0.1; 693 printl $l, (($bytes->[32] >> 7) ? -$temp : $temp) . " ns";693 printl($l, (($bytes->[32] >> 7) ? -$temp : $temp) . " ns"); 694 694 } 695 695 … … 697 697 $l = "Command and Address Signal Hold Time"; 698 698 $temp = (($bytes->[33] & 0x7f) >> 4) + ($bytes->[33] & 0xf) * 0.1; 699 printl $l, (($bytes->[33] >> 7) ? -$temp : $temp) . " ns";699 printl($l, (($bytes->[33] >> 7) ? -$temp : $temp) . " ns"); 700 700 } 701 701 … … 703 703 $l = "Data Signal Setup Time"; 704 704 $temp = (($bytes->[34] & 0x7f) >> 4) + ($bytes->[34] & 0xf) * 0.1; 705 printl $l, (($bytes->[34] >> 7) ? -$temp : $temp) . " ns";705 printl($l, (($bytes->[34] >> 7) ? -$temp : $temp) . " ns"); 706 706 } 707 707 … … 709 709 $l = "Data Signal Hold Time"; 710 710 $temp = (($bytes->[35] & 0x7f) >> 4) + ($bytes->[35] & 0xf) * 0.1; 711 printl $l, (($bytes->[35] >> 7) ? -$temp : $temp) . " ns";711 printl($l, (($bytes->[35] >> 7) ? -$temp : $temp) . " ns"); 712 712 } 713 713 } … … 721 721 # SPD revision 722 722 if ($bytes->[62] != 0xff) { 723 printl "SPD Revision", ($bytes->[62] >> 4) . "." .724 ($bytes->[62] & 0xf) ;723 printl("SPD Revision", ($bytes->[62] >> 4) . "." . 724 ($bytes->[62] & 0xf)); 725 725 } 726 726 727 727 # speed 728 prints "Memory Characteristics";728 prints("Memory Characteristics"); 729 729 730 730 $l = "Maximum module speed"; … … 737 737 $pcclk = $pcclk - ($pcclk % 100); 738 738 $ddrclk = int ($ddrclk); 739 printl $l, "${ddrclk}MHz (PC${pcclk})";739 printl($l, "${ddrclk}MHz (PC${pcclk})"); 740 740 741 741 #size computation … … 749 749 750 750 if ($ii > 0 && $ii <= 12 && $k > 0) { 751 printl "Size", ((1 << $ii) * $k) . " MB";751 printl("Size", ((1 << $ii) * $k) . " MB"); 752 752 } else { 753 printl "INVALID SIZE", $bytes->[3] . ", " . $bytes->[4] . ", " .754 $bytes->[5] . ", " . $bytes->[17] ;753 printl("INVALID SIZE", $bytes->[3] . ", " . $bytes->[4] . ", " . 754 $bytes->[5] . ", " . $bytes->[17]); 755 755 } 756 756 … … 773 773 $tras = $bytes->[30]; 774 774 775 printl "tCL-tRCD-tRP-tRAS",775 printl("tCL-tRCD-tRP-tRAS", 776 776 $highestCAS . "-" . 777 777 ceil($trcd/$ctime) . "-" . 778 778 ceil($trp/$ctime) . "-" . 779 ceil($tras/$ctime) ;779 ceil($tras/$ctime)); 780 780 781 781 # latencies 782 printl "Supported CAS Latencies", cas_latencies(keys %cas);782 printl("Supported CAS Latencies", cas_latencies(keys %cas)); 783 783 784 784 my @array; … … 788 788 if (@array) { $temp = join ', ', @array; } 789 789 else { $temp = "None"; } 790 printl "Supported CS Latencies", $temp;790 printl("Supported CS Latencies", $temp); 791 791 792 792 @array = (); … … 796 796 if (@array) { $temp = join ', ', @array; } 797 797 else { $temp = "None"; } 798 printl "Supported WE Latencies", $temp;798 printl("Supported WE Latencies", $temp); 799 799 800 800 # timings 801 801 if (exists $cas{$highestCAS}) { 802 printl "Minimum Cycle Time at CAS $highestCAS",803 "$ctime ns" ;804 805 printl "Maximum Access Time at CAS $highestCAS",806 (($bytes->[10] >> 4) * 0.1 + ($bytes->[10] & 0xf) * 0.01) . " ns" ;802 printl("Minimum Cycle Time at CAS $highestCAS", 803 "$ctime ns"); 804 805 printl("Maximum Access Time at CAS $highestCAS", 806 (($bytes->[10] >> 4) * 0.1 + ($bytes->[10] & 0xf) * 0.01) . " ns"); 807 807 } 808 808 809 809 if (exists $cas{$highestCAS-0.5} && spd_written(@$bytes[23..24])) { 810 printl "Minimum Cycle Time at CAS ".($highestCAS-0.5),811 (($bytes->[23] >> 4) + ($bytes->[23] & 0xf) * 0.1) . " ns" ;812 813 printl "Maximum Access Time at CAS ".($highestCAS-0.5),814 (($bytes->[24] >> 4) * 0.1 + ($bytes->[24] & 0xf) * 0.01) . " ns" ;810 printl("Minimum Cycle Time at CAS ".($highestCAS-0.5), 811 (($bytes->[23] >> 4) + ($bytes->[23] & 0xf) * 0.1) . " ns"); 812 813 printl("Maximum Access Time at CAS ".($highestCAS-0.5), 814 (($bytes->[24] >> 4) * 0.1 + ($bytes->[24] & 0xf) * 0.01) . " ns"); 815 815 } 816 816 817 817 if (exists $cas{$highestCAS-1} && spd_written(@$bytes[25..26])) { 818 printl "Minimum Cycle Time at CAS ".($highestCAS-1),819 (($bytes->[25] >> 4) + ($bytes->[25] & 0xf) * 0.1) . " ns" ;820 821 printl "Maximum Access Time at CAS ".($highestCAS-1),822 (($bytes->[26] >> 4) * 0.1 + ($bytes->[26] & 0xf) * 0.01) . " ns" ;818 printl("Minimum Cycle Time at CAS ".($highestCAS-1), 819 (($bytes->[25] >> 4) + ($bytes->[25] & 0xf) * 0.1) . " ns"); 820 821 printl("Maximum Access Time at CAS ".($highestCAS-1), 822 (($bytes->[26] >> 4) * 0.1 + ($bytes->[26] & 0xf) * 0.01) . " ns"); 823 823 } 824 824 … … 828 828 elsif (($bytes->[47] & 0x03) == 0x02) { $temp = "1.7\""; } 829 829 elsif (($bytes->[47] & 0x03) == 0x03) { $temp = "Other"; } 830 printl "Module Height", $temp;830 printl("Module Height", $temp); 831 831 } 832 832 } … … 901 901 # SPD revision 902 902 if ($bytes->[62] != 0xff) { 903 printl "SPD Revision", ($bytes->[62] >> 4) . "." .904 ($bytes->[62] & 0xf) ;903 printl("SPD Revision", ($bytes->[62] >> 4) . "." . 904 ($bytes->[62] & 0xf)); 905 905 } 906 906 907 907 # speed 908 prints "Memory Characteristics";908 prints("Memory Characteristics"); 909 909 910 910 $l = "Maximum module speed"; … … 917 917 $pcclk = $pcclk - ($pcclk % 100); 918 918 $ddrclk = int ($ddrclk); 919 printl $l, "${ddrclk}MHz (PC2-${pcclk})";919 printl($l, "${ddrclk}MHz (PC2-${pcclk})"); 920 920 921 921 #size computation … … 927 927 928 928 if($ii > 0 && $ii <= 12 && $k > 0) { 929 printl "Size", ((1 << $ii) * $k) . " MB";929 printl("Size", ((1 << $ii) * $k) . " MB"); 930 930 } else { 931 printl "INVALID SIZE", $bytes->[3] . "," . $bytes->[4] . "," .932 $bytes->[5] . "," . $bytes->[17] ;933 } 934 935 printl "Banks x Rows x Columns x Bits",936 join(' x ', $bytes->[17], $bytes->[3], $bytes->[4], $bytes->[6]) ;937 printl "Ranks", ($bytes->[5] & 7) + 1;938 939 printl "SDRAM Device Width", $bytes->[13]." bits";931 printl("INVALID SIZE", $bytes->[3] . "," . $bytes->[4] . "," . 932 $bytes->[5] . "," . $bytes->[17]); 933 } 934 935 printl("Banks x Rows x Columns x Bits", 936 join(' x ', $bytes->[17], $bytes->[3], $bytes->[4], $bytes->[6])); 937 printl("Ranks", ($bytes->[5] & 7) + 1); 938 939 printl("SDRAM Device Width", $bytes->[13]." bits"); 940 940 941 941 my @heights = ('< 25.4', '25.4', '25.4 - 30.0', '30.0', '30.5', '> 30.5'); 942 printl "Module Height", $heights[$bytes->[5] >> 5]." mm";942 printl("Module Height", $heights[$bytes->[5] >> 5]." mm"); 943 943 944 944 my @suptypes = ddr2_module_types($bytes->[20]); 945 printl "Module Type".(@suptypes > 1 ? 's' : ''), join(', ', @suptypes);946 947 printl "DRAM Package", $bytes->[5] & 0x10 ? "Stack" : "Planar";945 printl("Module Type".(@suptypes > 1 ? 's' : ''), join(', ', @suptypes)); 946 947 printl("DRAM Package", $bytes->[5] & 0x10 ? "Stack" : "Planar"); 948 948 949 949 my @volts = ("TTL (5V Tolerant)", "LVTTL", "HSTL 1.5V", 950 950 "SSTL 3.3V", "SSTL 2.5V", "SSTL 1.8V", "TBD"); 951 printl "Voltage Interface Level", $volts[$bytes->[8]];952 953 printl "Refresh Rate", ddr2_refresh_rate($bytes->[12]);951 printl("Voltage Interface Level", $volts[$bytes->[8]]); 952 953 printl("Refresh Rate", ddr2_refresh_rate($bytes->[12])); 954 954 955 955 my @burst; … … 957 957 push @burst, 8 if ($bytes->[16] & 8); 958 958 $burst[0] = 'None' if !@burst; 959 printl "Supported Burst Lengths", join(', ', @burst);959 printl("Supported Burst Lengths", join(', ', @burst)); 960 960 961 961 my $highestCAS = 0; … … 976 976 $tras = $bytes->[30]; 977 977 978 printl "tCL-tRCD-tRP-tRAS",978 printl("tCL-tRCD-tRP-tRAS", 979 979 $highestCAS . "-" . 980 980 ceil($trcd/$ctime) . "-" . 981 981 ceil($trp/$ctime) . "-" . 982 ceil($tras/$ctime) ;982 ceil($tras/$ctime)); 983 983 984 984 # latencies 985 printl "Supported CAS Latencies (tCL)", cas_latencies(keys %cas);985 printl("Supported CAS Latencies (tCL)", cas_latencies(keys %cas)); 986 986 987 987 # timings 988 988 if (exists $cas{$highestCAS}) { 989 printl "Minimum Cycle Time at CAS $highestCAS (tCK min)",990 tns($ctime) ;991 printl "Maximum Access Time at CAS $highestCAS (tAC)",992 tns(ddr2_sdram_atime($bytes->[10])) ;989 printl("Minimum Cycle Time at CAS $highestCAS (tCK min)", 990 tns($ctime)); 991 printl("Maximum Access Time at CAS $highestCAS (tAC)", 992 tns(ddr2_sdram_atime($bytes->[10]))); 993 993 } 994 994 995 995 if (exists $cas{$highestCAS-1} && spd_written(@$bytes[23..24])) { 996 printl "Minimum Cycle Time at CAS ".($highestCAS-1),997 tns(ddr2_sdram_ctime($bytes->[23])) ;998 printl "Maximum Access Time at CAS ".($highestCAS-1),999 tns(ddr2_sdram_atime($bytes->[24])) ;996 printl("Minimum Cycle Time at CAS ".($highestCAS-1), 997 tns(ddr2_sdram_ctime($bytes->[23]))); 998 printl("Maximum Access Time at CAS ".($highestCAS-1), 999 tns(ddr2_sdram_atime($bytes->[24]))); 1000 1000 } 1001 1001 1002 1002 if (exists $cas{$highestCAS-2} && spd_written(@$bytes[25..26])) { 1003 printl "Minimum Cycle Time at CAS ".($highestCAS-2),1004 tns(ddr2_sdram_ctime($bytes->[25])) ;1005 printl "Maximum Access Time at CAS ".($highestCAS-2),1006 tns(ddr2_sdram_atime($bytes->[26])) ;1007 } 1008 printl "Maximum Cycle Time (tCK max)",1009 tns(ddr2_sdram_ctime($bytes->[43])) ;1003 printl("Minimum Cycle Time at CAS ".($highestCAS-2), 1004 tns(ddr2_sdram_ctime($bytes->[25]))); 1005 printl("Maximum Access Time at CAS ".($highestCAS-2), 1006 tns(ddr2_sdram_atime($bytes->[26]))); 1007 } 1008 printl("Maximum Cycle Time (tCK max)", 1009 tns(ddr2_sdram_ctime($bytes->[43]))); 1010 1010 1011 1011 # more timing information 1012 1012 prints("Timing Parameters"); 1013 printl "Address/Command Setup Time Before Clock (tIS)",1014 tns(ddr2_sdram_atime($bytes->[32])) ;1015 printl "Address/Command Hold Time After Clock (tIH)",1016 tns(ddr2_sdram_atime($bytes->[33])) ;1017 printl "Data Input Setup Time Before Strobe (tDS)",1018 tns(ddr2_sdram_atime($bytes->[34])) ;1019 printl "Data Input Hold Time After Strobe (tDH)",1020 tns(ddr2_sdram_atime($bytes->[35])) ;1021 printl "Minimum Row Precharge Delay (tRP)", tns($trp);1022 printl "Minimum Row Active to Row Active Delay (tRRD)",1023 tns($bytes->[28]/4) ;1024 printl "Minimum RAS# to CAS# Delay (tRCD)", tns($trcd);1025 printl "Minimum RAS# Pulse Width (tRAS)", tns($tras);1026 printl "Write Recovery Time (tWR)", tns($bytes->[36]/4);1027 printl "Minimum Write to Read CMD Delay (tWTR)", tns($bytes->[37]/4);1028 printl "Minimum Read to Pre-charge CMD Delay (tRTP)", tns($bytes->[38]/4);1029 printl "Minimum Active to Auto-refresh Delay (tRC)",1030 tns(ddr2_sdram_rtime($bytes->[41], 0, ($bytes->[40] >> 4) & 7)) ;1031 printl "Minimum Recovery Delay (tRFC)",1013 printl("Address/Command Setup Time Before Clock (tIS)", 1014 tns(ddr2_sdram_atime($bytes->[32]))); 1015 printl("Address/Command Hold Time After Clock (tIH)", 1016 tns(ddr2_sdram_atime($bytes->[33]))); 1017 printl("Data Input Setup Time Before Strobe (tDS)", 1018 tns(ddr2_sdram_atime($bytes->[34]))); 1019 printl("Data Input Hold Time After Strobe (tDH)", 1020 tns(ddr2_sdram_atime($bytes->[35]))); 1021 printl("Minimum Row Precharge Delay (tRP)", tns($trp)); 1022 printl("Minimum Row Active to Row Active Delay (tRRD)", 1023 tns($bytes->[28]/4)); 1024 printl("Minimum RAS# to CAS# Delay (tRCD)", tns($trcd)); 1025 printl("Minimum RAS# Pulse Width (tRAS)", tns($tras)); 1026 printl("Write Recovery Time (tWR)", tns($bytes->[36]/4)); 1027 printl("Minimum Write to Read CMD Delay (tWTR)", tns($bytes->[37]/4)); 1028 printl("Minimum Read to Pre-charge CMD Delay (tRTP)", tns($bytes->[38]/4)); 1029 printl("Minimum Active to Auto-refresh Delay (tRC)", 1030 tns(ddr2_sdram_rtime($bytes->[41], 0, ($bytes->[40] >> 4) & 7))); 1031 printl("Minimum Recovery Delay (tRFC)", 1032 1032 tns(ddr2_sdram_rtime($bytes->[42], $bytes->[40] & 1, 1033 ($bytes->[40] >> 1) & 7)) ;1034 printl "Maximum DQS to DQ Skew (tDQSQ)", tns($bytes->[44]/100);1035 printl "Maximum Read Data Hold Skew (tQHS)", tns($bytes->[45]/100);1036 printl "PLL Relock Time", $bytes->[46] . " us"if ($bytes->[46]);1033 ($bytes->[40] >> 1) & 7))); 1034 printl("Maximum DQS to DQ Skew (tDQSQ)", tns($bytes->[44]/100)); 1035 printl("Maximum Read Data Hold Skew (tQHS)", tns($bytes->[45]/100)); 1036 printl("PLL Relock Time", $bytes->[46] . " us") if ($bytes->[46]); 1037 1037 } 1038 1038 … … 1048 1048 "Micro-DIMM", "Mini-RDIMM", "Mini-UDIMM"); 1049 1049 1050 printl "Module Type", ($bytes->[3] <= $#module_types) ?1050 printl("Module Type", ($bytes->[3] <= $#module_types) ? 1051 1051 $module_types[$bytes->[3]] : 1052 sprint("Reserved (0x%.2X)", $bytes->[3]) ;1052 sprint("Reserved (0x%.2X)", $bytes->[3])); 1053 1053 1054 1054 # speed 1055 prints "Memory Characteristics";1055 prints("Memory Characteristics"); 1056 1056 1057 1057 $l = "Fine time base"; 1058 1058 my $dividend = ($bytes->[9] >> 4) & 15; 1059 1059 my $divisor = $bytes->[9] & 15; 1060 printl $l, sprintf("%.3f", $dividend / $divisor) . " ps";1060 printl($l, sprintf("%.3f", $dividend / $divisor) . " ps"); 1061 1061 1062 1062 $l = "Medium time base"; … … 1064 1064 $divisor = $bytes->[11]; 1065 1065 my $mtb = $dividend / $divisor; 1066 printl $l, tns3($mtb);1066 printl($l, tns3($mtb)); 1067 1067 1068 1068 $l = "Maximum module speed"; … … 1072 1072 my $pcclk = int ($ddrclk * $tbits / 8); 1073 1073 $ddrclk = int ($ddrclk); 1074 printl $l, "${ddrclk}MHz (PC3-${pcclk})";1074 printl($l, "${ddrclk}MHz (PC3-${pcclk})"); 1075 1075 1076 1076 # Size computation … … 1081 1081 $cap -= 20 + 3; 1082 1082 my $k = (($bytes->[7] >> 3) & 31) + 1; 1083 printl "Size", ((1 << $cap) * $k) . " MB";1084 1085 printl "Banks x Rows x Columns x Bits",1083 printl("Size", ((1 << $cap) * $k) . " MB"); 1084 1085 printl("Banks x Rows x Columns x Bits", 1086 1086 join(' x ', 1 << ((($bytes->[4] >> 4) & 7) + 3), 1087 1087 ((($bytes->[5] >> 3) & 31) + 12), 1088 1088 ( ($bytes->[5] & 7) + 9), 1089 ( 1 << (($bytes->[8] & 7) + 3)) ) ;1090 printl "Ranks", $k;1091 1092 printl "SDRAM Device Width", (1 << (($bytes->[7] & 7) + 2))." bits";1089 ( 1 << (($bytes->[8] & 7) + 3)) )); 1090 printl("Ranks", $k); 1091 1092 printl("SDRAM Device Width", (1 << (($bytes->[7] & 7) + 2))." bits"); 1093 1093 1094 1094 my $taa; … … 1102 1102 $tras = int((($bytes->[21] >> 4) * 256 + $bytes->[22]) / $bytes->[12]); 1103 1103 1104 printl "tCL-tRCD-tRP-tRAS", join("-", $taa, $trcd, $trp, $tras);1104 printl("tCL-tRCD-tRP-tRAS", join("-", $taa, $trcd, $trp, $tras)); 1105 1105 1106 1106 # latencies … … 1115 1115 } 1116 1116 } 1117 printl "Supported CAS Latencies (tCL)", cas_latencies(keys %cas);1117 printl("Supported CAS Latencies (tCL)", cas_latencies(keys %cas)); 1118 1118 1119 1119 # more timing information 1120 prints "Timing Parameters";1121 1122 printl "Minimum Write Recovery time (tWR)", tns3($bytes->[17] * $mtb);1123 printl "Minimum Row Active to Row Active Delay (tRRD)",1124 tns3($bytes->[19] * $mtb) ;1125 printl "Minimum Active to Auto-Refresh Delay (tRC)",1126 tns3((((($bytes->[21] >> 4) & 15) << 8) + $bytes->[23]) * $mtb) ;1127 printl "Minimum Recovery Delay (tRFC)",1128 tns3((($bytes->[25] << 8) + $bytes->[24]) * $mtb) ;1129 printl "Minimum Write to Read CMD Delay (tWTR)",1130 tns3($bytes->[26] * $mtb) ;1131 printl "Minimum Read to Pre-charge CMD Delay (tRTP)",1132 tns3($bytes->[27] * $mtb) ;1133 printl "Minimum Four Activate Window Delay (tFAW)",1134 tns3(((($bytes->[28] & 15) << 8) + $bytes->[29]) * $mtb) ;1120 prints("Timing Parameters"); 1121 1122 printl("Minimum Write Recovery time (tWR)", tns3($bytes->[17] * $mtb)); 1123 printl("Minimum Row Active to Row Active Delay (tRRD)", 1124 tns3($bytes->[19] * $mtb)); 1125 printl("Minimum Active to Auto-Refresh Delay (tRC)", 1126 tns3((((($bytes->[21] >> 4) & 15) << 8) + $bytes->[23]) * $mtb)); 1127 printl("Minimum Recovery Delay (tRFC)", 1128 tns3((($bytes->[25] << 8) + $bytes->[24]) * $mtb)); 1129 printl("Minimum Write to Read CMD Delay (tWTR)", 1130 tns3($bytes->[26] * $mtb)); 1131 printl("Minimum Read to Pre-charge CMD Delay (tRTP)", 1132 tns3($bytes->[27] * $mtb)); 1133 printl("Minimum Four Activate Window Delay (tFAW)", 1134 tns3(((($bytes->[28] & 15) << 8) + $bytes->[29]) * $mtb)); 1135 1135 1136 1136 # miscellaneous stuff 1137 prints "Optional Features";1137 prints("Optional Features"); 1138 1138 1139 1139 my $volts = "1.5V"; … … 1147 1147 $volts .= ", 1.2X V"; 1148 1148 } 1149 printl "Operable voltages", $volts;1150 printl "RZQ/6 supported?", ($bytes->[30] & 1) ? "Yes" : "No";1151 printl "RZQ/7 supported?", ($bytes->[30] & 2) ? "Yes" : "No";1152 printl "DLL-Off Mode supported?", ($bytes->[30] & 128) ? "Yes" : "No";1153 printl "Operating temperature range", sprintf "0-%dC",1154 ($bytes->[31] & 1) ? 95 : 85 ;1155 printl "Refresh Rate in extended temp range",1156 ($bytes->[31] & 2) ? "2X" : "1X" ;1157 printl "Auto Self-Refresh?", ($bytes->[31] & 4) ? "Yes" : "No";1158 printl "On-Die Thermal Sensor readout?",1159 ($bytes->[31] & 8) ? "Yes" : "No" ;1160 printl "Partial Array Self-Refresh?",1161 ($bytes->[31] & 128) ? "Yes" : "No" ;1162 printl "Thermal Sensor Accuracy",1149 printl("Operable voltages", $volts); 1150 printl("RZQ/6 supported?", ($bytes->[30] & 1) ? "Yes" : "No"); 1151 printl("RZQ/7 supported?", ($bytes->[30] & 2) ? "Yes" : "No"); 1152 printl("DLL-Off Mode supported?", ($bytes->[30] & 128) ? "Yes" : "No"); 1153 printl("Operating temperature range", sprintf "0-%dC", 1154 ($bytes->[31] & 1) ? 95 : 85); 1155 printl("Refresh Rate in extended temp range", 1156 ($bytes->[31] & 2) ? "2X" : "1X"); 1157 printl("Auto Self-Refresh?", ($bytes->[31] & 4) ? "Yes" : "No"); 1158 printl("On-Die Thermal Sensor readout?", 1159 ($bytes->[31] & 8) ? "Yes" : "No"); 1160 printl("Partial Array Self-Refresh?", 1161 ($bytes->[31] & 128) ? "Yes" : "No"); 1162 printl("Thermal Sensor Accuracy", 1163 1163 ($bytes->[32] & 128) ? sprintf($bytes->[32] & 127) : 1164 "Not implemented" ;1165 printl "SDRAM Device Type",1164 "Not implemented"); 1165 printl("SDRAM Device Type", 1166 1166 ($bytes->[33] & 128) ? sprintf($bytes->[33] & 127) : 1167 "Standard Monolithic" ;1167 "Standard Monolithic"); 1168 1168 if ($bytes->[3] >= 1 && $bytes->[3] <= 6) { 1169 1169 1170 prints "Physical Characteristics";1171 printl "Module Height (mm)", ($bytes->[60] & 31) + 15;1172 printl "Module Thickness (mm)", sprintf("%d front, %d back",1170 prints("Physical Characteristics"); 1171 printl("Module Height (mm)", ($bytes->[60] & 31) + 15); 1172 printl("Module Thickness (mm)", sprintf("%d front, %d back", 1173 1173 ($bytes->[61] & 15) + 1, 1174 (($bytes->[61] >> 4) & 15) +1) ;1175 printl "Module Width (mm)", ($bytes->[3] <= 2) ? 133.5 :1176 ($bytes->[3] == 3) ? 67.6 : "TBD" ;1174 (($bytes->[61] >> 4) & 15) +1)); 1175 printl("Module Width (mm)", ($bytes->[3] <= 2) ? 133.5 : 1176 ($bytes->[3] == 3) ? 67.6 : "TBD"); 1177 1177 1178 1178 my $alphabet = "ABCDEFGHJKLMNPRTUVWY"; … … 1194 1194 } 1195 1195 } 1196 printl "Module Reference Card", $ref_card;1196 printl("Module Reference Card", $ref_card); 1197 1197 } 1198 1198 if ($bytes->[3] == 1 || $bytes->[3] == 5) { 1199 prints "Registered DIMM";1199 prints("Registered DIMM"); 1200 1200 1201 1201 my @rows = ("Undefined", 1, 2, 4); 1202 printl "# DRAM Rows", $rows[($bytes->[63] >> 2) & 3];1203 printl "# Registers", $rows[$bytes->[63] & 3];1204 printl "Register manufacturer",1205 manufacturer_ddr3($bytes->[65], $bytes->[66]) ;1206 printl "Register device type",1202 printl("# DRAM Rows", $rows[($bytes->[63] >> 2) & 3]); 1203 printl("# Registers", $rows[$bytes->[63] & 3]); 1204 printl("Register manufacturer", 1205 manufacturer_ddr3($bytes->[65], $bytes->[66])); 1206 printl("Register device type", 1207 1207 (($bytes->[68] & 7) == 0) ? "SSTE32882" : 1208 "Undefined" ;1209 printl "Register revision", sprintf("0x%.2X", $bytes->[67]);1210 printl "Heat spreader characteristics",1208 "Undefined"); 1209 printl("Register revision", sprintf("0x%.2X", $bytes->[67])); 1210 printl("Heat spreader characteristics", 1211 1211 ($bytes->[64] < 128) ? "Not incorporated" : 1212 sprintf("%.2X", ($bytes->[64] & 127)) ;1212 sprintf("%.2X", ($bytes->[64] & 127))); 1213 1213 my $regs; 1214 1214 for (my $i = 0; $i < 8; $i++) { 1215 1215 $regs = sprintf("SSTE32882 RC%d/RC%d", 1216 1216 $i * 2, $i * 2 + 1); 1217 printl $regs, sprintf("%.2X", $bytes->[$i + 69]);1217 printl($regs, sprintf("%.2X", $bytes->[$i + 69])); 1218 1218 } 1219 1219 } … … 1226 1226 1227 1227 #size computation 1228 prints "Memory Characteristics";1228 prints("Memory Characteristics"); 1229 1229 1230 1230 my $ii; … … 1233 1233 1234 1234 if ($ii > 0 && $ii < 16) { 1235 printl "Size", (1 << $ii) . " MB";1235 printl("Size", (1 << $ii) . " MB"); 1236 1236 } else { 1237 printl "INVALID SIZE", sprintf("0x%02x, 0x%02x",1238 $bytes->[4], $bytes->[5]) ;1237 printl("INVALID SIZE", sprintf("0x%02x, 0x%02x", 1238 $bytes->[4], $bytes->[5])); 1239 1239 } 1240 1240 } … … 1246 1246 1247 1247 #size computation 1248 prints "Memory Characteristics";1248 prints("Memory Characteristics"); 1249 1249 1250 1250 my $ii; … … 1253 1253 1254 1254 if ($ii > 0 && $ii < 16) { 1255 printl "Size", (1 << $ii) . " MB";1255 printl("Size", (1 << $ii) . " MB"); 1256 1256 } else { 1257 printl "INVALID SIZE", sprintf("0x%02x, 0x%02x",1258 $bytes->[3], $bytes->[5]) ;1257 printl("INVALID SIZE", sprintf("0x%02x, 0x%02x", 1258 $bytes->[3], $bytes->[5])); 1259 1259 } 1260 1260 } … … 1376 1376 my ($l, $temp); 1377 1377 1378 prints "Intel Specification";1378 prints("Intel Specification"); 1379 1379 1380 1380 $l = "Frequency"; … … 1383 1383 elsif ($bytes->[126] == 133) { $temp = "133MHz"; } 1384 1384 else { $temp = "Undefined!"; } 1385 printl $l, $temp;1385 printl($l, $temp); 1386 1386 1387 1387 $l = "Details for 100MHz Support"; … … 1398 1398 if (($bytes->[127] & 192) == 192) { $temp .= "Double-sided DIMM\n"; } 1399 1399 elsif (($bytes->[127] & 192) != 0) { $temp .= "Single-sided DIMM\n"; } 1400 printl $l, $temp;1400 printl($l, $temp); 1401 1401 } 1402 1402 … … 1453 1453 close F; 1454 1454 $header and die "Unable to parse any data from hexdump '$_[0]'"; 1455 $word and printc "Using $use_hexdump 16-bit hex dump";1455 $word and printc("Using $use_hexdump 16-bit hex dump"); 1456 1456 1457 1457 # Cache the data for later use … … 1625 1625 } 1626 1626 1627 printc "decode-dimms version $revision";1628 printh 'Memory Serial Presence Detect Decoder',1627 printc("decode-dimms version $revision"); 1628 printh('Memory Serial Presence Detect Decoder', 1629 1629 'By Philip Edelbrock, Christian Zuckschwerdt, Burkart Lingner, 1630 Jean Delvare, Trent Piepho and others' ;1630 Jean Delvare, Trent Piepho and others'); 1631 1631 1632 1632 … … 1664 1664 1665 1665 print "<b><u>" if $opt_html; 1666 printl2 "\n\nDecoding EEPROM",1666 printl2("\n\nDecoding EEPROM", 1667 1667 $use_hexdump ? $dimm_list[$i] : ($use_sysfs ? 1668 1668 "/sys/bus/i2c/drivers/eeprom/$dimm_list[$i]" : 1669 "/proc/sys/dev/sensors/$dimm_list[$i]") ;1669 "/proc/sys/dev/sensors/$dimm_list[$i]")); 1670 1670 print "</u></b>" if $opt_html; 1671 1671 print "<table border=1>\n" if $opt_html; … … 1674 1674 || (!$use_sysfs && /^[^-]+-[^-]+-[^-]+-([^-]+)$/)) { 1675 1675 my $dimm_num = $1 - 49; 1676 printl "Guessing DIMM is in", "bank $dimm_num";1676 printl("Guessing DIMM is in", "bank $dimm_num"); 1677 1677 } 1678 1678 } 1679 1679 1680 1680 # Decode first 3 bytes (0-2) 1681 prints "SPD EEPROM Information";1682 1683 printl $l, ($chk_valid ?1681 prints("SPD EEPROM Information"); 1682 1683 printl($l, ($chk_valid ? 1684 1684 sprintf("OK (%s)", $chk_calc) : 1685 1685 sprintf("Bad\n(found %s, calculated %s)", 1686 $chk_spd, $chk_calc)) ;1686 $chk_spd, $chk_calc))); 1687 1687 1688 1688 my $temp; … … 1692 1692 elsif ($bytes[0] == 0) { $temp = "Invalid"; } 1693 1693 else { $temp = "Reserved"; } 1694 printl "SPD Revision", $temp;1694 printl("SPD Revision", $temp); 1695 1695 } else { 1696 1696 my ($spd_size, $spd_used) = spd_sizes(\@bytes); 1697 printl "# of bytes written to SDRAM EEPROM", $spd_used;1698 printl "Total number of bytes in EEPROM", $spd_size;1697 printl("# of bytes written to SDRAM EEPROM", $spd_used); 1698 printl("Total number of bytes in EEPROM", $spd_size); 1699 1699 1700 1700 # If there's more data than what we've read, let's … … 1725 1725 } 1726 1726 } 1727 printl $l, $type;1727 printl($l, $type); 1728 1728 1729 1729 # Decode next 61 bytes (3-63, depend on memory type) … … 1751 1751 } 1752 1752 } 1753 printl2 "\n\nNumber of SDRAM DIMMs detected and decoded", $dimm_count;1753 printl2("\n\nNumber of SDRAM DIMMs detected and decoded", $dimm_count); 1754 1754 1755 1755 print "</body></html>\n" if ($opt_html && !$opt_bodyonly);
