1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356
|
#!/usr/bin/env perl
#
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# MODIFY THE LOCATION OF PERL ABOVE IF NECESSARY
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
# @(#) memconf - Identify sizes of memory modules installed on a
# @(#) Solaris, Linux, FreeBSD or HP-UX workstation or server.
# @(#) Micron Technology, Inc. - Tom Schmidt 13-Jan-2010 V2.13
#
# Maintained by Tom Schmidt (tschmidt@micron.com)
#
# Check my website at http://www.4schmidts.com/unix.html to get the latest
# version of memconf.
#
# If memconf does not recognize a system, then please run 'memconf -D' to
# have it automatically E-mail me the information I need to enhanced to
# recognize it. If the unrecognized system is a Sun clone, please also send
# any hardware documentation on the memory layout that you may have.
#
# Usage: memconf [ -v | -D | -h ] [explorer_dir]
# -v verbose mode
# -D E-mail results to memconf maintainer
# -h print help
# explorer_dir Sun Explorer output directory
#
# memconf reports the size of each SIMM/DIMM memory module installed in a
# system. It also reports the system type and any empty memory sockets.
# In verbose mode, it also reports the following information if available:
# - banner name, model and CPU/system frequencies
# - address range and bank numbers for each module
#
# memconf is Y2K compliant. There are no date calls in the program. Your
# Operating System or Perl version may not be Y2K compliant.
#
# memconf is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Original version based on SunManagers SUMMARY by Howard Modell
# (h.modell@ieee.org) on 29-Jan-1997.
#
# Tested to work on:
# - Solaris 10 6/06 or later on x86 with /usr/platform/i86pc/sbin/prtdiag
# - Linux on SPARC with sparc-utils and /dev/openprom
# - Linux/FreeBSD on x86 with kernel-utils or pmtools for /usr/sbin/dmidecode
# - most HP-UX systems with Support Tools Manager (cstm)
# - Solaris (SunOS 4.X or 5.X) on the following SPARC systems
# - sun4c Sun SS1, SS2, IPC, IPX, ELC with Open Boot PROM V2.X
# - sun4m Sun 4/6x0, SS4, SS5, SS10, SS20, LX/ZX, Classic, Voyager, JavaEngine1
# - sun4d Sun SPARCserver-1000, 1000E, SPARCcenter-2000, 2000E
# - sun4u Sun Ultra 1, 2, 5, 10, 30, 60, 450
# - sun4u Sun Ultra 80, Ultra Enterprise 420R, and Netra t1400/1405.
# - sun4u Sun Ultra Enterprise 220R, 250, 450
# - sun4u Sun Ultra Enterprise 3000, 3500, 4000/5000, 4500/5500, 6000, 6500
# - sun4u1 Sun Ultra Enterprise 10000
# - sun4u Sun StorEdge N8400 and N8600 Filer
# - sun4u Sun SPARCengine Ultra AX, AXi, AXmp, AXmp+, AXe
# - sun4u Sun SPARCengine CP 1400, CP 1500, CP2140
# - sun4u Sun Netra t1 100/105, t1120/1125, ft1800, X1, T1 200, AX1105-500, 120
# - sun4u Sun Netra 20 (Netra T4)
# - sun4u Sun Netra ct800
# - sun4u Sun Blade 100, 150, 1000, 1500, 2000, 2500
# - sun4u Sun Fire 280R
# - sun4u Sun Fire 3800, 4800, 4810, 6800
# - sun4u Sun Fire V100, V120, V210, V240, V250, V440
# - sun4u Sun Netra 210, 240, 440
# - sun4u Sun Fire V125, V215, V245, V445
# - sun4u Sun Fire V480, V490, V880, V880z, V890
# - sun4u Sun Fire 12000, 15000, E20K, E25K
# - sun4u Sun Fire V1280, Netra 1280 (Netra T12)
# - sun4u Sun Fire E2900, E4900, E6900
# - sun4u Sun Fire B100s Blade Server
# - sun4u Sun Ultra 25 Workstation
# - sun4u Sun Ultra 45 Workstation
# - sun4u Sun/Fujitsu Siemens SPARC Enterprise M3000, M4000, M5000, M8000 Server
# - sun4v Sun Fire T2000, T1000, Netra T2000
# - sun4v Sun Blade T6300, T6320, T6340
# - sun4v Sun SPARC Enterprise T2000, T1000 Server
# - sun4v Sun SPARC Enterprise T5120, T5140, T5220, T5240 Server, Netra T5220
# - sun4v Sun SPARC Enterprise T5440 Server
# - sun4m Tatung COMPstation 5, 10, 20AL, 20S and 20SL clones
# - sun4m transtec SPARCstation 20I clone
# - sun4m Rave Axil-255 SPARCstation 5 clone
# - sun4m Rave Axil-245, 311 and 320 clones (no verbose output)
# - sun4u AXUS Ultra 250
# - sun4u Tatung COMPstation U2, U60 and U80D clones
# - Force Computers SPARC clones (no verbose output)
# - Tadpole SPARCbook 3 and RDI PowerLite-170 (no verbose output)
# - Tadpole VoyagerIIi
# - Tadpole (Cycle) 3200 CycleQUAD Ultra 2 upgrade motherboard
# - Tadpole (Cycle) UP-520-IIi SPARCstation 5/20 upgrade motherboard
# - Tadpole SPARCle
# - Auspex 7000/650 (no verbose output)
# - Fujitsu S-4/10H, S-4/20L and S-4/20H clones (no verbose output)
# - Fujitsu GP7000, GP7000F
# - Fujitsu Siemens PrimePower 200, 400, 600, 800, 1000, 2000
# - Fujitsu Siemens PrimePower 250, 450, 650, 850
# - Fujitsu Siemens PrimePower 900, 1500, 2500, HPC2500
# - Twinhead TWINstation 5G, 20G
# - Detects VSIMMs for SX graphics on SS10SX/SS20 (1st VSIMM only)
# - Detects Prestoserve NVSIMMs on SS10/SS20/SS1000/SC2000
#
# Untested systems that should work:
# - sun4c Sun SS1+ with Open Boot PROM V2.X
# - sun4m Tatung COMPstation 20A clone
# - sun4u Sun Netra ct400, ct410, ct810
# - sun4u Sun SPARCengine CP2040, CP2060, CP2080, CP2160
# - sun4u Sun/Fujitsu Siemens SPARC Enterprise M9000 Server
# - May not work properly on Sun clones
#
# Won't work on:
# - SPARC systems without /dev/openprom
# - sun4c Sun SS1, SS1+, SLC, IPC with Open Boot PROM V1.X (no 'memory' lines
# in devinfo/prtconf output)
# - sun4 kernel architecture, and sun3 and older systems
# - Perl 5.001 is known to have problems with hex number conversions
# - Does not detect unused VSIMMs (another FB installed) or second VSIMM
#
# To Do list and Revision History can be found on the maintainers web site at
# http://www.4schmidts.com/unix.html
# Uncomment for debugging (perl 5 only)
#use diagnostics;
$^W=1; # Enables -w warning switch, put here for SunOS4 compatibility.
$version="V2.13";
$version_date="13-Jan-2010";
$URL="http://www.4schmidts.com/unix.html";
$newpath="/usr/sbin:/bin:/usr/bin:/usr/ucb:/usr/local/bin:/var/local/bin";
$ENV{PATH}=(defined($ENV{PATH})) ? "$newpath:$ENV{PATH}" : $newpath;
# Force C locale so that output is in English
$ENV{LC_ALL}="C";
$_=$];
($PERL_VERSION_MAJOR)=/(\d).*/;
if ($PERL_VERSION_MAJOR < 5) {
($PERL_VERS)=/(\d\.\d)/;
($PERL_PATCH)=/(\d*)$/;
$PERL_PATCH="0$PERL_PATCH" if ($PERL_PATCH < 10);
$PERL_VERSION="$PERL_VERS$PERL_PATCH";
} else {
($PERL_VERSION)=/(\d\.\d{3}).*/;
}
$uname="/usr/bin/uname";
$uname="/bin/uname" if (-x '/bin/uname');
if (-x $uname) {
$hostname=&mychomp(`$uname -n`);
$machine=&mychomp(`$uname -m`);
$os=&mychomp(`$uname`);
$os="Linux" if ("$os" eq "FreeBSD");
$osrel=&mychomp(`$uname -r`);
$kernver=&mychomp(`$uname -v`);
$platform=$machine;
} else {
$hostname="";
$machine="";
$os="this unsupported";
$osrel="";
$kernver="";
}
$osrelease="";
$prtdiag_cmd="";
$prtdiag_exec="";
$have_prtdiag_data=0;
$prtdiag_checked=0;
$prtfru_cmd="";
$have_prtfru_data=0;
$prtpicl_cmd="";
$have_prtpicl_data=0;
$psrinfo_cmd="";
$have_psrinfo_data=0;
$use_psrinfo_data=1;
$psrinfo_checked=0;
$cfgadm_cmd="";
$have_cfgadm_data=0;
$ipmitool_cmd="";
$have_ipmitool_data=0;
$cpucnt_ipmi=0;
$cputype_ipmi="";
@ipmi_mem=("");
$smbios_cmd="";
$have_smbios_data=0;
@smbios_mem=("");
$ldm_cmd="";
$have_ldm_data=0;
$ldm_memory=0;
$free_cmd="";
$have_free_data=0;
$have_x86_devname=0;
if (-d '/usr/platform') {
$platform=&mychomp(`$uname -i`);
if (-x "/usr/platform/$platform/sbin/prtdiag") {
$prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag";
} elsif (-x "/usr/platform/$machine/sbin/prtdiag") {
$prtdiag_cmd="/usr/platform/$machine/sbin/prtdiag";
} elsif (-x "/usr/sbin/prtdiag") {
$prtdiag_cmd="/usr/sbin/prtdiag";
}
} elsif (-x '/usr/kvm/prtdiag') {
$platform=$machine;
$prtdiag_cmd='/usr/kvm/prtdiag';
} elsif (-x "/usr/sbin/prtdiag") {
$platform=$machine;
$prtdiag_cmd="/usr/sbin/prtdiag";
}
if ($prtdiag_cmd ne "") {
if (-x $prtdiag_cmd) {
$prtdiag_exec="$prtdiag_cmd";
}
}
$buffer="";
$filename="";
$installed_memory=0;
$failed_memory=0;
$spare_memory=0;
$failing_memory=0;
$failed_fru="";
$ultra=0;
$simmbanks=0;
$simmspergroup=1;
$bankcnt=0;
$slot0=0;
$smallestsimm=16777216;
$largestsimm=0;
$found8mb=0;
$found16mb=0;
$found32mb=0;
$found10bit=0;
$found11bit=0;
$foundbank1or3=0;
$sxmem=0;
$nvmem=0;
$nvmem1=0;
$nvmem2=0;
$memtype="SIMM";
$sockettype="socket";
$verbose=0;
$DEBUG=0;
$starttime=time;
$recognized=1;
$untested=1;
$untested_type="";
$perlhexbug=0;
$exitstatus=0;
$meg=1048576;
@socketstr=("");
@socketlabelstr=("");
@orderstr=("");
@groupstr=("");
@bankstr=("");
@banksstr=("");
$bankname="banks";
@bytestr=("");
@slotstr=("");
$simmrangex=0;
$simmrange=1;
$showrange=1;
$start1x="";
$stop1x="";
@simmsizes=(0,16777216);
@simmsizesfound=();
@memorylines=("");
$socket="";
$socketlabel="";
$order="";
$group="";
$slotnum="";
$bank="";
$dualbank=0;
$byte="";
$gotmemory="";
$gotmodule="";
$gotmodulenames="";
$gotcpunames="";
$gotcpuboards="";
$slotname0="";
@boards_cpu="";
@boards_mem="";
$empty_banks="";
$banks_used="";
$nvsimm_banks="";
$boardslot_cpu=" ";
$boardslot_cpus=" ";
@boardslot_cpus=();
$boardslot_mem=" ";
$boardslot_mems=" ";
@boardslot_mems=();
$boardfound_cpu=0;
$boardfound_mem=0;
$prtdiag_has_mem=0;
$prtdiag_banktable_has_dimms=0;
$prtdiag_failed=0;
$prtconf_warn="";
$flag_cpu=0;
$flag_mem=0;
$flag_rewrite_prtdiag_mem=0;
$format_cpu=0;
$format_mem=0;
$foundname=0;
$sockets_used="";
$sockets_empty="";
$sortslots=1;
$devtype="";
$interleave=0;
$stacked=0;
$freq=0;
$sysfreq=0;
$cpufreq=0;
$cputype="";
$cputype_prtconf="";
$cputype_psrinfo="";
$cputype_cpuinfo="";
@cpucnt=();
$cpucntfrom="";
$cpucntflag=0;
$cpucnt_cpuinfo=0;
$have_cpuinfo_data=0;
$corecnt_cpuinfo=0;
$cpucores_cpuinfo=0;
$foundGenuineIntel=0;
@diagcpucnt=();
$diagthreadcnt=0;
$psrcpucnt=0;
$foundpsrinfocpu=0;
$ncpu=0; # remains 0 if using prtdiag output only
$ndcpu=0; # prtdiag cpu count
$npcpu=0; # physical cpu count
$nvcpu=0; # virtual cpu count
$necpu=0; # empty cpu socket count
$threadcnt=0;
$corecnt=1;
$hyperthread=0;
$header_shown=0;
$romver="";
$romvernum="";
$SUNWexplo=0;
$banner="";
$bannermore="";
$cpubanner="";
$diagbanner="";
$model="";
$modelmore="";
$model_checked=0;
$BSD=0; # Initially assume SunOS 5.X
$config_cmd="/usr/sbin/prtconf -vp";
$config_command="prtconf";
$config_permission=0;
$permission_error="";
$dmidecode_error="";
$freephys=0;
$isX86=0;
$HPUX=0;
$devname=""; # Sun internal development code name
$familypn=""; # Sun family part number (system code)
$clone=0;
$totmem=0;
$LnxDMI=0;
$latest_dmidecode_ver="2.10";
$dmidecode_ver="0";
$dmidecodeURL="http://www.nongnu.org/dmidecode/";
$cpuarr=-1;
$memarr=-1;
$release="";
$waitshown=0;
$helpers_defined=0;
$picl_foundmemory=0;
@picl_mem_pn=();
@picl_mem_bank=();
@picl_mem_dimm=();
$linebreak="----------------------------------------------------\n";
$uid=&mychomp(`id`);
$uid=~s/uid=//;
$uid=~s/\(.*//;
#
# Parse options
#
foreach $name (@ARGV) {
if ($name eq "-v") {
# verbose mode
$verbose=1;
} elsif ($name eq "-d") {
# more verbose debug mode
$verbose=2;
} elsif ($name eq "-debug") {
# most verbose debug mode
$DEBUG=1;
} elsif ($name eq "-D") {
# E-mail information of system to maintainer
$verbose=3;
open(MAILFILE, ">/tmp/memconf.output") || die "can't open /tmp/memconf.output: $!";
print MAILFILE "Output from 'memconf -d' on $hostname\n";
print MAILFILE "$linebreak";
close(MAILFILE);
open(STDOUT, "| tee -a /tmp/memconf.output") || die "can't open /tmp/memconf.output: $!";
print "Gathering memconf data to E-mail to maintainer. This may take a few minutes.\nPlease wait...\n";
} elsif (-f "$name/sysconfig/prtconf-vp.out") {
# Sun Explorer output
$SUNWexplo=1;
# Special case for regression testing Sun Explorer data
$os="SunOS";
open(FILE, "<$name/sysconfig/prtconf-vp.out");
@config=<FILE>;
close(FILE);
if (-f "$name/sysconfig/prtdiag-v.out") {
open(FILE, "<$name/sysconfig/prtdiag-v.out");
@prtdiag=<FILE>;
$have_prtdiag_data=1;
$prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag";
$prtdiag_exec="$prtdiag_cmd";
close(FILE);
}
if (-f "$name/fru/prtfru_-x.out") {
open(FILE, "<$name/fru/prtfru_-x.out");
@prtfru=<FILE>;
$have_prtfru_data=1;
$prtfru_cmd='/usr/sbin/prtfru';
close(FILE);
}
if (-f "$name/sysconfig/prtpicl-v.out") {
open(FILE, "<$name/sysconfig/prtpicl-v.out");
@prtpicl=<FILE>;
$have_prtpicl_data=1;
$prtpicl_cmd='/usr/sbin/prtpicl';
close(FILE);
}
if (-f "$name/sysconfig/psrinfo-v.out") {
open(FILE, "<$name/sysconfig/psrinfo-v.out");
@psrinfo=<FILE>;
$have_psrinfo_data=1;
$psrinfo_cmd='/usr/sbin/psrinfo';
close(FILE);
}
# Sun Explorer does not include "psrinfo -p" or
# "psrinfo -p -v" data yet.
if (-f "$name/sysconfig/cfgadm-alv.out") {
open(FILE, "<$name/sysconfig/cfgadm-alv.out");
@cfgadm=<FILE>;
$have_cfgadm_data=1;
$cfgadm_cmd='/usr/sbin/cfgadm';
close(FILE);
}
if (-f "$name/sysconfig/uname-a.out") {
open(FILE, "<$name/sysconfig/uname-a.out");
$uname=&mychomp(<FILE>);
close(FILE);
@unamearr=split(/\s/, $uname);
$hostname=$unamearr[1];
$machine=$unamearr[4];
$osrel=$unamearr[2];
$platform=$unamearr[6];
$prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag";
$prtdiag_exec="$prtdiag_cmd";
} else {
if ($config[0] =~ /System Configuration:/) {
@machinearr=split(/\s+/, $config[0]);
$machine=$machinearr[4];
}
$osrel="";
$hostname="";
}
if (-f "$name/sysconfig/prtconf-V.out") {
open(FILE, "<$name/sysconfig/prtconf-V.out");
$romver=&mychomp(<FILE>);
close(FILE);
}
$filename="$name";
} elsif (-f $name) {
# Regression test file with prtconf/dmidecode output
open(FILE, "<$name");
@config=<FILE>;
close(FILE);
# Regression test file may also have prtdiag, etc.
@prtdiag=@config;
@prtfru=@config;
$have_prtfru_data=1;
@prtpicl=@config;
$have_prtpicl_data=1;
@psrinfo=@config;
$have_psrinfo_data=1;
@cfgadm=@config;
$have_cfgadm_data=1;
@ipmitool=@config;
$have_ipmitool_data=1;
@ldm=@config;
$have_ldm_data=1;
@free=@config;
$have_free_data=1;
@cpuinfo=@config;
$have_cpuinfo_data=1;
@smbios=@config;
$have_smbios_data=1;
@machinfo=@config;
$hostname="";
$osrel="";
# Check test file to determine OS and machine
for ($val=0; $val <= $#config; $val++) {
if ($config[$val]) {
if ($config[$val] =~ /System Configuration:/) {
# Special case for regression testing SunOS prtconf files
$os="SunOS";
@machinearr=split(/\s+/, $config[$val]);
$machine=$machinearr[4];
$machine="" if (! defined($machine));
$platform=$machine;
last;
} elsif ($config[$val] =~ / dmidecode / || $config[$val] =~ /DMI .* present/) {
# Special case for regression testing Linux dmidecode files
$os="Linux";
$LnxDMI=1;
if ($config[$val] =~ / dmidecode /) {
$dmidecode_ver=&mychomp($config[$val]);
$dmidecode_ver=~s/.* dmidecode //;
}
$machine="";
$platform="";
last;
}
}
}
# Special case for regression testing SunOS4 and SunOS5 files
if ($name =~ /devinfo\./) {
$os="SunOS";
$BSD=1;
}
if ($name =~ /prtconf\./) {
$os="SunOS";
$BSD=0;
}
# Special case for regression testing Linux SPARC files
$os="Linux" if ($name =~ /prtconf\.Linux/);
$filename="$name";
} else {
&show_help;
}
}
&linux_dmi if ($LnxDMI);
if ($filename eq "") {
if ("$os" eq "HP-UX") {
$HPUX=1;
if (-x '/usr/sbin/cstm') {
&hpux_cstm;
} else {
&show_header;
&show_supported;
}
} elsif ("$os" eq "Linux") {
&linux_release if ("$release" eq "");
&find_helpers;
&linux_dmi if ($config_cmd =~ /dmidecode/);
if ("$machine" =~ /.86/ || ! -e '/dev/openprom') {
&show_header;
&show_supported;
}
} elsif ("$os" ne "SunOS") {
&show_header;
&show_supported;
}
if (-f '/vmunix') {
# SunOS 4.X (Solaris 1.X)
$BSD=1;
if (! -x '/usr/etc/devinfo') {
print "ERROR: no 'devinfo' command. Aborting.\n";
exit 1;
}
$config_cmd="/usr/etc/devinfo -pv";
$config_command="devinfo";
} else {
# Solaris 2.X or later
$BSD=0;
if (! -x '/usr/sbin/prtconf') {
print "ERROR: no 'prtconf' command. Aborting.\n";
exit 1;
}
$config_cmd="/usr/sbin/prtconf -vp";
$config_command="prtconf";
}
}
$kernbit="";
$hasprtconfV=0;
$solaris="";
$solaris="1.0" if ($osrel eq "4.1.1");
$solaris="1.0.1" if ($osrel eq "4.1.2");
$solaris="1.1" if ($osrel =~ /4.1.3/);
$solaris="1.1.1" if ($osrel eq "4.1.3_U1");
$solaris="1.1.2" if ($osrel eq "4.1.4");
if ($osrel =~ /^5./) {
$osminor=$osrel;
$osminor=~s/5.//;
if ($SUNWexplo) {
if (-f "$filename/etc/release") {
open(FILE, "<$filename/etc/release");
$release=<FILE>;
close(FILE);
}
} else {
if (-f '/etc/release') {
open(FILE, "</etc/release");
$release=<FILE>;
close(FILE);
}
}
if ($release =~ "Solaris") {
$release=~s/\s+//;
$release=&mychomp($release);
$solaris="$release";
}
if ($osminor =~ /[7-9]|1[0-9]/) {
$hasprtconfV=1;
$solaris=$osminor if ($solaris eq "");
$kernbit=32;
if ($SUNWexplo) {
$cpuarch="";
if (-f "$filename/sysconfig/isainfo.out") {
open(FILE, "<$filename/sysconfig/isainfo.out");
$cpuarch=<FILE>;
close(FILE);
} elsif (-f "$filename/sysconfig/isainfo-kv.out") {
open(FILE, "<$filename/sysconfig/isainfo-kv.out");
$cpuarch=<FILE>;
close(FILE);
}
$kernbit=64 if ($cpuarch =~ /sparcv9/ || $cpuarch =~ /amd64/);
} elsif (-x '/bin/isainfo') {
$kernbit=&mychomp(`/bin/isainfo -b`);
}
} elsif ($osminor =~ /[4-6]/) {
$hasprtconfV=1;
$solaris="2.$osminor" if ($solaris eq "");
} else {
$solaris="2.$osminor";
}
if ("$machine" eq "i86pc" && $osminor =~ /[0-5]/) {
# x86 Solaris 2.5.1 and earlier has different syntax than SPARC
$hasprtconfV=0;
$config_cmd="/usr/sbin/prtconf -v";
}
}
if ($filename eq "") {
@config=&run("$config_cmd");
if ($hasprtconfV) {
# Solaris 2.4 or later
$romver=&mychomp(`/usr/sbin/prtconf -V 2>&1`);
if ($romver eq "Cannot open openprom device") {
$prtconf_warn="ERROR: $romver";
$romver="";
} else {
@romverarr=split(/\s/, $romver);
$romvernum=$romverarr[1];
}
} else {
# Solaris 2.3 or older
# Try to use sysinfo if installed to determine the OBP version.
# sysinfo is available from http://www.MagniComp.com/sysinfo/
close(STDERR);
$romver=`sysinfo -show romver 2>/dev/null | tail -1`;
open(STDERR);
if ($romver eq "") {
# Assume it is old
$romver="2.X" if ($machine =~ /sun4/);
} else {
$romver=&mychomp($romver);
@romverarr=split(/\s/, $romver);
$romver=$romverarr[$#romverarr];
}
$romvernum=$romver;
}
}
sub please_wait {
return if ($waitshown);
$waitshown=1;
print "Gathering data for memconf. This may take over a minute. Please wait...\n";
}
sub find_helpers {
return if ($helpers_defined);
$helpers_defined=1;
if ("$os" eq "HP-UX") {
$config_cmd="echo 'selclass qualifier cpu;info;wait;selclass qualifier memory;info;wait;infolog'|/usr/sbin/cstm";
} elsif ("$os" eq "Linux") {
$config_cmd="dmidecode";
if (defined($ENV{DMIDECODE}) && -x $ENV{DMIDECODE}) {
# this may be a setuid-root version of dmidecode
$config_cmd=$ENV{DMIDECODE};
} else {
foreach $bin ('/usr/local/sbin','/usr/local/bin','/usr/sbin','/usr/bin','/bin') {
if (-x "$bin/dmidecode") {
$config_cmd="$bin/dmidecode";
last;
}
}
}
} elsif (-x '/usr/sbin/prtconf') {
# Solaris 2.X or later
$config_cmd="/usr/sbin/prtconf -vp";
$prtfru_cmd='/usr/sbin/prtfru' if (-x '/usr/sbin/prtfru');
$prtpicl_cmd='/usr/sbin/prtpicl' if (-x '/usr/sbin/prtpicl');
$psrinfo_cmd='/usr/sbin/psrinfo' if (-x '/usr/sbin/psrinfo');
$cfgadm_cmd='/usr/sbin/cfgadm' if (-x '/usr/sbin/cfgadm');
$smbios_cmd='/usr/sbin/smbios' if (-x '/usr/sbin/smbios');
$ldm_cmd='/opt/SUNWldm/bin/ldm' if (-x '/opt/SUNWldm/bin/ldm');
}
if ("$os" eq "Linux") {
$free_cmd='/usr/bin/free -m';
}
if ("$os" eq "SunOS" || "$os" eq "Linux") {
if (defined($ENV{IPMITOOL}) && -x $ENV{IPMITOOL}) {
# this may be a setuid-root version of ipmitool
$ipmitool_cmd=$ENV{IPMITOOL};
} else {
foreach $bin ('/usr/sfw/bin','/usr/local/sbin','/usr/local/bin','/usr/sbin','/usr/bin','/bin') {
if (-x "$bin/ipmitool") {
$ipmitool_cmd="$bin/ipmitool";
last;
}
}
}
}
}
sub show_helpers {
$s=shift;
print "$s$config_cmd\n";
if ("$os" eq "SunOS") {
print "$s$prtdiag_cmd -v\n" if ($prtdiag_exec ne "");
print "$s$prtfru_cmd -x\n" if ($prtfru_cmd ne "");
print "$s$prtpicl_cmd -v\n" if ($prtpicl_cmd ne "");
if ($psrinfo_cmd ne "") {
print "$s$psrinfo_cmd -v\n";
$tmp=&mychomp(`$psrinfo_cmd -p 2>/dev/null`);
if ($tmp ne "") {
print "$s$psrinfo_cmd -p\n";
print "$s$psrinfo_cmd -p -v\n";
}
}
print "$s$cfgadm_cmd -al\n" if ($cfgadm_cmd ne "");
print "$s$smbios_cmd\n" if ($smbios_cmd ne "");
print "$s$ldm_cmd list-devices -a -p\n" if ($ldm_cmd ne "");
}
if ("$os" eq "Linux") {
print "$s$free_cmd\n" if ($free_cmd ne "");
print "${s}cat /proc/cpuinfo\n" if (-r '/proc/cpuinfo');
}
if ("$os" eq "SunOS" || "$os" eq "Linux") {
print "$s$ipmitool_cmd fru\n" if ($ipmitool_cmd ne "");
}
if ("$os" eq "HP-UX") {
print "$s/usr/contrib/bin/machinfo\n" if (-x '/usr/contrib/bin/machinfo');
}
}
sub show_help {
&find_helpers;
$config_cmd="dmidecode" if ("$os" eq "Linux" && $config_cmd =~ /prtconf/);
print "Usage: memconf [ -v | -D | -h ] [explorer_dir]\n";
print " -v verbose mode\n";
print " -D E-mail results to memconf maintainer\n";
print " -h print help\n";
print " explorer_dir Sun Explorer output directory\n";
print "\nThis is memconf, $version $version_date\n\nCheck my website ";
print "at $URL to get the latest\nversion of memconf.\n\n";
&show_supported if ("$os" ne "SunOS" && "$os" ne "HP-UX" && "$os" ne "Linux");
print "Please send bug reports and enhancement requests along with ";
print "the output of the\nfollowing commands to tschmidt\@micron.com ";
print "as E-mail attachments so that memconf\nmay be enhanced. ";
print "You can do this using the 'memconf -D' command if this system\n";
print "can E-mail to the Internet.\n";
&show_helpers(" ");
exit;
}
sub cpubanner {
print &runtime . "in cpubanner, corecnt=$corecnt, npcpu=$npcpu, nvcpu=$nvcpu, cputype=$cputype\n" if ($DEBUG);
if ($modelmore =~ /(Solaris x86 machine)/ && $cpubanner eq "" && $cputype ne "x86") {
$modelmore="";
while (($cf,$cnt)=each(%cpucnt)) {
$cf=~/^(.*) (\d+)$/;
$cputype=$1;
$cpufreq=$2;
}
&x86multicorecnt($cputype);
$ncpu=$cpucnt{"$cputype $cpufreq"};
if ($cpucntflag == 0 && $npcpu == 0) {
for $tmp (2,3,4,6,8,12) {
$ncpu /= $tmp if ($corecnt == $tmp && $ncpu % $tmp == 0);
}
}
$ncpu=$npcpu if ($npcpu != 0);
$cpubanner="$ncpu X " if ($ncpu > 1);
$tmp=&multicore_cputype($cputype,$corecnt);
$cpubanner .= "$tmp";
$cpubanner .= " x86" if ($cputype eq "AMD");
$cpubanner .= " ${cpufreq}MHz" if ($cpufreq ne "" && $cpufreq ne "0" && $cputype !~ /Hz$/);
}
}
sub show_header {
return if ($header_shown);
print &runtime . "cpucntfrom=$cpucntfrom\n" if ($DEBUG);
&cpubanner;
$header_shown=1;
undef %saw;
@saw{@simmsizesfound}=();
@simmsizesfound=sort numerically keys %saw;
print "memconf: $version $version_date $URL\n" if ($verbose);
print "hostname: $hostname\n" if ($hostname);
if ($filename) {
print (($SUNWexplo) ? "Sun Explorer directory" : "filename");
print ": $filename\n";
}
if ($diagthreadcnt && $cpucntfrom eq "prtdiag") {
# Replace @cpucnt with @diagcpucnt
while (($cf,$tmp)=each(%cpucnt)) {
delete $cpucnt{"$cf"};
$cpucnt{"$cf"}=$diagcpucnt{"$cf"};
}
}
if ($banner) {
# See if banner includes CPU information
if ($banner !~ /\(.*SPARC/ && $banner !~ /MHz/) {
@cputypecnt=keys(%cpucnt);
$x=0;
while (($cf,$cnt)=each(%cpucnt)) {
$x++;
$cf=~/^(.*) (\d*)$/;
$ctype=$1;
$cfreq=$2;
&multicore_cpu_cnt("");
$cpubanner .= "$cnt X " if ($cnt > 1);
if ($ctype =~ /390Z5/) {
$cpubanner .= "SuperSPARC";
$cpubanner .= "-II" if ($cfreq > 70);
} elsif ($ctype =~ /MB86907/) {
$cpubanner .= "TurboSPARC-II";
} elsif ($ctype =~ /MB86904/ || $ctype =~ /390S10/) {
$cpubanner .= "microSPARC";
$cpubanner .= "-II" if ($cfreq > 70);
} elsif ($ctype =~ /L2A0925/) {
$cpubanner .= "microSPARC-IIep";
} elsif ($ctype =~ /,RT62[56]/) {
$cpubanner .= "hyperSPARC";
} else {
$cpubanner .= "$ctype";
}
$cpubanner .= " ${cfreq}MHz" if ($cfreq ne "" && $cpubanner !~ /Hz$/);
$cpubanner .= ", " if ($x < scalar(@cputypecnt));
}
} elsif ($banner =~ /\(/ && $banner !~ /MHz/) {
# CPU listed without speed
while (($cf,$cnt)=each(%cpucnt)) {
$cf=~/^(.*) (\d*)$/;
$cfreq=$2;
$banner=~s/\)/ ${cfreq}MHz\)/g if ($cfreq);
}
}
}
$modelmore="" if ($modelmore =~ /(Solaris x86 machine)/ && $model ne "i86pc");
if ($verbose) {
if ($banner) {
print "banner: $banner";
print " $bannermore" if ($bannermore);
print " ($cpubanner)" if ($cpubanner);
print "\n";
}
print "manufacturer: $manufacturer\n" if ($manufacturer);
if ($model) {
print "model: $model";
print " $modelmore" if ($modelmore);
print " $realmodel" if ($realmodel);
print " ($cpubanner)" if ($cpubanner ne "" && $banner eq "");
print "\n";
}
print "Sun development codename: $devname\n" if ($devname ne "" && ! $clone);
print "Sun Family Part Number: $familypn\n" if ($familypn ne "" && ! $clone);
if ($filename eq "" || $SUNWexplo) {
if ($solaris) {
print "Solaris " if ($solaris !~ /Solaris/);
print "$solaris, ";
print "${kernbit}-bit kernel, " if ($kernbit);
}
if ("$os" eq "Linux" && "$release" ne "") {
print "$release\n";
} else {
print "$os $osrel";
print " ($osrelease)" if ($osrelease ne "");
print ", ${kernbit}" if ($kernbit && $HPUX);
print "\n";
}
} elsif ($HPUX) {
print "$os";
print " $osrel" if ($osrel ne "");
print " ($osrelease)" if ($osrelease ne "");
print ", ${kernbit}" if ($kernbit);
print "\n";
} elsif ("$os" eq "Linux") {
if ("$release" ne "") {
print "$release\n";
} elsif ($LnxDMI) {
print "Linux x86\n";
} elsif (-e '/dev/openprom' || $filename =~ /prtconf\.Linux/) {
print "Linux SPARC\n";
}
} elsif ($BSD) {
print "Solaris 1.X, SunOS 4.X\n";
} else {
print "Solaris 2.X, SunOS 5.X\n";
}
$ncpu=1 if ($ncpu == 0); # Assume it has at least 1 CPU
if ($cpuarr == -1) {
@cputypecnt=keys(%cpucnt);
$x=0;
while (($cf,$cnt)=each(%cpucnt)) {
if ($cpucntflag == 0 && $npcpu == 0 && $cpucntfrom ne "prtdiag") {
for $tmp (2,3,4,6,8,12) {
$cnt /= $tmp if ($corecnt == $tmp && $cnt % $tmp == 0);
}
$cpucntflag=1;
}
if ($npcpu != 0) {
$cnt=$npcpu;
} else {
$cnt=$ndcpu if ($ndcpu != 0);
}
$x++;
$cf=~/^(.*) (\d*)$/;
$ctype=$1;
$ctype=$cf if (! $ctype);
$cfreq=$2;
&checkX86;
$ctype=&multicore_cputype($ctype,$corecnt) if ($isX86);
&multicore_cpu_cnt("");
print "$cnt $ctype";
if ($cfreq) {
print " ${cfreq}MHz" if ($cfreq > 0 && $ctype !~ /Hz$/);
}
print " cpu";
print "s" if ($cnt > 1);
print ", " if ($x < scalar(@cputypecnt));
}
print (($sysfreq) ? ", " : "\n") if ($x > 0);
}
print "system freq: ${sysfreq}MHz\n" if ($sysfreq);
} else {
$modelbuf="";
if ($manufacturer) {
$modelbuf .= "$manufacturer " if ($banner !~ /^$manufacturer/ && $model !~ /^$manufacturer/ && ($banner ne "" || $model ne ""));
}
if ($banner ne "" && $bannermore ne "") {
$modelbuf .= "$banner $bannermore";
} elsif ($modelmore) {
$modelbuf .= "$model $modelmore";
} elsif ($banner) {
$modelbuf .= "$banner";
} elsif ($diagbanner) {
$modelbuf .= "$diagbanner";
} elsif ($model) {
$modelbuf .= "$model";
}
$modelbuf .= " ($cpubanner)" if ($cpubanner);
$modelbuf .= " $realmodel" if ($realmodel);
print "$modelbuf\n" if ($modelbuf);
}
# debug output
if ($verbose > 1) {
if ($banner) {
print "banner = $banner\n";
} else {
print "diagbanner = $diagbanner\n" if ($diagbanner);
}
print "cpubanner = $cpubanner\n" if ($cpubanner);
print "bannermore = $bannermore\n" if ($bannermore);
print "model = $model\n" if ($model);
print "modelmore = $modelmore\n" if ($modelmore);
print "machine = $machine\n" if ($machine);
print "platform = $platform\n" if ($platform);
print "ultra = $ultra\n" if ($ultra);
if ($ultra eq "AXi") {
print "found10bit = $found10bit\n";
print "found11bit = $found11bit\n";
}
print "motherboard = $motherboard\n" if ($motherboard);
print "romver = $romver\n" if ($romver);
print "freephys = $freephys\n" if ($freephys);
print "perl version: " . &mychomp($]) . "\n";
print "memory line: $gotmemory\n" if ($gotmemory);
print "module info: $gotmodule\n" if ($gotmodule);
print "dmidecode version: $dmidecode_ver\n" if ($dmidecode_ver);
# Fujitsu GP7000F and PrimePower systems
print "cpu name info: $gotcpunames\n" if ($gotcpunames);
print "cpu board info: $gotcpuboards\n" if ($gotcpuboards);
print "module name info: $gotmodulenames\n" if ($gotmodulenames);
print "simmsizes = @simmsizes\n" if ($simmsizes[0] > 0);
print "simmsizesfound = @simmsizesfound\n" if ($simmsizesfound[0]);
}
if (($verbose >= 1) && $boardfound_cpu) {
if ($format_cpu == 1) {
print "CPU Units: Frequency Cache-Size Version\n" if ($model =~ /-Enterprise/ || $ultra eq "e");
} else {
print "CPU Units:\n" if (! $ldm_memory);
}
if ($model ne "SPARCserver-1000" && $model ne "SPARCcenter-2000") {
print @boards_cpu if (! $ldm_memory);
print "Memory Units:\n" if (! &is_virtualmachine);
}
}
if ($interleave && ! &is_virtualmachine) {
print "Memory Interleave Factor: $interleave";
print "-way" if ($interleave =~/^\d+$/);
print "\n";
}
}
sub show_unrecognized {
if ($perlhexbug) {
print " This is most likely because Perl V$PERL_VERSION";
print " is buggy in hex number\n conversions. Please";
print " upgrade your perl release to Perl V5.002 or later\n";
print " for best results.\n";
} else {
print " This is most likely because memconf $version";
print " does not completely\n";
print " recognize this $os $osrel $platform system.\n";
&show_request if ($untested == 0);
}
}
sub show_untested {
if ($untested_type eq "OS") {
print "WARNING: This is an untested $os $osrel operating";
} elsif ($untested_type eq "OBP") {
print "ERROR: This is an untested $os $osrel OBP $romvernum";
} elsif ($untested_type eq "CPU") {
print "ERROR: This is an untested CPU type on this $os $osrel";
} else {
print "ERROR: This is an untested $os $osrel";
}
print " system by memconf $version\n";
print " Please let the author know how it works.\n";
$exitstatus=1;
&show_request;
}
sub show_request {
print " Check my website at $URL\n";
print " for a newer version of memconf that may recognize this ";
print "system better.\n";
print " Please run 'memconf -D' if this system can E-mail to ";
print "the Internet\n or send the output of the following ";
print "commands manually to Tom Schmidt\n (tschmidt\@micron.com)";
print " so that memconf $version may be enhanced to\n properly ";
print "recognize this system:\n";
print " memconf -d\n";
&show_helpers(" ");
if ($untested) {
print " If this system is a Sun clone, ";
print "please also send any hardware\n documentation ";
print "on the memory layout that you may have.\n";
}
}
sub show_supported {
print "memconf: $version $version_date $URL\n" if (! $verbose);
print "ERROR: memconf $version is not supported on this $os";
print" $osrel $machine system.\n memconf is supported on:\n";
print " Solaris (SunOS 4.X or 5.X) on SPARC\n";
print " Solaris 10 6/06 or later on x86 with /usr/platform/i86pc/sbin/prtdiag\n";
print " Linux on SPARC with sparc-utils and /dev/openprom\n";
print " Linux on x86 with kernel-utils or pmtools for /usr/sbin/dmidecode\n";
print " most HP-UX systems with Support Tools Manager (cstm)\n";
if ("$os" eq "Linux") {
print "NOTICE: This may be corrected by installing the ";
print (("$machine" =~ /.86/) ? "kernel-utils or pmtools" : "sparc-utils");
print "\n package if available for this $machine system.\n";
}
print " memconf may be able to process Sun Explorer data on this";
print " machine.\n";
print " Check my website at $URL\n";
print " for a newer version of memconf that may recognize this ";
print "system better.\n";
exit 1;
}
sub show_memory {
$mem=shift;
print "${mem}MB";
print " (", $mem / 1024, "GB)" if ($mem > 1023);
print "\n";
}
sub show_memory_label {
$mem=shift;
return if (! defined($mem));
return "$mem" if ($mem =~ /[MG]B/);
return $mem / 1024 . "GB" if ($mem >= 1024);
return "${mem}MB";
}
sub check_model {
print &runtime . "in check_model, model=$model\n" if ($DEBUG);
&find_helpers;
if ($filename) {
$platform=$model;
$platform="SUNW,Ultra-5_10" if ($diagbanner =~ /Sun Ultra 5\/10/);
$platform="SUNW,Sun-Fire" if ($diagbanner =~ /Sun Fire [346]8[01]0\b/ || $diagbanner =~ /Sun Fire E[246]900\b/);
$platform="SUNW,Sun-Fire-15000" if ($diagbanner =~ /Sun Fire E2[05]K\b/);
$platform=~s/-S$// if ($model =~ /Sun-Blade-[12]500-S\b/);
$prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag" if ($prtdiag_cmd =~ /platform/);
}
$model=~s/.*SUNW,//g;
$model=~s/TWS,//g;
$model=~s/CYCLE,//g;
$model=~s/Tadpole_//g;
$model=~s/ASPX,//g;
$model=~s/PFU,//g;
$model=~s/FJSV,//g;
$model=~s/CompuAdd //g;
$model=~s/RDI,//g;
$model=~s/\s+$//;
$ultra="ultra" if ($ultra eq 0 && ($model =~ /Ultra/ || $model =~ /Blade/ || $model =~ /Fire/));
if ($model =~ /Fire[- ]X/i || $model =~ /Fire[- ]B[12]00x/i) {
# Sun Fire X??00 Servers, i86pc
# Sun B100x or B200x Blade Servers, i86pc
$ultra="";
$machine="x86" if ($machine ne "i86pc");
$untested=1;
&x86_devname;
}
$ultra="sparc64" if ($model =~ /SPARC64/);
$ultra="e" if ($model =~ /-Enterprise/ && $model !~ /SPARC-Enterprise/);
$ultra=1 if ($model =~ /Ultra-1\b/);
$ultra=2 if ($model =~ /Ultra-2\b/);
$ultra=5 if ($model =~ /Ultra-5\b/);
$ultra="5_10" if ($model =~ /Ultra-5_10\b/);
$ultra=30 if ($model =~ /Ultra-30\b/);
$ultra=60 if ($model =~ /Ultra-60\b/);
$ultra=80 if ($model =~ /Ultra-80\b/);
$ultra=250 if ($model =~ /Ultra-250\b/);
$ultra=450 if ($model =~ /Ultra-4\b/);
$ultra="Netra t1" if ($banner =~ /Netra t1\b/);
if ($model =~ /Ultra-4FT\b/) {
$ultra="Netra ft1800";
$bannermore="(Netra ft1800)";
$modelmore="(Netra ft1800)";
}
$ultra="Sun Blade 1000" if ($model =~ /Ultra-100\b/); # prototype
$ultra="Sun Blade 1000" if ($model =~ /Sun-Blade-1000\b/);
$ultra="Sun Blade 2000" if ($model =~ /Sun-Blade-2000\b/);
$ultra="Netra 20" if ($model =~ /Netra-20\b/);
$ultra="Netra 20" if ($model =~ /Netra-T4\b/);
# E2900/E4900 also use Netra-T12
$ultra="Netra T12" if ($model =~ /Netra-T12\b/ && $ultra !~ /Sun Fire/);
$ultra="Sun Blade 100" if ($model =~ /Grover\b/); # prototype
$ultra="Sun Blade 100" if ($model =~ /Sun-Blade-100\b/);
$ultra="Sun Fire 280R" if ($model =~ /Enterprise-820R\b/); # prototype
$ultra="Sun Fire 280R" if ($model =~ /Sun-Fire-280R\b/);
$ultra="Sun Fire" if ($model =~ /Serengeti\b/); # prototype
$ultra="Sun Fire" if ($model eq "Sun-Fire" || $model =~ /Sun-Fire-[346]8[01]0\b/);
$ultra="Sun Fire V480" if ($model =~ /Sun-Fire-480R\b/);
$ultra="Sun Fire V490" if ($model =~ /Sun-Fire-V490\b/);
$ultra="Sun Fire V880" if ($model =~ /Sun-Fire-880\b/);
$ultra="Sun Fire V890" if ($model =~ /Sun-Fire-V890\b/);
# Sun Fire 12K, E25K, etc. systems identifies itself as Sun Fire 15K
$ultra="Sun Fire 15K" if ($model =~ /Sun-Fire-15000\b/ && $ultra !~ /Sun Fire /);
$ultra="Sun Fire 12K" if ($model =~ /Sun-Fire-12000\b/);
$ultra="Serverblade1" if ($model =~ /Serverblade1\b/);
# UltraSPARC-IIIi (Jalapeno) systems
$ultra="Enchilada" if ($model =~ /Enchilada\b/); # prototype
$ultra="Enchilada" if ($model =~ /Sun-Fire-V210\b/);
$ultra="Enchilada" if ($model =~ /Netra-210\b/);
$ultra="Enchilada" if ($model =~ /Sun-Fire-V240\b/);
$ultra="Enchilada" if ($model =~ /Netra-240\b/);
$ultra="Sun Fire V440" if ($model =~ /Sun-Fire-V440\b/);
$ultra="Netra 440" if ($model =~ /Netra-440\b/);
$ultra="Sun Fire V250" if ($model =~ /Sun-Fire-V250\b/);
$ultra="Sun Blade 1500" if ($model =~ /Sun-Blade-1500\b/);
$ultra="Sun Blade 2500" if ($model =~ /Sun-Blade-2500\b/);
if ($model =~ /Sun-Blade-[12]500-S\b/) {
$model=~s/-S$//;
$modelmore="(Silver)" if ($banner !~ /\(Silver\)/);
}
$ultra="Sun Ultra 45 Workstation" if ($model =~ /Sun-Ultra-45-Workstation\b/ || $model eq "A70");
$ultra="Sun Ultra 25 Workstation" if ($model =~ /Sun-Ultra-25-Workstation\b/ || $model eq "Ultra-25");
$ultra="Sun Ultra 45 or Ultra 25 Workstation" if ($model =~ /Sun-Ultra-45-or-Ultra-25-Workstation\b/);
$ultra="Sun Fire V125" if ($model =~ /Sun-Fire-V125\b/);
$ultra="Seattle" if ($model =~ /Sun-Fire-V215\b/);
$ultra="Seattle" if ($model =~ /Sun-Fire-V245\b/);
$ultra="Boston" if ($model =~ /Sun-Fire-V445\b/);
# UltraSPARC-IV (Jaguar) or UltraSPARC-IV+ (Panther) systems
$ultra="Sun Fire E2900" if ($model =~ /Sun-Fire-E2900\b/);
$ultra="Sun Fire E4900" if ($model =~ /Sun-Fire-E4900\b/);
$ultra="Sun Fire E6900" if ($model =~ /Sun-Fire-E6900\b/);
$ultra="Sun Fire E20K" if ($model =~ /Sun-Fire-E20K\b/ || $model =~ /Sun-Fire-Enterprise-20K\b/);
$ultra="Sun Fire E25K" if ($model =~ /Sun-Fire-E25K\b/ || $model =~ /Sun-Fire-Enterprise-25K\b/);
# SPARC64-VI or SPARC64-VII systems
$ultra=$banner if ($banner =~ /SPARC Enterprise M[34589]000 Server/);
# UltraSPARC-T1 (Niagara) systems
if ($model =~ /Sun-Fire-T200\b/) {
$ultra="T2000";
$modelmore="(Sun Fire T2000)";
}
$ultra="T2000" if ($model =~ /Sun-Fire-T2000\b/ || $model =~ /SPARC-Enterprise-T2000/ || $banner =~ /SPARC Enterprise T2000/ || $model =~ /Netra-T2000\b/ || $banner =~ /Netra T2000\b/);
$ultra="T1000" if ($model =~ /Sun-Fire-T1000\b/ || $model =~ /SPARC-Enterprise-T1000/ || $banner =~ /SPARC Enterprise T1000/);
$ultra="T6300" if ($model =~ /Sun-Blade-T6300\b/ || $banner =~ /\bT6300\b/);
# UltraSPARC-T2 (Niagara-II) systems
$ultra="T5120" if ($model =~ /SPARC-Enterprise-T5120/ || $banner =~ /\bT5120\b/);
$ultra="T5220" if ($model =~ /SPARC-Enterprise-T5220/ || $model =~ /Netra-T5220/ || $banner =~ /\bT5220\b/);
$ultra="T6320" if ($model =~ /Sun-Blade-T6320\b/ || $banner =~ /\bT6320\b/);
# UltraSPARC-T2+ (Victoria Falls) systems
$ultra="T5140" if ($model =~ /SPARC-Enterprise-T5140/ || $banner =~ /\bT5140\b/);
$ultra="T5240" if ($model =~ /SPARC-Enterprise-T5240/ || $banner =~ /\bT5240\b/ || $model =~ /SPARC-USBRDT-5240/);
$ultra="T5440" if ($model =~ /SPARC-Enterprise-T5440/ || $model =~ /Netra-T5440/ || $banner =~ /\bT5440\b/ || $model =~ /SPARC-USBRDT-5440/);
$ultra="T6340" if ($model =~ /Sun-Blade-T6340\b/ || $banner =~ /\bT6340\b/);
# Older SPARCstations
$modelmore="SPARCstation SLC" if ($model eq "Sun 4/20");
$modelmore="SPARCstation ELC" if ($model eq "Sun 4/25");
$modelmore="SPARCstation IPC" if ($model eq "Sun 4/40");
$modelmore="SPARCstation IPX" if ($model eq "Sun 4/50");
$modelmore="SPARCstation 1" if ($model eq "Sun 4/60");
$modelmore="SPARCstation 1+" if ($model eq "Sun 4/65");
$modelmore="SPARCstation 2" if ($model eq "Sun 4/75");
$modelmore="(SPARCsystem 600)" if ($model =~ /Sun.4.600/ && $banner !~ /SPARCsystem/);
$modelmore="Sun 4/30" if ($model =~ /SPARCstation-LX/);
$modelmore="Sun 4/15" if ($model =~ /SPARCclassic/);
$modelmore="Sun 4/10" if ($model =~ /SPARCclassic-X/);
$modelmore="(SPARCstation 10SX)" if ($model =~ /Premier-24/);
if ($model eq "S240") {
$manufacturer="Sun Microsystems, Inc.";
$modelmore="SPARCstation Voyager";
}
# x86
&checkX86;
if ($isX86) {
$modelmore="(Solaris x86 machine)";
$cputype="x86";
$machine=$model;
$ultra=0;
$cpucntfrom="prtconf" if ($cpucntfrom eq "");
return if ($model_checked);
&check_prtdiag if ($use_psrinfo_data == 2);
&check_psrinfo;
&cpubanner;
$cpucnt{"$cputype $cpufreq"}++;
}
# Clones
if ($banner =~ /\bMP-250[(\b]/) {
$ultra="axus250";
$bannermore="Ultra-250";
$modelmore="(Ultra-250)";
}
$manufacturer="AXUS" if ($ultra =~ /axus/);
$manufacturer="Force Computers" if ($model =~ /SPARC CP/);
if ($model eq "S3GX") {
$bannermore="(SPARCbook 3GX)";
$modelmore="(SPARCbook 3GX)";
}
if ($model eq "S3XP") {
$bannermore="(SPARCbook 3XP)";
$modelmore="(SPARCbook 3XP)";
}
$manufacturer="Sun Microsystems, Inc." if ($banner !~ /Axil/ && (
$model =~ /^SPARCstation/ || $model =~ /^SPARCsystem/ ||
$model =~ /^SPARCclassic/ || $model =~ /^SPARCserver/ ||
$model =~ /^SPARCcenter/ || $model =~ /Enterprise/ ||
$model =~ /Premier 24/ || $model =~ /Netra/ ||
$model =~ /Sun.Fire/ || $model =~ /Sun.Blade/ ||
$model =~ /Serverblade1/));
if ($model =~ /Auspex/) {
$manufacturer="Auspex";
$model=~s/Auspex //g;
$bannermore="Netserver";
$modelmore="Netserver";
}
$manufacturer="Fujitsu" if ($banner =~ /Fujitsu/);
$manufacturer="Fujitsu Siemens" if ($banner =~ /Fujitsu Siemens/);
$manufacturer="Fujitsu Siemens Computers" if ($banner =~ /Fujitsu Siemens Computers/);
if ($model =~ /S-4/ || $model eq "GP" || $model =~ /^GPU[SZU]/) {
$manufacturer="Fujitsu" if ($manufacturer !~ /^Fujitsu/);
$model=~s,_,/,g;
$untested=1 if ($model =~ /^GPUSC-L/);
$untested=1 if ($model =~ /^GPUU/);
}
if ($model =~ /PowerLite-/) {
$bannermore=$model;
$bannermore=~s/PowerLite-//g;
}
$model_checked=1;
}
sub check_banner {
print &runtime . "in check_banner, banner=$banner, ultra=$ultra\n" if ($DEBUG);
$ultra="ultra" if ($ultra eq 0 && ($banner =~ /Ultra/ || $banner =~ /Blade/ || $banner =~ /Fire/));
$ultra="sparc64" if ($banner =~ /SPARC64/);
$ultra=5 if ($banner =~ /Ultra 5\b/);
$ultra="5_10" if ($banner =~ /Ultra 5\/10\b/);
$ultra=10 if ($banner =~ /Ultra 10\b/);
$ultra="220R" if ($banner =~ /Enterprise 220R\b/);
$ultra=80 if ($banner =~ /Ultra 80\b/);
# E410 is prototype name of E420R, but may still be in the
# banner as "Sun Ultra 80/Enterprise 410 UPA/PCI"
$ultra="420R" if ($banner =~ /Enterprise 410\b/);
$ultra="420R" if ($banner =~ /Enterprise 420R\b/);
$ultra="Netra t140x" if ($banner =~ /Netra t 1400\/1405\b/);
$ultra="CP1400" if ($banner =~ /Ultra CP 1400\b/);
$ultra="CP1500" if ($banner =~ /Ultra CP 1500\b/);
$ultra="CP2000" if ($banner =~ /\bCP2000\b/);
$ultra="CP2040" if ($banner =~ /\bCP2000 model 40\b/);
$ultra="CP2060" if ($banner =~ /\bCP2000 model 60\b/);
$ultra="CP2080" if ($banner =~ /\bCP2000 model 80\b/);
$ultra="CP2140" if ($banner =~ /\bCP2000 model 140\b/);
$ultra="CP2160" if ($banner =~ /\bCP2000 model 160\b/);
$ultra="Sun Blade 1000" if ($banner =~ /Sun Excalibur\b/); # prototype
$ultra="Sun Blade 2000" if ($banner =~ /Sun Blade 2000\b/);
$ultra="Netra ct400" if ($banner =~ /Netra ct400\b/);
$ultra="Netra ct410" if ($banner =~ /Netra ct410\b/);
$ultra="Netra ct800" if ($banner =~ /Netra ct800\b/);
$ultra="Netra ct810" if ($banner =~ /Netra ct810\b/);
$ultra="Sun Blade 150" if ($banner =~ /Sun Blade 150\b/);
# Sun Fire 12K, E25K, etc. systems identifies itself as Sun Fire 15K
$ultra="Sun Fire 12K" if ($banner =~ /Sun Fire 12000\b/ || $banner =~ /Sun Fire 12K\b/);
if ($banner =~ /Ultra 4FT\b/) {
$ultra="Netra ft1800";
$bannermore="(Netra ft1800)";
$modelmore="(Netra ft1800)";
}
# UltraSPARC-IIIi (Jalapeno) systems
$ultra="Sun Ultra 45 Workstation" if ($banner =~ /Sun Ultra 45 Workstation\b/);
$ultra="Sun Ultra 25 Workstation" if ($banner =~ /Sun Ultra 25 Workstation\b/);
# UltraSPARC-IV (Jaguar) or UltraSPARC-IV+ (Panther) systems
$ultra="Sun Fire E2900" if ($banner =~ /Sun Fire E2900\b/);
$ultra="Sun Fire E4900" if ($banner =~ /Sun Fire E4900\b/);
$ultra="Sun Fire E6900" if ($banner =~ /Sun Fire E6900\b/);
$ultra="Sun Fire E20K" if ($banner =~ /Sun Fire E20K\b/);
$ultra="Sun Fire E25K" if ($banner =~ /Sun Fire E25K\b/);
# SPARC64-VI or SPARC64-VII systems
$ultra=$banner if ($banner =~ /SPARC Enterprise M[34589]000 Server/);
# Clones
if ($banner =~ /\bMP-250[(\b]/) {
$ultra="axus250";
$bannermore="Ultra-250";
$modelmore="(Ultra-250)";
}
$manufacturer="AXUS" if ($ultra =~ /\baxus\b/);
$manufacturer="Rave" if ($banner =~ /Axil/);
$manufacturer="Tadpole/Cycle" if ($banner =~ /Cycle/ || $banner =~ /\bUP-20\b/ || $banner =~ /\b520IIi\b/);
$manufacturer="Tadpole" if ($banner =~ /Tadpole/ || $banner =~ /\bRDI\b/ || $banner =~ /\bVoyagerIIi\b/ || $banner =~ /\bSPARCLE\b/);
$manufacturer="Tatung" if ($banner =~ /COMPstation/);
$manufacturer="Twinhead" if ($banner =~ /TWINstation/);
$manufacturer="Fujitsu" if ($banner =~ /Fujitsu/);
$manufacturer="Fujitsu Siemens" if ($banner =~ /Fujitsu Siemens/);
$manufacturer="Fujitsu Siemens Computers" if ($banner =~ /Fujitsu Siemens Computers/);
}
sub check_for_prtdiag {
return if ("$prtdiag_exec" eq "" && $filename eq "");
return if ($have_prtdiag_data);
&find_helpers;
# Check for LDOMs
if ($ldm_cmd ne "" && $have_ldm_data == 0) {
# Warn that ldm and prtdiag may take a while to run
&please_wait;
@ldm=&run("$ldm_cmd list-devices -a -p");
$have_ldm_data=1;
foreach $line (@ldm) {
$line=&dos2unix($line);
$line=&mychomp($line);
&check_LDOM;
}
}
@prtdiag=&run("$prtdiag_exec") if ($filename eq "");
$have_prtdiag_data=1;
foreach $line (@prtdiag) {
$line=&dos2unix($line);
# Some Solaris prtdiag outputs have malformed header, so
# handle them also.
if ($line =~ /^System Configuration: +/ || $line =~ /.BIOS Configuration: / || $line =~ /Sun Microsystems .*Fire *X/i || $line =~ /Sun Microsystems .*Blade *X/i || $line =~ /Sun Microsystems .*Memory size: / || ($line =~ /Sun Microsystems .*Ultra / && $machine eq i86pc)) {
$line=&mychomp($line);
$tmp=$line;
$line=~s/System Configuration: +//g;
$line=~s/BIOS Configuration: .*//g;
if ($line =~ /^Sun Microsystems/i) {
$manufacturer="Sun Microsystems, Inc.";
} elsif ($line =~ /Inc\./) {
$manufacturer=$line;
$manufacturer=~s/^(.* Inc\.).*/$1/;
if ($tmp !~ /BIOS Configuration: / && $model eq "" && $machine eq "i86pc") {
$diagbanner=$line;
$diagbanner=~s/^.* Inc\. *(.*)/$1/;
}
} elsif ($line =~ /Corporation/) {
$manufacturer=$line;
$manufacturer=~s/^(.* Corporation).*/$1/;
if ($tmp !~ /BIOS Configuration: / && $model eq "" && $machine eq "i86pc") {
$diagbanner=$line;
$diagbanner=~s/^.* Corporation *(.*)/$1/;
}
} else {
$manufacturer=$line;
$manufacturer=~s/^(\w+)[ \/].*/$1/;
}
if ($line =~ /^Sun Microsystems +sun\w+ +/) {
$diagbanner=$line;
$diagbanner=~s/Sun Microsystems +sun\w+ +//g;
$diagbanner=~s/Memory size: .*$//g;
} elsif ($line =~ /^Sun Microsystems *Sun +/i) {
$diagbanner=$line;
$diagbanner=~s/Sun Microsystems *Sun/Sun/ig;
$diagbanner=~s/Memory size: .*$//g;
$diagbanner=~s/ BLADE / Blade /g;
$diagbanner=~s/ FIRE / Fire /g;
$diagbanner=~s/ SERVER / Server /g;
} elsif ($line =~ /^Sun Microsystems, Inc. *Sun +/i) {
$diagbanner=$line;
$diagbanner=~s/Sun Microsystems, Inc. *Sun/Sun/ig;
$diagbanner=~s/Memory size: .*$//g;
$diagbanner=~s/ BLADE / Blade /g;
$diagbanner=~s/ FIRE / Fire /g;
$diagbanner=~s/ SERVER / Server /g;
} elsif ($line =~ /^Sun Microsystems.*Ultra/) {
$diagbanner=$line;
$diagbanner=~s/Sun Microsystems.*Ultra/Ultra/g;
$diagbanner=~s/Memory size: .*$//g;
}
$diagbanner=~s/\s+$//;
}
$prtdiag_failed=1 if ($line =~ /Prtdiag Failed/i);
# prtdiag only works on the global zone (container), so find out
# if we are in a Solaris zone. solaris8 brand container shows
# kernel version of "Generic_Virtual"
$prtdiag_failed=2 if ($line =~ /prtdiag can only be run in the global /i || $kernver eq "Generic_Virtual");
}
if ($psrinfo_cmd ne "" && $have_psrinfo_data == 0) {
@psrinfo=&run("$psrinfo_cmd -v");
$tmp=&mychomp(`$psrinfo_cmd -p 2>/dev/null`); # physical CPUs
if ($tmp ne "") {
push(@psrinfo, "#psrinfo -p\n$tmp\n");
$tmp=&mychomp(`$psrinfo_cmd -p -v 2>/dev/null`);
push(@psrinfo, "#psrinfo -p -v\n$tmp\n");
}
$have_psrinfo_data=1;
}
if ($ipmitool_cmd ne "" && $have_ipmitool_data == 0) {
@ipmitool=&run("$ipmitool_cmd fru");
$have_ipmitool_data=1;
}
if ($smbios_cmd ne "" && $have_smbios_data == 0) {
@smbios=&run("$smbios_cmd");
$have_smbios_data=1;
}
if (($filename eq "") && ($verbose == 3)) {
# Only run the following commands if E-mailing maintainer since
# this data is used by memconf only for some systems
if ($prtfru_cmd ne "" && $have_prtfru_data == 0) {
@prtfru=&run("$prtfru_cmd -x");
$have_prtfru_data=1;
}
if ($prtpicl_cmd ne "" && $have_prtpicl_data == 0) {
@prtpicl=&run("$prtpicl_cmd -v");
$have_prtpicl_data=1;
}
if ($cfgadm_cmd ne "" && $have_cfgadm_data == 0) {
@cfgadm=&run("$cfgadm_cmd -al");
$have_cfgadm_data=1;
}
if ($ldm_cmd ne "" && $have_ldm_data == 0) {
@ldm=&run("$ldm_cmd list-devices -a -p");
$have_ldm_data=1;
}
}
}
sub check_prtdiag {
return if ($prtdiag_checked);
print &runtime . "in check_prtdiag\n" if ($DEBUG);
$prtdiag_checked=1;
return if ("$prtdiag_exec" eq "" && $filename eq "");
&check_for_prtdiag;
$flag_cpu=0;
$flag_mem=0;
foreach $line (@prtdiag) {
$line=&dos2unix($line);
if ($line =~ /====/ || $line =~ /\/ \(picl,/) {
$flag_cpu=0; # End of CPU section
$flag_mem=0; # End of memory section
}
if ($line =~ /Memory Units: Group Size/) {
# Start of CPU and memory section on SS1000/SC2000
$flag_cpu=1;
$flag_mem=1;
}
$line="Memory $line" if ($line =~ /^Segment Table:/);
if (($flag_mem >= 1) && ($line !~ /^\s*\n$/)) {
$boardfound_mem=1;
$boardfound_mem=0 if ($line =~ /Cannot find/);
@linearr=split(' ', $line);
if ($linearr[0] =~ /^0x/ && $ultra =~ /Sun Blade 1[05]0\b/ && ($linearr[$#linearr] eq "chassis/system-board" || $linearr[$#linearr] eq "-")) {
# Sometimes socket is unlabeled on prtdiag
# output on Sun Blade 100/150
$socket=$socketstr[0] if ($linearr[0] =~ /^0x0/);
if ($simmrangex eq "00000400") {
$socket=$socketstr[1] if ($linearr[0] =~ /^0x4/);
$socket=$socketstr[2] if ($linearr[0] =~ /^0x8/);
$socket=$socketstr[3] if ($linearr[0] =~ /^0xc/);
} else {
$socket=$socketstr[1] if ($linearr[0] =~ /^0x2/);
$socket=$socketstr[2] if ($linearr[0] =~ /^0x4/);
$socket=$socketstr[3] if ($linearr[0] =~ /^0x6/);
}
if ($linearr[$#linearr] eq "-") {
$line=~s/-$/$socket/g;
$linearr[$#linearr]=$socket;
} else {
$line=~s/-board/-board\/$socket/g;
$linearr[$#linearr]="chassis/system-board/$socket";
}
}
push(@boards_mem, "$line");
$flag_rewrite_prtdiag_mem=1 if ($line =~ /^MB\/CMP[0-3]\/BR[0-3]\/CH[01]\/D[01]/);
if ($#linearr >= 2) {
if ($linearr[2] =~ /\bU\d\d\d\d\b/) {
# Sun Ultra-250 format
$sockets_used .= " $linearr[2]";
} elsif ($linearr[2] =~ /\b\d\d\d\d\b/) {
# Sun Ultra-4 format
$sockets_used .= " U$linearr[2]";
}
}
if ($#linearr >= 3) {
if ($linearr[3] ne "BankIDs" && $linearr[3] ne "GroupID" && $line !~ /^0x\d[\d ]+\d.+ +\d +-$/) {
if ($linearr[1] =~ /\b\d+MB\b/) {
# Sun Blade 100/1000 format
$simmsize=$linearr[1];
$simmsize=~s/MB//g;
push(@simmsizesfound, "$simmsize");
} elsif ($linearr[1] =~ /\b\d+GB\b/) {
# Sun Blade 1000 format
$simmsize=$linearr[1];
$simmsize=~s/GB//g;
$simmsize *= 1024;
push(@simmsizesfound, "$simmsize");
}
}
if ($model eq "Ultra-250" || $ultra eq 250 || $model eq "Ultra-4" || $ultra eq 450 || $model eq "Ultra-4FT" || $ultra eq "Netra ft1800") {
if ($linearr[3] =~ /\b\d+\b/) {
$simmsize=$linearr[3];
push(@simmsizesfound, "$simmsize");
}
}
}
if ($linearr[$#linearr] =~ /\bDIMM\d/ || $linearr[$#linearr] =~ /\b[UJ]\d\d\d\d[\b,]/ || ($linearr[$#linearr - 1] eq "Label" && $linearr[$#linearr] eq "-")) {
$sockets_used .= " $linearr[$#linearr]";
# May be multiple sockets separated by ","
$sockets_used=~s/,/ /g;
} elsif ($#linearr >= 2) {
if ($linearr[2] =~ /MB\/P[01]\/B[01]\/D[01]/ || $linearr[2] =~ /C[0-3]\/P[01]\/B[01]\/D[01]/) {
$sockets_used .= " $linearr[2]";
# May be multiple sockets separated by ","
$sockets_used=~s/,/ /g;
}
}
if ($linearr[0] !~ /^0x/ && ($linearr[$#linearr] eq "-" || $linearr[$#linearr] =~ /^-,/)) {
# unlabeled sockets
$sockets_used .= " $linearr[$#linearr]";
# May be multiple sockets separated by ","
$sockets_used=~s/,/ /g;
}
if ($linearr[$#linearr] =~ /\/J\d\d\d\d$/) {
$linearr[$#linearr]=~s/.+\///g;
$sockets_used .= " $linearr[$#linearr]";
}
if ($ultra eq "Sun Fire 280R") {
if ($line =~ / CA +0 +[0-3] .+4-way/) {
$sockets_used="J0100 J0202 J0304 J0406 J0101 J0203 J0305 J0407";
} elsif ($line =~ / CA +0 +[02] /) {
$sockets_used .= " J0100 J0202 J0304 J0406" if ($sockets_used !~ / J0100 /);
} elsif ($line =~ / CA +[01] +[13] /) {
$sockets_used .= " J0101 J0203 J0305 J0407" if ($sockets_used !~ / J0101 /);
}
}
# Memory on Sun Fire systems
if ($line =~ /^\/N\d\/SB\d\/P\d\/B\d\b/) {
$boardslot_mem=substr($line,0,13);
push(@boardslot_mems, "$boardslot_mem");
$boardslot_mems .= $boardslot_mem . " ";
} elsif ($line =~ /^\/N\d\/SB\d\d\/P\d\/B\d\b/) {
$boardslot_mem=substr($line,0,14);
push(@boardslot_mems, "$boardslot_mem");
$boardslot_mems .= $boardslot_mem . " ";
} elsif ($line =~ /^\/SB\d\d\/P\d\/B\d\b/) {
$boardslot_mem=substr($line,0,11);
push(@boardslot_mems, "$boardslot_mem");
$boardslot_mems .= $boardslot_mem . " ";
} elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b,/) {
$boardslot_mem=substr($line,24,51);
push(@boardslot_mems, "$boardslot_mem");
$boardslot_mems .= $boardslot_mem . " ";
} elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) {
$boardslot_mem=substr($line,24,12);
push(@boardslot_mems, "$boardslot_mem");
$boardslot_mems .= $boardslot_mem . " ";
}
if (($ultra =~ /Sun Fire/) && ($#linearr >= 5)) {
if ($linearr[5] =~ /\d+MB/) {
$simmsize=$linearr[5];
$simmsize=~s/MB//g;
push(@simmsizesfound, "$simmsize");
}
}
if ($ultra =~ /Sun Fire V[48][89]0\b/) {
# Fire V480, V490, V880, V890
$bankname="groups";
if ($banks_used ne "A0 A1 B0 B1") {
$banks_used="A0 B0" if ($line =~ /^ ?[ABCD] .+ 4-way /);
$banks_used="A0 A1 B0 B1" if ($line =~ /^ ?[ABCD] .+ 8-way /);
}
}
if ($linearr[$#linearr] =~ /MB\/CMP0\/CH[0-3]\/R[01]\/D[01]/) {
# UltraSPARC-T1 systems
if ($#linearr >= 5) {
if ($linearr[5] eq "MB") {
$simmsize=$linearr[4];
$simmsize=~s/MB//g;
$simmsize /= 2;
push(@simmsizesfound, "$simmsize");
} elsif ($linearr[5] eq "GB") {
$simmsize=$linearr[4];
$simmsize=~s/GB//g;
$simmsize *= 512;
push(@simmsizesfound, "$simmsize");
}
}
$sockets_used .= " $linearr[$#linearr]";
}
if ($linearr[$#linearr] =~ /MB\/CMP[0-3]\/BR[0-3]\/CH[01]\/D[01]/ || $linearr[$#linearr] =~ /MB\/CMP[01]\/MR[01]\/BR[01]\/CH[01]\/D[23]/) {
# UltraSPARC-T2 systems: T5120, T5220, T6320
# UltraSPARC-T2+ systems: T5140, T5240
$sockets_used .= " $linearr[$#linearr]";
}
if ($linearr[$#linearr] =~ /MB\/CPU[01]\/CMP[01]\/BR[01]\/CH[01]\/D[01]/ || $linearr[$#linearr] =~ /MB\/MEM[01]\/CMP[01]\/BR[01]\/CH[01]\/D[01]/) {
$sockets_used .= " $linearr[$#linearr]";
}
}
if ($line =~ /CPU Units:/) {
$flag_cpu=1; # Start of CPU section
$flag_mem=0; # End of memory section
$format_cpu=1;
}
if ($line =~ /==== CPU/ || $line =~ /==== Processor Sockets / || $line =~ /==== Virtual CPU/) {
$flag_cpu=1; # Start of CPU section
$flag_mem=0; # End of memory section
$format_cpu=2;
}
if ($line =~ /Memory Units:/ || $line =~ /==== Memory / || $line =~ /==== Physical Memory / || $line =~ /Used Memory:/) {
$flag_cpu=0; # End of CPU section
$flag_mem=1; # Start of memory section
}
if ($line =~ /CPU Units:/ && $line =~ /Memory Units:/) {
$flag_cpu=1; # Start of CPU section
$flag_mem=1; # Start of memory section
}
if (($flag_cpu >= 1) && ($line !~ /^\s*\n$/)) {
if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) {
$newline=$line;
$newline=~s/^ //g if ($line !~ /Run Ecache CPU CPU/);
push(@boards_cpu, "$newline");
} else {
push(@boards_cpu, "$line");
}
$boardfound_cpu=1;
&checkX86;
if (($flag_cpu == 2) && $isX86) {
# Solaris x86 CPU type found in prtdiag
$cputype2=&mychomp($line);
$cputype2=~s/\s\s+.*//;
$cputype2=~s/(^.* Processor \d+) .*/$1/;
$cputype2=~s/ CPU / /;
$cputype2=~s/\s+/ /g;
$cputype2=~s/^\s+//;
$cputype2=~s/\s+$//;
&x86multicorecnt($cputype2);
# rewrite %cpucnt $cputype2
$cfreq=0;
while (($cf,$cnt)=each(%cpucnt)) {
$cf=~/^(.*) (\d+)$/;
if (! defined($2)) {
delete $cpucnt{"$cf"};
} else {
$cfreq=$2;
delete $cpucnt{"$1 $2"};
}
}
$ndcpu++;
if ($cpucntfrom ne "psrinfo") {
$cpucntfrom="prtdiag";
$cpucntflag=1;
$ncpu++ if ($filename);
}
$cputype=$cputype2 if ($cputype2 ne "");
$cputype=$cputype_prtconf if ($cputype eq "AMD" && $cputype_prtconf ne "");
$cputype=$cputype_psrinfo if ($cputype_psrinfo ne "");
$cpucnt{"$cputype $cfreq"}=$ncpu;
}
# CPUs on Sun Fire systems
if ($line =~ /^\/N\d\/SB\d\/P\d\b/) {
$boardslot_cpu=substr($line,0,10);
push(@boardslot_cpus, "$boardslot_cpu");
$boardslot_cpus .= $boardslot_cpu . " ";
} elsif ($line =~ /^\/N\d\/SB\d\d\/P\d\b/) {
$boardslot_cpu=substr($line,0,11);
push(@boardslot_cpus, "$boardslot_cpu");
$boardslot_cpus .= $boardslot_cpu . " ";
} elsif ($line =~ /^\/SB\d\d\/P\d\b/) {
$boardslot_cpu=substr($line,0,8);
push(@boardslot_cpus, "$boardslot_cpu");
$boardslot_cpus .= $boardslot_cpu . " ";
&prtdiag_threadcount(1);
} elsif ($line =~ /^ SB\d\/P\d\b/) {
$boardslot_cpu=substr($line,4,6);
push(@boardslot_cpus, "$boardslot_cpu");
$boardslot_cpus .= $boardslot_cpu . " ";
# prtdiag does not show cpuid or cputype
} elsif ($line =~ / SB\d\/P\d$/) {
$boardslot_cpu=substr($line,length($line)-7,6);
push(@boardslot_cpus, "$boardslot_cpu");
$boardslot_cpus .= $boardslot_cpu . " ";
&prtdiag_threadcount(0);
}
}
if ($flag_cpu && $line =~ /------/) {
# Next lines are the CPUs on each system board
$flag_cpu=2;
}
if ($flag_mem && $line =~ /------/) {
# Next lines are the memory on each system board
$flag_mem=2;
}
if ($filename && $use_psrinfo_data) {
# May have "psrinfo -v" output in regression test file
if ($line =~ /.+ operates at \d+ MHz/) {
$cpufreq=&mychomp($line);
$cpufreq=~s/.+ operates at //;
$cpufreq=~s/ MHz.+//;
$cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm");
$cpucntflag="0"; # reset flag
$psrcpucnt++;
# rewrite %cpucnt $cputype with frequency
while (($cf,$cnt)=each(%cpucnt)) {
$cf=~/^(.*) (\d+)$/;
$tmp=$1;
if (defined($tmp)) {
delete $cpucnt{"$1 $2"} if ($2 == 0);
}
}
if (defined($tmp)) {
$cpucnt{"$tmp $cpufreq"}=$psrcpucnt;
$ncpu=$psrcpucnt;
}
}
# May have "psrinfo -p -v" output in regression test
# file that has more detailed information about the
# CPUs. Assumes all CPUs are same.
$foundpsrinfocpu=1 if ($line =~ /.+ \d+ virtual processor/);
if ($foundpsrinfocpu && (($line =~ /.+Hz$/ && $line !~ /Speed: / && $line !~ / PCI/) || $line =~ /\bAMD .* Processor /) && $line !~ / x86 /) {
$cputype=&mychomp($line);
$cputype=~s/ CPU / /;
$cputype=~s/\s+/ /g;
$cputype=~s/^\s+//;
$cputype=~s/\s+$//;
$cputype=~s/^Version:\s+//;
# rewrite %cpucnt $cputype with cputype
while (($cf,$cnt)=each(%cpucnt)) {
$cf=~/^(.*) (\d+)$/;
$cpufreq=$2;
delete $cpucnt{"$1 $2"};
}
$cpucnt{"$cputype $cpufreq"}=$psrcpucnt;
}
}
}
# Rewrite prtdiag output to include DIMM information on SB1X00, SB2X00,
# Enchilada, Chalupa (Sun Fire V440), Netra T12, Seattle and Boston
# systems
@new_boards_mem="";
$grpcnt=0;
$intcnt=0;
if ($ultra =~ /Sun Blade [12][05]00\b/ || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20" || $ultra eq "Sun Fire V250" || $ultra eq "Netra T12") {
foreach $line (@boards_mem) {
$line=&mychomp($line);
$newline=$line;
if (($line eq "-----------------------------------------------------------") && ($prtdiag_banktable_has_dimms == 0)) {
$newline=$line . "------";
} elsif ($line eq "--------------------------------------------------") {
$newline=$line . "-----------";
} elsif (($line =~ /ControllerID GroupID Size/) && ($prtdiag_banktable_has_dimms == 0)) {
$newline="ID ControllerID GroupID Size DIMMs Interleave Way";
} elsif ($line =~ /ControllerID GroupID Labels Status/) {
$newline=$line . " DIMMs";
} elsif ($line =~ /ControllerID GroupID Labels/) {
$newline=$line . " DIMMs";
} elsif ($line =~ /ControllerID GroupID Size Labels/) {
$newline=$line . " DIMMs";
} elsif ($line =~ /^\d[\d ] \d[\d ] \d /) {
&read_prtdiag_bank_table;
} elsif ($line =~ /^0x\d[\d ]+\d.+ +\d +-$/ || $line =~ / GroupID \d[\d ]$/) {
&read_prtdiag_memory_segment_table;
} elsif ($line =~ /J0100,/) {
$sz=$grpsize{0,0};
if (defined($sz)) {
$sz=~s/ //g;
$newline=$line . " 4x$sz";
}
} elsif ($line =~ /J0101,/) {
$sz=$grpsize{0,1};
if (defined($sz)) {
$sz=~s/ //g;
$newline=$line . " 4x$sz";
}
} elsif ($line =~ /\/J0[1-4]0[0246]\b/) {
$sz=$grpsize{0,0};
if (defined($sz)) {
$sz=~s/ //g;
$newline=$line . " $sz";
}
} elsif ($line =~ /\/J0[1-4]0[1357]\b/) {
$sz=$grpsize{0,1};
if (defined($sz)) {
$sz=~s/ //g;
$newline=$line . " $sz";
}
} elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d,/) {
$tmp=substr($line,0,2);
$tmp=~s/ //g;
$sz=$grpsize{$tmp,substr($line,15,1)};
$sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
if (defined($sz)) {
$sz=~s/ //g;
$newline=$line . " 4x$sz";
}
} elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) {
$tmp=substr($line,0,2);
$tmp=~s/ //g;
$sz=$grpsize{$tmp,substr($line,15,1)};
$sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
if (defined($sz)) {
$sz=~s/ //g;
$newline=$line . " $sz";
}
} elsif ($line =~ / MB\/DIMM\d,/) {
$sz=$grpsize{0,substr($line,15,1)};
$newline=$line . " 2x$sz" if (defined($sz));
} elsif ($line =~ /DIMM\d,DIMM\d/) {
@linearr=split(' ', $line);
if ($linearr[2] =~ /\d+[MG]B/) {
$sz=$linearr[2];
if ($sz =~ /\dGB/) {
$sz=~s/GB//g;
$sz *= 512;
} else {
$sz=~s/MB//g;
$sz /= 2;
}
$sz=&show_memory_label($sz);
}
$newline=$line . " 2x$sz" if (defined($sz));
if ($line =~ /DIMM[13],DIMM[24]/ && $ultra eq "Sun Blade 1500") {
# prototype has sockets DIMM1-DIMM4
@socketstr=("DIMM1".."DIMM4");
}
if ($line =~ /DIMM[1357],DIMM[2468]/ && $ultra eq "Sun Blade 2500") {
# prototype has sockets DIMM1-DIMM8
if ($line =~ /DIMM[13],DIMM[24]/) {
@socketstr=("DIMM1".."DIMM4");
} elsif ($line =~ /DIMM[57],DIMM[68]/) {
push(@socketstr, "DIMM5".."DIMM8");
}
}
}
push(@new_boards_mem, "$newline\n") if ($newline ne "");
}
@boards_mem=@new_boards_mem;
} elsif ($ultra eq "Enchilada" || $ultra eq "Sun Fire V440" || $ultra eq "Netra 440" || $ultra =~ /Sun Ultra [24]5 .*Workstation/ || $ultra eq "Sun Fire V125" || $ultra eq "Seattle" || $ultra eq "Boston" || $banner =~ /Sun Fire E[24]900\b/ || $diagbanner =~ /Sun Fire E[24]900/) {
foreach $line (@boards_mem) {
$line=&mychomp($line);
$newline=$line;
if (($line eq "-----------------------------------------------------------") && ($prtdiag_banktable_has_dimms == 0)) {
$newline=$line . "------";
} elsif ($line eq "--------------------------------------------------") {
$newline=$line . "-----------";
} elsif (($line =~ /ControllerID GroupID Size/) && ($prtdiag_banktable_has_dimms == 0)) {
$newline="ID ControllerID GroupID Size DIMMs Interleave Way";
} elsif ($line =~ /ControllerID GroupID Labels Status/) {
$newline=$line . " DIMMs";
} elsif ($line =~ /ControllerID GroupID Labels/) {
$newline=$line . " DIMMs";
} elsif ($line =~ /^\d[\d ] \d[\d ] \d /) {
&read_prtdiag_bank_table;
} elsif ($line =~ /^0x\d[\d ]+\d.+ +\d +-$/ || $line =~ / GroupID \d[\d ]$/) {
&read_prtdiag_memory_segment_table;
} elsif ($line =~ / MB\/P[01]\/B[01]\/D[01],/ || $line =~ /C[0-3]\/P[01]\/B[01]\/D[01],/) {
$sz=$grpsize{substr($line,0,1),substr($line,15,1)};
$sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
if (defined($sz)) {
$newline=$line . " 2x$sz";
} else {
$newline=$line . " Failing";
$failing_memory=1;
}
} elsif ($line =~ / MB\/P[01]\/B[01]\/D[01]\b/ || $line =~ /C[0-3]\/P[01]\/B[01]\/D[01]\b/) {
$sz=$grpsize{substr($line,0,1),substr($line,15,1)};
$sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
if (defined($sz)) {
$sz=~s/ //g;
$sz=&show_memory_label($sz);
}
$space=" ";
$space="" if ($line =~ / okay/);
if ($line =~ / failed/) {
if (defined($sz)) {
$failed_memory += $sz;
} else {
$failing_memory=1;
}
}
if (defined($sz)) {
# If interleave factor is 16, then print 4x$sz
if (defined($grpinterleave{substr($line,28,1),0})) {
if (($grpinterleave{substr($line,28,1),0} eq "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15") && ($prtdiag_banktable_has_dimms == 0)) {
$newline=$line . "$space 4x$sz";
} else {
$newline=$line . "$space $sz";
}
} else {
$newline=$line . "$space $sz";
}
}
} elsif ($line =~ / MB\/DIMM[0-7]\b/) {
$sz=$grpsize{substr($line,0,1),substr($line,15,1)};
$sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
$newline=$line . " $sz" if (defined($sz));
} elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d,/) {
$tmp=substr($line,0,2);
$tmp=~s/ //g;
$sz=$grpsize{$tmp,substr($line,15,1)};
$sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
if (defined($sz)) {
$sz=~s/ //g;
$newline=$line . " 4x$sz";
}
} elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) {
$tmp=substr($line,0,2);
$tmp=~s/ //g;
$sz=$grpsize{$tmp,substr($line,15,1)};
$sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
if (defined($sz)) {
$sz=~s/ //g;
$newline=$line . " $sz";
}
}
push(@new_boards_mem, "$newline\n") if ($newline ne "");
}
@boards_mem=@new_boards_mem;
}
# Rewrite prtdiag output to exclude redundant labels
@new_boards_mem="";
$flag_group=0;
foreach $line (@boards_mem) {
$line=&mychomp($line);
$newline=$line;
$flag_group++ if ($line =~ /Memory Module Groups:/);
if ($flag_group ge 2) {
$newline="" if ($line =~ /Memory Module Groups:/ || $line =~ "--------------------------------------------------" || $line =~ /ControllerID GroupID/);
}
push(@new_boards_mem, "$newline\n") if ($newline ne "");
}
if (($ultra eq "T5120" || $ultra eq "T5220" || $ultra eq "T6320" || $ultra eq "T5140" || $ultra eq "T5240" || $ultra eq "T5440") && $sockets_used ne "") {
if ($prtpicl_cmd ne "" && $have_prtpicl_data == 0) {
# Warn that prtpicl may take a while to run
&please_wait;
@prtpicl=&run("$prtpicl_cmd -v");
$have_prtpicl_data=1;
}
&check_prtpicl if ($have_prtpicl_data);
if ($picl_foundmemory) {
@new_boards_mem="";
$bank_cnt=scalar(keys %picl_mem_bank);
if (scalar(keys %picl_mem_dimm) == 1 || $bank_cnt > 1) {
$pn_cnt=scalar(keys %picl_mem_pn);
while (($socket,$simmsize)=each(%picl_mem_bank)) {
if ($pn_cnt == $bank_cnt * 2 || $interleave == 8) {
# CH1 was not listed
$simmsize /= 2;
$picl_mem_dimm{"$socket"}=$simmsize;
$socket=~s/CH0/CH1/g;
$picl_mem_dimm{"$socket"}=$simmsize;
$sockets_used .= " $socket" if ($sockets_used !~ /$socket/);
} else {
$picl_mem_dimm{"$socket"}=$simmsize;
}
}
}
while (($socket,$simmsize)=each(%picl_mem_dimm)) {
$pn=$picl_mem_pn{"$socket"};
$sz=&show_memory_label($simmsize);
$newline="socket $socket has a ";
$newline .= $pn . " " if (defined($pn));
$newline .= $sz . " " if (defined($sz));
$newline .= "$memtype";
push(@new_boards_mem, "$newline\n");
push(@simmsizesfound, $simmsize) if (defined($sz));
}
@new_boards_mem=sort @new_boards_mem;
} elsif ($flag_rewrite_prtdiag_mem) {
# Hack: Rewrite prtdiag output better than original
if ($sockets_used =~ /MB\/CMP[01]\/BR[0-3]\/CH[01]\/D1/) {
# All 16 DIMMs are installed
@new_boards_mem="";
if ($sockets_used !~ /MB\/CMP[01]\/BR[0-3]\/CH1\/D[01]/) {
foreach $line (@boards_mem) {
$line=&mychomp($line);
$newline=$line;
if ($line =~ /MB\/CMP[01]\/BR[0-3]\/CH0\/D[01]/) {
$line=~s/\s+$//;
$tmp=$line;
$tmp=~s/^.*(MB\/CMP.*)/$1/;
$tmp=~s/CH0/CH1/g;
$space="";
$space=" " if ($line =~ /^MB\/CMP/);
$newline="$space$line,$tmp";
}
push(@new_boards_mem, "$newline\n") if ($newline ne "");
}
}
$sockets_used="";
for ($cnt=0; $cnt <= $#socketstr; $cnt++) {
$sockets_used .= " $socketstr[$cnt]";
}
$simmsize=$installed_memory / 16;
} else {
# 8-DIMMs or 4-DIMMs are installed.
# Hack: assume 4-DIMM configuration since
# 8-DIMM has prtpicl output.
@new_boards_mem="";
foreach $line (@boards_mem) {
$line=&mychomp($line);
$newline=$line;
if ($line =~ /MB\/CMP[01]\/BR[0-3]\/CH0\/D[01]/) {
$line=~s/\s+$//;
$space="";
$space=" " if ($line =~ /^MB\/CMP/);
$newline="$space$line";
}
push(@new_boards_mem, "$newline\n") if ($newline ne "");
}
$simmsize=$installed_memory / 4;
}
# Round up DIMM value
$simmsize=int(($simmsize + 128) / 1024) * 1024;
push(@simmsizesfound, $simmsize);
} else {
$tmp=0;
foreach $socket (sort split(' ', $sockets_used)) {
$tmp++;
}
if ($tmp) {
$simmsize=$installed_memory / $tmp;
# Round up DIMM value
$simmsize=int(($simmsize + 128) / 1024) * 1024;
push(@simmsizesfound, $simmsize);
}
}
}
@boards_mem=@new_boards_mem;
}
sub prtdiag_threadcount {
$arg=shift;
$diagthreadcnt++;
$tmp=$line;
$tmp=~s/,\s+/,/;
@linearr=split(' ', $tmp);
if ($line =~ /\bUS-/) {
$cputype=$linearr[4];
$cputype=~s/US-/UltraSPARC-/;
$cputype=~s/UltraSPARC-IV/Dual-Core UltraSPARC-IV/;
$cpufreq=$linearr[2];
}
$diagcpucnt{"$cputype $cpufreq"}++;
if ($linearr[$arg] =~ /,/) {
$tmp=$linearr[$arg];
@linearr=split(',', $tmp);
$diagthreadcnt += $#linearr;
}
$cpucntfrom="prtdiag";
}
sub check_prtpicl {
print &runtime . "in check_prtpicl\n" if ($DEBUG);
$flag_mem_seg=0;
$flag_mem_bank=0;
$flag_mem_chan=0;
$flag_mem_mod=0;
$cpumembrd="";
foreach $line (@prtpicl) {
$line=&dos2unix($line);
$line=&mychomp($line);
$line=~s/\s+$//;
if ($line =~ /^\s+:Label\s+CPU[01]/ || $line =~ /^\s+:Label\s+MEM[01]/) {
$cpumembrd=$line;
$cpumembrd=~s/^.*:Label\s+(.*)$/$1/;
$cpumembrd .= "/";
}
if ($line =~ /^\s+:Label\s+CMP[0-3]/) {
$cmp=$line;
$cmp=~s/^.*:Label\s+(.*)$/$1/;
}
if ($line =~ /\s+:name\s/) {
$flag_mem_seg=0;
if ($flag_mem_mod) {
$socket="MB/$cpumembrd$cmp/$mem_branch/$mem_channel/$mem_dimm";
$flag_mem_mod=0; # End of memory module section
$sockets_used .= " $socket" if ($sockets_used !~ /$socket/);
$picl_mem_pn{"$socket"}="$mem_mfg $mem_model";
if ($sockets_used =~ /\/CH1\//) {
$picl_mem_dimm{"$socket"}=$bank_size / 2;
} else {
$picl_mem_dimm{"$socket"}=$bank_size;
}
}
if ($flag_mem_bank && ! $flag_mem_mod) {
if ($bank_nac) {
$socket="$bank_nac" if ($bank_nac ne "");
}
$flag_mem_bank=0; # End of memory bank section
$sockets_used .= " $socket" if ($sockets_used !~ /$socket/);
$picl_mem_bank{"$socket"}=$bank_size;
}
}
if ($line =~ /^\s+memory-segment\s/) {
$flag_mem_seg=1; # Start of memory segment section
}
if ($flag_mem_seg) {
if ($line =~ /^\s+:InterleaveFactor\s/) {
$interleave=$line;
$interleave=~s/^.*:InterleaveFactor\s+(.*)$/$1/;
$interleave=hex($interleave) if ($interleave =~ /^0x\d/);
}
if ($line =~ /^\s+:Size\s/) {
$segment_size=$line;
$segment_size=~s/^.*:Size\s+(.*)$/$1/;
if ($segment_size =~ /^0x\d/) {
$segment_size=~s/^(.*)00000$/$1/;
$segment_size=hex($segment_size);
} else {
$segment_size /= $meg;
}
}
}
if ($line =~ /^\s+memory-bank\s/) {
$flag_mem_bank=1; # Start of memory bank section
}
if ($flag_mem_bank) {
if ($line =~ /^\s+:Label\s/) {
$bank_label=$line;
$bank_label=~s/^.*:Label\s+(.*)$/$1/;
}
if ($line =~ /^\s+:nac\s/) {
$bank_nac=$line;
$bank_nac=~s/^.*:nac\s+(.*)$/$1/;
}
if ($line =~ /^\s+:Size\s/) {
$bank_size=$line;
$bank_size=~s/^.*:Size\s+(.*)$/$1/;
if ($bank_size =~ /^0x\d/) {
$bank_size=~s/^(.*)00000$/$1/;
$bank_size=hex($bank_size);
} else {
$bank_size=$segment_size / $meg;
}
}
}
if ($line =~ /^\s+memory-module\s/ && $flag_mem_bank) {
$flag_mem_mod=1; # Start of memory module section
}
if ($flag_mem_mod) {
if ($line =~ /^\s+:nac\s/) {
$mem_dimm=$line;
$mem_dimm=~s/^.*:nac\s+(.*)$/$1/;
}
}
if ($line =~ /^\s+BR\d\s/) {
$flag_mem_chan=0;
$mem_branch=$line;
$mem_branch=~s/^.*(BR\d).*/$1/;
}
if ($line =~ /^\s+CH\d\s/) {
$flag_mem_chan=1; # Start of memory channel section
$mem_channel=$line;
$mem_channel=~s/^.*(CH\d).*/$1/;
}
if ($flag_mem_chan && $line =~ /^\s+D\d\s/) {
$flag_mem_mod=1; # Start of memory module section
$picl_foundmemory=1;
$mem_dimm=$line;
$mem_dimm=~s/^.*(D\d).*/$1/;
}
if ($flag_mem_mod) {
if ($line =~ /\s+:ModelName\s/) {
$mem_model=$line;
$mem_model=~s/^.*:ModelName\s+(.*)$/$1/;
}
if ($line =~ /\s+:MfgName\s/) {
$mem_mfg=$line;
$mem_mfg=~s/^.*:MfgName\s+(.*)$/$1/;
}
}
}
}
sub multicore_cputype {
$s=shift;
$tmp=shift;
return if (! defined($s));
return if (! defined($tmp));
$s="Hyper-Threaded $s" if ($hyperthread);
$s="Dual-Core $s" if ($tmp == 2 && $s !~ /Dual.Core/i);
$s="Triple-Core $s" if ($tmp == 3 && $s !~ /Triple.Core/i);
$s="Quad-Core $s" if ($tmp == 4 && $s !~ /Quad.Core/i);
$s="Hex-Core $s" if ($tmp == 6 && $s !~ /Hex.Core/i);
$s="Octal-Core $s" if ($tmp == 8 && $s !~ /Octal.Core/i);
$s="Twelve-Core $s" if ($tmp == 12 && $s !~ /Twelve.Core/i);
$s=~s/ Core/-Core/ if ($s =~ /Dual Core/i || $s =~ /Triple Core/i || $s =~ /Quad Core/i || $s =~ /Hex Core/i || $s =~ /Octal Core/i || $s =~ /Twelve Core/i || $s =~ /[0-9] Core/i);
return($s);
}
sub cleanup_cputype {
$_=shift;
return "" if (! defined($_));
s/ CPU//;
s/ [Pp]rocessor//;
s/ +MHz/MHz/;
s/ *$//;
s/ +/ /g;
s/ Core/-Core/ if (/Dual Core/i || /Triple Core/i || /Quad Core/i || /Hex Core/i || /Octal Core/i || /Twelve Core/i || /[0-9] Core/i);
return($_);
}
sub multicore_cpu_cnt {
$arg=shift;
# return if ($isX86);
&check_psrinfo;
print &runtime . "in multicore_cpu_cnt, cputype=$cputype\n" if ($DEBUG);
if ($cputype =~ /UltraSPARC-T1\b/) {
$cputype="UltraSPARC-T1";
# Count 4-Thread (4, 6, or 8 Core) Niagara CPUs as 1 CPU
if ($npcpu && ! $have_ldm_data) {
$ncpu=$npcpu;
} else {
# Assume each CPU has 8 Cores max (32 threads)
$ncpu=int(($threadcnt - 1) / 32) + 1;
}
if (defined($arg)) {
$cnt=$ncpu;
return;
}
$cputype=$threadcnt / 4 / $ncpu . "-Core Quad-Thread $cputype";
$cpucnt{"$cputype $cpufreq"}=$ncpu;
} elsif ($cputype =~ /UltraSPARC-T2\+/) {
$cputype="UltraSPARC-T2+";
# Count 8-Thread (4, 6, or 8 Core) Victoria Falls CPUs as 1 CPU
if ($npcpu && ! $have_ldm_data) {
$ncpu=$npcpu;
} else {
# Assume there are no single-cpu systems with the US-T2+
$ncpu=2;
# Valid configurations:
# T5140,T5240: 2 x 4-Core (64 threads), 2 x 6-Core
# (96 threads), 2 x 8-Core (128 threads)
# T5440: 4 x 4-Core (128 threads), 4 x 8-Core
# (256 threads)
if ($ultra eq "T5140" || $ultra eq "T5240") {
$ncpu=2;
} elsif ($ultra eq "T5440") {
$ncpu=4;
}
}
if (defined($arg)) {
$cnt=$ncpu;
return;
}
$cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype";
$cpucnt{"$cputype $cpufreq"}=$ncpu;
} elsif ($cputype =~ /UltraSPARC-T2\b/) {
$cputype="UltraSPARC-T2";
# Count 8-Thread (4 or 8 Core) Niagara-II CPUs as 1 CPU
if ($npcpu && ! $have_ldm_data) {
$ncpu=$npcpu;
} else {
# Assume each CPU has 8 Cores max (64 threads)
$ncpu=int(($threadcnt - 1) / 64) + 1;
}
if (defined($arg)) {
$cnt=$ncpu;
return;
}
$cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype";
$cpucnt{"$cputype $cpufreq"}=$ncpu;
} elsif ($cputype =~ /SPARC64-VI\b/) {
# Count Dual-Core Dual-Thread Olympus-C SPARC64-VI CPUs as 1 CPU
$ncpu=$threadcnt / 4;
$cputype="Dual-Core Dual-Thread SPARC64-VI";
if (defined($arg)) {
$cnt=$ncpu;
return;
}
$cpucnt{"$cputype $cpufreq"}=$ncpu;
} elsif ($cputype =~ /SPARC64-VII\b/) {
# Count Quad-Core Dual-Thread Jupiter SPARC64-VII CPUs as 1 CPU
$ncpu=$threadcnt / 8;
$cputype="Quad-Core Dual-Thread SPARC64-VII";
if (defined($arg)) {
$cnt=$ncpu;
return;
}
$cpucnt{"$cputype $cpufreq"}=$ncpu;
} elsif ($cputype =~ /SPARC64-VII\+\b/) {
# Count Quad-Core Dual-Thread Jupiter+ SPARC64-VII+ CPUs as 1 CPU
$ncpu=$threadcnt / 8;
$cputype="Quad-Core Dual-Thread SPARC64-VII+";
if (defined($arg)) {
$cnt=$ncpu;
return;
}
$cpucnt{"$cputype $cpufreq"}=$ncpu;
} elsif ($cputype =~ /SPARC64-VIII\b/) {
# Guess on the Venus SPARC64-VIII name ???
# Count 8-Core Dual-Thread Venus SPARC64-VIII CPUs as 1 CPU
$ncpu=$threadcnt / 16;
$cputype="8-Core Dual-Thread SPARC64-VIII";
if (defined($arg)) {
$cnt=$ncpu;
return;
}
$cpucnt{"$cputype $cpufreq"}=$ncpu;
}
}
sub x86multicorecnt {
$_=shift;
return if (! defined($_));
$corecnt=2 if (/\bDual.Core/i || /\bTwo.Core/i);
$corecnt=3 if (/\bTriple.Core/i || /\bThree.Core/i);
$corecnt=4 if (/\bQuad.Core/i || /\bFour.Core/i);
$corecnt=6 if (/\bHex.Core/i || /\bSix.Core/i);
$corecnt=8 if (/\bOctal.Core/i || /\bEight.Core/i);
$corecnt=12 if (/\bTwelve.Core/i);
}
sub checkX86 {
$isX86=1 if ($model eq "i86pc" || $machine eq "i86pc" || $model eq "i86xpv" || $machine eq "i86xpv");
# Use CPU count from prtdiag (ndcpu) and thread count from psrinfo to
# get core count per cpu for i86xpv
$use_psrinfo_data=2 if ($model eq "i86xpv" || $machine eq "i86xpv");
}
sub check_psrinfo {
return if ($psrinfo_checked);
print &runtime . "in check_psrinfo, ndcpu=$ndcpu, npcpu=$npcpu, nvcpu=$nvcpu\n" if ($DEBUG);
$psrinfo_checked=1;
return if ($nvcpu);
return if (! $use_psrinfo_data);
if ($filename) {
$npcpu=0;
$j=0;
$have_npcpu=0;
foreach $line (@psrinfo) {
$line=&dos2unix($line);
# May have "psrinfo -p" output in regression test file
# that has number of physical CPUs.
if ($line =~ /^#psrinfo -p$/ && $psrinfo[$j + 1] =~ /^\d+$/) {
$npcpu=&mychomp($psrinfo[$j + 1]);
$have_npcpu=1;
}
# May have "psrinfo -p -v" output in regression test
# file that has number of virtual CPUs. Assumes all
# CPUs are same.
if ($line =~ /.+ \d+ virtual processor/) {
$nvcpu=&mychomp($line);
$nvcpu=~s/.+ processor has //;
$nvcpu=~s/ virtual processor.+//;
$corecnt=$nvcpu if ($nvcpu >= 2);
$corecnt /= 2 if ($hyperthread);
if ($use_psrinfo_data == 2 && $ndcpu > 1) {
$corecnt /= $ndcpu;
$npcpu=$ndcpu if ($have_npcpu == 0);
} else {
$npcpu++ if ($have_npcpu == 0);
}
$cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm");
$cpucntflag="0"; # reset flag
}
$j++;
}
} elsif ($psrinfo_cmd ne "") {
$ncpu=&mychomp(`$psrinfo_cmd | wc -l`); # physical & virtual CPUs
$ncpu=~s/\s+//;
$npcpu=&mychomp(`$psrinfo_cmd -p 2>/dev/null`); # physical CPUs
if ($npcpu eq "") {
$npcpu=$ncpu;
$nvcpu=1;
} else {
# Find number of virtual CPUs
@tmp=`$psrinfo_cmd -p -v`;
foreach $line (@tmp) {
$line=&dos2unix($line);
if ($line =~ /.+ \d+ virtual processor/) {
$nvcpu=&mychomp($line);
$nvcpu=~s/.+ processor has //;
$nvcpu=~s/ virtual processor.+//;
$corecnt=$nvcpu if ($nvcpu >= 2);
$corecnt /= 2 if ($hyperthread);
if ($use_psrinfo_data == 2 && $ndcpu > 1) {
$corecnt /= $ndcpu;
$npcpu=$ndcpu;
}
}
}
if ($cputype eq "x86") {
if ($tmp[2] =~ /.+Hz/ || $tmp[2] =~ /\bAMD .* Processor /) {
$cputype=&mychomp($tmp[2]);
$cputype=~s/ CPU / /;
$cputype=~s/\s+/ /g;
$cputype=~s/^\s+//;
$cputype=~s/\s+$//;
$cputype_psrinfo=$cputype;
}
}
}
@tmp=`$psrinfo_cmd -v`;
if ($tmp[2] =~ /MHz/) {
$cpufreq=&mychomp($tmp[2]);
$cpufreq=~s/.+ operates at //;
$cpufreq=~s/ MHz.+//;
}
$cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm");
$have_psrinfo_data=1;
}
}
sub get_mfg {
$_=shift;
return "" if (! defined($_));
s/Manufacturer: *//ig;
if (/JEDEC ID:/) {
s/JEDEC ID://g;
s/ //g;
}
s/^\s+//;
s/\s+$//;
s/^0x//;
return "" if (/^$/ || /^\r$/ || /^FFFFFFFFFFFF/i || /Manufacturer\d/i);
# Based on JEDEC JEP106-X
return "AMD" if (/^01/ || /^8001/);
return "AMI" if (/^02/ || /^8002/);
return "Fujitsu" if (/^04/ || /^8004/ || /Fujitsu/i);
return "Elpida" if (/^0500/ || /Elpida/i); # Hack
return "Hitachi" if (/^07/ || /^8007/ || /Hitachi/i);
return "Inmos" if (/^08/ || /^8008/ || /Inmos/i);
return "Intersil" if (/^0B/i || /^800B/i || /Intersil/i);
return "Mostek" if (/^0D/i || /^800D/i || /Mostek/i);
return "Freescale (Motorola)" if (/^0E/i || /^800E/i || /Freescale/i || /Motorola/i);
return "NEC" if (/^10/ || /^8010/);
return "Conexant (Rockwell)" if (/^13/ || /^8013/ || /Conexant/i || /Rockwell/i);
return "NXP (Philips Semi, Signetics)" if (/^15/ || /^8015/ || /Philips Semi/i || /Signetics/i);
return "Synertek" if (/^16/ || /^8016/ || /Synertek/i);
return "Xicor" if (/^19/ || /^8019/ || /Xicor/i);
return "Zilog" if (/^1A/i || /^801A/i || /Zilog/i);
return "Mitsubishi" if (/^1C/i || /^801C/i || /Mitsubishi/i);
return "Micron Technology" if (/^2C/i || /^802C/i || /Micron Technology/i);
return "ProMOS/Mosel Vitelic" if (/^40/ || /^8040/ || /ProMOS/i || /Mosel Vitelic/i);
return "Goldenram" if (/^6A/i || /^806A/i || /Goldenram/i);
return "Nanya Technology" if (/^7F7F7F0B/i || /^830B/i || /Nanya/i); # Hack
return "Fairchild" if (/^83/ || /^8083/ || /Fairchild/i);
return "Numonyx (Intel)" if (/^89/ || /^8089/ || /Numonyx/i || /Intel/i);
return "DATARAM" if (/^91/ || /^8091/);
return "Toshiba" if (/^98/ || /^8098/ || /Toshiba/i);
return "IBM" if (/^A4/i || /^80A4/);
return "Hynix Semiconductor (Hyundai Electronics)" if (/^AD/i || /^80AD/i || /Hynix/i || /Hyundai/i);
return "Infineon (Siemens)" if (/^C1/i || /^80C1/ || /^7F7F7F7F7F51/i || /Infineon/i || /Siemens/i);
return "Samsung" if (/^CE/i || /^80CE/i || /Samsung/i);
return "Winbond Electronics" if (/^DE/i || /^80DE/i || /Winbond/i);
return "LG Semiconductor (Goldstar)" if (/^E0/i || /^80E0/i || /LG Semi/i || /Goldstar/i);
return "Micron CMS" if (/^7F45/i || /Micron CMS/i);
return "Kingston" if (/^7F98/i || /Kingston/i);
return "Ramaxel Technology" if (/^7F7F7F7F43/i || /Ramaxel/i); # Hack
return &mychomp($_);
}
# See if CPUs and memory modules are listed in "ipmitool fru" output
sub check_ipmitool {
print &runtime . "in check_ipmitool\n" if ($DEBUG);
return if ("$ipmitool_cmd" eq "" && $filename eq "");
$cputype2="";
$mem_mfg="";
$mem_model="";
$flag_cpu=0;
$flag_mem=0;
$socket="";
foreach $line (@ipmitool) {
$line=&dos2unix($line);
$line=&mychomp($line);
if ($line =~ /^ *$/) {
# store cpu and memory modules in hash
if ($flag_cpu) {
if ($cputype2 ne "") {
$cputype2=~s/DUAL.CORE/Dual-Core/;
$cputype2=~s/QUAD.CORE/Quad-Core/;
$cputype2=~s/ Core/-Core/;
$cputype2=~s/OPTERON\(TM\) PROCESSOR/Opteron\(tm\) Processor/;
$cputype_ipmi="$cputype2";
$cpucnt_ipmi++;
}
}
if ($flag_mem && $socket ne "") {
$ipmi_mem{"$socket"}=("$mem_mfg$mem_model" ne "") ? "$mem_mfg $mem_model" : "";
}
$flag_cpu=0; # End of CPU section
$flag_mem=0; # End of memory section
$cputype2="";
$mem_mfg="";
$mem_model="";
}
if ($line =~ / cpu\d+\.vpd / || $line =~ / p\d+\.fru /) {
$flag_cpu=1; # Start of CPU section
$socket=$line;
$socket=~s/^.*: +(.*\S)\.[vf][pr][du].*$/$1/;
}
if ($flag_cpu && ($line =~ / Product Name /)) {
$cputype2=$line;
$cputype2=~s/^.*: +(.*\S) *$/$1/;
&x86multicorecnt($cputype2);
}
if ($line =~ / cpu\d+\.mem\d+\.vpd / || $line =~ / p\d+\.d\d+\.fru /) {
$flag_mem=1; # Start of memory module section
$socket=$line;
$socket=~s/^.*: +(.*\S)\.[vf][pr][du].*$/$1/;
}
if ($flag_mem && ($line =~ / Product Manufacturer /)) {
$mem_mfg=$line;
$mem_mfg=~s/^.*: +(.*\S) *$/$1/;
$mem_mfg=&get_mfg($mem_mfg);
}
if ($flag_mem && ($line =~ / Product Name /)) {
$mem_model=$line;
$mem_model=~s/^.*: +(.*\S) *$/$1/;
$mem_model=~s/ ADDRESS\/COMMAND//;
$mem_model=~s/PARITY/Parity/;
}
}
# Is ipmitool CPU count better?
# print &runtime . "cpucnt_ipmi=$cpucnt_ipmi\n" if ($DEBUG);
if ($ncpu != $cpucnt_ipmi && $npcpu == 0 && $cpucnt_ipmi != 0) {
$ncpu=$cpucnt_ipmi;
$npcpu=$cpucnt_ipmi;
$cpucntfrom="ipmitool";
$cpucnt{"$cputype $cpufreq"}=$cpucnt_ipmi;
}
# Did ipmitool find a better cputype?
if (&lc($cputype) ne &lc($cputype_ipmi) && $cputype_ipmi ne "") {
# rewrite %cpucnt $cputype with cputype
while (($cf,$cnt)=each(%cpucnt)) {
$cf=~/^(.*) (\d+)$/;
$cpufreq=$2;
delete $cpucnt{"$1 $2"};
}
$cpucnt{"$cputype_ipmi $cpufreq"}=$cpucnt_ipmi;
}
}
# Check for logical domains
sub check_for_LDOM {
print &runtime . "in check_for_LDOM\n" if ($DEBUG);
# Handle control domain on UltraSPARC-T1 and UltraSPARC-T2 systems
if ($ldm_cmd ne "" && $have_ldm_data == 0) {
@ldm=&run("$ldm_cmd list-devices -a -p");
$have_ldm_data=1;
}
if ($have_ldm_data) {
$threadcnt=0;
foreach $line (@ldm) {
$line=&dos2unix($line);
$line=&mychomp($line);
&check_LDOM;
# Count virtual CPUs
$threadcnt++ if ($line =~ /^\|pid=\d/);
if ($line =~ /^\|pa=\d.*\|size=\d/) {
# Add up total memory found in ldm output
$sz=$line;
$sz=~s/^.*size=(\d*).*/$1/;
$ldm_memory += $sz;
}
}
if ($threadcnt > 0) {
# VCPUs found in ldm output
delete $cpucnt{"$cputype $cpufreq"};
print &runtime . "ldm: ncpu=$ncpu, npcpu=$npcpu\n" if ($DEBUG);
$cpucntfrom="ldm";
&multicore_cpu_cnt;
}
$installed_memory=$ldm_memory / $meg if ($ldm_memory > 0);
}
# Handle guest domains on UltraSPARC-T1 and UltraSPARC-T2 systems
if ($cfgadm_cmd ne "" && $have_cfgadm_data == 0) {
@cfgadm=&run("$cfgadm_cmd -al");
$have_cfgadm_data=1;
}
if ($have_cfgadm_data) {
foreach $line (@cfgadm) {
$line=&dos2unix($line);
if ($line =~ /Configuration administration not supported/) {
# Hack: Assume cfgadm fails on guest domains.
&found_guest_LDOM;
exit 1;
}
}
}
}
sub check_LDOM {
if ($line =~ /Authorization failed/i || $line =~ /Connection refused/i) {
if ($uid eq "0") {
# No LDOMs configured
$ldm_cmd="";
$have_ldm_data=0;
} else {
&found_guest_LDOM("");
print "ERROR: ldm: $line\n";
print " This user does not have permission to run '/opt/SUNWldm/bin/ldm'.\n";
print " Run memconf as a privileged user like root on the control domain.\n";
exit 1;
}
}
}
sub found_guest_LDOM {
# Rewrite cputype and cpucnt hash since I don't
# know how many cores the guest domain host has
if ($cputype =~ /UltraSPARC-T1\b/) {
delete $cpucnt{"$cputype $cpufreq"};
$cputype="UltraSPARC-T1";
$cpucnt{"$cputype $cpufreq"}=1;
} elsif ($cputype =~ /UltraSPARC-T2\+/) {
delete $cpucnt{"$cputype $cpufreq"};
$cputype="UltraSPARC-T2+";
$cpucnt{"$cputype $cpufreq"}=1;
} elsif ($cputype =~ /UltraSPARC-T2\b/) {
delete $cpucnt{"$cputype $cpufreq"};
$cputype="UltraSPARC-T2";
$cpucnt{"$cputype $cpufreq"}=1;
}
&show_header;
$arg=shift;
return if (defined($arg));
print "ERROR: Guest Logical Domain (LDOM) detected.\n";
print " Run memconf on the control domain. It will not work on guest domains.\n";
}
sub check_smbios {
print &runtime . "in check_smbios\n" if ($DEBUG);
$flag_smb_memdevice=0;
foreach $line (@smbios) {
$line=&dos2unix($line);
$line=&mychomp($line);
if ($line =~ /SMB_TYPE_MEMDEVICE/) {
$mem_mfg="";
$socket="";
$pn="";
$simmsize=0;
$memtype="";
$formfactor="";
$flag_smb_memdevice=1;
}
if ($flag_smb_memdevice) {
if ($line =~ /Manufacturer:/) {
$mem_mfg=$line;
$mem_mfg=~s/^ *Manufacturer: *//g;
$mem_mfg=&get_mfg($mem_mfg);
$mem_mfg .= " " if ($mem_mfg ne "");
}
if ($line =~ /Location Tag:/) {
$socket=$line;
$socket=~s/^ *Location Tag: *//g;
}
if ($line =~ /Part Number:/) {
$pn=$line;
$pn=~s/^ *Part Number: *//g;
$pn=~s/\s*$//g;
$pn="" if ($pn =~ /^0xFF/ || $pn =~ /PartNum\d/i);
$pn .= " " if ($pn ne "");
}
if ($line =~ /Size:/) {
$simmsize=$line;
$simmsize=~s/^ *Size: //g;
$simmsize=~s/ bytes//g;
$simmsize=0 if ($simmsize =~ /Not Populated/);
$simmsize /= $meg;
}
if ($line =~ /Memory Type:/) {
$memtype=$line;
$memtype=~s/^ *Memory Type:.*\((.*)\).*/$1/g;
$memtype .= " " if ($formfactor ne "");
$memtype="" if ($memtype =~ /Memory Type:/ || $memtype =~ /^other/);
}
if ($line =~ /Form Factor:/) {
$formfactor=$line;
$formfactor=~s/^ *Form Factor:.*\((.*)\).*/$1/g;
$formfactor="" if ($formfactor =~ /Form Factor:/);
}
if ($line =~ /Bank Locator:/ || $line =~ /^ *ID *SIZE *TYPE/) {
$bank_label=$line;
$bank_label=~s/^ *Bank Locator: *//g;
$bank_label="BANK $bank_label" if ($bank_label =~ /^.$/);
$bank_label="" if ($bank_label eq $socket);
$bank_label=", $bank_label" if ($bank_label ne "");
$flag_smb_memdevice=0;
if ($socket ne "") {
$smbios_mem{"$socket"}=($simmsize) ? "$mem_mfg${simmsize}MB $pn$memtype$formfactor$bank_label" : "";
$sockets_used="";
}
}
}
}
$tmp=scalar(keys %smbios_mem);
if (defined($tmp)) {
if ($tmp > 0) {
&show_header;
if (! &is_virtualmachine) {
for (sort keys %smbios_mem) {
if ($smbios_mem{$_} eq "") {
$sockets_empty .= "," if ($sockets_empty ne "");
$sockets_empty .= " $_";
} else {
print "socket $_: $smbios_mem{$_}\n";
}
}
}
$totmem=$installed_memory;
&print_empty_memory("memory sockets");
&finish;
exit;
}
}
}
sub found_empty_bank {
$empty_banks .= "," if ($empty_banks ne "");
$boardslot_mem=~s/[: ]//g;
$empty_banks .= " Board $boardslot_mem @_";
}
sub print_empty_memory {
return if (&is_virtualmachine);
$s=shift;
print "empty $s:";
print (($sockets_empty ne "") ? "$sockets_empty\n" : " None\n");
}
sub found_nvsimm_bank {
$nvsimm_banks .= ", Board $boardslot_mem @_";
}
sub recommend_prtdiag_patch {
# Sun BugID 4664349
print " This may be corrected by installing ";
if ($osrel eq "5.9") {
print "Sun patch 113221-03 or 118558-06 or later.\n";
} elsif ($osrel eq "5.8") {
print "Sun patch 109873-26 or 111792-11 or later.\n";
} else {
print "a Sun patch on this system.\n";
}
}
sub numerically {
$a <=> $b;
}
sub lc {
$s=shift;
return "" if (! defined($s));
$s=~tr/[A-Z]/[a-z]/;
return $s;
}
sub dos2unix {
# Convert "CR LF" or "CR" to "LF"
$s=shift;
$s=~s/\r\n/\n/g;
$s=~s/\r/\n/g;
return $s;
}
sub convert_freq {
($freqx)=@_;
if ($isX86) {
$freq=int(hex("0x$freqx") / 10000 + 0.5);
} else {
if ($freqx =~ /'/) {
$freqpack=$freqx;
$freqpack=~s/'//g;
@frequnpack=unpack("C*",$freqpack);
$freqx="";
foreach $field (@frequnpack) {
$freqx.=sprintf("%02lx", $field);
}
if ($#frequnpack < 3) {
$freqx.="00";
}
}
$freq=int(hex("0x$freqx") / 1000000 + 0.5);
}
return $freq;
}
sub mychomp {
# Used instead of chop or chomp for compatibility with perl4 and perl5
($a)=@_;
return "" if (! defined($a));
$a=~s,$/$,,g;
return $a;
}
sub run {
print &runtime . "Running @_\n" if ($DEBUG);
`@_ 2>&1`;
}
sub runtime {
return "DEBUG time " . (time - $starttime) . ": ";
}
sub read_prtdiag_bank_table {
# prtdiag Bank Table
$simmsize=substr($line,33,5);
if ($simmsize =~ /\dGB/) {
$simmsize=~s/GB//g;
$simmsize *= 1024;
} else {
$simmsize=~s/MB//g;
}
if (($prtdiag_banktable_has_dimms == 0) || ($line =~ / 0$/)) {
# Interleave Way = 0
$simmsize /= 2;
}
if (($prtdiag_banktable_has_dimms == 1) && ($line =~ / 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15/)) {
# Interleave Way = 16
$simmsize *= 4;
$intcnt=1;
push(@simmsizesfound, "$simmsize");
} elsif ($intcnt > 0) {
# Interleave Way = 16
$intcnt++;
$simmsize *= 4;
}
$a=substr($line,9,2);
$a=~s/ //g;
$b=substr($line,23,1);
$sz=&show_memory_label($simmsize);
$grpsize{$a,$b}=$sz;
$memlength=length($line);
if ($memlength > 49) {
$grpinterleave{$a,$b}=substr($line,49,40) if (substr($line,49,40) ne "");
}
if ($intcnt == 0) {
push(@simmsizesfound, "$simmsize");
$simmsize=&show_memory_label($simmsize) . " ";
if ($prtdiag_banktable_has_dimms == 0) {
$newline=substr($line,0,38) . " 2x" . substr($simmsize,0,5);
$newline .= substr($line,42,20) if ($memlength > 38);
}
}
$intcnt=1 if (($prtdiag_banktable_has_dimms == 1) && ($line =~ / 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15/));
$intcnt=0 if ($intcnt == 16);
}
sub read_prtdiag_memory_segment_table {
# prtdiag Memory Segment Table
$simmsize=($line =~ /\dGB/) ? substr($line,19,1) * 512 : substr($line,19,3) / 2;
$grp=substr($line,-2,2);
$grp=~s/ //g;
if ($grp eq "-") {
$grp=$grpcnt;
$grpcnt++;
}
push(@simmsizesfound, "$simmsize");
$simmsize=&show_memory_label($simmsize);
$grpsize{0,$grp}=$simmsize;
}
$motherboard="";
$realmodel="";
$manufacturer="";
$i=0;
# May not have had permission to run prtconf, so see if prtdiag works
&check_for_prtdiag;
if ($diagbanner) {
if ($filename eq "" || $SUNWexplo) {
$model=$platform;
$model=~s/SUNW,//g;
} else {
$model=$diagbanner;
$model=~s/ /-/g;
# define $model for systems with $diagbanner != $model
$model="Ultra-4" if ($diagbanner =~ /Sun.Enterprise.450\b/);
$model="Sun-Blade-1000" if ($diagbanner =~ /Sun.Blade.1000\b/);
$model="Sun-Fire-280R" if ($diagbanner =~ /Sun.Fire.280R\b/);
$model="Netra t1" if ($diagbanner =~ /Netra.t1\b/);
$model="Netra-T4" if ($diagbanner =~ /Netra.T4\b/);
$model="Sun-Blade-100" if ($diagbanner =~ /Sun.Blade.1[05]0\b/);
$model="Netra-T12" if ($diagbanner =~ /Sun.Fire.V1280\b/);
$model="Serverblade1" if ($diagbanner =~ /Serverblade1\b/);
$model="Ultra-Enterprise" if ($diagbanner =~ /Enterprise.E?[3-6][05]00\b/ || $diagbanner =~ /Enterprise.10000\b/);
}
# Check model and banner here in case we don't have prtconf data
&check_model;
&check_banner;
}
foreach $line (@config) {
$line=&dos2unix($line);
$line=&mychomp($line);
$config_permission=1 if ($line =~ /Node /);
if ($line =~ /Permission denied/i) {
$permission_error="ERROR: $line" if ($diagbanner eq "" || ! $prtdiag_has_mem);
}
&hpux_cstm if ($line =~ /cstm.*selclass qualifier /); # for HP-UX regression test file
if ($line =~ /banner-name:/ && $banner eq "") {
$banner=$line;
$banner=~s/\s+banner-name:\s+//;
$banner=~s/'//g;
$banner=~s/SUNW,//g;
$banner=~s/TWS,//g;
$banner=~s/CYCLE,//g;
$banner=~s/\s+$//;
&check_banner;
}
if ($line =~ /model:.*AXUS/) {
# AXUS clones with their name on OBP
$manufacturer="AXUS";
}
if (($line =~ /SUNW,Ultra-/ || $line =~ /SUNW,SPARC/ || $line =~ /Sun.4/ ||
$line =~ /SUNW,S240/ || $line =~ /SUNW,JavaEngine1/ ||
$line =~ /SUNW,Ultra.*[Ee]ngine/ || $line =~ /SUNW,Ultra.*Netra*/ ||
$line =~ /SUNW,Premier-24/ || $line =~ /SUNW,UltraAX-/ ||
$line =~ /SUNW,Netra/ || $line =~ /\s+name:.*SUNW,Sun-/ ||
$line =~ /SUNW,Grover/ || $line =~ /SUNW,Enchilada/ ||
$line =~ /SUNW,Serverblade1/ || $line =~ /SUNW,Enterprise/ ||
$line =~ /SUNW,A[0-9]/ || $line =~ /SUNW,T[0-9]/ ||
$line =~ /\s+name:.*'i86pc'/ || $line =~ /^i86pc/ || $line =~ /^i86xpv/ ||
$line =~ /model:\s+'SPARC CPU-/ || $line =~ /model:\s+'SPARC CPCI-/ ||
$line =~ /SUNW,Axil-/ || $line =~ /\s+name:.*COMPstation/ ||
$line =~ /\s+name:.*Tadpole/ || $line =~ /\s+name:.*Auspex/ ||
$line =~ /\s+name:.*S-4/ || $line =~ /\s+name:.*FJSV,GP/ ||
$line =~ /\s+name:.*CompuAdd/ || $line =~ /\s+name:.*RDI,/) &&
$line !~ /\s+:Description\s+/ && $line !~ /\s+:*whoami:*\s+/ &&
$line !~ /\s+:*impl-arch-name:*\s+/ && $line !~ /Sun 4x Quad/i) {
$model=$line;
$model=~s/\s+name:\s+//;
$model=~s/\s+model:\s+//;
$model=~s/\s+:binding-name\s+//;
$model=~s/\s+:PlatformName\s+//;
$model=~s/'//g;
$model=~s/\s+$//;
&check_model;
if ($line =~ /CompuAdd/) {
$manufacturer="CompuAdd";
if ($model eq "SS-2") {
$banner=$model if ($banner eq "");
$bannermore="SPARCstation 2";
$modelmore="SPARCstation 2";
}
}
}
$foundname=1 if ($line =~ /\s+name:\s+/);
if (($line =~ /\s+model:\s+'.+,/) && ($foundname == 0)) {
# Ultra 5/10 motherboard is 375-xxxx part number
# SS10/SS20 motherboard is Sxx,501-xxxx part number
if ($line =~ /,375-/ || $line =~ /,500-/ || $line =~ /,501-/) {
$motherboard=$line;
$motherboard=~s/\s+model:\s+//;
$motherboard=~s/'//g;
}
}
if ($line =~ /\sname:\s+'memory'/) {
$j=$i - 2;
if ($config[$j] =~ /\sreg:\s/) {
$gotmemory=&mychomp($config[$j]);
} elsif ($config[$j - 1] =~ /\sreg:\s/) {
$gotmemory=&mychomp($config[$j - 1]);
} elsif ($config[$j + 1] =~ /\sreg:\s/) {
$gotmemory=&mychomp($config[$j + 1]);
}
}
if ($line =~ /\sdevice_type:\s+'memory-bank'/) {
$j=$i - 3;
if ($config[$j] =~ /\sreg:\s/ && $config[$j] !~ /.00000000$/) {
$config[$j]=~s/\s+reg:\s+//;
$gotmemory=($gotmemory) ? "$gotmemory.$config[$j]" : $config[$j];
$gotmemory=&mychomp($gotmemory);
}
}
# The following is not used yet
#if ($line =~ /\sdevice_type:\s+'memory-module'/) {
# if ($config[$i - 2] =~ /\sreg:\s/) {
# $config[$i - 3]=~s/\s+socket-name:\s+//;
# if ($gotmodule) {
# $gotmodule .= ".$config[$i - 3]";
# } else {
# $gotmodule=$config[$i - 3];
# }
# $gotmodule=&mychomp($gotmodule);
# $config[$i - 2]=~s/\s+reg:\s+//;
# @module=split(/\./, $config[$i - 2]);
# $gotmodule .= ".$module[3]";
# $gotmodule=&mychomp($gotmodule);
# $config[$i + 1]=~s/\s+name:\s+//;
# $config[$i + 1] =~ y/[a-z]/[A-Z]/;
# $gotmodule .= ".$config[$i + 1]";
# $gotmodule=&mychomp($gotmodule);
# $gotmodule=~s/'//g;
# }
#}
if ($line =~ /\ssimm-use:\s+/) {
# DIMM usage on Fujitsu GP7000
$gotmodule=&mychomp($config[$i]);
$gotmodule=~s/\s+simm-use:\s+//;
$slotname0="SLOT0" if ($banner =~ /GP7000\b/);
}
if ($line =~ /\scomponent-name:\s+'.*CPU.*'/) {
# CPUs on Fujitsu GP7000F and PrimePower systems
$slotname=$line;
$slotname=~s/\s+component-name:\s+//;
$slotname=~s/'//g;
$gotcpunames=($gotcpunames) ? "$gotcpunames $slotname" : $slotname;
$boardname=$slotname;
$boardname=~s/-.*//g;
if ($boardname ne $slotname) {
if ($gotcpuboards) {
$gotcpuboards .= " $boardname" if ($gotcpuboards !~ /\b$boardname\b/);
} else {
$gotcpuboards=$boardname;
}
}
}
if ($line =~ /\sdevice_type:\s+'memory-module'/) {
# DIMM usage on Fujitsu GP7000F and PrimePower systems
$slotname="";
if ($config[$i - 3] =~ /\scomponent-name:\s/) {
$slotname=$config[$i - 3];
}
if ($config[$i - 4] =~ /\scomponent-name:\s/) {
$slotname=$config[$i - 4];
}
if ($slotname ne "") {
$slotname=~s/\s+component-name:\s+//;
$slotname=~s/'//g;
$slotname=&mychomp($slotname);
$gotmodulenames=($gotmodulenames) ? "$gotmodulenames.$slotname" : $slotname;
$slotname0=$slotname if (! $slotname0);
$config[$i - 1]=~s/\s+reg:\s+//;
@module=split(/\./, $config[$i - 1]);
$gotmodulenames .= ".$module[1]";
$gotmodulenames=&mychomp($gotmodulenames);
}
}
if ($line =~ /\sname:\s+'cgfourteen'/) {
# Determine size of VSIMM
# Currently assumes only one VSIMM is installed
if ($config[$i - 2] =~ /\sreg:\s/) {
$sx_line=&mychomp($config[$i - 2]);
} elsif ($config[$i - 3] =~ /\sreg:\s/) {
$sx_line=&mychomp($config[$i - 3]);
}
@sxline=split(/\./, $sx_line);
$sxmem=hex("0x$sxline[5]") / $meg;
}
if ($line =~ /501-2197/) {
# 1MB Prestoserve NVSIMMs (SS1000/SC2000)
if ($config[$i + 1] =~ /\sreg:\s/) {
$nv_line=&mychomp($config[$i + 1]);
} elsif ($config[$i + 2] =~ /\sreg:\s/) {
$nv_line=&mychomp($config[$i + 2]);
}
@nvline=split(/\./, $nv_line);
$nvmem += hex("0x$nvline[2]") / $meg;
}
if ($line =~ /501-2001/) {
# 2MB Prestoserve NVSIMMs (SS10/SS20)
if ($config[$i + 1] =~ /\sreg:\s/) {
$nv_line=&mychomp($config[$i + 1]);
} elsif ($config[$i + 2] =~ /\sreg:\s/) {
$nv_line=&mychomp($config[$i + 2]);
}
@nvline=split(/\./, $nv_line);
$nvmem += hex("0x$nvline[2]") / $meg;
$nvmem1=1 if ($nvline[1] eq "10000000");
$nvmem2=1 if ($nvline[1] eq "14000000" || $nvline[1] eq "1c000000");
}
if (($line =~ /Memory size:\s/) && ($installed_memory == 0)) {
$installed_memory=$line;
$installed_memory=~s/^.*size: *(\d*[GM]*[Bb]*).*/$1/;
if ($installed_memory =~ /GB/) {
$installed_memory=~s/GB//g;
$installed_memory *= 1024;
} else {
$installed_memory=~s/MB//ig;
}
# prtconf sometimes reports incorrect total memory
# 32MB is minimum for sun4u machines
if (($installed_memory < 32) && ($machine eq "sun4u")) {
$prtconf_warn="Incorrect total installed memory (${installed_memory}MB) was reported by prtconf.";
$installed_memory=0;
}
# Round up some odd-number total memory values
$installed_memory++ if (sprintf("%3d", ($installed_memory + 1) / 2 ) * 2 != $installed_memory && $installed_memory >= 1023);
$BSD=0; # prtconf and prtdiag only have this output
$config_cmd="/usr/sbin/prtconf -vp" if ($config_cmd !~ /prtconf/);
$config_command="prtconf";
}
if (($sysfreq == 0) && ($freq > 0)) {
$sysfreq=$freq;
$freq=0;
}
if ($devtype eq "cpu" || $line =~ /compatible: 'FJSV,SPARC64-/) {
if ($cputype =~ /SPARC64-/) {
$cpufreq=$freq if ($freq > $cpufreq);
} else {
$cpufreq=$freq;
}
$cpuline=$line;
$j=$i - 3;
while ($cpuline !~ /^$/ && $cpuline !~ /^\r$/) {
if ($cpuline =~ /clock-frequency:/) {
@freq_line=split(' ', $cpuline);
$cpufreq=&convert_freq($freq_line[1]);
$sysfreq=$freq if (($sysfreq == 0) && ($freq > 0));
} elsif (($cpuline =~ /\sname:\s/ || $cpuline =~ /\scompatible:\s/) && $cpuline !~ /Sun 4/ && $cpuline !~ /SPARCstation/ && $cpuline !~ /CompuAdd/ && $cpuline !~ /'cpu/ && $cpuline !~ /'core'/) {
$cputype=&mychomp($cpuline);
$cputype=~s/\s+name:\s+//;
$cputype=~s/\s+compatible:\s+//;
$cputype=~s/'//g;
$cputype=~s/SUNW,//g;
$cputype=~s/FJSV,//g;
$cputype=~s/ .*//g;
} elsif ($cpuline =~ /\sname:\s/ && $model eq "") {
$model=&mychomp($cpuline);
$model=~s/\s+name:\s+//;
$model=~s/'//g;
$model=~s/SUNW,//g;
$model=~s/FJSV,//g;
}
$j++;
$cpuline=($config[$j]) ? $config[$j] : "";
}
$freq=0;
$cpufreq=$sysfreq if ($sysfreq >= $cpufreq);
print &runtime . "Checking cputype=$cputype, ncpu=$ncpu\n" if ($DEBUG);
if ($cputype eq "") {
$cputype=$machine;
$cputype="SPARC" if ($cputype =~ /^sun4/ || $model =~ /Sun 4\//);
@bannerarr=split(/\s/, $banner);
foreach $field (@bannerarr) {
if ($field =~ /SPARC/ && $field !~ /SPARCstation/) {
$cputype=$field;
} elsif ($field =~ /390Z5/) {
$field="TI,TMS$field" if ($field =~ /^390Z5/);
$cputype=($cpufreq > 70) ? "SuperSPARC-II $field" : "SuperSPARC $field";
} elsif ($field =~ /RT62[56]/) {
$cputype="hyperSPARC $field";
$machine="sun4m";
}
}
$cputype=~s/[()]//g;
} elsif ($cputype =~ /MB86907/) {
$cputype="TurboSPARC-II $cputype";
} elsif ($cputype =~ /MB86904/ || $cputype =~ /390S10/) {
$cputype=($cpufreq > 70) ? "microSPARC-II $cputype" : "microSPARC $cputype";
} elsif ($cputype =~ /,RT62[56]/) {
$cputype="hyperSPARC $cputype";
$machine="sun4m";
} elsif ($cputype =~ /UltraSPARC-IV/) {
# Count Dual-Core US-IV & US-IV+ as 1 CPU
$cputype="Dual-Core $cputype";
$machine="sun4u";
$threadcnt++;
$threadcnt=0 if ($threadcnt == 2);
# CPU count is better from prtdiag than psrinfo for
# US-IV & US-IV+ Dual-Core processors.
$use_psrinfo_data=0;
} elsif ($cputype =~ /UltraSPARC-T1\b/) {
# Count 4-Thread (4, 6, or 8 Core) Niagara CPUs as 1 CPU
$machine="sun4v";
$threadcnt++;
# Number of cores & CPUs counted outside this loop below
} elsif ($cputype =~ /UltraSPARC-T2\+/) {
# Count 8-Thread (4, 6, or 8 Core) Victoria Falls CPUs as 1 CPU
$machine="sun4v";
$threadcnt++;
# Number of cores & CPUs counted outside this loop below
} elsif ($cputype =~ /UltraSPARC-T2\b/) {
# Count 8-Thread (4 or 8 Core) Niagara-II CPUs as 1 CPU
$machine="sun4v";
$threadcnt++;
# Number of cores & CPUs counted outside this loop below
} elsif ($cputype =~ /SPARC64-VI\b/ && $devtype eq "cpu") {
# Count Dual-Core Dual-Thread as 1 CPU
$machine="sun4u";
$threadcnt++;
# Number of cores & CPUs counted outside this loop below
} elsif ($cputype =~ /SPARC64-VII\b/ && $devtype eq "cpu") {
# Count Quad-Core Dual-Thread as 1 CPU
$machine="sun4u";
$threadcnt++;
# Number of cores & CPUs counted outside this loop below
} elsif ($cputype =~ /SPARC64-VII\+\b/ && $devtype eq "cpu") {
# Count Quad-Core Dual-Thread as 1 CPU
$machine="sun4u";
$threadcnt++;
# Number of cores & CPUs counted outside this loop below
} elsif ($cputype eq "SPARC64-VIII" && $devtype eq "cpu") {
# Guess on the Venus SPARC64-VIII name ???
# Count 8-Core Dual-Thread as 1 CPU
$machine="sun4u";
$threadcnt++;
# Number of cores & CPUs counted outside this loop below
}
if ($threadcnt == 0 && $devtype eq "cpu") {
$ncpu++;
$cpucnt{"$cputype $cpufreq"}++;
$cpucntfrom=$config_command;
}
$devtype="";
}
if ($line =~ /device_type:/) {
@dev_line=split(/\'/, $line);
$devtype=$dev_line[1];
}
if ($line =~ /clock-frequency:/) {
@freq_line=split(' ', $line);
$freq=&convert_freq($freq_line[1]);
}
if ($line =~ /\sversion:\s+'OBP/ && $romver eq "") {
$romver=$line;
$romver=~s/\s+version:\s+//;
$romver=~s/'//g;
@romverarr=split(/\s/, $romver);
$romvernum=$romverarr[1];
}
if ($line =~ /compatible:\s+'sun4.'/ && $osrel eq "") {
@compatible_line=split(/\'/, $line);
$machine=$compatible_line[1];
}
if ($line =~ /value='.*AMD Opteron/ && $cputype eq "x86") {
$cputype_prtconf=$line;
$cputype_prtconf=~s/.*='//;
$cputype_prtconf=~s/'//g;
}
$i++;
}
&multicore_cpu_cnt;
if ($osrel eq "") {
if ($BSD) {
$osrel="4.X";
$config_cmd="/usr/etc/devinfo -pv";
$config_command="devinfo";
$cpucntfrom="devinfo";
} else {
$osrel="5.X";
$solaris="2.X";
$config_cmd="/usr/sbin/prtconf -vp";
$config_command="prtconf";
}
}
#$sysfreq=$freq if ($sysfreq == 0 && $freq > 0);
#$cpufreq=$sysfreq if ($sysfreq > $cpufreq && $ncpu > 0);
@romverarr=split(/\./, $romvernum) if ($romver);
$romvermajor=($romverarr[0]) ? $romverarr[0] : 2;
$romverminor=($romverarr[1]) ? $romverarr[1] : 0;
$romverminor=0 if ($romverminor eq "" || $romverminor eq "X");
if ($banner =~ /^ \(/) {
# banner-name does not include the eeprom banner name. This happens
# sometimes when OBP 3.23 is installed on Ultra-60/E220R and
# Ultra-80/E420R systems.
$bannermore="Ultra 60 or Enterprise 220R" if ($model eq "Ultra-60");
$bannermore="Ultra 80, Enterprise 420R or Netra t 1400/1405" if ($model eq "Ultra-80");
}
#
# SPARCengine systems
#
$ultra="AX" if ($motherboard =~ /501-3043/);
$ultra="AX-300" if ($motherboard =~ /501-5037/);
$ultra="AXi" if ($motherboard =~ /501-4559/);
$ultra="AXmp" if ($banner =~ /UltraAX-MP/ || $model =~ /UltraAX-MP/ || $motherboard =~ /501-5296/ || $motherboard =~ /501-5487/ || $motherboard =~ /501-5670/);
$ultra="AXmp+" if ($banner =~ /UltraAX-MP\+/ || $model =~ /UltraAX-MP\+/ || $motherboard =~ /501-4324/);
$ultra="AXe" if ($banner =~ /UltraAXe\b/ || $model =~ /UltraAX-e\b/ || $motherboard =~ /375-0088/);
$ultra="AX-e2" if ($banner =~ /Netra AX1105-500\b/ || $model =~ /UltraAX-e2\b/ || $motherboard =~ /375-0128/);
$ultra="Netra X1" if ($banner =~ /Netra X1\b/ || $motherboard =~ /375-3015/);
$ultra="Netra T1 200" if ($banner =~ /Netra T1 200\b/ || $motherboard =~ /375-0132/);
$ultra="Sun Fire V100" if ($banner =~ /Sun Fire V100\b/);
# Sun Fire V120/Netra 120 can use motherboard 375-0132 like Netra T1 200 above
$ultra="Sun Fire V120" if ($banner =~ /Sun Fire V120\b/);
$ultra="Netra 120" if ($banner =~ /Netra 120\b/);
if ($ultra =~ /AX/) {
if ($banner !~ /SPARCengine.*Ultra/) {
$tmp="(SPARCengine Ultra $ultra)";
$bannermore=($bannermore) ? "$tmp $bannermore" : $tmp;
}
}
if ($model =~ /Ultra-5_10\b/) {
if ($banner =~ /\bVoyagerIIi\b/) {
# Tadpole Voyager IIi has 8 DIMM slots, but prtconf reports
# it as an Ultra 5/10
$model="VoyagerIIi";
$ultra="VoyagerIIi";
}
}
$ultra="Sun Blade 150" if ($banner =~ /Sun Blade 150\b/ || $diagbanner =~ /Sun Blade 150\b/);
$ultra="UP-20" if ($banner =~ /\bUP-20\b/); # untested ???
$ultra="UP-520IIi" if ($motherboard =~ /501-4559/ && $banner =~ /\b520IIi\b/);
$need_obp2=0;
if ($model eq "Sun 4/20" || $model eq "Sun 4/25" || $model eq "Sun 4/40" || $model eq "Sun 4/50" || $model eq "Sun 4/60" || $model eq "Sun 4/65" || $model eq "Sun 4/75" || $model eq "SS-2") {
$machine="sun4c";
$need_obp2=1 if ($model eq "Sun 4/40" || $model eq "Sun 4/60" || $model eq "Sun 4/65");
}
&check_prtdiag if ($isX86);
if ($isX86) {
# Round up Solaris x86 memory (may have 128MB or more reserved)
$installed_memory=&roundup_memory($installed_memory);
}
if ($gotmemory eq "" && $ultra eq 0 && $machine ne "sun4d" && $boardfound_mem eq 0) {
&check_prtdiag;
&show_header;
if ($installed_memory) {
print "total memory = ";
&show_memory($installed_memory);
}
print "$permission_error\n" if ($permission_error);
print "$prtconf_warn\n" if ($prtconf_warn ne "");
if ($prtdiag_failed == 2) {
# non-global zone (container)
print "WARNING: More details can be reported if memconf is run in the global zone.\n";
} else {
print "ERROR: no 'memory' line in \"$config_cmd\" output.\n" if ($model ne "i86pc");
if (! $config_permission && $machine =~ /sun4/ && $prtconf_warn eq "") {
print " This user ";
print (($permission_error) ? "does" : "may");
print " not have permission to run $config_command.\n";
print " Try running memconf as a privileged user like root.\n" if ($uid ne "0");
} elsif ($need_obp2) {
print " Upgrading from Open Boot PROM V1.X to V2.X will ";
print "allow memconf to\n detect the memory installed.\n";
} elsif ($prtconf_warn =~ /openprom/) {
print " Please correct the problem with the openprom device.\n" if ($model ne "i86pc");
} else {
print " This is an unsupported system by memconf.\n" if ($model ne "i86pc");
}
}
&show_supported if ($machine !~ /sun4/);
$exitstatus=1;
&mailmaintainer if ($verbose == 3);
exit $exitstatus;
}
$gotmemory=~s/\s+reg:\s+//;
$gotmemory=~s/'//g;
@slots=split(/\./, $gotmemory);
$slot=1;
if ($manufacturer ne "" && $manufacturer !~ /^Sun\b/ && $ultra !~ /SPARC Enterprise M[34589]000 Server/) {
$bannermore=($bannermore) ? "$bannermore clone" : "clone" if ($manufacturer ne "Force Computers");
$modelmore=($modelmore) ? "$modelmore clone" : "clone";
$clone=1;
}
# DIMMs are installed in pairs on Ultra 1, 5 and 10; quads on
# Ultra 2, 60, 80, 220R, 420R, 450; 8's in Ultra Enterprise
#
# On 64-bit systems, prtconf format is AAAAAAAA.AAAAAAAA.SSSSSSSS.SSSSSSSS
# and on 32-bit systems, prtconf format is AAAAAAAA.AAAAAAAA.SSSSSSSS
# where A is for Address, S is for Size.
# Minimum module size is 1MB (0x00100000), so strip off last 5 hex digits of LSB
# and prepend last 5 digits of MSB, which allows recognizing up to 4500TB!
#
if ($ultra) {
$val0=3; # simmsize is in 3rd and 4th fields
$valaddr=2; # address is 2 fields before simmsize
$valinc=4; # fields per simm
$memtype="DIMM";
} else {
$val0=2; # simmsize is in 3rd field
$valaddr=1; # address is 1 field before simmsize
$valinc=3; # fields per simm
}
#
# Define memory layout for specific systems
#
if ($model eq "Sun 4/20") {
# SLC accepts 4MB SIMMs on motherboard
# 501-1676 (4MB 100ns), 501-1698 (4MB 80ns)
# 33-bit 72-pin Fast Page Mode (36-bit work also)
# Does not support Open Boot PROM V2.X, so devinfo/prtconf output will
# not have memory lines.
$devname="OffCampus";
$untested=1;
$simmrangex="00000010";
$simmbanks=4;
$simmsperbank=1;
@simmsizes=(4);
@socketstr=("U0502","U0501","U0602","U0601");
}
if ($model eq "Sun 4/25") {
# ELC accepts 4MB or 16MB SIMMs on motherboard
# 501-1698 or 501-1812 (4MB 80ns), 501-1822 (16MB 80ns)
# 33-bit 72-pin Fast Page Mode (36-bit work also)
$devname="NodeWarrior";
$untested=0;
$simmrangex="00000010";
$simmbanks=4;
$simmsperbank=1;
@simmsizes=(4,16);
@socketstr=("U0407".."U0410");
@bankstr=("MEM1".."MEM4");
}
if ($model eq "Sun 4/40") {
# IPC accepts 1MB or 4MB SIMMs on motherboard
# 501-1697 (1MB 80ns), 501-1625 (4MB 100ns), 501-1739 (4MB 80ns)
# Does not show memory with Open Boot PROM V1.X, but does with OBP V2.X
$devname="Phoenix";
$untested=0;
$simmrangex="00000010";
$simmbanks=3;
$simmsperbank=4;
@simmsizes=(1,4);
@socketstr=("U0588","U0587","U0586","U0585","U0584","U0591","U0590","U0589","U0678","U0676","U0683","U0677");
@bankstr=(0,0,0,0,1,1,1,1,2,2,2,2);
@bytestr=(0..3,0..3,0..3);
}
if ($model eq "Sun 4/50") {
# IPX accepts 4MB or 16MB SIMMs on motherboard
# 501-1812 (4MB 80ns), 501-1915 or 501-1822 (16MB 80ns)
# 33-bit 72-pin Fast Page Mode (36-bit work also)
$devname="Hobbes";
$untested=0;
$simmrangex="00000010";
$simmbanks=4;
$simmsperbank=1;
@simmsizes=(4,16);
@socketstr=("U0310","U0309","U0308","U0307");
@bankstr=(0..3);
}
if ($model eq "Sun 4/60" || $model eq "Sun 4/65") {
# SS1 and SS1+ accepts 1MB or 4MB SIMMs on motherboard
# 501-1408 (1MB 100ns), 501-1697 (SS1+ only) (1MB 80ns),
# 501-1625 (4MB 100ns), 501-1739 (4MB 80ns)
# Does not show memory with Open Boot PROM V1.X, but does with OBP V2.X
if ($model eq "Sun 4/60") {
$devname="Campus";
$untested=0;
} else {
$devname="CampusB, Campus+";
$untested=1;
}
$simmrangex="00000010";
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(1,4);
@socketstr=("U0588","U0587","U0586","U0585","U0584","U0591","U0590","U0589","U0678","U0676","U0683","U0677","U0682","U0681","U0680","U0679");
@bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
@bytestr=(0..3,0..3,0..3,0..3);
}
if ($model eq "Sun 4/75" || $model eq "SS-2") {
# SS2 accepts 4MB SIMMs on motherboard and 32MB or 64MB SBus expansion
# card (501-1823 Primary and 501-1824 Secondary)
# 501-1739 (4MB 80ns)
$devname="Calvin";
$untested=0;
$simmrangex="00000010";
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(4);
@socketstr=("U0311","U0309","U0307","U0322","U0312","U0310","U0308","U0321","U0313","U0314","U0315","U0320","U0319","U0318","U0317","U0316");
@bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
@bytestr=(0..3,0..3,0..3,0..3);
}
if ($model =~ /SPARCclassic/ || $model =~ /SPARCstation-LX/) {
# Classic-X (4/10) accepts 1MB, 2MB, 4MB and 16MB SIMMs on motherboard
# Classic (4/15) and LX (4/30) accepts 4MB and 16MB SIMMs on motherboard
# Can accept 32MB SIMMs in bank 1, allowing 128MB total (2x32, 4x16)
# Possibly accepts 8MB SIMMs in bank 1
# 501-2289 (1MB), 501-2433 (2MB) on Classic-X only
# 501-1991 (4MB), 501-2059 (16MB)
# 36-bit 72-pin 60ns Fast Page Mode
$devname="Sunergy";
if ($model =~ /SPARCclassic-X/) {
$untested=1;
@simmsizes=(1,2,4,8,16,32);
} else {
$untested=0;
@simmsizes=(4,8,16,32);
}
$simmrangex="00000020";
$simmbanks=3;
$simmsperbank=2;
@socketstr=("U0304","U0303","U0301","U0302","U0402","U0401");
@bankstr=(1,1,2,2,3,3);
}
if ($model eq "S240") {
# Voyager has 16MB on motherboard, plus accepts one or two 16MB or 32MB
# Memory cards (501-2327 32MB, 501-2366 16MB)
# Motherboard, address 0x00000000-0x007fffff, 0x01000000-0x017fffff
# Lower slot=Mem 1, address 0x02000000-0x07ffffff
# Upper slot=Mem 2, address 0x0a000000-0x0fffffff
$devname="Gypsy";
$untested=0;
$memtype="memory card";
$sockettype="slot";
$simmrangex="00000020";
$simmbanks=8; # Count the skipped address range
$simmsperbank=1;
@simmsizes=(16,32);
@socketstr=("motherboard","Mem 1","Mem 1","Mem 1","?","Mem 2","Mem 2","Mem 2");
@orderstr=("","lower slot","lower slot","lower slot","?","upper slot","upper slot","upper slot");
}
if ($model eq "JavaEngine1") {
# Accepts 8MB, 16MB and 32MB EDO DIMMs
$devname="Bali";
$untested=0;
$memtype="DIMM";
$simmrangex="00000020";
$simmbanks=2;
$simmsperbank=1;
@simmsizes=(8,16,32);
@socketstr=("J0501","J0502");
@bankstr=(0,1);
}
if ($model eq "SPARCstation-4") {
# Accepts 8MB and 32MB SIMMs on motherboard
# 501-2470 (8MB), 501-2471 (32MB)
# 168-pin 60ns Fast Page Mode
$devname="Perigee";
$untested=0;
$simmrangex="00000020";
$simmbanks=5;
$simmsperbank=1;
@simmsizes=(8,32);
@socketstr=("J0301".."J0305");
@bankstr=(0..4);
}
if ($model eq "SPARCstation-5" || $model eq "micro COMPstation 5" || $model =~ /Axil-255/ || $banner =~ /TWINstation 5G\b/) {
# Accepts 8MB and 32MB SIMMs on motherboard
# 501-2470 (8MB), 501-2471 (32MB)
# 168-pin 60ns Fast Page Mode
$devname="Aurora" if ($model eq "SPARCstation-5");
$untested=0;
$simmrangex="00000020";
$simmbanks=8;
$simmsperbank=1;
@simmsizes=(8,32);
@socketstr=("J0300".."J0303","J0400".."J0403");
@bankstr=(0..7);
if ($banner =~ /TWINstation 5G\b/) {
$simmbanks=6;
@socketstr=(0..5);
}
if ($model ne "SPARCstation-5") {
$bannermore="SPARCstation 5 clone";
$modelmore="SPARCstation 5 clone";
}
}
if ($model =~ /SPARCstation-10/ || $model eq "Premier-24" || $motherboard eq "SUNW,S10,501-2365") {
# Accepts 16MB and 64MB SIMMs on motherboard
# 501-1785 or 501-2273 (16MB 80ns), 501-2479 (16MB 60ns),
# 501-2622 (32MB 60ns), 501-1930 (64MB 80ns), 501-2480 (64MB 60ns)
# 200-pin 60ns or 80ns Fast Page Mode ECC
# 32MB SIMMs not supported according to Sun, but appears to work fine
# depending on the OBP revision. OBP 2.12 and older detects the 32MB
# SIMM as 16MB, OBP 2.19 and later properly detects the 32MB SIMM.
$devname="Campus2" if ($model =~ /SPARCstation-10/);
$devname="Campus2+" if ($model =~ /Premier-24/);
$untested=0;
$simmrangex="00000040";
$simmbanks=8;
$simmsperbank=1;
$romvernum="2.X" if ($romvernum eq "");
$romverminor=0 if ($romverminor eq "" || $romverminor eq "X");
@simmsizes=(($romvermajor eq 2) && ($romverminor >= 19)) ? (16,32,64) : (16,64);
@socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305");
@orderstr=("1st","3rd","4th","2nd","8th","6th","5th","7th");
@bankstr=(0..7);
}
if ($model =~ /SPARCstation-20/ || $model =~ /COMPstation-20S/ || $banner =~ /TWINstation 20G\b/) {
# Accepts 16MB, 32MB and 64MB SIMMs on motherboard
# 501-2479 (16MB), 501-2622 (32MB), 501-2480 (64MB)
# 200-pin 60ns Fast Page Mode ECC
$devname="Kodiak" if ($model eq "SPARCstation-20");
$untested=0;
$simmrangex="00000040";
$simmbanks=8;
$simmsperbank=1;
@simmsizes=(16,32,64);
@socketstr=("J0201","J0303","J0202","J0301","J0305","J0203","J0302","J0304");
@orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th");
@bankstr=(0..7);
if ($model !~ /SPARCstation-20/) {
$bannermore="SPARCstation 20 clone";
$modelmore="SPARCstation 20 clone";
}
if ($model eq "SPARCstation-20I") {
$bannermore="(SPARCstation-20I) clone";
$modelmore="clone";
}
if ($banner =~ /TWINstation 20G\b/) {
# @socketstr=("J0201","J0303","J0202","J0301","J0305","J0203","J0302","J0304");
# @orderstr=("1st","6th","2nd","4th","8th","3rd","5th","7th");
@socketstr=(0..7);
@orderstr=("");
}
}
if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/) {
# Accepts 4MB or 16MB SIMMs on motherboard
# Accepts 1MB, 4MB or 16MB SIMMs on VME expansion cards
# A memory bank is 16 SIMMs of the same size and speed
# Minimum memory configuration is 16 SIMMs in Bank 0 on the motherboard
# Motherboard Bank 1 must be populated before adding expansion cards
# Up to two VME memory expansion cards can be added
# Use 4MB SIMM 501-1739-01 or 501-2460-01
# Use 16MB SIMM 501-2060-01
$devname="Galaxy";
$untested=0;
$simmrangex="00000100";
$simmbanks=2; # 2 banks on CPU board, 4 banks on each expansion cards
$simmsperbank=16;
@simmsizes=(4,16);
# Sockets, banks and bytes on motherboard
@socketstr=("U1107","U1307","U1105","U1305","U1103","U1303","U1101","U1301","U1207","U1407","U1205","U1405","U1203","U1403","U1201","U1401","U1108","U1308","U1106","U1306","U1104","U1304","U1102","U1302","U1208","U1408","U1206","U1406","U1204","U1404","U1202","U1402");
@bankstr=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
@banksstr=("Motherboard bank 0","Motherboard bank 1");
@bytestr=("0L0","0L1","1L0","1L1","2L0","2L1","3L0","3L1","4L0","4L1","5L0","5L1","6L0","6L1","7L0","7L1","0H0","0H1","1H0","1H1","2H0","2H1","3H0","3H1","4H0","4H1","5H0","5H1","6H0","6H1","7H0","7H1");
# Sockets, banks and bytes on VME expansion cards
@socketstr_exp=("U1501","U1503","U1505","U1507","U1601","U1603","U1605","U1607","U1701","U1703","U1705","U1707","U1801","U1803","U1805","U1807","U1502","U1504","U1506","U1508","U1602","U1604","U1606","U1608","U1702","U1704","U1706","U1708","U1802","U1804","U1806","U1808","U1901","U1903","U1905","U1907","U2001","U2003","U2005","U2007","U2101","U2103","U2105","U2107","U2201","U2203","U2205","U2207","U1902","U1904","U1906","U1908","U2002","U2004","U2006","U2008","U2102","U2104","U2106","U2108","U2202","U2204","U2206","U2208");
@bankstr_exp=("B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3");
@bytestr_exp=("0L0","0L1","1L0","1L1","2L0","2L1","3L0","3L1","4L0","4L1","5L0","5L1","6L0","6L1","7L0","7L1","0H0","0H1","1H0","1H1","2H0","2H1","3H0","3H1","4H0","4H1","5H0","5H1","6H0","6H1","7H0","7H1","8L0","8L1","9L0","9L1","aL0","aL1","bL0","bL1","cL0","cL1","dL0","dL1","eL0","eL1","fL0","fL1","8H0","8H1","9H0","9H1","aH0","aH1","bH0","bH1","cH0","cH1","dH0","dH1","eH0","eH1","fH0","fH1");
}
if ($model eq "Ultra-1" || $ultra eq 1) {
# Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
# 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB),
# 501-3136 (128MB)
# 200-pin 60ns Fast Page Mode ECC
$devname="Neutron (Ultra 1), Electron (Ultra 1E), Dublin (Ultra 150)";
$familypn="A11 (Ultra 1), A12 (Ultra 1E)";
$untested=0;
$simmrangex="00000100";
$simmbanks=4;
$simmsperbank=2;
@simmsizes=(16,32,64,128);
@socketstr=("U0701","U0601","U0702","U0602","U0703","U0603","U0704","U0604");
@bankstr=("0L","0H","1L","1H","2L","2H","3L","3H");
@bytestr=("00-15","16-31","00-15","16-31","00-15","16-31","00-15","16-31");
}
if ($model eq "Ultra-2" || $ultra eq 2) {
# Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
$devname="Pulsar";
$familypn="A14";
$untested=0;
$simmrangex="00000200";
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(16,32,64,128);
@socketstr=("U0501","U0401","U0701","U0601","U0502","U0402","U0702","U0602","U0503","U0403","U0703","U0603","U0504","U0404","U0704","U0604");
@groupstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
@bankstr=("0L","0H","1L","1H","0L","0H","1L","1H","0L","0H","1L","1H","0L","0H","1L","1H");
@bytestr=("00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63");
}
if ($model eq "Ultra-30" || $ultra eq 30) {
# Also Netra t 1100
# Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
# 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB),
# 501-3136 (128MB)
# 200-pin 60ns Fast Page Mode ECC
# Two DIMMs form a pair, two pairs of DIMMs form a quad.
# Minumum requirements is two DIMMs in any adjacent pair.
# DIMMs can be installed in any order of pairs.
# Interleaving requires a fully populated quad.
# Each quad addresses 512MB of memory.
$devname="Quark (Ultra-30), Lightweight (Netra t 1100)";
$familypn="A16 (Ultra-30), N01 (Netra t 1100)";
$untested=0;
# simmrangex, simmbanks, and simmsperbank set later after determining
# if interleaving banks using quads rather than pairs
@simmsizes=(16,32,64,128);
@socketstr=("U0701","U0801","U0901","U1001","U0702","U0802","U0902","U1002","U0703","U0803","U0903","U1003","U0704","U0804","U0904","U1004");
@bankstr=("Quad 0 Pair 0","Quad 0 Pair 0","Quad 0 Pair 1","Quad 0 Pair 1","Quad 1 Pair 0","Quad 1 Pair 0","Quad 1 Pair 1","Quad 1 Pair 1","Quad 2 Pair 0","Quad 2 Pair 0","Quad 2 Pair 1","Quad 2 Pair 1","Quad 3 Pair 0","Quad 3 Pair 0","Quad 3 Pair 1","Quad 3 Pair 1");
}
if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) {
# Accepts 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard
# 16MB DIMM uses 10-bit column addressing and was not sold
# 32, 64, 128 and 256MB DIMMs use 11-bit column addressing
# Do not mix 16MB DIMMs with other sizes
# 256MB DIMM not supported in Ultra 5 according to Sun documentation,
# but they do work as long as you use low-profile DIMMs or take out the
# floppy drive.
# Memory speed is 60ns if 50ns and 60ns DIMMs are mixed
# 2-way interleaving supported with four identical sized DIMMs
# 50ns DIMMs supported on 375-0066 & 375-0079 motherboards
# Bank 0 DIMM1/DIMM2 0x00000000-0x0fffffff, 0x20000000-0x2fffffff
# Bank 1 DIMM3/DIMM4 0x10000000-0x1fffffff, 0x30000000-0x3fffffff
$devname="Darwin/Otter (Ultra 5), Darwin/SeaLion (Ultra 10)";
$familypn="A21 (Ultra 5), A22 (Ultra 10)";
$untested=0;
$simmrangex="00000100";
$simmbanks=2;
$simmsperbank=2;
@simmsizes=(16,32,64,128,256);
@socketstr=("DIMM1".."DIMM4");
@bankstr=("0L","0H","1L","1H");
$sortslots=0;
}
if ($model eq "Ultra-60" || $ultra eq 60 || $ultra eq "220R") {
# Also Netra t1120/1125
# Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
# 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB),
# 501-3136 (128MB)
# 200-pin 60ns Fast Page Mode ECC
# U1001-U1004 bank 3 address 0xa0000000-0xbfffffff
# U0901-U0904 bank 2 address 0x80000000-0x9fffffff
# U0801-U0804 bank 1 address 0x20000000-0x3fffffff
# U0701-U0704 bank 0 address 0x00000000-0x1fffffff
if ($model eq "Ultra-60" || $ultra eq 60) {
$devname="Deuterium (Ultra-60), Lightweight 2 (Netra t112x)";
$familypn="A23 (Ultra-60), N02/N04 (Netra t1120), N03 (Netra t1125)";
}
if ($ultra eq "220R") {
$devname="Razor";
$familypn="A34";
}
$untested=0;
$simmrangex="00000200";
$simmbanks=6; # Count the skipped address range
$simmsperbank=4;
@simmsizes=(16,32,64,128);
@socketstr=("U0701".."U0704","U0801".."U0804","?","?","?","?","?","?","?","?","U0901".."U0904","U1001".."U1004");
@bankstr=(0,0,0,0,1,1,1,1,"?","?","?","?","?","?","?","?",2,2,2,2,3,3,3,3);
}
#
# SPARCengine systems
#
if ($banner =~ /Netra t1\b/ || $ultra eq "Netra t1" || $model eq "Netra t1" || $banner =~ /Ultra CP 1500\b/ || $ultra eq "CP1500" || $ultra eq "Netra ct400" || $ultra eq "Netra ct410" || $ultra eq "Netra ct800" || $ultra eq "Netra ct810") {
# Netra t1 100/105, Netra ct400/410/800/810, SPARCengine CP1500
# Accepts 1 or 2 64MB, 128MB, 256MB or 512MB mezzanine memory cards
# Netra ct400/800 use the Netra ct1600 DC chassis (N08)
# Netra ct410/810 use the Netra ct1600 AC chassis (N09)
# Also used in Sun Fire 12K & Sun Fire 15K
# Install the highest capacity memory board first
# The 370-4155 was sold for use in the Netra t1 100/105
# Up to four 370-4155 256MB memory boards can be installed
# Only one 370-4155 can be mixed with any other memory boards
# Cannot distinguish between 4 370-4155 256MB and 2 512MB memory boards
# Maximum memory: 768MB for 270MHz/33MHz, 1GB for 360MHz/440MHz systems
#
# Top slot -> 64MB 64MB 128MB 128MB 256MB 256MB 512MB
# Bottom slot SSF SS DSF SS SSF SS DSF SS DSF DS DSF SS DSF DS
# |
# v ------ ------ ------ ------ ------ ------ ------
# 64MB SSF SS Y N Y N N Y N
# 64MB DSF SS Y Y Y Y Y Y Y
# 128MB SSF SS Y N Y N N Y N
# 128MB DSF SS Y Y Y Y Y Y Y
# 256MB DSF SS Y Y Y Y Y Y Y
# 512MB DSF DS Y/N * Y/N * Y/N * Y/N * Y/N * Y/N * Y/N *
#
# SSF=single-sided fab, DSF=double-sided fab
# SS=stuffed on one side, DS=stuffed on both sides
# * 512MB DSF DS board is supported on 360MHz and 440MHz systems,
# 512MB DSF DS board is not supported on 270MHz and 333MHz systems
# Lower board, address 0x00000000-0x0fffffff, 0x20000000-0x2fffffff
# upper board, address 0x10000000-0x1fffffff, 0x30000000-0x3fffffff
if ($banner =~ /Netra t1\b/ || $ultra eq "Netra t1" || $model eq "Netra t1") {
$devname="Flyweight (Model 100), Flapjack (Model 105)";
$familypn="N07 (Model 100), N06 (Model 105)";
}
$devname="Tonga" if ($ultra eq "Netra ct400");
$devname="Monte Carlo" if ($ultra eq "Netra ct800");
$familypn="N08" if ($ultra =~ /Netra ct[48]00/);
if ($ultra =~ /Netra ct[48]10/) {
$devname="Makaha";
$familypn="N09";
}
$untested=0;
$untested=1 if ($ultra eq "Netra ct400" || $ultra =~ /Netra ct[48]10/);
$memtype="memory card";
$sockettype="";
$simmrangex="00000100";
$simmbanks=2;
$simmsperbank=1;
@simmsizes=(64,128,256,512);
@socketstr=("base mezzanine board","additional mezzanine board");
@orderstr=("lower board","upper board");
$sortslots=0;
}
if ($banner =~ /Ultra CP 1400\b/ || $ultra eq "CP1400") {
# Accepts 1 or 2 64MB, 128MB, 256MB or 512MB mezzanine memory cards
# Has 64MB on-board memory on motherboard
# Maximum memory: 832MB (64MB motherboard, 512MB bottom, 256MB top)
#
# Top slot -> 64MB 64MB 128MB 128MB 256MB 512MB
# Bottom slot SSF SS DSF SS SSF SS DSF SS DSF SS DSF DS
# |
# v ------ ------ ------ ------ ------ ------
# 64MB SSF SS Y N Y N Y N
# 64MB DSF SS Y Y Y Y Y N
# 128MB SSF SS Y N Y N Y N
# 128MB DSF SS Y Y Y Y Y N
# 256MB DSF SS Y Y Y Y Y N
# 512MB DSF DS Y Y Y Y Y N
#
# SSF=single-sided fab, DSF=double-sided fab
# SS=stuffed on one side, DS=stuffed on both sides
# 512MB DSF DS board is only supported in bottom slot
#
# Motherboard, address 0x00000000-0x03ffffff
# Upper board, address 0x08000000-0xffffffff, 0x28000000-0x2fffffff
# Lower board, address 0x10000000-0x17ffffff, 0x30000000-0x37ffffff
$devname="Casanova";
$untested=0;
$memtype="memory card";
$sockettype="";
$simmrangex="00000080";
$simmbanks=3;
$simmsperbank=1;
@simmsizes=(64,128,256,512);
@socketstr=("motherboard","additional mezzanine board","base mezzanine board");
@orderstr=("","upper board","lower board");
$sortslots=0;
}
if ($ultra eq "AX" || $ultra eq "AX-300") {
# SPARCengine Ultra AX and AX-300
# Accepts 8MB, 16MB, 32MB or 64MB DIMMs on motherboard
# AX-300 also accepts 128MB DIMMs on motherboard
$devname="Photon";
$untested=0; # unsure if socket order is correct
$simmrangex="00000200";
$simmbanks=2;
$simmsperbank=4;
@simmsizes=(8,16,32,64,128);
@socketstr=("U0301".."U0304","U0401".."U0404");
@bankstr=(0,0,0,0,1,1,1,1);
}
if ($ultra eq "AXi") {
# SPARCengine Ultra AXi
# Accepts 8MB, 16MB, 32MB, 64MB or 128MB single or dual bank 10-bit
# column address type DIMMs on motherboard in all socket pairs
# Accepts 8MB, 16MB, 32MB, 64MB, 128MB or 256MB dual bank 11-bit
# column address type DIMMs on motherboard in Pairs 0 & 2
# (leave Pairs 1 & 3 empty)
# DIMMs should be chosen as all 10-bit or all 11-bit column address type
# Use 60ns DIMMs only
#$devname="unknown";
$untested=0;
$simmrangex="00000100";
$simmbanks=4;
$simmsperbank=2;
@simmsizes=(8,16,32,64,128,256);
@socketstr=("U0404","U0403","U0304","U0303","U0402","U0401","U0302","U0301");
@bankstr=(0,0,2,2,1,1,3,3);
$sortslots=0;
}
if ($ultra eq "AXmp" || $ultra eq "AXmp+") {
# SPARCengine Ultra AXmp
# Accepts 8MB, 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
# Accepts 256MB dual-bank DIMMs in bank 0 or 1 (not both)
# Can't distinguish dual-bank DIMMs from two banks of single bank DIMMs
# SPARCengine Ultra AXmp+
# Accepts 8MB, 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard
# Accepts dual-bank DIMMs in both bank 0 and 1
# Can't distinguish dual-bank DIMMs from two banks of single bank DIMMs
$devname="Crichton";
$untested=0;
$simmbanks=2;
$simmsperbank=8;
if ($ultra eq "AXmp+") {
$simmrangex="00000400";
@simmsizes=(8,16,32,64,128,256);
} else {
$simmrangex="00000800";
@simmsizes=(8,16,32,64,128);
}
@socketstr=("U0701".."U0704","U0801".."U0804","U0901".."U0904","U1001".."U1004");
@bankstr=(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1);
$sortslots=0;
}
if ($ultra eq "AXe") {
# SPARCengine Ultra AXe
# Accepts 32MB, 64MB, 128MB or 256MB single or dual bank DIMMs
# DIMMs should be chosen as all 10-bit or all 11-bit column address type
$devname="Topdog";
$untested=0;
$simmrangex="00000100";
$simmbanks=2;
$simmsperbank=2;
@simmsizes=(32,64,128,256);
@socketstr=("DIMM3","DIMM4","DIMM1","DIMM2");
@bankstr=(0,0,1,1);
# Assume stacked DIMMs like AXi since only 128MB DIMMs have been tested
$sortslots=0;
}
if ($ultra eq "AX-e2") {
# Netra AX1105-500
# Accepts up to 4 64MB, 128MB, 256MB or 512MB registered SDRAM PC133
# DIMMs; 128MB Minimum, 2GB Maximum
# DIMM0 & DIMM1 form Bank 0, DIMM2 & DIMM3 form Bank 1
# DIMMs don't have to be installed as pairs
$devname="Birdsnest Lite";
$untested=0;
$simmrangex="00000200";
$simmbanks=4;
$simmsperbank=1;
@simmsizes=(64,128,256,512);
@socketstr=("DIMM0".."DIMM3");
@bankstr=(0,0,1,1);
}
if ($ultra eq "Netra X1" || $ultra eq "Sun Fire V100") {
# Netra X1, Sun Fire V100, UltraAX-i2
# Accepts up to 4 128MB or 256MB PC133 DIMMs for 1GB maximum
# 500MHz model also accepts up to 4 512MB PC133 DIMMs for 2GB maximum
# Have seen slower models also work with 512MB DIMMs for 2GB maximum
# Sun Fire V100 is 500MHz only
# The memory installation sequence is Slot 3, 2, 1, and 0.
# Each DIMM slot addresses 512MB with 400MHz UltraSPARC IIe
# Each DIMM slot addresses 1GB with >= 550MHz UltraSPARC IIe
# Memory is SDRAM PC133 CL=3 ECC registered
# When equal size DIMMs are installed, the lowest slot number is
# mapped to the lowest address range.
# When mixed size DIMMs are installed, the slot number with the largest
# size DIMM is mapped to the lowest address range.
$devname="Flapjack-lite" if ($ultra eq "Netra X1");
$devname="Flapjack-liteCD500" if ($ultra eq "Sun Fire V100");
$familypn="N19";
$untested=0;
$simmrangex=($cpufreq > 520) ? "00000400" : "00000200";
$simmbanks=4;
$simmsperbank=1;
@simmsizes=(128,256,512);
@socketstr=("DIMM0".."DIMM3");
}
if ($ultra eq "Netra T1 200" || $ultra eq "Sun Fire V120" || $ultra eq "Netra 120") {
# Netra T1 200, Sun Fire V120, Netra 120, UltraAX-i2
# Accepts up to 4 256MB, 512MB or 1GB PC133 DIMMs for 4GB maximum
# Sun Fire V120 is 550MHz or 650MHz
# Netra 120 is same platform as Sun Fire V120, but is 650MHz only
# Memory is SDRAM PC133 CL=3 ECC registered
# The minimum memory requirement is one DIMM in Slot 0
# The memory installation sequence is Slot 0, 1, 2, 3
# Each DIMM slot addresses 512MB of memory with 500MHz UltraSPARC IIe
# Each DIMM slot addresses 1GB of memory with >= 550MHz UltraSPARC IIe
# When equal size DIMMs are installed, the lowest slot number is
# mapped to the lowest address range.
# When mixed size DIMMs are installed, the slot number with the largest
# size DIMM is mapped to the lowest address range.
if ($ultra eq "Netra T1 200") {
$devname="Flapjack2";
$familypn="N21";
}
if ($ultra eq "Sun Fire V120" || $ultra eq "Netra 120") {
$devname="Flapjack2+";
$familypn="N25";
}
$untested=0;
$simmrangex=($cpufreq > 520) ? "00000400" : "00000200";
$simmbanks=4;
$simmsperbank=1;
@simmsizes=(256,512,1024);
@socketstr=("DIMM0".."DIMM3");
}
if ($banner =~ /\bCP2000\b/ || $ultra =~ /^CP2[01]\d0$/) {
# Netra CP2000/CP2100 Series CompactPCI Boards (UltraSPARC-IIe)
# CP2040 (SUNW,UltraSPARC-IIe-NetraCT-40) supports 256MB, 512MB, and 1GB
# CP2060 (SUNW,UltraSPARC-IIe-NetraCT-60) has non-expandable 512MB
# CP2080 (SUNW,UltraSPARCengine_CP-80) supports 256MB, 512MB, and 1GB
# CP2140 (SUNW,UltraSPARCengine_CP-40) supports 512MB, 1GB and 2GB
# CP2160 (SUNW,UltraSPARCengine_CP-60) supports 1GB and 2GB
# 256MB Single-Wide module 375-3024
# 512MB Single-Wide module 375-3025
# 1GB Double-Wide module 375-3026
# 1GB Single-Wide module 375-3125
# 2GB Double-Wide module 375-3114
# Max number of stacked memory boards is two
# Install double wide memory first, then single wide memory
$devname="Othello" if ($ultra eq "CP2040");
$devname="Sputnik Bluesky" if ($ultra eq "CP2060");
$devname="Sputnik Orion" if ($ultra eq "CP2080");
$devname="Othello+" if ($ultra eq "CP2140");
$devname="Sputnik+" if ($ultra eq "CP2160");
$untested=1;
$untested=0 if ($ultra eq "CP2140");
if ($ultra eq "CP2060") {
$memtype="embedded memory";
$sockettype="";
$simmrangex="00001000";
$simmbanks=1;
$simmsperbank=1;
@simmsizes=(512);
} else {
$memtype="memory card";
$sockettype="";
$simmrangex="00001000";
$simmbanks=2;
$simmsperbank=1;
if ($ultra eq "CP2140") {
@simmsizes=(512,1024,2048);
} elsif ($ultra eq "CP2160") {
@simmsizes=(1024,2048);
} else {
@simmsizes=(256,512,1024);
}
@socketstr=("base mezzanine board","additional mezzanine board");
@orderstr=("lower board","upper board");
$sortslots=0;
}
}
#
# Clones: most do not have verbose output since I don't have any socket data
# on them
#
if ($ultra eq "axus250" || $modelmore =~ /Ultra-250/) {
# AXUS Microsystems, Inc. http://www.axus.com.tw
# AXUS 250 clone
# accepts up to 128MB DIMMs on motherboard
$untested=0;
$simmrangex="00000200";
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(8,16,32,64,128);
@socketstr=("U0501","U0601","U0701","U0801","U0502","U0602","U0702","U0802","U0503","U0603","U0703","U0803","U0504","U0604","U0704","U0804");
@bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
}
if ($model =~ /SPARC CPU-/ || $model =~ /SPARC CPCI-/) {
# Force Computers, http://www.forcecomputers.com
# model format: "SPARC CPU-5V/64-110-X" for 64MB w/ 110MHz CPU
$untested=1;
$untested=0 if ($model =~ /SPARC CPU-/);
if ($model =~ /\/${installed_memory}-/) {
$totmem=$installed_memory;
push(@simmsizesfound, "$totmem");
$buffer="motherboard contains ${totmem}MB on-board memory\n";
&finish;
}
}
if ($model =~ /Axil/) {
# RAVE Computer Association, http://rave.com
$untested=1;
$untested=0 if ($model =~ /Axil-245/);
$untested=0 if ($model =~ /Axil-255/);
$untested=0 if ($model =~ /Axil-311/);
$untested=0 if ($model =~ /Axil-320/);
}
if ($manufacturer =~ /Tadpole/) {
# Tadpole RDI, http://www.tadpole.com
$untested=1;
$untested=0 if ($banner =~ /Tadpole S3/);
$untested=0 if ($model =~ /PowerLite-170/);
$untested=0 if ($banner =~ /\bVoyagerIIi\b/);
$untested=0 if ($banner =~ /\bCycleQUAD\b/);
if ($ultra eq "UP-20") {
# Cycle UP-20 to upgrade SPARCstation 5/20 motherboards
# Accepts 16MB, 32MB and 64MB SIMMs from SPARCstation 20
# Install SIMMs in pairs to form each bank
$untested=1;
$simmrangex="00000040";
$simmbanks=4;
$simmsperbank=2;
@simmsizes=(16,32,64);
@bankstr=(0,0,1,1,2,2,3,3);
}
if ($ultra eq "UP-520IIi") {
# Cycle UP-520-IIi to upgrade SPARCstation 5/20 motherboards
# Accepts 8MB, 16MB, 32MB, 64MB, 128MB and 256MB DIMMs
$untested=0;
$simmrangex="00000200";
$simmbanks=4;
$simmsperbank=2;
@simmsizes=(8,16,32,64,128,256);
@socketstr=("J301".."J304");
@bankstr=(0,0,1,1);
}
if ($banner =~ /\bSPARCLE\b/) {
# UltraSPARC-IIe at 440MHz, 500MHz, or 650MHz
# 256MB - 2GB ECC SDRAM, two slots, PC-133, 144-pin SO-DIMMs
$untested=0;
$simmbanks=2;
$simmsperbank=1;
@simmsizes=(128,256,512,1024);
@socketstr=("DIMM0","DIMM1");
$memtype="SO-DIMM";
}
}
if ($manufacturer eq "Auspex") {
# Auspex Netserver, http://www.auspex.com
$memtype="Memory Module";
$untested=1;
$untested=0 if ($model eq "SPARC Processor");
if ($osrel =~ /^5./) {
$untested=1; # Untested with Solaris 2.X
$untested_type="OS";
}
}
if ($manufacturer =~ /Fujitsu/) {
# Hal Computer Systems, a Fujitsu Company, http://www.hal.com
# Fujitsu Siemens, http://www.fujitsu-siemens.com
$untested=1;
$untested=0 if ($model =~ /S-4\/10H/ || $model =~ /S-4\/20[ABLH]/);
if ($banner =~ /GP7000\b/ || $banner =~ /GP7000F\b/) {
$untested=0;
if ($slotname0 =~ /SLOT[0-9]/) {
# M200
# Up to 4GB of memory
# System board has 16 DIMM slots, #00 - #15
# Banks - 0,0,1,1,2,2,2,2,3,3,3,3,4,4,4,4
# First Modules installed in Bank 0, slots 0-1
# Second Modules Installed in Bank 1, slots 2-3
# Modules in Bank 0 and 1 must be same size
# Subsequent memory expansion installed in sets of four
# modules in Bank 2 - 4 (Slots 4-7, 8-11, 12-15)
@socketstr=("SLOT0".."SLOT9","SLOT10".."SLOT15");
}
if ($slotname0 =~ /SLOT[AB][0-9]/) {
# M400 and M600
# Up to 4GB of memory
# System board has 32 DIMM slots, #00 - #15 Group A & B
# Banks - 0,0,1,1,2,2,2,2,3,3,3,3,4,4,4,4
# First Modules installed in Bank 0 Group A, slots 0-1
# Second Modules installed in Bank 0 Group B, slots 0-1
# Modules in Group A and B must be same size
# Next memory expansion installs in Bank 1 Group A & B,
# slots 2-3 using modules of same size as Bank 0
# Subsequent memory expansion installed in sets of eight
# modules in Bank 2 - 4 (Slots 4-7, 8-11, 12-15) in
# both Group A and B
@socketstr=("SLOTA0".."SLOTA9","SLOTA10".."SLOTA15","SLOTB0".."SLOTB9","SLOTB10".."SLOTB15");
}
}
if ($banner =~ /PRIMEPOWER *100N?\b/) {
# PRIMEPOWER100N, 1U rack mount
# Up to 2GB of memory
# 4 memory module slots
# 100MHz SDRAM ECC
# Mount memory modules in order from memory module slot 0
$untested=1;
}
if ($banner =~ /PRIMEPOWER *[246]00\b/) {
# Up to 8GB of memory
# Each system board has 16 DIMM slots, #00 - #15
# Four banks of 4 (0-3,4-7,8-11,12-15)
# PrimePower 200 and 400 use 1 system board
# PrimePower 600 uses 2 system boards (00, 01)
$untested=0;
foreach $brd ("00","01") {
if ($gotcpuboards =~ /\b$brd\b/) {
if ($gotmodulenames =~ /${brd}-SLOT[0-9]/) {
foreach $i (0..15) {
push(@socketstr, ("${brd}-SLOT$i"));
}
}
}
}
}
if ($banner =~ /PRIMEPOWER *800\b/ || $banner =~ /PRIMEPOWER *1000\b/ || $banner =~ /PRIMEPOWER *2000\b/) {
# 1-4 SPARC64 GP CPUs / system board
# PrimePower 800 can have 4 system boards per system
# PrimePower 1000 can have 8 system boards per system
# PrimePower 2000 can have 32 system boards per system
# Minimum Memory: 1GB / system board, 2GB / system
# Maximum Memory: 8GB / system board, 32GB / system
# 32 or 16 memory modules per system board, installed in quads
$untested=0;
@simmsizes=(128,256,512);
foreach $brd ("00".."77") {
if ($gotcpuboards =~ /\b$brd\b/) {
if ($gotmodulenames =~ /${brd}-SLOT#[AB][0-9]/) {
foreach $j ("A","B") {
foreach $i ("00".."03","10".."13","20".."23","30".."33") {
push(@socketstr, ("${brd}-SLOT#$j$i"));
}
}
}
}
}
}
if ($banner =~ /PRIMEPOWER *250\b/) {
# Pedestal, 2U or 4U rack mount
# 1-2 SPARC64 V processors at 1.1GHz, 1.32GHz, 1.87GHz
# 1GB-16GB DDR-SDRAM memory with ECC, 2-way, 8 DIMM slots
$untested=0;
@simmsizes=(256,512,1024,2048);
foreach $i ("00".."07") {
push(@socketstr, ("SLOT#$i"));
}
}
if ($banner =~ /PRIMEPOWER *450\b/) {
# Pedestal, 4U or 7U rack mount
# 1-4 SPARC64 V processors at 1.1GHz, 1.32GHz, 1.87GHz
# 1GB-32GB DDR-SDRAM memory with ECC, 4-way, 16 DIMM slots
$untested=0;
@simmsizes=(256,512,1024,2048);
foreach $i ("00".."15") {
push(@socketstr, ("SLOT#$i"));
}
}
if ($banner =~ /PRIMEPOWER *[68]50\b/) {
# PrimePower 650: 2-8 SPARC64 V processors at 1.1GHz or faster
# 2GB-64GB memory, 8-way, 1 system board, 8U rack mount
# PrimePower 850: 4-16 SPARC64 V processors at 1.1GHz or faster
# 2GB-128GB memory, 16-way, 2 system boards, 16U rack mount
# Uses DDR SDRAM ECC memory in 256MB, 512MB and 1GB sizes
# Each system board has 32 memory module slots, layed out
# with 4 DIMMs on 8 DIMM riser cards.
$untested=0;
@simmsizes=(256,512,1024,2048);
foreach $brd ("C0S00","C0S01") {
if ($gotcpuboards =~ /\b$brd\b/) {
if ($gotmodulenames =~ /${brd}-SLOT#[A-D][0-9]/) {
foreach $j ("A".."D") {
foreach $i ("00".."07") {
push(@socketstr, ("${brd}-SLOT#$j$i"));
}
}
}
}
}
}
if ($banner =~ /PRIMEPOWER *HPC2500\b/ || $banner =~ /PRIMEPOWER *900\b/ || $banner =~ /PRIMEPOWER *[12]500\b/) {
# SPARC64 V CPUs at 1.3GHz or 1.89GHz
# PRIMEPOWER HPC2500 / 2500
# 2-8 CPUs / system board, 64-128 / system
# Up to 16 8-way system boards / system
# Up to 1024GB DDR-SDRAM memory with ECC, 128-way
# Minimum Memory: 4GB / system board, 4GB / system
# Maximum Memory: 64GB / system board, 1024GB / system
# PRIMEPOWER 900
# 17U rack mount
# 1-8 CPUs / system board, 1-16 / system
# Up to 2 8-way system boards / system
# Up to 128GB DDR-SDRAM memory with ECC, 8-way
# Minimum Memory: 2GB / system board, 2GB / system
# Maximum Memory: 64GB / system board, 128GB / system
# PRIMEPOWER 1500
# 1-8 CPUs / system board, 1-32 / system
# Up to 4 8-way system boards / system
# Up to 256GB DDR-SDRAM memory with ECC, 8-way
# Minimum Memory: 2GB / system board, 2GB / system
# Maximum Memory: 64GB / system board, 256GB / system
$untested=0;
@simmsizes=(256,512,1024,2048);
foreach $cab ("C0S","C1S") {
foreach $brd ("00".."07") {
if ($gotcpuboards =~ /\b$cab$brd\b/) {
foreach $j ("A","B") {
foreach $i ("00".."15") {
push(@socketstr, ("$cab${brd}-SLOT#$j$i"));
}
}
}
}
}
}
}
if ($model =~ /COMPstation.10/) {
# Tatung Science and Technology, http://www.tsti.com
# Accepts 16MB and 64MB SIMMs on motherboard
# Bank 0 must be filled first
# Layout is like SPARCstation-10, but I don't know if it can accept
# 32MB SIMMs or NVSIMMs
$untested=0;
$simmrangex="00000040";
$simmbanks=8;
$simmsperbank=1;
@simmsizes=(16,64);
@socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305");
@bankstr=(0,2,4,6,1,3,5,7);
}
if ($model =~ /COMPstation-20A\b/) {
# Tatung Science and Technology, http://www.tsti.com
# Accepts 16MB, 32MB and 64MB SIMMs on motherboard
$untested=1;
$simmrangex="00000040";
$simmbanks=8;
$simmsperbank=1;
@simmsizes=(16,32,64);
@socketstr=("J0201","J0304","J0203","J0302","J0303","J0301","J0305","J0202");
@orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th");
@bankstr=(1..8);
}
if ($model =~ /COMPstation-20AL/) {
# Tatung Science and Technology, http://www.tsti.com
# Accepts 16MB, 32MB and 64MB SIMMs on motherboard
$untested=0;
$simmrangex="00000040";
$simmbanks=8;
$simmsperbank=1;
@simmsizes=(16,32,64);
@socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305");
@orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th");
@bankstr=(0..7);
}
if ($banner =~ /COMPstation_U60_Series/ || $banner =~ /COMPstation_U80D_Series/) {
# Tatung Science and Technology, http://www.tsti.com
# Accepts 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard
# 4 banks with 4 DIMMs per bank
$untested=0;
if ($banner =~ /COMPstation_U60_Series/) {
$simmrangex="00000200"; # use "00000400" with 256MB DIMMs
$simmbanks=6; # Count the skipped address range
} else {
$simmrangex="00000400";
$simmbanks=4;
}
$simmsperbank=4;
@simmsizes=(16,32,64,128,256);
}
if ($model =~ /\bVoyagerIIi\b/) {
# Tadpole Voyager IIi has 8 DIMM slots, but otherwise appears
# to look like an Ultra 5. It allows 256MB to 1GB of memory.
$untested=0;
$simmrangex="00000100";
$simmbanks=4;
$simmsperbank=2;
@simmsizes=(16,32,64,128);
@socketstr=("DIMM1","DIMM2","DIMM5","DIMM6","DIMM3","DIMM4","DIMM7","DIMM8");
$sortslots=1;
}
#
# systems below may have memory information available in prtdiag output
#
if ($model eq "SPARCserver-1000" || $model eq "SPARCcenter-2000") {
$devname="Scorpion" if ($model eq "SPARCserver-1000");
$devname="Scorpion+" if ($banner =~ "1000E");
$devname="Dragon" if ($model eq "SPARCcenter-2000");
$devname="Dragon+" if ($banner =~ "2000E");
# Accepts 8MB and 32MB SIMMs on motherboard
$untested=0;
@simmsizes=(8,32);
$prtdiag_has_mem=1;
&check_prtdiag;
if ($boardfound_mem) {
foreach $line (@boards_mem) {
if ($line =~ /Board/) {
$boardslot_mem=substr($line,5,1);
$simmsize=int substr($line,46,3) / 4;
if ($simmsize == 0) {
&found_empty_bank("Group 0");
} elsif ($simmsize == 1) {
&found_nvsimm_bank("Group 0");
} else {
push(@simmsizesfound, "$simmsize");
}
$simmsize=int substr($line,54,3) / 4;
if ($simmsize == 0) {
&found_empty_bank("Group 1");
} elsif ($simmsize == 1) {
&found_nvsimm_bank("Group 1");
} else {
push(@simmsizesfound, "$simmsize");
}
$simmsize=int substr($line,62,3) / 4;
if ($simmsize == 0) {
&found_empty_bank("Group 2");
} elsif ($simmsize == 1) {
&found_nvsimm_bank("Group 2");
} else {
push(@simmsizesfound, "$simmsize");
}
$simmsize=int substr($line,70,3) / 4;
if ($simmsize == 0) {
&found_empty_bank("Group 3");
} elsif ($simmsize == 1) {
&found_nvsimm_bank("Group 3");
} else {
push(@simmsizesfound, "$simmsize");
}
}
}
&show_header;
print @boards_mem;
print "Each memory unit group is comprised of 4 SIMMs\n";
$empty_banks=" None" if ($empty_banks eq "");
print "empty memory groups:$empty_banks\n";
} else {
&show_header;
$recognized=0;
}
$totmem=$installed_memory;
&finish;
exit;
}
if ($model eq "Ultra-4" || $ultra eq 450 || $model eq "Ultra-4FT" || $ultra eq "Netra ft1800") {
# Accepts 32MB, 64MB, 128MB or 256MB DIMMs on motherboard
# 16MB DIMMs are not supported and may cause correctable ECC errors
# 501-2622 (32MB), 501-2480 or 501-5691 (64MB), 501-3136 (128MB),
# 501-4743 or 501-5896 (256MB)
# 200-pin 60ns Fast Page Mode ECC
# Netra ft1800 is based on Ultra 450
$devname="Tazmo (Tazmax/Tazmin)";
$familypn="A20, A25";
$familypn="N05" if ($model eq "Ultra-4FT" || $ultra eq "Netra ft1800");
$untested=0;
$simmrangex="00000400";
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(16,32,64,128,256);
@socketstr=("U1901".."U1904","U1801".."U1804","U1701".."U1704","U1601".."U1604");
@groupstr=("A","A","A","A","B","B","B","B","C","C","C","C","D","D","D","D");
@bankstr=(2,2,2,2,3,3,3,3,0,0,0,0,1,1,1,1);
}
if ($model eq "Ultra-250" || $ultra eq 250) {
# Accepts 16MB, 32MB, 64MB, or 128MB DIMMs on motherboard
# 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB),
# 501-3136 (128MB)
# 200-pin 60ns Fast Page Mode ECC
$devname="Javelin";
$familypn="A26";
$untested=0;
$simmrangex="00000200";
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(16,32,64,128);
@socketstr=("U0701","U0801","U0901","U1001","U0702","U0802","U0902","U1002","U0703","U0803","U0903","U1003","U0704","U0804","U0904","U1004");
@bankstr=("A","A","A","A","B","B","B","B","C","C","C","C","D","D","D","D");
}
if ($model eq "Ultra-80" || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x") {
# Accepts 64MB or 256MB DIMMs
# 501-5691 (64MB), 501-4743 501-5936 501-6005 501-6056 (256MB)
# 200-pin 60ns 5V Fast Page Mode ECC, 576 bits data width
# 64MB DIMMs same as in Ultra-60, 256MB DIMMs same as in Enterprise-450
# U0403,U0404,U1403,U1404 bank 3 address 0xc0000000-0xffffffff
# U0303,U0304,U1303,U1304 bank 2 address 0x80000000-0xbfffffff
# U0401,U0402,U1401,U1402 bank 1 address 0x40000000-0x7fffffff
# U0301,U0302,U1301,U1302 bank 0 address 0x00000000-0x3fffffff
# The minimum requirement is four DIMMs in any bank. The recommended
# installation sequence is Bank 0,2,1,3. DIMMs are required on both the
# Riser Board (U0[34]0?) and the System Board (U1[34]0?). Two-way and
# four-way memory bank interleaving is supported. Memory is 2-way
# interleaved when the same size DIMMs are installed in Banks 0 and 1.
# Memory is 4-way interleaved when the same size DIMMs are installed in
# Banks 0, 1, 2 and 3.
#
# prtconf does not reliably show the size of DIMMs in each slot when
# 1GB of total memory is installed. It shows this:
# reg: 00000000.00000000.00000000.40000000
# A system with 1GB is reported as having 4 256MB DIMMs, but may be
# using 16 64MB DIMMs in a 4-way interleave.
# This is an issue that Sun could fix in the OBP.
# It is broken with OBP 3.33.0 2003/10/07 (patch 109082-06) and older.
# prtfru (Solaris 8 and later) also does not work.
#
# Sun shipped U80 1GB configurations w/ 4x256MB DIMMs
# Sun shipped U80 256MB configurations w/ 4x64MB DIMMs
# Sun shipped E420R with 501-5936 256MB DIMMs
# 64MB DIMM 501-2480 and 128MB DIMM 501-3136 are not supported.
# 16MB and 32MB DIMMs are not sold for the Ultra 80.
#
$devname="Quasar (U80), Quahog (420R), Lightweight 3 (Netra t140x)";
$familypn="A27 (U80), A33 (420R), N14 (Netra t1405), N15 (Netra t1400)";
if ($ultra eq 80) {
$devname="Quasar";
$familypn="A27";
}
if ($ultra eq "420R") {
$devname="Quahog";
$familypn="A33";
}
if ($ultra eq "Netra t140x") {
$devname="Lightweight 3";
$familypn="N14 (Netra t1405), N15 (Netra t1400)";
}
$untested=0;
$simmrangex="00000400";
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(64,256); # Sun only supports 64MB and 256MB DIMMs
@socketstr=("U0301","U0302","U1301","U1302","U0401","U0402","U1401","U1402","U0303","U0304","U1303","U1304","U0403","U0404","U1403","U1404");
@bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
}
if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20") {
# Accepts up to 8 128MB, 256MB, 512MB, 1GB or 2GB DIMMs installed in
# groups of four DIMMs per bank on motherboard
# Uses 232-pin 3.3V ECC 7ns SDRAM
# J0407 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff
# J0406 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff
# J0305 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff
# J0304 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff
# J0203 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff
# J0202 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff
# J0101 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff
# J0100 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff
# The minimum memory requirement is four DIMMs in any Group
# DIMMs can be installed in any group order
# Each group addresses 4GB of memory
# Memory slots (Jxxxx) map to same-numbered DIMMs (Uxxxx)
# For maximum 4-way interleaving, install 8 DIMMs of identical sizes
$devname="Excalibur (Sun Blade 1000), Littleneck (Sun Fire 280R), Lightweight 2+ (Netra 20/Netra T4), Sun Blade 2000 (Sun Blade 2000)";
$familypn="A28 (Sun Blade 1000), A35 (Sun Fire 280R), N28 (Netra 20/Netra T4), A29 (Sun Blade 2000)";
if ($ultra eq "Sun Blade 1000") {
$devname="Excalibur (Sun Blade 1000), Sun Blade 2000 (Sun Blade 2000)";
$familypn="A28 (Sun Blade 1000), A29 (Sun Blade 2000)";
}
if ($ultra eq "Sun Fire 280R") {
$devname="Littleneck";
$familypn="A35";
}
if ($ultra eq "Netra 20") {
$devname="Lightweight 2+";
$familypn="N28";
}
if ($ultra eq "Sun Blade 2000") {
$devname="Sun Blade 2000";
$familypn="A29";
}
$untested=0;
# SB1000/2000 uses 501-4143, 501-5938, 501-6230 or 501-6560 motherboards
# SB1000 can use 600, 750 and 900MHz UltraSPARC-III CPUs
# SB1000 can use 900MHz and faster UltraSPARC-III+ Cu CPUs
# SB2000 only shipped with 900MHz and faster UltraSPARC-III+ Cu CPUs
# SB2000 can use any of the SB1000 motherboards
if ($ultra eq "Sun Blade 1000") {
$modelmore=$banner;
$modelmore=~s/Sun-Blade-1000/or Sun-Blade-2000/g;
$modelmore=~s/\s+$//;
while (($cf,$cnt)=each(%cpucnt)) {
$cf=~/^(.*) (\d*)$/;
$cfreq=$2;
$modelmore=~s/\)/ ${cfreq}MHz\)/g if ($cfreq);
}
}
$prtdiag_has_mem=1;
$simmrangex="00001000";
$simmbanks=2;
$simmsperbank=4;
@simmsizes=(128,256,512,1024,2048);
@socketstr=("J0100","J0202","J0304","J0406","J0101","J0203","J0305","J0407");
@bankstr=(0,0,0,0,1,1,1,1);
}
if ($model eq "Sun-Blade-100" || $ultra eq "Sun Blade 100" || $ultra eq "Sun Blade 150") {
# Accepts 128MB, 256MB or 512MB DIMMs on motherboard
# Uses 168-pin 3.3V ECC PC133 CL=3 SDRAM
# U5 DIMM3 address 0x60000000 - 0x7fffffff or 0xc0000000 - 0xffffffff
# U4 DIMM2 address 0x40000000 - 0x5fffffff or 0x80000000 - 0xbfffffff
# U3 DIMM1 address 0x20000000 - 0x3fffffff or 0x40000000 - 0x7fffffff
# U2 DIMM0 address 0x00000000 - 0x1fffffff or 0x00000000 - 0x3fffffff
# The minimum memory requirement is one DIMM in U2
# The memory installation sequence is U2, U3, U4, U5
# Each bank addresses 512MB of memory with 500MHz UltraSPARC
# Each bank addresses 1GB of memory with >= 550MHz UltraSPARC
if ($model eq "Sun-Blade-100" || $ultra eq "Sun Blade 100") {
$devname="Grover";
$familypn="A36";
}
if ($ultra eq "Sun Blade 150") {
$devname="Grover+";
$familypn="A41";
}
$untested=0;
$prtdiag_has_mem=1;
$simmrangex=($cpufreq > 520) ? "00000400" : "00000200";
$simmbanks=4;
$simmsperbank=1;
@simmsizes=(128,256,512);
@socketstr=("DIMM0".."DIMM3");
@bankstr=(0..3);
}
if ($ultra eq "Sun Fire" || $ultra eq "Sun Fire 15K" || $ultra eq "Sun Fire 12K" || $ultra =~ /Sun Fire [346]8[01]0\b/ || $ultra =~ /Sun Fire E[246]900\b/ || $ultra =~ /Sun Fire E2[05]K\b/) {
# Sun Fire 3800 system
# 2-8 UltraSPARC-III processors
# Up to 2 CPU/Memory boards
# Sun Fire 4800, 4810 and 6800 system
# 2-12 UltraSPARC-III processors
# Up to 3 CPU/Memory boards
# Sun Fire 6800 system
# 2-24 UltraSPARC-III processors
# Up to 6 CPU/Memory boards
# Sun Fire 15K system
# 16-106 UltraSPARC-III+, IV or IV+ processors
# Up to 18 CPU/Memory boards
# Sun Fire 12K system
# up to 56 UltraSPARC-III+, IV or IV+ processors and 288GB memory
# Sun Fire E2900 & E4900 system
# 4, 8, or 12 UltraSPARC-IV or IV+ processors, up to 3 Uniboards
# E4900 adds dynamic system domains when compared to E2900
# Sun Fire E6900 system
# 4-24 UltraSPARC-IV or IV+ processors, up to 6 Uniboards
# Sun Fire E20K system
# 4-36 UltraSPARC-IV or IV+ processors, up to 9 Uniboards
# Sun Fire E25K system
# Up to 72 UltraSPARC-IV or IV+ processors, up to 18 Uniboards
# Each CPU/Memory board holds up to 4 processors and up to 32GB memory
# (32 DIMMs per board, 8 banks of 4 DIMMs)
# Accepts 256MB, 512MB or 1GB DIMMs
# 1GB DIMM not supported at 750MHz
# 256MB DIMM only supported on US-III
# 2GB DIMMs supported on 48x0/6800/E2900/E4900/E6900/E20K/E25K
# System Board slots are labeled SB0 and higher
# A populated DIMM bank requires an UltraSPARC CPU.
# DIMMs are 232-pin 3.3V ECC 7ns SDRAM
# prtdiag output shows the memory installed.
#
# CPU1 and CPU0 Memory CPU3 and CPU2 Memory
# -------------------- --------------------
# Socket CPU Bank DIMM Socket CPU Bank DIMM
# ------ --- ---- ---- ------ --- ---- ----
# J14600 P1 B0 D3 J16600 P3 B0 D3
# J14601 P1 B1 D3 J16601 P3 B1 D3
# J14500 P1 B0 D2 J16500 P3 B0 D2
# J14501 P1 B1 D2 J16501 P3 B1 D2
# J14400 P1 B0 D1 J16400 P3 B0 D1
# J14401 P1 B1 D1 J16401 P3 B1 D1
# J14300 P1 B0 D0 J16300 P3 B0 D0
# J14301 P1 B1 D0 J16301 P3 B1 D0
# J13600 P0 B0 D3 J15600 P2 B0 D3
# J13601 P0 B1 D3 J15601 P2 B1 D3
# J13500 P0 B0 D2 J15500 P2 B0 D2
# J13501 P0 B1 D2 J15501 P2 B1 D2
# J13400 P0 B0 D1 J15400 P2 B0 D1
# J13401 P0 B1 D1 J15401 P2 B1 D1
# J13300 P0 B0 D0 J15300 P2 B0 D0
# J13301 P0 B1 D0 J15301 P2 B1 D0
#
$devname="Serengeti" if ($ultra eq "Sun Fire");
if ($banner =~ /Sun Fire 3800\b/ || $diagbanner =~ /Sun Fire 3800\b/) {
$devname="Serengeti8, SF3800 or SP";
$familypn="F3800";
}
if ($banner =~ /Sun Fire 4800\b/ || $diagbanner =~ /Sun Fire 4800\b/) {
$devname="Serengeti12, SF4800 or MD";
$familypn="F4800";
}
if ($banner =~ /Sun Fire 4810\b/ || $diagbanner =~ /Sun Fire 4810\b/) {
$devname="Serengeti12i, SF4810 or ME";
$familypn="F4810";
}
if ($banner =~ /Sun Fire 6800\b/ || $diagbanner =~ /Sun Fire 6800\b/) {
$devname="Serengeti24, SF6800 or DC";
$familypn="F6800";
}
if ($ultra eq "Sun Fire 15K") {
$devname="Starcat, Serengeti72";
$familypn="F15K";
}
$devname="Starkitty" if ($ultra eq "Sun Fire 12K");
if ($banner =~ /Sun Fire E2900\b/ || $diagbanner eq "Sun Fire E2900") {
$devname="Amazon 2";
$familypn="E29";
}
if ($banner =~ /Sun Fire E4900\b/ || $diagbanner eq "Sun Fire E4900") {
$devname="Amazon 4";
$familypn="E49";
}
$devname="Amazon 6" if ($banner =~ /Sun Fire E6900\b/ || $diagbanner eq "Sun Fire E6900");
$devname="Amazon 20" if ($banner =~ /Sun Fire E20K\b/ || $diagbanner eq "Sun Fire E20K");
$devname="Amazon 25" if ($banner =~ /Sun Fire E25K\b/ || $diagbanner eq "Sun Fire E25K");
$untested=0;
$prtdiag_has_mem=1;
@simmsizes=(256,512,1024);
@simmsizes=(256,512,1024,2048) if ($ultra =~ /Sun Fire [46]8[01]0\b/ || $ultra =~ /Sun Fire E[246]900\b/ || $ultra =~ /Sun Fire E2[05]K\b/);
}
if ($ultra eq "Sun Fire V880") {
# Accepts 128MB, 256MB, 512MB or 1GB DIMMs in groups of four per CPU
# 128MB DIMMs only supported on 750MHz CPU/memory boards
# 1GB DIMMs only supported on 900MHz or faster CPU/memory boards
# 2-8 UltraSPARC-III processors, 750MHz or faster
# Up to 64GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board
# DIMMs must be added four-at-a-time within the same group of DIMM
# slots; every fourth slot belongs to the same DIMM group.
# Each CPU/Memory board must be populated with a minimum of eight DIMMs,
# installed in groups A0 and B0.
# For 1050MHz and higher system boards, each CPU/Memory board must be
# populated with all sixteen DIMMs, installed in groups A0,A1,B0,B1.
# Each group used must have four identical DIMMs installed (all four
# DIMMs must be from the same manufacturing vendor and must have the
# same capacity).
# DIMMs are 232-pin 3.3V ECC 7ns SDRAM
# Uses 128-bit-wide path to memory, 150MHz DIMMs, 2.4GB/sec
# bandwidth to processor and an aggregate memory bw of 9.6GB/sec
# prtdiag output shows the memory installed.
#
# CPU CPU/Memory Slot Associated DIMM Group
# --- --------------- ---------------------
# 0 Slot A A0,A1
# 2 Slot A B0,B1
# 1 Slot B A0,A1
# 3 Slot B B0,B1
# 4 Slot C A0,A1
# 6 Slot C B0,B1
# 5 Slot D A0,A1
# 7 Slot D B0,B1
#
$devname="Daktari (V880), Nandi (V880z)";
$familypn="A30 (V880), A47 (V880z)";
$untested=0;
@simmsizes=($cpufreq < 800) ? (128,256,512) : (256,512,1024,2048);
@banksstr=("A0","A1","B0","B1");
$prtdiag_has_mem=1;
}
if ($ultra eq "Sun Fire V480") {
# Accepts 256MB, 512MB or 1GB DIMMs in groups of four per CPU
# 2 or 4 UltraSPARC-III processors, 900MHz or faster
# Up to 32GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board
# Smaller version of Sun Fire V880 above
$devname="Cherrystone";
$familypn="A37";
$untested=0;
@simmsizes=(256,512,1024,2048);
@banksstr=("A0","A1","B0","B1");
$prtdiag_has_mem=1;
}
if ($ultra eq "Sun Fire V490" || $ultra eq "Sun Fire V890") {
# Accepts 512MB or 1GB DIMMs in groups of four per CPU
# 2 or 4 UltraSPARC-III, IV or IV+ processors, 1050MHz or faster
# Up to 32GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board
# Similar memory contraints as Sun Fire V880 above
if ($ultra eq "Sun Fire V490") {
$devname="Sebring";
$familypn="A52";
}
if ($ultra eq "Sun Fire V890") {
$devname="Silverstone";
$familypn="A53";
}
$untested=0;
@simmsizes=(512,1024,2048);
@banksstr=("A0","A1","B0","B1");
$prtdiag_has_mem=1;
}
if ($ultra eq "Netra T12") {
# Sun Fire V1280, Netra 1280
# Essentially the same as a Sun Fire 4810, but is marketed as a low cost
# single domain system.
# 2-12 UltraSPARC-IIIcu processors using up to 3 CPU/Memory boards
# Each CPU/Memory board holds up to 4 processors and up to 32GB memory
# (32 DIMMs per board, 8 banks of 4 DIMMs)
# Accepts 256MB, 512MB, 1GB or 2GB DIMMs
# System Board slots are labeled SB0 and higher
# A populated DIMM bank requires an UltraSPARC III CPU.
# DIMMs are 232-pin 3.3V ECC 7ns SDRAM
# prtdiag output shows the memory installed.
$devname="Lightweight 8";
$familypn="A40 (Sun Fire V1280), N40 (Netra 1280)";
$untested=0;
$prtdiag_has_mem=1;
@simmsizes=(256,512,1024,2048);
}
if ($ultra eq "Enchilada") {
# Sun Fire V210, V240, Netra 210, 240
# 1-2 UltraSPARC-IIIi (Jalapeno) processors
# UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
# UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
# DDR-1 SDRAM PC2100 DIMMs, 8 DIMM slots, 4 DIMMs per processor,
# 2 banks per processor, 2 DIMMs per bank
# V210 accepts 1GB & 2GB DIMMs by installing Fan Upgrade Kit, X7418A
# Mixing DIMM sizes and capacities is not supported.
# prtdiag output can show the memory installed.
$devname="Enchilada"; # Enxs
if ($banner =~ /Sun Fire V210\b/ || $model =~ /Sun-Fire-V210/) {
$devname="Enchilada 1U";
$familypn="N31";
}
if ($model =~ /Netra-210\b/) {
$devname="Salsa 19";
$familypn="N79";
}
if ($banner =~ /Sun Fire V240\b/ || $model =~ /Sun-Fire-V240/) {
$devname="Enchilada 2U";
$familypn="N32";
}
if ($model =~ /Netra-240\b/) {
$devname="Enchilada 19";
$familypn="N54";
}
$untested=0 if ($banner =~ /Sun Fire V210\b/ || $model =~ /Sun-Fire-V210/ || $model =~ /Netra-210\b/ || $banner =~ /Sun Fire 240\b/ || $model =~ /Sun-Fire-V240/ || $model =~ /Netra-240\b/);
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
# Count the skipped address range for dual CPU
$simmbanks=($ncpu > 1) ? 10 : 2;
$simmsperbank=2;
@simmsizes=(128,256,512,1024,2048);
@socketstr=("MB/P0/B0/D0","MB/P0/B0/D1","MB/P0/B1/D0","MB/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?");
push(@socketstr, "MB/P1/B0/D0","MB/P1/B0/D1","MB/P1/B1/D0","MB/P1/B1/D1") if ($ncpu > 1);
}
if ($ultra eq "Sun Fire V440" || $ultra eq "Netra 440") {
# 1-4 UltraSPARC-IIIi (Jalapeno) processors
# UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
# UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
# DDR-1 SDRAM PC2100 DIMMs, 16 DIMM slots, 4 DIMMs per processor,
# 2 banks per processor, 2 DIMMs per bank
# prtdiag output can show the memory installed.
$devname="Chalupa";
$familypn="A42";
if ($ultra eq "Netra 440") {
$devname="Chalupa 19";
$familypn="N42";
}
$untested=0;
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
$simmbanks=26; # Count the skipped address range for each CPU
$simmsperbank=2;
@simmsizes=(128,256,512,1024,2048);
# Each CPU card has 4 DIMM slots labeled J0601 (B0/D0), J0602 (B0/D1),
# J0701 (B1/D0) and J0702 (B1/D1).
@socketstr=("C0/P0/B0/D0","C0/P0/B0/D1","C0/P0/B1/D0","C0/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?");
push(@socketstr, "C1/P0/B0/D0","C1/P0/B0/D1","C1/P0/B1/D0","C1/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?") if ($ncpu > 1);
push(@socketstr, "C2/P0/B0/D0","C2/P0/B0/D1","C2/P0/B1/D0","C2/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?") if ($ncpu > 2);
push(@socketstr, "C3/P0/B0/D0","C3/P0/B0/D1","C3/P0/B1/D0","C3/P0/B1/D1") if ($ncpu > 3);
}
if ($ultra eq "Sun Blade 1500") {
# 1 UltraSPARC-IIIi (Jalapeno) processor
# UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
# UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
# 184-pin DDR-1 SDRAM PC2100 DIMMs installed in pairs, 4 DIMM slots
# prtdiag output can show the memory installed.
$devname="Taco";
$devname .= "+" if ($modelmore =~ /\(Silver\)/ || $banner =~ /\(Silver\)/);
$familypn="A43";
$untested=0;
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
$simmbanks=2;
$simmsperbank=2;
@simmsizes=(128,256,512,1024,2048);
@socketstr=("DIMM0".."DIMM3"); # DIMM1-DIMM4 on prototype
}
if ($ultra eq "Sun Blade 2500" || $ultra eq "Sun Fire V250") {
# 1-2 UltraSPARC-IIIi (Jalapeno) processors
# UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
# UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
# 184-pin DDR-1 SDRAM PC2100 DIMMs, 8 DIMM slots, 4 DIMMs per processor,
# 2 banks per processor, 2 DIMMs per bank
# prtdiag output can show the memory installed.
if ($ultra eq "Sun Blade 2500") {
$devname="Enchilada Workstation";
$devname .= " Silver" if ($modelmore =~ /\(Silver\)/ || $banner =~ /\(Silver\)/);
$familypn="A39";
}
if ($ultra eq "Sun Fire V250") {
$devname="Enchilada 2P Tower";
$familypn="A50";
}
$untested=0;
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
# Count the skipped address range for dual CPU
$simmbanks=($ncpu > 1) ? 20 : 2;
$simmsperbank=2;
@simmsizes=(128,256,512,1024,2048);
if ($ultra eq "Sun Blade 2500") {
@socketstr=("DIMM0".."DIMM3");
push(@socketstr, "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "DIMM4".."DIMM7") if ($ncpu > 1);
} else {
@socketstr=("MB/DIMM0","MB/DIMM1","MB/DIMM2","MB/DIMM3");
push(@socketstr, "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "MB/DIMM4","MB/DIMM5","MB/DIMM6","MB/DIMM7") if ($ncpu > 1);
}
}
if ($ultra eq "Sun Ultra 45 Workstation" || $ultra eq "Sun Ultra 45 or Ultra 25 Workstation") {
# 1-2 UltraSPARC-IIIi (Jalapeno) 1.6GHz processors
# 1GB to 16GB of DDR1 SDRAM 266 or 333MHz registered ECC memory using
# matched pairs of 512MB, 1GB and 2GB DIMMs
# maximum of 4 DIMMs (8GB) per CPU
# CPU0 Bank0 DIMM1&DIMM3 blue sockets, Bank1 DIMM0&DIMM2 black sockets
# CPU1 Bank0 DIMM4&DIMM6 blue sockets, Bank1 DIMM5&DIMM7 black sockets
# prtdiag output can show the memory installed.
$devname="Chicago"; # also "Netra Salsa-19" development name
$familypn="A70";
$untested=0;
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
# Count the skipped address range for dual CPU
$simmbanks=($ncpu > 1) ? 20 : 2;
$simmsperbank=2;
@simmsizes=(512,1024,2048);
@socketstr=("MB/DIMM1","MB/DIMM3","MB/DIMM0","MB/DIMM2");
push(@socketstr, "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "MB/DIMM4","MB/DIMM6","MB/DIMM5","MB/DIMM7") if ($ncpu > 1);
}
if ($ultra eq "Sun Ultra 25 Workstation") {
# 1 UltraSPARC-IIIi (Jalapeno) 1.34GHz processors
# 1GB to 8GB of DDR1 SDRAM 266 or 333MHz registered ECC memory using
# matched pairs of 512MB, 1GB and 2GB DIMMs
# maximum of 4 DIMMs (8GB)
# Bank0 DIMM1&DIMM3 blue sockets, Bank1 DIMM0&DIMM2 black sockets
# prtdiag output can show the memory installed.
$devname="Southside";
$familypn="A89";
$untested=0;
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
$simmbanks=2;
$simmsperbank=2;
@simmsizes=(512,1024,2048);
@socketstr=("MB/DIMM1","MB/DIMM3","MB/DIMM0","MB/DIMM2");
}
if ($ultra eq "Sun Fire V125") {
# 1 UltraSPARC-IIIi (Jalapeno) processor
# UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
# UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
# DDR-1 SDRAM PC2100 DIMMs, 4 DIMM slots, 2 DIMMs per bank
# Mixing DIMM sizes and capacities is not supported.
# prtdiag output can show the memory installed.
$devname="El Paso";
$familypn="125";
$untested=0;
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
$simmbanks=2;
$simmsperbank=2;
@simmsizes=(128,256,512,1024,2048);
@socketstr=("MB/P0/B0/D0","MB/P0/B0/D1","MB/P0/B1/D0","MB/P0/B1/D1");
}
if ($ultra eq "Seattle") {
# Sun Fire V215, V245
# 1-2 UltraSPARC-IIIi (Jalapeno) processors
# UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
# UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
# DDR-1 SDRAM PC2100 DIMMs, 8 DIMM slots, 4 DIMMs per processor,
# 2 banks per processor, 2 DIMMs per bank
# Mixing DIMM sizes and capacities is not supported.
# prtdiag output can show the memory installed.
$devname="Seattle"; # Enxs
if ($banner =~ /Sun Fire V215\b/ || $model =~ /Sun-Fire-V215/) {
$devname="Seattle 1U";
$familypn="215";
}
if ($banner =~ /Sun Fire V245\b/ || $model =~ /Sun-Fire-V245/) {
$devname="Seattle 2U";
$familypn="245";
}
$untested=0;
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
# Count the skipped address range for dual CPU
$simmbanks=($ncpu > 1) ? 10 : 2;
$simmsperbank=2;
@simmsizes=(128,256,512,1024,2048);
@socketstr=("MB/P0/B0/D0","MB/P0/B0/D1","MB/P0/B1/D0","MB/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?");
push(@socketstr, "MB/P1/B0/D0","MB/P1/B0/D1","MB/P1/B1/D0","MB/P1/B1/D1") if ($ncpu > 1);
}
if ($ultra eq "Boston") {
# Sun Fire V445
# 2-4 UltraSPARC-IIIi (Jalapeno) processors
# UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
# UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
# DDR-1 SDRAM PC2100 DIMMs, 16 DIMM slots, 4 DIMMs per processor,
# 2 banks per processor, 2 DIMMs per bank
# prtdiag output can show the memory installed.
$devname="Boston";
$familypn="445, A77";
$untested=0;
$prtdiag_has_mem=1;
$prtdiag_banktable_has_dimms=1;
$simmrangex="00002000";
$simmbanks=26; # Count the skipped address range for each CPU
$simmsperbank=2;
@simmsizes=(128,256,512,1024,2048);
# Each CPU card has 4 DIMM slots labeled J0601 (B0/D0), J0602 (B0/D1),
# J0701 (B1/D0) and J0702 (B1/D1).
@socketstr=("C0/P0/B0/D0","C0/P0/B0/D1","C0/P0/B1/D0","C0/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?");
push(@socketstr, "C1/P0/B0/D0","C1/P0/B0/D1","C1/P0/B1/D0","C1/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?") if ($ncpu > 1);
push(@socketstr, "C2/P0/B0/D0","C2/P0/B0/D1","C2/P0/B1/D0","C2/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?") if ($ncpu > 2);
push(@socketstr, "C3/P0/B0/D0","C3/P0/B0/D1","C3/P0/B1/D0","C3/P0/B1/D1") if ($ncpu > 3);
}
if ($ultra eq "Serverblade1") {
# Sun Fire B100s Blade Server
# 1 UltraSPARC-IIi 650MHz processors
# Two PC-133 DIMM slots holding up to 2GB memory
# Up to 16 Blade Servers in a single B1600 Intelligent Shelf
# prtdiag output shows the memory installed.
$bannermore="(Sun Fire B100s Blade Server)";
$modelmore=$bannermore;
$devname="Stiletto";
$familypn="A44";
$untested=0;
$prtdiag_has_mem=1;
$simmrangex="00000400";
$simmbanks=2;
$simmsperbank=1;
@simmsizes=(256,512,1024);
@socketstr=("Blade/DIMM0","Blade/DIMM1");
}
if ($ultra eq "T2000") {
# 1 UltraSPARC-T1 (Niagara) processor with "CoolThreads" multithreading
# 8 Core 1.2GHz (9.6GHz clock speed rating) or 4, 6, or 8 Core 1.0GHz
# or 8 Core 1.4GHz
# Up to 64GB DDR2 memory in 16 slots w/ Chipkill and DRAM sparing, ECC
# registered DIMMs. Supports 512MB, 1GB, 2GB and 4GB DIMMs.
# Option X7800A - 1GB (2x512MB DDR2) 370-6207, 512MB DDR2 DIMM, 533MHz
# Option X7801A - 2GB (2x1GB DDR2) 370-6208, 1GB DDR2 DIMM, 533MHz
# Option X7802A - 4GB (2x2GB DDR2) 370-6209, 2GB DDR2 DIMM, 533MHz
# DIMMs must be installed in sets of 8. Two basic memory configurations
# are supported: 8-DIMM or 16-DIMM. All DIMMs must have identical
# capacity. An 8 DIMM configuration fully populates Rank 0 (R0) slots.
# Base configurations sold by Sun use all 16 DIMM slots (2 ranks) except
# smallest memory configuration (4GB, 8 x 512MB in Rank 0).
# The minimum T2000 memory requirement is 8 Rank 0 DIMMs.
# 4 memory controllers embedded in UltraSPARC-T1 (CH0-CH3)
#
# T2000 Memory Map
# +----------------------------------------+
# | J0901 Channel 0 Rank 1 DIMM 1 | DIMM 1
# Install 1st | J0701 Channel 0 Rank 0 DIMM 1 | DIMM 2
# | J0801 Channel 0 Rank 1 DIMM 0 | DIMM 3
# Install 1st | J0601 Channel 0 Rank 0 DIMM 0 | DIMM 4
# | J1401 Channel 1 Rank 1 DIMM 1 | DIMM 5
# Install 1st | J1201 Channel 1 Rank 0 DIMM 1 | DIMM 6
# | J1301 Channel 1 Rank 1 DIMM 0 | DIMM 7
# Install 1st | J1101 Channel 1 Rank 0 DIMM 0 | DIMM 8
# +----------------------------------------+
# +---------------+
# | UltraSPARC T1 |
# +---------------+
# +----------------------------------------+
# Install 1st | J2101 Channel 3 Rank 0 DIMM 0 | DIMM 9
# | J2301 Channel 3 Rank 1 DIMM 0 | DIMM 10
# Install 1st | J2201 Channel 3 Rank 0 DIMM 1 | DIMM 11
# | J2401 Channel 3 Rank 1 DIMM 1 | DIMM 12
# Install 1st | J1601 Channel 2 Rank 0 DIMM 0 | DIMM 13
# | J1801 Channel 2 Rank 1 DIMM 0 | DIMM 14
# Install 1st | J1701 Channel 2 Rank 0 DIMM 1 | DIMM 15
# | J1901 Channel 2 Rank 1 DIMM 1 | DIMM 16
# +----------------------------------------+
$devname="Ontario";
$familypn="T20";
if ($model =~ /Netra-T2000\b/ || $banner =~ /Netra T2000\b/) {
$devname="Pelton";
$familypn="N20";
}
$familypn="T20, SEB" if ($model =~ /SPARC-Enterprise-T2000/ || $banner =~ /SPARC Enterprise T2000/);
$untested=0;
$simmrangex="00002000";
if (scalar(@slots) == 8) {
# Two ranks reported
$simmbanks=2;
$simmsperbank=8;
} else {
# One rank reported, but default base configurations ship with
# two ranks (16 DIMMs)
$simmbanks=1;
$simmsperbank=16;
}
@simmsizes=(512,1024,2048,4096);
@socketstr=("MB/CMP0/CH0/R0/D0","MB/CMP0/CH0/R0/D1","MB/CMP0/CH1/R0/D0","MB/CMP0/CH1/R0/D1","MB/CMP0/CH2/R0/D0","MB/CMP0/CH2/R0/D1","MB/CMP0/CH3/R0/D0","MB/CMP0/CH3/R0/D1","MB/CMP0/CH0/R1/D0","MB/CMP0/CH0/R1/D1","MB/CMP0/CH1/R1/D0","MB/CMP0/CH1/R1/D1","MB/CMP0/CH2/R1/D0","MB/CMP0/CH2/R1/D1","MB/CMP0/CH3/R1/D0","MB/CMP0/CH3/R1/D1");
&check_for_LDOM;
}
if ($ultra eq "T1000") {
# 1 UltraSPARC-T1 (Niagara) processor with "CoolThreads" multithreading
# 6 or 8 Core 1.0GHz
# Up to 32GB DDR2 memory in 8 slots w/ Chipkill and DRAM sparing, ECC
# registered DIMMs. Supports 512MB, 1GB, 2GB and 4GB DIMMs.
# Option X7800A - 1GB (2x512MB DDR2) 370-6207, 512MB DDR2 DIMM, 533MHz
# Option X7801A - 2GB (2x1GB DDR2) 370-6208, 1GB DDR2 DIMM, 533MHz
# Option X7802A - 4GB (2x2GB DDR2) 370-6209, 2GB DDR2 DIMM, 533MHz
# DIMMs must be installed in sets of 4.
# Base configurations sold by Sun use all 8 DIMM slots (2 ranks) except
# smallest memory configuration (2GB, 4 x 512MB in Rank 0).
# The minimum T1000 memory requirement is 4 Rank 0 DIMMs.
# 4 memory controllers embedded in UltraSPARC-T1 (CH0-CH3)
#
# T1000 Memory Map
# +----------------------------------------+
# | J1301 Channel 3 Rank 1 DIMM 1 |
# Install 1st | J1101 Channel 3 Rank 0 DIMM 1 |
# | J1201 Channel 3 Rank 1 DIMM 0 |
# Install 1st | J1001 Channel 3 Rank 0 DIMM 0 |
# +----------------------------------------+
# +---------------+
# | UltraSPARC T1 |
# +---------------+
# +----------------------------------------+
# Install 1st | J0501 Channel 0 Rank 0 DIMM 0 |
# | J0701 Channel 0 Rank 1 DIMM 0 |
# Install 1st | J0601 Channel 0 Rank 0 DIMM 1 |
# | J0801 Channel 0 Rank 1 DIMM 1 |
# +----------------------------------------+
$devname="Erie";
$familypn="T10";
$familypn="T10, SEA" if ($model =~ /SPARC-Enterprise-T1000/ || $banner =~ /SPARC Enterprise T1000/);
$untested=0;
$simmrangex="00002000";
if (scalar(@slots) == 8) {
# Two ranks reported
$simmbanks=2;
$simmsperbank=4;
} else {
$simmbanks=1;
$simmsperbank=8;
}
@simmsizes=(512,1024,2048,4096);
@socketstr=("MB/CMP0/CH0/R0/D0","MB/CMP0/CH0/R0/D1","MB/CMP0/CH3/R0/D0","MB/CMP0/CH3/R0/D1","MB/CMP0/CH0/R1/D0","MB/CMP0/CH0/R1/D1","MB/CMP0/CH3/R1/D0","MB/CMP0/CH3/R1/D1");
&check_for_LDOM;
}
if ($ultra eq "T6300") {
# 1 UltraSPARC-T1 (Niagara) processor with "CoolThreads" multithreading
# 6-Core 1.0GHz, 8-Core 1.0GHz, 1.2GHz or 1.4GHz
# Up to 32GB ECC Registered DDR2 PC4200
# Supports 1GB, 2GB and 4GB DIMMs.
# DIMMs must be installed in sets of 4.
# Supported memory configurations:
# 4 FB-DIMMs (Channel 0 and Channel 3)
# 4 FB-DIMMs (Channel 1 and Channel 2)
# 8 FB-DIMMs (Channel 0, 1, 2 and 3) (fully populated configuration)
# Due to interleaving rules for the CPU, the system will operate at
# the lowest capacity of all the DIMMs installed. Therefore, it is
# ideal to install eight identical DIMMs (not four DIMMs of one
# capacity and four DIMMs of another capacity).
$devname="St. Paul";
$familypn="A94";
$untested=0;
$memtype="FB-DIMM";
$simmrangex="00002000";
$showrange=0;
$simmbanks=2;
$simmsperbank=4;
@simmsizes=(1024,2048,4096);
@socketstr=("MB/CMP0/CH0/R0/D0","MB/CMP0/CH0/R0/D1","MB/CMP0/CH3/R0/D0","MB/CMP0/CH3/R0/D1","MB/CMP0/CH1/R0/D0","MB/CMP0/CH1/R0/D1","MB/CMP0/CH2/R0/D0","MB/CMP0/CH2/R0/D1");
@socketlabelstr=("J6301","J6401","J7201","J7301","J6601","J6701","J6901","J7001");
&check_for_LDOM;
}
if ($ultra eq "T5120" || $ultra eq "T5220" || $ultra eq "T6320") {
# 1 UltraSPARC-T2 (Niagara-II) multicore processor with "CoolThreads"
# multithreading, 1.2GHz 4 or 8-Core or 1.4GHz 8-Core
# Up to 64GB Fully Buffered ECC-registered DDR2 @ 667MHz
# Supports 1GB, 2GB and 4GB DIMMs.
# DIMMs must be installed in sets of 4.
# All FB-DIMMs must be the same density (same type and Sun part number)
# Supported memory configurations:
# 4 FB-DIMMs (Group 1) MB/CMP0/BR[0-3]/CH0/D0
# 8 FB-DIMMs (Groups 1-2) MB/CMP0/BR[0-3]/CH[01]/D0
# 16 FB-DIMMs (Groups 1-3) MB/CMP0/BR[0-3]/CH[01]/D[01]
#
# FB-DIMM Configuration:
# Install FB-DIMM
# Branch Channel FRU Name FB-DIMM Order Pair
#
# 0 0 MB/CMP0/BR0/CH0/D0 J1001 1 A
# MB/CMP0/BR0/CH0/D1 J1101 3 B
# 1 MB/CMP0/BR0/CH1/D0 J1201 2 A
# MB/CMP0/BR0/CH1/D1 J1301 3 B
# 1 0 MB/CMP0/BR1/CH0/D0 J1401 1 C
# MB/CMP0/BR1/CH0/D1 J1501 3 D
# 1 MB/CMP0/BR1/CH1/D0 J1601 2 C
# MB/CMP0/BR1/CH1/D1 J1701 3 D
# 2 0 MB/CMP0/BR2/CH0/D0 J2001 1 E
# MB/CMP0/BR2/CH0/D1 J2101 3 F
# 1 MB/CMP0/BR2/CH1/D0 J2201 2 E
# MB/CMP0/BR2/CH1/D1 J2301 3 F
# 3 0 MB/CMP0/BR3/CH0/D0 J2401 1 G
# MB/CMP0/BR3/CH0/D1 J2501 3 H
# 1 MB/CMP0/BR3/CH1/D0 J2601 2 G
# MB/CMP0/BR3/CH1/D1 J2701 3 H
#
# Note - FB-DIMM names in ILOM messages are displayed with the full FRU
# name, such as /SYS/MB/CMP0/BR0/CH0/D0.
$devname="Huron";
if ($ultra eq "T5120") {
$devname="Huron 1U";
$familypn="SEC";
}
if ($ultra eq "T5220") {
$devname="Huron 2U";
$familypn="SED";
}
if ($banner =~ /Netra T5220\b/) {
$devname="Turgo";
$familypn="NT52";
}
if ($ultra eq "T6320") {
$devname="Glendale";
$familypn="A95";
}
$untested=0;
$memtype="FB-DIMM";
$simmrangex="00004000";
$showrange=0;
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(1024,2048,4096);
@socketstr=("MB/CMP0/BR0/CH0/D0","MB/CMP0/BR1/CH0/D0","MB/CMP0/BR2/CH0/D0","MB/CMP0/BR3/CH0/D0","MB/CMP0/BR0/CH1/D0","MB/CMP0/BR1/CH1/D0","MB/CMP0/BR2/CH1/D0","MB/CMP0/BR3/CH1/D0","MB/CMP0/BR0/CH0/D1","MB/CMP0/BR1/CH0/D1","MB/CMP0/BR2/CH0/D1","MB/CMP0/BR3/CH0/D1","MB/CMP0/BR0/CH1/D1","MB/CMP0/BR1/CH1/D1","MB/CMP0/BR2/CH1/D1","MB/CMP0/BR3/CH1/D1");
&check_for_LDOM;
}
if ($ultra eq "T5140" || $ultra eq "T5240" || $ultra eq "T6340") {
# T5140 has 2 UltraSPARC-T2+ (Victoria Falls) multicore processors with
# "CoolThreads" multithreading, 1.2GHz 4, 6, or 8-Core
# T5240 has 2 UltraSPARC-T2+ (Victoria Falls) multicore processors with
# "CoolThreads" multithreading, 1.2GHz 4, 6, or 8-Core or 1.4GHz 8-Core
# T6340 has 2 UltraSPARC-T2+ (Victoria Falls) multicore processors with
# "CoolThreads" multithreading, 1.4GHz 8-Core
# 8GB to 64GB Fully Buffered ECC-registered DDR2 @ 667MHz
# Supports 1GB, 2GB and 4GB DIMMs.
# T5240 also supports optional mezzanine memory board doubling memory
# with an additional 16 FB-DIMM sockets
# All FB-DIMMs must be the same density (same type and Sun part number)
#
# T5140,T5240 Supported memory configurations:
# 8 FB-DIMMs (Group 1) MB/CMP[01]/BR[01]/CH[01]/D0
# 12 FB-DIMMs (Groups 1-2) MB/CMP[01]/BR[01]/CH[01]/D0,MB/CMP0/BR[01]/CH[01]/D1
# 16 FB-DIMMs (Groups 1-3) MB/CMP[01]/BR[01]/CH[01]/D[01]
# T5240 with memory mezzanine assembly supports these additional
# memory configurations once the motherboard is fully populated:
# 24 FB-DIMMs (Groups 1-4) MB/CMP[01]/MR0/BR[01]/CH[01]/D[23]
# 32 FB-DIMMs (Groups 1-5) MB/CMP[01]/MR[01]/BR[01]/CH[01]/D[23]
#
# FB-DIMM Configuration:
# Install FB-DIMM
# Branch Channel FRU Name FB-DIMM Order Pair
#
# CMP0,0 0 MB/CMP0/BR0/CH0/D0 J0500 1 A
# MB/CMP0/BR0/CH0/D1 J0600 2 B
# 1 MB/CMP0/BR0/CH1/D0 J0700 1 A
# MB/CMP0/BR0/CH1/D1 J0800 2 B
# CMP0,1 0 MB/CMP0/BR1/CH0/D0 J0900 1 C
# MB/CMP0/BR1/CH0/D1 J1000 2 D
# 1 MB/CMP0/BR1/CH1/D0 J1100 1 C
# MB/CMP0/BR1/CH1/D1 J1200 2 D
# CMP1,0 0 MB/CMP1/BR0/CH0/D0 J1800 1 E
# MB/CMP1/BR0/CH0/D1 J1900 3 F
# 1 MB/CMP1/BR0/CH1/D0 J2000 1 E
# MB/CMP1/BR0/CH1/D1 J2100 3 F
# CMP1,1 0 MB/CMP1/BR1/CH0/D0 J2200 1 G
# MB/CMP1/BR1/CH0/D1 J2300 3 H
# 1 MB/CMP1/BR1/CH1/D0 J2400 1 G
# MB/CMP1/BR1/CH1/D1 J2500 3 H
# CMP0,0 0 MB/CMP0/MR0/BR0/CH0/D2 J0201 4
# MB/CMP0/MR0/BR0/CH0/D3 J0301 4
# 1 MB/CMP0/MR0/BR0/CH1/D2 J0401 4
# MB/CMP0/MR0/BR0/CH1/D3 J0501 4
# CMP0,1 0 MB/CMP0/MR0/BR1/CH0/D2 J0601 4
# MB/CMP0/MR0/BR1/CH0/D3 J0701 4
# 1 MB/CMP0/MR0/BR1/CH1/D2 J0801 4
# MB/CMP0/MR0/BR1/CH1/D3 J0901 4
# CMP1,0 0 MB/CMP1/MR1/BR0/CH0/D2 J0201 5
# MB/CMP1/MR1/BR0/CH0/D3 J0301 5
# 1 MB/CMP1/MR1/BR0/CH1/D2 J0401 5
# MB/CMP1/MR1/BR0/CH1/D3 J0501 5
# CMP1,1 0 MB/CMP1/MR1/BR1/CH0/D2 J0601 5
# MB/CMP1/MR1/BR1/CH0/D3 J0701 5
# 1 MB/CMP1/MR1/BR1/CH1/D2 J0801 5
# MB/CMP1/MR1/BR1/CH1/D3 J0901 5
#
# Note - FB-DIMM names in ILOM messages are displayed with the full FRU
# name, such as /SYS/MB/CMP0/BR0/CH0/D0.
$devname="Maramba";
if ($ultra eq "T5140") {
$devname="Maramba 1U";
$familypn="SET";
}
if ($ultra eq "T5240") {
$devname="Maramba 2U";
$familypn="SEU";
}
$untested=0;
if ($model =~ /Sun-USBRDT-5240/) {
$devname="Thunder";
$untested=1;
}
$devname="Scottsdale" if ($ultra eq "T6340");
$memtype="FB-DIMM";
$simmrangex="00004000";
$showrange=0;
$simmbanks=4;
$simmbanks=8 if ($ultra eq "T5240");
$simmsperbank=4;
@simmsizes=(1024,2048,4096);
@socketstr=("MB/CMP0/BR0/CH0/D0","MB/CMP0/BR0/CH1/D0","MB/CMP0/BR1/CH0/D0","MB/CMP0/BR1/CH1/D0","MB/CMP1/BR0/CH0/D0","MB/CMP1/BR0/CH1/D0","MB/CMP1/BR1/CH0/D0","MB/CMP1/BR1/CH1/D0","MB/CMP0/BR0/CH0/D1","MB/CMP0/BR0/CH1/D1","MB/CMP0/BR1/CH0/D1","MB/CMP0/BR1/CH1/D1","MB/CMP1/BR0/CH0/D1","MB/CMP1/BR0/CH1/D1","MB/CMP1/BR1/CH0/D1","MB/CMP1/BR1/CH1/D1");
push(@socketstr, "MB/CMP0/MR0/BR0/CH0/D2","MB/CMP0/MR0/BR0/CH0/D3","MB/CMP0/MR0/BR0/CH1/D2","MB/CMP0/MR0/BR0/CH1/D3","MB/CMP0/MR0/BR1/CH0/D2","MB/CMP0/MR0/BR1/CH0/D3","MB/CMP0/MR0/BR1/CH1/D2","MB/CMP0/MR0/BR1/CH1/D3","MB/CMP1/MR1/BR0/CH0/D2","MB/CMP1/MR1/BR0/CH0/D3","MB/CMP1/MR1/BR0/CH1/D2","MB/CMP1/MR1/BR0/CH1/D3","MB/CMP1/MR1/BR1/CH0/D2","MB/CMP1/MR1/BR1/CH0/D3","MB/CMP1/MR1/BR1/CH1/D2","MB/CMP1/MR1/BR1/CH1/D3") if ($ultra eq "T5240");
&check_for_LDOM;
}
if ($ultra eq "T5440") {
# T5440 has 4 UltraSPARC-T2+ (Victoria Falls) multicore processors
# 8GB to 64GB Fully Buffered ECC-registered DDR2 @ 667MHz
# Supports 1GB, 2GB and 4GB DIMMs.
# All FB-DIMMs must be the same density (same type and Sun part number)
#
# Note - FB-DIMM names in ILOM messages are displayed with the full FRU
# name, such as /SYS/MB/CMP0/BR0/CH0/D0.
$devname="Batoka" if ($ultra eq "T5440");
$devname="Congo" if ($model =~ /Netra-T5440/);
$devname="Lightning" if ($model =~ /Sun-USBRDT-5440/);
$untested=1;
$untested=0 if ($banner eq "T5440");
$memtype="FB-DIMM";
$simmrangex="00004000";
$showrange=0;
$simmbanks=4;
$simmsperbank=4;
@simmsizes=(1024,2048,4096);
@socketstr=("MB/CPU0/CMP0/BR0/CH0/D0","MB/CPU0/CMP0/BR0/CH1/D0","MB/CPU0/CMP0/BR1/CH0/D0","MB/CPU0/CMP0/BR1/CH1/D0","MB/CPU1/CMP1/BR0/CH0/D0","MB/CPU1/CMP1/BR0/CH1/D0","MB/CPU1/CMP1/BR1/CH0/D0","MB/CPU1/CMP1/BR1/CH1/D0","MB/MEM0/CMP0/BR0/CH0/D1","MB/MEM0/CMP0/BR0/CH1/D1","MB/MEM0/CMP0/BR1/CH0/D1","MB/MEM0/CMP0/BR1/CH1/D1","MB/MEM1/CMP1/BR0/CH0/D1","MB/MEM1/CMP1/BR0/CH1/D1","MB/MEM1/CMP1/BR1/CH0/D1","MB/MEM1/CMP1/BR1/CH1/D1");
&check_for_LDOM;
}
if ($model eq "SPARC-Enterprise" || $ultra =~ /SPARC Enterprise M[34589]000 Server/) {
# CPUs: Dual-Core Dual-Thread SPARC64-VI or
# Quad-Core Dual-Thread SPARC64-VII
# M3000: 2RU rack, single SPARC64-VII 2.52GHz cpu
# up to 32GB, uses DDR2-533 4GB or 8GB memory DIMMs
# M4000: 6RU rack, up to 4 SPARC64-VI or SPARC64-VII cpus
# Up to 2 CPU (CMU), 2 CPUs per board
# Main memory Up to 128 GB per domain / system, up to 4 memory
# boards w/ maximum 32GB per board using 8 DDR2 4GB memory DIMMs
# M5000: 10RU rack, up to 8 SPARC64-VI or SPARC64-VII cpus
# Up to 4 CPU (CMU), 2 CPUs per board
# Main memory Up to 256 GB per domain / system, up to 8 memory
# boards w/ maximum 32GB per board using 8 DDR2 4GB memory DIMMs
# M8000: up to 16 SPARC64-VI or SPARC64-VII cpus
# Up to 4 CPU memory boards (CMU), Up to 4 processors and up to
# 128 GB memory per board based on 32 4GB DIMMs
# Main memory Up to 512GB per domain / system
# M9000: 32 or 64 SPARC64-VI or SPARC64-VII cpus
# 32 CPU
# Up to 8 CPU memory boards (CMU), Up to 4 processors and up to
# 128 GB memory per board based on 32 4GB DIMMs
# Main memory Up to 1TB per domain / system
# 64 CPU
# Up to 16 CPU memory boards (CMU), Up to 4 processors and up to
# 128 GB memory per board based on 32 4GB DIMMs
# Main memory Up to 2TB per domain / system
if ($ultra =~ /Sun SPARC Enterprise M4000 Server/) {
$devname="OPL FF1";
$familypn="SEE";
}
if ($ultra =~ /Sun SPARC Enterprise M5000 Server/) {
$devname="OPL FF2";
$familypn="SEF";
}
$untested=1;
$untested=0 if ($ultra =~ /SPARC Enterprise M[3458]000 Server/);
$prtdiag_has_mem=1;
@simmsizes=(1024,2048,4096);
}
if (($model =~ /-Enterprise/ || $ultra eq "e") && $model !~ /SPARC-Enterprise/) {
# E3x00/E4x00/E5x00/E6x00 accepts 8MB, 32MB, 128MB or 256MB DIMMs on
# motherboard, 2 banks of 8 DIMMs per board.
# 256MB DIMMs (2GB kit X7026A) can be used with OBP 3.2.24 or later and
# Solaris 2.5.1 11/97, Solaris 2.6 3/98 or later
# 501-2652 (8MB), 501-2653 (32MB), 501-2654 (128MB), 501-5658 (256MB)
# 168-pin 60ns 3.3V ECC
# E10000 accepts 32MB or 128MB DIMMs on motherboard,
# using 2 or 4 banks of 8 DIMMs per board.
# 501-2653 (32MB), 501-2654 (128MB)
# 168-pin 60ns 3.3V ECC
$devname="Duraflame" if ($banner =~ /\bE?3[05]00\b/);
$devname="Campfire Rack" if ($banner =~ /\bE?5[05]00\b/);
$devname="Campfire" if ($banner =~ /\bE?4[05]00\b/);
$devname="Sunfire" if ($banner =~ /\bE?6[05]00\b/);
$devname .= "+" if ($banner =~ /\bE?[3-6]500\b/);
$devname="Starfire" if ($model =~ /-10000\b/);
$familypn="E3000, A17" if ($banner =~ /\bE?3000\b/);
$familypn="E3500" if ($banner =~ /\bE?3500\b/);
$familypn="E4000, A18" if ($banner =~ /\bE?4000\b/);
$familypn="E4500" if ($banner =~ /\bE?4500\b/);
$familypn="E5000" if ($banner =~ /\bE?5000\b/);
$familypn="E5500" if ($banner =~ /\bE?5500\b/);
$familypn="E6000" if ($banner =~ /\bE?6000\b/);
$familypn="E6500" if ($banner =~ /\bE?6500\b/);
$familypn="E10000" if ($model =~ /-10000\b/);
$untested=1;
if ($banner =~ /\bE?[3-6][05]00\b/ || $model =~ /-Enterprise-E?[3-6][05]00/ || $model eq "Ultra-Enterprise") {
$untested=0;
@simmsizes=(8,32,128,256);
}
if ($model =~ /-Enterprise-10000\b/) {
$untested=0;
@simmsizes=(32,128);
}
$prtdiag_has_mem=1;
@prtdiag=&run("$prtdiag_exec") if ($filename eq "");
$i=0;
$flag_cpu=0;
$flag_mem=0;
foreach $line (@prtdiag) {
$line=&dos2unix($line);
if ($line =~ /Memory Units:/) {
# Start of memory section, Solaris 2.5.1 format
$flag_mem=1;
$format_mem=1;
$flag_cpu=0; # End of CPU section
}
if ($line =~ /==== Memory / || $line =~ /==== Physical Memory /) {
# Start of memory section, Solaris 2.6 and later format
$flag_mem=1;
$format_mem=2;
$flag_cpu=0; # End of CPU section
}
if ($line =~ /Factor/) {
# No interleave factor on E10000
$format_mem += 2 if (($format_mem == 1) || ($format_mem == 2));
}
if ($line =~ /Failed Field Replaceable Unit/) {
$tmp=$line;
$tmp=~s/^\t/ /g;
$failed_fru .= $tmp;
}
if ($line =~ /IO Cards/) {
$flag_cpu=0; # End of CPU section
$flag_mem=0; # End of memory section
}
if (($flag_cpu >= 1) && ($line !~ /^\s*\n$/)) {
push(@boards_cpu, "$line");
$boardfound_cpu=1;
$boardslot_cpu=($line =~ /Board/) ? substr($line,6,2) : substr($line,0,2);
$boardslot_cpu=~s/[: ]//g;
if (($flag_cpu == 2) && ($boardslot_cpus !~ /\s$boardslot_cpu\s/) && ($boardslot_cpu ne "")) {
push(@boardslot_cpus, "$boardslot_cpu");
$boardslot_cpus .= $boardslot_cpu . " ";
}
}
if ($line =~ /CPU Units:/) {
$flag_cpu=1; # Start of CPU section
$flag_mem=0; # End of memory section
$format_cpu=1;
}
if ($line =~ /==== CPUs ====/ || $line =~ /==== Virtual CPUs ====/) {
$flag_cpu=1; # Start of CPU section
$flag_mem=0; # End of memory section
$format_cpu=2;
}
if (($flag_mem == 2) && ($line !~ /^\s*\n$/)) {
$boardslot_mem=($line =~ /Board/) ? substr($line,5,2) : substr($line,0,2);
$boardslot_mem=~s/[: ]//g;
if ($boardslot_mems !~ /\s$boardslot_mem\s/) {
push(@boardslot_mems, "$boardslot_mem");
$boardslot_mems .= $boardslot_mem . " ";
}
if ($format_mem == 1) {
# Memory on each system board, E10000
$mem0=substr($line,12,4);
$mem0=0 if ($mem0 !~ /\d+/);
$dimm0=$mem0 / 8;
if ($dimm0 > 0) {
$dimms0=sprintf("8x%3d", $dimm0);
push(@simmsizesfound, "$dimm0");
} else {
$dimms0=" ";
&found_empty_bank("Bank 0");
}
$mem1=substr($line,20,4);
$mem1=0 if ($mem1 !~ /\d+/);
$dimm1=$mem1 / 8;
if ($dimm1 > 0) {
$dimms1=sprintf("8x%3d", $dimm1);
push(@simmsizesfound, "$dimm1");
} else {
$dimms1=" ";
&found_empty_bank("Bank 1");
}
$mem2=substr($line,28,4);
$mem2=0 if ($mem2 !~ /\d+/);
$dimm2=$mem2 / 8;
if ($dimm2 > 0) {
$dimms2=sprintf("8x%3d", $dimm2);
push(@simmsizesfound, "$dimm2");
} else {
$dimms2=" ";
&found_empty_bank("Bank 2");
}
$mem3=substr($line,36,4);
$mem3=0 if ($mem3 !~ /\d+/);
$dimm3=$mem3 / 8;
if ($dimm3 > 0) {
$dimms3=sprintf("8x%3d", $dimm3);
push(@simmsizesfound, "$dimm3");
} else {
$dimms3=" ";
&found_empty_bank("Bank 3");
}
$newline=substr($line,0,10);
$newline .= " " . $mem0 . " " . $dimms0;
$newline .= " " . $mem1 . " " . $dimms1;
$newline .= " " . $mem2 . " " . $dimms2;
$newline .= " " . $mem3 . " " . $dimms3;
$newline .= "\n";
push(@boards_mem, "$newline");
$boardfound_mem=1;
}
if ($format_mem == 2) {
# Memory on each system board, E10000
# untested ??? reporting of empty banks
$untested=1;
$bank_slot=substr($line,6,2);
$mem=substr($line,12,4);
$mem=0 if ($mem !~ /\d+/);
$dimm=$mem / 8;
if ($dimm > 0) {
$dimms=sprintf("8x3d", $dimm);
push(@simmsizesfound, "$dimm");
$newline=substr($line,0,18) . $dimms;
$newline .= substr($line,16,47);
push(@boards_mem, "$newline");
$boardfound_mem=1;
$failed_memory += $mem if ($newline =~ /\b\bFailed\b\b/);
$spare_memory += $mem if ($newline =~ /\b\bSpare\b\b/);
} else {
$flag_mem=0;
&found_empty_bank("Bank $bank_slot");
}
if ($bank_slot == 0) {
$next_boardslot_mem=substr($prtdiag[$i + 1],0,2);
$next_boardslot_mem=~s/[: ]//g;
&found_empty_bank("Bank 1") if ($next_boardslot_mem ne $boardslot_mem);
}
if ($bank_slot == 1) {
$prev_boardslot_mem=substr($prtdiag[$i - 1],0,2);
$prev_boardslot_mem=~s/[: ]//g;
&found_empty_bank("Bank 0") if ($prev_boardslot_mem ne $boardslot_mem);
}
}
if ($format_mem == 3) {
# Memory on each system board, E[3456]x00
$mem0=substr($line,10,4);
$mem0=0 if ($mem0 !~ /\d+/);
$dimm0=$mem0 / 8;
if ($dimm0 > 0) {
$dimms0=sprintf("8x%3d", $dimm0);
push(@simmsizesfound, "$dimm0");
} else {
$dimms0=" ";
&found_empty_bank("Bank 0");
}
$memlength=length($line);
$mem1=($memlength > 34) ? substr($line,34,4) : 0;
$mem1=0 if ($mem1 !~ /\d+/);
$dimm1=$mem1 / 8;
if ($dimm1 > 0) {
$dimms1=sprintf("8x%3d", $dimm1);
push(@simmsizesfound, "$dimm1");
} else {
$dimms1=" ";
&found_empty_bank("Bank 1");
}
$newline=substr($line,0,16) . $dimms0;
$newline .= substr($line,16,24);
if ($dimm1 > 0) {
$newline .= $dimms1;
$newline .= substr($line,39,16);
}
push(@boards_mem, "$newline");
$boardfound_mem=1;
}
if ($format_mem == 4) {
# Memory on each system board, E[3456]x00
$bank_slot=substr($line,7,1);
$mem=substr($line,12,4);
$mem=0 if ($mem !~ /\d+/);
$dimm=$mem / 8;
if ($dimm > 0) {
$dimms=sprintf("8x%3d", $dimm);
push(@simmsizesfound, "$dimm");
$newline=substr($line,0,18) . $dimms;
$newline .= substr($line,16,47);
push(@boards_mem, "$newline");
$boardfound_mem=1;
$failed_memory += $mem if ($newline =~ /\b\bFailed\b\b/);
$spare_memory += $mem if ($newline =~ /\b\bSpare\b\b/);
} else {
$flag_mem=0;
&found_empty_bank("Bank $bank_slot");
}
if ($bank_slot == 0) {
$next_boardslot_mem=substr($prtdiag[$i + 1],0,2);
$next_boardslot_mem=~s/[: ]//g;
&found_empty_bank("Bank 1") if ($next_boardslot_mem ne $boardslot_mem);
}
if ($bank_slot == 1) {
$prev_boardslot_mem=substr($prtdiag[$i - 1],0,2);
$prev_boardslot_mem=~s/[: ]//g;
&found_empty_bank("Bank 0") if ($prev_boardslot_mem ne $boardslot_mem);
}
}
}
if (($flag_cpu == 1) && ($line =~ /-----/)) {
# Next lines are the CPUs on each system board
$flag_cpu=2;
}
if (($flag_mem == 1) && ($line =~ /-----/)) {
# Next lines are the memory on each system board
$flag_mem=2;
}
$i++;
}
&show_header;
if ($boardfound_mem) {
if ($boardfound_cpu) {
foreach $board (@boardslot_cpus) {
if ($boardslot_mems !~ /\s$board\s/) {
$boardslot_mem=$board;
if ($format_mem <= 2) {
# E10000
&found_empty_bank("Bank 0");
&found_empty_bank("Bank 1");
&found_empty_bank("Bank 2");
&found_empty_bank("Bank 3");
} else {
# E3x00/E4x00/E5x00/E6x00
&found_empty_bank("Bank 0");
&found_empty_bank("Bank 1");
}
}
}
}
if ($format_mem == 1) {
# E10000 running Solaris 2.5.1
print " Bank 0 Bank 1 Bank 2 Bank 3\n";
print " MB DIMMs MB DIMMs MB DIMMs MB DIMMs\n";
print " ---- ----- ---- ----- ---- ----- ---- -----\n";
print @boards_mem;
}
if ($format_mem == 2) {
# E10000 running Solaris 2.6 or later
print "Brd Bank MB DIMMs Status Condition Speed\n";
print "--- ----- ---- ----- ------- ---------- -----\n";
print @boards_mem;
}
if ($format_mem == 3) {
# E3x00/E4x00/E5x00/E6x00 running Solaris 2.5.1
print " Bank 0 Bank 1\n";
print " J3100-J3800 Interleave J3101-J3801 Interleave\n";
print " MB DIMMs Factor With MB DIMMs Factor With\n";
print " ---- ----- ------ ---- ---- ----- ------ ----\n";
print @boards_mem;
}
if ($format_mem == 4) {
# E3x00/E4x00/E5x00/E6x00 running Solaris 2.6 or later
print " Intrlv. Intrlv.\n";
print "Brd Bank MB DIMMs Status Condition Speed Factor With\n";
print "--- ----- ---- ----- ------- ---------- ----- ------- -------\n";
print @boards_mem;
print "Bank 0 uses sockets J3100-J3800, Bank 1 uses sockets J3101-J3801\n";
}
$empty_banks=" None" if ($empty_banks eq "");
print "empty memory banks:$empty_banks\n";
}
$totmem=$installed_memory;
&finish;
exit;
}
#
# Check to see if this system has memory defined in the prtdiag output
#
&check_prtdiag;
$model=$diagbanner if ($diagbanner ne "" && $isX86);
$untested=0 if ($boardfound_mem && $isX86 && $have_x86_devname == 0);
&x86_devname;
# Don't use prtdiag data on this clone
$boardfound_mem=0 if ($manufacturer eq "AXUS");
#
# Check to see if this system has module information in prtconf output
# (Seen on Fujitsu GP7000, GP7000F, PrimePower)
#
if ($gotmodule ne "" || $gotmodulenames ne "") {
@simmslots=($gotmodulenames) ? split(/\./, $gotmodulenames) : split(/\./, $gotmodule);
for ($val=0; $val < scalar(@simmslots); $val += 2) {
$socket=($gotmodulenames) ? $simmslots[$val] : "SLOT" . $val / 2;
$simmsz=$simmslots[$val + 1];
$simmsize=hex("0x$simmsz") / $meg;
$perlhexbug=1 if (($simmsize <= 0) && ($simmsz ne "00000000"));
$totmem += $simmsize;
if ($simmsize > 0) {
push(@simmsizesfound, "$simmsize");
if (! $boardfound_mem) {
push(@memorylines, "$socket has a ${simmsize}MB");
if ($simmsize > 1023) {
push(@memorylines, " (");
push(@memorylines, $simmsize/1024);
push(@memorylines, "GB)");
}
push(@memorylines, " $memtype\n");
}
$sockets_used .= " $socket";
}
}
&show_header;
print (($boardfound_mem) ? @boards_mem : @memorylines);
$totmem=$installed_memory;
&finish;
exit;
}
#
# Check to see if this system has module information in ipmitool output
#
if ($have_ipmitool_data) {
&check_ipmitool;
$tmp=scalar(keys %ipmi_mem);
if (defined($tmp)) {
if ($tmp > 0) {
&show_header;
for (sort keys %ipmi_mem) {
if ($ipmi_mem{$_} eq "") {
$sockets_empty .= "," if ($sockets_empty ne "");
$sockets_empty .= " $_";
} else {
print "socket $_: $ipmi_mem{$_}\n";
}
}
$totmem=$installed_memory;
&print_empty_memory("memory sockets");
&finish;
exit;
}
}
}
#
# Check to see if this system has module information in smbios output
#
&check_smbios if ($have_smbios_data);
#
# Display memory if found in prtdiag output
#
if ($boardfound_mem) {
&show_header;
print @boards_mem if (! &is_virtualmachine);
$totmem=$installed_memory;
}
#
# Look for empty memory banks on Sun Fire 3800, 4800, 4810, 6800, 12K, 15K and
# Netra T12 systems. Also Sun Fire E2900, E4900, E6900, E20K and E25K.
#
if ($ultra eq "Sun Fire" || $ultra eq "Sun Fire 15K" || $ultra eq "Sun Fire 12K" || $ultra eq "Netra T12" || $ultra =~ /Sun Fire [346]8[01]0\b/ || $ultra =~ /Sun Fire E[246]900\b/ || $ultra =~ /Sun Fire E2[05]K\b/) {
foreach $cpu (@boardslot_cpus) {
$empty_banks .= " $cpu/B0" if ($boardslot_mems !~ /$cpu\/B0/);
$empty_banks .= " $cpu/B1" if ($boardslot_mems !~ /$cpu\/B1/);
}
$empty_banks=" None" if ($empty_banks eq "");
if ($boardslot_mems eq " ") {
$empty_banks=" Unknown";
$exitstatus=1;
}
print "empty memory banks:$empty_banks\n" if ($boardfound_mem);
}
if ($boardfound_mem) {
&finish;
exit;
}
#
# OK, get ready to print out results
#
for ($val=$val0; $val < scalar(@slots); $val += $valinc) {
$newaddrmsb=substr($slots[$val - $valaddr - 1],3,5);
$newaddrlsb=substr($slots[$val - $valaddr],0,3);
$newsizemsb=($valinc == 4) ? substr($slots[$val - 1],3,5) : "";
$newsizelsb=substr($slots[$val],0,3);
# Round up for DIMM value seen on US-T1 and US-T2 Niagara systems
# Two Ranks of DIMMs appear as one in prtconf
if ($newsizelsb eq "ff8") {
if ($newsizemsb eq "00000") {
$newsizemsb="00001"; # 512MB
if ($ultra eq "T2000") {
# Hack: 1 rank of smallest DIMMs
$simmbanks=2;
$simmsperbank=8;
}
# Hack: Could be 1 Rank of 1GB on T1000
$recognized=-1 if (($ultra eq "T1000") && (scalar(@slots) == 4));
} elsif ($newsizemsb eq "00001") {
$newsizemsb="00002"; # 1GB
# Hack: Could be 1 Rank of 1GB on T2000
$recognized=-1 if (($ultra eq "T2000") && (scalar(@slots) == 4));
# Hack: Could be 1 Rank of 2GB on T1000
$recognized=-1 if (($ultra eq "T1000") && (scalar(@slots) == 4));
} elsif ($newsizemsb eq "00003") {
$newsizemsb="00004"; # 2GB
# Hack: Could be 1 Rank of 2GB on T2000
$recognized=-1 if (($ultra eq "T2000") && (scalar(@slots) == 4));
} elsif ($newsizemsb eq "00007") {
$newsizemsb="00008"; # Fully stuffed 2 Ranks of 2GB
}
$newsizelsb="000";
$installed_memory += 8;
} elsif ($newsizelsb eq "7f8" && $newsizemsb eq "00000") {
if ($ultra eq "T1000") {
# Hack: 1 rank of smallest DIMMs
$newsizelsb="800"; # 512MB
$simmbanks=2;
$simmsperbank=4;
} else {
$newsizelsb="800"; # Hack: unsupported 256MB DIMM
}
$installed_memory += 8;
} elsif ($newsizelsb eq "f80") {
if ($newsizemsb eq "00001") {
$newsizemsb="00002"; # 1GB
} elsif ($newsizemsb eq "00003") {
$newsizemsb="00004"; # 2GB
} elsif ($newsizemsb eq "00007") {
$newsizemsb="00008"; # 4GB
} elsif ($newsizemsb eq "0000f") {
$newsizemsb="00010"; # 8GB
}
$newsizelsb="000";
$installed_memory += 128;
}
if ($sortslots) {
$mods{"$newaddrmsb$newaddrlsb"}="$newsizemsb$newsizelsb";
} else {
push(@newslots, "$newaddrmsb$newaddrlsb");
push(@newslots, "$newsizemsb$newsizelsb");
}
}
if ($sortslots) {
for (sort keys %mods) {
push(@newslots, $_);
push(@newslots, $mods{$_});
}
}
# For Ultra-30, determine if interleaving of banks using four DIMMs
if ($model eq "Ultra-30" || $ultra eq 30) {
$interleave=2;
# pairs show up in odd numbered address ranges
for ($val=0; $val < scalar(@newslots); $val += 2) {
$interleave=1 if ($newslots[$val] =~ /00000[1357]00/);
}
if ($interleave eq 2) {
$simmrangex="00000200";
$simmbanks=4;
$simmsperbank=4;
} else {
$simmrangex="00000100";
$simmbanks=8;
$simmsperbank=2;
}
}
# Check if SPARCsystem-600 has VME memory expansion boards
if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/) {
for ($val=0; $val < scalar(@newslots); $val += 2) {
if ($newslots[$val] =~ /00000[4-9ab]00/) {
@simmsizes=(1,4,16);
push(@socketstr, @socketstr_exp);
push(@bankstr, @bankstr_exp);
push(@bytestr, @bytestr_exp);
$exp=($newslots[$val] =~ /00000[4-7]00/) ? "Expansion board 0 bank" : "Expansion board 1 bank";
push(@banksstr, ("$exp B0","$exp B1", "$exp B2","$exp B3"));
}
}
}
# Hack: Rewrite interleaved memory line for Ultra-80 or Enterprise 420R
if (($model eq "Ultra-80" || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x") && $newslots[0] eq "00000000") {
if ($newslots[1] eq "00001000" && $installed_memory eq 4096) {
# 4GB of memory (maximum) using 16x256MB in Banks 0-3
$newslots[1]="00000400";
$newslots[2]="00000400";
$newslots[3]="00000400";
$newslots[4]="00000800";
$newslots[5]="00000400";
$newslots[6]="00000c00";
$newslots[7]="00000400";
$interleave=4;
} elsif ($newslots[1] eq "00000800" && $installed_memory eq 2048) {
# 2GB of memory using 8x256MB in Banks 0,1
$newslots[1]="00000400";
$newslots[2]="00000400";
$newslots[3]="00000400";
$interleave=2;
} elsif ($newslots[1] =~ /00000[97653]00/) {
# Early OBP releases showed total memory as a single bank
$recognized=-1;
} elsif ($newslots[1] eq "00000400" && $installed_memory eq 1024) {
# 1GB of memory can be 4x256MB in Bank 0 or 16x64MB in Banks 0-3
# so flag OBP bug
$recognized=-1;
} elsif ($newslots[1] eq "00000200" && $installed_memory eq 512) {
# 512MB of memory using 8x64MB in Banks 0,1
$newslots[1]="00000100";
$newslots[2]="00000400";
$newslots[3]="00000100";
$interleave=2;
}
}
# Hack: Fix address ranges for Tatung COMPstation U60 and U80D
if ($banner =~ /COMPstation_U60_Series/ || $banner =~ /COMPstation_U80D_Series/) {
# Tatung Science and Technology, http://www.tsti.com
for ($val=0; $val < scalar(@newslots); $val += 2) {
$simmbanks=4 if ($newslots[$val] =~ /00000[46]00/);
# Check for 256MB DIMMs or 256MB address range per bank
if ($newslots[$val + 1] =~ /00000400/ || $newslots[$val] =~ /00000c00/) {
$simmrangex="00000400";
$simmbanks=4;
}
}
if ($simmbanks eq 6) {
# Skipped address range similar to Sun Ultra 60
@socketstr=("J17","J32","J36","J40","J18","J33","J37","J41","?","?","?","?","?","?","?","?","J19","J34","J38","J42","J20","J35","J39","J43");
@slotstr=(1..8,"?","?","?","?","?","?","?","?",9..16);
@bankstr=(0,0,0,0,1,1,1,1,"?","?","?","?","?","?","?","?",2,2,2,2,3,3,3,3);
} else {
@socketstr=("J17","J32","J36","J40","J18","J33","J37","J41","J19","J34","J38","J42","J20","J35","J39","J43");
@slotstr=(1..16);
@bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
}
}
# Hack: Try to rewrite memory line for Sun Blade 1000 & 2000 if prtdiag output
# did not show the memory. This does not expect 2GB DIMMs to be used.
if (($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R") && ! $boardfound_mem) {
# Assume 8GB is 8x1GB instead of 4x2GB
if ($newslots[1] eq "00002000") {
$newslots[1]="00001000";
$newslots[2]="00001000";
$newslots[3]="00001000";
$recognized=-2;
}
# Assume 6GB is 4x1GB + 4x512MB instead of 4x1.5GB
if ($newslots[1] eq "00001800") {
$newslots[1]="00001000";
$newslots[2]="00001000";
$newslots[3]="00000800";
$recognized=-1;
}
# Assume 5GB is 4x1GB + 4x256MB instead of 4x1280MB
if ($newslots[1] eq "00001400") {
$newslots[1]="00001000";
$newslots[2]="00001000";
$newslots[3]="00000400";
$recognized=-1;
}
# Assume 4.5GB is 4x1GB + 4x128MB instead of 4x1152MB
if ($newslots[1] eq "00001200") {
$newslots[1]="00001000";
$newslots[2]="00001000";
$newslots[3]="00000200";
$recognized=-1;
}
# Assume 3GB is 4x512MB + 4x256MB instead of 4x768MB
if ($newslots[1] eq "00000c00") {
$newslots[1]="00000800";
$newslots[2]="00001000";
$newslots[3]="00000400";
$recognized=-1;
}
# Assume 2.5GB is 4x512MB + 4x128MB instead of 4x640MB
if ($newslots[1] eq "00000a00") {
$newslots[1]="00000800";
$newslots[2]="00001000";
$newslots[3]="00000200";
$recognized=-1;
}
# Assume 1.5GB is 4x256MB + 4x128MB instead of 4x384MB
if ($newslots[1] eq "00000600") {
$newslots[1]="00000400";
$newslots[2]="00001000";
$newslots[3]="00000200";
$recognized=-1;
}
}
# for prtconf output only, or fully stuffed LDOM servers
if ($ultra eq "T5120" || $ultra eq "T5220" || $ultra eq "T6320"|| $ultra eq "T5140") {
# Hack: Rewrite fully stuffed memory line
if ($installed_memory >= 65408) {
$newslots[0]="00000000";
$newslots[1]="00004000";
$newslots[2]="00004000";
$newslots[3]="00004000";
$newslots[4]="00008000";
$newslots[5]="00004000";
$newslots[6]="0000c000";
$newslots[7]="00004000";
}
}
if ($ultra eq "T5240") {
# Hack: Rewrite fully stuffed memory line
if ($installed_memory >= 130816) {
$newslots[0]="00000000";
$newslots[1]="00004000";
$newslots[2]="00004000";
$newslots[3]="00004000";
$newslots[4]="00008000";
$newslots[5]="00004000";
$newslots[6]="0000c000";
$newslots[7]="00004000";
$newslots[8]="00010000";
$newslots[9]="00004000";
$newslots[10]="00014000";
$newslots[11]="00004000";
$newslots[12]="00018000";
$newslots[13]="00004000";
$newslots[14]="0001c000";
$newslots[15]="00004000";
}
}
# Check for dual bank DIMMs on Ultra AXmp+
if ($ultra eq "AXmp+") {
if ($#newslots eq 1 && $newslots[0] eq "00000c00") {
$simmsperbank=4;
$dualbank=1;
}
if ($#newslots eq 3) {
if ($newslots[2] =~ /00000[8c]00/) {
$simmrangex="00000800";
$dualbank=1 if ($newslots[1] eq $newslots[3]);
}
}
if ($#newslots ge 5) {
$dualbank=1 if ($newslots[4] =~ /00000[8c]00/);
}
if ($dualbank eq 1) {
@bankstr=("0,2","0,2","0,2","0,2","0,2","0,2","0,2","0,2","1,3","1,3","1,3","1,3","1,3","1,3","1,3","1,3");
# Rearrange slots if necessary
if ($#newslots ge 5) {
if ($newslots[4] eq "00000800") {
$tmp=$newslots[2];
$newslots[2]=$newslots[4];
$newslots[4]=$tmp;
$tmp=$newslots[3];
$newslots[3]=$newslots[5];
$newslots[5]=$tmp;
}
}
}
}
for ($val=0; $val < scalar(@newslots); $val += 2) {
$simmaddr=$newslots[$val];
$simmsz=$newslots[$val + 1];
$simmsize=hex("0x$simmsz");
$perlhexbug=1 if (($simmsize <= 0) && ($simmsz ne "00000000"));
$totmem += $simmsize;
if (($model eq "Sun 4/75" || $model eq "SS-2") && ($simmbanks < $bankcnt + 2)) {
# SS2 SBus memory card
$buffer=($simmaddr eq "00000080") ? "${buffer}SBus primary" : "${buffer}SBus secondary";
$start1=hex("0x$simmaddr") * $meg;
$perlhexbug=1 if ($start1 < 0);
$simmrange=hex("0x$simmrangex") * $meg;
$perlhexbug=1 if (($simmrange <= 0) && ($simmrangex ne "00000000"));
$start1x=sprintf("%08lx", $start1);
$stop1x=sprintf("%08lx", $start1 + (2 * $simmrange) - 1);
$totmem += $simmsize;
$simmsize *= 2;
$val += 2;
$buffer .= " contains ${simmsize}MB";
$buffer .= " (address 0x${start1x}-0x$stop1x)" if ($verbose);
$buffer .= "\n";
} elsif ($simmbanks > 0) {
$start1=hex("0x$simmaddr") * $meg;
$perlhexbug=1 if ($start1 < 0);
if ($simmrangex ne "0") {
$simmrange=hex("0x$simmrangex") * $meg;
$perlhexbug=1 if (($simmrange <= 0) && ($simmrangex ne "00000000"));
if ($simmrange < hex("0x00001000") * $meg) {
$start1x=sprintf("%08lx", $start1);
$stop1x=sprintf("%08lx", $start1 + ($simmsize * $meg) - 1);
} else {
# Systems with > 4GB of memory
$start1x=$simmaddr . "00000";
$start1x=~s/^0000//;
$stop1x=sprintf("%08lx", ($start1 / $meg) + $simmsize - 1) . "fffff";
$stop1x=~s/^0000//;
}
}
$cnt=0;
$maxcnt=$simmbanks * $simmsperbank / $simmspergroup;
while ($cnt < $maxcnt) {
if (($start1 >= $simmrange * $cnt) && ($start1 < $simmrange * ($cnt + 1))) {
$bankcnt=$cnt;
$cnt3=($bankcnt * $simmsperbank / $simmspergroup);
if ($#socketstr) {
$socket=$socketstr[$cnt3];
if ($#socketlabelstr) {
$socketlabel=" ($socketlabelstr[$cnt3])" if (defined($socketlabelstr[$cnt3]));
}
if ($found10bit && $newslots[$val] !~ /00000[0-3]00/) {
$socket=$socketstr[$cnt3 + 4];
if ($#socketlabelstr) {
$socketlabel=" ($socketlabelstr[$cnt3 + 4])" if (defined($socketlabelstr[$cnt3 + 4]));
}
}
}
$order=$orderstr[$cnt3] if ($#orderstr);
$group=$groupstr[$cnt3] if ($#groupstr);
$slotnum=$slotstr[$cnt3] if ($#slotstr);
if ($#bankstr) {
$bank=$bankstr[$cnt3];
$bank=$bankstr[$cnt3 + 4] if ($found10bit && $newslots[$val] !~ /00000[0-3]00/);
}
$banks=$banksstr[$cnt3/$simmsperbank] if ($#banksstr);
$byte=$bytestr[$cnt3] if ($#bytestr);
}
$cnt++;
}
#
# Check for stacked DIMMs. A 128MB DIMM is sometimes seen as 2
# 64MB DIMMs with a hole in the address range. This may report
# more slots than are really in a system. (i.e. a SS20 with
# 8 32MB SIMMs reports 16 slots of 16MB each).
# Special handling for $sortslots == 0 systems (Ultra 5/10,
# Netra t1, Ultra CP 1400/1500, Ultra AXi/AXe/AXmp/AXmp+)
#
$stacked=0;
if ($val < $#newslots - 2) {
if ($sortslots == 0) {
$start2=$start1 + ($simmrange * 2);
$start2=$start1 + ($simmrange * 4) if ($banner =~ /Ultra CP 1400\b/ || $ultra eq "CP1400");
$start2x=sprintf("%08lx", $start2 / $meg);
$stacked=2 if (($stacked == 0) && ($newslots[$val + 2] eq $start2x) && ($newslots[$val + 3] eq $simmsz));
if ($memtype eq "memory card") {
# Some 256MB mezzanine boards are seen
# as 4 64MB memory blocks with holes in
# the address range.
$start3=$start1 + ($simmsize * 2 * $meg) if ($simmsize eq 64);
# Some 512MB mezzanine boards are seen
# as 4 128MB memory blocks.
$start3=$start1 + ($simmsize * $meg) if ($simmsize eq 128 && $banner !~ /Ultra CP 1400\b/ && $ultra ne "CP1400");
if ($banner =~ /\bCP2000\b/ || $ultra =~ /^CP2[01]\d0$/) {
# 1GB mezzanine boards are seen
# as 4 256MB memory blocks.
$start3=$start1 + ($simmsize * $meg);
$stacked=4;
}
$start3x=sprintf("%08lx", $start3 / $meg);
if (($val < $#newslots - 6) && ($stacked != 0)) {
$stacked=4 if (($newslots[$val + 4] eq $start3x) && ($newslots[$val + 5] eq $simmsz) && ($simmrange != $start3));
}
}
if ($ultra eq "AXi") {
# Check for 10-bit column address DIMMs
if ($newslots[$val] =~ /00000[0-3]80/) {
$found10bit=1;
} elsif ($stacked == 0) {
$found11bit=1;
}
if ($found10bit && $newslots[$val] !~ /00000[0-3]00/) {
$socket=$socketstr[$cnt3 + 4];
if ($#socketlabelstr) {
$socketlabel=" ($socketlabelstr[$cnt3 + 4])" if (defined($socketlabelstr[$cnt3 + 4]));
}
$bank=$bankstr[$cnt3 + 4];
}
}
} else {
$start2=$start1 + ($simmrange / 2);
$start2x=sprintf("%08lx", $start2 / $meg);
$stacked=2 if ($newslots[$val + 2] eq $start2x && $newslots[$val + 3] eq $simmsz && ($simmsize ne 64));
}
#
# Check for 32MB SIMMs in bank 1 on Classic or LX.
# They look like 16MB SIMMs at 0x0000000 and 0x06000000
# Also check for 8MB SIMMs in bank 1 on Classic or LX.
# They look like 4MB SIMMs at 0x0000000 and 0x06000000
#
if ($model =~ /SPARCclassic/ || $model =~ /SPARCstation-LX/) {
if (($start1 == 0) && (($simmsize == 32) || ($simmsize == 8))) {
if ($newslots[$#newslots - 1] eq "00000060") {
$totmem += $simmsize;
$start2=hex("0x$newslots[$#newslots - 1]") * $meg;
$start2x=sprintf("%08lx", $start2);
$stop2x=sprintf("%08lx", $start2 + ($simmsize * $meg) - 1);
$stop1x .= ", 0x${start2x}-0x$stop2x";
$simmsize *= 2;
pop(@newslots);
pop(@newslots);
}
}
}
if ($stacked == 2) {
$totmem += $simmsize;
$start2=hex("0x$newslots[$val + 2]") * $meg;
if ($simmrange < hex("0x00001000") * $meg) {
$start2x=sprintf("%08lx", $start2);
$stop2x=sprintf("%08lx", $start2 + ($simmsize * $meg) - 1);
} else {
# Systems with > 4GB of memory
$start2x=sprintf("%08lx", ($start2 / $meg)) . "00000";
$start2x=~s/^0000//;
$stop2x=sprintf("%08lx", ($start2 / $meg) + $simmsize - 1) . "fffff";
$stop2x=~s/^0000//;
}
$stop1x .= ", 0x${start2x}-0x$stop2x";
$simmsize *= 2;
$val += 2;
}
if ($stacked == 4) {
$totmem += $simmsize * 3;
$start2=hex("0x$newslots[$val + 2]") * $meg;
$start2x=sprintf("%08lx", $start2);
$stop2x=sprintf("%08lx", $start2 + ($simmsize * $meg) - 1);
$stop1x .= ", 0x${start2x}-0x$stop2x";
$start3=hex("0x$newslots[$val + 4]") * $meg;
$start3x=sprintf("%08lx", $start3);
$stop3x=sprintf("%08lx", $start3 + ($simmsize * $meg) - 1);
$stop1x .= ", 0x${start3x}-0x$stop3x";
$start4=hex("0x$newslots[$val + 6]") * $meg;
$start4x=sprintf("%08lx", $start4);
$stop4x=sprintf("%08lx", $start4 + ($simmsize * $meg) - 1);
$stop1x .= ", 0x${start4x}-0x$stop4x";
$simmsize *= 4;
$val += 6;
}
}
#
# Check for Voyager memory cards. A 32MB memory card is seen
# as 4 8MB memory blocks with holes in the address range.
#
if (($model eq "S240") && ($start1 > 0) && ($simmsize == 16) && ($val < $#newslots - 4)) {
$start=hex("0x$newslots[$val + 4]") - hex("0x$newslots[$val]");
$perlhexbug=1 if ($start < 0);
$startx=sprintf("%08lx", $start);
if ($newslots[$val + 1] eq "008" && $newslots[$val + 3] eq "008" && $startx eq "00000040") {
$totmem += $simmsize;
$startx=$newslots[$val + 2];
$start=hex("0x$startx") * $meg;
$startx=sprintf("%08lx", $start);
$perlhexbug=1 if ($start < 0);
$stopx=sprintf("%08lx", $start + ($simmsize * $meg) - 1);
$stop1x .= ", 0x${startx}-0x$stopx";
$startx=$newslots[$val + 4];
$start=hex("0x$startx") * $meg;
$startx=sprintf("%08lx", $start);
$perlhexbug=1 if ($start < 0);
$stopx=sprintf("%08lx", $start + ($simmsize * $meg) - 1);
$stop1x .= ", 0x${startx}-0x$stopx";
$simmsize *= 2;
$val += 4;
}
}
$slot0=$simmsize if ($start1 == 0);
$simmsizeperbank=$simmsize / $simmsperbank;
$smallestsimm=$simmsizeperbank if ($simmsize < $smallestsimm);
$largestsimm=$simmsizeperbank if ($simmsize > $largestsimm);
$found8mb=1 if ($simmsizeperbank == 8);
$found16mb=1 if ($simmsizeperbank == 16);
$found32mb=1 if ($simmsizeperbank == 32);
push(@simmsizesfound, "$simmsizeperbank");
$cnt2=0;
$maxcnt2=$simmsperbank / $simmspergroup;
while ($cnt2 < $maxcnt2) {
$socket='?' if (! defined($socket));
$bank='' if (! defined($bank));
$byte='' if (! defined($byte));
$socket='?' if ($socket eq "");
$recognized=0 if ($socket eq "?");
$sockets_used .= " $socket";
if ($simmspergroup > 1) {
$buffer .= "${sockettype}s $socket have $simmsperbank ";
$buffer .= $simmsize/$simmsperbank . "MB ${memtype}s";
} else {
if ($socket eq "motherboard") {
$buffer .= "$socket has ";
$buffer .= $simmsize/$simmsperbank . "MB";
} else {
if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/) {
$exp="Expansion board 0" if ($newslots[$val] =~ /00000[4-7]00/);
$exp="Expansion board 1" if ($newslots[$val] =~ /00000[89ab]00/);
if ($newslots[$val] =~ /00000[4-9ab]00/) {
$buffer .= "$exp ";
$banks="$exp bank $bank";
}
$banks_used .= " $banks" if ($banks ne "" && $banks_used !~ /$banks/);
}
$buffer=($sockettype) ? "$buffer$sockettype $socket$socketlabel has a " : "$buffer$socket$socketlabel is a ";
$buffer .= $simmsize/$simmsperbank . "MB";
$buffer .= " (" . $simmsize/$simmsperbank/1024 . "GB)" if ($simmsize/$simmsperbank > 1023);
$buffer .= " $memtype";
push(@simmsizesfound, $simmsize/$simmsperbank);
}
}
if ($verbose) {
$buf="";
if ($order ne "") {
$buf .= "$order";
$buf .= " $memtype" if ($memtype !~ /memory card/);
}
$slotnum="" if (! defined($slotnum));
$buf .= "slot $slotnum" if ($slotnum ne "");
$buf .= ", " if ($order ne "" || $slotnum ne "");
$buf .= "group $group, " if ($group ne "");
if ($bank ne "") {
if ($bank =~ /Quad/) {
$buf .= "$bank, ";
} elsif ($dualbank eq 1) {
$buf .= "banks $bank, ";
} else {
$buf .= "bank $bank, ";
}
$foundbank1or3=1 if ($bank eq 1 || $bank eq 3);
}
$buf .= "byte $byte, " if ($byte ne "");
$buf .= "address 0x${start1x}-0x$stop1x" if ($start1x ne "" && $showrange eq 1);
$buffer .= " ($buf)" if ($buf ne "");
}
$buffer .= "\n";
$cnt2++;
$cnt3=($bankcnt * $simmsperbank / $simmspergroup) + $cnt2;
if ($#socketstr) {
$socket=$socketstr[$cnt3];
if ($#socketlabelstr) {
$socketlabel=" ($socketlabelstr[$cnt3])" if (defined($socketlabelstr[$cnt3]));
}
if ($found10bit && $newslots[$val] !~ /00000[0-3]00/) {
$socket=$socketstr[$cnt3 + 4];
if ($#socketlabelstr) {
$socketlabel=" ($socketlabelstr[$cnt3 + 4])" if (defined($socketlabelstr[$cnt3 + 4]));
}
}
# print &runtime . "socketstr[$cnt3], bankcnt=$bankcnt, cnt2=$cnt2\n" if ($DEBUG);
}
$order=$orderstr[$cnt3] if ($#orderstr);
$group=$groupstr[$cnt3] if ($#groupstr);
$slotnum=$slotstr[$cnt3] if ($#slotstr);
if ($#bankstr) {
$bank=$bankstr[$cnt3];
$bank=$bankstr[$cnt3 + 4] if ($found10bit && $newslots[$val] !~ /00000[0-3]00/);
}
$banks=$banksstr[$cnt3/$simmsperbank] if ($#banksstr);
$byte=$bytestr[$cnt3] if ($#bytestr);
}
} elsif ($ultra eq 1 || $ultra eq 5 || $ultra eq 10 || $ultra eq 30) {
$buffer .= "bank $slot has a pair of " . $simmsize/2 . "MB DIMMs\n";
push(@simmsizesfound, $simmsize/2);
} elsif ($ultra eq 2 || $ultra eq 250 || $ultra eq 450 || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x" || $ultra eq "Netra ft1800") {
$buffer .= "group $slot has four " . $simmsize/4 . "MB DIMMs\n";
push(@simmsizesfound, $simmsize/4);
} elsif ($ultra eq 60 || $ultra eq "220R") {
$buffer .= "group $slot has four " . $simmsize/2 . "MB DIMMs\n";
push(@simmsizesfound, $simmsize/2);
} elsif ($ultra eq "e") {
$buffer .= "group $slot has eight " . $simmsize/8 . "MB DIMMs\n";
push(@simmsizesfound, $simmsize/8);
} elsif ($socket eq "motherboard") {
$buffer .= "$slot has ${simmsize}MB\n";
push(@simmsizesfound, $simmsize);
} else {
$buffer .= "slot $slot has a ${simmsize}MB";
$buffer .= " (" . $simmsize/1024 . "GB)" if ($simmsize > 1023);
$buffer .= " $memtype\n";
push(@simmsizesfound, $simmsize);
}
$slot++;
}
#
# Try to distinguish Ultra 5 from Ultra 10
# Cannot distinguish Ultra 5/333MHz from Ultra 10/333MHz (375-0066 motherboard)
# Cannot distinguish Ultra 5/440MHz from Ultra 10/440MHz (375-0079 motherboard)
#
if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) {
if ($motherboard =~ /375-0009/) {
$ultra=($sysfreq > 91) ? 10 : 5;
$realmodel=($ultra eq 5) ? "(Ultra 5)" : "(Ultra 10)";
}
# Determine if interleaving of banks using four identical sized DIMMs
# Assume 1-way interleaving with mix of stacked and unstacked DIMMs
$interleave=1;
if (($#newslots == 3) && ($stacked == 0)) {
$interleave=2 if ($newslots[1] eq $newslots[3]);
}
if (($#newslots == 7) && ($stacked == 2)) {
$interleave=2 if ($newslots[1] eq $newslots[5]);
}
}
&finish;
exit;
sub hpux_cstm {
print &runtime . "in hpux_cstm\n" if ($DEBUG);
$HPUX=1;
$config_cmd="echo 'selclass qualifier memory;info;wait;infolog'|/usr/sbin/cstm";
if (($filename eq "") && ($verbose == 3)) {
# Only include CPU information if E-mailing maintainer since
# this data is used by memconf only for regression testing
$config_cmd="echo 'selclass qualifier cpu;info;wait;selclass qualifier memory;info;wait;infolog'|/usr/sbin/cstm";
}
$config_command="cstm";
$model=$machine;
if ($filename eq "") {
$osmajor=$osrel;
$osmajor=~s/[^.]*.[0B]*//;
$osmajor=~s/\..*//;
&hpux_osrelease;
$model=&mychomp(`/usr/bin/model`) if (-x '/usr/bin/model');
$cpuversion="";
if (-x '/usr/bin/getconf') {
$kernbit=&mychomp(`/usr/bin/getconf KERNEL_BITS`);
$kernbit .= "-bit kernel" if ($kernbit);
$cpuversion=&mychomp(`/usr/bin/getconf CPU_VERSION`);
}
$kernbit="32-bit kernel" if ($osmajor <= 10);
if (-x '/usr/contrib/bin/machinfo') {
@machinfo=&run("/usr/contrib/bin/machinfo");
&hpux_machinfo;
} elsif (-x '/usr/sbin/ioscan') {
$ncpu=&mychomp(`/usr/sbin/ioscan -kfnC processor | grep '^processor' | wc -l`);
} else {
# Get CPU count from kernel
if ($machine eq "ia64") {
$ncpu=&hpux_kernelval("active_processor_count");
} else {
$ncpu=&hpux_kernelval("processor_count");
}
}
$ncpu=1 if (! defined($ncpu)); # Assume it has at least 1 CPU
$cpubanner .= "$ncpu X " if ($ncpu > 1);
if ($machine =~ /^9000\//) {
$schedmodel=$model;
$schedmodel=~s/^.*\/(.*$)/$1/;
if (-r '/usr/sam/lib/mo/sched.models') {
$cputype=&myawk('/usr/sam/lib/mo/sched.models',"^$schedmodel\\b",2);
}
if ($cputype eq "" && -r '/opt/langtools/lib/sched.models') {
$cputype=&myawk('/opt/langtools/lib/sched.models',"^$schedmodel\\b",2);
}
if ($cputype eq "" && -r '/usr/lib/sched.models') {
$cputype=&myawk('/usr/lib/sched.models',"^$schedmodel\\b",2);
}
$cpubanner .= "$cputype " if ($cputype ne "");
if ($cpuversion == 768) {
$cpubanner .= "Itanium[TM] 1";
} elsif ($cpuversion == 524) {
$cpubanner .= "Motorola MC68020";
} elsif ($cpuversion == 525) {
$cpubanner .= "Motorola MC68030";
} elsif ($cpuversion == 526) {
$cpubanner .= "Motorola MC68040";
} else {
$cpubanner .= "PA-RISC";
if ($cpuversion == 532) {
$cpubanner .= " 2.0";
} elsif ($cpuversion == 529) {
$cpubanner .= " 1.2";
} elsif ($cpuversion == 528) {
$cpubanner .= " 1.1";
} elsif ($cpuversion == 523) {
$cpubanner .= " 1.0";
} elsif (&hpux_kernelval("cpu_arch_is_2_0")) {
$cpubanner .= " 2.0";
} elsif (&hpux_kernelval("cpu_arch_is_1_1")) {
$cpubanner .= " 1.1";
} elsif (&hpux_kernelval("cpu_arch_is_1_0")) {
$cpubanner .= " 1.0";
}
}
} else {
$cpubanner .= "$machine";
}
# Get CPU speed from kernel
$cfreq=&hpux_kernelval("itick_per_usec");
if (defined($cfreq)) {
$cpubanner .= ", ${cfreq}MHz";
} else {
$cfreq=&hpux_kernelval("itick_per_tick");
if (defined($cfreq)) {
$cfreq /= 10000;
$cpubanner .= ", ${cfreq}MHz";
}
}
} else {
$model="";
$machine="";
$platform="";
$os="HP-UX";
}
$model="HP $model" if ($model !~ /HP/i);
$model=~s/ +$//;
# Use HP-UX Support Tool Manager software to attempt to report memory
if ($filename eq "") {
&show_header;
@config=&run("$config_cmd");
}
foreach $line (@config) {
$line=&dos2unix($line);
next if ($line eq "\n" || $line =~ /^ +$/ || $line =~ /^ +=+$/);
if ($line =~ /=\-\+\-=/) {
$flag_mem=0; # End of section
next;
}
if ($line =~ /\bPA [78]\d+.* CPU\b/) {
$cputype=&mychomp($line);
$cputype=~s/^.* (PA [78]\d+).*/$1/;
$cputype=~s/ //g;
print &runtime . "hpux_cstm cputype=$cputype\n" if ($DEBUG);
$ncpu++;
}
if ($line =~ /^'9000\// && $model eq "HP" && $machine eq "") {
@linearr=split(' ', $line);
$machine=$linearr[0];
$machine=~s/\'//g;
$platform=$machine;
$model="HP $machine";
}
if ($flag_mem == 1) {
next if ($line =~ /Log creation time/);
if ($line =~ /^-- Information Tool Log for /) {
$flag_mem=0; # End of memory section
next;
}
push(@boards_mem, "$line");
$boardfound_mem=1;
}
if (($line =~ /^-- Information Tool Log for .*MEMORY /) && ($flag_mem == 0)) {
$flag_mem=1; # Start of memory section
}
}
if ($machine =~ /^9000\/7/) {
$modelmore="workstation";
} elsif ($machine =~ /^9000\/8/) {
$modelmore="server";
}
if ($filename ne "") {
&hpux_machinfo;
if ($cputype ne "") {
$cpubanner="$ncpu X " if ($ncpu > 1);
$cpubanner .= "$cputype";
} else {
$cpubanner="$ncpu cpus" if ($ncpu > 1);
}
if (defined($cfreq)) {
$cpubanner .= ", ${cfreq}MHz";
}
&show_header;
}
if ($boardfound_mem) {
print "@boards_mem";
} else {
if ($filename eq "") {
# Get total memory from kernel
if ($osmajor > 10) {
$totmem=&hpux_kernelval("memory_installed_in_machine");
} else {
$totmem=&hpux_kernelval("physmem");
}
if (defined($totmem)) {
$totmem /= 256; # Convert pages to MB
} else {
$totmem=0;
}
if (-r '/var/adm/syslog/syslog.log' && $totmem == 0) {
open(FILE, "</var/adm/syslog/syslog.log");
@syslog=<FILE>;
close(FILE);
@physical=grep(/Physical:/,@syslog);
foreach $line (@physical) {
@linearr=split(' ', $line);
$totmem=$linearr[6] / 1024;
last;
}
}
print " Total Physical Memory : ${totmem}MB\n" if ($totmem > 0);
}
print "ERROR: /usr/sbin/cstm did not report the memory installed in this HP-UX system.\n";
print " Cannot display detailed memory configuration. Aborting.\n";
$exitstatus=1;
}
# Flag untested CPU types (machine="" on regression test files)
if ($machine eq "" || $machine =~ /^9000\// || $machine eq "ia64") {
# Tested HP-UX on PA-RISC and Itanium
$untested=0;
} else {
$untested=1;
$untested_type="CPU" if ("$untested_type" eq "");
}
&show_untested if ($untested);
&mailmaintainer if ($verbose == 3);
exit $exitstatus;
}
sub hpux_kernelval {
return if (! -r '/dev/kmem');
$_=shift;
$kernel="/hp_ux";
$kernel="/stand/vmunix" if (-f '/stand/vmunix');
$adb="/usr/bin/adb";
$adb .= " -o" if ($machine eq "ia64");
$kernelval=`echo "$_/D" | $adb $kernel /dev/kmem 2>/dev/null | tail -1`;
@linearr=split(' ', $kernelval);
return $linearr[1];
}
sub hpux_machinfo {
print &runtime . "in hpux_machinfo\n" if ($DEBUG);
$flag_cpu=0;
$flag_platform=0;
$flag_os=0;
# parse machinfo output for CPU and other information
foreach $line (@machinfo) {
$line=&dos2unix($line);
$line=&mychomp($line);
if ($line eq "" || $line =~ /^ +$/) {
# End of sections
$flag_cpu=0;
$flag_platform=0;
$flag_os=0;
next;
}
if ($line =~ /^CPU info:/) {
$flag_cpu=1; # Start of CPU section
next;
}
if ($flag_cpu == 1) {
# Parse CPU count, type and frequency for cpubanner
if ($line =~ /^ *\d+ .*processors* \(\d.*Hz,/) {
$ncpu=$line;
$ncpu=~s/^ *(\d+) .*/$1/;
$cputype=$line;
$cputype=~s/^ *\d+ (.*) processor.*/$1/;
$cfreq=$line;
$cfreq=~s/^.*processor.* \((\d.* [GM]Hz),/$1/;
if ($cfreq =~ /GHz/) {
$cfreq=~s/ GHz.*$//;
$cfreq *= 1000;
} else {
$cfreq=~s/ MHz.*$//;
}
$flag_cpu=0;
print &runtime . "hpux_machinfo cputype=$cputype\n" if ($DEBUG);
next;
} elsif ($line =~ /Number of CPUs = /) {
@linearr=split('=', $line);
$ncpu=$linearr[1];
$ncpu=~s/^ *//;
next;
} elsif ($line =~ /processor model: /) {
@linearr=split(':', $line);
$cputype=$linearr[1];
$cputype=~s/^ *\d+ +//;
$cputype=~s/ processor$//;
print &runtime . "hpux_machinfo cputype=$cputype\n" if ($DEBUG);
next;
} elsif ($line =~ /Clock speed = \d+ [GM]Hz/) {
@linearr=split('=', $line);
$cfreq=$linearr[1];
$cfreq=~s/^ *//;
if ($cfreq =~ /GHz/) {
$cfreq=~s/ GHz//;
$cfreq *= 1000;
} else {
$cfreq=~s/ MHz//;
}
next;
}
}
if ($line =~ /^Platform info:/) {
$flag_platform=1; # Start of Platform section
next;
}
if ($flag_platform == 1 && $model eq "HP" && $line =~ /\bModel/i) {
@linearr=split('[:=]', $line);
$model=$linearr[1];
$model=~s/^ +//;
$model=~s/"//g;
$model=~s/ +$//;
if ($model =~ /^ia64/) {
$machine="ia64";
$platform="ia64";
$kernbit="64-bit kernel";
}
$model="HP $model" if ($model !~ /HP/i);
next;
}
if ($line =~ /^OS info:/) {
$flag_os=1; # Start of OS section
next;
}
if ($flag_os == 1 && $osrel eq "" && $line =~ /\bRelease/i) {
@linearr=split('[:=]', $line);
$osrel=$linearr[1];
$osrel=~s/^ +//;
$osrel=~s/^HP-UX //;
&hpux_osrelease;
next;
}
}
}
sub hpux_osrelease {
if ($osrel eq "B.11.11") {
$osrelease="11i v1";
} elsif ($osrel eq "B.11.20") {
$osrelease="11i v1.5";
} elsif ($osrel eq "B.11.22") {
$osrelease="11i v1.6";
} elsif ($osrel eq "B.11.23") {
$osrelease="11i v2";
} elsif ($osrel eq "B.11.31") {
$osrelease="11i v3";
}
}
sub myawk {
$awkfile=shift;
$awksearch=shift;
$awkfield=shift;
open(FILE, "<$awkfile");
@tmp=<FILE>;
close(FILE);
foreach $line (@tmp) {
if ($line =~ /$awksearch/) {
@linearr=split(' ', $line);
return $linearr[$awkfield];
}
}
return "";
}
sub x86_devname {
return if ($have_x86_devname);
return if ($machine =~ /sun4/);
return if (! defined($model));
print &runtime . "in x86_devname, model=$model\n" if ($DEBUG);
# x86 Sun development names and family part number
$m=(defined($manufacturer)) ? "$manufacturer $model" : $model;
$m=~s/-/ /g;
$untested=2 if ($m =~ /Sun /i || $m =~ /Netra /i);
if ($m =~ /Sun .*W1100z\b/i) {
$devname="Metropolis 1P";
$familypn="A58";
}
if ($m =~ /Sun .*W2100z\b/i) {
$devname="Metropolis 2P";
$familypn="A59";
}
if ($m =~ /Sun .*W1100z.*2100z\b/i) {
$devname="Metropolis";
$familypn="A58 (W1100z), A59 (W2100z)";
$untested=0 if ("$os" eq "Linux");
}
if ($m =~ /Sun .*V20z\b/i) {
$devname="Stinger 2P";
$familypn="A55";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*V40z\b/i) {
$devname="Stinger 4P";
$familypn="A57";
$untested=0;
}
if ($m =~ /Sun .*V20z.*40z\b/i) {
$devname="Stinger";
$familypn="A55 (V20z), A57 (V40z)";
}
if ($m =~ /Sun .*X2100\b/i) {
$devname="Aquarius";
$familypn="A75";
$untested=0;
}
if ($m =~ /Sun .*X2100 M2\b/i) {
$devname="Leo";
$familypn="A84";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X2200 M2\b/i) {
$devname="Taurus";
$familypn="A85";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X2200 speedbump\b/i) {
# AMD 4-Core Barcelona processor
$devname="Taurus2";
}
if ($m =~ /Sun .*X2250\b/i) {
$devname="Venus";
}
if ($m =~ /Sun .*X2270\b/i) {
# X2270 has 1 or 2 Quad-Core hyperthreaded CPUs
$hyperthread=1;
}
if ($m =~ /Sun .*X4100\b/i) {
$devname="Galaxy 1U";
$familypn="A64";
$untested=0;
}
if ($m =~ /Sun .*X4100 M2\b/i) {
$devname="Galaxy 1F";
$familypn="A86";
$untested=0;
}
if ($m =~ /Sun .*X4100E\b/i) {
$devname="Galaxy 1E"; # Cancelled
$familypn="A72";
}
if ($m =~ /Sun .*X4140\b/i) {
$devname="Dorado 1U";
$familypn="B12";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X4150\b/i) {
$devname="Doradi 1U";
$familypn="B13";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X4170\b/i) {
# X4170 has 1 or 2 Quad-Core hyperthreaded CPUs
$hyperthread=1;
$devname="Lynx 1U";
$untested=0 if ("$os" eq "Linux");
}
if ($m =~ /Sun .*X4200\b/i) {
$devname="Galaxy 2U";
$familypn="A65";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X4200 M2\b/i) {
$devname="Galaxy 2F";
$familypn="A87";
$untested=0;
}
if ($m =~ /Netra .*X4200\b/i) {
$devname="Draco";
$familypn="N87";
}
if ($m =~ /Sun .*X4200E\b/i) {
$devname="Galaxy 2E"; # Cancelled
$familypn="A73";
}
if ($m =~ /Sun .*X4240\b/i) {
$devname="Dorado 2U";
$familypn="B14";
}
if ($m =~ /Netra .*X4250\b/i) {
$devname="Aries";
}
if ($m =~ /Sun .*X4250\b/i) {
$devname="Doradi 2U";
}
if ($m =~ /Sun .*X4270\b/i || $m =~ /Sun .*X4275\b/i ) {
# X4270/X4275 has 1 or 2 Quad-Core hyperthreaded CPUs
$hyperthread=1;
$devname="Lynx 2U";
$untested=0;
}
if ($m =~ /Sun .*X4440\b/i) {
$devname="Tucana";
$familypn="B16";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X4450\b/i) {
$devname="Tucani";
$familypn="B15";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Netra .*X4450\b/i) {
$devname="Argo";
}
if ($m =~ /Sun .*X4500\b/i) {
$devname="Thumper";
$familypn="A76";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X4540\b/i) {
$devname="Thor";
$familypn="B24";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X4600\b/i) {
$devname="Galaxy 4U";
$familypn="A67"; # Same for X4600 M2
$devname="Galaxy 4F" if ($m =~ /Sun .*X4600 M2\b/);
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X4950\b/i) {
$devname="Streamstar StreamSwitch 2";
$familypn="A91";
}
# The Sun Blade 8000 Modular System uses the Sun Blade
# X8420/X8440/X8450 Server Modules
if ($m =~ /Sun .*Blade 8000\b/i) {
$devname="Andromeda 19";
$familypn="A81";
if ($m =~ /Sun .*Blade 8000 P\b/i) {
$devname="Andromeda 14";
$familypn="A82";
}
$untested=2;
}
if ($m =~ /Sun .*Fire V60x\b/i) {
$devname="Grizzly";
$familypn="A48";
}
if ($m =~ /Sun .*Fire V65x\b/i) {
$devname="Grizzly 2U";
$familypn="A48";
}
if ($m =~ /Sun .*Ultra *20\b/i) {
$devname="Marrakesh";
$familypn="A63";
$untested=2;
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*Ultra *20 M2\b/i) {
$devname="Munich";
$familypn="A88";
$untested=2;
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*Ultra *24\b/i) {
$devname="Ursa";
$familypn="B21";
$untested=0;
}
if ($m =~ /Sun .*Ultra *40\b/i) {
$devname="Sirius";
$familypn="A71";
$untested=2;
$untested=0 if ("$os" eq "Linux");
}
if ($m =~ /Sun .*Ultra *40 M2\b/i) {
$devname="Stuttgart";
$familypn="A83";
$untested=2;
$untested=0 if ("$os" eq "SunOS");
}
# The Sun Blade 6000 and 6048 Modular Systems use the Sun Blade
# X6220, X6250 or T6300 Server Modules.
if ($m =~ /Sun .*Blade 6000\b/i) {
$devname="Constellation 10";
$familypn="A90";
$untested=2;
}
if ($m =~ /Sun .*Blade 6048\b/i) {
$devname="Constellation 48";
$familypn="B22";
$untested=2;
}
if ($m =~ /Sun .*X6220\b/i) {
$devname="Gemini";
$familypn="A92";
}
if ($m =~ /Sun .*X6240\b/i) {
$devname="Gemini+";
}
if ($m =~ /Sun .*X6250\b/i) {
$devname="Wolf";
$familypn="A93";
$untested=0 if ("$os" eq "SunOS");
}
if ($m =~ /Sun .*X6270\b/i) {
# X6270 has 1 or 2 Quad-Core hyperthreaded CPUs
$hyperthread=1;
}
if ($m =~ /Sun .*X6275\b/i ) {
# X6275 has 2 or 4 Quad-Core hyperthreaded CPUs
$hyperthread=1;
}
if ($m =~ /Sun .*X6420\b/i) {
$devname="Pegasus";
}
if ($m =~ /Sun .*X6440\b/i) {
$devname="Pegasus+";
}
if ($m =~ /Sun .*X6450\b/i) {
$devname="Hercules2";
}
if ($m =~ /Sun .*X8400\b/i) {
$devname="Andromeda";
}
if ($m =~ /Sun .*X8420\b/i) {
$devname="Capella";
}
if ($m =~ /Sun .*X8440\b/i) {
$devname="Mira";
$familypn="A98";
}
if ($m =~ /Sun .*X8450\b/i) {
# Quad-Core CPU for Sun Blade 8000 chassis
$devname="Scorpio";
}
if ($m =~ /Sun .*X8600\b/i) {
$devname="Antares";
}
$have_x86_devname=1 if ($devname ne "");
}
sub linux_release {
$release="";
$kernbit="";
$kernbit="32-bit kernel, " if ($machine =~ /i.86/ || $machine =~ /sparc/);
$kernbit="64-bit kernel, " if ($machine eq "x86_64" || $machine eq "sparc64" || $machine eq "ia64");
if (-f '/etc/freebsd-update.conf') {
# FreeBSD
@linearr=split(' ', $kernver);
$release=$linearr[0] . " " . $linearr[1];
$release .= ", $kernbit$os $osrel";
return;
}
foreach $relfile ('/etc/centos-release','/etc/fedora-release',
'/etc/mandriva-release','/etc/mandrakelinux-release',
'/etc/mandrake-release','/etc/slackware-version',
'/etc/gentoo-release','/etc/redhat-release',
'/etc/SuSE-release') {
if (-f "$relfile") {
$release=&mychomp(`head -1 $relfile`);
$release .= ", $kernbit$os $osrel";
return;
}
}
if (-d '/KNOPPIX') {
if (-r '/cdrom/index.html') {
open(FILE, "</cdrom/index.html");
while(<FILE>) {
if (/<TITLE>/) {
$release=&mychomp($_);
$release=~s/<TITLE>//;
$release=~s/<\/TITLE.*//;
}
}
close(FILE);
} elsif (-r '/init') {
open(FILE, "</init");
while(<FILE>) {
if (/DISTRO=/) {
$release=&mychomp($_);
$release=~s/.*DISTRO="*(.*)$/$1/;
$release=~s/"//g;
}
}
close(FILE);
}
$release="Knoppix" if ($release eq "");
$release .= ", $kernbit$os $osrel";
if (-f '/etc/issue') {
$tmp=&mychomp(`head -1 /etc/issue`);
$tmp=~s/\s*\\n.*//;
$release .= ", $tmp";
}
return;
} elsif (-f '/gos/gOS/gos.html') {
$release="gOS, $kernbit$os $osrel";
if (-f '/etc/issue') {
$tmp=&mychomp(`head -1 /etc/issue`);
$tmp=~s/\s*\\n.*//;
$release .= ", $tmp";
}
return;
} elsif (-f '/etc/motd.static') {
$release=&mychomp(`head -1 /etc/motd.static`);
$release=~s/\s*\(.*//;
$release=~s/^Welcome to //;
$release .= ", $kernbit$os $osrel";
if ($release =~ /Knoppix/i && -f '/etc/issue') {
$tmp=&mychomp(`head -1 /etc/issue`);
$tmp=~s/\s*\\n.*//;
$release="Knoppix, $kernbit$os $osrel, $tmp";
}
return;
} elsif (-f '/etc/issue') {
$release=&mychomp(`head -1 /etc/issue`);
$release=~s/\s*\\n.*//;
($release)=(/Welcome to (.*) - /) if ($release =~ /Welcome to /);
} elsif (-f '/etc/motd') {
$release=&mychomp(`head -1 /etc/motd`);
$release=~s/\s*\(.*//;
$release=~s/^Welcome to //;
}
$release=(defined($release)) ? "$release, $kernbit$os $osrel" : "";
}
sub roundup_memory {
$newval=shift;
# Round up memory (may have 128MB or more reserved)
for ($val=1024; $val <= 4096; $val += 512) {
$newval=$val if ($newval >= $val-128 && $newval < $val);
}
for ($val=4096; $val <= 7168; $val += 1024) {
$newval=$val if ($newval >= $val-256 && $newval < $val);
}
for ($val=7168; $val <= 14336; $val += 1024) {
$newval=$val if ($newval >= $val-512 && $newval < $val);
}
for ($val=14336; $val <= 262144; $val += 2048) {
$newval=$val if ($newval >= $val-512 && $newval < $val);
}
return($newval);
}
sub check_dmidecode_ver {
@dmidecode_verarr=split(/\./, $dmidecode_ver);
@latest_dmidecode_verarr=split(/\./, $latest_dmidecode_ver);
if (($dmidecode_verarr[0] < $latest_dmidecode_verarr[0]) ||
($dmidecode_verarr[0] == $latest_dmidecode_verarr[0] &&
$dmidecode_verarr[1] < $latest_dmidecode_verarr[1])) {
print " Your dmidecode package is an old version";
print " ($dmidecode_ver)" if ($dmidecode_ver);
print ", so consider upgrading\n";
print " to dmidecode-$latest_dmidecode_ver or later.\n";
} elsif ($dmidecode_ver) {
print " Your dmidecode version is $dmidecode_ver.\n";
}
}
sub linux_dmi {
&find_helpers;
if (($filename eq "") && ($free_cmd ne "")) {
# Check memory detected by OS
@free=&run("$free_cmd");
$have_free_data=1;
}
if ($have_free_data) {
foreach $line (@free) {
$line=&dos2unix($line);
if ($line =~ /Mem:/) {
@linearr=split(' ', $line);
$freephys=$linearr[1];
last;
}
}
}
$DMI6=0;
$DMI6cnt=0;
$DMI6totmem=0;
$DMI17=0;
$DMI17cnt=0;
$DMI17totmem=0;
$DMItype=0;
$platform="";
$FoundEnd=0;
$config_command="dmidecode";
if ($filename eq "") {
$DmiFile="$config_cmd 2>&1 |";
&linux_release if ("$release" eq "");
if ($ipmitool_cmd ne "" && $have_ipmitool_data == 0) {
@ipmitool=&run("$ipmitool_cmd fru");
$have_ipmitool_data=1;
}
} else {
$DmiFile="<$filename";
}
open(FILE, $DmiFile);
while(<FILE>) {
next if (/<OUT OF SPEC>/i || / Unknown/i || /: Other/i || /: \.\./ || /: Not Specified/i || /:\s+$/);
($dmidecode_ver)=(/.* dmidecode (.*)/i) if (/ dmidecode /i);
($permission_error)=(/(.*)/) if (/Permission denied/i);
($dmidecode_error)=(/# *(.*)/) if (/No SMBIOS nor DMI entry point found/i);
($DMItype)=(/DMI type (\d+)/i) if (/\bDMI type /i);
# Keep walking the dmidecode output for more about the system
# Check system information
if ($DMItype == 1) {
($manufacturer)=(/: +(.*\S) *$/) if (/^\s*Manufacturer: /i || /^\s*Vendor: /i);
($model)=(/: +(.*\S) *$/) if (/^\s*Product Name: /i || /^\s*Product: /i);
}
if ($DMItype == 2) {
if ($manufacturer) {
if ($manufacturer =~ /To Be Filled/i || $manufacturer =~ /System Manufacturer/i) {
($manufacturer)=(/: +(.*\S) *$/) if (/^\s*Manufacturer: /i || /^\s*Vendor: /i);
}
} else {
($manufacturer)=(/: +(.*\S) *$/) if (/^\s*Manufacturer: /i || /^\s*Vendor: /i);
}
if ($model) {
if ($model =~ /To Be Filled/i || $model =~ /System Name/i || $model =~ /XXXX/i) {
($model)=(/: +(.*\S) *$/) if (/^\s*Product Name: /i || /^\s*Product: /i);
if ($manufacturer) {
$model=~s/^$manufacturer // if ($model);
}
}
} else {
($model)=(/: +(.*\S) *$/) if (/^\s*Product Name: /i || /^\s*Product: /i);
if ($manufacturer) {
$model=~s/^$manufacturer // if ($model);
}
}
}
# Check CPU information
if ($DMItype == 4) {
if (/^\s*Processor Information$/i || /^\s*Processor$/i) {
$cpuarr++;
$ncpu++;
}
($CPUSocketDesignation[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*Socket Designation: /i);
($CPUFamily[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*Family: /i || /^\s*Processor Family: /i);
if (/^\s*Manufacturer: /i || /^\s*Processor Manufacturer: /i) {
($CPUManufacturer[$cpuarr])=(/: +(.*\S) *$/);
$CPUManufacturer[$cpuarr]=~s/GenuineIntel/Intel/;
}
($CPUVersion[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*Version: /i || /^\s*Processor Version: /i);
($ExtSpeed[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*External Clock: /i);
($CPUSpeed[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*Current Speed: /i);
if (/^\s*Status: /i) {
($CPUStatus[$cpuarr])=(/: +(.*\S) *$/);
if ($CPUStatus[$cpuarr] =~ /Unpopulated/i) {
$ncpu--;
$necpu++;
}
}
}
# Check memory controller information
if ($DMItype == 5) {
($ECC)=(/: +(.*\S) *$/) if (/^\s*Error Detecting Method: /i && ! $ECC);
($interleave)=(/: +(.*\S) *$/) if (/^\s*Current Interleave: /i && $interleave eq "0");
($MAXMEM)=(/: +(.*\S) *$/) if (/^\s*Maximum Total Memory Size: /i && ! $MAXMEM);
}
# Check each memory device
if ($DMItype == 6) {
$DMI6=1;
$memarr++ if (/^\s*Memory Module Information$/i || /^\s*Memory Bank$/i);
($Locator6[$memarr])=(/: +(.*\S) *$/) if (/^\s*Socket Designation: /i || /^\s*Socket: /i);
($Speed6[$memarr])=(/: +(.*\S) *$/) if (/^\s*Current Speed: /i);
($Type6[$memarr])=(/: +(.*\S) *$/) if (/^\s*Type: /i);
if (/^\s*Installed Size: /i) {
($Size6[$memarr])=(/: +(.*\S) *$/);
if ($Size6[$memarr] !~ /Not Installed/i && $Size6[$memarr] !~ /No Module Installed/i) {
$simmsize=$Size6[$memarr];
$simmsize=~s/ *MB.*//ig;
$DMI6totmem += $simmsize if ($simmsize);
$SizeDetail[$memarr]=$Size6[$memarr];
$Size6[$memarr]=$simmsize . "MB";
$SizeDetail[$memarr]=~s/\d+ *MBy*t*e* *//i;
}
}
$DMI6cnt=$memarr + 1;
}
# SMBIOS 2.1 added DMI Types 16 & 17, obsoleting Types 5 & 6
# Check physical memory array
if ($DMItype == 16) {
($ECC)=(/: +(.*\S) *$/) if (/^\s*Error Correction Type: /i && ! $ECC);
($MAXMEM)=(/: +(.*\S) *$/) if (/^\s*Maximum Capacity: /i && ! $MAXMEM);
($NUMMOD)=(/: +(.*\S) *$/) if (/^\s*Number Of Devices: /i && ! $NUMMOD);
}
# Check each memory device
if ($DMItype == 17) {
if ($DMI6) {
# Prefer DMI type 17 information over DMI type 6
$memarr=-1 if (! $DMI17);
}
$DMI17=1;
$memarr++ if (/^\s*Memory Device$/i);
($FormFactor[$memarr])=(/: +(.*\S) *$/) if (/^\s*Form Factor: /i);
($Locator17[$memarr])=(/: +(.*\S) *$/) if (/^\s*Locator: /i);
($BankLocator[$memarr])=(/: +(.*\S) *$/) if (/^\s*Bank Locator: /i);
($Type17[$memarr])=(/: +(.*\S) *$/) if (/^\s*Type: /i);
($TypeDetail[$memarr])=(/: +(.*\S) *$/) if (/^\s*Type Detail: /i);
($Size17[$memarr])=(/: +(.*\S) *$/) if (/^\s*Size: /i);
($Speed17[$memarr])=(/: +(.*\S) *$/) if (/^\s*Speed: /i);
($MemManufacturer[$memarr])=&get_mfg(/: +(.*\S) *$/) if (/^\s*Manufacturer: /i);
($MemPartNum[$memarr])=(/: +(.*\S) *$/) if (/^\s*Part Number: /i && ! /PartNum\d/i);
# Ignore Flash chips for DMI17cnt
$DMI17cnt=$memarr + 1 if (/^\s*Form Factor: /i && ! /\bChip\b/i);
if (/^\s*Size: /i) {
($Size17[$memarr])=(/: +(.*\S) *$/);
# Ignore Flash chips for DMI17totmem (Size
# reported as KB)
if ($Size17[$memarr] !~ /Not Installed/i && $Size17[$memarr] !~ /No Module Installed/i && $Size17[$memarr] !~ / *KB/i) {
$simmsize=$Size17[$memarr];
$simmsize=~s/ *MB.*//ig;
$DMI17totmem += $simmsize if ($simmsize);
}
}
}
$FoundEnd=1 if (/End.Of.Table/i);
}
close(FILE);
# Check kernel to see how many processors it sees (for multi-core and
# hyperthreaded CPUs)
if (($filename eq "") && -r '/proc/cpuinfo') {
open(FILE, "/proc/cpuinfo");
@cpuinfo=<FILE>;
close(FILE);
$have_cpuinfo_data=1;
}
if ($have_cpuinfo_data) {
foreach $line (@cpuinfo) {
$line=&dos2unix($line);
$_=$line;
$cpucnt_cpuinfo++ if (/^processor\b.*: \d+/);
$corecnt_cpuinfo++ if (/^core id\b.*: \d+/);
($cpucores_cpuinfo)=(/^cpu cores\b.*: (.*)$/) if (/^cpu cores\b.*: \d+/);
# Only GenuineIntel x86 has hyperthreading capability
$foundGenuineIntel=1 if (/^vendor_id\b.*: GenuineIntel/);
if (/^model name\b.*: /) {
($cputype_cpuinfo)=(/^model name\b.*: (.*)$/);
$cputype_cpuinfo=&cleanup_cputype($cputype_cpuinfo);
}
}
print &runtime . "cputype_cpuinfo=$cputype_cpuinfo, ncpu=$ncpu, cpucnt_cpuinfo=$cpucnt_cpuinfo, corecnt_cpuinfo=$corecnt_cpuinfo, cpucores_cpuinfo=$cpucores_cpuinfo, foundGenuineIntel=$foundGenuineIntel\n" if ($DEBUG);
}
# hash CPUs
for ($val=0; $val < $ncpu; $val++) {
$cputype="";
$cpufreq="";
if ($CPUVersion[$val]) {
if ($CPUVersion[$val] eq "AMD" && $cputype_cpuinfo ne "" && ! &is_virtualmachine) {
print &runtime . "Adding \$cputype_cpuinfo=$cputype_cpuinfo to cputype\n" if ($DEBUG);
$cputype .= "$CPUManufacturer[$val] " if ($CPUManufacturer[$val] ne "" && $cputype_cpuinfo !~ /$CPUManufacturer[$val]/i);
$cputype .= "$cputype_cpuinfo ";
} else {
print &runtime . "Adding \$CPUVersion[\$val]=$CPUVersion[$val] to cputype\n" if ($DEBUG);
$cputype .= "$CPUManufacturer[$val] " if ($CPUManufacturer[$val] ne "" && $CPUVersion[$val] !~ /$CPUManufacturer[$val]/i);
$CPUVersion[$val]=&cleanup_cputype($CPUVersion[$val]);
$cputype .= "$CPUVersion[$val] ";
}
} elsif ($cputype_cpuinfo ne "" && ! &is_virtualmachine) {
print &runtime . "Adding \$cputype_cpuinfo=$cputype_cpuinfo to cputype\n" if ($DEBUG);
$cputype .= "$CPUManufacturer[$val] " if ($CPUManufacturer[$val] ne "" && $cputype_cpuinfo !~ /$CPUManufacturer[$val]/i);
$cputype .= "$cputype_cpuinfo ";
} else {
$cputype .= "$CPUManufacturer[$val] " if ($CPUManufacturer[$val]);
$cputype .= "$CPUFamily[$val] " if ($CPUFamily[$val]);
}
if (! $machine && $CPUFamily[$val]) {
$machine="ia64" if ($CPUFamily[$val] eq "Itanium");
}
$cputype=~s/^\s+//;
$cputype=~s/\s+$//;
$cputype=~s/ +/ /g;
if ($ncpu < $cpucnt_cpuinfo && $cpucnt_cpuinfo > 0) {
# Distinguish Dual-Core from hyperthreading
$hyperthread=1 if ($foundGenuineIntel && $corecnt_cpuinfo != $ncpu * $cpucores_cpuinfo && $cpucores_cpuinfo > 0 && $corecnt_cpuinfo > 1);
if ($cpucores_cpuinfo > 0) {
$cputype=&multicore_cputype($cputype,$cpucores_cpuinfo);
} else {
$cputype=&multicore_cputype($cputype,$cpucnt_cpuinfo / $ncpu);
}
}
if ($CPUSpeed[$val]) {
$cpufreq="$CPUSpeed[$val]";
$cpufreq=~s/ *MHz$//;
$CPUSpeed[$val]=~s/ *MHz$/MHz/;
}
&x86multicorecnt($cputype);
$cpucnt{"$cputype $cpufreq"}++;
$cpucntfrom="dmidecode";
$ExtSpeed[$val]=~s/ *MHz$/MHz/ if ($ExtSpeed[$val]);
}
@cputypecnt=keys(%cpucnt);
$x=0;
while (($cf,$cnt)=each(%cpucnt)) {
$x++;
$cf=~/^(.*) (\d*)$/;
$ctype=$1;
$cfreq=$2;
$cpubanner .= "$cnt X " if ($cnt > 1);
$cpubanner .= "$ctype";
$cpubanner .= " ${cfreq}MHz" if ($cfreq ne "" && $ctype !~ /Hz$/);
$cpubanner .= ", " if ($x < scalar(@cputypecnt));
}
$machine="x86" if (! $machine);
&x86_devname;
#
# Print information
#
&show_header;
if ($permission_error) {
print "ERROR: $permission_error\n";
print " This user does not have permission to run $config_command.\n";
print " Try running memconf as a privileged user like root.\n" if ($uid ne "0");
exit 1;
}
# CPU information
if ($verbose > 0) {
print "WARNING: CPU Information Unknown\n" if ($cpuarr < 0);
for ($cnt=0; $cnt <= $cpuarr; $cnt++) {
if ($CPUSocketDesignation[$cnt]) {
if ($CPUSocketDesignation[$cnt] eq "Microprocessor") {
print "CPU$cnt: ";
} else {
print "$CPUSocketDesignation[$cnt]: ";
}
}
if ($CPUStatus[$cnt]) {
if ($CPUStatus[$cnt] =~ /Unpopulated/i) {
print "$CPUStatus[$cnt]\n";
next;
}
}
$ctype="";
if ($CPUVersion[$cnt]) {
$ctype .= "$CPUManufacturer[$cnt] " if ($CPUManufacturer[$cnt] ne "" && $CPUVersion[$cnt] !~ /$CPUManufacturer[$cnt]/i);
$ctype .= "$CPUVersion[$cnt] ";
} else {
$ctype .= "$CPUManufacturer[$cnt] " if ($CPUManufacturer[$cnt]);
$ctype .= "$CPUFamily[$cnt] " if ($CPUFamily[$cnt]);
}
print "$ctype";
if ($CPUSpeed[$cnt]) {
print "$CPUSpeed[$cnt] " if ($ctype !~ /Hz $/);
}
print "cpu";
print ", system freq: $ExtSpeed[$cnt]" if ($ExtSpeed[$cnt]);
print "\n";
}
}
# Memory information
print "Memory Error Correction: $ECC\n" if ($ECC && ! &is_virtualmachine);
$max=0;
if ($MAXMEM) {
if ($MAXMEM =~ /\d+ MB/) {
$max=$MAXMEM;
$max=~s/ MB//g;
} elsif ($MAXMEM =~ /\d+ GB/) {
$max=$MAXMEM;
$max=~s/ GB//g;
$max *= 1024;
}
}
for ($cnt=0; $cnt <= $memarr; $cnt++) {
# Prefer DMI type 17 information over DMI type 6
$DMI=17;
$DMI=6 if ($DMI6 & ! $DMI17);
# Prefer DMI type 6 information if DMI type 6 reports different
# total memory than DMI type 17
$DMI=6 if ($DMI6 & $DMI17 && $DMI6totmem != $DMI17totmem);
if ($DMI == 6) {
next if (! $Size6[$cnt]);
if ($Type6[$cnt]) {next if ($Type6[$cnt] =~ /Flash/i);}
if (defined($Locator6[$cnt]) && defined($BankLocator[$cnt])) {
$BankLocator[$cnt]="" if ($Locator6[$cnt] eq $BankLocator[$cnt]);
if ($Locator6[$cnt] =~ /:/ && $BankLocator[$cnt] =~ /:/) {
$Loc1=$Locator6[$cnt];
$Loc1=~s/.*://;
$Loc2=$BankLocator[$cnt];
$Loc2=~s/.*://;
$Locator6[$cnt]=~s/:.*// if ($Loc1 eq $Loc2);
}
}
if ($Size6[$cnt] =~ /Not Installed/i || $Size6[$cnt] =~ /No Module Installed/i || $Size6[$cnt] =~ /^0 *MB.*/i) {
$sockets_empty .= "," if ($sockets_empty ne "");
$sockets_empty .= " $Locator6[$cnt]";
} else {
$buffer .= "$Locator6[$cnt]";
$simmsize=$Size6[$cnt];
$simmsize=~s/ *MB.*//ig;
$totmem += $simmsize if ($simmsize);
$Size6[$cnt]=~s/MByte/ MB/ig;
$Size6[$cnt]=~s/ +MB/MB/g;
$buffer .= ": $Size6[$cnt]";
$buffer .= " $SizeDetail[$cnt]" if ($SizeDetail[$cnt]);
if ($Speed6[$cnt]) {
$Speed6[$cnt]=~s/ +MHz/MHz/;
$Speed6[$cnt]=~s/ +ns/ns/;
$buffer .= " $Speed6[$cnt]";
} elsif ($Speed17[$cnt]) {
$Speed17[$cnt]=~s/ +MHz/MHz/;
$Speed17[$cnt]=~s/ +ns/ns/;
$buffer .= " $Speed17[$cnt]";
}
if ($TypeDetail[$cnt]) {
$buffer .= " $TypeDetail[$cnt]" if ($TypeDetail[$cnt] !~ /None/i);
}
if ($FormFactor[$cnt]) {
$buffer .= " $Type17[$cnt]";
$buffer .= " $FormFactor[$cnt]" if ($Type17[$cnt] !~ /$FormFactor[$cnt]/);
} elsif ($Type6[$cnt]) {
$buffer .= " $Type6[$cnt]";
}
if ($MemManufacturer[$cnt]) {
$buffer .= ", $MemManufacturer[$cnt]" if ($MemManufacturer[$cnt] !~ /None/i);
if ($MemPartNum[$cnt]) {
$buffer .= " $MemPartNum[$cnt]" if ($MemPartNum[$cnt] !~ /None/i);
}
}
$buffer .= "\n";
}
} else {
next if (! $Size17[$cnt]);
if ($Type17[$cnt]) {next if ($Type17[$cnt] =~ /Flash/i);}
if (defined($Locator17[$cnt]) && defined($BankLocator[$cnt])) {
$BankLocator[$cnt]="" if ($Locator17[$cnt] eq $BankLocator[$cnt]);
if ($Locator17[$cnt] =~ /:/ && $BankLocator[$cnt] =~ /:/) {
$Loc1=$Locator17[$cnt];
$Loc1=~s/.*://;
$Loc2=$BankLocator[$cnt];
$Loc2=~s/.*://;
$Locator17[$cnt]=~s/:.*// if ($Loc1 eq $Loc2);
}
}
if ($Size17[$cnt] =~ /Not Installed/i || $Size17[$cnt] =~ /No Module Installed/i || $Size17[$cnt] =~ /^0 *MB.*/i) {
$sockets_empty .= "," if ($sockets_empty ne "");
$sockets_empty .= " $Locator17[$cnt]";
$sockets_empty .= " $BankLocator[$cnt]" if ($BankLocator[$cnt]);
} else {
$buffer .= "$Locator17[$cnt]";
$buffer .= " $BankLocator[$cnt]" if ($BankLocator[$cnt]);
$simmsize=$Size17[$cnt];
$simmsize=~s/ *MB.*//ig;
$totmem += $simmsize if ($simmsize);
$Size17[$cnt]=~s/MByte/ MB/ig;
$Size17[$cnt]=~s/ +MB/MB/g;
$buffer .= ": $Size17[$cnt]";
$buffer .= " $SizeDetail[$cnt]" if ($SizeDetail[$cnt]);
if ($Speed17[$cnt]) {
$Speed17[$cnt]=~s/ +MHz/MHz/;
$Speed17[$cnt]=~s/ +ns/ns/;
$buffer .= " $Speed17[$cnt]";
} elsif ($Speed6[$cnt]) {
$Speed6[$cnt]=~s/ +MHz/MHz/;
$Speed6[$cnt]=~s/ +ns/ns/;
$buffer .= " $Speed6[$cnt]";
}
if ($TypeDetail[$cnt]) {
$buffer .= " $TypeDetail[$cnt]" if ($TypeDetail[$cnt] !~ /None/i);
}
$buffer .= " $Type17[$cnt]" if ($Type17[$cnt]);
if ($FormFactor[$cnt]) {
if ($Type17[$cnt]) {
$buffer .= " $FormFactor[$cnt]" if ($Type17[$cnt] !~ /$FormFactor[$cnt]/);
} else {
$buffer .= " $FormFactor[$cnt]";
}
}
if ($MemManufacturer[$cnt]) {
$buffer .= ", $MemManufacturer[$cnt]" if ($MemManufacturer[$cnt] !~ /None/i);
if ($MemPartNum[$cnt]) {
$buffer .= " $MemPartNum[$cnt]" if ($MemPartNum[$cnt] !~ /None/i);
}
}
$buffer .= "\n";
}
}
}
if (! &is_virtualmachine) {
print "Maximum Memory: ";
if ((! $MAXMEM) || ($max < $totmem) || ($max == 0)) {
$MAXMEM="Unknown";
$MAXMEM .= " (DMI incorrectly reports ${max}MB)" if (($max < $totmem) && ($max > 0));
print "$MAXMEM\n";
} else {
&show_memory($max);
}
print $buffer if ($buffer ne "");
}
#
# Print total memory
#
if (($memarr < 0) || ($totmem == 0)) {
print "WARNING: Memory Information Unknown\n";
print "WARNING: dmidecode output is truncated\n" if (! $FoundEnd);
&check_dmidecode_ver;
$exitstatus=1;
} else {
&print_empty_memory("memory sockets") if (! &is_virtualmachine);
print "total memory = ";
&show_memory($totmem);
}
print "ERROR: $dmidecode_error\n" if ($dmidecode_error);
if ($freephys > $totmem && ! &is_virtualmachine) {
print "ERROR: Total physical memory (${freephys}MB) is ";
print "greater than the total memory found.\n The total ";
print "physical memory reported by 'free -m' does not match ";
print "the\n memory reported by 'dmidecode'.\n";
print " An upgraded version of dmidecode from ";
print "$dmidecodeURL\n may fix this issue. This is a ";
print "dmidecode bug, not a bug in memconf.\n";
&check_dmidecode_ver;
$recognized=0;
$exitstatus=1;
}
# See if half of the memory is unused due to missing a second CPU
if ($totmem > 0 && $totmem == &roundup_memory($freephys) * 2 && $ncpu == 1 && $necpu == 1) {
print "WARNING: Half of the installed memory is not being ";
print "used due to only having a\n single CPU ";
print "installed in this dual-CPU capable system.\n";
}
if ("$os" eq "Linux" && &roundup_memory($freephys) < $totmem) {
$tmp=0;
@tmp=("");
if (-r '/var/log/dmesg' && ($filename eq "")) {
open(FILE, "</var/log/dmesg");
@tmp=<FILE>;
close(FILE);
} elsif ($filename ne "") {
@tmp=@config;
}
foreach $line (@tmp) {
if ($line =~ /Warning only \d.*B will be used/) {
$line=~s/Warning o/WARNING: O/;
print $line;
$tmp=1;
}
if ($line =~ /Use a PAE enabled kernel/) {
print "WARNING: " . $line;
$tmp=1;
}
}
if ($tmp) {
print "WARNING: Total memory available to the OS is ";
print "less than the total memory found.\n An ";
print "upgraded BIOS may fix this issue. This is not ";
print "a bug in memconf.\n";
$recognized=0;
$exitstatus=1;
}
}
# Flag untested CPU types (machine="" or "x86" on regression test files)
# Linux tested so far on x86, i86pc, x86_64, and Itanium ia64
if ($machine eq "" || $machine eq "x86" || $machine =~ /i.86/ || $machine eq "x86_64" || $machine eq "ia64") {
$untested=0 if ($untested == 1);
} else {
# Linux on SPARC
# if ($machine =~ /sparc/) {
# if ($machine eq "sparc64") {
$untested=1;
$untested_type="CPU" if ("$untested_type" eq "");
}
&check_virtualmachine;
&show_untested if ($untested);
&mailmaintainer if ($verbose == 3);
exit $exitstatus;
}
sub show_total_memory {
#
# Print total memory
#
print "total memory = ";
&show_memory($totmem);
print "$permission_error\n" if ($permission_error);
if ($prtconf_warn ne "") {
print "WARNING: $prtconf_warn\n";
print " This may be corrected by installing ";
print "a Sun patch on this system.\n";
}
}
sub show_control_LDOM_message {
#
# Post notice if on control domain
#
print "NOTICE: Control Logical Domain (LDOM) detected. The cpus and memory modules\n";
print " reported are for the system, not necessarily the control domain.\n";
}
sub is_virtualmachine {
if ($model =~ /VMware|Virtual Platform|Virtual Machine/i || $diagbanner =~ /Virtual Machine/i) {
return(1);
}
return(0);
}
sub check_virtualmachine {
if (&is_virtualmachine) {
print "NOTICE: Details shown are for the configuration of this Virtual Machine (VM),\n not the physical CPUs and memory of the VM server it is running on.\n";
if ($cputype_cpuinfo ne "") {
print " VM server CPU";
print (($cpucnt_cpuinfo > 1) ? "s: $cpucnt_cpuinfo X" : ":");
print " $cputype_cpuinfo\n";
}
}
}
sub finish {
&show_header;
#print "newslots=@newslots\n" if ($#newslots > 0 && $verbose > 1);
# TLS
# Cannot accurately determine installed memory unless information is
# is in prtpicl output, or if system is fully stuffed
if ($ldm_memory && ! $picl_foundmemory) {
&show_control_LDOM_message;
$totmem=$installed_memory;
&show_total_memory;
# TLS ToDo: If fully stuffed, rewrite output
# TLS ToDo: If not fully stuffed, clear bogus module sizes found
return;
}
print $buffer if ($buffer ne "");
#
# Special memory options
#
if ($sxmem) {
# Currently assumes only one VSIMM is installed.
# Auxiliary Video Board 501-2020 (SS10SX) or 501-2488 (SS20)
# required if two VSIMMs are installed.
if ($model eq "SPARCstation-20" || $model eq "SuperCOMPstation-20S") {
# SS20 1st VSIMM in J0304/J0407, 2nd in J0305/J0406
print "sockets J0304/J0407 have";
$sockets_used .= " J0304";
} elsif ($model =~ /COMPstation-20A\b/) {
# 1st VSIMM in J0202, 2nd in J0301
print "socket J0202 has";
$sockets_used .= " J0202";
} else {
# SS10SX 1st VSIMM in J0301/J1203, 2nd in J0202/J1201
print "sockets J0301/J1203 have";
$sockets_used .= " J0301";
}
print " a ${sxmem}MB VSIMM installed for SX (CG14) graphics\n";
}
if ($nvmem) {
# NVSIMMs for Prestoserve
if ($model eq "SPARCstation-20" || $model eq "SuperCOMPstation-20S") {
# SS20 1st 2MB NVSIMM in J0305/J0406, 2nd in J0304/J0407
if ($nvmem1) {
$sockets_used .= " J0305";
print "sockets J0305/J0406 have a 2MB NVSIMM";
print " installed for Prestoserve\n";
}
if ($nvmem2) {
$sockets_used .= " J0304";
print "sockets J0304/J0407 have a 2MB NVSIMM";
print " installed for Prestoserve\n";
}
} elsif ($model =~ /COMPstation-20A\b/) {
# 1st 2MB NVSIMM in J0301, 2nd in J0202
if ($nvmem1) {
$sockets_used .= " J0301";
print "socket J0301 has a 2MB NVSIMM";
print " installed for Prestoserve\n";
}
if ($nvmem2) {
$sockets_used .= " J0202";
print "socket J0202 has a 2MB NVSIMM";
print " installed for Prestoserve\n";
}
} elsif ($model =~ /SPARCstation-10/ || $model eq "Premier-24") {
# SS10 1st 2MB NVSIMM in J0202/J1201, 2nd in J0301/J1203
if ($nvmem1) {
$sockets_used .= " J0202";
print "sockets J0202/J1201 have a 2MB NVSIMM";
print " installed for Prestoserve\n";
}
if ($nvmem2) {
$sockets_used .= " J0301";
print "sockets J0301/J1203 have a 2MB NVSIMM";
print " installed for Prestoserve\n";
}
} else {
# SS1000 supports two banks of four 1MB NVSIMMs
# SC2000 supports one bank of eight 1MB NVSIMMs
print "Has ${nvmem}MB of NVSIMM installed for Prestoserve ";
if ($model eq "SPARCserver-1000") {
print "(1 bank of 4" if ($nvmem == 4);
print "(2 banks of 4" if ($nvmem == 8);
} else {
print "(1 bank of 8";
}
print " 1MB NVSIMMs$nvsimm_banks)\n";
}
}
#
# Check for empty banks or sockets
#
if ($#banksstr > 0) {
foreach $banks (@banksstr) {
if ($banks ne "?") {
if ($banks_used !~ /\b$banks\b/ &
$sockets_empty !~ /\b$banks\b/) {
$sockets_empty .= "," if ($sockets_empty ne "");
$sockets_empty .= " $banks";
}
}
}
&print_empty_memory($bankname);
} elsif ($#socketstr > 0) {
foreach $socket (@socketstr) {
if ($socket ne "?") {
if ($sockets_used !~ /\b$socket\b/ &
$sockets_empty !~ /\b$socket\b/) {
if ($memtype =~ /memory card/ &
$sockets_empty ne "") {
$sockets_empty .= ", $socket";
} else {
$sockets_empty .= " $socket";
}
}
}
}
if ($sockettype) {
&print_empty_memory("${sockettype}s");
} else {
&print_empty_memory("memory slots");
}
} elsif (($verbose > 1) && ($sockets_used ne "")) {
print "memory sockets used: $sockets_used\n";
}
# Look for duplicate sockets
if ($sockets_used ne "" && $have_prtdiag_data) {
$dup_sockets="";
foreach $socket (sort split(' ', $sockets_used)) {
next if ($socket eq "board" || $socket eq "mezzanine");
next if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/);
$pos=-1;
$cnt=0;
while (($pos=index(" $sockets_used ", " $socket ", $pos)) > -1) {
$pos++;
$cnt++;
if (($cnt == 2) && ($socket ne "-") && ($socket ne "?")) {
if ($dup_sockets !~ /\b$socket\b/) {
$dup_sockets .= " $socket";
print "ERROR: Duplicate socket $socket found\n";
$exitstatus=1;
}
}
}
}
if ($dup_sockets ne "") {
print "WARNING: Memory was not properly reported by";
print " the 'prtdiag' command.\n";
&recommend_prtdiag_patch;
}
}
# Look for unlabeled sockets
if ($sockets_used =~ /\s-\s|^-\s|\s-$|^-$/) {
print "WARNING: Unlabeled socket found";
print " in the 'prtdiag' command output" if ($have_prtdiag_data);
print ".\n This may cause the reported empty sockets";
print " to be incorrect.\n";
&recommend_prtdiag_patch;
}
# Make sure Sun Fire V480/V490/V880/V890 is fully stuffed if >= 1050MHz
if ($ultra =~ /Sun Fire V[48][89]0\b/) {
print "ERROR: System should not have any empty banks since CPU is >= 1050MHz.\n" if (($cpufreq >= 1050) && ($banks_used ne "A0 A1 B0 B1"));
}
if ($machine eq "sun4v") {
# Round up Solaris memory (may have 128MB or more reserved)
$installed_memory=&roundup_memory($installed_memory);
$totmem=$installed_memory;
}
#
# Print total memory
#
&show_total_memory;
#
# Post notice if on control domain
#
&show_control_LDOM_message if ($ldm_memory);
#
# Post notice if on a virtual machine
#
&check_virtualmachine;
#
# Check for illegal memory stuffings
#
if ($model eq "Sun 4/50" || $model eq "Sun 4/25") { # IPX, ELC
if (($slot0 != 16) && ($largestsimm == 16) && ($osrel =~ /4.1.1/)) {
print "ERROR: Install the highest capacity 16MB SIMM";
print " in socket $socketstr[0] under SunOS 4.1.1.\n";
$exitstatus=1;
}
}
if ($model =~ /SPARCclassic/ || $model =~ /SPARCstation-LX/) {
if ($found32mb) {
# Reportedly can accept 32MB SIMMs in bank 1, allowing
# 128MB total (2x32, 4x16)
print "NOTICE: The 32MB SIMM is not supported in the";
print " $model according to\n Sun. However it does";
print " appear to work in bank 1 only, allowing a";
print " maximum of\n 128MB of total memory (2x32MB";
print " bank 1 + 4x16MB banks 2 & 3).\n";
}
if ($found8mb) {
# Possibly can accept 8MB SIMMs in bank 1
print "NOTICE: The 8MB SIMM is not supported in the";
print " $model according to\n Sun. However it does";
print " appear to work in bank 1 only.\n";
}
}
if ($model =~ /SPARCstation-10/ || $model eq "Premier-24") {
if (($slot0 < $largestsimm) && $BSD) {
print "ERROR: Install the highest capacity SIMM in";
print " socket $socketstr[0] under Solaris 1.X.\n";
$exitstatus=1;
}
if (! $found32mb && $found16mb && ($romvermajor eq 2) && ($romverminor < 19)) {
print "WARNING: The 32MB SIMM is not supported in the";
print " SS10 or SS10SX according to\n Sun. However";
print " it does work correctly depending on the Open";
print " Boot PROM\n version. This system is running";
print " OBP $romvernum, so 32MB SIMMs will only be\n";
print " recognized as 16MB SIMMs. You should";
print " upgrade to OBP 2.19 or later in order\n to";
print " be able to detect and utilize 32MB SIMMs.\n";
# OBP 2.14 and earlier see the 32MB SIMM as 16MB.
# OBP 2.15 on a SS20 does see the 32MB SIMM as 32MB.
# Have not tested 32MB SIMMs on SS10 with OBP 2.15-2.18
if ($romverminor > 14) {
$untested=1;
$untested_type="OBP";
}
}
if ($found32mb && ($romvermajor eq 2) && ($romverminor < 19)) {
print "NOTICE: The 32MB SIMM is not supported in the";
print " SS10 or SS10SX according to\n Sun. However";
print " it does work correctly depending on the Open";
print " Boot PROM\n version. This system is running";
print " OBP $romvernum, and 32MB SIMMs were properly\n";
print " recognized.\n";
@simmsizes=(16,32,64);
if ($romvernum ne "2.X") {
$untested=1;
$untested_type="OBP";
}
}
if (! $nvmem1 && $nvmem2) {
print "ERROR: First NVSIMM should be installed in";
print " socket J0202, not socket J0301\n";
$exitstatus=1;
}
}
if ($model eq "SPARCstation-20" || $model eq "SuperCOMPstation-20S") {
if (! $nvmem1 && $nvmem2) {
print "ERROR: First NVSIMM should be installed in";
print " socket J0305, not socket J0304\n";
$exitstatus=1;
}
}
if ($model eq "SPARCstation-5") {
if (($slot0 < $largestsimm) && $BSD) {
print "ERROR: Install the highest capacity SIMM in";
print " socket $socketstr[0] under Solaris 1.X.\n";
$exitstatus=1;
}
if ($osrel eq "4.1.3_U1" && $found32mb) {
# Look to see if patch 101508-07 or later is installed
# for 32MB SIMMs to work properly (bug 1176458)
$what=&mychomp(`/usr/ucb/what /sys/sun4m/OBJ/module_vik.o`);
if ($what !~ /module_vik.c 1.38 94\/08\/22 SMI/) {
print "WARNING: Install SunOS 4.1.3_U1 patch";
print " 101508-07 or later in order for 32MB\n";
print " SIMMs to work reliably on the";
print " SPARCstation 5.\n";
}
}
}
if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) {
if (($smallestsimm == 16) && ($largestsimm > 16)) {
print "ERROR: 16MB DIMMs cannot be mixed with larger";
print " DIMMs on Ultra 5/10 systems.\n";
$exitstatus=1;
}
}
if ($ultra eq 5) {
if ($largestsimm == 256) {
print "NOTICE: The 256MB DIMM is not supported in the";
print " Ultra 5 according to\n Sun. However it does";
print " work correctly as long as you use low-profile";
print "\n DIMMs or take out the floppy drive.\n";
}
}
if ($ultra eq "AXi") {
# DIMMs should be chosen as all 10-bit or all 11-bit column
# address type. If using 11-bit, then only use Bank 0 & 2.
if ($found10bit && $found11bit) {
print "ERROR: You should not mix 10-bit and 11-bit";
print " column address type DIMMs in the\n ";
print "SPARCengine Ultra AXi.\n";
$exitstatus=1;
}
if ($found11bit) {
if ($foundbank1or3) {
print "ERROR";
$exitstatus=1;
} else {
print "WARNING";
}
print ": Do not use Bank 1 (sockets U0402 & U0401) &";
print " Bank 3 (sockets U0302 &\n U0301) since";
print " 11-bit column address type DIMMs are";
print " installed. You should\n only use Bank 0";
print " (sockets U0404 & U0403) & Bank 2 (sockets";
print " U0304 & U0303).\n";
}
}
if ($model eq "Ultra-4" || $ultra eq 450 || $model eq "Ultra-4FT" || $ultra eq "Netra ft1800") {
if ($found16mb) {
print "WARNING: 16MB DIMMs are not supported and may";
print " cause correctable ECC errors.\n";
}
}
#
# Check for unsupported memory sizes
#
foreach $i (@simmsizesfound) {
$smallestsimm=$i if ($i < $smallestsimm);
$largestsimm=$i if ($i > $largestsimm);
$simmsizelegal=0;
foreach $j (@simmsizes) {
$simmsizelegal=1 if ($i == $j);
}
if (($simmsizelegal == 0) && ($simmsizes[0] > 0)) {
print "ERROR: Unsupported ${i}MB $memtype found (supported ";
if ($#simmsizes == 0) {
print "size is @{simmsizes}MB)\n";
} else {
print "MB sizes are: @simmsizes)\n";
}
$exitstatus=1;
}
}
if ($smallestsimm < $simmsizes[0]) {
print "ERROR: Smaller than expected $memtype found ";
print "(found ${smallestsimm}MB, smallest expected ";
print "${simmsizes[0]}MB)\n";
$exitstatus=1;
}
if ($largestsimm > $simmsizes[$#simmsizes]) {
print "ERROR: Larger than expected $memtype found ";
print "(found ${largestsimm}MB, largest expected ";
print "${simmsizes[$#simmsizes]}MB)\n";
$exitstatus=1;
}
#
# Check for buggy perl version
#
if ($perlhexbug) {
print "ERROR: This Perl V$PERL_VERSION is buggy in hex number";
print " conversions.\n";
$exitstatus=1;
}
if ($PERL_VERSION == 5.001) {
print "WARNING: Perl V5.001 is known to be buggy in hex number";
print " conversions.\n";
}
if ($PERL_VERSION < 5.002) {
print "WARNING: Perl V5.002 or later is recommended for best";
print " results.\n";
print " You are running Perl V$PERL_VERSION\n";
}
#
# Check for bad eeprom banner-name. This happens sometimes when OBP 3.23
# or later is installed on Ultra-60/E220R and Ultra-80/E420R systems.
#
if ($banner =~ /^ \(/) {
print "ERROR: banner-name not set in EEPROM (BugID 4257412).";
print " Cannot distinguish an\n ";
print "Ultra 60 from an Enterprise 220R" if ($model eq "Ultra-60");
print "Ultra 80 from an Enterprise 420R or Netra t 1400/1405" if ($model eq "Ultra-80");
print "Sun Blade 1000/2000 from a Sun Fire 280R or Netra 20" if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20");
print ".\n To correct this problem, please run one of ";
print "the following commands as\n root depending on ";
print "the system you have:\n";
if ($model eq "Ultra-60") {
print " eeprom banner-name='Sun Ultra 60 UPA/PCI'\n";
print " eeprom banner-name='Sun Enterprise 220R'\n";
print "Note: Netra t1120/1125 systems may also use the 'Sun Ultra 60 UPA/PCI' banner\n";
}
if ($model eq "Ultra-80") {
print " eeprom banner-name='Sun Ultra 80 UPA/PCI'\n";
print " eeprom banner-name='Sun Enterprise 420R'\n";
print " eeprom banner-name='Netra t 1400/1405'\n";
print "Note: Netra t1400/1405 systems may also use the 'Sun Ultra 80 UPA/PCI' banner\n";
}
if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20") {
print " eeprom banner-name='Sun-Blade-1000'\n";
print " eeprom banner-name='Sun Fire 280R'\n";
print " eeprom banner-name='Netra 20'\n";
print "Note: Netra 20 systems may also use the 'Sun-Blade-1000' banner\n";
}
$exitstatus=1;
}
#
# Check for possible memory detection errors by this program
#
if ($prtdiag_failed == 2) {
# non-global zone (container)
print "WARNING: More details can be reported if memconf is run in the global zone.\n";
$prtdiag_has_mem=0;
}
if (! $boardfound_mem && $prtdiag_has_mem) {
print "WARNING: Memory should have been reported in the output from\n";
if ($prtdiag_cmd) {
print " $prtdiag_cmd";
} else {
print " prtdiag, which was not found";
print " in /usr/platform/$machine/sbin" if (-d '/usr/platform');
}
print "\nERROR: prtdiag failed!" if ($prtdiag_failed);
print "\n This system may be misconfigured, or may be";
print " missing software packages\n like SUNWpiclr,";
print " SUNWpiclu and SUNWpiclx, or may need the latest\n";
print " recommended Sun patches installed from";
print " http://www.sunsolve.com/\n";
if ($ultra eq "Sun Fire V880") {
print " This may be corrected by installing ";
print "Sun patch 112186-19 or 119231-01 or later.\n";
}
print " Check my website at $URL\n";
print " to get the latest version of memconf.\n";
$exitstatus=1;
}
if ($recognized == 0) {
print "ERROR: Layout of memory ${sockettype}s not completely ";
print "recognized on this system.\n";
$exitstatus=1;
}
if ($recognized < 0) {
print "WARNING: Layout of memory ${sockettype}s not completely";
print " recognized on this system.\n";
if ($model eq "Ultra-80" || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x") {
if ($recognized == -1) {
print " The memory configuration displayed is a guess which may be incorrect.\n";
if ($totmem eq 1024) {
print " The 1GB of memory installed may be 4 256MB DIMMs populating bank 0,\n";
print " or 16 64MB DIMMs populating all 4 banks.\n";
}
}
print " This is a known bug due to Sun's 'prtconf', 'prtdiag' and 'prtfru'\n";
print " commands not providing enough detail for the memory layout of this\n";
print " SunOS $osrel $platform system to be accurately determined.\n";
print " This is a bug in Sun's OBP, not a bug in memconf. The latest OBP\n";
print " release (OBP 3.33.0 2003/10/07 from patch 109082-06) ";
print (($totmem eq 1024) ? "still has this bug" : "should fix this");
print ".\n This system is using $romver\n";
$exitstatus=1;
}
if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20") {
# Do this if memory was not in the output of prtdiag
if ($recognized == -2) {
# Hack: If Sun Blade 1000 has 8GB of memory (maximum
# allowed), then memory line was rewritten to show
# memory stuffing.
print " The memory configuration displayed should be";
print " correct though since this\n";
print " is a fully stuffed system.\n";
} else {
print " The memory configuration displayed is a guess which may be incorrect.\n";
}
}
if ($ultra eq "T2000" || $ultra eq "T1000") {
# Do this if memory was not in the output of prtdiag
# Hack: If Sun Fire T2000 has 8GB or 16GB of memory or
# if Sun Fire T1000 has 4GB or 8GB of memory, then it
# may be 1 rank of DIMMs instead of default 2 ranks.
print " The memory configuration displayed is a guess which may be incorrect.\n";
print " Base Sun configurations ship with two ranks of modules installed.\n";
print " This system may have one rank of " . $simmsizesfound[0]*2 . "MB DIMMs installed instead\n";
print " of two ranks of " . $simmsizesfound[0] . "MB DIMMs as shown.\n";
print " This is a known bug due to Sun's 'prtconf', 'prtdiag' and 'prtfru'\n";
print " commands not providing enough detail for the memory layout of this\n";
print " SunOS $osrel $platform system to be accurately determined.\n";
print " This is a Sun bug, not a bug in memconf.\n";
$exitstatus=1;
}
}
if ($banner =~ /Netra t1\b/ || $ultra eq "Netra t1" || $model eq "Netra t1") {
if ($totmem eq 1024) {
print "WARNING: Cannot distinguish between four";
print " 370-4155 256MB mezzanine boards and\n";
print " two 512MB mezzanine boards.\n";
}
if ($totmem eq 768) {
print "WARNING: Cannot distinguish between three";
print " 370-4155 256MB mezzanine boards and\n";
print " one 512MB and one 256MB mezzanine boards.\n";
}
}
if ($installed_memory > 0) {
if ($installed_memory != $totmem) {
print "ERROR: Total memory installed (${installed_memory}MB) ";
print "does not match total memory found.\n";
$recognized=0;
$exitstatus=1;
}
}
if ($failed_memory > 0) {
print "ERROR: Failed memory (${failed_memory}MB) was detected.\n";
print " You should consider replacing the failed memory.\n";
$exitstatus=1;
}
if ($spare_memory > 0) {
print "NOTICE: Spare memory (${spare_memory}MB) was detected.\n";
print " You can configure the spare memory using the 'cfgadm' command.\n";
}
if ($failing_memory > 0) {
print "ERROR: Some of the installed memory has failed.\n";
print " You should consider replacing the failed memory.\n";
$exitstatus=1;
}
if ($failed_fru ne "") {
print "ERROR: $failed_fru";
print " You should consider replacing the failed FRUs.\n";
$exitstatus=1;
}
&show_unrecognized if ($recognized == 0);
# Tested on SunOS 4.X - 5.11 (Solaris 1.0 through Solaris 11)
# Flag Future/Beta SunOS releases as untested
if ($osrel =~ /^5.1[2-9]/ || $osrel =~ /^[6-9]/) {
$untested=1;
$untested_type="OS" if ("$untested_type" eq "");
}
# Flag untested CPU types:
# US-IIIi+ (Serrano)
if ($cputype =~ /UltraSPARC-IIIi\+/) {
$untested=1;
$untested_type="CPU" if ("$untested_type" eq "");
}
# US-T3 or newer
if ($cputype =~ /UltraSPARC-T[3-9]/) {
$untested=1;
$untested_type="CPU" if ("$untested_type" eq "");
}
# SPARC64-VII+ or newer
if ($cputype =~ /SPARC64-VII\+/ || $cputype =~ /SPARC64-IX/ || $cputype =~ /SPARC64-X/) {
$untested=1;
$untested_type="CPU" if ("$untested_type" eq "");
}
# Dual-Core and Quad-Core x86 CPUs have been tested, so flag
# Triple-Core and other multicore x86 CPUs
if ($isX86 && ($corecnt == 3 || $corecnt >= 5)) {
$untested=1;
$untested_type="CPU" if ("$untested_type" eq "");
}
&show_untested if ($untested);
&mailmaintainer if ($verbose == 3);
exit $exitstatus;
}
sub attach_mail {
$s=shift;
close(MAILFILE);
if ($uuencode_cmd ne "") {
open(MAILFILE, "| $uuencode_cmd $s >>/tmp/memconf.output") || die "can't open /tmp/memconf.output: $!";
} else {
open(MAILFILE, ">>/tmp/memconf.output") || die "can't open /tmp/memconf.output: $!";
print MAILFILE "$linebreak";
print MAILFILE "#filename: $s\n";
}
$tmp=0;
foreach $line (@_) {
print MAILFILE "$line";
print MAILFILE "\n" if ($line !~ /\n$/);
$tmp++;
}
close(MAILFILE);
print STDERR time . " attached $tmp lines in $s\n" if ($DEBUG);
}
sub mailmaintainer {
# E-mail information of system to maintainer. Use system call to
# mail instead of Mail::Send module so that this works for perl4
print "\nSending E-mail to memconf maintainer tschmidt\@micron.com";
print " with output of:\n memconf -d (seen above)\n";
&show_helpers(" ");
if ($filename) {
$mail_from=($SUNWexplo) ? "Sun Explorer directory $filename" : "filename $filename";
} else {
$mail_from="$hostname";
}
$mail_from="memconf output from $mail_from";
$mail_prog='mail';
foreach $bin ('/usr/bin/mailx','/usr/ucb/mail','/usr/bin/mail','/bin/mail') {
if (-x "$bin") {
$mail_prog="$bin -s \"$mail_from\"";
last;
}
}
# Rewrite fully-qualified hostnames so that attachment filename has
# only one extension.
$newhostname=$hostname;
$newhostname=~s/\./_/g;
close(STDOUT);
$attaching="Attaching ";
if (-x '/usr/bin/uuencode') {
$attaching .= "uuencoded ";
$uuencode_cmd="/usr/bin/uuencode";
} else {
$uuencode_cmd="";
}
$attaching .= "output from ";
@memconf_output=`cat /tmp/memconf.output`;
open(MAILFILE, ">>/tmp/memconf.output") || die "can't open /tmp/memconf.output: $!";
print MAILFILE "$linebreak";
print MAILFILE "$attaching'$config_cmd'\n";
if ($uuencode_cmd ne "") {
if ("$os" eq "SunOS") {
print MAILFILE "$attaching'$prtdiag_cmd -v'\n" if ($prtdiag_exec ne "");
print MAILFILE "$attaching'$prtfru_cmd -x'\n" if ($prtfru_cmd ne "");
print MAILFILE "$attaching'$prtpicl_cmd -v'\n" if ($prtpicl_cmd ne "");
print MAILFILE "$attaching'$psrinfo_cmd -v'\n" if ($psrinfo_cmd ne "");
print MAILFILE "$attaching'$cfgadm_cmd -al'\n" if ($cfgadm_cmd ne "");
print MAILFILE "$attaching'$smbios_cmd'\n" if ($smbios_cmd ne "");
print MAILFILE "$attaching'$ldm_cmd list-devices -a -p'\n" if ($ldm_cmd ne "");
}
if ("$os" eq "Linux") {
print MAILFILE "$attaching'$free_cmd'\n" if ($free_cmd ne "");
}
if ("$os" eq "SunOS" || "$os" eq "Linux") {
print MAILFILE "$attaching'$ipmitool_cmd fru'\n" if ($ipmitool_cmd ne "");
}
if ("$os" eq "HP-UX") {
print MAILFILE "$attaching'/usr/contrib/bin/machinfo'\n" if (-x '/usr/contrib/bin/machinfo');
}
print MAILFILE "$linebreak";
}
close(MAILFILE);
$outfile="memconf_$newhostname";
&attach_mail("${outfile}.txt",@memconf_output) if ($uuencode_cmd ne "");
@config=&run("$config_cmd") if (! $config[0]);
&attach_mail("${outfile}_${config_command}.txt",@config);
if ("$os" eq "SunOS") {
&attach_mail("${outfile}_prtdiag.txt",@prtdiag) if ($prtdiag_exec ne "");
&attach_mail("${outfile}_prtfru.txt",@prtfru) if ($prtfru_cmd ne "");
&attach_mail("${outfile}_prtpicl.txt",@prtpicl) if ($prtpicl_cmd ne "");
&attach_mail("${outfile}_psrinfo.txt",@psrinfo) if ($psrinfo_cmd ne "");
&attach_mail("${outfile}_cfgadm.txt",@cfgadm) if ($cfgadm_cmd ne "");
&attach_mail("${outfile}_smbios.txt",@smbios) if ($smbios_cmd ne "");
&attach_mail("${outfile}_ldm.txt",@ldm) if ($ldm_cmd ne "");
}
&attach_mail("${outfile}_free.txt",@free) if ($free_cmd ne "");
&attach_mail("${outfile}_cpuinfo.txt",@cpuinfo) if (-r '/proc/cpuinfo');
&attach_mail("${outfile}_ipmitool.txt",@ipmitool) if ($ipmitool_cmd ne "");
if ("$os" eq "HP-UX") {
&attach_mail("${outfile}_machinfo.txt",@machinfo) if (-x '/usr/contrib/bin/machinfo');
}
if ($uuencode_cmd eq "") {
close(MAILFILE);
open(MAILFILE, ">>/tmp/memconf.output") || die "can't open /tmp/memconf.output: $!";
print MAILFILE "$linebreak";
close(MAILFILE);
}
`$mail_prog tschmidt\@micron.com < /tmp/memconf.output`;
unlink "/tmp/memconf.output";
}
|