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 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706 16707 16708 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 16719 16720 16721 16722 16723 16724 16725 16726 16727 16728 16729 16730 16731 16732 16733 16734 16735 16736 16737 16738 16739 16740 16741 16742 16743 16744 16745 16746 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 16846 16847 16848 16849 16850 16851 16852 16853 16854 16855 16856 16857 16858 16859 16860 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939 16940 16941 16942 16943 16944 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 16955 16956 16957 16958 16959 16960 16961 16962 16963 16964 16965 16966 16967 16968 16969 16970 16971 16972 16973 16974 16975 16976 16977 16978 16979 16980 16981 16982 16983 16984 16985 16986 16987 16988 16989 16990 16991 16992 16993 16994 16995 16996 16997 16998 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157 17158 17159 17160 17161 17162 17163 17164 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 17193 17194 17195 17196 17197 17198 17199 17200 17201 17202 17203 17204 17205 17206 17207 17208 17209 17210 17211 17212 17213 17214 17215 17216 17217 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 17229 17230 17231 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241 17242 17243 17244 17245 17246 17247 17248 17249 17250 17251 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 17266 17267 17268 17269 17270 17271 17272 17273 17274 17275 17276 17277 17278 17279 17280 17281 17282 17283 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325 17326 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337 17338 17339 17340 17341 17342 17343 17344 17345 17346 17347 17348 17349 17350 17351 17352 17353 17354 17355 17356 17357 17358 17359 17360 17361 17362 17363 17364 17365 17366 17367 17368 17369 17370 17371 17372 17373 17374 17375 17376 17377 17378 17379 17380 17381 17382 17383 17384 17385 17386 17387 17388 17389 17390 17391 17392 17393 17394 17395 17396 17397 17398 17399 17400 17401 17402 17403 17404 17405 17406 17407 17408 17409 17410 17411 17412 17413 17414 17415 17416 17417 17418 17419 17420 17421 17422 17423 17424 17425 17426 17427 17428 17429 17430 17431 17432 17433 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 17473 17474 17475 17476 17477 17478 17479 17480 17481 17482 17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 17502 17503 17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 17515 17516 17517 17518 17519 17520 17521 17522 17523 17524 17525 17526 17527 17528 17529 17530 17531 17532 17533 17534 17535 17536 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 17547 17548 17549 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 17577 17578 17579 17580 17581 17582 17583 17584 17585 17586 17587 17588 17589 17590 17591 17592 17593 17594 17595 17596 17597 17598 17599 17600 17601 17602 17603 17604 17605 17606 17607 17608 17609 17610 17611 17612 17613 17614 17615 17616 17617 17618 17619 17620 17621 17622 17623 17624 17625 17626 17627 17628 17629 17630 17631 17632 17633 17634 17635 17636 17637 17638 17639 17640 17641 17642 17643 17644 17645 17646 17647 17648 17649 17650 17651 17652 17653 17654 17655 17656 17657 17658 17659 17660 17661 17662 17663 17664 17665 17666 17667 17668 17669 17670 17671 17672 17673 17674 17675 17676 17677 17678 17679 17680 17681 17682 17683 17684 17685 17686 17687 17688 17689 17690 17691 17692 17693 17694 17695 17696 17697 17698 17699 17700 17701 17702 17703 17704 17705 17706 17707 17708 17709 17710 17711 17712 17713 17714 17715 17716 17717 17718 17719 17720 17721 17722 17723 17724 17725 17726 17727 17728 17729 17730 17731 17732 17733 17734 17735 17736 17737 17738 17739 17740 17741 17742 17743 17744 17745 17746 17747 17748 17749 17750 17751 17752 17753 17754 17755 17756 17757 17758 17759 17760 17761 17762 17763 17764 17765 17766 17767 17768 17769 17770 17771 17772 17773 17774 17775 17776 17777 17778 17779 17780 17781 17782 17783 17784 17785 17786 17787 17788 17789 17790 17791 17792 17793 17794 17795 17796 17797 17798 17799 17800 17801 17802 17803 17804 17805 17806 17807 17808 17809 17810 17811 17812 17813 17814 17815 17816 17817 17818 17819 17820 17821 17822 17823 17824 17825 17826 17827 17828 17829 17830 17831 17832 17833 17834 17835 17836 17837 17838 17839 17840 17841 17842 17843 17844 17845 17846 17847 17848 17849 17850 17851 17852 17853 17854 17855 17856 17857 17858 17859 17860 17861 17862 17863 17864 17865 17866 17867 17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 17878 17879 17880 17881 17882 17883 17884 17885 17886 17887 17888 17889 17890 17891 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 17907 17908 17909 17910 17911 17912 17913 17914 17915 17916 17917 17918 17919 17920 17921 17922 17923 17924 17925 17926 17927 17928 17929 17930 17931 17932 17933 17934 17935 17936 17937 17938 17939 17940 17941 17942 17943 17944 17945 17946 17947 17948 17949 17950 17951 17952 17953 17954 17955 17956 17957 17958 17959 17960 17961 17962 17963 17964 17965 17966 17967 17968 17969 17970 17971 17972 17973 17974 17975 17976 17977 17978 17979 17980 17981 17982 17983 17984 17985 17986 17987 17988 17989 17990 17991 17992 17993 17994 17995 17996 17997 17998 17999 18000 18001 18002 18003 18004 18005 18006 18007 18008 18009 18010 18011 18012 18013 18014 18015 18016 18017 18018 18019 18020 18021 18022 18023 18024 18025 18026 18027 18028 18029 18030 18031 18032 18033 18034 18035 18036 18037 18038 18039 18040 18041 18042 18043 18044 18045 18046 18047 18048 18049 18050 18051 18052 18053 18054 18055 18056 18057 18058 18059 18060 18061 18062 18063 18064 18065 18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 18082 18083 18084 18085 18086 18087 18088 18089 18090 18091 18092 18093 18094 18095 18096 18097 18098 18099 18100 18101 18102 18103 18104 18105 18106 18107 18108 18109 18110 18111 18112 18113 18114 18115 18116 18117 18118 18119 18120 18121 18122 18123 18124 18125 18126 18127 18128 18129 18130 18131 18132 18133 18134 18135 18136 18137 18138 18139 18140 18141 18142 18143 18144 18145 18146 18147 18148 18149 18150 18151 18152 18153 18154 18155 18156 18157 18158 18159 18160 18161 18162 18163 18164 18165 18166 18167 18168 18169 18170 18171 18172 18173 18174 18175 18176 18177 18178 18179 18180 18181 18182 18183 18184 18185 18186 18187 18188 18189 18190 18191 18192 18193 18194 18195 18196 18197 18198 18199 18200 18201 18202 18203 18204 18205 18206 18207 18208 18209 18210 18211 18212 18213 18214 18215 18216 18217 18218 18219 18220 18221 18222 18223 18224 18225 18226 18227 18228 18229 18230 18231 18232 18233 18234 18235 18236 18237 18238 18239 18240 18241 18242 18243 18244 18245 18246 18247 18248 18249 18250 18251 18252 18253 18254 18255 18256 18257 18258 18259 18260 18261 18262 18263 18264 18265 18266 18267 18268 18269 18270 18271 18272 18273 18274 18275 18276 18277 18278 18279 18280 18281 18282 18283 18284 18285 18286 18287 18288 18289 18290 18291 18292 18293 18294 18295 18296 18297 18298 18299 18300 18301 18302 18303 18304 18305 18306 18307 18308 18309 18310 18311 18312 18313 18314 18315 18316 18317 18318 18319 18320 18321 18322 18323 18324 18325 18326 18327 18328 18329 18330 18331 18332 18333 18334 18335 18336 18337 18338 18339 18340 18341 18342 18343 18344 18345 18346 18347 18348 18349 18350 18351 18352 18353 18354 18355 18356 18357 18358 18359 18360 18361 18362 18363 18364 18365 18366 18367 18368 18369 18370 18371 18372 18373 18374 18375 18376 18377 18378 18379 18380 18381 18382 18383 18384 18385 18386 18387 18388 18389 18390 18391 18392 18393 18394 18395 18396 18397 18398 18399 18400 18401 18402 18403 18404 18405 18406 18407 18408 18409 18410 18411 18412 18413 18414 18415 18416 18417 18418 18419 18420 18421 18422 18423 18424 18425 18426 18427 18428 18429 18430 18431 18432 18433 18434 18435 18436 18437 18438 18439 18440 18441 18442 18443 18444 18445 18446 18447 18448 18449 18450 18451 18452 18453 18454 18455 18456 18457 18458 18459 18460 18461 18462 18463 18464 18465 18466 18467 18468 18469 18470 18471 18472 18473 18474 18475 18476 18477 18478 18479 18480 18481 18482 18483 18484 18485 18486 18487 18488 18489 18490 18491 18492 18493 18494 18495 18496 18497 18498 18499 18500 18501 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 18523 18524 18525 18526 18527 18528 18529 18530 18531 18532 18533 18534 18535 18536 18537 18538 18539 18540 18541 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 18559 18560 18561 18562 18563 18564 18565 18566 18567 18568 18569 18570 18571 18572 18573 18574 18575 18576 18577 18578 18579 18580 18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 18592 18593 18594 18595 18596 18597 18598 18599 18600 18601 18602 18603 18604 18605 18606 18607 18608 18609 18610 18611 18612 18613 18614 18615 18616 18617 18618 18619 18620 18621 18622 18623 18624 18625 18626 18627 18628 18629 18630 18631 18632 18633 18634 18635 18636 18637 18638 18639 18640 18641 18642 18643 18644 18645 18646 18647 18648 18649 18650 18651 18652 18653 18654 18655 18656 18657 18658 18659 18660 18661 18662 18663 18664 18665 18666 18667 18668 18669 18670 18671 18672 18673 18674 18675 18676 18677 18678 18679 18680 18681 18682 18683 18684 18685 18686 18687 18688 18689 18690 18691 18692 18693 18694 18695 18696 18697 18698 18699 18700 18701 18702 18703 18704 18705 18706 18707 18708 18709 18710 18711 18712 18713 18714 18715 18716 18717 18718 18719 18720 18721 18722 18723 18724 18725 18726 18727 18728 18729 18730 18731 18732 18733 18734 18735 18736 18737 18738 18739 18740 18741 18742 18743 18744 18745 18746 18747 18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 18792 18793 18794 18795 18796 18797 18798 18799 18800 18801 18802 18803 18804 18805 18806 18807 18808 18809 18810 18811 18812 18813 18814 18815 18816 18817 18818 18819 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 18830 18831 18832 18833 18834 18835 18836 18837 18838 18839 18840 18841 18842 18843 18844 18845 18846 18847 18848 18849 18850 18851 18852 18853 18854 18855 18856 18857 18858 18859 18860 18861 18862 18863 18864 18865 18866 18867 18868 18869 18870 18871 18872 18873 18874 18875 18876 18877 18878 18879 18880 18881 18882 18883 18884 18885 18886 18887 18888 18889 18890 18891 18892 18893 18894 18895 18896 18897 18898 18899 18900 18901 18902 18903 18904 18905 18906 18907 18908 18909 18910 18911 18912 18913 18914 18915 18916 18917 18918 18919 18920 18921 18922 18923 18924 18925 18926 18927 18928 18929 18930 18931 18932 18933 18934 18935 18936 18937 18938 18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 18963 18964 18965 18966 18967 18968 18969 18970 18971 18972 18973 18974 18975 18976 18977 18978 18979 18980 18981 18982 18983 18984 18985 18986 18987 18988 18989 18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 19002 19003 19004 19005 19006 19007 19008 19009 19010 19011 19012 19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 19025 19026 19027 19028 19029 19030 19031 19032 19033 19034 19035 19036 19037 19038 19039 19040 19041 19042 19043 19044 19045 19046 19047 19048 19049 19050 19051 19052 19053 19054 19055 19056 19057 19058 19059 19060 19061 19062 19063 19064 19065 19066 19067 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 19091 19092 19093 19094 19095 19096 19097 19098 19099 19100 19101 19102 19103 19104 19105 19106 19107 19108 19109 19110 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 19139 19140 19141 19142 19143 19144 19145 19146 19147 19148 19149 19150 19151 19152 19153 19154 19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 19168 19169 19170 19171 19172 19173 19174 19175 19176 19177 19178 19179 19180 19181 19182 19183 19184 19185 19186 19187 19188 19189 19190 19191 19192 19193 19194 19195 19196 19197 19198 19199 19200 19201 19202 19203 19204 19205 19206 19207 19208 19209 19210 19211 19212 19213 19214 19215 19216 19217 19218 19219 19220 19221 19222 19223 19224 19225 19226 19227 19228 19229 19230 19231 19232 19233 19234 19235 19236 19237 19238 19239 19240 19241 19242 19243 19244 19245 19246 19247 19248 19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 19263 19264 19265 19266 19267 19268 19269 19270 19271 19272 19273 19274 19275 19276 19277 19278 19279 19280 19281 19282 19283 19284 19285 19286 19287 19288 19289 19290 19291 19292 19293 19294 19295 19296 19297 19298 19299 19300 19301 19302 19303 19304 19305 19306 19307 19308 19309 19310 19311 19312 19313 19314 19315 19316 19317 19318 19319 19320 19321 19322 19323 19324 19325 19326 19327 19328 19329 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 19450 19451 19452 19453 19454 19455 19456 19457 19458 19459 19460 19461 19462 19463 19464 19465 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 19504 19505 19506 19507 19508 19509 19510 19511 19512 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 19528 19529 19530 19531 19532 19533 19534 19535 19536 19537 19538 19539 19540 19541 19542 19543 19544 19545 19546 19547 19548 19549 19550 19551 19552 19553 19554 19555 19556 19557 19558 19559 19560 19561 19562 19563 19564 19565 19566 19567 19568 19569 19570 19571 19572 19573 19574 19575 19576 19577 19578 19579 19580 19581 19582 19583 19584 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 19598 19599 19600 19601 19602 19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 19624 19625 19626 19627 19628 19629 19630 19631 19632 19633 19634 19635 19636 19637 19638 19639 19640 19641 19642 19643 19644 19645 19646 19647 19648 19649 19650 19651 19652 19653 19654 19655 19656 19657 19658 19659 19660 19661 19662 19663 19664 19665 19666 19667 19668 19669 19670 19671 19672 19673 19674 19675 19676 19677 19678 19679 19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 19712 19713 19714 19715 19716 19717 19718 19719 19720 19721 19722 19723 19724 19725 19726 19727 19728 19729 19730 19731 19732 19733 19734 19735 19736 19737 19738 19739 19740 19741 19742 19743 19744 19745 19746 19747 19748 19749 19750 19751 19752 19753 19754 19755 19756 19757 19758 19759 19760 19761 19762 19763 19764 19765 19766 19767 19768 19769 19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 19781 19782 19783 19784 19785 19786 19787 19788 19789 19790 19791 19792 19793 19794 19795 19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 19811 19812 19813 19814 19815 19816 19817 19818 19819 19820 19821 19822 19823 19824 19825 19826 19827 19828 19829 19830 19831 19832 19833 19834 19835 19836 19837 19838 19839 19840 19841 19842 19843 19844 19845 19846 19847 19848 19849 19850 19851 19852 19853 19854 19855 19856 19857 19858 19859 19860 19861 19862 19863 19864 19865 19866 19867 19868 19869 19870 19871 19872 19873 19874 19875 19876 19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 19887 19888 19889 19890 19891 19892 19893 19894 19895 19896 19897 19898 19899 19900 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 19916 19917 19918 19919 19920 19921 19922 19923 19924 19925 19926 19927 19928 19929 19930 19931 19932 19933 19934 19935 19936 19937 19938 19939 19940 19941 19942 19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 19957 19958 19959 19960 19961 19962 19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 19979 19980 19981 19982 19983 19984 19985 19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003 20004 20005 20006 20007 20008 20009 20010 20011 20012 20013 20014 20015 20016 20017 20018 20019 20020 20021 20022 20023 20024 20025 20026 20027 20028 20029 20030 20031 20032 20033 20034 20035 20036 20037 20038 20039 20040 20041 20042 20043 20044 20045 20046 20047 20048 20049 20050 20051 20052 20053 20054 20055 20056 20057 20058 20059 20060 20061 20062 20063 20064 20065 20066 20067 20068 20069 20070 20071 20072 20073 20074 20075 20076 20077 20078 20079 20080 20081 20082 20083 20084 20085 20086 20087 20088 20089 20090 20091 20092 20093 20094 20095 20096 20097 20098 20099 20100 20101 20102 20103 20104 20105 20106 20107 20108 20109 20110 20111 20112 20113 20114 20115 20116 20117 20118 20119 20120 20121 20122 20123 20124 20125 20126 20127 20128 20129 20130 20131 20132 20133 20134 20135 20136 20137 20138 20139 20140 20141 20142 20143 20144 20145 20146 20147 20148 20149 20150 20151 20152 20153 20154 20155 20156 20157 20158 20159 20160 20161 20162 20163 20164 20165 20166 20167 20168 20169 20170 20171 20172 20173 20174 20175 20176 20177 20178 20179 20180 20181 20182 20183 20184 20185 20186 20187 20188 20189 20190 20191 20192 20193 20194 20195 20196 20197 20198 20199 20200 20201 20202 20203 20204 20205 20206 20207 20208 20209 20210 20211 20212 20213 20214 20215 20216 20217 20218 20219 20220 20221 20222 20223 20224 20225 20226 20227 20228 20229 20230 20231 20232 20233 20234 20235 20236 20237 20238 20239 20240 20241 20242 20243 20244 20245 20246 20247 20248 20249 20250 20251 20252 20253 20254 20255 20256 20257 20258 20259 20260 20261 20262 20263 20264 20265 20266 20267 20268 20269 20270 20271 20272 20273 20274 20275 20276 20277 20278 20279 20280 20281 20282 20283 20284 20285 20286 20287 20288 20289 20290 20291 20292 20293 20294 20295 20296 20297 20298 20299 20300 20301 20302 20303 20304 20305 20306 20307 20308 20309 20310 20311 20312 20313 20314 20315 20316 20317 20318 20319 20320 20321 20322 20323 20324 20325 20326 20327 20328 20329 20330 20331 20332 20333 20334 20335 20336 20337 20338 20339 20340 20341 20342 20343 20344 20345 20346 20347 20348 20349 20350 20351 20352 20353 20354 20355 20356 20357 20358 20359 20360 20361 20362 20363 20364 20365 20366 20367 20368 20369 20370 20371 20372 20373 20374 20375 20376 20377 20378 20379 20380 20381 20382 20383 20384 20385 20386 20387 20388 20389 20390 20391 20392 20393 20394 20395 20396 20397 20398 20399 20400 20401 20402 20403 20404 20405 20406 20407 20408 20409 20410 20411 20412 20413 20414 20415 20416 20417 20418 20419 20420 20421 20422 20423 20424 20425 20426 20427 20428 20429 20430 20431 20432 20433 20434 20435 20436 20437 20438 20439 20440 20441 20442 20443 20444 20445 20446 20447 20448 20449 20450 20451 20452 20453 20454 20455 20456 20457 20458 20459 20460 20461 20462 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 20477 20478 20479 20480 20481 20482 20483 20484 20485 20486 20487 20488 20489 20490 20491 20492 20493 20494 20495 20496 20497 20498 20499 20500 20501 20502 20503 20504 20505 20506 20507 20508 20509 20510 20511 20512 20513 20514 20515 20516 20517 20518 20519 20520 20521 20522 20523 20524 20525 20526 20527 20528 20529 20530 20531 20532 20533 20534 20535 20536 20537 20538 20539 20540 20541 20542 20543 20544 20545 20546 20547 20548 20549 20550 20551 20552 20553 20554 20555 20556 20557 20558 20559 20560 20561 20562 20563 20564 20565 20566 20567 20568 20569 20570 20571 20572 20573 20574 20575 20576 20577 20578 20579 20580 20581 20582 20583 20584 20585 20586 20587 20588 20589 20590 20591 20592 20593 20594 20595 20596 20597 20598 20599 20600 20601 20602 20603 20604 20605 20606 20607 20608 20609 20610 20611 20612 20613 20614 20615 20616 20617 20618 20619 20620 20621 20622 20623 20624 20625 20626 20627 20628 20629 20630 20631 20632 20633 20634 20635 20636 20637 20638 20639 20640 20641 20642 20643 20644 20645 20646 20647 20648 20649 20650 20651 20652 20653 20654 20655 20656 20657 20658 20659 20660 20661 20662 20663 20664 20665 20666 20667 20668 20669 20670 20671 20672 20673 20674 20675 20676 20677 20678 20679 20680 20681 20682 20683 20684 20685 20686 20687 20688 20689 20690 20691 20692 20693 20694 20695 20696 20697 20698 20699 20700 20701 20702 20703 20704 20705 20706 20707 20708 20709 20710 20711 20712 20713 20714 20715 20716 20717 20718 20719 20720 20721 20722 20723 20724 20725 20726 20727 20728 20729 20730 20731 20732 20733 20734 20735 20736 20737 20738 20739 20740 20741 20742 20743 20744 20745 20746 20747 20748 20749 20750 20751 20752 20753 20754 20755 20756 20757 20758 20759 20760 20761 20762 20763 20764 20765 20766 20767 20768 20769 20770 20771 20772 20773 20774 20775 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 20787 20788 20789 20790 20791 20792 20793 20794 20795 20796 20797 20798 20799 20800 20801 20802 20803 20804 20805 20806 20807 20808 20809 20810 20811 20812 20813 20814 20815 20816 20817 20818 20819 20820 20821 20822 20823 20824 20825 20826 20827 20828 20829 20830 20831 20832 20833 20834 20835 20836 20837 20838 20839 20840 20841 20842 20843 20844 20845 20846 20847 20848 20849 20850 20851 20852 20853 20854 20855 20856 20857 20858 20859 20860 20861 20862 20863 20864 20865 20866 20867 20868 20869 20870 20871 20872 20873 20874 20875 20876 20877 20878 20879 20880 20881 20882 20883 20884 20885 20886 20887 20888 20889 20890 20891 20892 20893 20894 20895 20896 20897 20898 20899 20900 20901 20902 20903 20904 20905 20906 20907 20908 20909 20910 20911 20912 20913 20914 20915 20916 20917 20918 20919 20920 20921 20922 20923 20924 20925 20926 20927 20928 20929 20930 20931 20932 20933 20934 20935 20936 20937 20938 20939 20940 20941 20942 20943 20944 20945 20946 20947 20948 20949 20950 20951 20952 20953 20954 20955 20956 20957 20958 20959 20960 20961 20962 20963 20964 20965 20966 20967 20968 20969 20970 20971 20972 20973 20974 20975 20976 20977 20978 20979 20980 20981 20982 20983 20984 20985 20986 20987 20988 20989 20990 20991 20992 20993 20994 20995 20996 20997 20998 20999 21000 21001 21002 21003 21004 21005 21006 21007 21008 21009 21010 21011 21012 21013 21014 21015 21016 21017 21018 21019 21020 21021 21022 21023 21024 21025 21026 21027 21028 21029 21030 21031 21032 21033 21034 21035 21036 21037 21038 21039 21040 21041 21042 21043 21044 21045 21046 21047 21048 21049 21050 21051 21052 21053 21054 21055 21056 21057 21058 21059 21060 21061 21062 21063 21064 21065 21066 21067 21068 21069 21070 21071 21072 21073 21074 21075 21076 21077 21078 21079 21080 21081 21082 21083 21084 21085 21086 21087 21088 21089 21090 21091 21092 21093 21094 21095 21096 21097 21098 21099 21100 21101 21102 21103 21104 21105 21106 21107 21108 21109 21110 21111 21112 21113 21114 21115 21116 21117 21118 21119 21120 21121 21122 21123 21124 21125 21126 21127 21128 21129 21130 21131 21132 21133 21134 21135 21136 21137 21138 21139 21140 21141 21142 21143 21144 21145 21146 21147 21148 21149 21150 21151 21152 21153 21154 21155 21156 21157 21158 21159 21160 21161 21162 21163 21164 21165 21166 21167 21168 21169 21170 21171 21172 21173 21174 21175 21176 21177 21178 21179 21180 21181 21182 21183 21184 21185 21186 21187 21188 21189 21190 21191 21192 21193 21194 21195 21196 21197 21198 21199 21200 21201 21202 21203 21204 21205 21206 21207 21208 21209 21210 21211 21212 21213 21214 21215 21216 21217 21218 21219 21220 21221 21222 21223 21224 21225 21226 21227 21228 21229 21230 21231 21232 21233 21234 21235 21236 21237 21238 21239 21240 21241 21242 21243 21244 21245 21246 21247 21248 21249 21250 21251 21252 21253 21254 21255 21256 21257 21258 21259 21260 21261 21262 21263 21264 21265 21266 21267 21268 21269 21270 21271 21272 21273 21274 21275 21276 21277 21278 21279 21280 21281 21282 21283 21284 21285 21286 21287 21288 21289 21290 21291 21292 21293 21294 21295 21296 21297 21298 21299 21300 21301 21302 21303 21304 21305 21306 21307 21308 21309 21310 21311 21312 21313 21314 21315 21316 21317 21318 21319 21320 21321 21322 21323 21324 21325 21326 21327 21328 21329 21330 21331 21332 21333 21334 21335 21336 21337 21338 21339 21340 21341 21342 21343 21344 21345 21346 21347 21348 21349 21350 21351 21352 21353 21354 21355 21356 21357 21358 21359 21360 21361 21362 21363 21364 21365 21366 21367 21368 21369 21370 21371 21372 21373 21374 21375 21376 21377 21378 21379 21380 21381 21382 21383 21384 21385 21386 21387 21388 21389 21390 21391 21392 21393 21394 21395 21396 21397 21398 21399 21400 21401 21402 21403 21404 21405 21406 21407 21408 21409 21410 21411 21412 21413 21414 21415 21416 21417 21418 21419 21420 21421 21422 21423 21424 21425 21426 21427 21428 21429 21430 21431 21432 21433 21434 21435 21436 21437 21438 21439 21440 21441 21442 21443 21444 21445 21446 21447 21448 21449 21450 21451 21452 21453 21454 21455 21456 21457 21458 21459 21460 21461 21462 21463 21464 21465 21466 21467 21468 21469 21470 21471 21472 21473 21474 21475 21476 21477 21478 21479 21480 21481 21482 21483 21484 21485 21486 21487 21488 21489 21490 21491 21492 21493 21494 21495 21496 21497 21498 21499 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 21513 21514 21515 21516 21517 21518 21519 21520 21521 21522 21523 21524 21525 21526 21527 21528 21529 21530 21531 21532 21533 21534 21535 21536 21537 21538 21539 21540 21541 21542 21543 21544 21545 21546 21547 21548 21549 21550 21551 21552 21553 21554 21555 21556 21557 21558 21559 21560 21561 21562 21563 21564 21565 21566 21567 21568 21569 21570 21571 21572 21573 21574 21575 21576 21577 21578 21579 21580 21581 21582 21583 21584 21585 21586 21587 21588 21589 21590 21591 21592 21593 21594 21595 21596 21597 21598 21599 21600 21601 21602 21603 21604 21605 21606 21607 21608 21609 21610 21611 21612 21613 21614 21615 21616 21617 21618 21619 21620 21621 21622 21623 21624 21625 21626 21627 21628 21629 21630 21631 21632 21633 21634 21635 21636 21637 21638 21639 21640 21641 21642 21643 21644 21645 21646 21647 21648 21649 21650 21651 21652 21653 21654 21655 21656 21657 21658 21659 21660 21661 21662 21663 21664 21665 21666 21667 21668 21669 21670 21671 21672 21673 21674 21675 21676 21677 21678 21679 21680 21681 21682 21683 21684 21685 21686 21687 21688 21689 21690 21691 21692 21693 21694 21695 21696 21697 21698 21699 21700 21701 21702 21703 21704 21705 21706 21707 21708 21709 21710 21711 21712 21713 21714 21715 21716 21717 21718 21719 21720 21721 21722 21723 21724 21725 21726 21727 21728 21729 21730 21731 21732 21733 21734 21735 21736 21737 21738 21739 21740 21741 21742 21743 21744 21745 21746 21747 21748 21749 21750 21751 21752 21753 21754 21755 21756 21757 21758 21759 21760 21761 21762 21763 21764 21765 21766 21767 21768 21769 21770 21771 21772 21773 21774 21775 21776 21777 21778 21779 21780 21781 21782 21783 21784 21785 21786 21787 21788 21789 21790 21791 21792 21793 21794 21795 21796 21797 21798 21799 21800 21801 21802 21803 21804 21805 21806 21807 21808 21809 21810 21811 21812 21813 21814 21815 21816 21817 21818 21819 21820 21821 21822 21823 21824 21825 21826 21827 21828 21829 21830 21831 21832 21833 21834 21835 21836 21837 21838 21839 21840 21841 21842 21843 21844 21845 21846 21847 21848 21849 21850 21851 21852 21853 21854 21855 21856 21857 21858 21859 21860 21861 21862 21863 21864 21865 21866 21867 21868 21869 21870 21871 21872 21873 21874 21875 21876 21877 21878 21879 21880 21881 21882 21883 21884 21885 21886 21887 21888 21889 21890 21891 21892 21893 21894 21895 21896 21897 21898 21899 21900 21901 21902 21903 21904 21905 21906 21907 21908 21909 21910 21911 21912 21913 21914 21915 21916 21917 21918 21919 21920 21921 21922 21923 21924 21925 21926 21927 21928 21929 21930 21931 21932 21933 21934 21935 21936 21937 21938 21939 21940 21941 21942 21943 21944 21945 21946 21947 21948 21949 21950 21951 21952 21953 21954 21955 21956 21957 21958 21959 21960 21961 21962 21963 21964 21965 21966 21967 21968 21969 21970 21971 21972 21973 21974 21975 21976 21977 21978 21979 21980 21981 21982 21983 21984 21985 21986 21987 21988 21989 21990 21991 21992 21993 21994 21995 21996 21997 21998 21999 22000 22001 22002 22003 22004 22005 22006 22007 22008 22009 22010 22011 22012 22013 22014 22015 22016 22017 22018 22019 22020 22021 22022 22023 22024 22025 22026 22027 22028 22029 22030 22031 22032 22033 22034 22035 22036 22037 22038 22039 22040 22041 22042 22043 22044 22045 22046 22047 22048 22049 22050 22051 22052 22053 22054 22055 22056 22057 22058 22059 22060 22061 22062 22063 22064 22065 22066 22067 22068 22069 22070 22071 22072 22073 22074 22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 22089 22090 22091 22092 22093 22094 22095 22096 22097 22098 22099 22100 22101 22102 22103 22104 22105 22106 22107 22108 22109 22110 22111 22112 22113 22114 22115 22116 22117 22118 22119 22120 22121 22122 22123 22124 22125 22126 22127 22128 22129 22130 22131 22132 22133 22134 22135 22136 22137 22138 22139 22140 22141 22142 22143 22144 22145 22146 22147 22148 22149 22150 22151 22152 22153 22154 22155 22156 22157 22158 22159 22160 22161 22162 22163 22164 22165 22166 22167 22168 22169 22170 22171 22172 22173 22174 22175 22176 22177 22178 22179 22180 22181 22182 22183 22184 22185 22186 22187 22188 22189 22190 22191 22192 22193 22194 22195 22196 22197 22198 22199 22200 22201 22202 22203 22204 22205 22206 22207 22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 22228 22229 22230 22231 22232 22233 22234 22235 22236 22237 22238 22239 22240 22241 22242 22243 22244 22245 22246 22247 22248 22249 22250 22251 22252 22253 22254 22255 22256 22257 22258 22259 22260 22261 22262 22263 22264 22265 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 22290 22291 22292 22293 22294 22295 22296 22297 22298 22299 22300 22301 22302 22303 22304 22305 22306 22307 22308 22309 22310 22311 22312 22313 22314 22315 22316 22317 22318 22319 22320 22321 22322 22323 22324 22325 22326 22327 22328 22329 22330 22331 22332 22333 22334 22335 22336 22337 22338 22339 22340 22341 22342 22343 22344 22345 22346 22347 22348 22349 22350 22351 22352 22353 22354 22355 22356 22357 22358 22359 22360 22361 22362 22363 22364 22365 22366 22367 22368 22369 22370 22371 22372 22373 22374 22375 22376 22377 22378 22379 22380 22381 22382 22383 22384 22385 22386 22387 22388 22389 22390 22391 22392 22393 22394 22395 22396 22397 22398 22399 22400 22401 22402 22403 22404 22405 22406 22407 22408 22409 22410 22411 22412 22413 22414 22415 22416 22417 22418 22419 22420 22421 22422 22423 22424 22425 22426 22427 22428 22429 22430 22431 22432 22433 22434 22435 22436 22437 22438 22439 22440 22441 22442 22443 22444 22445 22446 22447 22448 22449 22450 22451 22452 22453 22454 22455 22456 22457 22458 22459 22460 22461 22462 22463 22464 22465 22466 22467 22468 22469 22470 22471 22472 22473 22474 22475 22476 22477 22478 22479 22480 22481 22482 22483 22484 22485 22486 22487 22488 22489 22490 22491 22492 22493 22494 22495 22496 22497 22498 22499 22500 22501 22502 22503 22504 22505 22506 22507 22508 22509 22510 22511 22512 22513 22514 22515 22516 22517 22518 22519 22520 22521 22522 22523 22524 22525 22526 22527 22528 22529 22530 22531 22532 22533 22534 22535 22536 22537 22538 22539 22540 22541 22542 22543 22544 22545 22546 22547 22548 22549 22550 22551 22552 22553 22554 22555 22556 22557 22558 22559 22560 22561 22562 22563 22564 22565 22566 22567 22568 22569 22570 22571 22572 22573 22574 22575 22576 22577 22578 22579 22580 22581 22582 22583 22584 22585 22586 22587 22588 22589 22590 22591 22592 22593 22594 22595 22596 22597 22598 22599 22600 22601 22602 22603 22604 22605 22606 22607 22608 22609 22610 22611 22612 22613 22614 22615 22616 22617 22618 22619 22620 22621 22622 22623 22624 22625 22626 22627 22628 22629 22630 22631 22632 22633 22634 22635 22636 22637 22638 22639 22640 22641 22642 22643 22644 22645 22646 22647 22648 22649 22650 22651 22652 22653 22654 22655 22656 22657 22658 22659 22660 22661 22662 22663 22664 22665 22666 22667 22668 22669 22670 22671 22672 22673 22674 22675 22676 22677 22678 22679 22680 22681 22682 22683 22684 22685 22686 22687 22688 22689 22690 22691 22692 22693 22694 22695 22696 22697 22698 22699 22700 22701 22702 22703 22704 22705 22706 22707 22708 22709 22710 22711 22712 22713 22714 22715 22716 22717 22718 22719 22720 22721 22722 22723 22724 22725 22726 22727 22728 22729 22730 22731 22732 22733 22734 22735 22736 22737 22738 22739 22740 22741 22742 22743 22744 22745 22746 22747 22748 22749 22750 22751 22752 22753 22754 22755 22756 22757 22758 22759 22760 22761 22762 22763 22764 22765 22766 22767 22768 22769 22770 22771 22772 22773 22774 22775 22776 22777 22778 22779 22780 22781 22782 22783 22784 22785 22786 22787 22788 22789 22790 22791 22792 22793 22794 22795 22796 22797 22798 22799 22800 22801 22802 22803 22804 22805 22806 22807 22808 22809 22810 22811 22812 22813 22814 22815 22816 22817 22818 22819 22820 22821 22822 22823 22824 22825 22826 22827 22828 22829 22830 22831 22832 22833 22834 22835 22836 22837 22838 22839 22840 22841 22842 22843 22844 22845 22846 22847 22848 22849 22850 22851 22852 22853 22854 22855 22856 22857 22858 22859 22860 22861 22862 22863 22864 22865 22866 22867 22868 22869 22870 22871 22872 22873 22874 22875 22876 22877 22878 22879 22880 22881 22882 22883 22884 22885 22886 22887 22888 22889 22890 22891 22892 22893 22894 22895 22896 22897 22898 22899 22900 22901 22902 22903 22904 22905 22906 22907 22908 22909 22910 22911 22912 22913 22914 22915 22916 22917 22918 22919 22920 22921 22922 22923 22924 22925 22926 22927 22928 22929 22930 22931 22932 22933 22934 22935 22936 22937 22938 22939 22940 22941 22942 22943 22944 22945 22946 22947 22948 22949 22950 22951 22952 22953 22954 22955 22956 22957 22958 22959 22960 22961 22962 22963 22964 22965 22966 22967 22968 22969 22970 22971 22972 22973 22974 22975 22976 22977 22978 22979 22980 22981 22982 22983 22984 22985 22986 22987 22988 22989 22990 22991 22992 22993 22994 22995 22996 22997 22998 22999 23000 23001 23002 23003 23004 23005 23006 23007 23008 23009 23010 23011 23012 23013 23014 23015 23016 23017 23018 23019 23020 23021 23022 23023 23024 23025 23026 23027 23028 23029 23030 23031 23032 23033 23034 23035 23036 23037 23038 23039 23040 23041 23042 23043 23044 23045 23046 23047 23048 23049 23050 23051 23052 23053 23054 23055 23056 23057 23058 23059 23060 23061 23062 23063 23064 23065 23066 23067 23068 23069 23070 23071 23072 23073 23074 23075 23076 23077 23078 23079 23080 23081 23082 23083 23084 23085 23086 23087 23088 23089 23090 23091 23092 23093 23094 23095 23096 23097 23098 23099 23100 23101 23102 23103 23104 23105 23106 23107 23108 23109 23110 23111 23112 23113 23114 23115 23116 23117 23118 23119 23120 23121 23122 23123 23124 23125 23126 23127 23128 23129 23130 23131 23132 23133 23134 23135 23136 23137 23138 23139 23140 23141 23142 23143 23144 23145 23146 23147 23148 23149 23150 23151 23152 23153 23154 23155 23156 23157 23158 23159 23160 23161 23162 23163 23164 23165 23166 23167 23168 23169 23170 23171 23172 23173 23174 23175 23176 23177 23178 23179 23180 23181 23182 23183 23184 23185 23186 23187 23188 23189 23190 23191 23192 23193 23194 23195 23196 23197 23198 23199 23200 23201 23202 23203 23204 23205 23206 23207 23208 23209 23210 23211 23212 23213 23214 23215 23216 23217 23218 23219 23220 23221 23222 23223 23224 23225 23226 23227 23228 23229 23230 23231 23232 23233 23234 23235 23236 23237 23238 23239 23240 23241 23242 23243 23244 23245 23246 23247 23248 23249 23250 23251 23252 23253 23254 23255 23256 23257 23258 23259 23260 23261 23262 23263 23264 23265 23266 23267 23268 23269 23270 23271 23272 23273 23274 23275 23276 23277 23278 23279 23280 23281 23282 23283 23284 23285 23286 23287 23288 23289 23290 23291 23292 23293 23294 23295 23296 23297 23298 23299 23300 23301 23302 23303 23304 23305 23306 23307 23308 23309 23310 23311 23312 23313 23314 23315 23316 23317 23318 23319 23320 23321 23322 23323 23324 23325 23326 23327 23328 23329 23330 23331 23332 23333 23334 23335 23336 23337 23338 23339 23340 23341 23342 23343 23344 23345 23346 23347 23348 23349 23350 23351 23352 23353 23354 23355 23356 23357 23358 23359 23360 23361 23362 23363 23364 23365 23366 23367 23368 23369 23370 23371 23372 23373 23374 23375 23376 23377 23378 23379 23380 23381 23382 23383 23384 23385 23386 23387 23388 23389 23390 23391 23392 23393 23394 23395 23396 23397 23398 23399 23400 23401 23402 23403 23404 23405 23406 23407 23408 23409 23410 23411 23412 23413 23414 23415 23416 23417 23418 23419 23420 23421 23422 23423 23424 23425 23426 23427 23428 23429 23430 23431 23432 23433 23434 23435 23436 23437 23438 23439 23440 23441 23442 23443 23444 23445 23446 23447 23448 23449 23450 23451 23452 23453 23454 23455 23456 23457 23458 23459 23460 23461 23462 23463 23464 23465 23466 23467 23468 23469 23470 23471 23472 23473 23474 23475 23476 23477 23478 23479 23480 23481 23482 23483 23484 23485 23486 23487 23488 23489 23490 23491 23492 23493 23494 23495 23496 23497 23498 23499 23500 23501 23502 23503 23504 23505 23506 23507 23508 23509 23510 23511 23512 23513 23514 23515 23516 23517 23518 23519 23520 23521 23522 23523 23524 23525 23526 23527 23528 23529 23530 23531 23532 23533 23534 23535 23536 23537 23538 23539 23540 23541 23542 23543 23544 23545 23546 23547 23548 23549 23550 23551 23552 23553 23554 23555 23556 23557 23558 23559 23560 23561 23562 23563 23564 23565 23566 23567 23568 23569 23570 23571 23572 23573 23574 23575 23576 23577 23578 23579 23580 23581 23582 23583 23584 23585 23586 23587 23588 23589 23590 23591 23592 23593 23594 23595 23596 23597 23598 23599 23600 23601 23602 23603 23604 23605 23606 23607 23608 23609 23610 23611 23612 23613 23614 23615 23616 23617 23618 23619 23620 23621 23622 23623 23624 23625 23626 23627 23628 23629 23630 23631 23632 23633 23634 23635 23636 23637 23638 23639 23640 23641 23642 23643 23644 23645 23646 23647 23648 23649 23650 23651 23652 23653 23654 23655 23656 23657 23658 23659 23660 23661 23662 23663 23664 23665 23666 23667 23668 23669 23670 23671 23672 23673 23674 23675 23676 23677 23678 23679 23680 23681 23682 23683 23684 23685 23686 23687 23688 23689 23690 23691 23692 23693 23694 23695 23696 23697 23698 23699 23700 23701 23702 23703 23704 23705 23706 23707 23708 23709 23710 23711 23712 23713 23714 23715 23716 23717 23718 23719 23720 23721 23722 23723 23724 23725 23726 23727 23728 23729 23730 23731 23732 23733 23734 23735 23736 23737 23738 23739 23740 23741 23742 23743 23744 23745 23746 23747 23748 23749 23750 23751 23752 23753 23754 23755 23756 23757 23758 23759 23760 23761 23762 23763 23764 23765 23766 23767 23768 23769 23770 23771 23772 23773 23774 23775 23776 23777 23778 23779 23780 23781 23782 23783 23784 23785 23786 23787 23788 23789 23790 23791 23792 23793 23794 23795 23796 23797 23798 23799 23800 23801 23802 23803 23804 23805 23806 23807 23808 23809 23810 23811 23812 23813 23814 23815 23816 23817 23818 23819 23820 23821 23822 23823 23824 23825 23826 23827 23828 23829 23830 23831 23832 23833 23834 23835 23836 23837 23838 23839 23840 23841 23842 23843 23844 23845 23846 23847 23848 23849 23850 23851 23852 23853 23854 23855 23856 23857 23858 23859 23860 23861 23862 23863 23864 23865 23866 23867 23868 23869 23870 23871 23872 23873 23874 23875 23876 23877 23878 23879 23880 23881 23882 23883 23884 23885 23886 23887 23888 23889 23890 23891 23892 23893 23894 23895 23896 23897 23898 23899 23900 23901 23902 23903 23904 23905 23906 23907 23908 23909 23910 23911 23912 23913 23914 23915 23916 23917 23918 23919 23920 23921 23922 23923 23924 23925 23926 23927 23928 23929 23930 23931 23932 23933 23934 23935 23936 23937 23938 23939 23940 23941 23942 23943 23944 23945 23946 23947 23948 23949 23950 23951 23952 23953 23954 23955 23956 23957 23958 23959 23960 23961 23962 23963 23964 23965 23966 23967 23968 23969 23970 23971 23972 23973 23974 23975 23976 23977 23978 23979 23980 23981 23982 23983 23984 23985 23986 23987 23988 23989 23990 23991 23992 23993 23994 23995 23996 23997 23998 23999 24000 24001 24002 24003 24004 24005 24006 24007 24008 24009 24010 24011 24012 24013 24014 24015 24016 24017 24018 24019 24020 24021 24022 24023 24024 24025 24026 24027 24028 24029 24030 24031 24032 24033 24034 24035 24036 24037 24038 24039 24040 24041 24042 24043 24044 24045 24046 24047 24048 24049 24050 24051 24052 24053 24054 24055 24056 24057 24058 24059 24060 24061 24062 24063 24064 24065 24066 24067 24068 24069 24070 24071 24072 24073 24074 24075 24076 24077 24078 24079 24080 24081 24082 24083 24084 24085 24086 24087 24088 24089 24090 24091 24092 24093 24094 24095 24096 24097 24098 24099 24100 24101 24102 24103 24104 24105 24106 24107 24108 24109 24110 24111 24112 24113 24114 24115 24116 24117 24118 24119 24120 24121 24122 24123 24124 24125 24126 24127 24128 24129 24130 24131 24132 24133 24134 24135 24136 24137 24138 24139 24140 24141 24142 24143 24144 24145 24146 24147 24148 24149 24150 24151 24152 24153 24154 24155 24156 24157 24158 24159 24160 24161 24162 24163 24164 24165 24166 24167 24168 24169 24170 24171 24172 24173 24174 24175 24176 24177 24178 24179 24180 24181 24182 24183 24184 24185 24186 24187 24188 24189 24190 24191 24192 24193 24194 24195 24196 24197 24198 24199 24200 24201 24202 24203 24204 24205 24206 24207 24208 24209 24210 24211 24212 24213 24214 24215 24216 24217 24218 24219 24220 24221 24222 24223 24224 24225 24226 24227 24228 24229 24230 24231 24232 24233 24234 24235 24236 24237 24238 24239 24240 24241 24242 24243 24244 24245 24246 24247 24248 24249 24250 24251 24252 24253 24254 24255 24256 24257 24258 24259 24260 24261 24262 24263 24264 24265 24266 24267 24268 24269 24270 24271 24272 24273 24274 24275 24276 24277 24278 24279 24280 24281 24282 24283 24284 24285 24286 24287 24288 24289 24290 24291 24292 24293 24294 24295 24296 24297 24298 24299 24300 24301 24302 24303 24304 24305 24306 24307 24308 24309 24310 24311 24312 24313 24314 24315 24316 24317 24318 24319 24320 24321 24322 24323 24324 24325 24326 24327 24328 24329 24330 24331 24332 24333 24334 24335 24336 24337 24338 24339 24340 24341 24342 24343 24344 24345 24346 24347 24348 24349 24350 24351 24352 24353 24354 24355 24356 24357 24358 24359 24360 24361 24362 24363 24364 24365 24366 24367 24368 24369 24370 24371 24372 24373 24374 24375 24376 24377 24378 24379 24380 24381 24382 24383 24384 24385 24386 24387 24388 24389 24390 24391 24392 24393 24394 24395 24396 24397 24398 24399 24400 24401 24402 24403 24404 24405 24406 24407 24408 24409 24410 24411 24412 24413 24414 24415 24416 24417 24418 24419 24420 24421 24422 24423 24424 24425 24426 24427 24428 24429 24430 24431 24432 24433 24434 24435 24436 24437 24438 24439 24440 24441 24442 24443 24444 24445 24446 24447 24448 24449 24450 24451 24452 24453 24454 24455 24456 24457 24458 24459 24460 24461 24462 24463 24464 24465 24466 24467 24468 24469 24470 24471 24472 24473 24474 24475 24476 24477 24478 24479 24480 24481 24482 24483 24484 24485 24486 24487 24488 24489 24490 24491 24492 24493 24494 24495 24496 24497 24498 24499 24500 24501 24502 24503 24504 24505 24506 24507 24508 24509 24510 24511 24512 24513 24514 24515 24516 24517 24518 24519 24520 24521 24522 24523 24524 24525 24526 24527 24528 24529 24530 24531 24532 24533 24534 24535 24536 24537 24538 24539 24540 24541 24542 24543 24544 24545 24546 24547 24548 24549 24550 24551 24552 24553 24554 24555 24556 24557 24558 24559 24560 24561 24562 24563 24564 24565 24566 24567 24568 24569 24570 24571 24572 24573 24574 24575 24576 24577 24578 24579 24580 24581 24582 24583 24584 24585 24586 24587 24588 24589 24590 24591 24592 24593 24594 24595 24596 24597 24598 24599 24600 24601 24602 24603 24604 24605 24606 24607 24608 24609 24610 24611 24612 24613 24614 24615 24616 24617 24618 24619 24620 24621 24622 24623 24624 24625 24626 24627 24628 24629 24630 24631 24632 24633 24634 24635 24636 24637 24638 24639 24640 24641 24642 24643 24644 24645 24646 24647 24648 24649 24650 24651 24652 24653 24654 24655 24656 24657 24658 24659 24660 24661 24662 24663 24664 24665 24666 24667 24668 24669 24670 24671 24672 24673 24674 24675 24676 24677 24678 24679 24680 24681 24682 24683 24684 24685 24686 24687 24688 24689 24690 24691 24692 24693 24694 24695 24696 24697 24698 24699 24700 24701 24702 24703 24704 24705 24706 24707 24708 24709 24710 24711 24712 24713 24714 24715 24716 24717 24718 24719 24720 24721 24722 24723 24724 24725 24726 24727 24728 24729 24730 24731 24732 24733 24734 24735 24736 24737 24738 24739 24740 24741 24742 24743 24744 24745 24746 24747 24748 24749 24750 24751 24752 24753 24754 24755 24756 24757 24758 24759 24760 24761 24762 24763 24764 24765 24766 24767 24768 24769 24770 24771 24772 24773 24774 24775 24776 24777 24778 24779 24780 24781 24782 24783 24784 24785 24786 24787 24788 24789 24790 24791 24792 24793 24794 24795 24796 24797 24798 24799 24800 24801 24802 24803 24804 24805 24806 24807 24808 24809 24810 24811 24812 24813 24814 24815 24816 24817 24818 24819 24820 24821 24822 24823 24824 24825 24826 24827 24828 24829 24830 24831 24832 24833 24834 24835 24836 24837 24838 24839 24840 24841 24842 24843 24844 24845 24846 24847 24848 24849 24850 24851 24852 24853 24854 24855 24856 24857 24858 24859 24860 24861 24862 24863 24864 24865 24866 24867 24868 24869 24870 24871 24872 24873 24874 24875 24876 24877 24878 24879 24880 24881 24882 24883 24884 24885 24886 24887 24888 24889 24890 24891 24892 24893 24894 24895 24896 24897 24898 24899 24900 24901 24902 24903 24904 24905 24906 24907 24908 24909 24910 24911 24912 24913 24914 24915 24916 24917 24918 24919 24920 24921 24922 24923 24924 24925 24926 24927 24928 24929 24930 24931 24932 24933 24934 24935 24936 24937 24938 24939 24940 24941 24942 24943 24944 24945 24946 24947 24948 24949 24950 24951 24952 24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034 25035 25036 25037 25038 25039 25040 25041 25042 25043 25044 25045 25046 25047 25048 25049 25050 25051 25052 25053 25054 25055 25056 25057 25058 25059 25060 25061 25062 25063 25064 25065 25066 25067 25068 25069 25070 25071 25072 25073 25074 25075 25076 25077 25078 25079 25080 25081 25082 25083 25084 25085 25086 25087 25088 25089 25090 25091 25092 25093 25094 25095 25096 25097 25098 25099 25100 25101 25102 25103 25104 25105 25106 25107 25108 25109 25110 25111 25112 25113 25114 25115 25116 25117 25118 25119 25120 25121 25122 25123 25124 25125 25126 25127 25128 25129 25130 25131 25132 25133 25134 25135 25136 25137 25138 25139 25140 25141 25142 25143 25144 25145 25146 25147 25148 25149 25150 25151 25152 25153 25154 25155 25156 25157 25158 25159 25160 25161 25162 25163 25164 25165 25166 25167 25168 25169 25170 25171 25172 25173 25174 25175 25176 25177 25178 25179 25180 25181 25182 25183 25184 25185 25186 25187 25188 25189 25190 25191 25192 25193 25194 25195 25196 25197 25198 25199 25200 25201 25202 25203 25204 25205 25206 25207 25208 25209 25210 25211 25212 25213 25214 25215 25216 25217 25218 25219 25220 25221 25222 25223 25224 25225 25226 25227 25228 25229 25230 25231 25232 25233 25234 25235 25236 25237 25238 25239 25240 25241 25242 25243 25244 25245 25246 25247 25248 25249 25250 25251 25252 25253 25254 25255 25256 25257 25258 25259 25260 25261 25262 25263 25264 25265 25266 25267 25268 25269 25270 25271 25272 25273 25274 25275 25276 25277 25278 25279 25280 25281 25282 25283 25284 25285 25286 25287 25288 25289 25290 25291 25292 25293 25294 25295 25296 25297 25298 25299 25300 25301 25302 25303 25304 25305 25306 25307 25308 25309 25310 25311 25312 25313 25314 25315 25316 25317 25318 25319 25320 25321 25322 25323 25324 25325 25326 25327 25328 25329 25330 25331 25332 25333 25334 25335 25336 25337 25338 25339 25340 25341 25342 25343 25344 25345 25346 25347 25348 25349 25350 25351 25352 25353 25354 25355 25356 25357 25358 25359 25360 25361 25362 25363 25364 25365 25366 25367 25368 25369 25370 25371 25372 25373 25374 25375 25376 25377 25378 25379 25380 25381 25382 25383 25384 25385 25386 25387 25388 25389 25390 25391 25392 25393 25394 25395 25396 25397 25398 25399 25400 25401 25402 25403 25404 25405 25406 25407 25408 25409 25410 25411 25412 25413 25414 25415 25416 25417 25418 25419 25420 25421 25422 25423 25424 25425 25426 25427 25428 25429 25430 25431 25432 25433 25434 25435 25436 25437 25438 25439 25440 25441 25442 25443 25444 25445 25446 25447 25448 25449 25450 25451 25452 25453 25454 25455 25456 25457 25458 25459 25460 25461 25462 25463 25464 25465 25466 25467 25468 25469 25470 25471 25472 25473 25474 25475 25476 25477 25478 25479 25480 25481 25482 25483 25484 25485 25486 25487 25488 25489 25490 25491 25492 25493 25494 25495 25496 25497 25498 25499 25500 25501 25502 25503 25504 25505 25506 25507 25508 25509 25510 25511 25512 25513 25514 25515 25516 25517 25518 25519 25520 25521 25522 25523 25524 25525 25526 25527 25528 25529 25530 25531 25532 25533 25534 25535 25536 25537 25538 25539 25540 25541 25542 25543 25544 25545 25546 25547 25548 25549 25550 25551 25552 25553 25554 25555 25556 25557 25558 25559 25560 25561 25562 25563 25564 25565 25566 25567 25568 25569 25570 25571 25572 25573 25574 25575 25576 25577 25578 25579 25580 25581 25582 25583 25584 25585 25586 25587 25588 25589 25590 25591 25592 25593 25594 25595 25596 25597 25598 25599 25600 25601 25602 25603 25604 25605 25606 25607 25608 25609 25610 25611 25612 25613 25614 25615 25616 25617 25618 25619 25620 25621 25622 25623 25624 25625 25626 25627 25628 25629 25630 25631 25632 25633 25634 25635 25636 25637 25638 25639 25640 25641 25642 25643 25644 25645 25646 25647 25648 25649 25650 25651 25652 25653 25654 25655 25656 25657 25658 25659 25660 25661 25662 25663 25664 25665 25666 25667 25668 25669 25670 25671 25672 25673 25674 25675 25676 25677 25678 25679 25680 25681 25682 25683 25684 25685 25686 25687 25688 25689 25690 25691 25692 25693 25694 25695 25696 25697 25698 25699 25700 25701 25702 25703 25704 25705 25706 25707 25708 25709 25710 25711 25712 25713 25714 25715 25716 25717 25718 25719 25720 25721 25722 25723 25724 25725 25726 25727 25728 25729 25730 25731 25732 25733 25734 25735 25736 25737 25738 25739 25740 25741 25742 25743 25744 25745 25746 25747 25748 25749 25750 25751 25752 25753 25754 25755 25756 25757 25758 25759 25760 25761 25762 25763 25764 25765 25766 25767 25768 25769 25770 25771 25772 25773 25774 25775 25776 25777 25778 25779 25780 25781 25782 25783 25784 25785 25786 25787 25788 25789 25790 25791 25792 25793 25794 25795 25796 25797 25798 25799 25800 25801 25802 25803 25804 25805 25806 25807 25808 25809 25810 25811 25812 25813 25814 25815 25816 25817 25818 25819 25820 25821 25822 25823 25824 25825 25826 25827 25828 25829 25830 25831 25832 25833 25834 25835 25836 25837 25838 25839 25840 25841 25842 25843 25844 25845 25846 25847 25848 25849 25850 25851 25852 25853 25854 25855 25856 25857 25858 25859 25860 25861 25862 25863 25864 25865 25866 25867 25868 25869 25870 25871 25872 25873 25874 25875 25876 25877 25878 25879 25880 25881 25882 25883 25884 25885 25886 25887 25888 25889 25890 25891 25892 25893 25894 25895 25896 25897 25898 25899 25900 25901 25902 25903 25904 25905 25906 25907 25908 25909 25910 25911 25912 25913 25914 25915 25916 25917 25918 25919 25920 25921 25922 25923 25924 25925 25926 25927 25928 25929 25930 25931 25932 25933 25934 25935 25936 25937 25938 25939 25940 25941 25942 25943 25944 25945 25946 25947 25948 25949 25950 25951 25952 25953 25954 25955 25956 25957 25958 25959 25960 25961 25962 25963 25964 25965 25966 25967 25968 25969 25970 25971 25972 25973 25974 25975 25976 25977 25978 25979 25980 25981 25982 25983 25984 25985 25986 25987 25988 25989 25990 25991 25992 25993 25994 25995 25996 25997 25998 25999 26000 26001 26002 26003 26004 26005 26006 26007 26008 26009 26010 26011 26012 26013 26014 26015 26016 26017 26018 26019 26020 26021 26022 26023 26024 26025 26026 26027 26028 26029 26030 26031 26032 26033 26034 26035 26036 26037 26038 26039 26040 26041 26042 26043 26044 26045 26046 26047 26048 26049 26050 26051 26052 26053 26054 26055 26056 26057 26058 26059 26060 26061 26062 26063 26064 26065 26066 26067 26068 26069 26070 26071 26072 26073 26074 26075 26076 26077 26078 26079 26080 26081 26082 26083 26084 26085 26086 26087 26088 26089 26090 26091 26092 26093 26094 26095 26096 26097 26098 26099 26100 26101 26102 26103 26104 26105 26106 26107 26108 26109 26110 26111 26112 26113 26114 26115 26116 26117 26118 26119 26120 26121 26122 26123 26124 26125 26126 26127 26128 26129 26130 26131 26132 26133 26134 26135 26136 26137 26138 26139 26140 26141 26142 26143 26144 26145 26146 26147 26148 26149 26150 26151 26152 26153 26154 26155 26156 26157 26158 26159 26160 26161 26162 26163 26164 26165 26166 26167 26168 26169 26170 26171 26172 26173 26174 26175 26176 26177 26178 26179 26180 26181 26182 26183 26184 26185 26186 26187 26188 26189 26190 26191 26192 26193 26194 26195 26196 26197 26198 26199 26200 26201 26202 26203 26204 26205 26206 26207 26208 26209 26210 26211 26212 26213 26214 26215 26216 26217 26218 26219 26220 26221 26222 26223 26224 26225 26226 26227 26228 26229 26230 26231 26232 26233 26234 26235 26236 26237 26238 26239 26240 26241 26242 26243 26244 26245 26246 26247 26248 26249 26250 26251 26252 26253 26254 26255 26256 26257 26258 26259 26260 26261 26262 26263 26264 26265 26266 26267 26268 26269 26270 26271 26272 26273 26274 26275 26276 26277 26278 26279 26280 26281 26282 26283 26284 26285 26286 26287 26288 26289 26290 26291 26292 26293 26294 26295 26296 26297 26298 26299 26300 26301 26302 26303 26304 26305 26306 26307 26308 26309 26310 26311 26312 26313 26314 26315 26316 26317 26318 26319 26320 26321 26322 26323 26324 26325 26326 26327 26328 26329 26330 26331 26332 26333 26334 26335 26336 26337 26338 26339 26340 26341 26342 26343 26344 26345 26346 26347 26348 26349 26350 26351 26352 26353 26354 26355 26356 26357 26358 26359 26360 26361 26362 26363 26364 26365 26366 26367 26368 26369 26370 26371 26372 26373 26374 26375 26376 26377 26378 26379 26380 26381 26382 26383 26384 26385 26386 26387 26388 26389 26390 26391 26392 26393 26394 26395 26396 26397 26398 26399 26400 26401 26402 26403 26404 26405 26406 26407 26408 26409 26410 26411 26412 26413 26414 26415 26416 26417 26418 26419 26420 26421 26422 26423 26424 26425 26426 26427 26428 26429 26430 26431 26432 26433 26434 26435 26436 26437 26438 26439 26440 26441 26442 26443 26444 26445 26446 26447 26448 26449 26450 26451 26452 26453 26454 26455 26456 26457 26458 26459 26460 26461 26462 26463 26464 26465 26466 26467 26468 26469 26470 26471 26472 26473 26474 26475 26476 26477 26478 26479 26480 26481 26482 26483 26484 26485 26486 26487 26488 26489 26490 26491 26492 26493 26494 26495 26496 26497 26498 26499 26500 26501 26502 26503 26504 26505 26506 26507 26508 26509 26510 26511 26512 26513 26514 26515 26516 26517 26518 26519 26520 26521 26522 26523 26524 26525 26526 26527 26528 26529 26530 26531 26532 26533 26534 26535 26536 26537 26538 26539 26540 26541 26542 26543 26544 26545 26546 26547 26548 26549 26550 26551 26552 26553 26554 26555 26556 26557 26558 26559 26560 26561 26562 26563 26564 26565 26566 26567 26568 26569 26570 26571 26572 26573 26574 26575 26576 26577 26578 26579 26580 26581 26582 26583 26584 26585 26586 26587 26588 26589 26590 26591 26592 26593 26594 26595 26596 26597 26598 26599 26600 26601 26602 26603 26604 26605 26606 26607 26608 26609 26610 26611 26612 26613 26614 26615 26616 26617 26618 26619 26620 26621 26622 26623 26624 26625 26626 26627 26628 26629 26630 26631 26632 26633 26634 26635 26636 26637 26638 26639 26640 26641 26642 26643 26644 26645 26646 26647 26648 26649 26650 26651 26652 26653 26654 26655 26656 26657 26658 26659 26660 26661 26662 26663 26664 26665 26666 26667 26668 26669 26670 26671 26672 26673 26674 26675 26676 26677 26678 26679 26680 26681 26682 26683 26684 26685 26686 26687 26688 26689 26690 26691 26692 26693 26694 26695 26696 26697 26698 26699 26700 26701 26702 26703 26704 26705 26706 26707 26708 26709 26710 26711 26712 26713 26714 26715 26716 26717 26718 26719 26720 26721 26722 26723 26724 26725 26726 26727 26728 26729 26730 26731 26732 26733 26734 26735 26736 26737 26738 26739 26740 26741 26742 26743 26744 26745 26746 26747 26748 26749 26750 26751 26752 26753 26754 26755 26756 26757 26758 26759 26760 26761 26762 26763 26764 26765 26766 26767 26768 26769 26770 26771 26772 26773 26774 26775 26776 26777 26778 26779 26780 26781 26782 26783 26784 26785 26786 26787 26788 26789 26790 26791 26792 26793 26794 26795 26796 26797 26798 26799 26800 26801 26802 26803 26804 26805 26806 26807 26808 26809 26810 26811 26812 26813 26814 26815 26816 26817 26818 26819 26820 26821 26822 26823 26824 26825 26826 26827 26828 26829 26830 26831 26832 26833 26834 26835 26836 26837 26838 26839 26840 26841 26842 26843 26844 26845 26846 26847 26848 26849 26850 26851 26852 26853 26854 26855 26856 26857 26858 26859 26860 26861 26862 26863 26864 26865 26866 26867 26868 26869 26870 26871 26872 26873 26874 26875 26876 26877 26878 26879 26880 26881 26882 26883 26884 26885 26886 26887 26888 26889 26890 26891 26892 26893 26894 26895 26896 26897 26898 26899 26900 26901 26902 26903 26904 26905 26906 26907 26908 26909 26910 26911 26912 26913 26914 26915 26916 26917 26918 26919 26920 26921 26922 26923 26924 26925 26926 26927 26928 26929 26930 26931 26932 26933 26934 26935 26936 26937 26938 26939 26940 26941 26942 26943 26944 26945 26946 26947 26948 26949 26950 26951 26952 26953 26954 26955 26956 26957 26958 26959 26960 26961 26962 26963 26964 26965 26966 26967 26968 26969 26970 26971 26972 26973 26974 26975 26976 26977 26978 26979 26980 26981 26982 26983 26984 26985 26986 26987 26988 26989 26990 26991 26992 26993 26994 26995 26996 26997 26998 26999 27000 27001 27002 27003 27004 27005 27006 27007 27008 27009 27010 27011 27012 27013 27014 27015 27016 27017 27018 27019 27020 27021 27022 27023 27024 27025 27026 27027 27028 27029 27030 27031 27032 27033 27034 27035 27036 27037 27038 27039 27040 27041 27042 27043 27044 27045 27046 27047 27048 27049 27050 27051 27052 27053 27054 27055 27056 27057 27058 27059 27060 27061 27062 27063 27064 27065 27066 27067 27068 27069 27070 27071 27072 27073 27074 27075 27076 27077 27078 27079 27080 27081 27082 27083 27084 27085 27086 27087 27088 27089 27090 27091 27092 27093 27094 27095 27096 27097 27098 27099 27100 27101 27102 27103 27104 27105 27106 27107 27108 27109 27110 27111 27112 27113 27114 27115 27116 27117 27118 27119 27120 27121 27122 27123 27124 27125 27126 27127 27128 27129 27130 27131 27132 27133 27134 27135 27136 27137 27138 27139 27140 27141 27142 27143 27144 27145 27146 27147 27148 27149 27150 27151 27152 27153 27154 27155 27156 27157 27158 27159 27160 27161 27162 27163 27164 27165 27166 27167 27168 27169 27170 27171 27172 27173 27174 27175 27176 27177 27178 27179 27180 27181 27182 27183 27184 27185 27186 27187 27188 27189 27190 27191 27192 27193 27194 27195 27196 27197 27198 27199 27200 27201 27202 27203 27204 27205 27206 27207 27208 27209 27210 27211 27212 27213 27214 27215 27216 27217 27218 27219 27220 27221 27222 27223 27224 27225 27226 27227 27228 27229 27230 27231 27232 27233 27234 27235 27236 27237 27238 27239 27240 27241 27242 27243 27244 27245 27246 27247 27248 27249 27250 27251 27252 27253 27254 27255 27256 27257 27258 27259 27260 27261 27262 27263 27264 27265 27266 27267 27268 27269 27270 27271 27272 27273 27274 27275 27276 27277 27278 27279 27280 27281 27282 27283 27284 27285 27286 27287 27288 27289 27290 27291 27292 27293 27294 27295 27296 27297 27298 27299 27300 27301 27302 27303 27304 27305 27306 27307 27308 27309 27310 27311 27312 27313 27314 27315 27316 27317 27318 27319 27320 27321 27322 27323 27324 27325 27326 27327 27328 27329 27330 27331 27332 27333 27334 27335 27336 27337 27338 27339 27340 27341 27342 27343 27344 27345 27346 27347 27348 27349 27350 27351 27352 27353 27354 27355 27356 27357 27358 27359 27360 27361 27362 27363 27364 27365 27366 27367 27368 27369 27370 27371 27372 27373 27374 27375 27376 27377 27378 27379 27380 27381 27382 27383 27384 27385 27386 27387 27388 27389 27390 27391 27392 27393 27394 27395 27396 27397 27398 27399 27400 27401 27402 27403 27404 27405 27406 27407 27408 27409 27410 27411 27412 27413 27414 27415 27416 27417 27418 27419 27420 27421 27422 27423 27424 27425 27426 27427 27428 27429 27430 27431 27432 27433 27434 27435 27436 27437 27438 27439 27440 27441 27442 27443 27444 27445 27446 27447 27448 27449 27450 27451 27452 27453 27454 27455 27456 27457 27458 27459 27460 27461 27462 27463 27464 27465 27466 27467 27468 27469 27470 27471 27472 27473 27474 27475 27476 27477 27478 27479 27480 27481 27482 27483 27484 27485 27486 27487 27488 27489 27490 27491 27492 27493 27494 27495 27496 27497 27498 27499 27500 27501 27502 27503 27504 27505 27506 27507 27508 27509 27510 27511 27512 27513 27514 27515 27516 27517 27518 27519 27520 27521 27522 27523 27524 27525 27526 27527 27528 27529 27530 27531 27532 27533 27534 27535 27536 27537 27538 27539 27540 27541 27542 27543 27544 27545 27546 27547 27548 27549 27550 27551 27552 27553 27554 27555 27556 27557 27558 27559 27560 27561 27562 27563 27564 27565 27566 27567 27568 27569 27570 27571 27572 27573 27574 27575 27576 27577 27578 27579 27580 27581 27582 27583 27584 27585 27586 27587 27588 27589 27590 27591 27592 27593 27594 27595 27596 27597 27598 27599 27600 27601 27602 27603 27604 27605 27606 27607 27608 27609 27610 27611 27612 27613 27614 27615 27616 27617 27618 27619 27620 27621 27622 27623 27624 27625 27626 27627 27628 27629 27630 27631 27632 27633 27634 27635 27636 27637 27638 27639 27640 27641 27642 27643 27644 27645 27646 27647 27648 27649 27650 27651 27652 27653 27654 27655 27656 27657 27658 27659 27660 27661 27662 27663 27664 27665 27666 27667 27668 27669 27670 27671 27672 27673 27674 27675 27676 27677 27678 27679 27680 27681 27682 27683 27684 27685 27686 27687 27688 27689 27690 27691 27692 27693 27694 27695 27696 27697 27698 27699 27700 27701 27702 27703 27704 27705 27706 27707 27708 27709 27710 27711 27712 27713 27714 27715 27716 27717 27718 27719 27720 27721 27722 27723 27724 27725 27726 27727 27728 27729 27730 27731 27732 27733 27734 27735 27736 27737 27738 27739 27740 27741 27742 27743 27744 27745 27746 27747 27748 27749 27750 27751 27752 27753 27754 27755 27756 27757 27758 27759 27760 27761 27762 27763 27764 27765 27766 27767 27768 27769 27770 27771 27772 27773 27774 27775 27776 27777 27778 27779 27780 27781 27782 27783 27784 27785 27786 27787 27788 27789 27790 27791 27792 27793 27794 27795 27796 27797 27798 27799 27800 27801 27802 27803 27804 27805 27806 27807 27808 27809 27810 27811 27812 27813 27814 27815 27816 27817 27818 27819 27820 27821 27822 27823 27824 27825 27826 27827 27828 27829 27830 27831 27832 27833 27834 27835 27836 27837 27838 27839 27840 27841 27842 27843 27844 27845 27846 27847 27848 27849 27850 27851 27852 27853 27854 27855 27856 27857 27858 27859 27860 27861 27862 27863 27864 27865 27866 27867 27868 27869 27870 27871 27872 27873 27874 27875 27876 27877 27878 27879 27880 27881 27882 27883 27884 27885 27886 27887 27888 27889 27890 27891 27892 27893 27894 27895 27896 27897 27898 27899 27900 27901 27902 27903 27904 27905 27906 27907 27908 27909 27910 27911 27912 27913 27914 27915 27916 27917 27918 27919 27920 27921 27922 27923 27924 27925 27926 27927 27928 27929 27930 27931 27932 27933 27934 27935 27936 27937 27938 27939 27940 27941 27942 27943 27944 27945 27946 27947 27948 27949 27950 27951 27952 27953 27954 27955 27956 27957 27958 27959 27960 27961 27962 27963 27964 27965 27966 27967 27968 27969 27970 27971 27972 27973 27974 27975 27976 27977 27978 27979 27980 27981 27982 27983 27984 27985 27986 27987 27988 27989 27990 27991 27992 27993 27994 27995 27996 27997 27998 27999 28000 28001 28002 28003 28004 28005 28006 28007 28008 28009 28010 28011 28012 28013 28014 28015 28016 28017 28018 28019 28020 28021 28022 28023 28024 28025 28026 28027 28028 28029 28030 28031 28032 28033 28034 28035 28036 28037 28038 28039 28040 28041 28042 28043 28044 28045 28046 28047 28048 28049 28050 28051 28052 28053 28054 28055 28056 28057 28058 28059 28060 28061 28062 28063 28064 28065 28066 28067 28068 28069 28070 28071 28072 28073 28074 28075 28076 28077 28078 28079 28080 28081 28082 28083 28084 28085 28086 28087 28088 28089 28090 28091 28092 28093 28094 28095 28096 28097 28098 28099 28100 28101 28102 28103 28104 28105 28106 28107 28108 28109 28110 28111 28112 28113 28114 28115 28116 28117 28118 28119 28120 28121 28122 28123 28124 28125 28126 28127 28128 28129 28130 28131 28132 28133 28134 28135 28136 28137 28138 28139 28140 28141 28142 28143 28144 28145 28146 28147 28148 28149 28150 28151 28152 28153 28154 28155 28156 28157 28158 28159 28160 28161 28162 28163 28164 28165 28166 28167 28168 28169 28170 28171 28172 28173 28174 28175 28176 28177 28178 28179 28180 28181 28182 28183 28184 28185 28186 28187 28188 28189 28190 28191 28192 28193 28194 28195 28196 28197 28198 28199 28200 28201 28202 28203 28204 28205 28206 28207 28208 28209 28210 28211 28212 28213 28214 28215 28216 28217 28218 28219 28220 28221 28222 28223 28224 28225 28226 28227 28228 28229 28230 28231 28232 28233 28234 28235 28236 28237 28238 28239 28240 28241 28242 28243 28244 28245 28246 28247 28248 28249 28250 28251 28252 28253 28254 28255 28256 28257 28258 28259 28260 28261 28262 28263 28264 28265 28266 28267 28268 28269 28270 28271 28272 28273 28274 28275 28276 28277 28278 28279 28280 28281 28282 28283 28284 28285 28286 28287 28288 28289 28290 28291 28292 28293 28294 28295 28296 28297 28298 28299 28300 28301 28302 28303 28304 28305 28306 28307 28308 28309 28310 28311 28312 28313 28314 28315 28316 28317 28318 28319 28320 28321 28322 28323 28324 28325 28326 28327 28328 28329 28330 28331 28332 28333 28334 28335 28336 28337 28338 28339 28340 28341 28342 28343 28344 28345 28346 28347 28348 28349 28350 28351 28352 28353 28354 28355 28356 28357 28358 28359 28360 28361 28362 28363 28364 28365 28366 28367 28368 28369 28370 28371 28372 28373 28374 28375 28376 28377 28378 28379 28380 28381 28382 28383 28384 28385 28386 28387 28388 28389 28390 28391 28392 28393 28394 28395 28396 28397 28398 28399 28400 28401 28402 28403 28404 28405 28406 28407 28408 28409 28410 28411 28412 28413 28414 28415 28416 28417 28418 28419 28420 28421 28422 28423 28424 28425 28426 28427 28428 28429 28430 28431 28432 28433 28434 28435 28436 28437 28438 28439 28440 28441 28442 28443 28444 28445 28446 28447 28448 28449 28450 28451 28452 28453 28454 28455 28456 28457 28458 28459 28460 28461 28462 28463 28464 28465 28466 28467 28468 28469 28470 28471 28472 28473 28474 28475 28476 28477 28478 28479 28480 28481 28482 28483 28484 28485 28486 28487 28488 28489 28490 28491 28492 28493 28494 28495 28496 28497 28498 28499 28500 28501 28502 28503 28504 28505 28506 28507 28508 28509 28510 28511 28512 28513 28514 28515 28516 28517 28518 28519 28520 28521 28522 28523 28524 28525 28526 28527 28528 28529 28530 28531 28532 28533 28534 28535 28536 28537 28538 28539 28540 28541 28542 28543 28544 28545 28546 28547 28548 28549 28550 28551 28552 28553 28554 28555 28556 28557 28558 28559 28560 28561 28562 28563 28564 28565 28566 28567 28568 28569 28570 28571 28572 28573 28574 28575 28576 28577 28578 28579 28580 28581 28582 28583 28584 28585 28586 28587 28588 28589 28590 28591 28592 28593 28594 28595 28596 28597 28598 28599 28600 28601 28602 28603 28604 28605 28606 28607 28608 28609 28610 28611 28612 28613 28614 28615 28616 28617 28618 28619 28620 28621 28622 28623 28624 28625 28626 28627 28628 28629 28630 28631 28632 28633 28634 28635 28636 28637 28638 28639 28640 28641 28642 28643 28644 28645 28646 28647 28648 28649 28650 28651 28652 28653 28654 28655 28656 28657 28658 28659 28660 28661 28662 28663 28664 28665 28666 28667 28668 28669 28670 28671 28672 28673 28674 28675 28676 28677 28678 28679 28680 28681 28682 28683 28684 28685 28686 28687 28688 28689 28690 28691 28692 28693 28694 28695 28696 28697 28698 28699 28700 28701 28702 28703 28704 28705 28706 28707 28708 28709 28710 28711 28712 28713 28714 28715 28716 28717 28718 28719 28720 28721 28722 28723 28724 28725 28726 28727 28728 28729 28730 28731 28732 28733 28734 28735 28736 28737 28738 28739 28740 28741 28742 28743 28744 28745 28746 28747 28748 28749 28750 28751 28752 28753 28754 28755 28756 28757 28758 28759 28760 28761 28762 28763 28764 28765 28766 28767 28768 28769 28770 28771 28772 28773 28774 28775 28776 28777 28778 28779 28780 28781 28782 28783 28784 28785 28786 28787 28788 28789 28790 28791 28792 28793 28794 28795 28796 28797 28798 28799 28800 28801 28802 28803 28804 28805 28806 28807 28808 28809 28810 28811 28812 28813 28814 28815 28816 28817 28818 28819 28820 28821 28822 28823 28824 28825 28826 28827 28828 28829 28830 28831 28832 28833 28834 28835 28836 28837 28838 28839 28840 28841 28842 28843 28844 28845 28846 28847 28848 28849 28850 28851 28852 28853 28854 28855 28856 28857 28858 28859 28860 28861 28862 28863 28864 28865 28866 28867 28868 28869 28870 28871 28872 28873 28874 28875 28876 28877 28878 28879 28880 28881 28882 28883 28884 28885 28886 28887 28888 28889 28890 28891 28892 28893 28894 28895 28896 28897 28898 28899 28900 28901 28902 28903 28904 28905 28906 28907 28908 28909 28910 28911 28912 28913 28914 28915 28916 28917 28918 28919 28920 28921 28922 28923 28924 28925 28926 28927 28928 28929 28930 28931 28932 28933 28934 28935 28936 28937 28938 28939 28940 28941 28942 28943 28944 28945 28946 28947 28948 28949 28950 28951 28952 28953 28954 28955 28956 28957 28958 28959 28960 28961 28962 28963 28964 28965 28966 28967 28968 28969 28970 28971 28972 28973 28974 28975 28976 28977 28978 28979 28980 28981 28982 28983 28984 28985 28986 28987 28988 28989 28990 28991 28992 28993 28994 28995 28996 28997 28998 28999 29000 29001 29002 29003 29004 29005 29006 29007 29008 29009 29010 29011 29012 29013 29014 29015 29016 29017 29018 29019 29020 29021 29022 29023 29024 29025 29026 29027 29028 29029 29030 29031 29032 29033 29034 29035 29036 29037 29038 29039 29040 29041 29042 29043 29044 29045 29046 29047 29048 29049 29050 29051 29052 29053 29054 29055 29056 29057 29058 29059 29060 29061 29062 29063 29064 29065 29066 29067 29068 29069 29070 29071 29072 29073 29074 29075 29076 29077 29078 29079 29080 29081 29082 29083 29084 29085 29086 29087 29088 29089 29090 29091 29092 29093 29094 29095 29096 29097 29098 29099 29100 29101 29102 29103 29104 29105 29106 29107 29108 29109 29110 29111 29112 29113 29114 29115 29116 29117 29118 29119 29120 29121 29122 29123 29124 29125 29126 29127 29128 29129 29130 29131 29132 29133 29134 29135 29136 29137 29138 29139 29140 29141 29142 29143 29144 29145 29146 29147 29148 29149 29150 29151 29152 29153 29154 29155 29156 29157 29158 29159 29160 29161 29162 29163 29164 29165 29166 29167 29168 29169 29170 29171 29172 29173 29174 29175 29176 29177 29178 29179 29180 29181 29182 29183 29184 29185 29186 29187 29188 29189 29190 29191 29192 29193 29194 29195 29196 29197 29198 29199 29200 29201 29202 29203 29204 29205 29206 29207 29208 29209 29210 29211 29212 29213 29214 29215 29216 29217 29218 29219 29220 29221 29222 29223 29224 29225 29226 29227 29228 29229 29230 29231 29232 29233 29234 29235 29236 29237 29238 29239 29240 29241 29242 29243 29244 29245 29246 29247 29248 29249 29250 29251 29252 29253 29254 29255 29256 29257 29258 29259 29260 29261 29262 29263 29264 29265 29266 29267 29268 29269 29270 29271 29272 29273 29274 29275 29276 29277 29278 29279 29280 29281 29282 29283 29284 29285 29286 29287 29288 29289 29290 29291 29292 29293 29294 29295 29296 29297 29298 29299 29300 29301 29302 29303 29304 29305 29306 29307 29308 29309 29310 29311 29312 29313 29314 29315 29316 29317 29318 29319 29320 29321 29322 29323 29324 29325 29326 29327 29328 29329 29330 29331 29332 29333 29334 29335 29336 29337 29338 29339 29340 29341 29342 29343 29344 29345 29346 29347 29348 29349 29350 29351 29352 29353 29354 29355 29356 29357 29358 29359 29360 29361 29362 29363 29364 29365 29366 29367 29368 29369 29370 29371 29372 29373 29374 29375 29376 29377 29378 29379 29380 29381 29382 29383 29384 29385 29386 29387 29388 29389 29390 29391 29392 29393 29394 29395 29396 29397 29398 29399 29400 29401 29402 29403 29404 29405 29406 29407 29408 29409 29410 29411 29412 29413 29414 29415 29416 29417 29418 29419 29420 29421 29422 29423 29424 29425 29426 29427 29428 29429 29430 29431 29432 29433 29434 29435 29436 29437 29438 29439 29440 29441 29442 29443 29444 29445 29446 29447 29448 29449 29450 29451 29452 29453 29454 29455 29456 29457 29458 29459 29460 29461 29462 29463 29464 29465 29466 29467 29468 29469 29470 29471 29472 29473 29474 29475 29476 29477 29478 29479 29480 29481 29482 29483 29484 29485 29486 29487 29488 29489 29490 29491 29492 29493 29494 29495 29496 29497 29498 29499 29500 29501 29502 29503 29504 29505 29506 29507 29508 29509 29510 29511 29512 29513 29514 29515 29516 29517 29518 29519 29520 29521 29522 29523 29524 29525 29526 29527 29528 29529 29530 29531 29532 29533 29534 29535 29536 29537 29538 29539 29540 29541 29542 29543 29544 29545 29546 29547 29548 29549 29550 29551 29552 29553 29554 29555 29556 29557 29558 29559 29560 29561 29562 29563 29564 29565 29566 29567 29568 29569 29570 29571 29572 29573 29574 29575 29576 29577 29578 29579 29580 29581 29582 29583 29584 29585 29586 29587 29588 29589 29590 29591 29592 29593 29594 29595 29596 29597 29598 29599 29600 29601 29602 29603 29604 29605 29606 29607 29608 29609 29610 29611 29612 29613 29614 29615 29616 29617 29618 29619 29620 29621 29622 29623 29624 29625 29626 29627 29628 29629 29630 29631 29632 29633 29634 29635 29636 29637 29638 29639 29640 29641 29642 29643 29644 29645 29646 29647 29648 29649 29650 29651 29652 29653 29654 29655 29656 29657 29658 29659 29660 29661 29662 29663 29664 29665 29666 29667 29668 29669 29670 29671 29672 29673 29674 29675 29676 29677 29678 29679 29680 29681 29682 29683 29684 29685 29686 29687 29688 29689 29690 29691 29692 29693 29694 29695 29696 29697 29698 29699 29700 29701 29702 29703 29704 29705 29706 29707 29708 29709 29710 29711 29712 29713 29714 29715 29716 29717 29718 29719 29720 29721 29722 29723 29724 29725 29726 29727 29728 29729 29730 29731 29732 29733 29734 29735 29736 29737 29738 29739 29740 29741 29742 29743 29744 29745 29746 29747 29748 29749 29750 29751 29752 29753 29754 29755 29756 29757 29758 29759 29760 29761 29762 29763 29764 29765 29766 29767 29768 29769 29770 29771 29772 29773 29774 29775 29776 29777 29778 29779 29780 29781 29782 29783 29784 29785 29786 29787 29788 29789 29790 29791 29792 29793 29794 29795 29796 29797 29798 29799 29800 29801 29802 29803 29804 29805 29806 29807 29808 29809 29810 29811 29812 29813 29814 29815 29816 29817 29818 29819 29820 29821 29822 29823 29824 29825 29826 29827 29828 29829 29830 29831 29832 29833 29834 29835 29836 29837 29838 29839 29840 29841 29842 29843 29844 29845 29846 29847 29848 29849 29850 29851 29852 29853 29854 29855 29856 29857 29858 29859 29860 29861 29862 29863 29864 29865 29866 29867 29868 29869 29870 29871 29872 29873 29874 29875 29876 29877 29878 29879 29880 29881 29882 29883 29884 29885 29886 29887 29888 29889 29890 29891 29892 29893 29894 29895 29896 29897 29898 29899 29900 29901 29902 29903 29904 29905 29906 29907 29908 29909 29910 29911 29912 29913 29914 29915 29916 29917 29918 29919 29920 29921 29922 29923 29924 29925 29926 29927 29928 29929 29930 29931 29932 29933 29934 29935 29936 29937 29938 29939 29940 29941 29942 29943 29944 29945 29946 29947 29948 29949 29950 29951 29952 29953 29954 29955 29956 29957 29958 29959 29960 29961 29962 29963 29964 29965 29966 29967 29968 29969 29970 29971 29972 29973 29974 29975 29976 29977 29978 29979 29980 29981 29982 29983 29984 29985 29986 29987 29988 29989 29990 29991 29992 29993 29994 29995 29996 29997 29998 29999 30000 30001 30002 30003 30004 30005 30006 30007 30008 30009 30010 30011 30012 30013 30014 30015 30016 30017 30018 30019 30020 30021 30022 30023 30024 30025 30026 30027 30028 30029 30030 30031 30032 30033 30034 30035 30036 30037 30038 30039 30040 30041 30042 30043 30044 30045 30046 30047 30048 30049 30050 30051 30052 30053 30054 30055 30056 30057 30058 30059 30060 30061 30062 30063 30064 30065 30066 30067 30068 30069 30070 30071 30072 30073 30074 30075 30076 30077 30078 30079 30080 30081 30082 30083 30084 30085 30086 30087 30088 30089 30090 30091 30092 30093 30094 30095 30096 30097 30098 30099 30100 30101 30102 30103 30104 30105 30106 30107 30108 30109 30110 30111 30112 30113 30114 30115 30116 30117 30118 30119 30120 30121 30122 30123 30124 30125 30126 30127 30128 30129 30130 30131 30132 30133 30134 30135 30136 30137 30138 30139 30140 30141 30142 30143 30144 30145 30146 30147 30148 30149 30150 30151 30152 30153 30154 30155 30156 30157 30158 30159 30160 30161 30162 30163 30164 30165 30166 30167 30168 30169 30170 30171 30172 30173 30174 30175 30176 30177 30178 30179 30180 30181 30182 30183 30184 30185 30186 30187 30188 30189 30190 30191 30192 30193 30194 30195 30196 30197 30198 30199 30200 30201 30202 30203 30204 30205 30206 30207 30208 30209 30210 30211 30212 30213 30214 30215 30216 30217 30218 30219 30220 30221 30222 30223 30224 30225 30226 30227 30228 30229 30230 30231 30232 30233 30234 30235 30236 30237 30238 30239 30240 30241 30242 30243 30244 30245 30246 30247 30248 30249 30250 30251 30252 30253 30254 30255 30256 30257 30258 30259 30260 30261 30262 30263 30264 30265 30266 30267 30268 30269 30270 30271 30272 30273 30274 30275 30276 30277 30278 30279 30280 30281 30282 30283 30284 30285 30286 30287 30288 30289 30290 30291 30292 30293 30294 30295 30296 30297 30298 30299 30300 30301 30302 30303 30304 30305 30306 30307 30308 30309 30310 30311 30312 30313 30314 30315 30316 30317 30318 30319 30320 30321 30322 30323 30324 30325 30326 30327 30328 30329 30330 30331 30332 30333 30334 30335 30336 30337 30338 30339 30340 30341 30342 30343 30344 30345 30346 30347 30348 30349 30350 30351 30352 30353 30354 30355 30356 30357 30358 30359 30360 30361 30362 30363 30364 30365 30366 30367 30368 30369 30370 30371 30372 30373 30374 30375 30376 30377 30378 30379 30380 30381 30382 30383 30384 30385 30386 30387 30388 30389 30390 30391 30392 30393 30394 30395 30396 30397 30398 30399 30400 30401 30402 30403 30404 30405 30406 30407 30408 30409 30410 30411 30412 30413 30414 30415 30416 30417 30418 30419 30420 30421 30422 30423 30424 30425 30426 30427 30428 30429 30430 30431 30432 30433 30434 30435 30436 30437 30438 30439 30440 30441 30442 30443 30444 30445 30446 30447 30448 30449 30450 30451 30452 30453 30454 30455 30456 30457 30458 30459 30460 30461 30462 30463 30464 30465 30466 30467 30468 30469 30470 30471 30472 30473 30474 30475 30476 30477 30478 30479 30480 30481 30482 30483 30484 30485 30486 30487 30488 30489 30490 30491 30492 30493 30494 30495 30496 30497 30498 30499 30500 30501 30502 30503 30504 30505 30506 30507 30508 30509 30510 30511 30512 30513 30514 30515 30516 30517 30518 30519 30520 30521 30522 30523 30524 30525 30526 30527 30528 30529 30530 30531 30532 30533 30534 30535 30536 30537 30538 30539 30540 30541 30542 30543 30544 30545 30546 30547 30548 30549 30550 30551 30552 30553 30554 30555 30556 30557 30558 30559 30560 30561 30562 30563 30564 30565 30566 30567 30568 30569 30570 30571 30572 30573 30574 30575 30576 30577 30578 30579 30580 30581 30582 30583 30584 30585 30586 30587 30588 30589 30590 30591 30592 30593 30594 30595 30596 30597 30598 30599 30600 30601 30602 30603 30604 30605 30606 30607 30608 30609 30610 30611 30612 30613 30614 30615 30616 30617 30618 30619 30620 30621 30622 30623 30624 30625 30626 30627 30628 30629 30630 30631 30632 30633 30634 30635 30636 30637 30638 30639 30640 30641 30642 30643 30644 30645 30646 30647 30648 30649 30650 30651 30652 30653 30654 30655 30656 30657 30658 30659 30660 30661 30662 30663 30664 30665 30666 30667 30668 30669 30670 30671 30672 30673 30674 30675 30676 30677 30678 30679 30680 30681 30682 30683 30684 30685 30686 30687 30688 30689 30690 30691 30692 30693 30694 30695 30696 30697 30698 30699 30700 30701 30702 30703 30704 30705 30706 30707 30708 30709 30710 30711 30712 30713 30714 30715 30716 30717 30718 30719 30720 30721 30722 30723 30724 30725 30726 30727 30728 30729 30730 30731 30732 30733 30734 30735 30736 30737 30738 30739 30740 30741 30742 30743 30744 30745 30746 30747 30748 30749 30750 30751 30752 30753 30754 30755 30756 30757 30758 30759 30760 30761 30762 30763 30764 30765 30766 30767 30768 30769 30770 30771 30772 30773 30774 30775 30776 30777 30778 30779 30780 30781 30782 30783 30784 30785 30786 30787 30788 30789 30790 30791 30792 30793 30794 30795 30796 30797 30798 30799 30800 30801 30802 30803 30804 30805 30806 30807 30808 30809 30810 30811 30812 30813 30814 30815 30816 30817 30818 30819 30820 30821 30822 30823 30824 30825 30826 30827 30828 30829 30830 30831 30832 30833 30834 30835 30836 30837 30838 30839 30840 30841 30842 30843 30844 30845 30846 30847 30848 30849 30850 30851 30852 30853 30854 30855 30856 30857 30858 30859 30860 30861 30862 30863 30864 30865 30866 30867 30868 30869 30870 30871 30872 30873 30874 30875 30876 30877 30878 30879 30880 30881 30882 30883 30884 30885 30886 30887 30888 30889 30890 30891 30892 30893 30894 30895 30896 30897 30898 30899 30900 30901 30902 30903 30904 30905 30906 30907 30908 30909 30910 30911 30912 30913 30914 30915 30916 30917 30918 30919 30920 30921 30922 30923 30924 30925 30926 30927 30928 30929 30930 30931 30932 30933 30934 30935 30936 30937 30938 30939 30940 30941 30942 30943 30944 30945 30946 30947 30948 30949 30950 30951 30952 30953 30954 30955 30956 30957 30958 30959 30960 30961 30962 30963 30964 30965 30966 30967 30968 30969 30970 30971 30972 30973 30974 30975 30976 30977 30978 30979 30980 30981 30982 30983 30984 30985 30986 30987 30988 30989 30990 30991 30992 30993 30994 30995 30996 30997 30998 30999 31000 31001 31002 31003 31004 31005 31006 31007 31008 31009 31010 31011 31012 31013 31014 31015 31016 31017 31018 31019 31020 31021 31022 31023 31024 31025 31026 31027 31028 31029 31030 31031 31032 31033 31034 31035 31036 31037 31038 31039 31040 31041 31042 31043 31044 31045 31046 31047 31048 31049 31050 31051 31052 31053 31054 31055 31056 31057 31058 31059 31060 31061 31062 31063 31064 31065 31066 31067 31068 31069 31070 31071 31072 31073 31074 31075 31076 31077 31078 31079 31080 31081 31082 31083 31084 31085 31086 31087 31088 31089 31090 31091 31092 31093 31094 31095 31096 31097 31098 31099 31100 31101 31102 31103 31104 31105 31106 31107
|
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/common/pci_ops.c linux-2.4.22/arch/mips/au1000/common/pci_ops.c
--- linux-2.4.22.clean/arch/mips/au1000/common/pci_ops.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/au1000/common/pci_ops.c 2003-09-27 14:07:03.000000000 +0200
@@ -6,7 +6,8 @@
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
- * Support for all devices (greater than 16) added by David Gathright.
+ * - Support for all devices (greater than 16) added by David Gathright.
+ * - Wired tlb fix for ioremap calls in interrupt routines by Embedded Edge.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -36,6 +37,7 @@
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/vmalloc.h>
#include <asm/au1000.h>
#ifdef CONFIG_MIPS_PB1000
@@ -53,6 +55,8 @@
#define DBG(x...)
#endif
+int (*board_pci_idsel)(unsigned int devsel, int assert);
+
/* TBD */
static struct resource pci_io_resource = {
"pci IO space",
@@ -120,6 +124,41 @@
#else
+
+/* CP0 hazard avoidance. */
+#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
+ "nop; nop; nop; nop;\t" \
+ ".set reorder\n\t")
+
+void mod_wired_entry(int entry, unsigned long entrylo0,
+ unsigned long entrylo1, unsigned long entryhi,
+ unsigned long pagemask)
+{
+ unsigned long old_pagemask;
+ unsigned long old_ctx;
+
+ /* Save old context and create impossible VPN2 value */
+ old_ctx = read_c0_entryhi() & 0xff;
+ old_pagemask = read_c0_pagemask();
+ write_c0_index(entry);
+ BARRIER;
+ write_c0_pagemask(pagemask);
+ write_c0_entryhi(entryhi);
+ write_c0_entrylo0(entrylo0);
+ write_c0_entrylo1(entrylo1);
+ BARRIER;
+ tlb_write_indexed();
+ BARRIER;
+ write_c0_entryhi(old_ctx);
+ BARRIER;
+ write_c0_pagemask(old_pagemask);
+}
+
+struct vm_struct *pci_cfg_vm;
+static int pci_cfg_wired_entry;
+static int first_cfg = 1;
+unsigned long last_entryLo0, last_entryLo1;
+
static int config_access(unsigned char access_type, struct pci_dev *dev,
unsigned char where, u32 * data)
{
@@ -128,68 +167,107 @@
unsigned int dev_fn = dev->devfn;
unsigned int device = PCI_SLOT(dev_fn);
unsigned int function = PCI_FUNC(dev_fn);
- unsigned long config, status;
- unsigned long cfg_addr;
+ unsigned long offset, status;
+ unsigned long cfg_base;
+ unsigned long flags;
+ int error = PCIBIOS_SUCCESSFUL;
+ unsigned long entryLo0, entryLo1;
if (device > 19) {
*data = 0xffffffff;
return -1;
}
+ local_irq_save(flags);
au_writel(((0x2000 << 16) | (au_readl(Au1500_PCI_STATCMD) & 0xffff)),
Au1500_PCI_STATCMD);
- //au_writel(au_readl(Au1500_PCI_CFG) & ~PCI_ERROR, Au1500_PCI_CFG);
au_sync_udelay(1);
+ /*
+ * We can't ioremap the entire pci config space because it's
+ * too large. Nor can we call ioremap dynamically because some
+ * device drivers use the pci config routines from within
+ * interrupt handlers and that becomes a problem in get_vm_area().
+ * We use one wired tlb to handle all config accesses for all
+ * busses. To improve performance, if the current device
+ * is the same as the last device accessed, we don't touch the
+ * tlb.
+ */
+ if (first_cfg) {
+ /* reserve a wired entry for pci config accesses */
+ first_cfg = 0;
+ pci_cfg_vm = get_vm_area(0x1000, 0);
+ if (!pci_cfg_vm)
+ panic (KERN_ERR "PCI unable to get vm area\n");
+ pci_cfg_wired_entry = read_c0_wired();
+ add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr,
+ PM_4K);
+ last_entryLo0 = last_entryLo1 = 0xffffffff;
+ }
+
+ /* Since the Au1xxx doesn't do the idsel timing exactly to spec,
+ * many board vendors implement their own off-chip idsel, so call
+ * it now. If it doesn't succeed, may as well bail out at this point.
+ */
+ if (board_pci_idsel) {
+ if (board_pci_idsel(device, 1) == 0) {
+ *data = 0xffffffff;
+ local_irq_restore(flags);
+ return -1;
+ }
+ }
+
/* setup the config window */
if (bus == 0) {
- cfg_addr = ioremap( Au1500_EXT_CFG | ((1<<device)<<11) ,
- 0x00100000);
+ cfg_base = ((1<<device)<<11);
} else {
- cfg_addr = ioremap( Au1500_EXT_CFG_TYPE1 | (bus<<16) |
- (device<<11), 0x00100000);
+ cfg_base = 0x80000000 | (bus<<16) | (device<<11);
}
-
- if (!cfg_addr)
- panic (KERN_ERR "PCI unable to ioremap cfg space\n");
+ cfg_base &= ~0xfff;
/* setup the lower bits of the 36 bit address */
- config = cfg_addr | (function << 8) | (where & ~0x3);
+ offset = (function << 8) | (where & ~0x3);
-#if 0
- printk("cfg access: config %x, dev_fn %x, device %x function %x\n",
- config, dev_fn, device, function);
-#endif
+ entryLo0 = (6 << 26) | (cfg_base >> 6) | (2 << 3) | 7;
+ entryLo1 = (6 << 26) | (cfg_base >> 6) | (0x1000 >> 6) | (2 << 3) | 7;
+
+ if ((entryLo0 != last_entryLo0) || (entryLo1 != last_entryLo1)) {
+ mod_wired_entry(pci_cfg_wired_entry, entryLo0, entryLo1,
+ (unsigned long)pci_cfg_vm->addr, PM_4K);
+ last_entryLo0 = entryLo0;
+ last_entryLo1 = entryLo1;
+ }
if (access_type == PCI_ACCESS_WRITE) {
- au_writel(*data, config);
+ au_writel(*data, (int)(pci_cfg_vm->addr + offset));
} else {
- *data = au_readl(config);
+ *data = au_readl((int)(pci_cfg_vm->addr + offset));
}
au_sync_udelay(2);
-
DBG("config_access: %d bus %d device %d at %x *data %x, conf %x\n",
- access_type, bus, device, where, *data, config);
-
- /* unmap io space */
- iounmap( cfg_addr );
+ access_type, bus, device, where, *data, offset);
/* check master abort */
status = au_readl(Au1500_PCI_STATCMD);
-#if 0
-printk("cfg access: status %x, data %x\n", status, *data );
-#endif
+
if (status & (1<<29)) {
*data = 0xffffffff;
- return -1;
+ error = -1;
} else if ((status >> 28) & 0xf) {
DBG("PCI ERR detected: status %x\n", status);
*data = 0xffffffff;
- return -1;
- } else {
- return PCIBIOS_SUCCESSFUL;
+ error = -1;
+ }
+
+ /* Take away the idsel.
+ */
+ if (board_pci_idsel) {
+ (void)board_pci_idsel(device, 0);
}
+
+ local_irq_restore(flags);
+ return error;
#endif
}
#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/common/power.c linux-2.4.22/arch/mips/au1000/common/power.c
--- linux-2.4.22.clean/arch/mips/au1000/common/power.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/au1000/common/power.c 2003-09-27 14:07:03.000000000 +0200
@@ -34,7 +34,6 @@
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/sysctl.h>
-#include <linux/acpi.h>
#include <asm/string.h>
#include <asm/uaccess.h>
@@ -52,10 +51,10 @@
extern void au1k_wait(void);
static void calibrate_delay(void);
-extern void set_au1000_speed(unsigned int new_freq);
-extern unsigned int get_au1000_speed(void);
-extern unsigned long get_au1000_uart_baud_base(void);
-extern void set_au1000_uart_baud_base(unsigned long new_baud_base);
+extern void set_au1x00_speed(unsigned int new_freq);
+extern unsigned int get_au1x00_speed(void);
+extern unsigned long get_au1x00_uart_baud_base(void);
+extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
extern unsigned long save_local_and_disable(int controller);
extern void restore_local_and_enable(int controller, unsigned long mask);
extern void local_enable_irq(unsigned int irq_nr);
@@ -188,13 +187,13 @@
return -EFAULT;
}
- old_baud_base = get_au1000_uart_baud_base();
- old_cpu_freq = get_au1000_speed();
+ old_baud_base = get_au1x00_uart_baud_base();
+ old_cpu_freq = get_au1x00_speed();
new_cpu_freq = pll * 12 * 1000000;
new_baud_base = (new_cpu_freq / 4) / 16;
- set_au1000_speed(new_cpu_freq);
- set_au1000_uart_baud_base(new_baud_base);
+ set_au1x00_speed(new_cpu_freq);
+ set_au1x00_uart_baud_base(new_baud_base);
old_refresh = au_readl(MEM_SDREFCFG) & 0x1ffffff;
new_refresh =
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/common/setup.c linux-2.4.22/arch/mips/au1000/common/setup.c
--- linux-2.4.22.clean/arch/mips/au1000/common/setup.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/au1000/common/setup.c 2003-09-27 14:07:03.000000000 +0200
@@ -44,6 +44,7 @@
#include <asm/reboot.h>
#include <asm/pgtable.h>
#include <asm/au1000.h>
+#include <asm/time.h>
#if defined(CONFIG_AU1X00_SERIAL_CONSOLE)
extern void console_setup(char *, int *);
@@ -72,6 +73,8 @@
extern phys_t (*fixup_bigphys_addr)(phys_t phys_addr, phys_t size);
static phys_t au1500_fixup_bigphys_addr(phys_t phys_addr, phys_t size);
#endif
+extern void au1xxx_time_init(void);
+extern void au1xxx_timer_setup(void);
void __init au1x00_setup(void)
{
@@ -126,6 +129,9 @@
fixup_bigphys_addr = au1500_fixup_bigphys_addr;
#endif
+ board_time_init = au1xxx_time_init;
+ board_timer_setup = au1xxx_timer_setup;
+
// IO/MEM resources.
set_io_port_base(0);
ioport_resource.start = IOPORT_RESOURCE_START;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/common/time.c linux-2.4.22/arch/mips/au1000/common/time.c
--- linux-2.4.22.clean/arch/mips/au1000/common/time.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/au1000/common/time.c 2003-09-27 14:07:03.000000000 +0200
@@ -25,6 +25,11 @@
*
* Setting up the clock on the MIPS boards.
*
+ * Update. Always configure the kernel with CONFIG_NEW_TIME_C. This
+ * will use the user interface gettimeofday() functions from the
+ * arch/mips/kernel/time.c, and we provide the clock interrupt processing
+ * and the timer offset compute functions. If CONFIG_PM is selected,
+ * we also ensure the 32KHz timer is available. -- Dan
*/
#include <linux/types.h>
@@ -44,6 +49,10 @@
#include <linux/mc146818rtc.h>
#include <linux/timex.h>
+#if !defined(CONFIG_NEW_TIME_C)
+#error "Alchemy processors need CONFIG_NEW_TIME_C defined"
+#endif
+
extern void startup_match20_interrupt(void);
extern void do_softirq(void);
extern volatile unsigned long wall_jiffies;
@@ -52,7 +61,8 @@
static unsigned long r4k_offset; /* Amount to increment compare reg each time */
static unsigned long r4k_cur; /* What counter should be at next timer irq */
extern rwlock_t xtime_lock;
-unsigned int mips_counter_frequency = 0;
+int no_au1xxx_32khz;
+void (*au1k_wait_ptr)(void);
/* Cycle counter value at the previous timer interrupt.. */
static unsigned int timerhi = 0, timerlo = 0;
@@ -160,6 +170,57 @@
do_timer(regs); /* increment jiffies by one */
}
}
+
+/* When we wakeup from sleep, we have to "catch up" on all of the
+ * timer ticks we have missed.
+ */
+void
+wakeup_counter0_adjust(void)
+{
+ unsigned long pc0;
+ int time_elapsed;
+
+ pc0 = au_readl(SYS_TOYREAD);
+ if (pc0 < last_match20) {
+ /* counter overflowed */
+ time_elapsed = (0xffffffff - last_match20) + pc0;
+ }
+ else {
+ time_elapsed = pc0 - last_match20;
+ }
+
+ while (time_elapsed > 0) {
+ time_elapsed -= MATCH20_INC;
+ last_match20 += MATCH20_INC;
+ }
+
+ last_pc0 = pc0;
+ au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
+ au_sync();
+
+}
+
+/* This is just for debugging to set the timer for a sleep delay.
+*/
+void
+wakeup_counter0_set(int ticks)
+{
+ unsigned long pc0;
+
+ pc0 = au_readl(SYS_TOYREAD);
+ last_pc0 = pc0;
+ au_writel(last_match20 + (MATCH20_INC * ticks), SYS_TOYMATCH2);
+ au_sync();
+}
+#endif
+
+/* I haven't found anyone that doesn't use a 12 MHz source clock,
+ * but just in case.....
+ */
+#ifdef CONFIG_AU1000_SRC_CLK
+#define AU1000_SRC_CLK CONFIG_AU1000_SRC_CLK
+#else
+#define AU1000_SRC_CLK 12
#endif
/*
@@ -171,104 +232,72 @@
{
unsigned long count;
unsigned long cpu_speed;
- unsigned long start, end;
- unsigned long counter;
- int trim_divide = 16;
unsigned long flags;
spin_lock_irqsave(&time_lock, flags);
-
+#ifdef CONFIG_AU1000_USE32K
counter = au_readl(SYS_COUNTER_CNTRL);
- au_writel(counter | SYS_CNTRL_EN1, SYS_COUNTER_CNTRL);
-
- while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S);
- au_writel(trim_divide-1, SYS_RTCTRIM); /* RTC now ticks at 32.768/16 kHz */
- while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S);
-
- while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
- au_writel (0, SYS_TOYWRITE);
- while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
-
- start = au_readl(SYS_RTCREAD);
- start += 2;
- /* wait for the beginning of a new tick */
- while (au_readl(SYS_RTCREAD) < start);
-
- /* Start r4k counter. */
- write_c0_count(0);
- end = start + (32768 / trim_divide)/2; /* wait 0.5 seconds */
-
- while (end > au_readl(SYS_RTCREAD));
-
- count = read_c0_count();
- cpu_speed = count * 2;
- mips_counter_frequency = count;
- set_au1x00_uart_baud_base(((cpu_speed) / 4) / 16);
- spin_unlock_irqrestore(&time_lock, flags);
- return (cpu_speed / HZ);
-}
-
-
-void __init time_init(void)
-{
- unsigned int est_freq;
+ if (counter & SYS_CNTRL_E0) {
+ unsigned long start, end;
+ unsigned long counter;
+ int trim_divide = 16;
+
+ au_writel(counter | SYS_CNTRL_EN1, SYS_COUNTER_CNTRL);
+
+ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S);
+ au_writel(trim_divide-1, SYS_RTCTRIM); /* RTC now ticks at 32.768/16 kHz */
+ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S);
+
+ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
+ au_writel (0, SYS_TOYWRITE);
+ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
+
+ start = au_readl(SYS_RTCREAD);
+ start += 2;
+ /* wait for the beginning of a new tick */
+ while (au_readl(SYS_RTCREAD) < start);
+
+ /* Start r4k counter. */
+ write_c0_count(0);
+ end = start + (32768 / trim_divide)/2; /* wait 0.5 seconds */
- printk("calculating r4koff... ");
- r4k_offset = cal_r4koff();
- printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
+ while (end > au_readl(SYS_RTCREAD));
- //est_freq = 2*r4k_offset*HZ;
- est_freq = r4k_offset*HZ;
- est_freq += 5000; /* round */
- est_freq -= est_freq%10000;
- printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
- (est_freq%1000000)*100/1000000);
- set_au1x00_speed(est_freq);
- set_au1x00_lcd_clock(); // program the LCD clock
- r4k_cur = (read_c0_count() + r4k_offset);
-
- write_c0_compare(r4k_cur);
-
- /* no RTC on the pb1000 */
- xtime.tv_sec = 0;
- xtime.tv_usec = 0;
-
-#ifdef CONFIG_PM
- /*
- * setup counter 0, since it keeps ticking after a
- * 'wait' instruction has been executed. The CP0 timer and
- * counter 1 do NOT continue running after 'wait'
- *
- * It's too early to call request_irq() here, so we handle
- * counter 0 interrupt as a special irq and it doesn't show
- * up under /proc/interrupts.
+ count = read_c0_count();
+ cpu_speed = count * 2;
+ }
+ else {
+ /* The 32KHz oscillator isn't running, so assume there
+ * isn't one and grab the processor speed from the PLL.
+ * NOTE: some old silicon doesn't allow reading the PLL.
+ */
+ cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * 1000000 * AU1000_SRC_CLK;
+ count = cpu_speed / 2;
+ no_au1xxx_32khz = 1;
+ }
+#else
+ /* Always read the processor speed from the PLL. Guessing this
+ * value by using a 32KHz clock doesn't provide the accurate
+ * clock speed. This causes problems for peripheral clock dividers
+ * because their clocks are not accurate, either.
+ * NOTE: some old silicon doesn't allow reading the PLL.
*/
- while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
- au_writel(0, SYS_TOYWRITE);
- while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
-
- au_writel(au_readl(SYS_WAKEMSK) | (1<<8), SYS_WAKEMSK);
- au_writel(~0, SYS_WAKESRC);
- au_sync();
- while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
-
- /* setup match20 to interrupt once every 10ms */
- last_pc0 = last_match20 = au_readl(SYS_TOYREAD);
- au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
- au_sync();
- while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
- startup_match20_interrupt();
+ cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * 1000000 * 12;
+ count = cpu_speed / 2;
+ no_au1xxx_32khz = 1;
#endif
-
- //set_c0_status(ALLINTS);
- au_sync();
+ mips_hpt_frequency = count;
+ // Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16)
+ set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16));
+ spin_unlock_irqrestore(&time_lock, flags);
+ return (cpu_speed / HZ);
}
/* This is for machines which generate the exact clock. */
#define USECS_PER_JIFFY (1000000/HZ)
#define USECS_PER_JIFFY_FRAC (0x100000000*1000000/HZ&0xffffffff)
-#ifndef CONFIG_PM
+
static unsigned long
div64_32(unsigned long v1, unsigned long v2, unsigned long v3)
{
@@ -276,30 +305,9 @@
do_div64_32(r0, v1, v2, v3);
return r0;
}
-#endif
-static unsigned long do_fast_gettimeoffset(void)
+static unsigned long do_fast_cp0_gettimeoffset(void)
{
-#ifdef CONFIG_PM
- unsigned long pc0;
- unsigned long offset;
-
- pc0 = au_readl(SYS_TOYREAD);
- if (pc0 < last_pc0) {
- offset = 0xffffffff - last_pc0 + pc0;
- printk("offset over: %x\n", (unsigned)offset);
- }
- else {
- offset = (unsigned long)(((pc0 - last_pc0) * 305) / 10);
- }
- if ((pc0-last_pc0) > 2*MATCH20_INC) {
- printk("huge offset %x, last_pc0 %x last_match20 %x pc0 %x\n",
- (unsigned)offset, (unsigned)last_pc0,
- (unsigned)last_match20, (unsigned)pc0);
- }
- au_sync();
- return offset;
-#else
u32 count;
unsigned long res, tmp;
unsigned long r0;
@@ -340,60 +348,114 @@
"r" (quotient));
/*
- * Due to possible jiffies inconsistencies, we need to check
+ * Due to possible jiffies inconsistencies, we need to check
* the result so that we'll get a timer that is monotonic.
*/
if (res >= USECS_PER_JIFFY)
res = USECS_PER_JIFFY-1;
return res;
-#endif
}
-void do_gettimeofday(struct timeval *tv)
+#ifdef CONFIG_PM
+static unsigned long do_fast_pm_gettimeoffset(void)
{
- unsigned long flags;
-
- read_lock_irqsave (&xtime_lock, flags);
- *tv = xtime;
- tv->tv_usec += do_fast_gettimeoffset();
-
- /*
- * xtime is atomically updated in timer_bh. jiffies - wall_jiffies
- * is nonzero if the timer bottom half hasnt executed yet.
- */
- if (jiffies - wall_jiffies)
- tv->tv_usec += USECS_PER_JIFFY;
-
- read_unlock_irqrestore (&xtime_lock, flags);
+ unsigned long pc0;
+ unsigned long offset;
- if (tv->tv_usec >= 1000000) {
- tv->tv_usec -= 1000000;
- tv->tv_sec++;
+ pc0 = au_readl(SYS_TOYREAD);
+ au_sync();
+ offset = pc0 - last_pc0;
+ if (offset > 2*MATCH20_INC) {
+ printk("huge offset %x, last_pc0 %x last_match20 %x pc0 %x\n",
+ (unsigned)offset, (unsigned)last_pc0,
+ (unsigned)last_match20, (unsigned)pc0);
}
+ offset = (unsigned long)((offset * 305) / 10);
+ return offset;
}
+#endif
-void do_settimeofday(struct timeval *tv)
+void __init au1xxx_timer_setup(void)
{
- write_lock_irq (&xtime_lock);
+ unsigned int est_freq;
+ extern unsigned long (*do_gettimeoffset)(void);
+ extern void r4k_wait(void);
- /* This is revolting. We need to set the xtime.tv_usec correctly.
- * However, the value in this location is value at the last tick.
- * Discover what correction gettimeofday would have done, and then
- * undo it!
- */
- tv->tv_usec -= do_fast_gettimeoffset();
+ printk("calculating r4koff... ");
+ r4k_offset = cal_r4koff();
+ printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
+
+ //est_freq = 2*r4k_offset*HZ;
+ est_freq = r4k_offset*HZ;
+ est_freq += 5000; /* round */
+ est_freq -= est_freq%10000;
+ printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
+ (est_freq%1000000)*100/1000000);
+ set_au1x00_speed(est_freq);
+ set_au1x00_lcd_clock(); // program the LCD clock
+
+ r4k_cur = (read_c0_count() + r4k_offset);
+ write_c0_compare(r4k_cur);
- if (tv->tv_usec < 0) {
- tv->tv_usec += 1000000;
- tv->tv_sec--;
+ /* no RTC on the pb1000 */
+ xtime.tv_sec = 0;
+ xtime.tv_usec = 0;
+
+#ifdef CONFIG_PM
+ /*
+ * setup counter 0, since it keeps ticking after a
+ * 'wait' instruction has been executed. The CP0 timer and
+ * counter 1 do NOT continue running after 'wait'
+ *
+ * It's too early to call request_irq() here, so we handle
+ * counter 0 interrupt as a special irq and it doesn't show
+ * up under /proc/interrupts.
+ *
+ * Check to ensure we really have a 32KHz oscillator before
+ * we do this.
+ */
+ if (no_au1xxx_32khz) {
+ printk("WARNING: no 32KHz clock found.\n");
+ do_gettimeoffset = do_fast_cp0_gettimeoffset;
+
+ /* Ensure we get CPO_COUNTER interrupts.
+ */
+ change_cp0_status(IE_IRQ5, IE_IRQ5);
+ }
+ else {
+ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
+ au_writel(0, SYS_TOYWRITE);
+ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
+
+ au_writel(au_readl(SYS_WAKEMSK) | (1<<8), SYS_WAKEMSK);
+ au_writel(~0, SYS_WAKESRC);
+ au_sync();
+ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
+
+ /* setup match20 to interrupt once every 10ms */
+ last_pc0 = last_match20 = au_readl(SYS_TOYREAD);
+ au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
+ au_sync();
+ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
+ startup_match20_interrupt();
+
+ do_gettimeoffset = do_fast_pm_gettimeoffset;
+
+ /* We can use the real 'wait' instruction.
+ */
+ au1k_wait_ptr = r4k_wait;
}
- xtime = *tv;
- time_adjust = 0; /* stop active adjtime() */
- time_status |= STA_UNSYNC;
- time_maxerror = NTP_PHASE_LIMIT;
- time_esterror = NTP_PHASE_LIMIT;
+#else
+ /* We have to do this here instead of in timer_init because
+ * the generic code in arch/mips/kernel/time.c will write
+ * over our function pointer.
+ */
+ do_gettimeoffset = do_fast_cp0_gettimeoffset;
+#endif
+}
- write_unlock_irq (&xtime_lock);
+void __init au1xxx_time_init(void)
+{
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/csb250/board_setup.c linux-2.4.22/arch/mips/au1000/csb250/board_setup.c
--- linux-2.4.22.clean/arch/mips/au1000/csb250/board_setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/arch/mips/au1000/csb250/board_setup.c 2003-09-08 02:05:46.000000000 +0200
@@ -0,0 +1,250 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ * Cogent CSB250 board setup.
+ *
+ * Copyright 2002 Cogent Computer Systems, Inc.
+ * dan@embeddededge.com
+ *
+ * This program 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/ioport.h>
+#include <linux/mm.h>
+#include <linux/console.h>
+#include <linux/mc146818rtc.h>
+#include <linux/delay.h>
+
+#include <asm/cpu.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/keyboard.h>
+#include <asm/mipsregs.h>
+#include <asm/reboot.h>
+#include <asm/pgtable.h>
+#include <asm/au1000.h>
+#include <asm/csb250.h>
+
+#ifdef CONFIG_USB_OHCI
+// Enable the workaround for the OHCI DoneHead
+// register corruption problem.
+#define CONFIG_AU1000_OHCI_FIX
+#endif
+
+#ifdef CONFIG_RTC
+extern struct rtc_ops csb250_rtc_ops;
+#endif
+
+extern int (*board_pci_idsel)(unsigned int devsel, int assert);
+int csb250_pci_idsel(unsigned int devsel, int assert);
+
+void __init board_setup(void)
+{
+ u32 pin_func, pin_val;
+ u32 sys_freqctrl, sys_clksrc;
+
+
+ // set AUX clock to 12MHz * 8 = 96 MHz
+ au_writel(8, SYS_AUXPLL);
+ au_writel(0, SYS_PINSTATERD);
+ udelay(100);
+
+#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
+
+ /* GPIO201 is input for PCMCIA card detect */
+ /* GPIO203 is input for PCMCIA interrupt request */
+ au_writel(au_readl(GPIO2_DIR) & (u32)(~((1<<1)|(1<<3))), GPIO2_DIR);
+
+ /* zero and disable FREQ2 */
+ sys_freqctrl = au_readl(SYS_FREQCTRL0);
+ sys_freqctrl &= ~0xFFF00000;
+ au_writel(sys_freqctrl, SYS_FREQCTRL0);
+
+ /* zero and disable USBH/USBD clocks */
+ sys_clksrc = au_readl(SYS_CLKSRC);
+ sys_clksrc &= ~0x00007FE0;
+ au_writel(sys_clksrc, SYS_CLKSRC);
+
+ sys_freqctrl = au_readl(SYS_FREQCTRL0);
+ sys_freqctrl &= ~0xFFF00000;
+
+ sys_clksrc = au_readl(SYS_CLKSRC);
+ sys_clksrc &= ~0x00007FE0;
+
+ // FREQ2 = aux/2 = 48 MHz
+ sys_freqctrl |= ((0<<22) | (1<<21) | (1<<20));
+ au_writel(sys_freqctrl, SYS_FREQCTRL0);
+
+ /*
+ * Route 48MHz FREQ2 into USB Host and/or Device
+ */
+#ifdef CONFIG_USB_OHCI
+ sys_clksrc |= ((4<<12) | (0<<11) | (0<<10));
+#endif
+#ifdef CONFIG_AU1X00_USB_DEVICE
+ sys_clksrc |= ((4<<7) | (0<<6) | (0<<5));
+#endif
+ au_writel(sys_clksrc, SYS_CLKSRC);
+
+
+ pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
+#ifndef CONFIG_AU1X00_USB_DEVICE
+ // 2nd USB port is USB host
+ pin_func |= 0x8000;
+#endif
+ au_writel(pin_func, SYS_PINFUNC);
+#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
+
+ /* Configure GPIO2....it's used by PCI among other things.
+ */
+
+ /* Make everything but GP200 (PCI RST) an input until we get
+ * the pins set correctly.
+ */
+ au_writel(0x00000001, GPIO2_DIR);
+
+ /* Set the pins used for output.
+ * A zero bit will leave PCI reset, LEDs off, power up USB,
+ * IDSEL disabled.
+ */
+ pin_val = ((3 << 30) | (7 << 19) | (1 << 17) | (1 << 16));
+ au_writel(pin_val, GPIO2_OUTPUT);
+
+ /* Set the output direction.
+ */
+ pin_val = ((3 << 14) | (7 << 3) | (1 << 1) | (1 << 0));
+ au_writel(pin_val, GPIO2_DIR);
+
+#ifdef CONFIG_PCI
+ /* Use FREQ1 for the PCI output clock. We use the
+ * CPU clock of 384 MHz divided by 12 to get 32 MHz PCI.
+ * If Michael changes the CPU speed, we need to adjust
+ * that here as well :-).
+ */
+
+ /* zero and disable FREQ1
+ */
+ sys_freqctrl = au_readl(SYS_FREQCTRL0);
+ sys_freqctrl &= ~0x000ffc00;
+ au_writel(sys_freqctrl, SYS_FREQCTRL0);
+
+ /* zero and disable PCI clock
+ */
+ sys_clksrc = au_readl(SYS_CLKSRC);
+ sys_clksrc &= ~0x000f8000;
+ au_writel(sys_clksrc, SYS_CLKSRC);
+
+ /* Get current values (which really should match above).
+ */
+ sys_freqctrl = au_readl(SYS_FREQCTRL0);
+ sys_freqctrl &= ~0x000ffc00;
+
+ sys_clksrc = au_readl(SYS_CLKSRC);
+ sys_clksrc &= ~0x000f8000;
+
+ /* FREQ1 = cpu/12 = 32 MHz
+ */
+ sys_freqctrl |= ((5<<12) | (1<<11) | (0<<10));
+ au_writel(sys_freqctrl, SYS_FREQCTRL0);
+
+ /* Just connect the clock without further dividing.
+ */
+ sys_clksrc |= ((3<<17) | (0<<16) | (0<<15));
+ au_writel(sys_clksrc, SYS_CLKSRC);
+
+ udelay(1);
+
+ /* Now that clocks should be running, take PCI out of reset.
+ */
+ pin_val = au_readl(GPIO2_OUTPUT);
+ pin_val |= ((1 << 16) | 1);
+ au_writel(pin_val, GPIO2_OUTPUT);
+
+ // Setup PCI bus controller
+ au_writel(0, Au1500_PCI_CMEM);
+ au_writel(0x00003fff, Au1500_CFG_BASE);
+
+ /* We run big endian without any of the software byte swapping,
+ * so configure the PCI bridge to help us out.
+ */
+ au_writel(0xf | (2<<6) | (1<<5) | (1<<4), Au1500_PCI_CFG);
+
+ au_writel(0xf0000000, Au1500_PCI_MWMASK_DEV);
+ au_writel(0, Au1500_PCI_MWBASE_REV_CCL);
+ au_writel(0x02a00356, Au1500_PCI_STATCMD);
+ au_writel(0x00003c04, Au1500_PCI_HDRTYPE);
+ au_writel(0x00000008, Au1500_PCI_MBAR);
+ au_sync();
+
+ board_pci_idsel = csb250_pci_idsel;
+#endif
+
+ /* Enable BCLK switching */
+ au_writel(0x00000060, 0xb190003c);
+
+#ifdef CONFIG_RTC
+ rtc_ops = &csb250_rtc_ops;
+ // Enable the RTC if not already enabled
+ if (!(au_readl(0xac000028) & 0x20)) {
+ printk("enabling clock ...\n");
+ au_writel((au_readl(0xac000028) | 0x20), 0xac000028);
+ }
+ // Put the clock in BCD mode
+ if (readl(0xac00002C) & 0x4) { /* reg B */
+ au_writel(au_readl(0xac00002c) & ~0x4, 0xac00002c);
+ au_sync();
+ }
+#endif
+}
+
+/* The IDSEL is selected in the GPIO2 register. We will make device
+ * 12 appear in slot 0 and device 13 appear in slot 1.
+ */
+int
+csb250_pci_idsel(unsigned int devsel, int assert)
+{
+ int retval;
+ unsigned int gpio2_pins;
+
+ retval = 1;
+
+ /* First, disable both selects, then assert the one requested.
+ */
+ au_writel(0xc000c000, GPIO2_OUTPUT);
+ au_sync();
+
+ if (assert) {
+ if (devsel == 12)
+ gpio2_pins = 0x40000000;
+ else if (devsel == 13)
+ gpio2_pins = 0x80000000;
+ else {
+ gpio2_pins = 0xc000c000;
+ retval = 0;
+ }
+ au_writel(gpio2_pins, GPIO2_OUTPUT);
+ }
+ au_sync();
+
+ return retval;
+}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/csb250/init.c linux-2.4.22/arch/mips/au1000/csb250/init.c
--- linux-2.4.22.clean/arch/mips/au1000/csb250/init.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/arch/mips/au1000/csb250/init.c 2003-09-08 02:05:46.000000000 +0200
@@ -0,0 +1,95 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ * Cogent CSB250 board setup
+ *
+ * Copyright 2002 Cogent Computer Systems, Inc.
+ * dan@embeddededge.com
+ *
+ * This program 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/bootmem.h>
+#include <asm/addrspace.h>
+#include <asm/bootinfo.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+
+int prom_argc;
+char **prom_argv, **prom_envp;
+extern void __init prom_init_cmdline(void);
+extern char *prom_getenv(char *envname);
+
+/* When we get initrd working someday.........
+*/
+int my_initrd_start, my_initrd_size;
+
+/* Start arguments and environment.
+*/
+static char *csb_env[2];
+static char *csb_arg[4];
+static char *arg1 = "console=ttyS3,38400";
+static char *arg2 = "root=/dev/nfs rw ip=any";
+static char *env1 = "ethaddr=00:30:23:50:00:00";
+
+const char *get_system_type(void)
+{
+ return "Cogent CSB250";
+}
+
+int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
+{
+ unsigned char *memsize_str;
+ unsigned long memsize;
+
+ /* We use a0 and a1 to pass initrd start and size.
+ */
+ if (((uint) argc > 0) && ((uint)argv > 0)) {
+ my_initrd_start = (uint)argc;
+ my_initrd_size = (uint)argv;
+ }
+
+ /* First argv is ignored.
+ */
+ prom_argc = 3;
+ prom_argv = csb_arg;
+ prom_envp = csb_env;
+ csb_arg[1] = arg1;
+ csb_arg[2] = arg2;
+ csb_env[0] = env1;
+
+ mips_machgroup = MACH_GROUP_ALCHEMY;
+ mips_machtype = MACH_CSB250;
+
+ prom_init_cmdline();
+ memsize_str = prom_getenv("memsize");
+ if (!memsize_str) {
+ memsize = 0x02000000;
+ } else {
+ memsize = simple_strtol(memsize_str, NULL, 0);
+ }
+ add_memory_region(0, memsize, BOOT_MEM_RAM);
+ return 0;
+}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/csb250/irqmap.c linux-2.4.22/arch/mips/au1000/csb250/irqmap.c
--- linux-2.4.22.clean/arch/mips/au1000/csb250/irqmap.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/arch/mips/au1000/csb250/irqmap.c 2003-09-08 02:05:46.000000000 +0200
@@ -0,0 +1,100 @@
+/*
+ * BRIEF MODULE DESCRIPTION
+ * Au1xxx irq map table
+ *
+ * Copyright 2003 Embedded Edge, LLC
+ * dan@embeddededge.com
+ *
+ * This program 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/kernel_stat.h>
+#include <linux/module.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/timex.h>
+#include <linux/slab.h>
+#include <linux/random.h>
+#include <linux/delay.h>
+
+#include <asm/bitops.h>
+#include <asm/bootinfo.h>
+#include <asm/io.h>
+#include <asm/mipsregs.h>
+#include <asm/system.h>
+#include <asm/au1000.h>
+
+au1xxx_irq_map_t au1xxx_irq_map[] = {
+ { AU1000_UART0_INT, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_UART3_INT, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0},
+
+ { AU1000_IRDA_TX_INT, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_IRDA_RX_INT, INTC_INT_HIGH_LEVEL, 0},
+
+ { AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
+ { AU1000_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
+ { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0},
+
+ { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
+
+ { AU1000_PCI_INTA, INTC_INT_LOW_LEVEL, 0 },
+ { AU1000_PCI_INTB, INTC_INT_LOW_LEVEL, 0 },
+ { AU1000_PCI_INTC, INTC_INT_LOW_LEVEL, 0 },
+ { AU1000_PCI_INTD, INTC_INT_LOW_LEVEL, 0 },
+ { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 },
+ { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 },
+ { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 },
+ { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 },
+ { AU1500_GPIO_207, INTC_INT_LOW_LEVEL, 0 },
+
+ { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_USB_DEV_REQ_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
+ { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
+
+ /* Careful if you change match 2 request!
+ * The interrupt handler is called directly
+ * from the low level dispatch code.
+ */
+ { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
+};
+
+int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/csb250/Makefile linux-2.4.22/arch/mips/au1000/csb250/Makefile
--- linux-2.4.22.clean/arch/mips/au1000/csb250/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/arch/mips/au1000/csb250/Makefile 2003-09-08 02:05:46.000000000 +0200
@@ -0,0 +1,18 @@
+#
+# Copyright 2002 Cogent Computer Systems
+# dan@embeddededge.com
+#
+# Makefile for the Cogent CSB250 Au1500 board. Copied from Pb1500.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+USE_STANDARD_AS_RULE := true
+
+O_TARGET := csb250.o
+
+obj-y := init.o board_setup.o irqmap.o
+
+include $(TOPDIR)/Rules.make
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/au1000/db1x00/board_setup.c linux-2.4.22/arch/mips/au1000/db1x00/board_setup.c
--- linux-2.4.22.clean/arch/mips/au1000/db1x00/board_setup.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/au1000/db1x00/board_setup.c 2003-09-27 14:07:03.000000000 +0200
@@ -62,7 +62,7 @@
au_writel(pin_func, SYS_PINFUNC);
#endif
-#if defined(CONFIG_IRDA) && (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1000))
+#if defined(CONFIG_IRDA) && (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100))
/* set IRFIRSEL instead of GPIO15 */
pin_func = au_readl(SYS_PINFUNC) | (u32)((1<<8));
au_writel(pin_func, SYS_PINFUNC);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/boot/addinitrd.c linux-2.4.22/arch/mips/boot/addinitrd.c
--- linux-2.4.22.clean/arch/mips/boot/addinitrd.c 2002-11-29 00:53:09.000000000 +0100
+++ linux-2.4.22/arch/mips/boot/addinitrd.c 2003-09-21 03:08:49.000000000 +0200
@@ -2,6 +2,8 @@
* addinitrd - program to add a initrd image to an ecoff kernel
*
* (C) 1999 Thomas Bogendoerfer
+ * minor modifications, cleanup: Guido Guenther <agx@sigxcpu.org>
+ *
*/
#include <sys/types.h>
@@ -54,7 +56,7 @@
exit (1);
}
- if ((fd_vmlinux = open (argv[1],O_RDWR)) < 0)
+ if ((fd_vmlinux = open (argv[1],O_RDONLY)) < 0)
die ("open vmlinux");
if (read (fd_vmlinux, &efile, sizeof efile) != sizeof efile)
die ("read file header");
@@ -78,6 +80,11 @@
swab = 1;
}
+ /* make sure we have an empty data segment for the initrd */
+ if( eaout.dsize || esecs[1].s_size ) {
+ fprintf(2,"Data segment not empty. Giving up!");
+ exit(1);
+ }
if ((fd_initrd = open (argv[2], O_RDONLY)) < 0)
die ("open initrd");
if (fstat (fd_initrd, &st) < 0)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/boot/Makefile linux-2.4.22/arch/mips/boot/Makefile
--- linux-2.4.22.clean/arch/mips/boot/Makefile 2002-11-29 00:53:09.000000000 +0100
+++ linux-2.4.22/arch/mips/boot/Makefile 2003-09-27 14:07:03.000000000 +0200
@@ -24,7 +24,7 @@
drop-sections = .reginfo .mdebug
strip-flags = $(addprefix --remove-section=,$(drop-sections))
-all: vmlinux.ecoff addinitrd
+all: vmlinux.ecoff vmlinux.srec addinitrd
vmlinux.ecoff: $(CONFIGURE) elf2ecoff $(TOPDIR)/vmlinux
./elf2ecoff $(TOPDIR)/vmlinux vmlinux.ecoff $(E2EFLAGS)
@@ -32,6 +32,9 @@
elf2ecoff: elf2ecoff.c
$(HOSTCC) -o $@ $^
+vmlinux.srec: $(CONFIGURE) $(TOPDIR)/vmlinux
+ $(OBJCOPY) -S -O srec $(strip-flags) $(TOPDIR)/vmlinux vmlinux.srec
+
addinitrd: addinitrd.c
$(HOSTCC) -o $@ $^
@@ -40,10 +43,12 @@
clean:
rm -f vmlinux.ecoff
+ rm -f vmlinux.srec
rm -f zImage zImage.tmp
mrproper:
rm -f vmlinux.ecoff
+ rm -f vmlinux.srec
rm -f addinitrd
rm -f elf2ecoff
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/config-shared.in linux-2.4.22/arch/mips/config-shared.in
--- linux-2.4.22.clean/arch/mips/config-shared.in 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/config-shared.in 2003-09-27 14:07:02.000000000 +0200
@@ -33,6 +33,7 @@
dep_bool 'Support for Alchemy PB1500 board' CONFIG_MIPS_PB1500 $CONFIG_MIPS32
dep_bool 'Support for MyCable XXS1500 board' CONFIG_MIPS_XXS1500 $CONFIG_MIPS32
dep_bool 'Support for 4G Systems MTX-1 board' CONFIG_MIPS_MTX1 $CONFIG_MIPS32
+dep_bool 'Support for Cogent CSB250 board' CONFIG_COGENT_CSB250 $CONFIG_MIPS32
dep_bool 'Support for BAGET MIPS series (EXPERIMENTAL)' CONFIG_BAGET_MIPS $CONFIG_MIPS32 $CONFIG_EXPERIMENTAL
bool 'Support for CASIO CASSIOPEIA E-10/15/55/65' CONFIG_CASIO_E55
dep_bool 'Support for Cobalt Server (EXPERIMENTAL)' CONFIG_MIPS_COBALT $CONFIG_EXPERIMENTAL
@@ -117,10 +118,10 @@
if [ "$CONFIG_SIBYTE_UNKNOWN" = "y" ]; then
choice ' BCM1xxx SOC Type' \
- "BCM91250 CONFIG_SIBYTE_SB1250 \
- BCM91120 CONFIG_SIBYTE_BCM1120 \
- BCM91125 CONFIG_SIBYTE_BCM1125 \
- BCM91125H CONFIG_SIBYTE_BCM1125H" CONFIG_SIBYTE_SB1250
+ "BCM1250 CONFIG_SIBYTE_SB1250 \
+ BCM1120 CONFIG_SIBYTE_BCM1120 \
+ BCM1125 CONFIG_SIBYTE_BCM1125 \
+ BCM1125H CONFIG_SIBYTE_BCM1125H" CONFIG_SIBYTE_SB1250
unset CONFIG_SIBYTE_BOARD
else
define_bool CONFIG_SIBYTE_BOARD y
@@ -246,6 +247,7 @@
if [ "$CONFIG_MIPS_MIRAGE" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1500 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PC_KEYB y
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
@@ -255,6 +257,7 @@
if [ "$CONFIG_MIPS_BOSPORUS" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1500 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PC_KEYB y
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
@@ -264,6 +267,7 @@
if [ "$CONFIG_MIPS_PB1000" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1000 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
define_bool CONFIG_NONCOHERENT_IO y
@@ -274,6 +278,7 @@
if [ "$CONFIG_MIPS_PB1100" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1100 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PCI y
define_bool CONFIG_PCI_AUTO n
define_bool CONFIG_NEW_PCI y
@@ -285,6 +290,7 @@
if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1500 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
define_bool CONFIG_PCI_AUTO y
@@ -294,6 +300,7 @@
if [ "$CONFIG_MIPS_DB1000" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1000 y
+ define_bool CONFIG_NEW_TIME_C y
# CONFIG_PCI needed for USB
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
@@ -305,6 +312,7 @@
if [ "$CONFIG_MIPS_DB1500" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1500 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
define_bool CONFIG_PCI_AUTO y
@@ -314,6 +322,7 @@
if [ "$CONFIG_MIPS_DB1100" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1100 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
define_bool CONFIG_NONCOHERENT_IO y
@@ -323,6 +332,7 @@
if [ "$CONFIG_MIPS_XXS1500" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1500 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
define_bool CONFIG_PCI_AUTO y
@@ -332,11 +342,22 @@
if [ "$CONFIG_MIPS_MTX1" = "y" ]; then
define_bool CONFIG_SOC_AU1X00 y
define_bool CONFIG_SOC_AU1500 y
+ define_bool CONFIG_NEW_TIME_C y
define_bool CONFIG_PCI y
define_bool CONFIG_NEW_PCI y
define_bool CONFIG_PCI_AUTO y
define_bool CONFIG_NONCOHERENT_IO y
fi
+if [ "$CONFIG_COGENT_CSB250" = "y" ]; then
+ define_bool CONFIG_SOC_AU1X00 y
+ define_bool CONFIG_SOC_AU1500 y
+ define_bool CONFIG_NEW_TIME_C y
+ define_bool CONFIG_PCI y
+ define_bool CONFIG_NEW_PCI y
+ define_bool CONFIG_PCI_AUTO y
+ define_bool CONFIG_NONCOHERENT_IO y
+ define_bool CONFIG_PC_KEYB y
+fi
if [ "$CONFIG_MIPS_COBALT" = "y" ]; then
define_bool CONFIG_COBALT_LCD y
define_bool CONFIG_I8259 y
@@ -1033,8 +1054,13 @@
bool 'Enable run-time debugging' CONFIG_RUNTIME_DEBUG
bool 'Remote GDB kernel debugging' CONFIG_KGDB
dep_bool ' Console output to GDB' CONFIG_GDB_CONSOLE $CONFIG_KGDB
+if [ "$CONFIG_KGDB" = "y" ]; then
+ define_bool CONFIG_DEBUG_INFO y
+else
+ bool 'Debugging symbols' CONFIG_DEBUG_INFO
+fi
if [ "$CONFIG_SIBYTE_SB1xxx_SOC" = "y" ]; then
- bool 'Compile for Corelis Debugger' CONFIG_SB1XXX_CORELIS
+ dep_bool 'Compile for Corelis Debugger' CONFIG_SB1XXX_CORELIS $CONFIG_DEBUG_INFO
fi
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
if [ "$CONFIG_SMP" != "y" ]; then
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/ddb5xxx/ddb5476/setup.c linux-2.4.22/arch/mips/ddb5xxx/ddb5476/setup.c
--- linux-2.4.22.clean/arch/mips/ddb5xxx/ddb5476/setup.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/ddb5xxx/ddb5476/setup.c 2003-09-27 14:07:03.000000000 +0200
@@ -84,7 +84,7 @@
static void __init ddb_time_init(void)
{
#if defined(USE_CPU_COUNTER_TIMER)
- mips_counter_frequency = CPU_COUNTER_FREQUENCY;
+ mips_hpt_frequency = CPU_COUNTER_FREQUENCY;
#endif
/* we have ds1396 RTC chip */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/ddb5xxx/ddb5477/setup.c linux-2.4.22/arch/mips/ddb5xxx/ddb5477/setup.c
--- linux-2.4.22.clean/arch/mips/ddb5xxx/ddb5477/setup.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/ddb5xxx/ddb5477/setup.c 2003-09-27 14:07:03.000000000 +0200
@@ -138,11 +138,11 @@
bus_frequency = detect_bus_frequency(rtc_base);
}
- /* mips_counter_frequency is 1/2 of the cpu core freq */
+ /* mips_hpt_frequency is 1/2 of the cpu core freq */
i = (read_c0_config() >> 28 ) & 7;
if ((current_cpu_data.cputype == CPU_R5432) && (i == 3))
i = 4;
- mips_counter_frequency = bus_frequency*(i+4)/4;
+ mips_hpt_frequency = bus_frequency*(i+4)/4;
}
extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/dec/setup.c linux-2.4.22/arch/mips/dec/setup.c
--- linux-2.4.22.clean/arch/mips/dec/setup.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/dec/setup.c 2003-09-28 02:52:17.000000000 +0200
@@ -48,6 +48,11 @@
extern asmlinkage void decstation_handle_int(void);
+#ifdef CONFIG_BLK_DEV_INITRD
+extern unsigned long initrd_start, initrd_end;
+extern void *__rd_start, *__rd_end;
+#endif
+
spinlock_t ioasic_ssr_lock;
volatile u32 *ioasic_base;
@@ -131,6 +136,12 @@
void __init decstation_setup(void)
{
+#ifdef CONFIG_BLK_DEV_INITRD
+ ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
+ initrd_start = (unsigned long)&__rd_start;
+ initrd_end = (unsigned long)&__rd_end;
+#endif
+
board_be_init = dec_be_init;
board_time_init = dec_time_init;
board_timer_setup = dec_timer_setup;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/dec/time.c linux-2.4.22/arch/mips/dec/time.c
--- linux-2.4.22.clean/arch/mips/dec/time.c 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/dec/time.c 2003-09-27 14:07:03.000000000 +0200
@@ -144,6 +144,11 @@
}
+static int dec_timer_state(void)
+{
+ return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0;
+}
+
static void dec_timer_ack(void)
{
CMOS_READ(RTC_REG_C); /* Ack the RTC interrupt. */
@@ -169,19 +174,23 @@
rtc_get_time = dec_rtc_get_time;
rtc_set_mmss = dec_rtc_set_mmss;
+ mips_timer_state = dec_timer_state;
mips_timer_ack = dec_timer_ack;
+
if (!cpu_has_counter && IOASIC) {
/* For pre-R4k systems we use the I/O ASIC's counter. */
mips_hpt_read = dec_ioasic_hpt_read;
mips_hpt_init = dec_ioasic_hpt_init;
}
+
+ /* Set up the rate of periodic DS1287 interrupts. */
+ CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - LOG_2_HZ), RTC_REG_A);
}
void __init dec_timer_setup(struct irqaction *irq)
{
+ setup_irq(dec_interrupt[DEC_IRQ_RTC], irq);
+
/* Enable periodic DS1287 interrupts. */
- CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - LOG_2_HZ), RTC_REG_A);
CMOS_WRITE(CMOS_READ(RTC_REG_B) | RTC_PIE, RTC_REG_B);
-
- setup_irq(dec_interrupt[DEC_IRQ_RTC], irq);
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig linux-2.4.22/arch/mips/defconfig
--- linux-2.4.22.clean/arch/mips/defconfig 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig 2003-09-27 14:07:02.000000000 +0200
@@ -674,6 +674,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-atlas linux-2.4.22/arch/mips/defconfig-atlas
--- linux-2.4.22.clean/arch/mips/defconfig-atlas 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-atlas 2003-09-27 14:07:02.000000000 +0200
@@ -665,6 +665,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-bosporus linux-2.4.22/arch/mips/defconfig-bosporus
--- linux-2.4.22.clean/arch/mips/defconfig-bosporus 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-bosporus 2003-09-27 14:07:02.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1500=y
+CONFIG_NEW_TIME_C=y
CONFIG_PC_KEYB=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
@@ -680,6 +681,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
CONFIG_RTC=y
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -915,6 +917,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-capcella linux-2.4.22/arch/mips/defconfig-capcella
--- linux-2.4.22.clean/arch/mips/defconfig-capcella 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-capcella 2003-09-27 14:07:02.000000000 +0200
@@ -654,6 +654,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-cobalt linux-2.4.22/arch/mips/defconfig-cobalt
--- linux-2.4.22.clean/arch/mips/defconfig-cobalt 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-cobalt 2003-09-27 14:07:02.000000000 +0200
@@ -648,6 +648,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-csb250 linux-2.4.22/arch/mips/defconfig-csb250
--- linux-2.4.22.clean/arch/mips/defconfig-csb250 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/arch/mips/defconfig-csb250 2003-09-08 02:05:46.000000000 +0200
@@ -0,0 +1,854 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MIPS=y
+CONFIG_MIPS32=y
+# CONFIG_MIPS64 is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_MIPS_MTX1 is not set
+CONFIG_COGENT_CSB250=y
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_CASIO_E55 is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_IBM_WORKPAD is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_NEC_OSPREY is not set
+# CONFIG_NEC_EAGLE is not set
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SIBYTE_SB1xxx_SOC is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TANBAC_TB0226 is not set
+# CONFIG_TANBAC_TB0229 is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_VICTOR_MPC30X is not set
+# CONFIG_ZAO_CAPCELLA is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_SOC_AU1X00=y
+CONFIG_SOC_AU1500=y
+CONFIG_NEW_TIME_C=y
+CONFIG_PCI=y
+CONFIG_NEW_PCI=y
+CONFIG_PCI_AUTO=y
+CONFIG_NONCOHERENT_IO=y
+CONFIG_PC_KEYB=y
+# CONFIG_MIPS_AU1000 is not set
+
+#
+# CPU selection
+#
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_CPU_HAS_PREFETCH=y
+# CONFIG_VTAG_ICACHE is not set
+CONFIG_64BIT_PHYS_ADDR=y
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_LLSC=y
+# CONFIG_CPU_HAS_LLDSCD is not set
+# CONFIG_CPU_HAS_WB is not set
+CONFIG_CPU_HAS_SYNC=y
+
+#
+# General setup
+#
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+# CONFIG_BINFMT_IRIX is not set
+CONFIG_NET=y
+# CONFIG_PCI_NAMES is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+CONFIG_HOTPLUG=y
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+# CONFIG_CARDBUS is not set
+# CONFIG_TCIC is not set
+# CONFIG_I82092 is not set
+# CONFIG_I82365 is not set
+CONFIG_PCMCIA_AU1X00=m
+# CONFIG_PCMCIA_PB1X00 is not set
+CONFIG_PCMCIA_DB1X00=y
+# CONFIG_PCMCIA_XXS1500 is not set
+# CONFIG_PCMCIA_VRC4173 is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+# CONFIG_HOTPLUG_PCI_COMPAQ is not set
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_MIPS32_COMPAT is not set
+# CONFIG_MIPS32_O32 is not set
+# CONFIG_MIPS32_N32 is not set
+# CONFIG_BINFMT_ELF32 is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_BLK_STATS is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK_DEV is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+
+#
+# IP: Netfilter Configuration
+#
+# CONFIG_IP_NF_CONNTRACK is not set
+# CONFIG_IP_NF_QUEUE is not set
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
+
+#
+#
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+CONFIG_IDE=y
+
+#
+# IDE, ATA and ATAPI Block devices
+#
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_HD_IDE is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_IDEDISK_STROKE is not set
+CONFIG_BLK_DEV_IDECS=m
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_ISAPNP is not set
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_PCI_WIP is not set
+# CONFIG_BLK_DEV_ADMA100 is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_WDC_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_AMD74XX_OVERRIDE is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_PDC202XX_BURST is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_RZ1000 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SIS5513 is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_DMA_NONPCI is not set
+CONFIG_BLK_DEV_IDE_MODES=y
+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set
+# CONFIG_BLK_DEV_ATARAID_SII is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MIPS_AU1X00_ENET=y
+# CONFIG_BCM5222_DUAL_PHY is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# PCMCIA network device support
+#
+# CONFIG_NET_PCMCIA is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input core support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_KEYBDEV=y
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
+# CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_DIGI is not set
+# CONFIG_ESPSERIAL is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_MOXA_SMARTIO is not set
+# CONFIG_ISI is not set
+# CONFIG_SYNCLINK is not set
+# CONFIG_SYNCLINKMP is not set
+# CONFIG_N_HDLC is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALDRV is not set
+# CONFIG_SERIAL_TX3912 is not set
+# CONFIG_SERIAL_TX3912_CONSOLE is not set
+# CONFIG_SERIAL_TXX9 is not set
+# CONFIG_SERIAL_TXX9_CONSOLE is not set
+CONFIG_AU1X00_UART=y
+CONFIG_AU1X00_SERIAL_CONSOLE=y
+# CONFIG_AU1X00_USB_TTY is not set
+# CONFIG_AU1X00_USB_RAW is not set
+# CONFIG_TXX927_SERIAL is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+# CONFIG_INPUT_NS558 is not set
+# CONFIG_INPUT_LIGHTNING is not set
+# CONFIG_INPUT_PCIGAME is not set
+# CONFIG_INPUT_CS461X is not set
+# CONFIG_INPUT_EMU10K1 is not set
+# CONFIG_INPUT_SERIO is not set
+# CONFIG_INPUT_SERPORT is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_ANALOG is not set
+# CONFIG_INPUT_A3D is not set
+# CONFIG_INPUT_ADI is not set
+# CONFIG_INPUT_COBRA is not set
+# CONFIG_INPUT_GF2K is not set
+# CONFIG_INPUT_GRIP is not set
+# CONFIG_INPUT_INTERACT is not set
+# CONFIG_INPUT_TMDC is not set
+# CONFIG_INPUT_SIDEWINDER is not set
+# CONFIG_INPUT_IFORCE_USB is not set
+# CONFIG_INPUT_IFORCE_232 is not set
+# CONFIG_INPUT_WARRIOR is not set
+# CONFIG_INPUT_MAGELLAN is not set
+# CONFIG_INPUT_SPACEORB is not set
+# CONFIG_INPUT_SPACEBALL is not set
+# CONFIG_INPUT_STINGER is not set
+# CONFIG_INPUT_DB9 is not set
+# CONFIG_INPUT_GAMECON is not set
+# CONFIG_INPUT_TURBOGRAFX is not set
+# CONFIG_QIC02_TAPE is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_IPMI_PANIC_EVENT is not set
+# CONFIG_IPMI_DEVICE_INTERFACE is not set
+# CONFIG_IPMI_KCS is not set
+# CONFIG_IPMI_WATCHDOG is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_SCx200_GPIO is not set
+# CONFIG_AMD_PM768 is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_PCMCIA_SERIAL_CS is not set
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_AU1X00_GPIO is not set
+# CONFIG_TS_AU1X00_ADS7846 is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
+CONFIG_AUTOFS_FS=y
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BEFS_DEBUG is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+# CONFIG_NFSD_TCP is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Console drivers
+#
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_MDA_CONSOLE is not set
+
+#
+# Frame-buffer support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_BANDWIDTH is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+CONFIG_USB_OHCI=y
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_MIDI is not set
+
+#
+# SCSI support is needed for USB Storage
+#
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_AX8817X is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_TIGL is not set
+# CONFIG_USB_BRLVGER is not set
+# CONFIG_USB_LCD is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_RUNTIME_DEBUG is not set
+# CONFIG_KGDB is not set
+# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC32 is not set
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-db1000 linux-2.4.22/arch/mips/defconfig-db1000
--- linux-2.4.22.clean/arch/mips/defconfig-db1000 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-db1000 2003-09-27 14:07:02.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1000=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
# CONFIG_PCI_AUTO is not set
@@ -652,6 +653,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -964,6 +966,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-db1100 linux-2.4.22/arch/mips/defconfig-db1100
--- linux-2.4.22.clean/arch/mips/defconfig-db1100 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-db1100 2003-09-27 14:07:02.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1100=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
CONFIG_NONCOHERENT_IO=y
@@ -651,6 +652,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -1003,6 +1005,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-db1500 linux-2.4.22/arch/mips/defconfig-db1500
--- linux-2.4.22.clean/arch/mips/defconfig-db1500 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-db1500 2003-09-27 14:07:02.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1500=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
CONFIG_PCI_AUTO=y
@@ -574,6 +575,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -843,6 +845,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-ddb5476 linux-2.4.22/arch/mips/defconfig-ddb5476
--- linux-2.4.22.clean/arch/mips/defconfig-ddb5476 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-ddb5476 2003-09-27 14:07:02.000000000 +0200
@@ -690,6 +690,7 @@
CONFIG_RUNTIME_DEBUG=y
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-ddb5477 linux-2.4.22/arch/mips/defconfig-ddb5477
--- linux-2.4.22.clean/arch/mips/defconfig-ddb5477 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-ddb5477 2003-09-27 14:07:02.000000000 +0200
@@ -594,6 +594,7 @@
CONFIG_RUNTIME_DEBUG=y
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-decstation linux-2.4.22/arch/mips/defconfig-decstation
--- linux-2.4.22.clean/arch/mips/defconfig-decstation 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-decstation 2003-09-27 14:07:02.000000000 +0200
@@ -622,6 +622,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-e55 linux-2.4.22/arch/mips/defconfig-e55
--- linux-2.4.22.clean/arch/mips/defconfig-e55 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-e55 2003-09-27 14:07:02.000000000 +0200
@@ -613,6 +613,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-eagle linux-2.4.22/arch/mips/defconfig-eagle
--- linux-2.4.22.clean/arch/mips/defconfig-eagle 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-eagle 2003-09-27 14:07:02.000000000 +0200
@@ -878,6 +878,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-ev64120 linux-2.4.22/arch/mips/defconfig-ev64120
--- linux-2.4.22.clean/arch/mips/defconfig-ev64120 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-ev64120 2003-09-27 14:07:02.000000000 +0200
@@ -577,6 +577,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-ev96100 linux-2.4.22/arch/mips/defconfig-ev96100
--- linux-2.4.22.clean/arch/mips/defconfig-ev96100 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-ev96100 2003-09-27 14:07:02.000000000 +0200
@@ -574,6 +574,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-hp-lj linux-2.4.22/arch/mips/defconfig-hp-lj
--- linux-2.4.22.clean/arch/mips/defconfig-hp-lj 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-hp-lj 2003-09-27 14:07:03.000000000 +0200
@@ -727,6 +727,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-ip22 linux-2.4.22/arch/mips/defconfig-ip22
--- linux-2.4.22.clean/arch/mips/defconfig-ip22 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-ip22 2003-09-27 14:07:03.000000000 +0200
@@ -697,6 +697,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-it8172 linux-2.4.22/arch/mips/defconfig-it8172
--- linux-2.4.22.clean/arch/mips/defconfig-it8172 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-it8172 2003-09-27 14:07:03.000000000 +0200
@@ -591,7 +591,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
-CONFIG_MIPS_RTC=y
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -747,6 +747,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-ivr linux-2.4.22/arch/mips/defconfig-ivr
--- linux-2.4.22.clean/arch/mips/defconfig-ivr 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-ivr 2003-09-27 14:07:03.000000000 +0200
@@ -778,6 +778,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-jmr3927 linux-2.4.22/arch/mips/defconfig-jmr3927
--- linux-2.4.22.clean/arch/mips/defconfig-jmr3927 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-jmr3927 2003-09-27 14:07:03.000000000 +0200
@@ -642,6 +642,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-lasat linux-2.4.22/arch/mips/defconfig-lasat
--- linux-2.4.22.clean/arch/mips/defconfig-lasat 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-lasat 2003-09-27 14:07:03.000000000 +0200
@@ -725,6 +725,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-malta linux-2.4.22/arch/mips/defconfig-malta
--- linux-2.4.22.clean/arch/mips/defconfig-malta 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-malta 2003-09-27 14:07:03.000000000 +0200
@@ -647,6 +647,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-mirage linux-2.4.22/arch/mips/defconfig-mirage
--- linux-2.4.22.clean/arch/mips/defconfig-mirage 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-mirage 2003-09-27 14:07:03.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1500=y
+CONFIG_NEW_TIME_C=y
CONFIG_PC_KEYB=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
@@ -489,6 +490,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
CONFIG_RTC=y
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -752,6 +754,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-mpc30x linux-2.4.22/arch/mips/defconfig-mpc30x
--- linux-2.4.22.clean/arch/mips/defconfig-mpc30x 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-mpc30x 2003-09-27 14:07:03.000000000 +0200
@@ -668,6 +668,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-mtx-1 linux-2.4.22/arch/mips/defconfig-mtx-1
--- linux-2.4.22.clean/arch/mips/defconfig-mtx-1 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-mtx-1 2003-09-27 14:07:03.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1500=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
CONFIG_PCI_AUTO=y
@@ -515,6 +516,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -647,6 +649,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-nino linux-2.4.22/arch/mips/defconfig-nino
--- linux-2.4.22.clean/arch/mips/defconfig-nino 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-nino 2003-09-27 14:07:03.000000000 +0200
@@ -518,6 +518,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-ocelot linux-2.4.22/arch/mips/defconfig-ocelot
--- linux-2.4.22.clean/arch/mips/defconfig-ocelot 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-ocelot 2003-09-27 14:07:03.000000000 +0200
@@ -642,6 +642,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-osprey linux-2.4.22/arch/mips/defconfig-osprey
--- linux-2.4.22.clean/arch/mips/defconfig-osprey 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-osprey 2003-09-27 14:07:03.000000000 +0200
@@ -539,6 +539,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-pb1000 linux-2.4.22/arch/mips/defconfig-pb1000
--- linux-2.4.22.clean/arch/mips/defconfig-pb1000 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-pb1000 2003-09-27 14:07:03.000000000 +0200
@@ -72,6 +72,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1000=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
CONFIG_NONCOHERENT_IO=y
@@ -643,6 +644,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -955,6 +957,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-pb1100 linux-2.4.22/arch/mips/defconfig-pb1100
--- linux-2.4.22.clean/arch/mips/defconfig-pb1100 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-pb1100 2003-09-27 14:07:03.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1100=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
# CONFIG_PCI_AUTO is not set
CONFIG_NEW_PCI=y
@@ -629,6 +630,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
CONFIG_RTC=y
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -978,6 +980,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-pb1500 linux-2.4.22/arch/mips/defconfig-pb1500
--- linux-2.4.22.clean/arch/mips/defconfig-pb1500 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-pb1500 2003-09-27 14:07:03.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1500=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
CONFIG_PCI_AUTO=y
@@ -690,6 +691,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
CONFIG_RTC=y
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -1046,6 +1048,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-rbtx4927 linux-2.4.22/arch/mips/defconfig-rbtx4927
--- linux-2.4.22.clean/arch/mips/defconfig-rbtx4927 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/arch/mips/defconfig-rbtx4927 2003-09-10 02:17:31.000000000 +0200
@@ -0,0 +1,602 @@
+#
+# Automatically generated by make menuconfig: don't edit
+#
+CONFIG_MIPS=y
+CONFIG_MIPS32=y
+# CONFIG_MIPS64 is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_COGENT_CSB250 is not set
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_CASIO_E55 is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_IBM_WORKPAD is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_NEC_OSPREY is not set
+# CONFIG_NEC_EAGLE is not set
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SIBYTE_SB1xxx_SOC is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TANBAC_TB0226 is not set
+# CONFIG_TANBAC_TB0229 is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+CONFIG_TOSHIBA_RBTX4927=y
+# CONFIG_VICTOR_MPC30X is not set
+# CONFIG_ZAO_CAPCELLA is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_NEW_TIME_C=y
+CONFIG_PCI=y
+CONFIG_NEW_PCI=y
+CONFIG_PCI_AUTO=y
+CONFIG_SWAP_IO_SPACE_W=y
+CONFIG_SWAP_IO_SPACE_L=y
+CONFIG_ISA=y
+CONFIG_NONCOHERENT_IO=y
+CONFIG_DUMMY_KEYB=y
+# CONFIG_MIPS_AU1000 is not set
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+CONFIG_CPU_TX49XX=y
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_CPU_ADVANCED=y
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
+CONFIG_CPU_HAS_WB=y
+CONFIG_CPU_HAS_SYNC=y
+
+#
+# General setup
+#
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_NET=y
+# CONFIG_PCI_NAMES is not set
+CONFIG_EISA=y
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+# CONFIG_HOTPLUG_PCI is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_MIPS32_COMPAT is not set
+# CONFIG_MIPS32_O32 is not set
+# CONFIG_MIPS32_N32 is not set
+# CONFIG_BINFMT_ELF32 is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_BLK_STATS is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+# CONFIG_PACKET is not set
+# CONFIG_NETLINK_DEV is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_AC3200 is not set
+# CONFIG_APRICOT is not set
+# CONFIG_B44 is not set
+# CONFIG_CS89x0 is not set
+# CONFIG_TULIP is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_DGRS is not set
+# CONFIG_DM9102 is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_EEPRO100_PIO is not set
+# CONFIG_E100 is not set
+# CONFIG_LNE390 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_NE3210 is not set
+# CONFIG_ES3210 is not set
+# CONFIG_8139CP is not set
+CONFIG_8139TOO=y
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_SUNDANCE_MMIO is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_RHINE_MMIO is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
+# CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_DIGI is not set
+# CONFIG_ESPSERIAL is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_MOXA_SMARTIO is not set
+# CONFIG_ISI is not set
+# CONFIG_SYNCLINK is not set
+# CONFIG_SYNCLINKMP is not set
+# CONFIG_N_HDLC is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALDRV is not set
+CONFIG_SERIAL_TXX9=y
+CONFIG_SERIAL_TXX9_CONSOLE=y
+# CONFIG_SERIAL_TX3912 is not set
+# CONFIG_SERIAL_TX3912_CONSOLE is not set
+# CONFIG_TXX927_SERIAL is not set
+# CONFIG_TXX927_SERIAL_CONSOLE is not set
+# CONFIG_UNIX98_PTYS is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+# CONFIG_QIC02_TAPE is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_IPMI_PANIC_EVENT is not set
+# CONFIG_IPMI_DEVICE_INTERFACE is not set
+# CONFIG_IPMI_KCS is not set
+# CONFIG_IPMI_WATCHDOG is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_SCx200_GPIO is not set
+# CONFIG_AMD_PM768 is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BEFS_DEBUG is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_EXT2_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+# CONFIG_NFSD_TCP is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_RUNTIME_DEBUG is not set
+# CONFIG_KGDB is not set
+# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC32 is not set
+# CONFIG_ZLIB_INFLATE is not set
+# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-rm200 linux-2.4.22/arch/mips/defconfig-rm200
--- linux-2.4.22.clean/arch/mips/defconfig-rm200 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-rm200 2003-09-27 14:07:03.000000000 +0200
@@ -498,6 +498,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-sb1250-swarm linux-2.4.22/arch/mips/defconfig-sb1250-swarm
--- linux-2.4.22.clean/arch/mips/defconfig-sb1250-swarm 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-sb1250-swarm 2003-09-27 14:07:03.000000000 +0200
@@ -607,6 +607,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_SB1XXX_CORELIS is not set
# CONFIG_MAGIC_SYSRQ is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-sead linux-2.4.22/arch/mips/defconfig-sead
--- linux-2.4.22.clean/arch/mips/defconfig-sead 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-sead 2003-09-27 14:07:03.000000000 +0200
@@ -377,6 +377,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-tb0226 linux-2.4.22/arch/mips/defconfig-tb0226
--- linux-2.4.22.clean/arch/mips/defconfig-tb0226 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-tb0226 2003-09-27 14:07:03.000000000 +0200
@@ -790,6 +790,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-tb0229 linux-2.4.22/arch/mips/defconfig-tb0229
--- linux-2.4.22.clean/arch/mips/defconfig-tb0229 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-tb0229 2003-09-27 14:07:03.000000000 +0200
@@ -630,6 +630,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-ti1500 linux-2.4.22/arch/mips/defconfig-ti1500
--- linux-2.4.22.clean/arch/mips/defconfig-ti1500 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-ti1500 2003-09-27 14:07:03.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1500=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
CONFIG_PCI_AUTO=y
@@ -621,6 +622,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -972,6 +974,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-workpad linux-2.4.22/arch/mips/defconfig-workpad
--- linux-2.4.22.clean/arch/mips/defconfig-workpad 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-workpad 2003-09-27 14:07:03.000000000 +0200
@@ -613,6 +613,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/defconfig-xxs1500 linux-2.4.22/arch/mips/defconfig-xxs1500
--- linux-2.4.22.clean/arch/mips/defconfig-xxs1500 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/defconfig-xxs1500 2003-09-27 14:07:03.000000000 +0200
@@ -71,6 +71,7 @@
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_SOC_AU1X00=y
CONFIG_SOC_AU1500=y
+CONFIG_NEW_TIME_C=y
CONFIG_PCI=y
CONFIG_NEW_PCI=y
CONFIG_PCI_AUTO=y
@@ -664,6 +665,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
CONFIG_RTC=y
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -879,6 +881,7 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/burner.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/burner.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/burner.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/burner.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,230 +0,0 @@
-/*
- * arch/mips/galileo/compressed/burner.c
- *
- * By RidgeRun Inc (Leveraged from Galileo's main.c, misc.c, etc).
- *
- * Burn image from ram to flash
- * For use with Galileo EVB64120A MIPS eval board.
- */
-#include <asm/types.h>
-#include <asm/byteorder.h>
-#include <asm/galileo-boards/evb64120A/eeprom_param.h>
-#include <asm/galileo-boards/evb64120A/flashdrv.h>
-
-#define IMAGEOFFSET 0x00300000
-
-static void burn_image_from_memory(void);
-static char *sprintf(char *buf, const char *fmt, ...);
-static void printf(const char *fmt, ...);
-
-unsigned int FlashSize;
-
-/******************************
- Routine:
- Description:
- ******************************/
-int main(void)
-{
- printf("\n");
- printf("\n");
- printf("\n");
- printf("\n");
- printf(" +--------------------+\n");
- printf(" | |\n");
- printf(" | Flash Burn Utility |\n");
- printf(" | |\n");
- printf(" +--------------------+\n");
- printf("\n");
- printf("Please send your *.srec image to the parallel port\n");
- printf("\n");
- printf("Note: The *.srec image should be setup to\n");
- printf(" load into address 0xa0300000 where\n");
- printf(" it will then be transferred to flash\n");
- printf("\n");
-
- SET_REG_BITS(0x468, BIT20); // Set Flash to be 16 bit wide
- FlashSize = flashInit(0xbf000000, 2, X16);
-
- galileo_dl(); // read in the users *.srec image.
- burn_image_from_memory(); // put it in flash.
-
- printf("\n");
- printf("\n");
- printf("+---------------+\n");
- printf("| Done |\n");
- printf("|(please reboot)|\n");
- printf("+---------------+\n");
- printf("\n");
-
- while (1) {
- }
- return 0;
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-static void burn_image_from_memory(void)
-{
- unsigned int count, delta, temp, temp1;
- unsigned int to_sector, last_sector;
-
- /* Find how many sectors needed to be erased */
- to_sector = flashInWhichSector(FlashSize - 4); // skranz, modified.
- if (to_sector == 0xffffffff) {
- printf
- ("Flash Burning Error - Flash too small - Cannot burn image\n"); // skranz, modified.
- return;
- }
-
- /* Which is the last sector */
- last_sector = flashInWhichSector(FlashSize - 4);
- delta = 0;
- printf("\nErasing first %d sectors\n", to_sector);
- for (count = 0; count < to_sector + 1; count++) {
- printf("Erasing sector %d\n", count);
- flashEraseSector(count);
- }
- printf("flash region size = %d\n", FlashSize); // skranz, added
- printf("Sdram IMAGEOFFSET = %d\n", IMAGEOFFSET); // skranz, added
-
- printf("Burning from Sdram to %d mark; full burn.\n", FlashSize);
- for (count = 0; count < (FlashSize - delta); count = count + 4) {
- flashWriteWord(count,
- *(unsigned int *) ((count | NONE_CACHEABLE)
- + IMAGEOFFSET)); // skranz, modified.
- temp = flashReadWord(count);
- temp1 = *(unsigned int *) ((count | NONE_CACHEABLE) + IMAGEOFFSET); // skranz, modified.
- if (((unsigned int) temp) != ((unsigned int) temp1)) {
- printf
- ("Burning error at address %X : flash(%X) sdram(%X)\n",
- count, flashReadWord(count),
- *(unsigned int *) ((count | NONE_CACHEABLE) + IMAGEOFFSET)); // skranz, modified.
- printf("Aborting Prematurally.\n");
- break;
- }
- }
- printf("Finished burning Image\n");
-}
-
-/******************************
- Routine:
- Description:
- Formats:
- %X - 4 byte ASCII (8 hex digits)
- %x - 2 byte ASCII (4 hex digits)
- %b - 1 byte ASCII (2 hex digits)
- %d - decimal (also %i)
- %c - ASCII char
- %s - ASCII string
- %I - Internet address in x.x.x.x notation
- ******************************/
-static char hex[] = "0123456789ABCDEF";
-static char *do_printf(char *buf, const char *fmt, const int *dp)
-{
- register char *p;
- char tmp[16];
- while (*fmt) {
- if (*fmt == '%') { /* switch() uses more space */
- fmt++;
-
- if (*fmt == 'X') {
- const long *lp = (const long *) dp;
- register long h = *lp++;
- dp = (const int *) lp;
- *(buf++) = hex[(h >> 28) & 0x0F];
- *(buf++) = hex[(h >> 24) & 0x0F];
- *(buf++) = hex[(h >> 20) & 0x0F];
- *(buf++) = hex[(h >> 16) & 0x0F];
- *(buf++) = hex[(h >> 12) & 0x0F];
- *(buf++) = hex[(h >> 8) & 0x0F];
- *(buf++) = hex[(h >> 4) & 0x0F];
- *(buf++) = hex[h & 0x0F];
- }
- if (*fmt == 'x') {
- register int h = *(dp++);
- *(buf++) = hex[(h >> 12) & 0x0F];
- *(buf++) = hex[(h >> 8) & 0x0F];
- *(buf++) = hex[(h >> 4) & 0x0F];
- *(buf++) = hex[h & 0x0F];
- }
- if (*fmt == 'b') {
- register int h = *(dp++);
- *(buf++) = hex[(h >> 4) & 0x0F];
- *(buf++) = hex[h & 0x0F];
- }
- if ((*fmt == 'd') || (*fmt == 'i')) {
- register int dec = *(dp++);
- p = tmp;
- if (dec < 0) {
- *(buf++) = '-';
- dec = -dec;
- }
- do {
- *(p++) = '0' + (dec % 10);
- dec = dec / 10;
- } while (dec);
- while ((--p) >= tmp)
- *(buf++) = *p;
- }
- if (*fmt == 'I') {
- union {
- long l;
- unsigned char c[4];
- } u;
- const long *lp = (const long *) dp;
- u.l = *lp++;
- dp = (const int *) lp;
- buf = sprintf(buf, "%d.%d.%d.%d",
- u.c[0], u.c[1], u.c[2],
- u.c[3]);
- }
- if (*fmt == 'c')
- *(buf++) = *(dp++);
- if (*fmt == 's') {
- p = (char *) *dp++;
- while (*p)
- *(buf++) = *p++;
- }
- } else
- *(buf++) = *fmt;
- fmt++;
- }
- *buf = 0;
- return (buf);
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-static char *sprintf(char *buf, const char *fmt, ...)
-{
- return do_printf(buf, fmt, ((const int *) &fmt) + 1);
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-void putchar(int c)
-{
- if (c == '\n') {
- serial_putc('\r');
- }
- serial_putc(c);
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-static void printf(const char *fmt, ...)
-{
- char buf[256], *p;
- p = buf;
- do_printf(buf, fmt, ((const int *) &fmt) + 1);
- while (*p)
- putchar(*p++);
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/doit.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/doit.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/doit.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/doit.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,75 +0,0 @@
-/*
- * By RidgeRun Inc.
- *
- * The input to this program is intended to be
- * a compressed linux kernel. The output of this
- * program is then a constructed *.S file which
- * defines a large data structure -- the contents
- * of which represent the compressed kernel which
- * can subsequently be used in a program designed
- * to access that struture for decompression at
- * runtime and then subsequent kernel bootup.
- *
- * Example Usage:
- * ./doit < piggy.gz > piggy.S
- *
- */
-
-#include <stdio.h>
-
-void printval(int i)
-{
- int tth, th, h, t, d;
-
- if (i > 99999) {
- printf("Error - printval outofbounds\n");
- return;
- }
-
- tth = 0;
- th = 0;
- //tth = (i) / 10000;
- //th = (i - (tth * 10000)) / 1000;
- h = (i - ((tth * 10000) + (th * 1000))) / 100;
- t = (i - ((tth * 10000) + (th * 1000) + (h * 100))) / 10;
- d = (i - ((tth * 10000) + (th * 1000) + (h * 100) + (t * 10)));
- //putchar(tth + '0');
- //putchar(th + '0');
- putchar(h + '0');
- putchar(t + '0');
- putchar(d + '0');
-}
-
-main(int argc, char **argv)
-{
- int val;
- int size = 0;
- unsigned char c;
-
- printf("gcc2_compiled.:\n");
- printf("__gnu_compiled_c:\n");
- printf("\t.globl linux_compressed_start\n");
- printf("\t.text\n");
- printf("\t.align 2\n");
- printf("\t.type linux_compressed_start,@object\n");
- printf("linux_compressed_start:\n");
-
-
- val = getchar();
- while (val != EOF) {
- size++;
- c = (unsigned char) (val & 0x00ff);
- printf("\t.byte ");
- printval((int) c);
- printf("\n");
- val = getchar();
- }
- printf("\t.size linux_compressed_start,%d\n", size);
- printf("\t.globl linux_compressed_size\n");
- printf("\t.text\n");
- printf("\t.align 2\n");
- printf("\t.type linux_compressed_size,@object\n");
- printf("\t.size linux_compressed_size,4\n");
- printf("linux_compressed_size:\n");
- printf("\t.word %d\n", size);
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/etherboot.h linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/etherboot.h
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/etherboot.h 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/etherboot.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,566 +0,0 @@
-/**************************************************************************
-ETHERBOOT - BOOTP/TFTP Bootstrap Program
-
-Author: Martin Renters
- Date: Dec/93
-
-**************************************************************************/
-
-#include "osdep.h"
-
-/* These could be customised for different languages perhaps */
-#define ASK_PROMPT "Boot from (N)etwork or from (L)ocal? "
-#define ANS_NETWORK 'N'
-#define ANS_LOCAL 'L'
-#ifndef ANS_DEFAULT /* in case left out in Makefile */
-#define ANS_DEFAULT ANS_NETWORK
-#endif
-
-#define TAGGED_IMAGE /* eventually optional */
-#if !defined(TAGGED_IMAGE) && !defined(AOUT_IMAGE) && !defined(ELF_IMAGE)
-#define TAGGED_IMAGE /* choose at least one */
-#endif
-
-#define ESC 0x1B
-
-#ifndef DEFAULT_BOOTFILE
-#define DEFAULT_BOOTFILE "/tftpboot/kernel"
-#endif
-
-/* Clean up console settings... mainly CONSOLE_CRT and CONSOLE_SERIAL are used
- * in the sources (except start.S and serial.S which cannot include
- * etherboot.h). At least one of the CONSOLE_xxx has to be set, and
- * CONSOLE_DUAL sets both CONSOLE_CRT and CONSOLE_SERIAL. If none is set,
- * CONSOLE_CRT is assumed. */
-#ifdef CONSOLE_DUAL
-#undef CONSOLE_CRT
-#define CONSOLE_CRT
-#undef CONSOLE_SERIAL
-#define CONSOLE_SERIAL
-#endif
-#if defined(CONSOLE_CRT) && defined(CONSOLE_SERIAL)
-#undef CONSOLE_DUAL
-#define CONSOLE_DUAL
-#endif
-#if !defined(CONSOLE_CRT) && !defined(CONSOLE_SERIAL)
-#define CONSOLE_CRT
-#endif
-
-#ifndef DOWNLOAD_PROTO_NFS
-#undef DOWNLOAD_PROTO_TFTP
-#define DOWNLOAD_PROTO_TFTP /* default booting protocol */
-#endif
-
-#ifdef DOWNLOAD_PROTO_TFTP
-#define download(fname,loader) tftp((fname),(loader))
-#endif
-#ifdef DOWNLOAD_PROTO_NFS
-#define download(fname,loader) nfs((fname),(loader))
-#endif
-
-#ifndef MAX_TFTP_RETRIES
-#define MAX_TFTP_RETRIES 20
-#endif
-
-#ifndef MAX_BOOTP_RETRIES
-#define MAX_BOOTP_RETRIES 20
-#endif
-
-#ifndef MAX_BOOTP_EXTLEN
-#if (RELOC < 0x94000)
-/* Force internal buffer (if external buffer would overlap with our code...) */
-#undef INTERNAL_BOOTP_DATA
-#define INTERNAL_BOOTP_DATA
-#endif
-/* sizeof(struct bootp_t) == 0x240 */
-#if defined(INTERNAL_BOOTP_DATA) || (RELOC >= 0x94240)
-#define MAX_BOOTP_EXTLEN 1024
-#else
-#define MAX_BOOTP_EXTLEN (1024-sizeof(struct bootp_t))
-#endif
-#endif
-
-#ifndef MAX_ARP_RETRIES
-#define MAX_ARP_RETRIES 20
-#endif
-
-#ifndef MAX_RPC_RETRIES
-#define MAX_RPC_RETRIES 20
-#endif
-
-#define TICKS_PER_SEC 18
-
-/* Inter-packet retry in ticks */
-#define TIMEOUT (10*TICKS_PER_SEC)
-
-/* These settings have sense only if compiled with -DCONGESTED */
-/* total retransmission timeout in ticks */
-#define TFTP_TIMEOUT (30*TICKS_PER_SEC)
-/* packet retransmission timeout in ticks */
-#define TFTP_REXMT (3*TICKS_PER_SEC)
-
-#ifndef NULL
-#define NULL ((void *)0)
-#endif
-
-#define TRUE 1
-#define FALSE 0
-
-#define ETHER_ADDR_SIZE 6 /* Size of Ethernet address */
-#define ETHER_HDR_SIZE 14 /* Size of ethernet header */
-#define ETH_MIN_PACKET 64
-#define ETH_MAX_PACKET 1518
-
-#define VENDOR_NONE 0
-#define VENDOR_WD 1
-#define VENDOR_NOVELL 2
-#define VENDOR_3COM 3
-#define VENDOR_3C509 4
-#define VENDOR_CS89x0 5
-
-#define FLAG_PIO 0x01
-#define FLAG_16BIT 0x02
-#define FLAG_790 0x04
-
-#define ARP_CLIENT 0
-#define ARP_SERVER 1
-#define ARP_GATEWAY 2
-#define ARP_ROOTSERVER 3
-#define ARP_SWAPSERVER 4
-#define MAX_ARP ARP_SWAPSERVER+1
-
-#define RARP_REQUEST 3
-#define RARP_REPLY 4
-
-#define IP 0x0800
-#define ARP 0x0806
-#define RARP 0x8035
-
-#define BOOTP_SERVER 67
-#define BOOTP_CLIENT 68
-#define TFTP_PORT 69
-#define SUNRPC_PORT 111
-
-#define IP_UDP 17
-/* Same after going through htonl */
-#define IP_BROADCAST 0xFFFFFFFF
-
-#define ARP_REQUEST 1
-#define ARP_REPLY 2
-
-#define BOOTP_REQUEST 1
-#define BOOTP_REPLY 2
-
-#define TAG_LEN(p) (*((p)+1))
-#define RFC1533_COOKIE 99, 130, 83, 99
-#define RFC1533_PAD 0
-#define RFC1533_NETMASK 1
-#define RFC1533_TIMEOFFSET 2
-#define RFC1533_GATEWAY 3
-#define RFC1533_TIMESERVER 4
-#define RFC1533_IEN116NS 5
-#define RFC1533_DNS 6
-#define RFC1533_LOGSERVER 7
-#define RFC1533_COOKIESERVER 8
-#define RFC1533_LPRSERVER 9
-#define RFC1533_IMPRESSSERVER 10
-#define RFC1533_RESOURCESERVER 11
-#define RFC1533_HOSTNAME 12
-#define RFC1533_BOOTFILESIZE 13
-#define RFC1533_MERITDUMPFILE 14
-#define RFC1533_DOMAINNAME 15
-#define RFC1533_SWAPSERVER 16
-#define RFC1533_ROOTPATH 17
-#define RFC1533_EXTENSIONPATH 18
-#define RFC1533_IPFORWARDING 19
-#define RFC1533_IPSOURCEROUTING 20
-#define RFC1533_IPPOLICYFILTER 21
-#define RFC1533_IPMAXREASSEMBLY 22
-#define RFC1533_IPTTL 23
-#define RFC1533_IPMTU 24
-#define RFC1533_IPMTUPLATEAU 25
-#define RFC1533_INTMTU 26
-#define RFC1533_INTLOCALSUBNETS 27
-#define RFC1533_INTBROADCAST 28
-#define RFC1533_INTICMPDISCOVER 29
-#define RFC1533_INTICMPRESPOND 30
-#define RFC1533_INTROUTEDISCOVER 31
-#define RFC1533_INTROUTESOLICIT 32
-#define RFC1533_INTSTATICROUTES 33
-#define RFC1533_LLTRAILERENCAP 34
-#define RFC1533_LLARPCACHETMO 35
-#define RFC1533_LLETHERNETENCAP 36
-#define RFC1533_TCPTTL 37
-#define RFC1533_TCPKEEPALIVETMO 38
-#define RFC1533_TCPKEEPALIVEGB 39
-#define RFC1533_NISDOMAIN 40
-#define RFC1533_NISSERVER 41
-#define RFC1533_NTPSERVER 42
-#define RFC1533_VENDOR 43
-#define RFC1533_NBNS 44
-#define RFC1533_NBDD 45
-#define RFC1533_NBNT 46
-#define RFC1533_NBSCOPE 47
-#define RFC1533_XFS 48
-#define RFC1533_XDM 49
-#ifndef NO_DHCP_SUPPORT
-#define RFC2132_REQ_ADDR 50
-#define RFC2132_MSG_TYPE 53
-#define RFC2132_SRV_ID 54
-#define RFC2132_PARAM_LIST 55
-#define RFC2132_MAX_SIZE 57
-
-#define DHCPDISCOVER 1
-#define DHCPOFFER 2
-#define DHCPREQUEST 3
-#define DHCPACK 5
-#endif /* NO_DHCP_SUPPORT */
-
-#define RFC1533_VENDOR_MAJOR 0
-#define RFC1533_VENDOR_MINOR 0
-
-#define RFC1533_VENDOR_MAGIC 128
-#define RFC1533_VENDOR_ADDPARM 129
-#ifdef IMAGE_FREEBSD
-#define RFC1533_VENDOR_HOWTO 132
-#endif
-#define RFC1533_VENDOR_MNUOPTS 160
-#define RFC1533_VENDOR_SELECTION 176
-#define RFC1533_VENDOR_MOTD 184
-#define RFC1533_VENDOR_NUMOFMOTD 8
-#define RFC1533_VENDOR_IMG 192
-#define RFC1533_VENDOR_NUMOFIMG 16
-
-#define RFC1533_END 255
-#define BOOTP_VENDOR_LEN 64
-#ifndef NO_DHCP_SUPPORT
-#define DHCP_OPT_LEN 312
-#endif /* NO_DHCP_SUPPORT */
-
-#define TFTP_DEFAULTSIZE_PACKET 512
-#define TFTP_MAX_PACKET 1432 /* 512 */
-
-#define TFTP_RRQ 1
-#define TFTP_WRQ 2
-#define TFTP_DATA 3
-#define TFTP_ACK 4
-#define TFTP_ERROR 5
-#define TFTP_OACK 6
-
-#define TFTP_CODE_EOF 1
-#define TFTP_CODE_MORE 2
-#define TFTP_CODE_ERROR 3
-#define TFTP_CODE_BOOT 4
-#define TFTP_CODE_CFG 5
-
-#define AWAIT_ARP 0
-#define AWAIT_BOOTP 1
-#define AWAIT_TFTP 2
-#define AWAIT_RARP 3
-#define AWAIT_RPC 4
-#define AWAIT_QDRAIN 5 /* drain queue, process ARP requests */
-
-typedef struct {
- unsigned long s_addr;
-} in_addr;
-
-struct arptable_t {
- in_addr ipaddr;
- unsigned char node[6];
-};
-
-/*
- * A pity sipaddr and tipaddr are not longword aligned or we could use
- * in_addr. No, I don't want to use #pragma packed.
- */
-struct arprequest {
- unsigned short hwtype;
- unsigned short protocol;
- char hwlen;
- char protolen;
- unsigned short opcode;
- char shwaddr[6];
- char sipaddr[4];
- char thwaddr[6];
- char tipaddr[4];
-};
-
-struct iphdr {
- char verhdrlen;
- char service;
- unsigned short len;
- unsigned short ident;
- unsigned short frags;
- char ttl;
- char protocol;
- unsigned short chksum;
- in_addr src;
- in_addr dest;
-};
-
-struct udphdr {
- unsigned short src;
- unsigned short dest;
- unsigned short len;
- unsigned short chksum;
-};
-
-struct bootp_t {
- struct iphdr ip;
- struct udphdr udp;
- char bp_op;
- char bp_htype;
- char bp_hlen;
- char bp_hops;
- unsigned long bp_xid;
- unsigned short bp_secs;
- unsigned short unused;
- in_addr bp_ciaddr;
- in_addr bp_yiaddr;
- in_addr bp_siaddr;
- in_addr bp_giaddr;
- char bp_hwaddr[16];
- char bp_sname[64];
- char bp_file[128];
-#ifdef NO_DHCP_SUPPORT
- char bp_vend[BOOTP_VENDOR_LEN];
-#else
- char bp_vend[DHCP_OPT_LEN];
-#endif /* NO_DHCP_SUPPORT */
-};
-
-struct bootpd_t {
- struct bootp_t bootp_reply;
- unsigned char bootp_extension[MAX_BOOTP_EXTLEN];
-};
-
-struct tftp_t {
- struct iphdr ip;
- struct udphdr udp;
- unsigned short opcode;
- union {
- char rrq[TFTP_DEFAULTSIZE_PACKET];
- struct {
- unsigned short block;
- char download[TFTP_MAX_PACKET];
- } data;
- struct {
- unsigned short block;
- } ack;
- struct {
- unsigned short errcode;
- char errmsg[TFTP_DEFAULTSIZE_PACKET];
- } err;
- struct {
- char data[TFTP_DEFAULTSIZE_PACKET + 2];
- } oack;
- } u;
-};
-
-#define TFTP_MIN_PACKET (sizeof(struct iphdr) + sizeof(struct udphdr) + 4)
-
-struct rpc_t {
- struct iphdr ip;
- struct udphdr udp;
- union {
- char data[300]; /* longest RPC call must fit!!!! */
- struct {
- long id;
- long type;
- long rpcvers;
- long prog;
- long vers;
- long proc;
- long data[1];
- } call;
- struct {
- long id;
- long type;
- long rstatus;
- long verifier;
- long v2;
- long astatus;
- long data[1];
- } reply;
- } u;
-};
-
-#define PROG_PORTMAP 100000
-#define PROG_NFS 100003
-#define PROG_MOUNT 100005
-
-#define MSG_CALL 0
-#define MSG_REPLY 1
-
-#define PORTMAP_GETPORT 3
-
-#define MOUNT_ADDENTRY 1
-#define MOUNT_UMOUNTALL 4
-
-#define NFS_LOOKUP 4
-#define NFS_READ 6
-
-#define NFS_FHSIZE 32
-
-#define NFSERR_PERM 1
-#define NFSERR_NOENT 2
-#define NFSERR_ACCES 13
-
-/* Block size used for NFS read accesses. A RPC reply packet (including all
- * headers) must fit within a single Ethernet frame to avoid fragmentation.
- * Chosen to be a power of two, as most NFS servers are optimized for this. */
-#define NFS_READ_SIZE 1024
-
-#define FLOPPY_BOOT_LOCATION 0x7c00
-
-#define ROM_INFO_LOCATION 0x7dfa
-/* at end of floppy boot block */
-
-struct rom_info {
- unsigned short rom_segment;
- unsigned short rom_length;
-};
-
-/***************************************************************************
-External prototypes
-***************************************************************************/
-/* main.c */
-extern void print_bytes P((unsigned char *bytes, int len));
-extern void load P((void));
-extern int load_linux P((int root_mount_port, int swap_mount_port,
- int root_nfs_port, char *kernel_handle));
-extern int downloadkernel P((unsigned char *, int, int, int));
-extern int tftp
-P((const char *name, int (*)(unsigned char *, int, int, int)));
-extern void rpc_init(void);
-extern int nfs
-P((const char *name, int (*)(unsigned char *, int, int, int)));
-extern void nfs_umountall P((int));
-extern int bootp P((void));
-extern int rarp P((void));
-extern int udp_transmit P((unsigned long destip, unsigned int srcsock,
- unsigned int destsock, int len,
- const void *buf));
-
-extern int await_reply P((int type, int ival, void *ptr, int timeout));
-extern int decode_rfc1533 P((unsigned char *, int, int, int));
-extern unsigned short ipchksum P((unsigned short *, int len));
-extern void rfc951_sleep P((int));
-extern void cleanup_net P((void));
-extern void cleanup P((void));
-
-/* config.c */
-extern void print_config(void);
-extern void eth_reset(void);
-extern int eth_probe(void);
-extern int eth_poll(void);
-extern void eth_transmit(const char *d, unsigned int t, unsigned int s,
- const void *p);
-extern void eth_disable(void);
-
-/* bootmenu.c */
-extern int execute P((char *string));
-extern void bootmenu P((int));
-extern void show_motd P((void));
-extern void parse_menuopts P((char *, int));
-extern int getoptvalue P((char **, int *, int *));
-extern void selectImage P((char **));
-
-/* osloader.c */
-#if defined(AOUT_IMAGE) || defined(ELF_IMAGE)
-extern int howto;
-#endif
-extern int os_download P((unsigned int, unsigned char *, unsigned int));
-
-/* misc.c */
-extern void twiddle P((void));
-extern void sleep P((int secs));
-extern int strcasecmp P((char *a, char *b));
-extern char *substr P((char *a, char *b));
-extern int getdec P((char **));
-extern void printf P((const char *, ...));
-extern char *sprintf P((char *, const char *, ...));
-extern int inet_aton P((char *p, in_addr * i));
-extern void gateA20_set P((void));
-extern void gateA20_unset P((void));
-extern void putchar P((int));
-extern int getchar P((void));
-extern int iskey P((void));
-
-/* start*.S */
-extern int getc P((void));
-extern void putc P((int));
-extern int ischar P((void));
-extern int getshift P((void));
-extern unsigned int memsize P((void));
-extern unsigned short basememsize P((void));
-extern void disk_init P((void));
-extern unsigned int disk_read P((int drv, int c, int h, int s, char *buf));
-extern void xstart P((unsigned long, unsigned long, char *));
-extern unsigned long currticks P((void));
-extern int setjmp P((void *jmpbuf));
-extern void longjmp P((void *jmpbuf, int where));
-extern void exit P((int status));
-extern void slowdownio P((void));
-
-/* serial.S */
-extern int serial_getc P((void));
-extern void serial_putc P((int));
-extern int serial_ischar P((void));
-extern int serial_init P((void));
-
-/* ansiesc.c */
-extern void ansi_reset P((void));
-extern void enable_cursor P((int));
-extern void handleansi P((unsigned char));
-
-/* md5.c */
-extern void md5_put P((unsigned int ch));
-extern void md5_done P((unsigned char *buf));
-
-/* floppy.c */
-extern int bootdisk P((int dev, int part));
-
-/***************************************************************************
-External variables
-***************************************************************************/
-/* main.c */
-extern const char *kernel;
-extern char kernel_buf[128];
-extern struct rom_info rom;
-extern int hostnamelen;
-extern unsigned long netmask;
-extern int jmp_bootmenu[10];
-extern struct arptable_t arptable[MAX_ARP];
-#ifdef IMAGE_MENU
-extern char *motd[RFC1533_VENDOR_NUMOFMOTD];
-extern int menutmo, menudefault;
-extern unsigned char *defparams;
-extern int defparams_max;
-#endif
-#if defined(ETHERBOOT32) && !defined(INTERNAL_BOOTP_DATA)
-#define BOOTP_DATA_ADDR ((struct bootpd_t *)0x93C00)
-#else
-extern struct bootpd_t bootp_data;
-#define BOOTP_DATA_ADDR (&bootp_data)
-#endif
-extern unsigned char *end_of_rfc1533;
-#ifdef IMAGE_FREEBSD
-extern int freebsd_howto;
-#endif
-
-/* config.c */
-extern struct nic nic;
-
-/* bootmenu.c */
-
-/* osloader.c */
-
-/* created by linker */
-extern char _start[], _edata[], _end[];
-
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/evb64120A_Setup.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/evb64120A_Setup.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/evb64120A_Setup.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/evb64120A_Setup.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,197 +0,0 @@
-/*
- * arch/mips/galileo/compressed/evb64120A_memSetup.c
- *
- * By RidgeRun Inc, (Leveraged from Galileo's sbd.c)
- *
- * Xfer an image from flash to ram.
- * For use with Galileo EVB64120A MIPS eval board.
- */
-#include "ns16550.h"
-#include <linux/serial_reg.h>
-#include <asm/galileo-boards/evb64120A/pci.h>
-#include <asm/galileo-boards/evb64120A/core.h>
-
-void XferToRam(void);
-bool mapMemoryBanks0and1(unsigned int bank0Base, unsigned int bank0Length,
- unsigned int bank1Base, unsigned int bank1Length);
-bool mapMemoryBanks2and3(unsigned int bank2Base, unsigned int bank2Length,
- unsigned int bank3Base, unsigned int bank3Length);
-bool mapDevices0_1and2MemorySpace(unsigned int device0Base,
- unsigned int device0Length,
- unsigned int device1Base,
- unsigned int device1Length,
- unsigned int device2Base,
- unsigned int device2Length);
-
-#define RUNNINGFROMFLASH
-#include "./xfer.c"
-
-/******************************
- Routine:
- Description:
- ******************************/
-unsigned int readWord(unsigned int addr)
-{
- unsigned int tmp;
- tmp = *(unsigned int *) (addr | NONE_CACHEABLE);
- return WORDSWAP(tmp);
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-void writeWord(unsigned int addr, unsigned int data)
-{
- *((unsigned int *) (addr | NONE_CACHEABLE)) = WORDSWAP(data);
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-unsigned int GetExtendedMemorySize(void)
-{
- unsigned int address, data = 0x11223344, type;
- unsigned int bank1_ef = false, bank2_ef = false, bank3_ef = false;
- unsigned int bank0_size, bank2_size, bank3_size, total_size = 0;
-
- mapMemoryBanks0and1(0, 0x800000, 0x800000, 0x800000);
- mapMemoryBanks2and3(0x1000000, 0x800000, 0x1800000, 0x800000);
- type = readWord(0x14000810);
- switch (type) {
- case 16:
- bank0_size = 0x1000000;
- break;
- case 64:
- bank0_size = 0x4000000;
- break;
- case 128:
- bank0_size = 0x8000000;
- break;
- case 256:
- bank0_size = 0x10000000;
- break;
- default:
- bank0_size = 0x1000000;
- break;
- }
-
- type = readWord(0x14000814);
- switch (type) {
- case 16:
- bank2_size = 0x1000000;
- bank3_size = 0x1000000;
- break;
- case 64:
- bank2_size = 0x4000000;
- bank3_size = 0x4000000;
- break;
- case 128:
- bank2_size = 0x8000000;
- bank3_size = 0x8000000;
- break;
- case 256:
- bank2_size = 0x10000000;
- bank3_size = 0x10000000;
- break;
- default:
- bank2_size = 0x1000000;
- bank3_size = 0x1000000;
- break;
- }
-
- /* Check which banks exist */
- /* Bank 1 */
- for (address = 0xffff00; address < 0x1000000; address += 4)
- writeWord(address, data);
- for (address = 0xffff00; address < 0x1000000; address += 4) {
- if (readWord(address) != data)
- break;
- }
- if (address == 0x1000000)
- bank1_ef = true;
- // Bank 2
- for (address = 0x17fff00; address < 0x1800000; address += 4)
- writeWord(address, data);
- for (address = 0x17fff00; address < 0x1800000; address += 4) {
- if (readWord(address) != data)
- break;
- }
- if (address == 0x1800000)
- bank2_ef = true;
- else
- bank2_size = 0x0;
- // Bank 3
- for (address = 0x1ffff00; address < 0x2000000; address += 4)
- writeWord(address, data);
- for (address = 0x1ffff00; address < 0x2000000; address += 4) {
- if (readWord(address) != data)
- break;
- }
- if (address == 0x2000000)
- bank3_ef = true;
-
- // Reconfig the system with the new bank0 (and maybe bank1) size.
- if (bank0_size == 0x10000000)
- bank1_ef = false;
- if (bank1_ef == true) {
- mapMemoryBanks0and1(0, bank0_size, bank0_size, bank0_size);
- // Fix the PCI bars
- pci0MapMemoryBanks0_1(0, bank0_size * 2);
- pci1MapMemoryBanks0_1(0, bank0_size * 2);
- total_size += bank0_size * 2;
- } else {
- mapMemoryBanks0and1(0, bank0_size, bank0_size, 0);
- // Fix the PCI bars
- pci0MapMemoryBanks0_1(0, bank0_size);
- pci1MapMemoryBanks0_1(0, bank0_size);
- total_size += bank0_size;
- }
- if (total_size == 0x10000000) {
- bank2_ef = false;
- bank3_ef = false;
- } else {
- if ((total_size + bank2_size) > 0x10000000) {
- bank2_size = 0x10000000 - total_size;
- bank3_ef = false;
- } else {
- if (bank3_size + total_size + bank2_size >
- 0x10000000) {
- bank3_size =
- 0x10000000 - (total_size + bank2_size);
- }
- }
- }
- if (bank2_ef == true) {
- if (bank3_ef == true) {
- mapMemoryBanks2and3(total_size, bank2_size,
- total_size + bank2_size,
- bank3_size);
- // Fix the PCI bars
- pci0MapMemoryBanks2_3(total_size,
- bank2_size + bank3_size);
- pci1MapMemoryBanks2_3(total_size,
- bank2_size + bank3_size);
- total_size += (bank2_size + bank3_size);
- } else {
- mapMemoryBanks2and3(total_size, bank2_size,
- total_size + bank2_size, 0);
- // Fix the PCI bars
- pci0MapMemoryBanks2_3(total_size, bank2_size);
- pci1MapMemoryBanks2_3(total_size, bank2_size);
- total_size += bank2_size;
- }
- } else {
- mapMemoryBanks2and3(total_size, 0, total_size, 0);
- pci0MapMemoryBanks2_3(total_size, 0);
- pci1MapMemoryBanks2_3(total_size, 0);
- }
- /* Reorganize the devices memory map */
- mapDevices0_1and2MemorySpace(0x1c000000, 0x800000, 0x1a000000,
- 0xc00000, 0x1d000000, 0x800000);
-
- XferToRam();
- return 0; // Not that we'll ever get to this line of code, but
- // it does satisfy a compiler warning.
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/fixit linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/fixit
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/fixit 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/fixit 1970-01-01 01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
-#!/bin/ksh
-
-# By RidgeRun Inc.
-#
-# The input to this script is
-# intended to be a *.S file which
-# was previously created by the doit
-# program. That program constructs
-# a *.S file which has a defined data
-# table containing values with leading
-# zeroes. To satisfy our assembler those
-# leading zeroes need to be stripped off
-# and that is the purpose of this script.
-
-echo "Removing leading zeros"
-sed -e "s/ 0\(.\)/ \1/g" $1 | sed -e "s/ 0\(.\)/ \1/g" > $1.new
-mv $1.new $1
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/flashdrv.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/flashdrv.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/flashdrv.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/flashdrv.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,1560 +0,0 @@
-/* flashdrv.c - FLASH memory functions and definitions*/
-
-/* Copyright Galileo Technology. */
-
-/*
-DESCRIPTION
-This flash driver gives the user a convenient interface to FLASH memory located
-on the user`s board, it supports various layout configurations such as:
-1. One pure 8 bit device (Such as AMD`s AM29LV040B).
-2. 1,2,4 or 8 devices 16 bit wide configured to operate in 8 bit mode.
-3. 1,2 or 4 devices each 16 bit wide.
-Before using the driver you must call the initialization function at least once
-or when ever you are changing the FLASH base address.
-The list bellow contains the supported FLASH memory devices, new devices can be
-added easily in the future.
-*/
-
-/*includes*/
-#ifdef __linux__
-#include <asm/galileo-boards/evb64120A/flashdrv.h>
-#else
-#include "flashdrv.h"
-#endif
-/* locals */
-
-#ifdef __MIPSEB__ // skranz, add
-#define BE // skranz, add
-#endif // skranz, add
-
-/******************************************************************************
-* Those two tables contain the supported flash devices information needed by
-* the driver:
-* The first table "flashParametrs" starts with 10 shared fields
-* (currently 6 are reserved):
-* index 0 => Pointer to an entry in the second table list
-* index 1 => baseAddress - Flash memory device base address.
-* index 2 => width - 1, 2, 4 or 8 Bytes.
-* index 3 => mode - PURE8, X8 or X16 flash configuration (for X16 devices only)
-* The second table (flashTypes) contains:
-* Entry`s structure:
-* Manufacture ID,Device ID,number of sectors,list of sector`s sizes
-* (in Kbytes starting with sector number 0).
-* The end of the list is pointed with a zero.
-******************************************************************************/
-unsigned int flashParametrs[10]; /* 0 Entry pointer */
- /* 0 Base address */
- /* 0 Width */
- /* 0 Mode */
- /* 0,0,0,0,0,0, spare entries. */
-unsigned int flashTypes[] = {
-
- /* 0 */ AMD_FLASH, AM29F400BB, 11, 16, 8, 8, 32, 64, 64, 64, 64,
- 64, 64, 64,
- /* 1 */ AMD_FLASH, AM29F400BT, 11, 64, 64, 64, 64, 64, 64, 64, 32,
- 8, 8, 16,
- /* 2 */ ST_FLASH, M29W040, 8, 64, 64, 64, 64, 64, 64, 64, 64,
- /* 3 */ AMD_FLASH, AM29LV040B, 8, 64, 64, 64, 64, 64, 64, 64, 64,
- /* 4 */ AMD_FLASH, AM29LV800BT, 19, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64,
- 64, 64, 64, 64, 64, 32, 8, 8, 16,
- /* 5 */ INTEL_FLASH, I28F320J3A, 32, 128, 128, 128, 128, 128, 128,
- 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128,
- /* 6 */ INTEL_FLASH, I28F640J3A, 64, 128, 128, 128, 128, 128, 128,
- 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128,
- /* 7 */ INTEL_FLASH, I28F128J3A, 128, 128, 128, 128, 128, 128, 128,
- 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- /* 8 */ AMD_FLASH, AM29LV400BB, 11, 16, 8, 8, 32, 64, 64, 64, 64,
- 64, 64, 64,
- /* 9 */ AMD_FLASH, AM29LV400BT, 11, 64, 64, 64, 64, 64, 64, 64, 32,
- 8, 8, 16,
- /* 10 */ INTEL_FLASH, I28F320B3_T, 71, 64, 64, 64, 64, 64, 64, 64,
- 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8,
- /* 11 */ INTEL_FLASH, I28F320B3_B, 71, 8, 8, 8, 8, 8, 8, 8, 8, 64,
- 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- /* 12 */ INTEL_FLASH, I28F160B3_B, 39, 8, 8, 8, 8, 8, 8, 8, 8, 64,
- 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- /* 13 */ INTEL_FLASH, I28F160B3_T, 39, 64, 64, 64, 64, 64, 64, 64,
- 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 8, 8, 8, 8, 8, 8, 8, 8,
-
- 0 /* End of list indicator */
-};
-
-/********************************************************************
-* flashInit - Initializes the FLASH memory driver`s parameters, this function
-* must be called at least once before using the FLASH memory.
-* If you are changing the FLASH base address call this function
-* again.
-*
-* INPUTS: unsigned int flashBaseAddress - The flash base Address.
-* unsigned int flashWidth - Flash bus width in Bytes: 1,2,4 or 8.
-* flashMode - PURE8, X8 or X16.
-* RETURNS: Flash Size, zero when operation (flashInit) failed.
-*********************************************************************/
-unsigned int flashInit(unsigned int flashBaseAddress,
- unsigned int flashWidth, FLASHmode flashMode)
-{
- unsigned short mfrId = 0;
- unsigned short devId = 0xffff;
- unsigned int FirstAddr, SecondAddr, ThirdAddr;
- unsigned int pArray = 0;
- unsigned int counter;
- unsigned int flashSize = 0;
-
- /* update the list with relevant parametrs */
- flashParametrs[0] = 0; /* Default initialization */
- flashParametrs[1] = flashBaseAddress;
- flashParametrs[2] = flashWidth;
- flashParametrs[3] = flashMode;
- /* Get the FLASH`s ID */
- switch (FLASH_WIDTH) {
- case 1:
- /* AMD or ST ?? * */
- if (flashMode == PURE8) { /* Boot Flash */
- FirstAddr = 0x5555;
- SecondAddr = 0x2aaa;
- ThirdAddr = 0x5555;
- } else { /* X16 device configured to 8bit Mode */
-
- FirstAddr = 0xaaaa;
- SecondAddr = 0x5555;
- ThirdAddr = 0xaaaa;
- }
- flashReset();
- WRITE_CHAR(FLASH_BASE_ADDRESS + FirstAddr, 0xAA);
- WRITE_CHAR(FLASH_BASE_ADDRESS + SecondAddr, 0x55);
- WRITE_CHAR(FLASH_BASE_ADDRESS + ThirdAddr, 0x90);
- READ_CHAR(FLASH_BASE_ADDRESS + 0x0, &mfrId);
- if (mfrId == AMD_FLASH || mfrId == ST_FLASH) {
- flashReset();
- WRITE_CHAR(FLASH_BASE_ADDRESS + FirstAddr, 0xAA);
- WRITE_CHAR(FLASH_BASE_ADDRESS + SecondAddr, 0x55);
- WRITE_CHAR(FLASH_BASE_ADDRESS + ThirdAddr, 0x90);
- READ_CHAR(FLASH_BASE_ADDRESS + 0x1, &devId);
- break;
- }
- /* Micron or Intel ?? * */
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0xff); /* Read Array */
- /* Flash reset for Intel/Micron */
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0x90); /* IDENTIFY Device */
- READ_CHAR(FLASH_BASE_ADDRESS + 0x0, &mfrId); /*Address for ManufactureID */
- if (mfrId == INTEL_FLASH || mfrId == MICRON_FLASH) {
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0xff); /* Read Array */
- /*Flash reset for Intel/Micron */
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0x90); /* IDENTIFY Device */
- READ_CHAR(FLASH_BASE_ADDRESS + 0x1, &devId); /*Address for DeviceID */
- }
- break;
- case 2:
- case 4:
- case 8:
- /* AMD or ST ??? */
- flashReset();
- WRITE_SHORT(FLASH_BASE_ADDRESS + 0x5555 * FLASH_WIDTH,
- 0xaa);
- WRITE_SHORT(FLASH_BASE_ADDRESS + 0x2aaa * FLASH_WIDTH,
- 0x55);
- WRITE_SHORT(FLASH_BASE_ADDRESS + 0x5555 * FLASH_WIDTH,
- 0x90);
- READ_SHORT(FLASH_BASE_ADDRESS, &mfrId);
- flashReset();
- /* Read the device ID */
- if (mfrId == AMD_FLASH || mfrId == ST_FLASH) {
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- 0x5555 * FLASH_WIDTH, 0xaa);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- 0x2aaa * FLASH_WIDTH, 0x55);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- 0x5555 * FLASH_WIDTH, 0x90);
- READ_SHORT(FLASH_BASE_ADDRESS + 0x1 * FLASH_WIDTH,
- &devId);
- break;
- }
- /* Micron or Intel ?? * */
- WRITE_WORD(FLASH_BASE_ADDRESS, 0x00ff00ff);
- WRITE_WORD(FLASH_BASE_ADDRESS, 0x00900090);
- if ((FLASH_WIDTH == 4) || (FLASH_WIDTH == 8)) { /* 32 or 64 bit */
- READ_SHORT(FLASH_BASE_ADDRESS, &mfrId);
- } else { /* FLASH_WIDTH = 2 */
-
- READ_SHORT(FLASH_BASE_ADDRESS, &mfrId);
- }
- if ((mfrId == INTEL_FLASH) || (mfrId == MICRON_FLASH)) {
- /* Flash reset for Intel/Micron */
- flashReset();
- WRITE_WORD(FLASH_BASE_ADDRESS, 0x00ff00ff);
- WRITE_WORD(FLASH_BASE_ADDRESS, 0x00900090);
- READ_SHORT(FLASH_BASE_ADDRESS + 0x1 * FLASH_WIDTH,
- &devId);
- }
- break;
-
- }
- /* Try to locate the device in the supported flashes list (FLASH_TYPE).
- according to the keys:
- 1) mfrId - manufactor ID.
- 2) devId - device ID.
- */
-
- while (true) {
- if (flashTypes[pArray] == 0) {
- flashReset();
- return 0; /* Device not in the list */
- }
- if ((flashTypes[pArray] == mfrId) &&
- (flashTypes[pArray + 1] == devId)) {
- POINTER_TO_FLASH = pArray;
- for (counter = 0;
- counter < flashTypes[NUMBER_OF_SECTORS];
- counter++) {
- flashSize =
- flashSize +
- flashTypes[FIRST_SECTOR_SIZE +
- counter];
- }
- if (FLASH_MODE != PURE8) {
- flashReset();
- return (flashSize * _1K *
- (FLASH_WIDTH / (FLASH_MODE / 8)));
- } else {
- flashReset();
- return (flashSize * _1K * FLASH_WIDTH);
- }
- }
- pArray += (3 + flashTypes[pArray + 2]); /* Move to next entry */
- }
-}
-
-/********************************************************************
-* flashReset - Resets the Flash memory (FLASH`s internal protocol reset).
-*
-* INTPUTS: N/A
-* OUTPUT: N/A
-*********************************************************************/
-void flashReset()
-{
- unsigned char ucData;
- unsigned short usData;
- unsigned int uiData;
-
- if ((flashTypes[POINTER_TO_FLASH] == AMD_FLASH) ||
- (flashTypes[POINTER_TO_FLASH]) == ST_FLASH) {
- if (FLASH_MODE == X16) {
- ucData = 0xf0;
- usData = 0xf0;
- uiData = 0x00f000f0;
- } else { /* case of PURE8 or X8 */
-
- ucData = 0xf0;
- usData = 0xf0f0;
- uiData = 0xf0f0f0f0;
- }
- } else {
- if (FLASH_MODE == X16) {
- ucData = 0xff;
- usData = 0xff;
- uiData = 0x00ff00ff;
- } else { /* case of PURE8 or X8 */
-
- ucData = 0xff;
- usData = 0xffff;
- uiData = 0xffffffff;
- }
- }
- switch (FLASH_WIDTH) {
- case 1:
- WRITE_CHAR(FLASH_BASE_ADDRESS, ucData);
- break;
- case 2:
- WRITE_SHORT(FLASH_BASE_ADDRESS, usData);
- break;
- case 4:
- WRITE_WORD(FLASH_BASE_ADDRESS, uiData);
- break;
- case 8:
- WRITE_WORD(FLASH_BASE_ADDRESS, uiData);
- WRITE_WORD(FLASH_BASE_ADDRESS + 0x4, uiData);
- break;
- }
-}
-
-/********************************************************************
-* flashErase - The function erases the WHOLE flash memory.
-*
-*
-* RETURNS: true on success,false on failure
-*********************************************************************/
-bool flashErase()
-{
- unsigned int totalFlashSize;
- unsigned int address;
- unsigned int readData;
- unsigned int nextSector;
-
- flashReset();
- totalFlashSize = flashGetSize();
- /* scan all flash memory space. */
- address = 0;
- while (address < totalFlashSize) {
- readData = flashReadWord(address);
- if (readData != 0xffffffff) { /* offset with dirty data. */
- flashEraseSector(flashInWhichSector(address));
- nextSector = flashInWhichSector(address) + 1;
- if (nextSector < flashTypes[NUMBER_OF_SECTORS])
- /* jump to next sector. */
- address = flashGetSectorOffset(nextSector);
- else
- /* end of erasing. */
- address = totalFlashSize;
- } else
- address += 4;
- }
- return true;
-}
-
-/********************************************************************
-* flashEraseSector - The function erases a specific sector in the flash memory.
-*
-* INPUTS: Sector number.
-* RETURNS: true on success,false on failure.
-*********************************************************************/
-bool flashEraseSector(unsigned int sectorNumber)
-{
- volatile unsigned int spin;
- unsigned int regValue;
- unsigned int sectorBaseAddress = 0;
- unsigned int i;
- unsigned int data20, dataD0, data70;
- unsigned int dataPoll;
- unsigned int FirstAddr, SecondAddr, ThirdAddr, FourthAddr,
- FifthAddr;
- unsigned int FirstData, SecondData, ThirdData;
- unsigned int FourthData, FifthData, SixthData;
-
- /* calculate the sector base Address according to the following parametrs:
- 1: FLASH_WIDTH
- 2: the size of each sector which it detailed in the table */
-
- /* checking the if the sectorNumber is legal. */
- if (sectorNumber > flashTypes[NUMBER_OF_SECTORS] - 1)
- return false;
- /* now the calculation begining of the sector Address */
- for (i = 0; i < sectorNumber; i++) {
- sectorBaseAddress =
- sectorBaseAddress + flashTypes[FIRST_SECTOR_SIZE + i];
- }
- /* In case of X8 wide the address should be */
- if (FLASH_MODE == PURE8)
- sectorBaseAddress = _1K * sectorBaseAddress;
- if (FLASH_MODE == X8)
- sectorBaseAddress = _1K * sectorBaseAddress;
- /* In case of X16 wide the address should be */
- if (FLASH_MODE == X16)
- sectorBaseAddress = _1K * sectorBaseAddress / 2;
- flashReset();
- if ((flashTypes[POINTER_TO_FLASH] == AMD_FLASH) || \
- (flashTypes[POINTER_TO_FLASH] == ST_FLASH)) {
- switch (FLASH_WIDTH) {
- case 1:
- if (FLASH_MODE == PURE8) { /* Boot Flash PURE8 */
- FirstAddr = 0x5555;
- SecondAddr = 0x2aaa;
- ThirdAddr = 0x5555;
- FourthAddr = 0x5555;
- FifthAddr = 0x2aaa;
- } else {
- FirstAddr = 0xaaaa;
- SecondAddr = 0x5555;
- ThirdAddr = 0xaaaa;
- FourthAddr = 0xaaaa;
- FifthAddr = 0x5555;
- }
- WRITE_CHAR(FLASH_BASE_ADDRESS + FirstAddr, 0xAA);
- WRITE_CHAR(FLASH_BASE_ADDRESS + SecondAddr, 0x55);
- WRITE_CHAR(FLASH_BASE_ADDRESS + ThirdAddr, 0x80);
- WRITE_CHAR(FLASH_BASE_ADDRESS + FourthAddr, 0xAA);
- WRITE_CHAR(FLASH_BASE_ADDRESS + FifthAddr, 0x55);
- WRITE_CHAR(
- (FLASH_BASE_ADDRESS +
- (sectorBaseAddress & 0xffffff00)),
- 0x30);
- /* Poll on the flash */
- do {
- READ_CHAR(FLASH_BASE_ADDRESS +
- sectorBaseAddress, ®Value);
- } while ((regValue & 0x80) != 0x80);
-
- break;
- case 2:
- if (FLASH_MODE == X16) {
- FirstData = 0xaa; /* Data for the First Cycle */
- SecondData = 0x55; /* Data for the Second Cycle */
- ThirdData = 0x80; /* Data for the Third Cycle */
- FourthData = 0xaa; /* Data for the Fourth Cycle */
- FifthData = 0x55; /* Data for the Fifth Cycle */
- SixthData = 0x30; /* Data for the Sixth Cycle */
- FirstAddr = 0x5555; /* Address for the First Cycle */
- SecondAddr = 0x2aaa; /* Address for the Second Cycle */
- ThirdAddr = 0x5555; /* Address for the Third Cycle */
- FourthAddr = 0x5555; /* Address for the Fourth Cycle */
- FifthAddr = 0x2aaa; /* Address for the Fifth Cycle */
- } else { /* (FLASH_MODE = 8) */
-
- FirstData = 0xaaaa; /* Data for the First Cycle */
- SecondData = 0x5555; /* Data for the Second Cycle */
- ThirdData = 0x8080; /* Data for the Third Cycle */
- FourthData = 0xaaaa; /* Data for the Fourth Cycle */
- FifthData = 0x5555; /* Data for the Fifth Cycle */
- SixthData = 0x3030; /* Data for the Sixth Cycle */
- FirstAddr = 0xaaaa; /* Address for the First Cycle */
- SecondAddr = 0x5555; /* Address for the Second Cycle */
- ThirdAddr = 0xaaaa; /* Address for the Third Cycle */
- FourthAddr = 0xaaaa; /* Address for the Fourth Cycle */
- FifthAddr = 0x5555; /* Address for the Fifth Cycle */
- }
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- FirstAddr * FLASH_WIDTH, FirstData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- SecondAddr * FLASH_WIDTH, SecondData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- ThirdAddr * FLASH_WIDTH, ThirdData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- FourthAddr * FLASH_WIDTH, FourthData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- FifthAddr * FLASH_WIDTH, FifthData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- (sectorBaseAddress & 0xffffff00) *
- FLASH_WIDTH, SixthData);
- /* Poll on the flash */
- if (FLASH_MODE == X16) { /* 1 device of 16 bit */
- dataPoll = 0x0080;
- } else { /* (FLASH_MODE = 8) ==> 2 devices , 8 bit each => 16bit */
-
- dataPoll = 0x8080;
- }
- do {
- READ_SHORT(FLASH_BASE_ADDRESS +
- sectorBaseAddress * FLASH_WIDTH,
- ®Value);
- for (spin = 0; spin < 100; spin++) {
- } // skranz, added spin loop.
- } while ((regValue & dataPoll) != dataPoll);
- break;
- case 4:
- if (FLASH_MODE == X16) {
- FirstData = 0x00aa00aa; /* Data for the First Cycle */
- SecondData = 0x00550055; /* Data for the Second Cycle */
- ThirdData = 0x00800080; /* Data for the Third Cycle */
- FourthData = 0x00aa00aa; /* Data for the Fourth Cycle */
- FifthData = 0x00550055; /* Data for the Fifth Cycle */
- SixthData = 0x00300030; /* Data for the Sixth Cycle */
- FirstAddr = 0x5555; /* Address for the First Cycle */
- SecondAddr = 0x2aaa; /* Address for the Second Cycle */
- ThirdAddr = 0x5555; /* Address for the Third Cycle */
- FourthAddr = 0x5555; /* Address for the Fourth Cycle */
- FifthAddr = 0x2aaa; /* Address for the Fifth Cycle */
- } else { /* if (FLASH_MODE == 8) */
-
- FirstData = 0xaaaaaaaa; /* Data for the First Cycle */
- SecondData = 0x55555555; /* Data for the Second Cycle */
- ThirdData = 0x80808080; /* Data for the Third Cycle */
- FourthData = 0xAAAAAAAA; /* Data for the Fourth Cycle */
- FifthData = 0x55555555; /* Data for the Fifth Cycle */
- SixthData = 0x30303030; /* Data for the Sixth Cycle */
- FirstAddr = 0xaaaa; /* Address for the First Cycle */
- SecondAddr = 0x5555; /* Address for the Second Cycle */
- ThirdAddr = 0xaaaa; /* Address for the Third Cycle */
- FourthAddr = 0xaaaa; /* Address for the Fourth Cycle */
- FifthAddr = 0x5555; /* Address for the Fifth Cycle */
- }
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FirstAddr * FLASH_WIDTH, FirstData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- SecondAddr * FLASH_WIDTH, SecondData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- ThirdAddr * FLASH_WIDTH, ThirdData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FourthAddr * FLASH_WIDTH, FourthData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FifthAddr * FLASH_WIDTH, FifthData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- (sectorBaseAddress & 0xffffff00) *
- FLASH_WIDTH, SixthData);
- /* Poll on the flash */
- if (FLASH_MODE == X16) { /* 4 devices , 16 bit each => 64bit */
- dataPoll = 0x00800080;
- } else { /* (FLASH_MODE = 8) ==> 8 devices , 8 bit each => 64bit */
-
- dataPoll = 0x80808080;
- }
- do {
- READ_WORD(FLASH_BASE_ADDRESS +
- sectorBaseAddress * FLASH_WIDTH,
- ®Value);
- } while ((regValue & dataPoll) != dataPoll);
- break;
- case 8: /* In case of 64bit width the transformation is 1->8 */
- if (FLASH_MODE == X16) {
- FirstData = 0x00aa00aa; /* Data for the First Cycle */
- SecondData = 0x00550055; /* Data for the Second Cycle */
- ThirdData = 0x00800080; /* Data for the Third Cycle */
- FourthData = 0x00aa00aa; /* Data for the Fourth Cycle */
- FifthData = 0x00550055; /* Data for the Fifth Cycle */
- SixthData = 0x00300030; /* Data for the Sixth Cycle */
- FirstAddr = 0x5555; /* Address for the First Cycle */
- SecondAddr = 0x2aaa; /* Address for the Second Cycle */
- ThirdAddr = 0x5555; /* Address for the Third Cycle */
- FourthAddr = 0x5555; /* Address for the Fourth Cycle */
- FifthAddr = 0x2aaa; /* Address for the Fifth Cycle */
- } else { /* (FLASH_MODE = 8 */
-
- FirstData = 0xaaaaaaaa; /* Data for the First Cycle */
- SecondData = 0x55555555; /* Data for the Second Cycle */
- ThirdData = 0x80808080; /* Data for the Third Cycle */
- FourthData = 0xAAAAAAAA; /* Data for the Fourth Cycle */
- FifthData = 0x55555555; /* Data for the Fifth Cycle */
- SixthData = 0x30303030; /* Data for the Sixth Cycle */
- FirstAddr = 0xaaaa; /* Address for the First Cycle */
- SecondAddr = 0x5555; /* Address for the Second Cycle */
- ThirdAddr = 0xaaaa; /* Address for the Third Cycle */
- FourthAddr = 0xaaaa; /* Address for the Fourth Cycle */
- FifthAddr = 0x5555; /* Address for the Fifth Cycle */
- }
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FirstAddr * FLASH_WIDTH, FirstData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- SecondAddr * FLASH_WIDTH, SecondData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- ThirdAddr * FLASH_WIDTH, ThirdData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FourthAddr * FLASH_WIDTH, FourthData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FifthAddr * FLASH_WIDTH, FifthData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- (sectorBaseAddress & 0xffffff00) *
- FLASH_WIDTH, SixthData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FirstAddr * FLASH_WIDTH + 4, FirstData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- SecondAddr * FLASH_WIDTH + 4,
- SecondData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- ThirdAddr * FLASH_WIDTH + 4, ThirdData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FourthAddr * FLASH_WIDTH + 4,
- FourthData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- FifthAddr * FLASH_WIDTH + 4, FifthData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- (sectorBaseAddress & 0xffffff00)
- * FLASH_WIDTH + 4, SixthData);
- /* Poll on the flash */
- if (FLASH_MODE == X16) { /* 4 devices , 16 bit each => 64bit */
- dataPoll = 0x00800080;
- } else { /* (FLASH_MODE = 8) ==> 8 devices , 8 bit each => 64bit */
-
- dataPoll = 0x80808080;
- }
- do {
- READ_WORD(FLASH_BASE_ADDRESS +
- sectorBaseAddress * FLASH_WIDTH,
- ®Value);
- } while ((regValue & dataPoll) != dataPoll);
- do {
- READ_WORD(FLASH_BASE_ADDRESS +
- sectorBaseAddress * FLASH_WIDTH +
- 4, ®Value);
- } while ((regValue & dataPoll) != dataPoll);
- break;
- default:
- return false;
- }
- } /* End of 'flash erase sector' for AMD/ST */
- else { /* Intel/Micron */
-
- switch (FLASH_WIDTH) {
- case 1:
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0x20);
- WRITE_CHAR(
- (FLASH_BASE_ADDRESS +
- (sectorBaseAddress & 0xffffff00)),
- 0xd0);
- /* Poll on the flash */
- while (true) {
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0x70);
- READ_CHAR(FLASH_BASE_ADDRESS, ®Value);
- if ((regValue & 0x80) == 0x80)
- break;
- }
- break;
- case 2:
- if (FLASH_MODE == X16) { /* 1 device 16 bit. */
- data20 = 0x0020;;
- dataD0 = 0x00d0;;
- } else { /* (FLASH_MODE = 8) ==> 2 devices , 8 bit each => 16bit */
-
- data20 = 0x2020;
- dataD0 = 0xd0d0;
- }
- WRITE_SHORT(FLASH_BASE_ADDRESS, data20);
- WRITE_SHORT(
- (FLASH_BASE_ADDRESS +
- ((sectorBaseAddress * 2) &
- 0xffffff00)), dataD0);
- /* Poll on the flash */
- if (FLASH_MODE == X16) {
- dataPoll = 0x0080;
- data70 = 0x0070;
- } else { /* (FLASH_MODE = 8) */
-
- dataPoll = 0x8080;
- data70 = 0x7070;
- }
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- sectorBaseAddress * 2, data70);
- READ_SHORT(FLASH_BASE_ADDRESS +
- sectorBaseAddress * 2,
- ®Value);
- if ((regValue & 0x0080) == 0x0080)
- break;
- }
- break;
- case 4:
- if (FLASH_MODE == X16) { /* 2 devices , 16 bit each => 32bit */
- data20 = 0x00200020;
- dataD0 = 0x00d000d0;
- } else { /* (FLASH_MODE = 8) ==> 4 devices , 8 bit each => 32bit */
-
- data20 = 0x20202020;
- dataD0 = 0xd0d0d0d0;
- }
- WRITE_WORD(FLASH_BASE_ADDRESS, data20);
- WRITE_WORD(
- (FLASH_BASE_ADDRESS +
- ((sectorBaseAddress * 4) &
- 0xffffff00)), dataD0);
- /* Poll on the flash */
- if (FLASH_MODE == X16) {
- dataPoll = 0x0080;
- data70 = 0x0070;
- } else { /* (FLASH_MODE = 8) */
-
- dataPoll = 0x8080;
- data70 = 0x7070;
- }
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS, data70);
- READ_SHORT(FLASH_BASE_ADDRESS, ®Value);
- if ((regValue & dataPoll) == dataPoll)
- break;
- }
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS + 2,
- data70);
- READ_SHORT(FLASH_BASE_ADDRESS + 2,
- ®Value);
- if ((regValue & dataPoll) == dataPoll)
- break;
- }
- break;
- case 8:
- if (FLASH_MODE == X16) { /* 4 devices , 16 bit each => 64bit */
- data20 = 0x00200020;
- dataD0 = 0x00d000d0;
- } else { /* (FLASH_MODE = 8) ==> 8 devices , 8 bit each => 64bit */
-
- data20 = 0x20202020;
- dataD0 = 0xd0d0d0d0;
- }
- WRITE_WORD(FLASH_BASE_ADDRESS, data20);
- WRITE_WORD(
- (FLASH_BASE_ADDRESS +
- ((sectorBaseAddress * 8) &
- 0xffffff00)), dataD0);
- WRITE_WORD(FLASH_BASE_ADDRESS + 4, data20);
- WRITE_WORD(
- (FLASH_BASE_ADDRESS +
- ((sectorBaseAddress * 8) & 0xffffff00 +
- 4)), dataD0);
- /* Poll on the flash */
- if (FLASH_MODE == X16) {
- dataPoll = 0x0080;
- data70 = 0x0070;
- } else { /* (FLASH_MODE = 8) */
-
- dataPoll = 0x8080;
- data70 = 0x7070;
- }
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- sectorBaseAddress * 8, data70);
- READ_SHORT(FLASH_BASE_ADDRESS +
- sectorBaseAddress * 8,
- ®Value);
- if ((regValue & dataPoll) == dataPoll)
- break;
- }
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS + 2,
- data70);
- READ_SHORT(FLASH_BASE_ADDRESS + 2,
- ®Value);
- if ((regValue & dataPoll) == dataPoll)
- break;
- }
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS + 4,
- data70);
- READ_SHORT(FLASH_BASE_ADDRESS + 4,
- ®Value);
- if ((regValue & dataPoll) == dataPoll)
- break;
- }
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS + 6,
- data70);
- READ_SHORT(FLASH_BASE_ADDRESS + 6,
- ®Value);
- if ((regValue & dataPoll) == dataPoll)
- break;
- }
- break;
- default:
- return false;
- }
- }
- flashReset();
- return true;
-}
-
-/********************************************************************
-* flashWriteWord - Write 32Bit to the FLASH memory at the given offset from the
-* FLASH base address.
-* address 0 = 0x00000000 !!
-* Attention!!! data "0" cannot be programed back to
-* "1" (only by first performing an earase operation).
-* The function takes care of Big/Little endian conversion
-*
-* INPUTS: offset - The offset from the flash`s base address.
-* data - The data that should be written.
-* RETURNS: true on success,false on failure
-*********************************************************************/
-bool flashWriteWord(unsigned int offset, unsigned int data)
-{
- unsigned char c, rc;
- unsigned short s, rs;
- register unsigned int rw;
- register unsigned int regValue;
- register unsigned int FirstAddr, SecondAddr, ThirdAddr;
- register unsigned int FirstData, SecondData, ThirdData;
- register unsigned int data10, data20, data70, data80;
-
- if ((flashTypes[POINTER_TO_FLASH] == AMD_FLASH) || \
- (flashTypes[POINTER_TO_FLASH] == ST_FLASH)) {
- switch (FLASH_WIDTH) {
- case 1: /* Split the 32 bit write into four 8bit Writings */
- if (FLASH_MODE == PURE8) { /* Boot Flash */
- FirstAddr = 0x5555;
- SecondAddr = 0x2aaa;
- ThirdAddr = 0x5555;
- } else {
- FirstAddr = 0xaaaa;
- SecondAddr = 0x5555;
- ThirdAddr = 0xaaaa;
- }
- WRITE_CHAR(FLASH_BASE_ADDRESS + FirstAddr, 0xaa);
- WRITE_CHAR(FLASH_BASE_ADDRESS + SecondAddr, 0x55);
- WRITE_CHAR(FLASH_BASE_ADDRESS + ThirdAddr, 0xa0);
-#ifdef BE
- c = (data >> 24);
-#else
- c = data;
-#endif
- WRITE_CHAR(FLASH_BASE_ADDRESS + offset, c);
- /* Writing first Byte */
- while (true) {
- READ_CHAR(FLASH_BASE_ADDRESS + offset,
- &rc);
- if ((rc & 0x80) == (c & 0x80)) /* DQ7 =? DATA */
- break; /* DQ7 = DATA */
- if ((rc & 0x20) == 0x20) { /* DQ5 =? '1' */
- READ_CHAR(FLASH_BASE_ADDRESS +
- offset, &rc);
- if ((rc & 0x80) == (c & 0x80))
- break; /* DQ7 = DATA */
- else
- return false; /* DQ7 != DATA */
- }
- }
- WRITE_CHAR(FLASH_BASE_ADDRESS + FirstAddr, 0xaa);
- WRITE_CHAR(FLASH_BASE_ADDRESS + SecondAddr, 0x55);
- WRITE_CHAR(FLASH_BASE_ADDRESS + ThirdAddr, 0xa0);
-#ifdef BE
- c = (data >> 16);
-#else
- c = (data >> 8);
-#endif
- WRITE_CHAR(FLASH_BASE_ADDRESS + offset + 1, c);
- /* Writing second Byte */
- while (true) {
- READ_CHAR(FLASH_BASE_ADDRESS + offset + 1,
- &rc);
- if ((rc & 0x80) == (c & 0x80)) /* DQ7 =? DATA */
- break; /* DQ7 = DATA */
- if ((rc & 0x20) == 0x20) { /* DQ5 =? '1' */
- READ_CHAR(FLASH_BASE_ADDRESS +
- offset + 1, &rc);
- if ((rc & 0x80) == (c & 0x80))
- break; /* DQ7 = DATA */
- else
- return false; /* DQ7 != DATA */
- }
- }
- WRITE_CHAR(FLASH_BASE_ADDRESS + FirstAddr, 0xaa);
- WRITE_CHAR(FLASH_BASE_ADDRESS + SecondAddr, 0x55);
- WRITE_CHAR(FLASH_BASE_ADDRESS + ThirdAddr, 0xa0);
-#ifdef BE
- c = (data >> 8);
-#else
- c = (data >> 16);
-#endif
- WRITE_CHAR(FLASH_BASE_ADDRESS + offset + 2, c);
- /* Writing third Byte */
- while (true) {
- READ_CHAR(FLASH_BASE_ADDRESS + offset + 2,
- &rc);
- if ((rc & 0x80) == (c & 0x80)) /* DQ7 =? DATA */
- break; /* DQ7 = DATA */
- if ((rc & 0x20) == 0x20) { /* DQ5 =? '1' */
- READ_CHAR(FLASH_BASE_ADDRESS +
- offset + 2, &rc);
- if ((rc & 0x80) == (c & 0x80))
- break; /* DQ7 = DATA */
- else
- return false; /* DQ7 != DATA */
- }
- }
- WRITE_CHAR(FLASH_BASE_ADDRESS + FirstAddr, 0xaa);
- WRITE_CHAR(FLASH_BASE_ADDRESS + SecondAddr, 0x55);
- WRITE_CHAR(FLASH_BASE_ADDRESS + ThirdAddr, 0xa0);
-#ifdef BE
- c = data;
-#else
- c = (data >> 24);
-#endif
- WRITE_CHAR(FLASH_BASE_ADDRESS + offset + 3, c);
- /* Writing fourth Byte */
- while (true) {
- READ_CHAR(FLASH_BASE_ADDRESS + offset + 3,
- &rc);
- if ((rc & 0x80) == (c & 0x80)) /* DQ7 =? DATA */
- break; /* DQ7 = DATA */
- if ((rc & 0x20) == 0x20) { /* DQ5 =? '1' */
- READ_CHAR(FLASH_BASE_ADDRESS +
- offset + 3, &rc);
- if ((rc & 0x80) == (c & 0x80))
- break; /* DQ7 = DATA */
- else
- return false; /* DQ7 != DATA */
- }
- }
- break;
- case 2: /* Split the 32 bit write into two 8/16 bit Writings
- (16bit width). */
- if (FLASH_MODE == X16) {
- FirstData = 0xaa; /* Data for the First Cycle */
- SecondData = 0x55; /* Data for the Second Cycle */
- ThirdData = 0xa0; /* Data for the Third Cycle */
- FirstAddr = 0x5555; /* Address for the First Cycle */
- SecondAddr = 0x2aaa; /* Address for the Second Cycle */
- ThirdAddr = 0x5555; /* Address for the Third Cycle */
- } else { /* if (FLASH_MODE == 8) */
-
- FirstData = 0xaaaa; /* Data for the First Cycle */
- SecondData = 0x5555; /* Data for the Second Cycle */
- ThirdData = 0xa0a0; /* Data for the Third Cycle */
- FirstAddr = 0xaaaa; /* Address for the First Cycle */
- SecondAddr = 0x5555; /* Address for the Second Cycle */
- ThirdAddr = 0xaaaa; /* Address for the Third Cycle */
- }
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- FirstAddr * FLASH_WIDTH, FirstData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- SecondAddr * FLASH_WIDTH, SecondData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- ThirdAddr * FLASH_WIDTH, ThirdData);
-#ifdef BE
- s = (data >> 16);
-#else
- s = data;
-#endif
- WRITE_SHORT(FLASH_BASE_ADDRESS + offset, s);
- /* Writing Two Bytes */
- if (FLASH_MODE == X16) {
- data80 = 0x80;;
- data20 = 0x20;;
- } else { /* if (FLASH_MODE == 8) */
-
- data80 = 0x8080;
- data20 = 0x2020;
- }
- while (true) {
- READ_SHORT(FLASH_BASE_ADDRESS + offset,
- &rs);
- if ((rs & data80) == (s & data80)) /* DQ7 =? DATA */
- break; /* DQ7 = DATA */
- if ((rs & data20) == data20) { /* DQ5 =? DATA */
- READ_SHORT(FLASH_BASE_ADDRESS +
- offset, &rs);
- if ((rs & data80) == (s & data80))
- break; /* DQ7 = DATA */
- else {
- flashReset();
- return false; /* DQ7 != DATA */
- }
- }
- }
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- FirstAddr * FLASH_WIDTH, FirstData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- SecondAddr * FLASH_WIDTH, SecondData);
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- ThirdAddr * FLASH_WIDTH, ThirdData);
-#ifdef BE
- s = data;
-#else
- s = (data >> 16);
-#endif
- WRITE_SHORT(FLASH_BASE_ADDRESS + offset + 2, s);
- /* Writing Two Bytes */
- while (true) {
- READ_SHORT(FLASH_BASE_ADDRESS + offset + 2,
- &rs);
- if ((rs & data80) == (s & data80)) /* DQ7 =? DATA */
- break; /* DQ7 = DATA */
- if ((rs & data20) == data20) { /* DQ5 =? '1' */
- READ_SHORT(FLASH_BASE_ADDRESS +
- offset + 2, &rs);
- if ((rs & data80) == (s & data80))
- break; /* DQ7 = DATA */
- else {
- flashReset();
- return false; /* DQ7 != DATA */
- }
- }
- }
- return true;
- case 4:
- case 8:
- if (FLASH_MODE == X16) {
- FirstData = 0x00aa00aa;
- SecondData = 0x00550055;
- ThirdData = 0x00a000a0;
- FirstAddr = 0x5555;
- SecondAddr = 0x2aaa;
- ThirdAddr = 0x5555;
- } else { /* (FLASH_MODE == 8) */
-
- FirstData = 0xaaaaaaaa; /* Data for the First Cycle */
- SecondData = 0x55555555; /* Data for the Second Cycle */
- ThirdData = 0xa0a0a0a0; /* Data for the Third Cycle */
- FirstAddr = 0xaaaaaaaa; /* Address for the First Cycle */
- SecondAddr = 0x55555555; /* Address for the Second Cycle */
- ThirdAddr = 0xaaaaaaaa; /* Address for the Third Cycle */
- }
- WRITE_WORD(FLASH_BASE_ADDRESS + FirstAddr *
- FLASH_WIDTH + offset % FLASH_WIDTH,
- FirstData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- SecondAddr * FLASH_WIDTH +
- offset % FLASH_WIDTH, SecondData);
- WRITE_WORD(FLASH_BASE_ADDRESS +
- ThirdAddr * FLASH_WIDTH +
- offset % FLASH_WIDTH, ThirdData);
- /* writting the word. */
- WRITE_WORD(FLASH_BASE_ADDRESS + offset, data);
- /* preparing the polling patterns. */
- if (FLASH_MODE == X16) {
- data80 = 0x00800080;
- data20 = 0x00200020;
- } else { /* (FLASH_MODE == 8) */
-
- data80 = 0x80808080;
- data20 = 0x20202020;
- }
- while (true) { /* polling loop. */
- rw = READWORD(FLASH_BASE_ADDRESS + offset);
- /* DQ7 =? DATA */
- if ((rw & data80) == (data & data80))
- break; /* DQ7 = DATA */
- if ((rw & data20) == data20) { /* DQ5 =? '1' */
- rw =
- READWORD(FLASH_BASE_ADDRESS +
- offset);
- if ((rw & data80) ==
- (data & data80)) break; /* DQ7 = DATA */
- else
- return false; /* DQ7 != DATA */
- }
- }
- return true;
- default:
- return false; /* case of invalid flash Width. */
- }
- } else { /* Intel/Micron */
-
- switch (FLASH_WIDTH) {
- case 1:
- /* Writing First Byte */
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0x10);
-#ifdef BE
- c = (data >> 24);
-#else
- c = data;
-#endif
- WRITE_CHAR(FLASH_BASE_ADDRESS + offset, c);
- while (true) {
- /* Reading STATUS Register */
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0x70);
- regValue = READCHAR(FLASH_BASE_ADDRESS);
- if ((regValue & 0x80) == 0x80)
- break; /* Case of Write-Operation had Ended */
- }
- /* Reading STATUS Register for Writing Verification */
- WRITE_CHAR(FLASH_BASE_ADDRESS, 0x70);
- regValue = READCHAR(FLASH_BASE_ADDRESS);
- if ((regValue & 0x10) == 0x10)
- return false; /* Write failure */
-
- /* Writing Second Byte */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 1, 0x10);
-#ifdef BE
- c = (data >> 16);
-#else
- c = (data >> 8);
-#endif
- WRITE_CHAR(FLASH_BASE_ADDRESS + offset + 1, c);
- while (true) {
- /* Reading STATUS Register */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 1, 0x70);
- regValue =
- READCHAR(FLASH_BASE_ADDRESS + 1);
- if ((regValue & 0x80) == 0x80)
- break; /* Write operation ended */
- }
- /* Reading STATUS Register for Writing verification */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 1, 0x70);
- regValue = READCHAR(FLASH_BASE_ADDRESS + 1);
- if ((regValue & 0x10) == 0x10)
- return false; /* Write failure */
-
- /* Writing Third Byte */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 2, 0x10);
-#ifdef BE
- c = (data >> 8);
-#else
- c = (data >> 16);
-#endif
- WRITE_CHAR(FLASH_BASE_ADDRESS + offset + 2, c);
- while (true) {
- /* Reading STATUS Register */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 2, 0x70);
- regValue =
- READCHAR(FLASH_BASE_ADDRESS + 2);
- if ((regValue & 0x80) == 0x80)
- break; /* Write operation ended */
- }
- /* Reading STATUS Register for Writing Verification */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 2, 0x70);
- regValue = READCHAR(FLASH_BASE_ADDRESS + 2);
- if ((regValue & 0x10) == 0x10)
- return false; /* Write failure */
-
- /* Writing Fourth Byte */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 3, 0x10);
-#ifdef BE
- c = data;
-#else
- c = (data >> 24);
-#endif
- WRITE_CHAR(FLASH_BASE_ADDRESS + offset + 3, c);
- while (true) {
- /* Reading STATUS Register */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 3, 0x70);
- regValue =
- READCHAR(FLASH_BASE_ADDRESS + 3);
- if ((regValue & 0x80) == 0x80)
- break; /* Write operation ended */
- }
- /* Reading STATUS Register for Writing Verification */
- WRITE_CHAR(FLASH_BASE_ADDRESS + 3, 0x70);
- regValue = READCHAR(FLASH_BASE_ADDRESS + 3);
- if ((regValue & 0x10) == 0x10)
- return false; /* Write failure */
- flashReset();
- return true;
- case 2:
- if (FLASH_MODE == X16) { /* Case of one X16 bit device */
- FirstData = 0x0010; /* Data for the First Cycle */
- } else { /* if (FLASH_MODE == 8) ==> Case of two X8 bit devices */
-
- FirstData = 0x1010; /* Data for the First Cycle */
- }
- /* Writing First two Bytes */
- WRITE_SHORT(FLASH_BASE_ADDRESS, FirstData);
-#ifdef BE
- s = (data >> 16);
-#else
- s = data;
-#endif
- WRITE_SHORT(FLASH_BASE_ADDRESS + offset, s);
- if (FLASH_MODE == X16) {
- data70 = 0x0070;
- data80 = 0x0080;
- data10 = 0x0010;
- } else { /* case of (FLASH_MODE == X8) */
-
- data70 = 0x7070;
- data80 = 0x8080;
- data10 = 0x1010;
- }
- /* polling on writing action => when done break. */
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS, data70);
- regValue = READSHORT(FLASH_BASE_ADDRESS);
- if ((regValue & data80) == data80)
- break;
- }
- /* Reading STATUS Register for Writing Verification */
- WRITE_CHAR(FLASH_BASE_ADDRESS, data70);
- regValue = READCHAR(FLASH_BASE_ADDRESS);
- if ((regValue & data10) == data10)
- return false; /* Write failure */
- /* Writing Last two Bytes */
- WRITE_SHORT(FLASH_BASE_ADDRESS + 2, FirstData);
-#ifdef BE
- s = data;
-#else
- s = (data >> 16);
-#endif
- WRITE_SHORT(FLASH_BASE_ADDRESS + offset + 2, s);
- /* polling on writing action => when done break. */
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS + 2,
- data70);
- regValue =
- READSHORT(FLASH_BASE_ADDRESS + 2);
- if ((regValue & data80) == data80)
- break;
- }
- /* Reading STATUS Register for Writing Verification */
- WRITE_CHAR(FLASH_BASE_ADDRESS, data70);
- regValue = READCHAR(FLASH_BASE_ADDRESS);
- if ((regValue & data10) == data10)
- return false; /* Write failure */
- flashReset();
- return true;
- case 4:
- case 8:
- if (FLASH_MODE == X16) { /* Case of one X16 bit device */
- FirstData = 0x00100010; /* Data for the First Cycle */
- } else { /* (FLASH_MODE == 8) ==> Case of two X8 bit devices */
-
- FirstData = 0x10101010; /* Data for the First Cycle */
- }
- /* Writing First two Bytes */
- WRITE_WORD(FLASH_BASE_ADDRESS +
- offset % FLASH_WIDTH, FirstData);
-#ifdef BE
- s = (data >> 16);
-#else
- s = data;
-#endif
- /* writing the 32-bit data to flash. */
- WRITE_WORD(FLASH_BASE_ADDRESS + offset, data);
- if (FLASH_MODE == X16) {
- data70 = 0x0070;
- data80 = 0x0080;
- data10 = 0x0010;
- } else { /* (FLASH_MODE == 8) */
-
- data70 = 0x7070;
- data80 = 0x8080;
- data10 = 0x1010;
- }
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- offset % FLASH_WIDTH, data70);
- regValue = READSHORT(FLASH_BASE_ADDRESS);
- if ((regValue & data80) == data80)
- break;
- }
- /* Reading STATUS Register for Writing Verification */
- WRITE_CHAR(FLASH_BASE_ADDRESS, data70);
- regValue = READCHAR(FLASH_BASE_ADDRESS);
- if ((regValue & data10) == data10)
- return false; /* Write failure */
-
- /* Writing Last two Bytes */
-#ifdef BE
- s = data;
-#else
- s = (data >> 16);
-#endif
- while (true) {
- WRITE_SHORT(FLASH_BASE_ADDRESS +
- offset % FLASH_WIDTH + 2,
- data70);
- regValue =
- READSHORT(FLASH_BASE_ADDRESS +
- offset % FLASH_WIDTH + 2);
- if ((regValue & data80) == data80)
- break;
- }
- /* Reading STATUS Register for Writing Verification */
- WRITE_CHAR(FLASH_BASE_ADDRESS, data70);
- regValue = READCHAR(FLASH_BASE_ADDRESS);
- if ((regValue & data10) == data10)
- return false; /* Write failure */
-
- flashReset();
- return true;
- default:
- flashReset();
- return false;
- }
- }
- flashReset();
- return true;
-}
-
-/********************************************************************
-* flashReadWord - Read 32Bit from the FLASH memory at a given offset
-* from the FLASH base address.
-* address 0 = 0x00000000 !!
-* The function takes care of Big/Little endian conversion
-* INPUTS: offset,the offset from the flash`s base address
-* RETURNS: data
-*********************************************************************/
-unsigned int flashReadWord(unsigned int offset)
-{
- unsigned int regValue;
- flashReset();
- READ_WORD(FLASH_BASE_ADDRESS + offset, ®Value);
- return regValue;
-}
-
-/********************************************************************
-* flashInWhichSector - Returns the sector`s number at which offset is at.
-*
-* INPUTS: Offset
-* RETURNS: Sector number,or 0xffffffff in case the address is out of range or
-* flash wasn't initialize.
-*********************************************************************/
-unsigned int flashInWhichSector(unsigned int offset)
-{
- unsigned int sectorNumber, numberOfDevices;
- unsigned int accMemory = 0;
-
- if ((FLASH_MODE == PURE8) || (FLASH_MODE == X8)) {
- numberOfDevices = FLASH_WIDTH;
- } else { /* X16 mode */
-
- numberOfDevices = FLASH_WIDTH / 2;
- }
- for (sectorNumber = 0;
- sectorNumber < flashTypes[NUMBER_OF_SECTORS]; sectorNumber++) {
- accMemory =
- accMemory + flashTypes[FIRST_SECTOR_SIZE +
- sectorNumber];
- if (offset < accMemory * numberOfDevices * 1024)
- return sectorNumber;
- }
- return 0xffffffff;
-}
-
-/********************************************************************
-* flashGetSectorSize - When given a Valid sector Number returns its Size.
-*
-* INPUTS: unsigned int sectorNumber.
-* RETURNS: Sector size. (if Sector number isn't valid or flash wasn't
-* initialize return 0.)
-*********************************************************************/
-unsigned int flashGetSectorSize(unsigned int sectorNumber)
-{
- if (sectorNumber >= flashTypes[NUMBER_OF_SECTORS])
- return 0;
- else {
- if (FLASH_MODE != PURE8)
- return (flashTypes
- [FIRST_SECTOR_SIZE +
- sectorNumber] * _1K * (FLASH_WIDTH * 8 /
- FLASH_MODE));
- else /* in case of PUR8 */
- return (flashTypes
- [FIRST_SECTOR_SIZE +
- sectorNumber] * _1K * FLASH_WIDTH);
- }
-}
-
-/********************************************************************
-* getFlashSize - Return Total flash size.
-*
-* INPUTS: N/A.
-* RETURNS: Flash size. (If flash wasn't initialize return 0)
-*********************************************************************/
-unsigned int flashGetSize()
-{
- unsigned int sectorNum;
- unsigned int totalSize = 0;
-
- if (POINTER_TO_FLASH == 0)
- return 0; /* case of flash not initialize */
- for (sectorNum = 0; sectorNum < flashTypes[NUMBER_OF_SECTORS];
- sectorNum++) {
- totalSize += flashGetSectorSize(sectorNum);
- }
- return (totalSize);
-
-}
-
-/********************************************************************
-* flashGetSectorOffset - Returns sector base address.
-*
-* INPUTS: unsigned int sectorNum.
-* RETURNS: Sector Base Address.
-*********************************************************************/
-unsigned int flashGetSectorOffset(unsigned int sectorNum)
-{
- unsigned int i;
- unsigned int sectorBaseAddress = 0;
- unsigned int numOfDevices;
-
- if (sectorNum > (flashParametrs[NUMBER_OF_SECTORS] - 1))
- return 0xffffffff;
- for (i = 0; i < sectorNum; i++) {
- sectorBaseAddress =
- sectorBaseAddress + flashTypes[FIRST_SECTOR_SIZE + i];
- }
- if (FLASH_MODE == X16)
- numOfDevices = FLASH_WIDTH * 8 / FLASH_MODE;
- else
- numOfDevices = FLASH_WIDTH;
- return (_1K * sectorBaseAddress * numOfDevices);
-
-}
-
-/********************************************************************
-* flashWriteBlock - Write block of chars to flash.
-*
-* INPUTS: unsigned int offset - flash destination address.
-* unsigned int numOfByte - block size.
-* unsigned char * blockAddress - block source address.
-* RETURNS: Number of Bytes written.
-*********************************************************************/
-unsigned int flashWriteBlock(unsigned int offset, unsigned int numOfByte,
- unsigned char *blockAddress)
-{
- register unsigned int flashWrite;
- register unsigned int align;
- register unsigned int num;
- register unsigned int i;
-
- if ((offset + numOfByte) > flashGetSize())
- numOfByte = flashGetSize() - offset; /* getting to flash boundary. */
- num = numOfByte;
- align = offset % 4; /* alignment toward flash. */
- /* writes chars until the offset toward flash will be align. */
- for (i = align; (i < 4) && (numOfByte > 0) && (align != 0); i++) {
- flashWriteChar(offset, blockAddress[0]);
- numOfByte--;
- offset++;
- blockAddress++;
- }
- while (numOfByte > 3) {
-#ifdef LE
- flashWrite = blockAddress[0] | (blockAddress[1] << 8) |
- (blockAddress[2] << 16) | (blockAddress[3] << 24);
-#else
- flashWrite = blockAddress[3] | (blockAddress[2] << 8) |
- (blockAddress[1] << 16) | (blockAddress[0] << 24);
-#endif
- if (flashWrite != 0xffffffff) /* for optimization. */
- flashWriteWord(offset, flashWrite);
- numOfByte -= 4;
- blockAddress += 4;
- offset += 4;
- }
- while (numOfByte > 0) {
- flashWriteChar(offset, blockAddress[0]);
- numOfByte--;
- blockAddress++;
- offset++;
- }
- return num;
-}
-
-/********************************************************************
-* flashReadBlock - Read block of chars from flash.
-*
-* INPUTS: unsigned int offset - flash source address.
-* unsigned int numOfByte - block size.
-* unsigned char * blockAddress - block destination address.
-* RETURNS: Number of Bytes written.
-*********************************************************************/
-unsigned int flashReadBlock(unsigned int offset, unsigned int numOfByte,
- unsigned char *blockAddress)
-{
- unsigned int i;
- for (i = 0; i < numOfByte; i++) {
- blockAddress[i] = flashReadChar(offset + i);
- }
- return numOfByte;
-}
-
-/********************************************************************
-* flashReadChar - read one charecter form given flash offset.
-*
-* INPUTS: unsigned int offset - required offset to be read from.
-* RETURNS: read charecter.
-*********************************************************************/
-unsigned char flashReadChar(unsigned int offset)
-{
- unsigned char regValue;
-
- flashReset();
- READ_CHAR(FLASH_BASE_ADDRESS + offset, ®Value);
- return regValue;
-}
-
-/********************************************************************
-* flashReadShort - read 16bit form given flash offset.
-*
-* INPUTS: unsigned int offset - required offset to be read from.
-* RETURNS: 16bit data.
-*********************************************************************/
-unsigned short flashReadShort(unsigned int offset)
-{
- unsigned short regValue;
-
- flashReset();
- READ_SHORT(FLASH_BASE_ADDRESS + offset, ®Value);
- return regValue;
-}
-
-/********************************************************************
-* flashWriteShort - write 16bit data to a given flash offset.
-* It reads the whole word 32bit wide, modify the short
-* and write back the word.
-*
-* INPUTS: unsigned int offset - required offset to be write to.
-* unsigned short sdata - data to be written.
-* RETURNS: true if writting successesed false otherwise.
-*********************************************************************/
-bool flashWriteShort(unsigned int offset, unsigned short sdata)
-{
- unsigned int align;
- unsigned int flashWrite;
- unsigned int flashRead;
-
- align = offset % 4;
- if ((align == 1) || (align == 3))
- return false; /* offset misaligned. */
- flashRead = flashReadWord(offset - align);
- if (align == 0)
-#ifdef BE
- flashWrite = (flashRead & 0x0000ffff) | (sdata << 16);
-#else
- flashWrite = (flashRead & 0xffff0000) | sdata;
-#endif
- else /* (align == 2) */
-#ifdef BE
- flashWrite = (flashRead & 0xffff0000) | sdata;
-#else
- flashWrite = (flashRead & 0x0000ffff) | (sdata << 16);
-#endif
- flashWriteWord(offset - align, flashWrite);
- return true;
-
-}
-
-/********************************************************************
-* flashWriteChar - write one charecter (8 bit) to a given flash offset.
-* It reads the whole word 32bit wide, modify the charecter
-* and write back the word.
-*
-* INPUTS: unsigned int offset - required offset to be write to.
-* unsigned short sdata - data to be written.
-* RETURNS: true if writting successed.
-*********************************************************************/
-bool flashWriteChar(unsigned int offset, unsigned char cdata)
-{
- unsigned int align;
- unsigned int flashWrite;
- unsigned int flashRead;
-
- align = offset % 4;
- flashRead = flashReadWord(offset - align);
-#ifdef BE
- flashWrite = (flashRead & ~(0xff000000 >> (8 * align))) |
- (cdata << (8 * (3 - align)));
-#else
- flashWrite = (flashRead & ~(0xff000000 << (8 * align))) |
- (cdata << (8 * align));
-#endif
- flashWriteWord(offset - align, flashWrite);
- return true;
-}
-
-/********************************************************************
-* flashGetNumOfSectors - write one charecter (8 bit) to a given flash offset.
-* It reads the whole word 32bit wide, modify the
-* charecter and write back the word.
-*
-* INPUTS: N/A.
-* RETURNS: Number of sectors.
-*********************************************************************/
-unsigned int flashGetNumOfSectors(void)
-{
- return (flashTypes[NUMBER_OF_SECTORS]);
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/galileo_port.h linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/galileo_port.h
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/galileo_port.h 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/galileo_port.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#define GFP_KERNEL 0
-#define GFP_ATOMIC 1
-#define KERN_ERR ""
-
-void *kmalloc(unsigned int, int);
-void *memset(void *, char, unsigned int);
-int memcmp(char *, char *, unsigned int);
-void *memcpy(void *to, const void *from, unsigned int);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/gt64011.h linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/gt64011.h
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/gt64011.h 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/gt64011.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,279 +0,0 @@
-/*
- * gt64011.h: Galileo PCI system controller
- * Copyright (c) 1998 Algorithmics Ltd
- */
-
-#ifdef __ASSEMBLY__
-
-/* offsets from base register */
-#define GT64011(x) (x)
-
-/* device is littleendian, so data may need to be swapped */
-#ifdef GALILEO_PORT
-#define htoll(x) ((((x) & 0x00ff) << 24) | \
- (((x) & 0xff00) << 8) | \
- (((x) >> 8) & 0xff00) | \
- (((x) >> 24) & 0x00ff))
-/*#define ltohl(x) htoll(x)*/
-#else
-#define htoll(x) (x)
-/* #define ltohl(x) (x) */
-#endif
-
-#else /* !__ASSEMBLY__ */
-
-/* offsets from base pointer, this construct allows optimisation */
-static char *const _gt64011p = (char *) PA_TO_KVA1(GT64011_BASE);
-
-#define GT64011(x) *(volatile unsigned long *)(_gt64011p + (x))
-
-/* device is littleendian, so data may need to be swapped */
-#ifdef GALILEO_PORT
-#define htoll(x) ({ \
- unsigned int v = (unsigned int)(x); \
- v = (((v & 0x00ff) << 24) | \
- ((v & 0xff00) << 8) | \
- ((v >> 8) & 0xff00) | \
- ((v >> 24) & 0x00ff)); \
- v; \
- })
-#define ltohl(x) htoll(x)
-
-#else
-asjdsajd
-#define htoll(x) (x)
-#define ltohl(x) (x)
-#endif
-#endif /* __ASSEMBLY__ */
-/* CPU configuration */
-#define GT_CPU_CFG GT64011(0x000)
-#define GT_CPU_CFG_WriteMode (1<<11)
-#define GT_CPU_CFG_Endianess (1<<12)
-/* Processor Address Space */
-#define GT_PAS_RAS10LO GT64011(0x008)
-#define GT_PAS_RAS10HI GT64011(0x010)
-#define GT_PAS_RAS32LO GT64011(0x018)
-#define GT_PAS_RAS32HI GT64011(0x020)
-#define GT_PAS_CS20LO GT64011(0x028)
-#define GT_PAS_CS20HI GT64011(0x030)
-#define GT_PAS_CS3BOOTLO GT64011(0x038)
-#define GT_PAS_CS3BOOTHI GT64011(0x040)
-#define GT_PAS_PCIIOLO GT64011(0x048)
-#define GT_PAS_PCIIOHI GT64011(0x050)
-#define GT_PAS_PCIMEMLO GT64011(0x058)
-#define GT_PAS_PCIMEMHI GT64011(0x060)
-#define GT_PAS_INTDEC GT64011(0x068)
-#define GT_PAS_BUSERRLO GT64011(0x070)
-#define GT_PAS_PCIMEM1LO GT64011(0x080)
-#define GT_PAS_PCIMEM1HI GT64011(0x088)
-#define GT_PAS_LOMASK_Low 0x7ff
-#define GT_PAS_LOSHIFT_Low 0
-#define GT_PAS_HIMASK_High 0x07f
-#define GT_PAS_HISHIFT_High 0
-/* DRAM and Device Address Space */
-#define GT_DDAS_RAS0LO GT64011(0x400)
-#define GT_DDAS_RAS0HI GT64011(0x404)
-#define GT_DDAS_RAS1LO GT64011(0x408)
-#define GT_DDAS_RAS1HI GT64011(0x40c)
-#define GT_DDAS_RAS2LO GT64011(0x410)
-#define GT_DDAS_RAS2HI GT64011(0x414)
-#define GT_DDAS_RAS3LO GT64011(0x418)
-#define GT_DDAS_RAS3HI GT64011(0x41c)
-#define GT_DDAS_CS0LO GT64011(0x420)
-#define GT_DDAS_CS0HI GT64011(0x424)
-#define GT_DDAS_CS1LO GT64011(0x428)
-#define GT_DDAS_CS1HI GT64011(0x42c)
-#define GT_DDAS_CS2LO GT64011(0x430)
-#define GT_DDAS_CS2HI GT64011(0x434)
-#define GT_DDAS_CS3LO GT64011(0x438)
-#define GT_DDAS_CS3HI GT64011(0x43c)
-#define GT_DDAS_BOOTCSLO GT64011(0x440)
-#define GT_DDAS_BOOTCSHI GT64011(0x444)
-#define GT_DDAS_ERROR GT64011(0x470)
-#define GT_DDAS_LOMASK_Low 0xff
-#define GT_DDAS_LOSHIFT_Low 0
-#define GT_DDAS_HIMASK_High 0xff
-#define GT_DDAS_HISHIFT_High 0
-/* DRAM Configuration */
-#define GT_DRAM_CFG GT64011(0x448)
-#define GT_DRAM_CFG_RefIntCntMASK 0x00003fff
-#define GT_DRAM_CFG_RefIntCntSHIFT 0
-#define GT_DRAM_CFG_RefIntCnt(x) (((x)<<GT_DRAM_CFG_RefIntCntSHIFT)&\
- GT_DRAM_CFG_RefIntCntMASK)
-#define GT_DRAM_CFG_StagRef (1<<16)
-#define GT_DRAM_CFG_StagRefOn 0
-#define GT_DRAM_CFG_StagRefAll GT_DRAM_CFG_StagRef
-#define GT_DRAM_CFG_ADSFunct (1<<17)
-#define GT_DRAM_CFG_ADSFunctDRAM 0
-#define GT_DRAM_CFG_ADSFunctOnly GT_DRAM_CFG_ADSFunct
-#define GT_DRAM_CFG_DRAMLatch (1<<18)
-#define GT_DRAM_CFG_DRAMLatchActive 0
-#define GT_DRAM_CFG_DRAMLatchTransparent GT_DRAM_CFG_DRAMLatch
-/* DRAM Parameters */
-#define GT_DRAMPAR_BANK0 GT64011(0x44c)
-#define GT_DRAMPAR_BANK1 GT64011(0x450)
-#define GT_DRAMPAR_BANK2 GT64011(0x454)
-#define GT_DRAMPAR_BANK3 GT64011(0x458)
-#define GT_DRAMPAR_CASWr (1<<0)
-#define GT_DRAMPAR_CASWr1 0
-#define GT_DRAMPAR_CASWr2 GT_DRAMPAR_CASWr
-#define GT_DRAMPAR_RAStoCASWr (1<<1)
-#define GT_DRAMPAR_RAStoCASWr2 0
-#define GT_DRAMPAR_RAStoCASWr3 GT_DRAMPAR_RAStoCASWr
-#define GT_DRAMPAR_CASRd (1<<2)
-#define GT_DRAMPAR_CASRd1 0
-#define GT_DRAMPAR_CASRd2 GT_DRAMPAR_CASRd
-#define GT_DRAMPAR_RAStoCASRd (1<<3)
-#define GT_DRAMPAR_RAStoCASRd2 0
-#define GT_DRAMPAR_RAStoCASRd3 GT_DRAMPAR_RAStoCASRd
-#define GT_DRAMPAR_RefreshSHIFT 4
-#define GT_DRAMPAR_RefreshMASK (3<<4)
-#define GT_DRAMPAR_Refresh512 (0<<4)
-#define GT_DRAMPAR_Refresh1024 (1<<4)
-#define GT_DRAMPAR_Refresh2048 (2<<4)
-#define GT_DRAMPAR_Refresh4096 (3<<4)
-#define GT_DRAMPAR_BankWidth (1<<6)
-#define GT_DRAMPAR_BankWidth32 0
-#define GT_DRAMPAR_BankWidth64 GT_DRAMPAR_BankWidth
-#define GT_DRAMPAR_BankLoc (1<<7)
-#define GT_DRAMPAR_BankLocEven 0
-#define GT_DRAMPAR_BankLocOdd GT_DRAMPAR_BankLoc
-#define GT_DRAMPAR_Parity (1<<8)
-#define GT_DRAMPAR_ParityDisable 0
-#define GT_DRAMPAR_ParityEnable GT_DRAMPAR_Parity
-#define GT_DRAMPAR_MBZ (1<<9)
-/* Device Parameters */
-#define GT_DEVPAR_BANK0 GT64011(0x45c)
-#define GT_DEVPAR_BANK1 GT64011(0x460)
-#define GT_DEVPAR_BANK2 GT64011(0x464)
-#define GT_DEVPAR_BANK3 GT64011(0x468)
-#define GT_DEVPAR_BOOT GT64011(0x46c)
-#define GT_DEVPAR_TurnOffMASK (7<<0)
-#define GT_DEVPAR_TurnOffSHIFT 0
-#define GT_DEVPAR_TurnOff(x) ((x)<<0)
-#define GT_DEVPAR_AccToFirstMASK (15<<3)
-#define GT_DEVPAR_AccToFirstSHIFT 3
-#define GT_DEVPAR_AccToFirst(x) ((x)<<3)
-#define GT_DEVPAR_AccToNextMASK (15<<7)
-#define GT_DEVPAR_AccToNextSHIFT 7
-#define GT_DEVPAR_AccToNext(x) ((x)<<7)
-#define GT_DEVPAR_ADStoWrMASK (7<<11)
-#define GT_DEVPAR_ADStoWrSHIFT 11
-#define GT_DEVPAR_ADStoWr(x) ((x)<<11)
-#define GT_DEVPAR_WrActiveMASK (7<<14)
-#define GT_DEVPAR_WrActiveSHIFT 14
-#define GT_DEVPAR_WrActive(x) ((x)<<14)
-#define GT_DEVPAR_WrHighMASK (7<<17)
-#define GT_DEVPAR_WrHighSHIFT 17
-#define GT_DEVPAR_WrHigh(x) ((x)<<17)
-#define GT_DEVPAR_DevWidthMASK (3<<20)
-#define GT_DEVPAR_DevWidthSHIFT 20
-#define GT_DEVPAR_DevWidth8 (0<<20)
-#define GT_DEVPAR_DevWidth16 (1<<20)
-#define GT_DEVPAR_DevWidth32 (2<<20)
-#define GT_DEVPAR_DevWidth64 (3<<20)
-#define GT_DEVPAR_DevLoc (1<<23)
-#define GT_DEVPAR_DevLocEven 0
-#define GT_DEVPAR_DevLocOdd GT_DEVPAR_DevLoc
-#define GT_DEVPAR_LatchFunct (1<<25)
-#define GT_DEVPAR_LatchFunctTransparent 0
-#define GT_DEVPAR_LatchFunctEnable GT_DEVPAR_LatchFunct
-#define GT_DEVPAR_Parity (1<<30)
-#define GT_DEVPAR_ParityDisable 0
-#define GT_DEVPAR_ParityEnable GT_DEVPAR_Parity
-#define GT_DEVPAR_ReservedMASK 0x3d400000
-#define GT_DEVPAR_Reserved 0x14400000
-/* PCI Internal */
-#define GT_IPCI_CMD GT64011(0xc00)
-#define GT_IPCI_CMD_ByteSwap (1<<0)
-#define GT_IPCI_CMD_ByteSwapOn 0
-#define GT_IPCI_CMD_ByteSwapOff GT_INTPCI_CMD_ByteSwap
-#define GT_IPCI_CMD_SyncModeMASK (3<<1)
-#define GT_IPCI_CMD_SyncModeSHIFT 1
-#define GT_IPCI_CMD_SyncModeStd (0<<1)
-#define GT_IPCI_CMD_SyncMode1 (1<<1)
-#define GT_IPCI_CMD_SyncMode2 (2<<1)
-#define GT_IPCI_TOR GT64011(0xc04)
-#define GT_IPCI_TOR_Timeout0MASK (255<<0)
-#define GT_IPCI_TOR_Timeout0SHIFT 0
-#define GT_IPCI_TOR_Timeout0(x) ((x)<<0)
-#define GT_IPCI_TOR_Timeout1MASK (255<<8)
-#define GT_IPCI_TOR_Timeout1SHIFT 8
-#define GT_IPCI_TOR_Timeout1(x) ((x)<<8)
-#define GT_IPCI_TOR_RetryCtrMASK (255<<16)
-#define GT_IPCI_TOR_RetryCtrSHIFT 16
-#define GT_IPCI_TOR_RetryCtr(x) ((x)<<16)
-#define GT_IPCI_RAS10SIZE GT64011(0xc08)
-#define GT_IPCI_RAS32SIZE GT64011(0xc0c)
-#define GT_IPCI_CS20SIZE GT64011(0xc10)
-#define GT_IPCI_CS3BOOTSIZE GT64011(0xc14)
-#define GT_IPCI_SIZE_BankSizeMASK (0xfffff<<12)
-#define GT_IPCI_SIZE_BankSizeSHIFT 12
-#define GT_IPCI_INTRCAUSE GT64011(0xc18)
-#define GT_IPCI_INTRMASK GT64011(0xc1c)
-#define GT_INTR_INTSUM 0x0000001
-#define GT_INTR_MEMOUT 0x0000002
-#define GT_INTR_DMAOUT 0x0000004
-#define GT_INTR_CPUOUT 0x0000008
-#define GT_INTR_DMA0COMP 0x0000010
-#define GT_INTR_DMA1COMP 0x0000020
-#define GT_INTR_DMA2COMP 0x0000040
-#define GT_INTR_DMA3COMP 0x0000080
-#define GT_INTR_T0EXP 0x0000100
-#define GT_INTR_T1EXP 0x0000200
-#define GT_INTR_T2EXP 0x0000400
-#define GT_INTR_T3EXP 0x0000800
-#define GT_INTR_MASRDERR 0x0001000
-#define GT_INTR_SLVWRERR 0x0002000
-#define GT_INTR_MASWRERR 0x0004000
-#define GT_INTR_SLVRDERR 0x0008000
-#define GT_INTR_ADDRERR 0x0010000
-#define GT_INTR_MEMERR 0x0020000
-#define GT_INTR_MASABORT 0x0040000
-#define GT_INTR_TARABORT 0x0080000
-#define GT_INTR_RETRYCTR 0x0010000
-#define GT_INTR_CPU2PCIA 0x0020000
-#define GT_INTR_CPU2PCIB 0x0040000
-#define GT_INTR_CPU2PCIC 0x0080000
-#define GT_INTR_CPU2PCID 0x0100000
-#define GT_INTR_CPU2PCIE 0x0200000
-#define GT_INTR_PCI2CPUA 0x0400000
-#define GT_INTR_PCI2CPUB 0x0800000
-#define GT_INTR_PCI2CPUC 0x1000000
-#define GT_INTR_PCI2CPUD 0x2000000
-#define GT_INTR_CPUINTSUM 0x4000000
-#define GT_INTR_PCIINTSUM 0x8000000
-#define GT_IPCI_PCIINTMASK GT64011(0xc24)
-#define GT_IPCI_SERMASK GT64011(0xc28)
-#define GT_IPCI_SERMASK_AddrErr (1<<0)
-#define GT_IPCI_SERMASK_MasWrErr (1<<1)
-#define GT_IPCI_SERMASK_MasRdErr (1<<2)
-#define GT_IPCI_SERMASK_MemErr (1<<3)
-#define GT_IPCI_SERMASK_MasAbort (1<<4)
-#define GT_IPCI_SERMASK_TarAbort (1<<5)
-#define GT_IPCI_INTACK GT64011(0xc34)
-#define GT_IPCI_BAREN GT64011(0xc3c)
-#define GT_IPCI_BAREN_SwCs3BootDis (1<<0)
-#define GT_IPCI_BAREN_SwRas32Dis (1<<1)
-#define GT_IPCI_BAREN_SwRas10Dis (1<<2)
-#define GT_IPCI_BAREN_IntIODis (1<<3)
-#define GT_IPCI_BAREN_IntMemDis (1<<4)
-#define GT_IPCI_BAREN_Cs3BootDis (1<<5)
-#define GT_IPCI_BAREN_Cs20Dis (1<<6)
-#define GT_IPCI_BAREN_Ras32Dis (1<<7)
-#define GT_IPCI_BAREN_Ras10Dis (1<<8)
-#define GT_IPCI_CFGADDR GT64011(0xcf8)
-#define GT_IPCI_CFGDATA GT64011(0xcfc)
-#define GT_IPCI_CFGADDR_RegNumMASK (0x3f<<2)
-#define GT_IPCI_CFGADDR_RegNumSHIFT 2
-#define GT_IPCI_CFGADDR_RegNum(x) ((x)<<2)
-#define GT_IPCI_CFGADDR_FunctNumMASK (0x7<<8)
-#define GT_IPCI_CFGADDR_FunctNumSHIFT 8
-#define GT_IPCI_CFGADDR_FunctNum(x) ((x)<<8)
-#define GT_IPCI_CFGADDR_DevNumMASK (0x1f<<11)
-#define GT_IPCI_CFGADDR_DevNumSHIFT 11
-#define GT_IPCI_CFGADDR_DevNum(x) ((x)<<11)
-#define GT_IPCI_CFGADDR_BusNumMASK (0xff<<16)
-#define GT_IPCI_CFGADDR_BusNumSHIFT 16
-#define GT_IPCI_CFGADDR_BusNum(x) ((x)<<16)
-#define GT_IPCI_CFGADDR_ConfigEn (1<<31)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/head.S linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/head.S
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/head.S 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/head.S 1970-01-01 01:00:00.000000000 +0100
@@ -1,19 +0,0 @@
-/*
- * arch/mips/galileo/compressed/head.S
- *
- */
-
-#include <asm/asm.h>
-#include <asm/regdef.h>
-
- .text
-NESTED(startup, 16, sp)
- .set noreorder
-
- jal decompress_kernel
- nop
-
- jal kernel_location_start+0x584
- nop
-
- END(startup)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ld.script.gal linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ld.script.gal
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ld.script.gal 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ld.script.gal 1970-01-01 01:00:00.000000000 +0100
@@ -1,19 +0,0 @@
-OUTPUT_FORMAT("elf32-bigmips")
-OUTPUT_ARCH(mips)
-ENTRY(startup)
-SECTIONS
-{
- kernel_location_start = 0x80100000;
- . = 0x80400000;
- .text : {
- *(.text)
- }
- .bss : {
- *(.bss)
- }
- .data :{
- *(.data)
- }
- malloc_start = .;
-}
-
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.burner linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.burner
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.burner 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.burner 1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-OUTPUT_FORMAT("elf32-bigmips")
-OUTPUT_ARCH(mips)
-ENTRY(main)
-
-SECTIONS
-{
- . = 0xA0400000;
- .text : {*(.text)}
- .data : {*(.data)}
- .bss : {*(.bss)}
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.Flash linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.Flash
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.Flash 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.Flash 1970-01-01 01:00:00.000000000 +0100
@@ -1,29 +0,0 @@
-OUTPUT_FORMAT("elf32-bigmips")
-OUTPUT_ARCH(mips)
-ENTRY(sbdreset)
-
-SECTIONS
-{
- . = 0xBFC00000;
- .got : {*(.got)}
- .reset : {
- sbdreset = ABSOLUTE(.);
- sbdreset_evb64120A.o
- evb64120A_Setup.o /* <-- Note: contains xfer.c contents as well.. */
- pci_etherboot.o
- memory.o
- pci.o
- }
- kernel_location_start = 0x80100000;
- . = 0x80400000;
- .text : {
- *(.text)
- }
- .bss : {
- *(.bss)
- }
- .data :{
- *(.data)
- }
- malloc_start = .;
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.Flash2 linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.Flash2
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.Flash2 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ld.sys.big.Flash2 1970-01-01 01:00:00.000000000 +0100
@@ -1,24 +0,0 @@
-OUTPUT_FORMAT("elf32-bigmips")
-OUTPUT_ARCH(mips)
-ENTRY(XferToRam)
-
-SECTIONS
-{
- . = 0xBF000000;
- .got : {*(.got)}
- .reset : {
- xfer.o
- }
- kernel_location_start = 0x80100000;
- . = 0x80400000;
- .text : {
- *(.text)
- }
- .bss : {
- *(.bss)
- }
- .data :{
- *(.data)
- }
- malloc_start = .;
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/load.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/load.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/load.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/load.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,244 +0,0 @@
-
-/* control character used for download */
-#define ETX CNTRL('c')
-#define ACK CNTRL('f')
-#define NAK CNTRL('u')
-#define XON CNTRL('q')
-#define XOFF CNTRL('s')
-
-unsigned int csum;
-unsigned int dl_entry;
-
-static const unsigned char hextab[256] = {
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255,
- 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255,
- 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255,
- 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255,
-};
-
-
-unsigned char ascii_to_bin(unsigned char c)
-{
- return hextab[c];
-}
-
-unsigned char read_char_direct(void)
-{
- unsigned char c, *cp;
- cp = (unsigned char *) 0xbd000020;
- while (1) {
- if (*(cp + 0x14) & 0x01) {
- c = (volatile unsigned char) *cp;
- return c;
- }
- cp++;
- cp--;
- }
-}
-
-unsigned char get_pair(void)
-{
- unsigned char byte;
-
- byte = ascii_to_bin(read_char_direct()) << 4;
- byte |= ascii_to_bin(read_char_direct());
- csum += byte;
- return (byte);
-}
-
-
-void serial_putc(int ch)
-{
- unsigned long temp;
- for (temp = 0; temp < 1000; temp++) {
- }
- *(char *) 0xbd000020 = (char) ch;
-}
-
-
-int inline serial_getc(void)
-{
- return read_char_direct();
-}
-
-int serial_ischar(void)
-{
-
- unsigned char c, *cp;
- unsigned count;
- cp = (unsigned char *) 0xbd000020;
- count = 0;
- while (count != 100) {
- if (*(cp + 0x14) & 0x01) {
- c = (volatile unsigned char) *cp;
- return c;
- }
- cp++;
- cp--;
- count++;
- }
- return 0;
-}
-
-int serial_init(void)
-{
- return 0;
-}
-
-
-int galileo_dl(void)
-{
-#define display_char '.'
-#define display_error 'E'
-#define display_error_bad_7 '7'
-#define display_error_unknown 'U'
-#define display_error_length 'L'
-
- register int length, address, save_csum;
- int i, first, done, eof, reccount, type, client_pc;
- int src, dbl_length;
- unsigned char *buffptr, databuff[258], tempo;
- register int display_counter, chunks, leftovers, putter,
- bytes_per_chunk;
- display_counter = 0;
- bytes_per_chunk = 16;
- csum = 0;
-
- reccount = 1;
- for (first = 1, done = 0; !done; first = 0, reccount++) {
- while (read_char_direct() != 'S')
- continue;
- csum = 0;
- type = read_char_direct();
- length = get_pair();
- if (length < 0 || length >= 256) {
- *(char *) 0xbd000020 = display_error_length;
- // *(char*)0xbd00000c = display_error_length;
- return 0;
- }
- length--;
- switch (type) {
- case '0':
- while (length-- > 0)
- get_pair();
- break;
- case '3':
- address = 0;
- for (i = 0; i < 4; i++) {
- address <<= 8;
- address |= get_pair();
- length--;
- }
- if (address == -1) {
- eof = 1;
- continue;
- }
- buffptr = &databuff[0];
- dbl_length = length << 1;
- chunks = dbl_length / bytes_per_chunk;
- leftovers = dbl_length % bytes_per_chunk;
- putter = bytes_per_chunk >> 1;
- while (chunks--) {
- for (i = 0; i < bytes_per_chunk; i++)
- databuff[i] = read_char_direct();
- src = i = 0;
- while (i++ < putter) {
- tempo =
- (ascii_to_bin(databuff[src++])
- << 4) |
- ascii_to_bin(databuff[src++]);
- csum += tempo;
- *(char *) address++ = tempo;
- }
- }
- if (leftovers) {
- putter = leftovers / 2;
- for (i = 0; i < leftovers; i++)
- databuff[i] = read_char_direct();
- src = i = 0;
- while (i++ < putter) {
- tempo =
- (ascii_to_bin(databuff[src++])
- << 4) |
- ascii_to_bin(databuff[src++]);
- csum += tempo;
- *(char *) address++ = tempo;
- }
- }
- break;
-
- case '7':
- address = 0;
- for (i = 0; i < 4; i++) {
- address <<= 8;
- address |= get_pair();
- length--;
- }
- if (address == -1) {
- eof = 1;
- continue;
- }
- client_pc = address;
- if (length) {
- *(char *) 0xbd000020 = display_error_bad_7;
- // *(char*)0xbd00000c = display_error_bad_7;
- }
-
- done = 1;
- break;
-
- default:
- *(char *) 0xbd000020 = display_error_unknown;
- // *(char*)0xbd00000c = display_error_unknown;
-
- break;
- }
- save_csum = (~csum) & 0xff;
- if ((csum = get_pair()) < 0) {
- eof = 1;
- continue;
- }
- if (csum != save_csum) {
- *(char *) 0xbd000020 = display_error;
- // *(char*)0xbd00000c = display_error;
- } else {
-
- if (display_counter % 50 == 0) {
- *(char *) 0xbd000020 = display_char;
- display_counter = 0;
- }
- display_counter++;
-
- }
- }
- --reccount;
- dl_entry = client_pc;
- return dl_entry; /* Success */
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/Makefile linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/Makefile
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/Makefile 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/Makefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,177 +0,0 @@
-# =============================================================
-#
-# linux/arch/mips/galileo/compressed/Makefile
-#
-# By RidgeRun Inc.
-#
-# Description:
-# Create a system containing a copy of the compressed vmlinux kernel.
-# The system knows how to decompress the contained kernel and then
-# jump to it resulting in a linux kernel boot.
-#
-# The system comes in three forms:
-#
-# 1. - ramsys -
-# to be loaded into ram then run. When run
-# it decompresses the kernel housed in its internal
-# data structures and then jumps to the image which
-# results in a linux kernel boot.
-#
-# 2. - flashsys -
-# to be loaded into ram so that it can be
-# burned into the onboard flash. Then the board jumpers
-# can be switched so that the next power cycle caused
-# the system in flash to run which then proceeds as
-# described by #1 above.
-# Note: burner.srec is the utility that will allow
-# the user to get this image into flash.
-#
-# 3. - flashsys2 -
-# to be loaded into ram so that it can be
-# burned into the onboard flash. Then on each power
-# cycle when the standard PMON prompt is presented
-# the user can type `call 0xbf000000` to invoke
-# the system in flash which then proceeds as
-# described by #1 above.
-# Note: burner.srec is the utility that will allow
-# the user to get this image into flash.
-#
-# 4. - burner.srec -
-# related to #2 and #3 above.
-#
-# =============================================================
-
-USE_STANDARD_AS_RULE := true
-
-all: ramsys.srec \
- flashsys.srec \
- flashsys2.srec \
- burner.srec
-
-SYSTEM = $(TOPDIR)/vmlinux
-
-CFLAGS_2 = -DCONSOLE_SERIAL -DDELIMITERLINES -DGALILEO_PORT \
- -DANSIESC -DELF_IMAGE -DELF_IMAGE -DDOWNLOAD_PROTO_TFTP \
- -DEVB64120A -D__MIPSEB__ -DINCLUDE_EEPRO100 \
- -DINCLUDE_GETH0 -DNOPRINTK -DPROM -DCOMPRESSEDVMLINUX
-
-sbdreset_evb64120A.o:
- $(CC) $(CFLAGS) $(CFLAGS_2) -c sbdreset_evb64120A.S -o $*.o
-memory.o:
- $(CC) $(CFLAGS) $(CFLAGS_2) -c memory.c -o $*.o
-pci.o:
- $(CC) $(CFLAGS) $(CFLAGS_2) -c pci.c -o $*.o
-pci_etherboot.o:
- $(CC) $(CFLAGS) $(CFLAGS_2) -c pci_etherboot.c -o $*.o
-load.o:
- $(CC) $(CFLAGS) $(CFLAGS_2) -c load.c -o $*.o
-flashdrv.o:
- $(CC) $(CFLAGS) $(CFLAGS_2) -c flashdrv.c -o $*.o
-
-gz2asm: gz2asm.c
- g++ -o gz2asm gz2asm.c
-
-doit: doit.c
- gcc -o doit doit.c
-
-piggy.gz: $(SYSTEM)
- rm -f piggy piggy.gz
- $(OBJCOPY) -S -O binary $(SYSTEM) piggy
- gzip -f -9 < piggy > piggy.gz
-
-piggy.S: doit fixit piggy.gz
- ./doit < piggy.gz > piggy.S; . ./fixit piggy.S
-
-OBJECTS_ramsys = head.o misc.o piggy.o ../serialGT.o
-OBJECTS_flashsys = sbdreset_evb64120A.o evb64120A_Setup.o pci_etherboot.o memory.o pci.o head.o misc.o piggy.o ../serialGT.o
-OBJECTS_flashsys2 = xfer.o head.o misc.o piggy.o ../serialGT.o
-OBJECTS_burner = burner.o load.o flashdrv.o
-
-ramsys.srec : $(OBJECTS_ramsys) ld.script.gal
- @# Note: this image is intended to run out of ram. No flash involved.
- $(LD) -T ld.script.gal -o ramsys $(OBJECTS_ramsys)
- $(NM) ramsys | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System_ramsys.map
- $(OBJCOPY) -O srec ramsys ramsys.srec
- cp ramsys.srec $(TOPDIR)/.
-
-flashsys.srec : $(OBJECTS_flashsys) ld.sys.big.Flash
- @# Note1: Use the burn utility to get this image into flash.
- @# Note2: This image is intended to run out of flash as invoked
- @# directly at powerup when EVB64120A jumpers are configured to
- @# bypass the onboard eprom.
- @# Assumes that 0xBFC00000 is the bootup run address (normal MIPS).
- @# And assumes that EVB64120A jumber J11 is added to the board and jumber
- @# J20 is moved from the 2&3 position to the 1&2 position instead. Without
- @# the jumper settings the system will execute at address 0xBFC00000,
- @# as normal, yet that address will map to the onboard eeprom instead
- @# of the onboard flash.
- @#
- $(LD) -T ld.sys.big.Flash -o flashsys $(OBJECTS_flashsys)
- $(NM) flashsys | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | sort > System_flashsys.map
- @#
- @# Next, Create the image that we want to place in the flash part.
- $(OBJCOPY) -S -g --strip-unneeded \
- --adjust-section-vma=.text+0x3f820000 \
- --adjust-section-vma=.rodata+0x3f820000 \
- --adjust-section-vma=.reginfo+0x3f820000 \
- --adjust-section-vma=.data+0x3f820000 \
- --remove-section=.bss \
- --remove-section=.scommon \
- --remove-section=.note \
- --remove-section=.comment \
- flashsys flashsys.temp
- @#
- @# Next, change the addresses so that when we download to
- @# to the board's ram it will land starting at address 0xA0300000
- @# because this is where we have choosen to have the image temporarily sit
- @# while we subsequently burn it (using some method not revealed here) into
- @# the board's flash. After the burn the system can be setup (via jumpers)
- @# to boot this image directory from the flash part.
- $(OBJCOPY) -O srec --adjust-vma=0xe0700000 flashsys.temp flashsys.srec
- cp flashsys.srec $(TOPDIR)/.
-
-flashsys2.srec : $(OBJECTS_flashsys2) ld.sys.big.Flash2
- @# Note1: Use the burn utility to get this image into flash.
- @# Note2: This image is intended to be run out of flash as invoked
- @# manually from the standard PMON running in eprom. This means that
- @# the image will be set to run from location 0xBF000000 which is the
- @# location the flash is mapped to when the board jumpers are set to
- @# the standard location such that the board boots out of onboard
- @# eprom. From the PMON prompt the user can type `call 0xbf000000`
- @# to transfer control to the image we are constructing here.
- @#
- $(LD) -T ld.sys.big.Flash2 -o flashsys2 $(OBJECTS_flashsys2)
- $(NM) flashsys2 | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | sort > System_flashsys2.map
- @#
- @# Next, Create the image that we want to place in the flash part.
- $(OBJCOPY) -S -g --strip-unneeded \
- --adjust-section-vma=.text+0x3ec20000 \
- --adjust-section-vma=.rodata+0x3ec20000 \
- --adjust-section-vma=.reginfo+0x3ec20000 \
- --adjust-section-vma=.data+0x3ec20000 \
- --remove-section=.bss \
- --remove-section=.scommon \
- --remove-section=.note \
- --remove-section=.comment \
- flashsys2 flashsys2.temp
- @#
- @# Next, change the addresses so that when we download to
- @# to the board's ram it will land starting at address 0xA0300000
- @# because this is where we have choosen to have the image temporarily sit
- @# while we subsequently burn it (using some method not revealed here) into
- @# the board's flash. After the burn a user will then be able to type
- @# `call 0xbf000000` at the PMON prompt (following a power cycle) to invoke
- @# the linux kernel.
- $(OBJCOPY) -O srec --adjust-vma=0xe1300000 flashsys2.temp flashsys2.srec
- cp flashsys2.srec $(TOPDIR)/.
-
-burner.srec : $(OBJECTS_burner) ld.sys.big.burner
- @# This utility can be used to burn the flashsys.srec or flashsys2.srec
- @# into the EVB64120A's on board flash part (1Meg minimum).
- $(LD) -T ld.sys.big.burner -o burner $(OBJECTS_burner)
- $(NM) burner | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System_burner.map
- $(OBJCOPY) -O srec burner burner.srec
- cp burner.srec $(TOPDIR)/.
-
-clean:
- rm -f doit piggy.S piggy.gz piggy burner *.o ramsys* flashsys* System*.map *.srec
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/meminit.S linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/meminit.S
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/meminit.S 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/meminit.S 1970-01-01 01:00:00.000000000 +0100
@@ -1,187 +0,0 @@
-/*
- * Define BUSWIDTH to usually be real buswidth X 2 (i.e assuming
- * 2-way interleaving). This is so that the test pattern and
- * inverted pattern are written to the same bank of memory, which
- * prevents us reading back data sitting in the dram buffers and
- * getting a false match.
- */
-
-#ifndef BUSWIDTH
-# if #cpu(r3000) || #cpu(r4300) || #cpu(r4650)
-# define BUSWIDTH 8 /* 32 bit memory, bank interleaved */
-# elif #cpu(r4000)
-# define BUSWIDTH 16 /* 64 bit memory, bank interleaved */
-# endif
-#endif
-
-#ifndef RAM_BASE
-#define RAM_BASE KSEG1_BASE
-#endif
-
-#ifndef MEMSTART
-#define MEMSTART 0x0 /* start of physical memory */
-#endif
-
-#ifndef MEMINCR
-# define MEMINCR 0x10000 /* work up in 64Kb increments */
-#endif
-
-SLEAF(size_mem)
- mfc0 t8,C0_STATUS
-#if #cpu(r4000)
- /* disable cache and memory parity checking */
- or t0,t8,SR_DE
- mtc0 t0,C0_STATUS
-#endif
-
- li t0,RAM_BASE+MEMSTART # start at bottom of phys mem
- move t1,t0 # remember start address
- li t2,0xaa55aa55 # pattern
- not t3,t2 # ~pattern
-
- move t7,k0
- la t4,.fail # bus error exception catcher
- addu k0,t4,s8 # RELOC
-
- /* fill first 64Kb with zero (for cache init) */
- move t4,t0
- li t5,0x10000
-1: sw zero,0(t4)
- sw zero,4(t4)
- sw zero,8(t4)
- sw zero,12(t4)
- subu t5,16
- addu t4,16
- bnez t5,1b
-
-.loop:
- addu t0,MEMINCR
- move t4,t0
-
- /* store pattern in bank 0, line 0 */
- sw t2,0(t4)
- addu t4,4
-
-#if BUSWIDTH > 4
- /* fill remainder of line with zeros */
- li t5,BUSWIDTH-4
-1: sw zero,0(t4)
- subu t5,4
- addu t4,4
- bnez t5,1b
-#endif
-
- /* store inverse pattern in bank 0, line 1 */
- sw t3,0(t4)
- addu t4,4
-
-#if BUSWIDTH > 4
- /* fill remainder of line with zeros */
- li t5,BUSWIDTH-4
-1: sw zero,0(t4)
- subu t5,4
- addu t4,4
- bnez t5,1b
-#endif
-
- /* defeat write buffering */
-#if #cpu(r4000)
- sync
-#else
- lw zero,-4(t4)
-#endif
-
- lw t4,0(t0) # read first word of line
- lw t5,0(t1) # read start of memory (should be zero)
- bne t4,t2,.fail # this line wrong?
- beq t5,zero,.loop # start of mem overwritten?
-
-.fail:
- move k0,t7 # clear exception catcher
-
- /* restore Status register */
- mtc0 t8,C0_STATUS
-
- /* return top of memory offset (normally == size) */
- subu v0,t0,RAM_BASE
- j ra
-END(size_mem)
-
-
-/*
- * We must often initialise memory so that it has good parity/ecc,
- * and this must be done before the caches are used.
- */
-
-/*
- clear_mem (size)
- - clear memory from RAM_BASE+MEMSTART to RAM_BASE+MEMSTART+size
- clear_mem_range (size, start)
- - clear memory from start to start+size
-*/
-
-SLEAF(clear_mem)
- li a1,RAM_BASE+MEMSTART # start at bottom of phys mem
-clear_mem_range:
- beqz a0,9f
- addu a0,a1 # end of memory
-
- /* XXX should run cached, but caches may not be initialised yet */
- .set noreorder
-#if __mips >= 3
-1: sd zero,0(a1)
- sd zero,8(a1)
- sd zero,16(a1)
- sd zero,24(a1)
- sd zero,32(a1)
- sd zero,40(a1)
- sd zero,48(a1)
- addu a1,64
- bne a1,a0,1b
- sd zero,-8(a1) # BDSLOT
-#else
-1: sw zero,0(a1)
- sw zero,4(a1)
- sw zero,8(a1)
- sw zero,12(a1)
- sw zero,16(a1)
- sw zero,20(a1)
- sw zero,24(a1)
- sw zero,28(a1)
- sw zero,32(a1)
- sw zero,36(a1)
- sw zero,40(a1)
- sw zero,44(a1)
- sw zero,48(a1)
- sw zero,52(a1)
- sw zero,56(a1)
- addu a1,64
- bne a1,a0,1b
- sw zero,-4(a1) # BDSLOT
-#endif
- .set reorder
-
-9: j ra
-END(clear_mem)
-
-
-SLEAF(init_tlb)
- /* initialise tlb */
- mtc0 zero,C0_TLBLO0 /* tlblo0 = invalid */
- mtc0 zero,C0_TLBLO1 /* tlblo1 = invalid */
- mtc0 zero,C0_PGMASK
- li t8,K1BASE /* tlbhi = impossible vpn */
- li t9,(NTLBENTRIES-1) /* index */
-
- .set noreorder
- nop
-1: mtc0 t8,C0_TLBHI
- mtc0 t9,C0_INX
- addu t8,0x2000 /* inc vpn */
- tlbwi
- bnez t9,1b
- subu t9,1 # BDSLOT
- .set reorder
-
- j ra
-END(init_tlb)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/memory.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/memory.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/memory.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/memory.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,593 +0,0 @@
-/* Memory.c - Memory mappings and remapping functions */
-
-/* Copyright - Galileo technology. */
-
-/*
-DESCRIPTION
-This file contains function which gives the user the ability to remap the
-SDRAM memory and devices windows, please pay attention to overlapping windows
-since the function do not take care of that for you.
-When remapping the SDRAM or devices memory space pay attention to the PCI
-mappings and make sure to coordinate between the two interfaces!!!
-*/
-
-/* includes */
-
-#ifdef __linux__
-#include <asm/galileo-boards/evb64120A/core.h>
-#include <asm/galileo-boards/evb64120A/memory.h>
-#else
-#include "Core.h"
-#include "Memory.h"
-#endif
-
-/********************************************************************
-* getMemoryBankBaseAddress - Extract the base address of a memory bank
-* - If the memory bank size is 0 then this base address has no meaning !!!
-*
-* INPUTS: MEMORY_BANK bank - SDRAM Bank number.
-* OUTPUT: N/A
-* RETURNS: Memory bank base address.
-*********************************************************************/
-unsigned int getMemoryBankBaseAddress(MEMORY_BANK bank)
-{
- unsigned int base, regBase;
- GT_REG_READ((SCS_1_0_LOW_DECODE_ADDRESS + (bank / 2) * 0x10),
- &base);
- base = base << 21;
- GT_REG_READ((SCS_0_LOW_DECODE_ADDRESS + bank * 8), ®Base);
- base = base | (regBase << 20);
- return base;
-}
-
-/********************************************************************
-* getDeviceBaseAddress - Extract the base address of a device.
-* - If the device size is 0 then this base address has no meaning!!!
-*
-* INPUT: DEVICE device - Bank number.
-* OUTPUT: N/A
-* RETURNS: Device base address.
-*********************************************************************/
-unsigned int getDeviceBaseAddress(DEVICE device)
-{
- unsigned int base, regBase;
- GT_REG_READ((CS_2_0_LOW_DECODE_ADDRESS + (device / 3) * 0x10),
- &base);
- base = base << 21;
- GT_REG_READ((CS_0_LOW_DECODE_ADDRESS + device * 0x8), ®Base);
- base = base | (regBase << 20);
- return base;
-}
-
-/********************************************************************
-* getMemoryBankSize - Extract the size of a memory bank.
-*
-* INPUT: MEMORY_BANK bank - Bank number
-* OUTPUT: N/A
-* RETURNS: Memory bank size.
-*********************************************************************/
-unsigned int getMemoryBankSize(MEMORY_BANK bank)
-{
- unsigned int size, base, value;
- base = getMemoryBankBaseAddress(bank);
- GT_REG_READ((SCS_0_HIGH_DECODE_ADDRESS + bank * 8), &size);
- size = ((size + 1) << 20) - (base & 0x0fffffff);
- GT_REG_READ((SCS_0_HIGH_DECODE_ADDRESS + bank * 8), &value);
- if (value == 0)
- return 0;
- else
- return size;
-}
-
-/********************************************************************
-* getDeviceSize - Extract the size of a device memory space
-*
-* INPUT: DEVICE device - Device number
-* OUTPUT: N/A
-* RETURNS: Size of a device memory space.
-*********************************************************************/
-unsigned int getDeviceSize(DEVICE device)
-{
- unsigned int size, base, value;
- base = getDeviceBaseAddress(device);
- GT_REG_READ((CS_0_HIGH_DECODE_ADDRESS + device * 8), &size);
- size = ((size + 1) << 20) - (base & 0x0fffffff);
- GT_REG_READ((CS_0_HIGH_DECODE_ADDRESS + device * 8), &value);
- if ((value + 1) == 0)
- return 0;
- else
- return size;
-}
-
-/********************************************************************
-* getDeviceWidth - A device can be with: 1,2,4 or 8 Bytes data width.
-* The width is determine in registers: 'Device Parameters'
-* registers (0x45c, 0x460, 0x464, 0x468, 0x46c - for each device.
-* at bits: [21:20].
-*
-* INPUT: DEVICE device - Device number
-* OUTPUT: N/A
-* RETURNS: Device width in Bytes (1,2,4, or 8), 0 if error had occurred.
-*********************************************************************/
-unsigned int getDeviceWidth(DEVICE device)
-{
- unsigned int width;
- unsigned int regValue;
-
- GT_REG_READ(DEVICE_BANK0PARAMETERS + device * 4, ®Value);
- width = (regValue & 0x00300000) >> 20;
- switch (width) {
- case 0:
- return 1;
- case 1:
- return 2;
- case 2:
- return 4;
- case 3:
- return 8;
- default:
- return 0;
- }
-}
-
-/********************************************************************
-* mapMemoryBanks0and1 - Sets new bases and boundaries for memory banks 0 and 1
-* - Pay attention to the PCI mappings and make sure to
-* coordinate between the two interfaces!!!
-* - It is the programmer`s responsibility to make sure
-* there are no conflicts with other memory spaces!!!
-* - If a bank needs to be closed , give it a 0 length
-*
-*
-* INPUTS: unsigned int bank0Base - required bank 0 base address.
-* unsigned int bank0Length - required bank 0 size.
-* unsigned int bank1Base - required bank 1 base address.
-* unsigned int bank1Length - required bank 1 size.
-* RETURNS: true on success, false on failure or if one of the parameters is
-* erroneous.
-*********************************************************************/
-bool mapMemoryBanks0and1(unsigned int bank0Base, unsigned int bank0Length,
- unsigned int bank1Base, unsigned int bank1Length)
-{
- unsigned int mainBank0Top = bank0Base + bank0Length;
- unsigned int mainBank1Top = bank1Base + bank1Length;
- unsigned int memBank0Base, bank0Top;
- unsigned int memBank1Base, bank1Top;
-
- if (bank0Base <= bank1Base) {
- if ((bank0Base + bank0Length) > bank1Base)
- return false;
- } else {
- if ((bank1Base + bank1Length) > bank0Base)
- return false;
- }
-
- if (bank0Length == 0)
- mainBank0Top++;
- if (bank1Length == 0)
- mainBank1Top++;
-
- memBank0Base = ((unsigned int) (bank0Base & 0x0fffffff)) >> 20;
- bank0Top = ((unsigned int) (mainBank0Top & 0x0fffffff)) >> 20;
- memBank1Base = ((unsigned int) (bank1Base & 0x0fffffff)) >> 20;
- bank1Top = ((unsigned int) (mainBank1Top & 0x0fffffff)) >> 20;
-
- if (mainBank1Top > mainBank0Top) {
- bank0Base >>= 21;
- mainBank0Top =
- ((unsigned int) (mainBank1Top & 0x0fffffff)) >> 21;
- } else {
- bank0Base = bank1Base >> 21;
- mainBank0Top =
- ((unsigned int) (mainBank0Top & 0x0fffffff)) >> 21;
- }
- GT_REG_WRITE(SCS_1_0_LOW_DECODE_ADDRESS, bank0Base);
- if ((bank0Length + bank1Length) != 0) {
- GT_REG_WRITE(SCS_1_0_HIGH_DECODE_ADDRESS,
- mainBank0Top - 1);
- } else {
- GT_REG_WRITE(SCS_1_0_HIGH_DECODE_ADDRESS, 0x0);
- }
- if (bank1Length != 0) {
- GT_REG_WRITE(SCS_1_HIGH_DECODE_ADDRESS, bank1Top - 1);
- } else {
- GT_REG_WRITE(SCS_1_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(SCS_1_LOW_DECODE_ADDRESS, memBank1Base);
- if (bank0Length != 0) {
- GT_REG_WRITE(SCS_0_HIGH_DECODE_ADDRESS, bank0Top - 1);
- } else {
- GT_REG_WRITE(SCS_0_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(SCS_0_LOW_DECODE_ADDRESS, memBank0Base);
- return true;
-}
-
-/********************************************************************
-* mapMemoryBanks2and3 - Sets new bases and boundaries for memory banks 2 and 3
-* - Pay attention to the PCI mappings and make sure to
-* coordinate between the two interfaces!!!
-* - It`s the programmer`s responsibility to make sure there
-* are no conflicts with other memory spaces!!!
-* - If a bank needs to be closed , give it a 0 length.
-*
-*
-* INPUTS: unsigned int bank2Base - required bank 2 base address.
-* unsigned int bank2Length - required bank 2 size.
-* unsigned int bank3Base - required bank 3 base address.
-* unsigned int bank3Length - required bank 3 size.
-* RETURNS: true on success, false on failure or if one of the parameters is
-* erroneous.
-*********************************************************************/
-bool mapMemoryBanks2and3(unsigned int bank2Base, unsigned int bank2Length,
- unsigned int bank3Base, unsigned int bank3Length)
-{
- unsigned int mainBank2Top =
- (unsigned int) (bank2Base + bank2Length);
- unsigned int mainBank3Top =
- (unsigned int) (bank3Base + bank3Length);
- unsigned int memBank2Base, bank2Top;
- unsigned int memBank3Base, bank3Top;
-
- if (bank2Base <= bank3Base) {
- if ((bank2Base + bank2Length) > bank3Base)
- return false;
- } else {
- if ((bank3Base + bank3Length) > bank2Base)
- return false;
- }
- if (bank2Length == 0)
- mainBank2Top++;
- if (bank3Length == 0)
- mainBank3Top++;
-
- memBank2Base = ((unsigned int) (bank2Base & 0x0fffffff)) >> 20;
- bank2Top = ((unsigned int) (mainBank2Top & 0x0fffffff)) >> 20;
- memBank3Base = ((unsigned int) (bank3Base & 0x0fffffff)) >> 20;
- bank3Top = ((unsigned int) (mainBank3Top & 0x0fffffff)) >> 20;
-
- if (mainBank3Top > mainBank2Top) {
- bank2Base >>= 21;
- mainBank2Top =
- ((unsigned int) (mainBank3Top & 0x0fffffff)) >> 21;
- } else {
- bank2Base = bank3Base >> 21;
- mainBank2Top =
- ((unsigned int) (mainBank2Top & 0x0fffffff)) >> 21;
- }
- GT_REG_WRITE(SCS_3_2_LOW_DECODE_ADDRESS, bank2Base);
- if ((bank2Length + bank3Length) != 0) {
- GT_REG_WRITE(SCS_3_2_HIGH_DECODE_ADDRESS,
- mainBank2Top - 1);
- } else {
- GT_REG_WRITE(SCS_3_2_HIGH_DECODE_ADDRESS, 0x0);
- }
- if (bank3Length != 0) {
- GT_REG_WRITE(SCS_3_HIGH_DECODE_ADDRESS, bank3Top - 1);
- } else {
- GT_REG_WRITE(SCS_3_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(SCS_3_LOW_DECODE_ADDRESS, memBank3Base);
- if (bank2Length != 0) {
- GT_REG_WRITE(SCS_2_HIGH_DECODE_ADDRESS, bank2Top - 1);
- } else {
- GT_REG_WRITE(SCS_2_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(SCS_2_LOW_DECODE_ADDRESS, memBank2Base);
- return true;
-}
-
-/********************************************************************
-* mapDevices0_1and2MemorySpace - Sets new bases and boundaries for devices 0,1
-* and 2
-* - Pay attention to the PCI mappings and make sure to
-* coordinate between the two interfaces!!!
-* - It`s the programmer`s responsibility to make sure there
-* are no conflicts with other memory spaces!!!
-* - If a device needs to be closed , give it a 0 length
-*
-*
-* INPUTS: unsigned int device0Base - required cs_0 base address.
-* unsigned int device0Length - required cs_0 size.
-* unsigned int device1Base - required cs_1 base address.
-* unsigned int device1Length - required cs_0 size.
-* unsigned int device2Base - required cs_2 base address.
-* unsigned int device2Length - required cs_2 size.
-* RETURNS: true on success, false on failure or if one of the parameters is
-* erroneous.
-*********************************************************************/
-bool mapDevices0_1and2MemorySpace(unsigned int device0Base,
- unsigned int device0Length,
- unsigned int device1Base,
- unsigned int device1Length,
- unsigned int device2Base,
- unsigned int device2Length)
-{
- unsigned int deviceBank0Top =
- (unsigned int) (device0Base + device0Length);
- unsigned int deviceBank1Top =
- (unsigned int) (device1Base + device1Length);
- unsigned int deviceBank2Top =
- (unsigned int) (device2Base + device2Length);
- unsigned int device0BaseTemp = 0, device0TopTemp = 0;
- unsigned int bank0Base, bank0Top;
- unsigned int bank1Base, bank1Top;
- unsigned int bank2Base, bank2Top;
- bank0Base = ((unsigned int) (device0Base & 0x0fffffff)) >> 20;
- bank0Top = ((unsigned int) (deviceBank0Top & 0x0fffffff)) >> 20;
- bank1Base = ((unsigned int) (device1Base & 0x0fffffff)) >> 20;
- bank1Top = ((unsigned int) (deviceBank1Top & 0x0fffffff)) >> 20;
- bank2Base = ((unsigned int) (device2Base & 0x0fffffff)) >> 20;
- bank2Top = ((unsigned int) (deviceBank2Top & 0x0fffffff)) >> 20;
-
- if (device0Length == 0)
- deviceBank0Top++;
- if (device1Length == 0)
- deviceBank1Top++;
- if (device2Length == 0)
- deviceBank2Top++;
-
- if (device0Base <= device1Base && device0Base <= device2Base) {
- if ((device0Base + device0Length) > device1Base || \
- (device0Base + device0Length) > device2Base)
- return false;
- if (device1Base <= device2Base) {
- if ((device1Base + device1Length) > device2Base)
- return false;
- } else {
- if ((device2Base + device2Length) > device1Base)
- return false;
- }
- }
-
- if (device1Base <= device0Base && device1Base <= device2Base) {
- if ((device1Base + device1Length) > device0Base ||
- (device1Base + device1Length) > device2Base)
- return false;
- if (device0Base <= device2Base) {
- if ((device0Base + device0Length) > device2Base)
- return false;
- } else {
- if ((device2Base + device2Length) > device0Base)
- return false;
- }
- }
-
- if (device2Base <= device1Base && device2Base <= device0Base) {
- if ((device2Base + device2Length) > device1Base ||
- (device2Base + device2Length) > device0Base)
- return false;
- if (device0Base <= device1Base) {
- if ((device0Base + device0Length) > device1Base)
- return false;
- } else {
- if ((device1Base + device1Length) > device0Base)
- return false;
- }
- }
-
- if ((deviceBank2Top > deviceBank1Top) && (deviceBank1Top >
- deviceBank0Top)) {
- device0BaseTemp = device0Base >> 21;
- device0TopTemp =
- ((unsigned int) (deviceBank2Top & 0x0fffffff)) >> 21;
- }
- if ((deviceBank2Top > deviceBank0Top)
- && (deviceBank0Top > deviceBank1Top)) {
- device0BaseTemp = device1Base >> 21;
- device0TopTemp =
- ((unsigned int) (deviceBank2Top & 0x0fffffff)) >> 21;
- }
- if ((deviceBank1Top > deviceBank2Top)
- && (deviceBank2Top > deviceBank0Top)) {
- device0BaseTemp = device0Base >> 21;
- device0TopTemp =
- ((unsigned int) (deviceBank1Top & 0x0fffffff)) >> 21;
- }
- if ((deviceBank1Top > deviceBank0Top)
- && (deviceBank0Top > deviceBank2Top)) {
- device0BaseTemp = device2Base >> 21;
- device0TopTemp =
- ((unsigned int) (deviceBank1Top & 0x0fffffff)) >> 21;
- }
- if ((deviceBank0Top > deviceBank2Top)
- && (deviceBank2Top > deviceBank1Top)) {
- device0BaseTemp = device1Base >> 21;
- device0TopTemp =
- ((unsigned int) (deviceBank0Top & 0x0fffffff)) >> 21;
- }
- if ((deviceBank0Top > deviceBank1Top)
- && (deviceBank1Top > deviceBank2Top)) {
- device0BaseTemp = device2Base >> 21;
- device0TopTemp =
- ((unsigned int) (deviceBank0Top & 0x0fffffff)) >> 21;
- }
- GT_REG_WRITE(CS_2_0_LOW_DECODE_ADDRESS, device0BaseTemp);
- if ((device0Length + device1Length + device2Length) != 0) {
- GT_REG_WRITE(CS_2_0_HIGH_DECODE_ADDRESS,
- device0TopTemp - 1);
- } else {
- GT_REG_WRITE(CS_2_0_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(CS_0_LOW_DECODE_ADDRESS, bank0Base);
- if (device0Length != 0) {
- GT_REG_WRITE(CS_0_HIGH_DECODE_ADDRESS, bank0Top - 1);
- } else {
- GT_REG_WRITE(CS_0_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(CS_1_LOW_DECODE_ADDRESS, bank1Base);
- if (device1Length != 0) {
- GT_REG_WRITE(CS_1_HIGH_DECODE_ADDRESS, bank1Top - 1);
- } else {
- GT_REG_WRITE(CS_1_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(CS_2_LOW_DECODE_ADDRESS, bank2Base);
- if (device2Length != 0) {
- GT_REG_WRITE(CS_2_HIGH_DECODE_ADDRESS, bank2Top - 1);
- } else {
- GT_REG_WRITE(CS_2_HIGH_DECODE_ADDRESS, 0x0);
- }
- return true;
-}
-
-/********************************************************************
-* mapDevices3andBootMemorySpace - Sets new bases and boundaries for devices:
-* 3 and boot
-* - Pay attention to the PCI mappings and make sure to
-* coordinate between the two interfaces!!!
-* - It is the programmer`s responsibility to make sure
-* there are no conflicts with other memory spaces!!!
-* - If a device needs to be closed , give it a 0 length.
-*
-* INPUTS: base and length of device 3and boot
-* RETURNS: true on success, false on failure
-*********************************************************************/
-bool mapDevices3andBootMemorySpace(unsigned int device3Base,
- unsigned int device3Length,
- unsigned int bootDeviceBase,
- unsigned int bootDeviceLength)
-{
- unsigned int deviceBank3Top =
- (unsigned int) (device3Base + device3Length);
- unsigned int deviceBankBootTop =
- (unsigned int) (bootDeviceBase + bootDeviceLength);
- unsigned int bank3Base, bank3Top;
- unsigned int bank4Base, bank4Top;
- unsigned int Device1Base, Device1Top;
-
- bank3Top = ((unsigned int) (deviceBank3Top & 0x0fffffff)) >> 20;
- bank4Top = ((unsigned int) (deviceBankBootTop & 0x0fffffff)) >> 20;
- bank3Base = ((unsigned int) (device3Base & 0x0fffffff)) >> 20;
- bank4Base = ((unsigned int) (bootDeviceBase & 0x0fffffff)) >> 20;
-
- if (device3Base <= bootDeviceBase) {
- if (deviceBank3Top > bootDeviceBase)
- return false;
- } else {
- if (deviceBankBootTop > device3Base)
- return false;
- }
-
- if (deviceBankBootTop > deviceBank3Top) {
- Device1Base = device3Base >> 21;
- Device1Top =
- ((unsigned int) (deviceBankBootTop & 0x0fffffff)) >>
- 21;
- } else {
- Device1Base = bootDeviceBase >> 21;
- Device1Top =
- ((unsigned int) (deviceBank3Top & 0x0fffffff)) >> 21;
- }
- GT_REG_WRITE(CS_3_BOOTCS_LOW_DECODE_ADDRESS, Device1Base);
- if ((device3Length + bootDeviceLength) != 0) {
- GT_REG_WRITE(CS_3_BOOTCS_HIGH_DECODE_ADDRESS,
- Device1Top - 1);
- } else {
- GT_REG_WRITE(CS_3_BOOTCS_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(CS_3_LOW_DECODE_ADDRESS, bank3Base);
- if (device3Length != 0) {
- GT_REG_WRITE(CS_3_HIGH_DECODE_ADDRESS, bank3Top - 1);
- } else {
- GT_REG_WRITE(CS_3_HIGH_DECODE_ADDRESS, 0x0);
- }
- GT_REG_WRITE(BOOTCS_LOW_DECODE_ADDRESS, bank4Base);
- if (bootDeviceLength != 0) {
- GT_REG_WRITE(BOOTCS_HIGH_DECODE_ADDRESS, bank4Top - 1);
- } else {
- GT_REG_WRITE(BOOTCS_HIGH_DECODE_ADDRESS, 0x0);
- }
- return true;
-}
-
-/********************************************************************
-* modifyDeviceParameters - This function can be used to modify a device`s
-* parameters.
-* - Be advised to check the spec before modifying them.
-* Inputs:
-* Returns: false if one of the parameters is erroneous,true otherwise.
-*********************************************************************/
-bool modifyDeviceParameters(DEVICE device, unsigned int turnOff,
- unsigned int accToFirst,
- unsigned int accToNext, unsigned int aleToWr,
- unsigned int wrActive, unsigned int wrHigh,
- unsigned int width, bool paritySupport)
-{
- unsigned int data, oldValue;
-
- if ((turnOff > 0x7 && turnOff != DONT_MODIFY)
- || (accToFirst > 0xf && accToFirst != DONT_MODIFY)
- || (accToNext > 0xf && accToNext != DONT_MODIFY)
- || (aleToWr > 0x7 && aleToWr != DONT_MODIFY)
- || (wrActive > 0x7 && wrActive != DONT_MODIFY)
- || (wrHigh > 0x7 && wrHigh != DONT_MODIFY)) {
- return false;
- }
-
- GT_REG_READ((DEVICE_BANK0PARAMETERS + device * 4), &oldValue);
- if (turnOff == DONT_MODIFY)
- turnOff = oldValue & 0x00000007;
- else
- turnOff = turnOff;
-
- if (accToFirst == DONT_MODIFY)
- accToFirst = oldValue & 0x00000078;
- else
- accToFirst = accToFirst << 3;
-
- if (accToNext == DONT_MODIFY)
- accToNext = oldValue & 0x00000780;
- else
- accToNext = accToNext << 7;
-
- if (aleToWr == DONT_MODIFY)
- aleToWr = oldValue & 0x00003800;
- else
- aleToWr = aleToWr << 11;
-
- if (wrActive == DONT_MODIFY)
- wrActive = oldValue & 0x0001c000;
- else
- wrActive = wrActive << 14;
-
- if (wrHigh == DONT_MODIFY)
- wrHigh = oldValue & 0x000e0000;
- else
- wrHigh = wrHigh << 17;
-
- data =
- turnOff | accToFirst | accToNext | aleToWr | wrActive | wrHigh;
- switch (width) {
- case _8BIT:
- break;
- case _16BIT:
- data = data | _16BIT;
- break;
- case _32BIT:
- data = data | _32BIT;
- break;
- case _64BIT:
- data = data | _64BIT;
- break;
- default:
- return false;
- }
- if (paritySupport == true)
- data = data | PARITY_SUPPORT;
- GT_REG_WRITE(DEVICE_BANK0PARAMETERS + device * 4, data);
- return true;
-}
-
-/********************************************************************
-* remapAddress - This fubction used for address remapping
-* Inputs: - regOffset: remap register
-* remapHeader : remapped address
-* Returns: false if one of the parameters is erroneous,true otherwise.
-*********************************************************************/
-bool remapAddress(unsigned int remapReg, unsigned int remapValue)
-{
- unsigned int valueForReg;
- valueForReg = (remapValue & 0xffe00000) >> 21;
- GT_REG_WRITE(remapReg, valueForReg);
- return true;
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/misc.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/misc.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/misc.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/misc.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,313 +0,0 @@
-/*
- * arch/mips/galileo/misc.c
- *
- * This is a collection of several routines from gzip-1.0.3
- * adapted for Linux.
- *
- * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
- * puts by Nick Holloway 1993, better puts by Martin Mares 1995
- * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
- *
- * Modified by RidgeRun Inc.
- */
-
-#include <linux/vmalloc.h>
-#include <asm/io.h>
-/*
- * gzip declarations
- */
-
-#define OF(args) args
-#define STATIC static
-
-#define channel 1
-
-#undef memset
-#undef memcpy
-#define memzero(s, n) memset ((s), 0, (n))
-
-typedef unsigned char uch;
-typedef unsigned short ush;
-typedef unsigned long ulg;
-
-#define WSIZE 0x8000 /* Window size must be at least 32k, */
- /* and a power of two */
-
-static uch *inbuf; /* input buffer */
-static uch window[WSIZE]; /* Sliding window buffer */
-
-static unsigned insize = 0; /* valid bytes in inbuf */
-static unsigned inptr = 0; /* index of next byte to be processed in inbuf */
-static unsigned outcnt = 0; /* bytes in output buffer */
-
-/* gzip flag byte */
-#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */
-#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
-#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
-#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
-#define COMMENT 0x10 /* bit 4 set: file comment present */
-#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
-#define RESERVED 0xC0 /* bit 6,7: reserved */
-
-void variable_init();
-static void puts(const char *);
-
-void int2hex(int i)
-{
- int tth, th, h, t, d;
-
- if (i > 99999) {
- serial_putc(channel, "Error - int2hex outofbounds");
- return;
- }
-
- tth = (i) / 10000;
- th = (i - (tth * 10000)) / 1000;
- h = (i - ((tth * 10000) + (th * 1000))) / 100;
- t = (i - ((tth * 10000) + (th * 1000) + (h * 100))) / 10;
- d = (i - ((tth * 10000) + (th * 1000) + (h * 100) + (t * 10)));
- serial_putc(channel, tth + '0');
- serial_putc(channel, th + '0');
- serial_putc(channel, h + '0');
- serial_putc(channel, t + '0');
- serial_putc(channel, d + '0');
-}
-
-int checksum;
-int byte_count;
-static unsigned char *input_data;
-
-static int printCnt = 0;
-
-int get_byte()
-{
- unsigned char c = (inptr < insize ? inbuf[inptr++] : fill_inbuf());
- byte_count++;
- checksum += c;
-
- // if (printCnt++ < 150)
- // {
- // puts("\n");
- // puts("byte count = ");
- // int2hex(byte_count & 0xff);
- // puts(" byte val = ");
- // int2hex(c);
- // puts(" checksum = ");
- // int2hex(checksum & 0xff);
- // puts("\n");
- // }
- return c;
-}
-
-/* Diagnostic functions */
-#ifdef DEBUG
-# define Assert(cond,msg) {if(!(cond)) error(msg);}
-# define Trace(x) fprintf x
-# define Tracev(x) {if (verbose) fprintf x ;}
-# define Tracevv(x) {if (verbose>1) fprintf x ;}
-# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
-# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
-#else
-# define Assert(cond,msg)
-# define Trace(x)
-# define Tracev(x)
-# define Tracevv(x)
-# define Tracec(c,x)
-# define Tracecv(c,x)
-#endif
-
-static int fill_inbuf(void);
-static void flush_window(void);
-static void error(char *m);
-static void gzip_mark(void **);
-static void gzip_release(void **);
-
-/*
- * This is set up by the setup-routine at boot-time
- */
-
-
-#define STACK_SIZE (4096)
-long user_stack[STACK_SIZE];
-long *stack_start = &user_stack[STACK_SIZE];
-
-extern int linux_compressed_start;
-extern int linux_compressed_size;
-extern int malloc_start;
-
-static int input_len;
-
-static long bytes_out = 0;
-extern int kernel_location_start;
-static uch *output_data;
-static unsigned long output_ptr = 0;
-
-
-static void *malloc(int size);
-static void free(void *where);
-static void error(char *m);
-static void gzip_mark(void **);
-static void gzip_release(void **);
-
-static unsigned long free_mem_ptr;
-static unsigned long free_mem_end_ptr;
-
-#include "../../../../../lib/inflate.c"
-
-static void *malloc(int size)
-{
- void *p;
-
- if (size < 0)
- error("Malloc error\n");
- // if (free_mem_ptr <= 0) error("Memory error\n");
-
- free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */
-
- p = (void *) free_mem_ptr;
- free_mem_ptr += size;
-
- if (free_mem_ptr >= free_mem_end_ptr)
- error("\nOut of memory\n");
-
- return p;
-}
-
-static void free(void *where)
-{ /* Don't care */
-}
-
-static void gzip_mark(void **ptr)
-{
- *ptr = (void *) free_mem_ptr;
-}
-
-static void gzip_release(void **ptr)
-{
- free_mem_ptr = (long) *ptr;
-}
-
-static void puts(const char *s)
-{
- while (*s) {
- if (*s == 10)
- serial_putc(channel, 13);
- serial_putc(channel, *s++);
- }
-}
-
-void *memset(void *s, int c, size_t n)
-{
- int i;
- char *ss = (char *) s;
-
- for (i = 0; i < n; i++)
- ss[i] = c;
- return s;
-}
-
-void *memcpy(void *__dest, __const void *__src, size_t __n)
-{
- int i;
- char *d = (char *) __dest, *s = (char *) __src;
-
- for (i = 0; i < __n; i++)
- d[i] = s[i];
- return __dest;
-}
-
-/* ===========================================================================
- * Fill the input buffer. This is called only when the buffer is empty
- * and at least one byte is really needed.
- */
-static int fill_inbuf(void)
-{
- if (insize != 0) {
- error("ran out of input data\n");
- }
-
- inbuf = input_data;
- insize = input_len;
- inptr = 1;
- return inbuf[0];
-}
-
-/* ===========================================================================
- * Write the output window window[0..outcnt-1] and update crc and bytes_out.
- * (Used for the decompressed data only.)
- */
-static void flush_window(void)
-{
- ulg c = crc; /* temporary variable */
- unsigned n;
- uch *in, *out, ch;
-
- in = window;
- out = &output_data[output_ptr];
- for (n = 0; n < outcnt; n++) {
- ch = *out++ = *in++;
- c = crc_32_tab[((int) c ^ ch) & 0xff] ^ (c >> 8);
- }
- crc = c;
- bytes_out += (ulg) outcnt;
- output_ptr += (ulg) outcnt;
- outcnt = 0;
-}
-
-check_mem()
-{
- int i;
-
- puts("\ncplens = ");
- for (i = 0; i < 10; i++) {
- int2hex(cplens[i]);
- puts(" ");
- }
- puts("\ncplext = ");
- for (i = 0; i < 10; i++) {
- int2hex(cplext[i]);
- puts(" ");
- }
- puts("\nborder = ");
- for (i = 0; i < 10; i++) {
- int2hex(border[i]);
- puts(" ");
- }
- puts("\n");
-}
-
-static void error(char *x)
-{
- check_mem();
- puts("\n\n");
- puts(x);
- puts("byte_count = ");
- int2hex(byte_count);
- puts("\n");
- puts("\n\n -- System halted");
- while (1); /* Halt */
-}
-
-void variable_init()
-{
- byte_count = 0;
- checksum = 0;
- input_data = (unsigned char *) &linux_compressed_start;
- input_len = linux_compressed_size;
- output_data = &kernel_location_start;
- free_mem_ptr = (long) &malloc_start;
- free_mem_end_ptr = (long) ((char *) &malloc_start + 0x400000);
-}
-
-int decompress_kernel()
-{
- //check_mem();
-
- variable_init();
-
- makecrc();
- puts("Uncompressing Linux... \n");
- gunzip(); // ...see inflate.c
- puts("Ok, booting the kernel.\n");
- return 0;
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ns16550.h linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ns16550.h
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/ns16550.h 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/ns16550.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,126 +0,0 @@
-/* NS16550 UART registers */
-
-#ifndef NS16550H
-#define NS16550H
-
-#define UART_BASE 0xbd000000
-#define NS16550_CHANA PHYS_TO_K1(UART_BASE + 0x20)
-#define NS16550_CHANB PHYS_TO_K1(UART_BASE)
-
-#ifndef NS16550_HZ
-#define NS16550_HZ 3686400
-#endif
-
-#ifdef __ASSEMBLY__
-
-#ifndef NSREG
-#define NSREG(x) ((x)*4)
-#endif
-
-#define DATA NSREG(0) /* data register (R/W) */
-#define IER NSREG(1) /* interrupt enable (W) */
-#define IIR NSREG(2) /* interrupt identification (R) */
-#define FIFO IIR /* 16550 fifo control (W) */
-#define CFCR NSREG(3) /* line control register (R/W) */
-#define MCR NSREG(4) /* modem control register (R/W) */
-#define LSR NSREG(5) /* line status register (R/W) */
-#define MSR NSREG(6) /* modem status register (R/W) */
-#define SCR NSREG(7) /* scratch register (R/W) */
-
-#else
-
-#ifndef nsreg
-#if #endian(little)
-#define nsreg(x) unsigned :24; unsigned char x;
-#else
-/*#define nsreg(x) unsigned char x; unsigned :24;*/
-#define nsreg(x) unsigned int x:8;unsigned int :24;
-#endif
-#endif
-
-typedef struct {
- nsreg(data); /* data register (R/W) */
- nsreg(ier); /* interrupt enable (W) */
- nsreg(iir); /* interrupt identification (R) */
-#define fifo iir /* 16550 fifo control (W) */
- nsreg(cfcr); /* line control register (R/W) */
- nsreg(mcr); /* modem control register (R/W) */
- nsreg(lsr); /* line status register (R/W) */
- nsreg(msr); /* modem status register (R/W) */
- nsreg(scr); /* scratch register (R/W) */
-} ns16550dev;
-#endif
-
-
-/* 16 bit baud rate divisor (lower byte in dca_data, upper in dca_ier) */
-#define BRTC(x) (NS16550_HZ / (16*(x)))
-
-/* interrupt enable register */
-#define IER_ERXRDY 0x1 /* int on rx ready */
-#define IER_ETXRDY 0x2 /* int on tx ready */
-#define IER_ERLS 0x4 /* int on line status change */
-#define IER_EMSC 0x8 /* int on modem status change */
-
-/* interrupt identification register */
-#define IIR_IMASK 0xf /* mask */
-#define IIR_RXTOUT 0xc /* receive timeout */
-#define IIR_RLS 0x6 /* receive line status */
-#define IIR_RXRDY 0x4 /* receive ready */
-#define IIR_TXRDY 0x2 /* transmit ready */
-#define IIR_NOPEND 0x1 /* nothing */
-#define IIR_MLSC 0x0 /* modem status */
-#define IIR_FIFO_MASK 0xc0 /* set if FIFOs are enabled */
-
-/* fifo control register */
-#define FIFO_ENABLE 0x01 /* enable fifo */
-#define FIFO_RCV_RST 0x02 /* reset receive fifo */
-#define FIFO_XMT_RST 0x04 /* reset transmit fifo */
-#define FIFO_DMA_MODE 0x08 /* enable dma mode */
-#define FIFO_TRIGGER_1 0x00 /* trigger at 1 char */
-#define FIFO_TRIGGER_4 0x40 /* trigger at 4 chars */
-#define FIFO_TRIGGER_8 0x80 /* trigger at 8 chars */
-#define FIFO_TRIGGER_14 0xc0 /* trigger at 14 chars */
-
-/* character format control register */
-#define CFCR_DLAB 0x80 /* divisor latch */
-#define CFCR_SBREAK 0x40 /* send break */
-#define CFCR_PZERO 0x30 /* zero parity */
-#define CFCR_PONE 0x20 /* one parity */
-#define CFCR_PEVEN 0x10 /* even parity */
-#define CFCR_PODD 0x00 /* odd parity */
-#define CFCR_PENAB 0x08 /* parity enable */
-#define CFCR_STOPB 0x04 /* 2 stop bits */
-#define CFCR_8BITS 0x03 /* 8 data bits */
-#define CFCR_7BITS 0x02 /* 7 data bits */
-#define CFCR_6BITS 0x01 /* 6 data bits */
-#define CFCR_5BITS 0x00 /* 5 data bits */
-
-/* modem control register */
-#define MCR_LOOPBACK 0x10 /* loopback */
-#define MCR_IENABLE 0x08 /* output 2 = int enable */
-#define MCR_DRS 0x04 /* output 1 = xxx */
-#define MCR_RTS 0x02 /* enable RTS */
-#define MCR_DTR 0x01 /* enable DTR */
-
-/* line status register */
-#define LSR_RCV_FIFO 0x80 /* error in receive fifo */
-#define LSR_TSRE 0x40 /* transmitter empty */
-#define LSR_TXRDY 0x20 /* transmitter ready */
-#define LSR_BI 0x10 /* break detected */
-#define LSR_FE 0x08 /* framing error */
-#define LSR_PE 0x04 /* parity error */
-#define LSR_OE 0x02 /* overrun error */
-#define LSR_RXRDY 0x01 /* receiver ready */
-#define LSR_RCV_MASK 0x1f
-
-/* modem status register */
-#define MSR_DCD 0x80 /* DCD active */
-#define MSR_RI 0x40 /* RI active */
-#define MSR_DSR 0x20 /* DSR active */
-#define MSR_CTS 0x10 /* CTS active */
-#define MSR_DDCD 0x08 /* DCD changed */
-#define MSR_TERI 0x04 /* RI changed */
-#define MSR_DDSR 0x02 /* DSR changed */
-#define MSR_DCTS 0x01 /* CTS changed */
-
-#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/osdep.h linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/osdep.h
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/osdep.h 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/osdep.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,36 +0,0 @@
-#ifndef __OSDEP_H__
-#define __OSDEP_H__
-
-/*
- * This program 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, or (at
- * your option) any later version.
- */
-
-#if defined(__linux__) || defined(__FreeBSD__) || defined (__MIPSEB__)
-#define ETHERBOOT32
-#define ntohl(x) (x)
-#define htonl(x) (x)
-#define ntohs(x) (x)
-#define htons(x) (x)
-
-#endif
-
-
-
-
-/* ANSI prototyping macro */
-#ifdef __STDC__
-#define P(x) x
-#else
-#define P(x) ()
-#endif
-
-#endif
-
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/pci.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/pci.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/pci.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/pci.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,1336 +0,0 @@
-/* PCI.c - PCI functions */
-
-/* Copyright - Galileo technology. */
-
-#ifdef __linux__
-#include <asm/galileo-boards/evb64120A/core.h>
-#include <asm/galileo-boards/evb64120A/pci.h>
-#ifndef PROM
-#include <linux/kernel.h>
-#endif
-
-#undef PCI_DEBUG
-
-#ifdef PCI_DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
-#else
-#include "core.h"
-#include "pci.h"
-#include <string.h>
-#endif
-
-/********************************************************************
-* pci0ScanDevices - This function scan PCI0 bus, if found any device on
-* this bus it interrogate the Device for the information
-* it can discover.
-* The fields with all information are the following:
-* char type[20];
-* unsigned int deviceNum;
-* unsigned int venID;
-* unsigned int deviceID;
-* unsigned int bar0Base;
-* unsigned int bar0Size;
-* unsigned int bar1Base;
-* unsigned int bar1Size;
-* unsigned int bar2Base;
-* unsigned int bar2Size;
-* unsigned int bar3Base;
-* unsigned int bar3Size;
-* unsigned int bar4Base;
-* unsigned int bar4Size;
-* unsigned int bar5Base;
-* unsigned int bar5Size;
-*
-* Inputs: PCI0_DEVICE* pci0Detect - Pointer to an array of STRUCT PCI0_DEVICE.
-* unsigned int numberOfElment - The PCI0_DEVICE Array length.
-* Output: None.
-*********************************************************************/
-
-void pci0ScanDevices(PCI_DEVICE * pci0Detect, unsigned int numberOfElment)
-{
- PCI_DEVICE *pci0ArrayPointer = pci0Detect;
- unsigned int id; /* PCI Configuration register 0x0. */
- unsigned int device; /* device`s Counter. */
- unsigned int classCode; /* PCI Configuration register 0x8 */
- unsigned int arrayCounter = 0;
- unsigned int memBaseAddress;
- unsigned int memSize;
- unsigned int c18RegValue;
-
- PCI0_MASTER_ENABLE(SELF);
- /* According to PCI REV 2.1 MAX agents on the bus are -21- */
- for (device = 6; device < 8; device++) {
- id = pci0ReadConfigReg(PCI_0DEVICE_AND_VENDOR_ID, device);
- GT_REG_READ(INTERRUPT_CAUSE_REGISTER, &c18RegValue);
- /* Clearing bit 18 of in the Cause Register 0xc18 by writting 0. */
- GT_REG_WRITE(INTERRUPT_CAUSE_REGISTER,
- c18RegValue & 0xfffbffff);
- if ((id != 0xffffffff) && !(c18RegValue & 0x40000)) {
- classCode =
- pci0ReadConfigReg
- (PCI_0CLASS_CODE_AND_REVISION_ID, device);
- pci0ArrayPointer->deviceNum = device;
- pci0ArrayPointer->venID = (id & 0xffff);
- pci0ArrayPointer->deviceID =
- ((id & 0xffff0000) >> 16);
- DBG("\nrr: venID %x devID %x\n",
- pci0ArrayPointer->venID,
- pci0ArrayPointer->deviceID);
- DBG("rr: device found %x\n",
- pci0ArrayPointer->deviceNum);
- /* BAR0 parameters */
- memBaseAddress = pci0ReadConfigReg(BAR0, device);
- pci0ArrayPointer->bar0Type = memBaseAddress & 1;
- pci0ArrayPointer->bar0Base =
- memBaseAddress & 0xfffff000;
- pci0WriteConfigReg(BAR0, device, 0xffffffff);
- memSize = pci0ReadConfigReg(BAR0, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci0ArrayPointer->bar0Size = 0;
- } else {
- if (pci0ArrayPointer->bar0Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci0ArrayPointer->bar0Size = memSize;
- }
- DBG("rr: device BAR0 size %x\n", memSize);
- DBG("rr: device BAR0 address %x\n",
- memBaseAddress);
- pci0WriteConfigReg(BAR0, device, memBaseAddress);
- /* BAR1 parameters */
- memBaseAddress = pci0ReadConfigReg(BAR1, device);
- pci0ArrayPointer->bar1Type = memBaseAddress & 1;
- pci0ArrayPointer->bar1Base =
- memBaseAddress & 0xfffff000;
- pci0WriteConfigReg(BAR1, device, 0xffffffff);
- memSize = pci0ReadConfigReg(BAR1, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci0ArrayPointer->bar1Size = 0;
- } else {
- if (pci0ArrayPointer->bar1Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci0ArrayPointer->bar1Size = memSize;
- }
- DBG("rr: device BAR1 size %x\n", memSize);
- DBG("rr: device BAR1 address %x\n",
- memBaseAddress);
- pci0WriteConfigReg(BAR1, device, memBaseAddress);
- /* BAR2 parameters */
- memBaseAddress = pci0ReadConfigReg(BAR2, device);
- pci0ArrayPointer->bar2Type = memBaseAddress & 1;
- pci0ArrayPointer->bar2Base =
- memBaseAddress & 0xfffff000;
- pci0WriteConfigReg(BAR2, device, 0xffffffff);
- memSize = pci0ReadConfigReg(BAR2, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci0ArrayPointer->bar2Size = 0;
- } else {
- if (pci0ArrayPointer->bar2Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci0ArrayPointer->bar2Size = memSize;
- }
- DBG("rr: device BAR2 size %x\n", memSize);
- DBG("rr: device BAR2 address %x\n",
- memBaseAddress);
- pci0WriteConfigReg(BAR2, device, memBaseAddress);
- /* BAR3 parameters */
- memBaseAddress = pci0ReadConfigReg(BAR3, device);
- pci0ArrayPointer->bar3Type = memBaseAddress & 1;
- pci0ArrayPointer->bar3Base =
- memBaseAddress & 0xfffff000;
- pci0WriteConfigReg(BAR3, device, 0xffffffff);
- memSize = pci0ReadConfigReg(BAR3, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci0ArrayPointer->bar3Size = 0;
- } else {
- if (pci0ArrayPointer->bar3Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci0ArrayPointer->bar3Size = memSize;
- }
- DBG("rr: device BAR3 size %x\n", memSize);
- DBG("rr: device BAR3 address %x\n",
- memBaseAddress);
- pci0WriteConfigReg(BAR3, device, memBaseAddress);
- /* BAR4 parameters */
- memBaseAddress = pci0ReadConfigReg(BAR4, device);
- pci0ArrayPointer->bar4Type = memBaseAddress & 1;
- pci0ArrayPointer->bar4Base =
- memBaseAddress & 0xfffff000;
- pci0WriteConfigReg(BAR4, device, 0xffffffff);
- memSize = pci0ReadConfigReg(BAR4, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci0ArrayPointer->bar4Size = 0;
- } else {
- if (pci0ArrayPointer->bar4Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci0ArrayPointer->bar4Size = memSize;
- }
- DBG("rr: device BAR4 size %x\n", memSize);
- DBG("rr: device BAR4 address %x\n",
- memBaseAddress);
- pci0WriteConfigReg(BAR4, device, memBaseAddress);
- /* BAR5 parameters */
- memBaseAddress = pci0ReadConfigReg(BAR5, device);
- pci0ArrayPointer->bar5Type = memBaseAddress & 1;
- pci0ArrayPointer->bar5Base =
- memBaseAddress & 0xfffff000;
- pci0WriteConfigReg(BAR5, device, 0xffffffff);
- memSize = pci0ReadConfigReg(BAR5, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci0ArrayPointer->bar5Size = 0;
- } else {
- if (pci0ArrayPointer->bar5Type == 1) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci0ArrayPointer->bar5Size = memSize;
- }
- DBG("rr: device BAR5 size %x\n", memSize);
- DBG("rr: device BAR5 address %x\n",
- memBaseAddress);
- pci0WriteConfigReg(BAR5, device, memBaseAddress);
- /* End of BARs Detection. */
-
- classCode = ((classCode & 0xff000000) >> 24);
- switch (classCode) {
- case 0x0:
- strcpy(pci0ArrayPointer->type,
- "Old generation device");
- break;
- case 0x1:
- strcpy(pci0ArrayPointer->type,
- "Mass storage controller");
- break;
- case 0x2:
- strcpy(pci0ArrayPointer->type,
- "Network controller");
- break;
- case 0x3:
- strcpy(pci0ArrayPointer->type,
- "Display controller");
- break;
- case 0x4:
- strcpy(pci0ArrayPointer->type,
- "Multimedia device");
- break;
- case 0x5:
- strcpy(pci0ArrayPointer->type,
- "Memory controller");
- break;
- case 0x6:
- strcpy(pci0ArrayPointer->type,
- "Bridge Device");
- break;
- case 0x7:
- strcpy(pci0ArrayPointer->type,
- "Simple Communication controllers");
- break;
- case 0x8:
- strcpy(pci0ArrayPointer->type,
- "Base system peripherals");
- break;
- case 0x9:
- strcpy(pci0ArrayPointer->type,
- "Input Devices");
- break;
- case 0xa:
- strcpy(pci0ArrayPointer->type,
- "Docking stations");
- break;
- case 0xb:
- strcpy(pci0ArrayPointer->type,
- "Processors");
- break;
- case 0xc:
- strcpy(pci0ArrayPointer->type,
- "Serial bus controllers");
- break;
- case 0xd:
- strcpy(pci0ArrayPointer->type,
- "Wireless controllers");
- break;
- case 0xe:
- strcpy(pci0ArrayPointer->type,
- "Intelligent I/O controllers");
- break;
- case 0xf:
- strcpy(pci0ArrayPointer->type,
- "Satellite communication controllers");
- break;
- case 0x10:
- strcpy(pci0ArrayPointer->type,
- "Encryption/Decryption controllers");
- break;
- case 0x11:
- strcpy(pci0ArrayPointer->type,
- "Data acquisition and signal processing controllers");
- break;
- default:
- break;
-
- }
- arrayCounter++; /* point to the next element in the Array. */
- if (arrayCounter == numberOfElment)
- return; /* When the Array is fully used, return. */
- /* Else, points to next free Element. */
- pci0ArrayPointer = &pci0Detect[arrayCounter];
- }
- }
- pci0ArrayPointer->deviceNum = 0; /* 0 => End of List */
-}
-
-
-/********************************************************************
-* pci1ScanDevices - This function scan PCI1 bus, if found any device on
-* this bus it interrogate the Device for the information
-* it can discover.
-* The fields with all information are the following:
-* char type[20];
-* unsigned int deviceNum;
-* unsigned int venID;
-* unsigned int deviceID;
-* unsigned int bar0Base;
-* unsigned int bar0Size;
-* unsigned int bar1Base;
-* unsigned int bar1Size;
-* unsigned int bar2Base;
-* unsigned int bar2Size;
-* unsigned int bar3Base;
-* unsigned int bar3Size;
-* unsigned int bar4Base;
-* unsigned int bar4Size;
-* unsigned int bar5Base;
-* unsigned int bar5Size;
-*
-* Inputs: Pointer to an array of STRUCT PCI1_DEVICE.
-* Output: None.
-*********************************************************************/
-
-void pci1ScanDevices(PCI_DEVICE * pci1Detect, unsigned int numberOfElment)
-{
- PCI_DEVICE *pci1ArrayPointer = pci1Detect;
- unsigned int id; /* PCI Configuration register 0x0. */
- unsigned int device; /* device`s Counter. */
- unsigned int classCode; /* PCI Configuration register 0x8 */
- unsigned int arrayCounter = 0;
- unsigned int memBaseAddress;
- unsigned int memSize;
- unsigned int c98RegValue;
-
- PCI1_MASTER_ENABLE(SELF);
- /* According to PCI REV 2.1 MAX agents on the bus are -21- */
- for (device = 1; device < 22; device++) {
- id = pci1ReadConfigReg(PCI_0DEVICE_AND_VENDOR_ID, device);
- GT_REG_READ(HIGH_INTERRUPT_CAUSE_REGISTER, &c98RegValue);
- /* Clearing bit 18 of in the High Cause Register 0xc98 */
- GT_REG_WRITE(HIGH_INTERRUPT_CAUSE_REGISTER,
- c98RegValue & 0xfffbffff);
- if ((id != 0xffffffff) && !(c98RegValue & 0x40000)) {
- classCode =
- pci1ReadConfigReg
- (PCI_0CLASS_CODE_AND_REVISION_ID, device);
- pci1ArrayPointer->deviceNum = device;
- pci1ArrayPointer->venID = (id & 0xffff);
- pci1ArrayPointer->deviceID =
- ((id & 0xffff0000) >> 16);
-
- /* BAR0 parameters */
- memBaseAddress = pci1ReadConfigReg(BAR0, device);
- pci1ArrayPointer->bar0Type = memBaseAddress & 1;
- pci1ArrayPointer->bar0Base =
- memBaseAddress & 0xfffff000;
- pci1WriteConfigReg(BAR0, device, 0xffffffff);
- memSize = pci1ReadConfigReg(BAR0, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci1ArrayPointer->bar0Size = 0;
- } else {
- if (pci1ArrayPointer->bar0Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci1ArrayPointer->bar0Size = memSize;
- }
- pci1WriteConfigReg(BAR0, device, memBaseAddress);
- /* BAR1 parameters */
- memBaseAddress = pci1ReadConfigReg(BAR1, device);
- pci1ArrayPointer->bar1Type = memBaseAddress & 1;
- pci1ArrayPointer->bar1Base =
- memBaseAddress & 0xfffff000;
- pci1WriteConfigReg(BAR1, device, 0xffffffff);
- memSize = pci1ReadConfigReg(BAR1, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci1ArrayPointer->bar1Size = 0;
- } else {
- if (pci1ArrayPointer->bar1Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci1ArrayPointer->bar1Size = memSize;
- }
- pci1WriteConfigReg(BAR1, device, memBaseAddress);
- /* BAR2 parameters */
- memBaseAddress = pci1ReadConfigReg(BAR2, device);
- pci1ArrayPointer->bar2Type = memBaseAddress & 1;
- pci1ArrayPointer->bar2Base =
- memBaseAddress & 0xfffff000;
- pci1WriteConfigReg(BAR2, device, 0xffffffff);
- memSize = pci1ReadConfigReg(BAR2, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci1ArrayPointer->bar2Size = 0;
- } else {
- if (pci1ArrayPointer->bar2Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci1ArrayPointer->bar2Size = memSize;
- }
- pci1WriteConfigReg(BAR2, device, memBaseAddress);
- /* BAR3 parameters */
- memBaseAddress = pci1ReadConfigReg(BAR3, device);
- pci1ArrayPointer->bar3Type = memBaseAddress & 1;
- pci1ArrayPointer->bar3Base =
- memBaseAddress & 0xfffff000;
- pci1WriteConfigReg(BAR3, device, 0xffffffff);
- memSize = pci1ReadConfigReg(BAR3, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci1ArrayPointer->bar3Size = 0;
- } else {
- if (pci1ArrayPointer->bar3Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci1ArrayPointer->bar3Size = memSize;
- }
- pci1WriteConfigReg(BAR3, device, memBaseAddress);
- /* BAR4 parameters */
- memBaseAddress = pci1ReadConfigReg(BAR4, device);
- pci1ArrayPointer->bar4Type = memBaseAddress & 1;
- pci1ArrayPointer->bar4Base =
- memBaseAddress & 0xfffff000;
- pci1WriteConfigReg(BAR4, device, 0xffffffff);
- memSize = pci1ReadConfigReg(BAR4, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci1ArrayPointer->bar4Size = 0;
- } else {
- if (pci1ArrayPointer->bar4Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci1ArrayPointer->bar4Size = memSize;
- }
- pci1WriteConfigReg(BAR4, device, memBaseAddress);
- /* BAR5 parameters */
- memBaseAddress = pci1ReadConfigReg(BAR5, device);
- pci1ArrayPointer->bar5Type = memBaseAddress & 1;
- pci1ArrayPointer->bar5Base =
- memBaseAddress & 0xfffff000;
- pci1WriteConfigReg(BAR5, device, 0xffffffff);
- memSize = pci1ReadConfigReg(BAR5, device);
- if (memSize == 0) { /* case of an empty BAR */
- pci1ArrayPointer->bar5Size = 0;
- } else {
- if (pci1ArrayPointer->bar5Type == 0) /* memory space */
- memSize =
- ~(memSize & 0xfffffff0) + 1;
- else /* IO space */
- memSize =
- ~(memSize & 0xfffffffc) + 1;
- pci1ArrayPointer->bar5Size = memSize;
- }
- pci1WriteConfigReg(BAR5, device, memBaseAddress);
- /* End of BARs Detection. */
-
- classCode = ((classCode & 0xff000000) >> 24);
- switch (classCode) {
- case 0x0:
- strcpy(pci1ArrayPointer->type,
- "Old generation device");
- break;
- case 0x1:
- strcpy(pci1ArrayPointer->type,
- "Mass storage controller");
- break;
- case 0x2:
- strcpy(pci1ArrayPointer->type,
- "Network controller");
- break;
- case 0x3:
- strcpy(pci1ArrayPointer->type,
- "Display controller");
- break;
- case 0x4:
- strcpy(pci1ArrayPointer->type,
- "Multimedia device");
- break;
- case 0x5:
- strcpy(pci1ArrayPointer->type,
- "Memory controller");
- break;
- case 0x6:
- strcpy(pci1ArrayPointer->type,
- "Bridge Device");
- break;
- case 0x7:
- strcpy(pci1ArrayPointer->type,
- "Simple Communication controllers");
- break;
- case 0x8:
- strcpy(pci1ArrayPointer->type,
- "Base system peripherals");
- break;
- case 0x9:
- strcpy(pci1ArrayPointer->type,
- "Input Devices");
- break;
- case 0xa:
- strcpy(pci1ArrayPointer->type,
- "Docking stations");
- break;
- case 0xb:
- strcpy(pci1ArrayPointer->type,
- "Processors");
- break;
- case 0xc:
- strcpy(pci1ArrayPointer->type,
- "Serial bus controllers");
- break;
- case 0xd:
- strcpy(pci1ArrayPointer->type,
- "Wireless controllers");
- break;
- case 0xe:
- strcpy(pci1ArrayPointer->type,
- "Intelligent I/O controllers");
- break;
- case 0xf:
- strcpy(pci1ArrayPointer->type,
- "Satellite communication controllers");
- break;
- case 0x10:
- strcpy(pci1ArrayPointer->type,
- "Encryption/Decryption controllers");
- break;
- case 0x11:
- strcpy(pci1ArrayPointer->type,
- "Data acquisition and signal processing controllers");
- break;
- }
- arrayCounter++; /* point to the next element in the Array. */
- if (arrayCounter == numberOfElment)
- return; /* When the Array is fully used, return. */
- /* Else, points to next free Element. */
- pci1ArrayPointer = &pci1Detect[arrayCounter];
- }
- }
- pci1ArrayPointer->deviceNum = 0; /* 0 => End of List */
-}
-
-/********************************************************************
-* pci0WriteConfigReg - Write to a PCI configuration register
-* - Make sure the GT is configured as a master before
-* writingto another device on the PCI.
-* - The function takes care of Big/Little endian conversion.
-* Inputs: unsigned int regOffset: The register offset as it apears in the GT spec
-* (or any other PCI device spec)
-* pciDevNum: The device number needs to be addressed.
-*
-* Configuration Address 0xCF8:
-*
-* 31 30 24 23 16 15 11 10 8 7 2 0 <=bit Number
-* |congif|Reserved| Bus |Device|Function|Register|00|
-* |Enable| |Number|Number| Number | Number | | <=field Name
-*
-*********************************************************************/
-
-void pci0WriteConfigReg(unsigned int regOffset, unsigned int pciDevNum,
- unsigned int data)
-{
- unsigned int DataForRegCf8;
- unsigned int functionNum;
-
- functionNum = regOffset & 0x00000700;
- pciDevNum = pciDevNum << 11;
- regOffset = regOffset & 0x0fffffff;
- DataForRegCf8 = (regOffset | pciDevNum | functionNum) | BIT31;
- GT_REG_WRITE(PCI_0CONFIGURATION_ADDRESS, DataForRegCf8);
- if (pciDevNum == SELF) { /* This board */
- GT_REG_WRITE(PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER,
- data);
- } else { /* configuration Transaction over the pci. */
-
- /* The PCI is working in LE Mode So it swap the Data. */
- GT_REG_WRITE(PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER,
- WORDSWAP(data));
- }
-}
-
-/********************************************************************
-* pci1WriteConfigReg - Write to a PCI configuration register
-* - Make sure the GT is configured as a master before writing
-* to another device on the PCI.
-* - The function takes care of Big/Little endian conversion.
-* Inputs: unsigned int regOffset: The register offset as it apears in the
-* GT spec (or any other PCI device spec)
-* pciDevNum: The device number needs to be addressed.
-*
-* Configuration Address 0xCF8:
-*
-* 31 30 24 23 16 15 11 10 8 7 2 0 <=bit Number
-* |congif|Reserved| Bus |Device|Function|Register|00|
-* |Enable| |Number|Number| Number | Number | | <=field Name
-*
-*********************************************************************/
-
-void pci1WriteConfigReg(unsigned int regOffset, unsigned int pciDevNum,
- unsigned int data)
-{
- unsigned int DataForRegCf8;
- unsigned int functionNum;
-
- functionNum = regOffset & 0x00000700;
- pciDevNum = pciDevNum << 11;
- regOffset = regOffset & 0x0fffffff;
- if (pciDevNum == SELF) { /* This board */
- /* when configurating our own PCI 1 L-unit the access is through
- the PCI 0 interface with reg number = reg number + 0x80 */
- DataForRegCf8 =
- (regOffset | pciDevNum | functionNum | 0x80) | BIT31;
- GT_REG_WRITE(PCI_0CONFIGURATION_ADDRESS, DataForRegCf8);
- } else {
- DataForRegCf8 =
- (regOffset | pciDevNum | functionNum) | BIT31;
- GT_REG_WRITE(PCI_1CONFIGURATION_ADDRESS, DataForRegCf8);
- }
- if (pciDevNum == SELF) { /* This board */
- GT_REG_WRITE(PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER,
- data);
- } else {
- GT_REG_WRITE(PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER,
- WORDSWAP(data));
- }
-}
-
-/********************************************************************
-* pci0ReadConfigReg - Read from a PCI0 configuration register
-* - Make sure the GT is configured as a master before
-* reading from another device on the PCI.
-* - The function takes care of Big/Little endian conversion.
-* INPUTS: regOffset: The register offset as it apears in the GT spec (or PCI
-* spec)
-* pciDevNum: The device number needs to be addressed.
-* RETURNS: data , if the data == 0xffffffff check the master abort bit in the
-* cause register to make sure the data is valid
-*
-* Configuration Address 0xCF8:
-*
-* 31 30 24 23 16 15 11 10 8 7 2 0 <=bit Number
-* |congif|Reserved| Bus |Device|Function|Register|00|
-* |Enable| |Number|Number| Number | Number | | <=field Name
-*
-*********************************************************************/
-
-unsigned int pci0ReadConfigReg(unsigned int regOffset,
- unsigned int pciDevNum)
-{
- unsigned int DataForRegCf8;
- unsigned int data;
- unsigned int functionNum;
-
- functionNum = regOffset & 0x00000700;
- pciDevNum = pciDevNum << 11;
- regOffset = regOffset & 0x0fffffff;
- DataForRegCf8 = (regOffset | pciDevNum | functionNum) | BIT31;
- GT_REG_WRITE(PCI_0CONFIGURATION_ADDRESS, DataForRegCf8);
- if (pciDevNum == SELF) { /* This board */
- GT_REG_READ(PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER,
- &data);
- return data;
- } else { /* The PCI is working in LE Mode So it swap the Data. */
-
- GT_REG_READ(PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER,
- &data);
- return WORDSWAP(data);
- }
-}
-
-/********************************************************************
-* pci1ReadConfigReg - Read from a PCI1 configuration register
-* - Make sure the GT is configured as a master before
-* reading from another device on the PCI.
-* - The function takes care of Big/Little endian conversion.
-* INPUTS: regOffset: The register offset as it apears in the GT spec (or PCI
-* spec)
-* pciDevNum: The device number needs to be addressed.
-* RETURNS: data , if the data == 0xffffffff check the master abort bit in the
-* cause register to make sure the data is valid
-*
-* Configuration Address 0xCF8:
-*
-* 31 30 24 23 16 15 11 10 8 7 2 0 <=bit Number
-* |congif|Reserved| Bus |Device|Function|Register|00|
-* |Enable| |Number|Number| Number | Number | | <=field Name
-*
-*********************************************************************/
-
-unsigned int pci1ReadConfigReg(unsigned int regOffset,
- unsigned int pciDevNum)
-{
- unsigned int DataForRegCf8;
- unsigned int data;
- unsigned int functionNum;
-
- functionNum = regOffset & 0x00000700;
- pciDevNum = pciDevNum << 11;
- regOffset = regOffset & 0x0fffffff;
- if (pciDevNum == SELF) { /* This board */
- /* when configurating our own PCI 1 L-unit the access is through
- the PCI 0 interface with reg number = reg number + 0x80 */
- DataForRegCf8 =
- (regOffset | pciDevNum | functionNum | 0x80) | BIT31;
- GT_REG_WRITE(PCI_0CONFIGURATION_ADDRESS, DataForRegCf8);
- } else {
- DataForRegCf8 =
- (regOffset | pciDevNum | functionNum) | BIT31;
- GT_REG_WRITE(PCI_1CONFIGURATION_ADDRESS, DataForRegCf8);
- }
- if (pciDevNum == SELF) { /* This board */
- GT_REG_READ(PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER,
- &data);
- return data;
- } else {
- GT_REG_READ(PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER,
- &data);
- return WORDSWAP(data);
- }
-}
-
-/********************************************************************
-* pci0MapIOspace - Maps PCI0 IO space for the master.
-* Inputs: base and length of pci0Io
-*********************************************************************/
-
-void pci0MapIOspace(unsigned int pci0IoBase, unsigned int pci0IoLength)
-{
- unsigned int pci0IoTop =
- (unsigned int) (pci0IoBase + pci0IoLength);
-
- if (pci0IoLength == 0)
- pci0IoTop++;
-
- pci0IoBase = (unsigned int) (pci0IoBase >> 21);
- pci0IoTop = (unsigned int) (((pci0IoTop - 1) & 0x0fffffff) >> 21);
- GT_REG_WRITE(PCI_0I_O_LOW_DECODE_ADDRESS, pci0IoBase);
- GT_REG_WRITE(PCI_0I_O_HIGH_DECODE_ADDRESS, pci0IoTop);
-}
-
-/********************************************************************
-* pci1MapIOspace - Maps PCI1 IO space for the master.
-* Inputs: base and length of pci1Io
-*********************************************************************/
-
-void pci1MapIOspace(unsigned int pci1IoBase, unsigned int pci1IoLength)
-{
- unsigned int pci1IoTop =
- (unsigned int) (pci1IoBase + pci1IoLength);
-
- if (pci1IoLength == 0)
- pci1IoTop++;
-
- pci1IoBase = (unsigned int) (pci1IoBase >> 21);
- pci1IoTop = (unsigned int) (((pci1IoTop - 1) & 0x0fffffff) >> 21);
- GT_REG_WRITE(PCI_1I_O_LOW_DECODE_ADDRESS, pci1IoBase);
- GT_REG_WRITE(PCI_1I_O_HIGH_DECODE_ADDRESS, pci1IoTop);
-}
-
-/********************************************************************
-* pci0MapMemory0space - Maps PCI0 memory0 space for the master.
-* Inputs: base and length of pci0Mem0
-*********************************************************************/
-
-
-void pci0MapMemory0space(unsigned int pci0Mem0Base,
- unsigned int pci0Mem0Length)
-{
- unsigned int pci0Mem0Top = pci0Mem0Base + pci0Mem0Length;
-
- if (pci0Mem0Length == 0)
- pci0Mem0Top++;
-
- pci0Mem0Base = pci0Mem0Base >> 21;
- pci0Mem0Top = ((pci0Mem0Top - 1) & 0x0fffffff) >> 21;
- GT_REG_WRITE(PCI_0MEMORY0_LOW_DECODE_ADDRESS, pci0Mem0Base);
- GT_REG_WRITE(PCI_0MEMORY0_HIGH_DECODE_ADDRESS, pci0Mem0Top);
-}
-
-/********************************************************************
-* pci1MapMemory0space - Maps PCI1 memory0 space for the master.
-* Inputs: base and length of pci1Mem0
-*********************************************************************/
-
-void pci1MapMemory0space(unsigned int pci1Mem0Base,
- unsigned int pci1Mem0Length)
-{
- unsigned int pci1Mem0Top = pci1Mem0Base + pci1Mem0Length;
-
- if (pci1Mem0Length == 0)
- pci1Mem0Top++;
-
- pci1Mem0Base = pci1Mem0Base >> 21;
- pci1Mem0Top = ((pci1Mem0Top - 1) & 0x0fffffff) >> 21;
- GT_REG_WRITE(PCI_1MEMORY0_LOW_DECODE_ADDRESS, pci1Mem0Base);
- GT_REG_WRITE(PCI_1MEMORY0_HIGH_DECODE_ADDRESS, pci1Mem0Top);
-}
-
-/********************************************************************
-* pci0MapMemory1space - Maps PCI0 memory1 space for the master.
-* Inputs: base and length of pci0Mem1
-*********************************************************************/
-
-void pci0MapMemory1space(unsigned int pci0Mem1Base,
- unsigned int pci0Mem1Length)
-{
- unsigned int pci0Mem1Top = pci0Mem1Base + pci0Mem1Length;
-
- if (pci0Mem1Length == 0)
- pci0Mem1Top++;
-
- pci0Mem1Base = pci0Mem1Base >> 21;
- pci0Mem1Top = ((pci0Mem1Top - 1) & 0x0fffffff) >> 21;
- GT_REG_WRITE(PCI_0MEMORY1_LOW_DECODE_ADDRESS, pci0Mem1Base);
- GT_REG_WRITE(PCI_0MEMORY1_HIGH_DECODE_ADDRESS, pci0Mem1Top);
-#ifndef PROM
- DBG(KERN_INFO "pci0Mem1Base %x\n", pci0Mem1Base);
- DBG(KERN_INFO "pci0Mem1Top %x\n", pci0Mem1Top);
- GT_REG_READ(PCI_0MEMORY0_ADDRESS_REMAP, &pci0Mem1Base);
- DBG(KERN_INFO "Mem 0/0 remap %x\n", pci0Mem1Base);
- GT_REG_READ(PCI_0MEMORY1_ADDRESS_REMAP, &pci0Mem1Base);
- DBG(KERN_INFO "Mem 0/1 remap %x\n", pci0Mem1Base);
- GT_REG_WRITE(PCI_0MEMORY1_ADDRESS_REMAP, 0x500);
- GT_REG_READ(PCI_0MEMORY1_ADDRESS_REMAP, &pci0Mem1Base);
- DBG(KERN_INFO "Mem 0/1 remapped %x\n", pci0Mem1Base);
-#endif
-}
-
-/********************************************************************
-* pci1MapMemory1space - Maps PCI1 memory1 space for the master.
-* Inputs: base and length of pci1Mem1
-*********************************************************************/
-
-void pci1MapMemory1space(unsigned int pci1Mem1Base,
- unsigned int pci1Mem1Length)
-{
- unsigned int pci1Mem1Top = pci1Mem1Base + pci1Mem1Length;
-
- if (pci1Mem1Length == 0)
- pci1Mem1Top++;
-
- pci1Mem1Base = pci1Mem1Base >> 21;
- pci1Mem1Top = ((pci1Mem1Top - 1) & 0x0fffffff) >> 21;
- GT_REG_WRITE(PCI_1MEMORY1_LOW_DECODE_ADDRESS, pci1Mem1Base);
- GT_REG_WRITE(PCI_1MEMORY1_HIGH_DECODE_ADDRESS, pci1Mem1Top);
-}
-
-/********************************************************************
-* pci0GetIOspaceBase - Return PCI0 IO Base Address.
-* Inputs: N/A
-* Returns: PCI0 IO Base Address.
-*********************************************************************/
-
-unsigned int pci0GetIOspaceBase()
-{
- unsigned int base;
- GT_REG_READ(PCI_0I_O_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- return base;
-}
-
-/********************************************************************
-* pci0GetIOspaceSize - Return PCI0 IO Bar Size.
-* Inputs: N/A
-* Returns: PCI0 IO Bar Size.
-*********************************************************************/
-
-unsigned int pci0GetIOspaceSize()
-{
- unsigned int top, base, size;
- GT_REG_READ(PCI_0I_O_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- GT_REG_READ(PCI_0I_O_HIGH_DECODE_ADDRESS, &top);
- top = (top << 21);
- size = ((top - base) & 0xfffffff);
- size = size | 0x1fffff;
- return (size + 1);
-}
-
-/********************************************************************
-* pci0GetMemory0Base - Return PCI0 Memory 0 Base Address.
-* Inputs: N/A
-* Returns: PCI0 Memory 0 Base Address.
-*********************************************************************/
-
-unsigned int pci0GetMemory0Base()
-{
- unsigned int base;
- GT_REG_READ(PCI_0MEMORY0_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- return base;
-}
-
-/********************************************************************
-* pci0GetMemory0Size - Return PCI0 Memory 0 Bar Size.
-* Inputs: N/A
-* Returns: PCI0 Memory 0 Bar Size.
-*********************************************************************/
-
-unsigned int pci0GetMemory0Size()
-{
- unsigned int top, base, size;
- GT_REG_READ(PCI_0MEMORY0_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- GT_REG_READ(PCI_0MEMORY0_HIGH_DECODE_ADDRESS, &top);
- top = (top << 21);
- size = ((top - base) & 0xfffffff);
- size = size | 0x1fffff;
- return (size + 1);
-}
-
-/********************************************************************
-* pci0GetMemory1Base - Return PCI0 Memory 1 Base Address.
-* Inputs: N/A
-* Returns: PCI0 Memory 1 Base Address.
-*********************************************************************/
-
-unsigned int pci0GetMemory1Base()
-{
- unsigned int base;
- GT_REG_READ(PCI_0MEMORY1_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- return base;
-}
-
-/********************************************************************
-* pci0GetMemory1Size - Return PCI0 Memory 1 Bar Size.
-* Inputs: N/A
-* Returns: PCI0 Memory 1 Bar Size.
-*********************************************************************/
-
-unsigned int pci0GetMemory1Size()
-{
- unsigned int top, base, size;
- GT_REG_READ(PCI_0MEMORY1_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- GT_REG_READ(PCI_0MEMORY1_HIGH_DECODE_ADDRESS, &top);
- top = (top << 21);
- size = ((top - base) & 0xfffffff);
- size = size | 0x1fffff;
- return (size + 1);
-}
-
-/********************************************************************
-* pci1GetIOspaceBase - Return PCI1 IO Base Address.
-* Inputs: N/A
-* Returns: PCI1 IO Base Address.
-*********************************************************************/
-
-unsigned int pci1GetIOspaceBase()
-{
- unsigned int base;
- GT_REG_READ(PCI_1I_O_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- return base;
-}
-
-/********************************************************************
-* pci1GetIOspaceSize - Return PCI1 IO Bar Size.
-* Inputs: N/A
-* Returns: PCI1 IO Bar Size.
-*********************************************************************/
-
-unsigned int pci1GetIOspaceSize()
-{
- unsigned int top, base, size;
- GT_REG_READ(PCI_1I_O_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- GT_REG_READ(PCI_1I_O_HIGH_DECODE_ADDRESS, &top);
- top = (top << 21);
- size = ((top - base) & 0xfffffff);
- size = size | 0x1fffff;
- return (size + 1);
-}
-
-/********************************************************************
-* pci1GetMemory0Base - Return PCI1 Memory 0 Base Address.
-* Inputs: N/A
-* Returns: PCI1 Memory 0 Base Address.
-*********************************************************************/
-
-unsigned int pci1GetMemory0Base()
-{
- unsigned int base;
- GT_REG_READ(PCI_1MEMORY0_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- return base;
-}
-
-/********************************************************************
-* pci1GetMemory0Size - Return PCI1 Memory 0 Bar Size.
-* Inputs: N/A
-* Returns: PCI1 Memory 0 Bar Size.
-*********************************************************************/
-
-unsigned int pci1GetMemory0Size()
-{
- unsigned int top, base, size;
- GT_REG_READ(PCI_1MEMORY1_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- GT_REG_READ(PCI_1MEMORY1_HIGH_DECODE_ADDRESS, &top);
- top = (top << 21);
- size = ((top - base) & 0xfffffff);
- size = size | 0x1fffff;
- return (size + 1);
-}
-
-/********************************************************************
-* pci1GetMemory1Base - Return PCI1 Memory 1 Base Address.
-* Inputs: N/A
-* Returns: PCI1 Memory 1 Base Address.
-*********************************************************************/
-
-unsigned int pci1GetMemory1Base()
-{
- unsigned int base;
- GT_REG_READ(PCI_1MEMORY1_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- return base;
-}
-
-/********************************************************************
-* pci1GetMemory1Size - Return PCI1 Memory 1 Bar Size.
-* Inputs: N/A
-* Returns: PCI1 Memory 1 Bar Size.
-*********************************************************************/
-
-unsigned int pci1GetMemory1Size()
-{
- unsigned int top, base, size;
- GT_REG_READ(PCI_1MEMORY1_LOW_DECODE_ADDRESS, &base);
- base = base << 21;
- GT_REG_READ(PCI_1MEMORY1_HIGH_DECODE_ADDRESS, &top);
- top = (top << 21);
- size = ((top - base) & 0xfffffff);
- size = size | 0x1fffff;
- return (size + 1);
-}
-
-/********************************************************************
-* pci0MapInternalRegSpace - Maps the internal registers memory space for the
-* slave.
-* Stays the same for all GT devices Disco include
-* Inputs: base of pci0 internal register
-*********************************************************************/
-
-void pci0MapInternalRegSpace(unsigned int pci0InternalBase)
-{
- pci0InternalBase = pci0InternalBase & 0xfffff000;
- pci0InternalBase =
- pci0InternalBase |
- (pci0ReadConfigReg
- (PCI_0INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS,
- SELF) & 0x00000fff);
- pci0WriteConfigReg
- (PCI_0INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS, SELF,
- pci0InternalBase);
-}
-
-/********************************************************************
-* pci1MapInternalRegSpace - Maps the internal registers memory space for the
-* slave.
-* Stays the same for all GT devices Disco include
-* Inputs: base of pci1 internal register
-*********************************************************************/
-
-void pci1MapInternalRegSpace(unsigned int pci1InternalBase)
-{
- pci1InternalBase = pci1InternalBase & 0xfffff000;
- pci1InternalBase =
- pci1InternalBase |
- (pci1ReadConfigReg
- (PCI_0INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS,
- SELF) & 0x00000fff);
- pci1WriteConfigReg
- (PCI_0INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS, SELF,
- pci1InternalBase);
-}
-
-/********************************************************************
-* pci0MapInternalRegIOSpace - Maps the internal registers IO space for the
-* slave.
-* Stays the same for all GT devices Disco include
-* Inputs: base of pci0 internal io register
-*********************************************************************/
-
-void pci0MapInternalRegIOSpace(unsigned int pci0InternalBase)
-{
- pci0InternalBase = pci0InternalBase & 0xfffff000;
- pci0InternalBase =
- pci0InternalBase |
- (pci0ReadConfigReg
- (PCI_0INTERNAL_REGISTERS_I_OMAPPED_BASE_ADDRESS,
- 0) & 0x00000fff);
- pci0WriteConfigReg(PCI_0INTERNAL_REGISTERS_I_OMAPPED_BASE_ADDRESS,
- SELF, pci0InternalBase);
-}
-
-/********************************************************************
-* pci0MapInternalRegIOSpace - Maps the internal registers IO space for the
-* slave.
-* Stays the same for all GT devices Disco include
-* Inputs: base of pci1 internal io register
-*********************************************************************/
-
-void pci1MapInternalRegIOSpace(unsigned int pci1InternalBase)
-{
- pci1InternalBase = pci1InternalBase & 0xfffff000;
- pci1InternalBase =
- pci1InternalBase |
- (pci1ReadConfigReg
- (PCI_0INTERNAL_REGISTERS_I_OMAPPED_BASE_ADDRESS,
- SELF) & 0x00000fff);
- pci1WriteConfigReg(PCI_0INTERNAL_REGISTERS_I_OMAPPED_BASE_ADDRESS,
- SELF, pci1InternalBase);
-}
-
-/********************************************************************
-* pci0MapMemoryBanks0_1 - Maps PCI0 memory banks 0 and 1 for the slave.
-* for Discovery we need two function: SCS0 & SCS1
-* (instead of SCS[1:0])
-* Inputs: base and size of pci0 dram
-*********************************************************************/
-
-
-void pci0MapMemoryBanks0_1(unsigned int pci0Dram0_1Base,
- unsigned int pci0Dram0_1Size)
-{
- pci0Dram0_1Base = pci0Dram0_1Base & 0xfffff000;
- pci0Dram0_1Base =
- pci0Dram0_1Base |
- (pci0ReadConfigReg(PCI_0SCS_1_0_BASE_ADDRESS, SELF) &
- 0x00000fff);
- pci0WriteConfigReg(PCI_0SCS_1_0_BASE_ADDRESS, SELF,
- pci0Dram0_1Base);
- /* swapped Bar */
- pci0WriteConfigReg(PCI_0SWAPPED_SCS_1_0_BASE_ADDRESS, SELF,
- pci0Dram0_1Base);
- if (pci0Dram0_1Size == 0)
- pci0Dram0_1Size++;
- GT_REG_WRITE(PCI_0SCS_1_0_BANK_SIZE, pci0Dram0_1Size - 1);
-}
-
-/********************************************************************
-* pci1MapMemoryBanks0_1 - Maps PCI1 memory banks 0 and 1 for the slave.
-* for Discovery we need two function: SCS0 & SCS1
-* (instead of SCS[1:0])
-* Inputs: base and size of pci1 dram
-*********************************************************************/
-
-void pci1MapMemoryBanks0_1(unsigned int pci1Dram0_1Base,
- unsigned int pci1Dram0_1Size)
-{
- pci1Dram0_1Base = pci1Dram0_1Base & 0xfffff000;
- pci1Dram0_1Base =
- pci1Dram0_1Base |
- (pci1ReadConfigReg(PCI_0SCS_1_0_BASE_ADDRESS, SELF) &
- 0x00000fff);
- pci1WriteConfigReg(PCI_0SCS_1_0_BASE_ADDRESS, SELF,
- pci1Dram0_1Base);
- /* swapped Bar */
- pci1WriteConfigReg(PCI_0SWAPPED_SCS_1_0_BASE_ADDRESS, SELF,
- pci1Dram0_1Base);
- if (pci1Dram0_1Size == 0)
- pci1Dram0_1Size++;
- GT_REG_WRITE(PCI_1SCS_1_0_BANK_SIZE, pci1Dram0_1Size - 1);
-}
-
-/********************************************************************
-* pci0MapMemoryBanks2_3 - Maps PCI0 memory banks 2 and 3 for the slave.
-* for Discovery we need two function: SCS2 & SCS3
-* (instead of SCS[3:2])
-* Inputs: base and size of pci0 dram
-*********************************************************************/
-
-void pci0MapMemoryBanks2_3(unsigned int pci0Dram2_3Base,
- unsigned int pci0Dram2_3Size)
-{
- pci0Dram2_3Base = pci0Dram2_3Base & 0xfffff000;
- pci0Dram2_3Base =
- pci0Dram2_3Base |
- (pci0ReadConfigReg(PCI_0SCS_3_2_BASE_ADDRESS, SELF) &
- 0x00000fff);
- pci0WriteConfigReg(PCI_0SCS_3_2_BASE_ADDRESS, SELF,
- pci0Dram2_3Base);
- /* swapped Bar */
- pci0WriteConfigReg(PCI_0SWAPPED_SCS_3_2_BASE_ADDRESS, SELF,
- pci0Dram2_3Base);
- if (pci0Dram2_3Size == 0)
- pci0Dram2_3Size++;
- GT_REG_WRITE(PCI_0SCS_3_2_BANK_SIZE, pci0Dram2_3Size - 1);
-}
-
-/********************************************************************
-* pci1MapMemoryBanks2_3 - Maps PCI1 memory banks 2 and 3 for the slave.
-* for Discovery we need two function: SCS2 & SCS3
-* (instead of SCS[3:2])
-* Inputs: base and size of pci1 dram
-*********************************************************************/
-
-void pci1MapMemoryBanks2_3(unsigned int pci1Dram2_3Base,
- unsigned int pci1Dram2_3Size)
-{
- pci1Dram2_3Base = pci1Dram2_3Base & 0xfffff000;
- pci1Dram2_3Base =
- pci1Dram2_3Base |
- (pci1ReadConfigReg(PCI_0SCS_3_2_BASE_ADDRESS, SELF) &
- 0x00000fff);
- pci1WriteConfigReg(PCI_0SCS_3_2_BASE_ADDRESS, SELF,
- pci1Dram2_3Base);
- /* swapped Bar */
- pci1WriteConfigReg(PCI_0SWAPPED_SCS_3_2_BASE_ADDRESS, SELF,
- pci1Dram2_3Base);
- if (pci1Dram2_3Size == 0)
- pci1Dram2_3Size++;
- GT_REG_WRITE(PCI_1SCS_3_2_BANK_SIZE, pci1Dram2_3Size - 1);
-}
-
-/********************************************************************
-* pci0MapDevices0_1and2MemorySpace - Maps PCI0 devices 0,1 and 2 memory spaces
-* for the slave.
-* For the Discovery there are 3 separate
-* fucnction's
-* Inputs: base and lengthof pci0 devises012
-*********************************************************************/
-
-
-void pci0MapDevices0_1and2MemorySpace(unsigned int pci0Dev012Base,
- unsigned int pci0Dev012Length)
-{
- pci0Dev012Base = pci0Dev012Base & 0xfffff000;
- pci0Dev012Base =
- pci0Dev012Base |
- (pci0ReadConfigReg(PCI_0CS_2_0_BASE_ADDRESS, SELF) &
- 0x00000fff);
- pci0WriteConfigReg(PCI_0CS_2_0_BASE_ADDRESS, SELF, pci0Dev012Base);
- if (pci0Dev012Length == 0)
- pci0Dev012Length++;
- GT_REG_WRITE(PCI_0CS_2_0_BANK_SIZE, pci0Dev012Length - 1);
-}
-
-/********************************************************************
-* pci1MapDevices0_1and2MemorySpace - Maps PCI1 devices 0,1 and 2 memory spaces
-* for the slave.
-* For the Discovery there are 3 separate
-* fucnction's
-* Inputs: base and lengthof pci1 devises012
-*********************************************************************/
-
-void pci1MapDevices0_1and2MemorySpace(unsigned int pci1Dev012Base,
- unsigned int pci1Dev012Length)
-{
- pci1Dev012Base = pci1Dev012Base & 0xfffff000;
- pci1Dev012Base =
- pci1Dev012Base |
- (pci1ReadConfigReg(PCI_0CS_2_0_BASE_ADDRESS, SELF) &
- 0x00000fff);
- pci1WriteConfigReg(PCI_0CS_2_0_BASE_ADDRESS, SELF, pci1Dev012Base);
- if (pci1Dev012Length == 0)
- pci1Dev012Length++;
- GT_REG_WRITE(PCI_1CS_2_0_BANK_SIZE, pci1Dev012Length - 1);
-}
-
-/********************************************************************
-* pci0MapDevices3andBootMemorySpace - Maps PCI0 devices 3 and boot memory
-* spaces for the slave.
-* For the Discovery there are 2 separate
-* fucnction's
-* Inputs: base and length of pci0 device3/ boot
-*********************************************************************/
-
-void pci0MapDevices3andBootMemorySpace(unsigned int pci0Dev3andBootBase,
- unsigned int pci0Dev3andBootLength)
-{
- pci0Dev3andBootBase = pci0Dev3andBootBase & 0xfffff000;
- pci0Dev3andBootBase =
- pci0Dev3andBootBase |
- (pci0ReadConfigReg(PCI_0CS_3_BOOTCS_BASE_ADDRESS, SELF) &
- 0x00000fff);
- pci0WriteConfigReg(PCI_0CS_3_BOOTCS_BASE_ADDRESS, SELF,
- pci0Dev3andBootBase);
- /* swapped Bar */
- pci0WriteConfigReg(PCI_0SWAPPED_CS_3_BOOTCS_BASE_ADDRESS, SELF,
- pci0Dev3andBootBase);
- if (pci0Dev3andBootLength == 0)
- pci0Dev3andBootLength++;
- GT_REG_WRITE(PCI_0CS_3_BOOTCS_BANK_SIZE,
- pci0Dev3andBootLength - 1);
-}
-
-/********************************************************************
-* pci1MapDevices3andBootMemorySpace - Maps PCI1 devices 3 and boot memory
-* spaces for the slave.
-* For the Discovery there are 2 separate
-* fucnction's
-* Inputs: base and length of pci1 device3/ boot
-*********************************************************************/
-
-void pci1MapDevices3andBootMemorySpace(unsigned int pci1Dev3andBootBase,
- unsigned int pci1Dev3andBootLength)
-{
- pci1Dev3andBootBase = pci1Dev3andBootBase & 0xfffff000;
- pci1Dev3andBootBase =
- pci1Dev3andBootBase |
- (pci1ReadConfigReg(PCI_0CS_3_BOOTCS_BASE_ADDRESS, SELF) &
- 0x00000fff);
- pci1WriteConfigReg(PCI_0CS_3_BOOTCS_BASE_ADDRESS, SELF,
- pci1Dev3andBootBase);
- /* swapped Bar */
- pci1WriteConfigReg(PCI_0SWAPPED_CS_3_BOOTCS_BASE_ADDRESS, SELF,
- pci1Dev3andBootBase);
- if (pci1Dev3andBootLength == 0)
- pci1Dev3andBootLength++;
- GT_REG_WRITE(PCI_1CS_3_BOOTCS_BANK_SIZE,
- pci1Dev3andBootLength - 1);
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,318 +0,0 @@
-/*
- * This program 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, or (at
- * your option) any later version.
- */
-#include <linux/config.h>
-#include <asm/galileo-boards/evb64120A/pci.h>
-#include <asm/byteorder.h>
-
-#include "etherboot.h"
-#include "pci_etherboot.h"
-#include "galileo_port.h"
-
-#define MAX_PCI_DEVS 10
-PCI_DEVICE pci0_devices[MAX_PCI_DEVS];
-PCI_DEVICE pci1_devices[MAX_PCI_DEVS];
-
-static int pci_range_ck(unsigned char bus, unsigned char dev)
-{
- if ((bus == 0) && (dev >= 0) && (dev < 30))
- return 0; // Bus/Device Number OK
-
- return -1; // Bus/Device Number not OK
-}
-
-/********************************************************************
- * pcibios_(read/write)_config_(byte/word/dword)
- *
- *Inputs :
- *bus - bus number
- *dev - device number
- *offset - register offset in the configuration space
- *val - value to be written / read
- *
- *Outputs :
- *Sucees/Failure
- *********************************************************************/
-#define PCI_CFG_DATA ((volatile unsigned long *)0xb4000cfc)
-#define PCI_CFG_CTRL ((volatile unsigned long *)0xb4000cf8)
-
-#define PCI_CFG_SET(dev,fun,off) \
- ((*PCI_CFG_CTRL) = cpu_to_le32((0x80000000 | ((dev)<<11) | ((fun)<<8) | (off))))
-
-int pcibios_read_config_dword(unsigned char bus, unsigned char dev,
- unsigned char offset, unsigned int *val)
-{
-
- if (offset & 0x3) {
- return PCIBIOS_BAD_REGISTER_NUMBER;
- }
- if (pci_range_ck(bus, dev)) {
- *val = 0xFFFFFFFF;
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- PCI_CFG_SET(dev, 0, offset);
- if (dev != 0) {
- *val = *PCI_CFG_DATA;
- } else {
- *val = cpu_to_le32(*PCI_CFG_DATA);
- }
- return PCIBIOS_SUCCESSFUL;
-}
-
-int pcibios_read_config_word(unsigned char bus, unsigned char dev,
- unsigned char offset, unsigned short *val)
-{
- if (offset & 0x1)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- if (pci_range_ck(bus, dev)) {
- *val = 0xffff;
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- PCI_CFG_SET(dev, 0, (offset & ~0x3));
- if (dev != 0) {
- *val = *PCI_CFG_DATA >> ((offset & 3) * 8);
- } else {
- *val = cpu_to_le32(*PCI_CFG_DATA) >> ((offset & 3) * 8);
- }
- return PCIBIOS_SUCCESSFUL;
-}
-
-int pcibios_read_config_byte(unsigned char bus, unsigned char dev,
- unsigned char offset, unsigned char *val)
-{
- if (pci_range_ck(bus, dev)) {
- *val = 0xff;
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- PCI_CFG_SET(dev, 0, (offset & ~0x3));
- if (dev != 0) {
- *val = *PCI_CFG_DATA >> ((offset & 3) * 8);
- } else {
- *val = cpu_to_le32(*PCI_CFG_DATA >> ((offset & 3) * 8));
- }
- return PCIBIOS_SUCCESSFUL;
-}
-
-int pcibios_write_config_dword(unsigned char bus, unsigned char dev,
- unsigned char offset, unsigned int val)
-{
- if (offset & 0x3)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- if (pci_range_ck(bus, dev))
- return PCIBIOS_DEVICE_NOT_FOUND;
- PCI_CFG_SET(dev, 0, offset);
- if (dev != 0) {
- *PCI_CFG_DATA = val;
- } else {
- *PCI_CFG_DATA = cpu_to_le32(val);
- }
- return PCIBIOS_SUCCESSFUL;
-}
-
-int pcibios_write_config_word(unsigned char bus, unsigned char dev,
- unsigned char offset, unsigned short val)
-{
- unsigned long tmp;
-
- if (offset & 0x1)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- if (pci_range_ck(bus, dev))
- return PCIBIOS_DEVICE_NOT_FOUND;
- PCI_CFG_SET(dev, 0, (offset & ~0x3));
- if (dev != 0) {
- tmp = *PCI_CFG_DATA;
- } else {
- tmp = cpu_to_le32(*PCI_CFG_DATA);
- }
- tmp &= ~(0xffff << ((offset & 0x3) * 8));
- tmp |= (val << ((offset & 0x3) * 8));
- if (dev != 0) {
- *PCI_CFG_DATA = tmp;
- } else {
- *PCI_CFG_DATA = cpu_to_le32(tmp);
- }
- return PCIBIOS_SUCCESSFUL;
-}
-
-int pcibios_write_config_byte(unsigned char bus, unsigned char dev,
- unsigned char offset, unsigned char val)
-{
- unsigned long tmp;
-
- if (pci_range_ck(bus, dev))
- return PCIBIOS_DEVICE_NOT_FOUND;
- PCI_CFG_SET(dev, 0, (offset & ~0x3));
- if (dev != 0) {
- tmp = *PCI_CFG_DATA;
- } else {
- tmp = cpu_to_le32(*PCI_CFG_DATA);
- }
- tmp &= ~(0xff << ((offset & 0x3) * 8));
- tmp |= (val << ((offset & 0x3) * 8));
- *PCI_CFG_DATA = cpu_to_le32(tmp);
- return PCIBIOS_SUCCESSFUL;
-}
-
-
-/********************************************************************
- * eth_pci_init - Fill pci_devi
- *
- *Inputs :
- *bus - bus number
- *dev - device number
- *offset - register offset in the configuration space
- *val - value to be written / read
- *
- *Outputs :
- *Sucees/Failure
- *********************************************************************/
-void eth_pci_init(struct pci_device *pcidev)
-{
- int i, count;
- pcibios_write_config_word(0, 0, 4, 0x7);
- pcibios_write_config_dword(0, 8, BAR0, 0x12000000);
- pcibios_write_config_dword(0, 8, BAR1, 0x10000001);
- pcibios_write_config_dword(0, 8, BAR2, 0x12100000);
- strcpy(pci0_devices[0].type, "Network Controller");
- pci0_devices[0].deviceNum = 8;
- pci0_devices[0].venID = 0x8086;
- pci0_devices[0].deviceID = 0x1229;
-
- pci0_devices[0].bar0Base = 0x12000000;
- pci0_devices[0].bar0Size = 0x00001000;
- pci0_devices[0].bar0Type = 0;
- pci0_devices[0].bar1Base = 0x10000000;
- pci0_devices[0].bar1Size = 0x40;
- pci0_devices[0].bar1Type = 1;
- pci0_devices[0].bar2Base = 0x12100000;
- pci0_devices[0].bar2Size = 0x00100000;
- pci0_devices[0].bar2Type = 0;
- for (i = 0; pcidev[i].vendor != 0; i++) {
- /* Look for device in PCI0 first */
- for (count = 0; count < MAX_PCI_DEVS; count++) {
- if ((pci0_devices[count].type[0] != 0)
- && ((unsigned short) pci0_devices[count].
- venID == (unsigned short) pcidev[i].vendor)
- && ((unsigned short) pci0_devices[count].
- deviceID ==
- (unsigned short) pcidev[i].dev_id)) {
- if ((pci0_devices[count].bar0Type == 1)
- && (pci0_devices[count].bar0Size != 0))
- pcidev[i].ioaddr =
- pci0_devices[count].bar0Base;
- if ((pci0_devices[count].bar1Type == 1)
- && (pci0_devices[count].bar1Size != 0))
- pcidev[i].ioaddr =
- pci0_devices[count].bar1Base;
- if ((pci0_devices[count].bar2Type == 1)
- && (pci0_devices[count].bar2Size != 0))
- pcidev[i].ioaddr =
- pci0_devices[count].bar2Base;
- if ((pci0_devices[count].bar3Type == 1)
- && (pci0_devices[count].bar3Size != 0))
- pcidev[i].ioaddr =
- pci0_devices[count].bar3Base;
- if ((pci0_devices[count].bar4Type == 1)
- && (pci0_devices[count].bar4Size != 0))
- pcidev[i].ioaddr =
- pci0_devices[count].bar4Base;
- if ((pci0_devices[count].bar5Type == 1)
- && (pci0_devices[count].bar5Size != 0))
- pcidev[i].ioaddr =
- pci0_devices[count].bar5Base;
-
- if ((pci0_devices[count].bar0Type == 0)
- && (pci0_devices[count].bar0Size != 0))
- pcidev[i].membase =
- pci0_devices[count].bar0Base;
- if ((pci0_devices[count].bar1Type == 0)
- && (pci0_devices[count].bar1Size != 0))
- pcidev[i].membase =
- pci0_devices[count].bar1Base;
- if ((pci0_devices[count].bar2Type == 0)
- && (pci0_devices[count].bar2Size != 0))
- pcidev[i].membase =
- pci0_devices[count].bar2Base;
- if ((pci0_devices[count].bar3Type == 0)
- && (pci0_devices[count].bar3Size != 0))
- pcidev[i].membase =
- pci0_devices[count].bar3Base;
- if ((pci0_devices[count].bar4Type == 0)
- && (pci0_devices[count].bar4Size != 0))
- pcidev[i].membase =
- pci0_devices[count].bar4Base;
- if ((pci0_devices[count].bar5Type == 0)
- && (pci0_devices[count].bar5Size != 0))
- pcidev[i].membase =
- pci0_devices[count].bar5Base;
- pcidev[i].bus = 0;
- pcidev[i].devfn =
- pci0_devices[count].deviceNum;
- }
-#ifdef CONFIG_EVB_PCI1
- if ((pci1_devices[count].type[0] != 0)
- && (pci1_devices[count].venID ==
- pcidev[i].vendor)
- && (pci1_devices[count].deviceID ==
- pcidev[i].dev_id)) {
- if ((pci1_devices[count].bar0Type == 1)
- && (pci1_devices[count].bar0Size != 0))
- pcidev[i].ioaddr =
- pci1_devices[count].bar0Base;
- if ((pci1_devices[count].bar1Type == 1)
- && (pci1_devices[count].bar1Size != 0))
- pcidev[i].ioaddr =
- pci1_devices[count].bar1Base;
- if ((pci1_devices[count].bar2Type == 1)
- && (pci1_devices[count].bar2Size != 0))
- pcidev[i].ioaddr =
- pci1_devices[count].bar2Base;
- if ((pci1_devices[count].bar3Type == 1)
- && (pci1_devices[count].bar3Size != 0))
- pcidev[i].ioaddr =
- pci1_devices[count].bar3Base;
- if ((pci1_devices[count].bar4Type == 1)
- && (pci1_devices[count].bar4Size != 0))
- pcidev[i].ioaddr =
- pci1_devices[count].bar4Base;
- if ((pci1_devices[count].bar5Type == 1)
- && (pci1_devices[count].bar5Size != 0))
- pcidev[i].ioaddr =
- pci1_devices[count].bar5Base;
-
- if ((pci1_devices[count].bar0Type == 0)
- && (pci1_devices[count].bar0Size != 0))
- pcidev[i].membase =
- pci1_devices[count].bar0Base;
- if ((pci1_devices[count].bar1Type == 0)
- && (pci1_devices[count].bar1Size != 0))
- pcidev[i].membase =
- pci1_devices[count].bar1Base;
- if ((pci1_devices[count].bar2Type == 0)
- && (pci1_devices[count].bar2Size != 0))
- pcidev[i].membase =
- pci1_devices[count].bar2Base;
- if ((pci1_devices[count].bar3Type == 0)
- && (pci1_devices[count].bar3Size != 0))
- pcidev[i].membase =
- pci1_devices[count].bar3Base;
- if ((pci1_devices[count].bar4Type == 0)
- && (pci1_devices[count].bar4Size != 0))
- pcidev[i].membase =
- pci1_devices[count].bar4Base;
- if ((pci1_devices[count].bar5Type == 0)
- && (pci1_devices[count].bar5Size != 0))
- pcidev[i].membase =
- pci1_devices[count].bar5Base;
-
- pcidev[i].bus = 1;
- pcidev[i].devfn =
- pci1_devices[count].deviceNum;
- }
-#endif
- }
- }
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.h linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.h
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.h 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,144 +0,0 @@
-#ifndef PCI_H
-#define PCI_H
-
-/*
-** Support for NE2000 PCI clones added David Monro June 1997
-** Generalised for other PCI NICs by Ken Yap July 1997
-**
-** Most of this is taken from:
-**
-** /usr/src/linux/drivers/pci/pci.c
-** /usr/src/linux/include/linux/pci.h
-** /usr/src/linux/arch/i386/bios32.c
-** /usr/src/linux/include/linux/bios32.h
-** /usr/src/linux/drivers/net/ne.c
-*/
-
-/*
- * This program 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, or (at
- * your option) any later version.
- */
-
-#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
-#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
-#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
-
-
-#define PCI_VENDOR_ID 0x00 /* 16 bits */
-#define PCI_DEVICE_ID 0x02 /* 16 bits */
-#define PCI_COMMAND 0x04 /* 16 bits */
-
-#define PCI_CLASS_CODE 0x0b /* 8 bits */
-#define PCI_SUBCLASS_CODE 0x0a /* 8 bits */
-#define PCI_HEADER_TYPE 0x0e /* 8 bits */
-
-#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
-#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits */
-#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits */
-#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
-#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
-#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
-
-#ifndef PCI_BASE_ADDRESS_IO_MASK
-#define PCI_BASE_ADDRESS_IO_MASK (~0x03)
-#endif
-#define PCI_BASE_ADDRESS_SPACE_IO 0x01
-#define PCI_ROM_ADDRESS 0x30 /* 32 bits */
-#define PCI_ROM_ADDRESS_ENABLE 0x01 /* Write 1 to enable ROM,
- bits 31..11 are address,
- 10..2 are reserved */
-
-#define PCI_FUNC(devfn) ((devfn) & 0x07)
-
-#define BIOS32_SIGNATURE (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
-
-/* PCI signature: "PCI " */
-#define PCI_SIGNATURE (('P' << 0) + ('C' << 8) + ('I' << 16) + (' ' << 24))
-
-/* PCI service signature: "$PCI" */
-#define PCI_SERVICE (('$' << 0) + ('P' << 8) + ('C' << 16) + ('I' << 24))
-
-#define KERN_CODE_SEG 0x8 /* This _MUST_ match start.S */
-
-#define PCI_VENDOR_ID_REALTEK 0x10ec
-#define PCI_DEVICE_ID_REALTEK_8029 0x8029
-#define PCI_DEVICE_ID_REALTEK_8139 0x8139
-#define PCI_VENDOR_ID_WINBOND2 0x1050
-#define PCI_DEVICE_ID_WINBOND2_89C940 0x0940
-#define PCI_VENDOR_ID_COMPEX 0x11f6
-#define PCI_DEVICE_ID_COMPEX_RL2000 0x1401
-#define PCI_VENDOR_ID_KTI 0x8e2e
-#define PCI_DEVICE_ID_KTI_ET32P2 0x3000
-#define PCI_VENDOR_ID_NETVIN 0x4a14
-#define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000
-#define PCI_VENDOR_ID_3COM 0x10b7
-#define PCI_DEVICE_ID_3COM_3C900TPO 0x9000
-#define PCI_DEVICE_ID_3COM_3C900COMBO 0x9001
-#define PCI_DEVICE_ID_3COM_3C905TX 0x9050
-#define PCI_DEVICE_ID_3COM_3C905T4 0x9051
-#define PCI_DEVICE_ID_3COM_3C905B_TX 0x9055
-#define PCI_DEVICE_ID_3COM_3C905C_TXM 0x9200
-#define PCI_VENDOR_ID_INTEL 0x8086
-#define PCI_DEVICE_ID_INTEL_82557 0x1229
-#define PCI_VENDOR_ID_AMD 0x1022
-#define PCI_DEVICE_ID_AMD_LANCE 0x2000
-#define PCI_VENDOR_ID_SMC_1211 0x1113
-#define PCI_DEVICE_ID_SMC_1211 0x1211
-#define PCI_VENDOR_ID_DEC 0x1011
-#define PCI_DEVICE_ID_DEC_TULIP 0x0002
-#define PCI_DEVICE_ID_DEC_TULIP_FAST 0x0009
-#define PCI_DEVICE_ID_DEC_TULIP_PLUS 0x0014
-#define PCI_DEVICE_ID_DEC_21142 0x0019
-#define PCI_VENDOR_ID_SMC 0x10B8
-#ifndef PCI_DEVICE_ID_SMC_EPIC100
-# define PCI_DEVICE_ID_SMC_EPIC100 0x0005
-#endif
-#define PCI_VENDOR_ID_MACRONIX 0x10d9
-#define PCI_DEVICE_ID_MX987x5 0x0531
-#define PCI_VENDOR_ID_LINKSYS 0x11AD
-#define PCI_DEVICE_ID_LC82C115 0xC115
-#define PCI_VENDOR_ID_VIATEC 0x1106
-#define PCI_DEVICE_ID_VIA_RHINE_I 0x3043
-#define PCI_DEVICE_ID_VIA_86C100A 0x6100
-#define PCI_VENDOR_ID_DAVICOM 0x1282
-#define PCI_DEVICE_ID_DM9102 0x9102
-
-struct pci_device {
- unsigned short vendor, dev_id;
- const char *name;
- unsigned int membase;
- unsigned int ioaddr;
- unsigned short devfn;
- unsigned short bus;
-};
-
-extern void eth_pci_init(struct pci_device *);
-int pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn,
- unsigned char where, unsigned char *val);
-int pcibios_read_config_word(unsigned char bus, unsigned char dev_fn,
- unsigned char where, unsigned short *val);
-int pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn,
- unsigned char where, unsigned int *val);
-int pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn,
- unsigned char where, unsigned char val);
-int pcibios_write_config_word(unsigned char bus, unsigned char dev_fn,
- unsigned char where, unsigned short val);
-int pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn,
- unsigned char where, unsigned int val);
-
-/*
- * Error values that may be returned by the PCI bios.
- */
-#define PCIBIOS_SUCCESSFUL 0x00
-#define PCIBIOS_FUNC_NOT_SUPPORTED 0x81
-#define PCIBIOS_BAD_VENDOR_ID 0x83
-#define PCIBIOS_DEVICE_NOT_FOUND 0x86
-#define PCIBIOS_BAD_REGISTER_NUMBER 0x87
-#define PCIBIOS_SET_FAILED 0x88
-#define PCIBIOS_BUFFER_TOO_SMALL 0x89
-
-
-
-#endif /* PCI_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/README linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/README
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/README 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/README 1970-01-01 01:00:00.000000000 +0100
@@ -1,131 +0,0 @@
-+------------------------------------------------+
-| $TOPDIR/arch/mips/galileo/compressed/README |
-| |
-| By RidgeRun Inc, |
-| Aug, 2000 |
-+------------------------------------------------+
-
-Description:
-============
- It is intended that this makefile be wired in to run as
- part of a top level linux build. For example, at the
- time of this writing, if the user types "make gboot" at
- the top level then in addition to building vmlinux the
- build system's makefiles will descend into this
- directory and build the "all:" target of this
- Makefile. This will have the result of compressing the
- vmlinux system and producing four separate systems. The
- following snippet is pulled from this directory's
- Makefile and describes each system.
-
- Four systems are availalbe for download to the EVB64120A
- board.
-
- 1. - ramsys -
- To be loaded into ram then run. When run
- it decompresses the "vmlinux" kernel housed in its internal
- data structures and then jumps to the image which
- results in a linux kernel boot.
-
- 2. - flashsys -
- To be loaded into ram so that it can be
- burned into the onboard flash. Then the board jumpers
- can be switched so that the next power cycle caused
- the system in flash to run which then proceeds as
- described by #1 above.
- Note: burner.srec is the utility that will allow
- the user to get this image into flash.
-
- 3. - flashsys2 -
- To be loaded into ram so that it can be
- burned into the onboard flash. Then on each power
- cycle when the standard PMON prompt is presented
- the user can type `call 0xbf000000` to invoke
- the system in flash which then proceeds as
- described by #1 above.
- Note: burner.srec is the utility that will allow
- the user to get this image into flash.
-
- 4. - burner.srec -
- Related to #2 and #3 above.
-
-Example: Running from Ram
-==========================
-
- In this scenario the compressed system is downloaded
- into ram and run directly from there. No flash is involved
- in this scenario. Naturally, the download must be repeated
- on every power cycle.
-
- 1. At the PMON prompt type `load`
- 2. Assuming you have your host connected to /dev/ttyS0
- type the following command in a host shell window.
- `cat ramsys.srec > /dev/ttyS0`
- 3. When the download completes type the following
- at the PMON prompt: `g`
-
-
-Example: Running from flash: Scenario #1
-========================================
-
- In this scenario vmlinux runs out of flash code
- automatically on every power up. This means that
- standard PMON code (of eprom) never runs.
-
- 1. Place the boot jumpers in the Boot-from-eprom
- state. This is the normal state and how the jumpers
- are found when booting PMON.
-
- Jumper settings. J11 - Removed
- J20 - Moved from the 1&2 position to
- the 2&3 position instead
-
- 2. Use PMON to "load" the burner.srec image and then
- run it. This utility will prompt you to download
- the image that you want burned into the flash
- part.
-
- 3. Send the flashsys.srec image to the running burner
- utility. The utililty will indicate when the burn
- process has completed.
-
- 4. Now switch off power and change the jumpers to
- the boot-from-flash position. The next power cycle
- will run the flash based system automatically.
-
- Jumper settings. J11 - Added.
- J20 - Moved from the 2&3 position to
- the 1&2 position instead
-
-Example: Running from flash: Scenario #2
-========================================
-
- In this scenario vmlinux runs out of flash only if the
- PMON user decides to jump there by issuing a command to
- PMON. Every power cycle would continue to bring up PMON
- and a user will have to reissue the jump command to
- force control transfer to the flash system.
-
- 1. Insure that the boot jumpers are in the Boot-from-eprom
- state. This is the normal state and how the jumpers
- are found when booting PMON.
-
- Jumper settings. J11 - Removed
- J20 - Moved from the 1&2 position to
- the 2&3 position instead
-
- 2. Use PMON to "load" the burner.srec image and then
- run it. This utility will prompt you to download
- the image that you want burned into the flash
- part.
-
- 3. Send the flashsys2.srec image to the running burner
- utility. The utililty will indicate when the burn
- process has completed.
-
- 4. Now that the image is in flash the user can invoke
- the following PMON command whenever a vmlinux
- boot is desired:
-
- call 0xbf000000
-
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/sbd.h linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/sbd.h
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/sbd.h 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/sbd.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,52 +0,0 @@
-/*
- * sbd.h: cpu board definitions for Galileo-9
- * Copyright (c) 1997 Algorithmics Ltd
- */
-
-#ifndef MHZ
-/* fastest possible pipeline clock */
-#define MHZ 150
-#endif
-
-/* FIXME These timings are completely fictional */
-#define RAMCYCLE 60 /* 60ns dram cycle */
-#define ROMCYCLE 750 /* ~750ns rom cycle */
-#define CACHECYCLE (1000/MHZ) /* internal clock */
-#define CYCLETIME CACHECYCLE
-#define CACHEMISS (CYCLETIME * 6)
-
-/*
- * rough scaling factors for 2 instruction DELAY loop to get 1ms and 1us delays
- */
-#define ASMDELAY(ns,icycle) \
- (((ns) + (icycle)) / ((icycle) * 2))
-
-#define CACHEUS ASMDELAY(1000, CACHECYCLE)
-#define RAMUS ASMDELAY(1000, CACHEMISS+RAMCYCLE)
-#define ROMUS ASMDELAY(1000, CACHEMISS+ROMCYCLE)
-#define CACHEMS ASMDELAY(1000000, CACHECYCLE)
-#define RAMMS ASMDELAY(1000000, CACHEMISS+RAMCYCLE)
-#define ROMMS ASMDELAY(1000000, CACHEMISS+ROMCYCLE)
-
-#ifndef __ASSEMBLY__
-#define nsdelay(ns) mips_cycle (ASMDELAY (ns, CACHECYCLE))
-#define usdelay(us) mips_cycle (ASMDELAY ((us)*1000, CACHECYCLE))
-#endif
-
-#define DRAM_BASE 0x00000000
-#define PCI_IO_BASE 0x10000000
-#define PCI_IO_SIZE 0x02000000
-#define PCI_MEM_BASE 0x12000000
-#define PCI_MEM_SIZE 0x02000000
-#define GT64011_BASE 0x14000000
-#define DUART_BASE 0x1d000000
-#define FLASH_BASE 0x1f000000
-#define PROM_BASE 0x1fc00000
-
-
-#define LOCAL_MEM DRAM_BASE
-#define LOCAL_MEM_SIZE (128*1024*1024) /* SDRAM size (16MB) */
-
-#define BOOTPROM_BASE PROM_BASE
-
-#define DUART_CLOCK 3686400
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/sbdreset_evb64120A.S linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/sbdreset_evb64120A.S
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/sbdreset_evb64120A.S 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/sbdreset_evb64120A.S 1970-01-01 01:00:00.000000000 +0100
@@ -1,1049 +0,0 @@
-/*
- * Copyright 1997 Algorithmics Ltd
- * All Rights Reserved
- *
- * gal9/sbdreset.sx -- low level board dependent routines
- */
-
-#ifdef EVB64120A
-
-#include <asm/asm.h>
-#include <asm/regdef.h>
-#include <asm/cacheops.h>
-#include <asm/current.h>
-#include <asm/offset.h>
-#include <asm/processor.h>
-#include <asm/regdef.h>
-#include <asm/cachectl.h>
-#include <asm/mipsregs.h>
-#include <asm/stackframe.h>
-#include <asm/cpu.h>
-#include "sbd.h"
-
-
-#include "gt64011.h"
-#include "ns16550.h"
-
-#ifdef GALILEO_PORT // miniBios crack
-#define C0_CONFIG CP0_CONFIG
-#define C0_STATUS CP0_STATUS
-#define C0_TLBLO0 CP0_ENTRYLO0
-#define C0_TLBLO1 CP0_ENTRYLO1
-#define C0_PGMASK CP0_PAGEMASK
-#define C0_TLBHI CP0_ENTRYHI
-#define C0_INX CP0_INDEX
-#define NTLBENTRIES 48
-
-
-#define CFG_IB CONF_IB
-#define CFG_DB CONF_DB
-#define CFG_C_NONCOHERENT CONF_CM_CACHABLE_NONCOHERENT
-#define C0_SR CP0_STATUS
-#define SR_DE ST0_DE
-
-
- #define SLEAF(x) LEAF(x)
- #define SEND(x) END(x)
- #define XLEAF(x) LEAF(x)
- #define SBD_DISPLAY(a,b,c,d,e) ;
-
-#define K0BASE 0x80000000
-#define K0SIZE 0x20000000
-#define K1BASE 0xa0000000
-#define K1SIZE 0x20000000
-#define K2BASE 0xc0000000
-
-#define PHYS_TO_K0(pa) ((pa)|K0BASE)
-#define PHYS_TO_K1(pa) ((pa)|K1BASE)
-#define K0_TO_PHYS(va) ((va)&(K0SIZE-1))
-#define K1_TO_PHYS(va) ((va)&(K1SIZE-1))
-#define K0_TO_K1(va) ((va)|K1SIZE)
-#define K1_TO_K0(va) ((va)&~K1SIZE)
-
-#define PA_TO_KVA0(pa) PHYS_TO_K0(pa)
-#define PA_TO_KVA1(pa) PHYS_TO_K1(pa)
-#define KVA_TO_PA(pa) K1_TO_PHYS(pa)
-#define KSEG0_BASE K0BASE
-#define KSEG1_BASE K1BASE
-
-
-#endif
-
-#define MB 0x100000
-
-#define MemTypeNone 0x8000
-#define MemRasMask 0x0f00
-#define MemRasShift 8
-#define MemCasMask 0x000f
-#define MemCasShift 0
-
-#define rasave s0
-#define p64011 s1
-#define bank0 s2
-#define bank1 s3
-#define bank2 s4
-#define bank3 s5
-#define memtop s6
-#define membase s7
-
-/*#if #endian(big) */
-#ifdef __MIPSEB__
-
-#define HTOLL(sr,tr) \
- .set noat ; \
- srl AT,sr,24 ; \
- srl tr,sr,8 ; \
- and tr,0xff00 ; \
- or AT,tr ; \
- and tr,sr,0xff00 ; \
- sll tr,8 ; \
- or AT,tr ; \
- sll tr,sr,24 ; \
- or sr,AT,tr ; \
- .set at
-#else
-#define HTOLL(sr,tr)
-#endif
-
-#undef DBGSBD
-
-#ifdef DBGSBD
-#define DBG(s) \
- .rdata ; \
-88: .asciiz s ; \
- .text ; \
- la a0, 88b ; \
- jal _dbgmsg
-
-LEAF(_dbgmsg)
- .set noat
- li AT,PHYS_TO_K1(NS16550_CHANB)
-waitrdy:
- lbu v1,LSR(AT)
- .set noreorder; nop; nop; nop; nop; nop; nop; nop; nop; .set reorder
- and v1,LSR_TXRDY
- beqz v1,waitrdy
-
- lbu v1,(a0)
- addu a0,1
- beqz v1,9f
- sb v1,DATA(AT)
- .set noreorder; nop; nop; nop; nop; nop; nop; nop; nop; .set reorder
- b waitrdy
-9: j ra
- .set at
-END(_dbgmsg)
-
-LEAF(_dbghex)
- li a1,PHYS_TO_K1(NS16550_CHANB)
- li t0,8
-1:
- lbu t1,LSR(a1)
- .set noreorder; nop; nop; nop; nop; nop; nop; nop; nop; .set reorder
- and t1,LSR_TXRDY
- beqz t1,1b
-
- srl t1,a0,28
- addu t1,'0'
- ble t1,'9',2f
- addu t1,'a'-'0'-10
-2: sb t1,DATA(a1)
- .set noreorder; nop; nop; nop; nop; nop; nop; nop; nop; .set reorder
-
- sll a0,4
- sub t0,1
- bnez t0,1b
-
- j ra
- .set at
-END(_dbghex)
-
- .rdata
-initb_str:
- .byte 9,0x40 /* Reset CH B */
- .byte 1,0x00 /* Interrupt disabled */
- .byte 3,0xc1 /* 8 bits/char rx enable */
- .byte 4,0x44 /* x16 clk mode 1 stop bit */
- .byte 5,0x6a /* tx 8/bit RTS & tx enable */
- .byte 9,0x0a /* MIE Master int enab. and NV No Vector */
- .byte 11,0x50 /* Select BR gen. out for both rx and ts */
- .byte 0,0x10
- .byte 0,0x10
- .byte 14,0x01 /* enable baud rate gen. */
- .byte 15,0x00 /* known state for reg 15 */
-
- .byte 14,0x00 /* disable baud rate gen. */
- .byte 12,0x0a /* 0x0a = 9600 baud time const. - lower 8 bits */
- .byte 13,0x00 /* 9600 buad time const. - upper 8 bits */
- .byte 14,0x01 /* enable baud rate gen. */
- .byte 0xff
-
- .text
-
-SLEAF(_dbginit)
- /*
- li v0,PHYS_TO_K1(NS16550_CHANB)
- la a0,initb_str
- or a0,K1BASE
-1: lbu t0,0(a0)
- beq t0,0xff,1f
- sb t0,LSR(v0)
- .set noreorder; nop; nop; nop; nop; nop; nop; nop; nop; .set reorder
- addu a0,1
- b 1b
- */
- jal init_ns16550_chan_b # Debug channel
- j ra
-SEND(_dbginit)
-#else
-#define DBG(s)
-#endif
-
-LEAF(sbdreset)
- move rasave,ra
-
- /* if launched by ITROM, leave Config alone */
-#ifndef ITBASE
- /* set config register for 32b/32b cachelines, kseg0 cacheable */
- mfc0 t1,C0_CONFIG
- and t1,~0x3f # set bits 5..0 only
- or t1,CFG_IB | CFG_DB | CFG_C_NONCOHERENT
- mtc0 t1,C0_CONFIG
-#endif
-
- /* Initialize stack pointer to 6MB address */
- li sp,0xa0600000
-
-
- /*
- * slight amount of kludgery here to stop RAM resident
- * program from overwriting itself...
- */
-// li v1,0x1fc00000 /* check return address is in ROM */
-// and v0,ra,v1
-// bne v0,v1,.noinit
-
- /* table driven hardware register initialization */
- la a0, reginittab
- or a0, K1BASE /* force to kseg1 */
-
-1: lw v0,0(a0)
- lw v1,4(a0)
- addu a0,8
- beqz v0,8f
-
- sw v1,0(v0)
- b 1b
-8:
-
-#ifdef DBGSBD
- jal init_ns16550_chan_b # was - _dbginit
- DBG("sbdreset\r\n")
-#endif
-#define DEVICE_BANK0PARAMETERS 0x45C
-#define DEVICE_BANK1PARAMETERS 0x460
-#define DEVICE_BANK2PARAMETERS 0x464
-#define DEVICE_BANK3PARAMETERS 0x468
-#define DEVICE_BOOT_BANK_PARAMETERS 0x46C
-#define GT_INTERNAL_REG_BASE 0xb4000000
-
- li p64011, PA_TO_KVA1(GT64011_BASE)
-
- li v0,0xb400046c /* Boot Device */
- lw t0,0(v0)
- and t0,0x00003000 /* Keep the correct boot size */
- or t0,htoll(0x3847de70)
- sw t0,0(v0)
-
- li v0,0xb4000468 /* CS3 Device - 16 bit FLASH memory */
- li t0,htoll(0x3859e6e8)
- sw t0,0(v0)
-
-
- li v0,0xb4000c84 /* PCI 1 timeout register */
- li t0,htoll(0xffff)
- sw t0,0(v0)
-
-
- li v0,0xb4000c3c /* Enable I/O response on PCI0 */
- li t0,htoll(0x7)
- sw t0,0(v0)
-
- li v0,0xb4000cbc /* Enable I/O response on PCI1 */
- li t0,htoll(0x7)
- sw t0,0(v0)
-
- /* GT-64120 Initialization */
-
- li p64011, PA_TO_KVA1(GT64011_BASE)
-
- /*********************************************************************/
- /************************* SDRAM initializing ************************/
- /******************************* START *******************************/
-
-
- /* SDRAM banks 0,1,2,3 parameters */
- li t0,htoll(0x01908200) /* - Standard Monitor: Interleave enabled */
- li v0,0xb4000448 /* - Registered SDRAM (Bit 23) */
- sw t0,0(v0) /* - Duplicate Dadr11,BankSel1 and Dadr12 */
- /* - Cas latency: 2 Cycles */
- /* - Flow Through enable: One sample */
- /* - SRAS - precharge time: 3 Cycles */
- /* - No ECC */
- /* - No ByPass */
- /* - Burst length: 8 */
-
- /* Detect whether we have a 16,64,128 or 256 Mbit SDRAM on DIMM0 */
- /* Set bank0`s range to: 0 - 0x10000000 (256 MByte) */
-_DIMM0:
- li v0,0xb4000008
- li t0,htoll(0x0)
- sw t0,0(v0)
-
- li v0,0xb4000010
- li t0,htoll(0x7f)
- sw t0,0(v0)
-
- /* Close banks 2 and 3 */
- li v0,0xb4000018
- li t0,htoll(0x7ff)
- sw t0,0(v0)
- li v0,0xb4000020
- li t0,htoll(0x00)
- sw t0,0(v0)
-
- /* Extend bank0 to 0x10000000 and Close bank1,2 and 3 */
- DBG("Extend bank0 to 0x10000000 and Close bank1,2 and 3...\r\n")
- li v0,0xb4000400
- li t0,htoll(0x0)
- sw t0,0(v0)
- li v0,0xb4000404
- li t0,htoll(0xff)
- sw t0,0(v0)
- li v0,0xb4000408
- li t0,htoll(0xff)
- sw t0,0(v0)
- li v0,0xb400040c
- li t0,htoll(0x00)
- sw t0,0(v0)
- li v0,0xb4000410
- li t0,htoll(0xff)
- sw t0,0(v0)
- li v0,0xb4000414
- li t0,htoll(0x00)
- sw t0,0(v0)
- li v0,0xb4000418
- li t0,htoll(0xff)
- sw t0,0(v0)
- li v0,0xb400041c
- li t0,htoll(0x00)
- sw t0,0(v0)
-
- /* Configure bank0 to 256 Mbit */
- DBG("Configure bank0 to 256 Mbit...\r\n")
- li v0,0xb400044c
- li t0,htoll(0x00004c69)
- sw t0,0(v0)
-
- /* Config the SDRAM banks decode system */
- li v0,0xb400047c
- li t0,htoll(2)
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x3)
- sw t0,0(v0)
-
- li v0,0xa0000000
- li t0,0
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x0)
- sw t0,0(v0)
-
- /* Write to address 0x2000000 and check if 0x00000000 is being written too */
- DBG("Write to address 0x2000000 and check if 0x00000000 is being written too...\r\n")
- li v0,0xa0000000
- li t1,0xa0000010
- li t0,htoll(0x0)
-1: sw t0,0(v0)
- addu v0,4
- bne t1,v0,1b
-
- /* The address should activate Dadr12 */
- li v0,0xa2000000
- li t0,0x11111111
- sw t0,0(v0)
- li v0,0xa0000010
- li t1,0xa0000100
- li t0,0x22222222
-2: sw t0,0(v0)
- addu v0,4
- bne t1,v0,2b
-
- DBG("Check address 0x00000000 for duplications...\r\n")
- li t0,0xa0000000
- li v0,0x11111111
- lw t0,(t0)
- bne t0,v0,_256MBIT
-
- /* Write to address 0x1000 and check if 0x00000000 is being written too */
- DBG("Write to address 0x1000 and check if 0x00000000 is being written too...\r\n")
- li v0,0xa0000000
- li t1,0xa0000010
- li t0,htoll(0x0)
-1: sw t0,0(v0)
- addu v0,4
- bne t1,v0,1b
-
- /* The address should activate bank select1*/
- li v0,0xa0001000
- li t0,0x11111111
- sw t0,0(v0)
- li v0,0xa0000010
- li t1,0xa0000100
- li t0,0x22222222
-2: sw t0,0(v0)
- addu v0,4
- bne t1,v0,2b
-
- DBG("Check address 0x00000000 for duplications...\r\n")
- li t0,0xa0000000
- li v0,0x11111111
- lw t0,(t0)
- beq t0,v0,_16MBIT
-
- /* Write to address 0x8000000 and check if 0x00000000 is being written too */
- DBG("Write to address 0x8000000 and check if 0x00000000 is being written too...\r\n")
- li v0,0xa0000000
- li t1,0xa0000010
- li t0,htoll(0x0)
-1: sw t0,0(v0)
- addu v0,4
- bne t1,v0,1b
-
- /* The address should activate Dadr9 which on the column cycle is in active with 64 Mbit
- device */
- li v0,0xa8000000
- li t0,0x11111111
- sw t0,0(v0)
- li v0,0xa0000010
- li t1,0xa0000100
- li t0,0x22222222
-2: sw t0,0(v0)
- addu v0,4
- bne t1,v0,2b
-
- DBG("Check address 0x00000000 for duplications...\r\n")
- li t0,0xa0000000
- li v0,0x11111111
- lw t0,(t0)
- beq t0,v0,_64MBIT
- b _128MBIT
-
-_16MBIT:
- DBG("16 Mbit SDRAM detected...\r\n")
- /* In 16 Mbit SDRAM we must use 2 way bank interleaving!!! */
- li v0,0xb4000810
- li t0,htoll(16)
- sw t0,0(v0)
- li t1,htoll(0x00000449)
- b _DIMM1
-
-_64MBIT:
- DBG("64 Mbit SDRAM detected...\r\n")
- /* In 64 Mbit SDRAM we must use 4 way bank interleaving!!! */
- li v0,0xb4000810
- li t0,htoll(64)
- sw t0,0(v0)
- li t1,htoll(0x00000c69)
- b _DIMM1
-
-_128MBIT:
- DBG("128 Mbit SDRAM detected...\r\n")
- /* In 128 Mbit SDRAM we must use 4 way bank interleaving!!! */
- li v0,0xb4000810
- li t0,htoll(128)
- sw t0,0(v0)
- li t1,htoll(0x00000c69)
- b _DIMM1
-
-_256MBIT:
- DBG("256 Mbit SDRAM detected...\r\n")
- /* In 256 Mbit SDRAM we must use 4 way bank interleaving!!! */
- li v0,0xb4000810
- li t0,htoll(256)
- sw t0,0(v0)
- li t1,htoll(0x00004c69)
- b _DIMM1
-
-_DIMM1:
- li v0,0xb400044c
- sw t1,0(v0) # Bank0
- sw t1,4(v0) # Bank1
-
- /* Detect whether we have a 16,64,128 or 256 Mbit SDRAM on DIMM1 */
- /* Close banks 0 and 1 */
- li v0,0xb4000008
- li t0,htoll(0xff)
- sw t0,0(v0)
-
- li v0,0xb4000010
- li t0,htoll(0x0)
- sw t0,0(v0)
-
- /* Set bank2`s range to: 0 - 0x10000000 (256 MByte) */
- li v0,0xb4000018
- li t0,htoll(0x0)
- sw t0,0(v0)
- li v0,0xb4000020
- li t0,htoll(0x7f)
- sw t0,0(v0)
-
- /* Extend bank2 to 0x10000000 and Close bank0,1 and 3 */
- DBG("Extend bank2 to 0x10000000 and Close banks 0,1 and 3...\r\n")
- li v0,0xb4000400
- li t0,htoll(0xff)
- sw t0,0(v0)
- li v0,0xb4000404
- li t0,htoll(0x00)
- sw t0,0(v0)
- li v0,0xb4000408
- li t0,htoll(0xff)
- sw t0,0(v0)
- li v0,0xb400040c
- li t0,htoll(0x00)
- sw t0,0(v0)
- li v0,0xb4000410
- li t0,htoll(0x00)
- sw t0,0(v0)
- li v0,0xb4000414
- li t0,htoll(0xff)
- sw t0,0(v0)
- li v0,0xb4000418
- li t0,htoll(0xff)
- sw t0,0(v0)
- li v0,0xb400041c
- li t0,htoll(0x00)
- sw t0,0(v0)
-
- /* Configure bank2 to 256 Mbit */
- DBG("Configure bank2 to 256 Mbit...\r\n")
- li v0,0xb4000454
- li t0,htoll(0x00004c69)
- sw t0,0(v0)
-
- /* Config the SDRAM banks decode system */
- li v0,0xb400047c
- li t0,htoll(2)
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x3)
- sw t0,0(v0)
-
- li v0,0xa0000000
- li t0,0
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x0)
- sw t0,0(v0)
-
- /* Write to address 0x2000000 and check if 0x00000000 is being written too */
- DBG("Write to address 0x2000000 and check if 0x00000000 is being written too...\r\n")
- li v0,0xa0000000
- li t1,0xa0000010
- li t0,htoll(0x0)
-1: sw t0,0(v0)
- addu v0,4
- bne t1,v0,1b
-
- /* The address should activate Dadr12 */
- li v0,0xa2000000
- li t0,0x11111111
- sw t0,0(v0)
- li v0,0xa0000010
- li t1,0xa0000100
- li t0,0x22222222
-2: sw t0,0(v0)
- addu v0,4
- bne t1,v0,2b
-
- DBG("Check address 0x00000000 for duplications...\r\n")
- li t0,0xa0000000
- li v0,0x11111111
- lw t0,(t0)
- bne t0,v0,_256MBIT2
-
- /* Write to address 0x1000 and check if 0x00000000 is being written too */
- DBG("Write to address 0x1000 and check if 0x00000000 is being written too...\r\n")
- li v0,0xa0000000
- li t1,0xa0000010
- li t0,htoll(0x0)
-1: sw t0,0(v0)
- addu v0,4
- bne t1,v0,1b
-
- /* The address should activate bank select1*/
- li v0,0xa0001000
- li t0,0x11111111
- sw t0,0(v0)
- li v0,0xa0000010
- li t1,0xa0000100
- li t0,0x22222222
-2: sw t0,0(v0)
- addu v0,4
- bne t1,v0,2b
-
- DBG("Check address 0x00000000 for duplications...\r\n")
- li t0,0xa0000000
- li v0,0x11111111
- lw t0,(t0)
- beq t0,v0,_16MBIT2
-
- /* Write to address 0x8000000 and check if 0x00000000 is being written too */
- DBG("Write to address 0x8000000 and check if 0x00000000 is being written too...\r\n")
- li v0,0xa0000000
- li t1,0xa0000010
- li t0,htoll(0x0)
-1: sw t0,0(v0)
- addu v0,4
- bne t1,v0,1b
-
- /* The address should activate Dadr9 which on the column cycle is in active with 64 Mbit
- device */
- li v0,0xa8000000
- li t0,0x11111111
- sw t0,0(v0)
- li v0,0xa0000010
- li t1,0xa0000100
- li t0,0x22222222
-2: sw t0,0(v0)
- addu v0,4
- bne t1,v0,2b
-
- DBG("Check address 0x00000000 for duplications...\r\n")
- li t0,0xa0000000
- li v0,0x11111111
- lw t0,(t0)
- beq t0,v0,_64MBIT2
- b _128MBIT2
-
-_16MBIT2:
- DBG("16 Mbit SDRAM detected...\r\n")
- /* In 16 Mbit SDRAM we must use 2 way bank interleaving!!! */
- li v0,0xb4000814
- li t0,htoll(16)
- sw t0,0(v0)
- li t1,htoll(0x00000449)
- b _INIT_SDRAM
-
-_64MBIT2:
- DBG("64 Mbit SDRAM detected...\r\n")
- /* In 64 Mbit SDRAM we must use 4 way bank interleaving!!! */
- li v0,0xb4000814
- li t0,htoll(64)
- sw t0,0(v0)
- li t1,htoll(0x00000c69)
- b _INIT_SDRAM
-
-_128MBIT2:
- DBG("128 Mbit SDRAM detected...\r\n")
- /* In 128 Mbit SDRAM we must use 4 way bank interleaving!!! */
- li v0,0xb4000814
- li t0,htoll(128)
- sw t0,0(v0)
- li t1,htoll(0x00000c69)
- b _INIT_SDRAM
-
-_256MBIT2:
- DBG("256 Mbit SDRAM detected...\r\n")
- /* In 256 Mbit SDRAM we must use 4 way bank interleaving!!! */
- li v0,0xb4000814
- li t0,htoll(256)
- sw t0,0(v0)
- li t1,htoll(0x00004c69)
- b _INIT_SDRAM
-
-_INIT_SDRAM:
- /* Restore defaults */
- DBG("Restoring defaults...\r\n")
- li v0,0xb4000404
- li t0,htoll(0x07)
- sw t0,0(v0)
- li v0,0xb4000408
- li t0,htoll(0x08)
- sw t0,0(v0)
- li v0,0xb400040c
- li t0,htoll(0x0f)
- sw t0,0(v0)
- li v0,0xb4000410
- li t0,htoll(0x10)
- sw t0,0(v0)
- li v0,0xb4000414
- li t0,htoll(0x17)
- sw t0,0(v0)
- li v0,0xb4000418
- li t0,htoll(0x18)
- sw t0,0(v0)
- li v0,0xb400041c
- li t0,htoll(0x1f)
- sw t0,0(v0)
- li v0,0xb4000010
- li t0,htoll(0x07)
- sw t0,0(v0)
- li v0,0xb4000018
- li t0,htoll(0x008)
- sw t0,0(v0)
- li v0,0xb4000020
- li t0,htoll(0x0f)
- sw t0,0(v0)
-
- li v0,0xb400044c
- sw t1,8(v0) # Bank2
- sw t1,12(v0) # Bank3
-
- li v0,0xb4000474
- li t0,htoll(0x3)
- sw t0,0(v0)
-
- li v0,0xa0000000
- li t0,0
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x0)
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x3)
- sw t0,0(v0)
-
- li v0,0xa0800000
- li t0,0
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x0)
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x3)
- sw t0,0(v0)
-
- li v0,0xa1000000
- li t0,0
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x0)
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x3)
- sw t0,0(v0)
-
- li v0,0xa1800000
- li t0,0
- sw t0,0(v0)
-
- li v0,0xb4000474
- li t0,htoll(0x0)
- sw t0,0(v0)
-
- /*********************************************************************/
- /************************* SDRAM initializing ************************/
- /******************************* END *********************************/
-
- li p64011, PA_TO_KVA1(GT64011_BASE)
-
- li t0,htoll(0x00000000) /* RAS[1:0] low decode address */
- sw t0,0x008(p64011)
-
- li t0,htoll(0x00000007) /* RAS[1:0] high decode address */
- sw t0,0x010(p64011)
-
- li t0,htoll(0x00000000) /* RAS[0] Low decode address */
- sw t0,0x400(p64011)
-
- li t0,htoll(0x0000000f) /* RAS[0] High decode address */
- sw t0,0x404(p64011)
-
- li t0,htoll(0x00000008) /* RAS[3:2] low decode address */
- sw t0,0x018(p64011)
-
- li t0,htoll(0x0000000f) /* RAS[3:2] high decode address */
- sw t0,0x020(p64011)
-
- li t0,htoll(0x0000000f) /* RAS[1] Low Decode Address */
- sw t0,0x408(p64011)
-
- li t0,htoll(0x00000008) /* RAS[1] High Decode Address */
- sw t0,0x40c(p64011)
-
- li t0,htoll(0x00000010) /* RAS[2] Low Decode Address */
- sw t0,0x410(p64011)
-
- li t0,htoll(0x00000017) /* RAS[2] High Decode Address */
- sw t0,0x414(p64011)
-
- li t0,htoll(0x00000018) /* RAS[3] Low Decode Address */
- sw t0,0x418(p64011)
-
- li t0,htoll(0x0000001f) /* RAS[3] High Decode Address <<<<<< 1*/
- sw t0,0x41c(p64011)
-
-#ifdef DBGSBD
-#define DREG(str,rname) \
- DBG(str); \
- DBG(":\t") ; \
- lw a0,rname(p64011) ; \
- HTOLL(a0,t0) ; \
- jal _dbghex ; \
- DBG("\r\n")
-
- DBG("GT-64120 settings:\r\n")
- DREG("DRAMPAR_BANK0 (44c)",GT_DRAMPAR_BANK0)
- DREG("DRAMPAR_BANK1 (450)",GT_DRAMPAR_BANK1)
- DREG("DRAMPAR_BANK2 (454)",GT_DRAMPAR_BANK2)
- DREG("DRAMPAR_BANK3 (458)",GT_DRAMPAR_BANK3)
- DREG("PAS_RAS10LO (008)",GT_PAS_RAS10LO)
- DREG("PAS_RAS10HI (010)",GT_PAS_RAS10HI)
- DREG("PAS_RAS32LO (018)",GT_PAS_RAS32LO)
- DREG("PAS_RAS32HI (020)",GT_PAS_RAS32HI)
- DREG("DDAS_RAS0LO (400)",GT_DDAS_RAS0LO)
- DREG("DDAS_RAS0HI (404)",GT_DDAS_RAS0HI)
- DREG("DDAS_RAS1LO (408)",GT_DDAS_RAS1LO)
- DREG("DDAS_RAS1HI (40c)",GT_DDAS_RAS1HI)
- DREG("DDAS_RAS2LO (410)",GT_DDAS_RAS2LO)
- DREG("DDAS_RAS2HI (414)",GT_DDAS_RAS2HI)
- DREG("DDAS_RAS3LO (418)",GT_DDAS_RAS3LO)
- DREG("DDAS_RAS3HI (41c)",GT_DDAS_RAS3HI)
- DREG("GT_DRAM_CFG (448)",GT_DRAM_CFG)
- DREG("GT_DEVPAR_BANK0 (45c)",GT_DEVPAR_BANK0)
- DREG("GT_DEVPAR_BANK1 (460)",GT_DEVPAR_BANK1)
- DREG("GT_DEVPAR_BANK2 (464)",GT_DEVPAR_BANK2)
- DREG("GT_DEVPAR_BANK3 (468)",GT_DEVPAR_BANK3)
- DREG("GT_IPCI_TOR (c04)",GT_IPCI_TOR)
-#endif
-
- /* we can now initialise the caches for a fast clear_mem */
- SBD_DISPLAY ('C','A','C','H',CHKPNT_CACH)
- DBG("init_cache\r\n")
-// jal mips_init_cache
-
-.noinit:
-
- /* initialise tlb */
- SBD_DISPLAY ('I','T','L','B', CHKPNT_ITLB)
- DBG("init_tlb\r\n")
-// bal init_tlb
-
-// DBG("sbdreset completed\r\n")
-// move ra,rasave
- j GetExtendedMemorySize
- nop
-
-END(sbdreset)
-
-LEAF(_sbd_memfail)
- SBD_DISPLAY ('!','M','E','M',CHKPNT_0MEM)
-1: b 1b
- j ra
-END(_sbd_memfail)
-
- .rdata
-RefreshBits:
- .word htoll(GT_DRAMPAR_Refresh512)
- .word htoll(GT_DRAMPAR_Refresh1024)
- .word htoll(GT_DRAMPAR_Refresh2048)
- .word htoll(GT_DRAMPAR_Refresh4096)
- .text
-
-/* DRAM: */
-#define GT_DRAM_CFG_INIT \
- GT_DRAM_CFG_RefIntCnt(160) | \
- GT_DRAM_CFG_StagRefOn | \
- GT_DRAM_CFG_ADSFunctDRAM | \
- GT_DRAM_CFG_DRAMLatchActive
-
-/* serial port: widest timings even 8 bit bus, latch enabled no parity */
-#define GT_DEVPAR_SERIALINIT \
- GT_DEVPAR_TurnOff(7) | \
- GT_DEVPAR_AccToFirst(15) | \
- GT_DEVPAR_AccToNext(15) | \
- GT_DEVPAR_ADStoWr(7) | \
- GT_DEVPAR_WrActive(7) | \
- GT_DEVPAR_WrHigh(7) | \
- GT_DEVPAR_DevWidth8 | \
- GT_DEVPAR_DevLocEven | \
- GT_DEVPAR_LatchFunctTransparent | \
- GT_DEVPAR_ParityDisable | \
- GT_DEVPAR_Reserved
-
-/* PCI: */
-#define GT_IPCI_TOR_INIT \
- GT_IPCI_TOR_Timeout0(255) | \
- GT_IPCI_TOR_Timeout1(255) | \
- GT_IPCI_TOR_RetryCtr(0)
-
-#define INIT(addr,val) \
- .word addr, val
-#define GTINIT(addr,val) \
- INIT(PHYS_TO_K1(GT64011_BASE+(addr)), htoll(val))
-
- .rdata
-reginittab:
-
- /* disable ras1:0 and ras3:2 decodes */
- GTINIT(GT_PAS_RAS10LO, GT_PAS_LOMASK_Low);
- GTINIT(GT_PAS_RAS10HI, 0);
- GTINIT(GT_PAS_RAS32LO, GT_PAS_LOMASK_Low);
- GTINIT(GT_PAS_RAS32HI, 0);
-
- /* disable RAS[0123] */
- GTINIT(GT_DDAS_RAS0LO, GT_DDAS_LOMASK_Low)
- GTINIT(GT_DDAS_RAS0HI, 0);
- GTINIT(GT_DDAS_RAS1LO, GT_DDAS_LOMASK_Low)
- GTINIT(GT_DDAS_RAS1HI, 0);
- GTINIT(GT_DDAS_RAS2LO, GT_DDAS_LOMASK_Low)
- GTINIT(GT_DDAS_RAS2HI, 0);
- GTINIT(GT_DDAS_RAS3LO, GT_DDAS_LOMASK_Low)
- GTINIT(GT_DDAS_RAS3HI, 0);
-
- /* 0x45c, 0x460, 0x464, 0x468 */
- /*GTINIT(GT_DEVPAR_BANK0, GT_DEVPAR_SERIALINIT)*/
- GTINIT(GT_DEVPAR_BANK0, 0x3847de60)
- GTINIT(GT_DEVPAR_BANK1, 0x146fffff)
- GTINIT(GT_DEVPAR_BANK2, 0x144fffff)
- GTINIT(GT_DEVPAR_BANK3, 0x167fffff)
-
- GTINIT(GT_IPCI_TOR, GT_IPCI_TOR_INIT)
- INIT(0,0)
- .text
-
- .globl sbddelay
-
-LEAF(sbdberrenb)
- mfc0 v0,C0_SR
- li t0,SR_DE
- bnez a0,1f
- or t1,v0,t0 # disable cache/parity errors (SR_DE = 1)
- b 2f
-1: not t1,t0 # enable cache/parity errors (SR_DE = 0)
- and t1,v0
-2: mtc0 t1,C0_SR
- and v0,t0 # get old SR_DE bit
- xor v0,t0 # and invert to make it an enable bit
- j ra
-END(sbdberrenb)
-
-
-LEAF(sbdberrcnt)
- move v0,zero
- j ra
-END(sbdberrcnt)
-
- .lcomm wbfltmp,4
-
-LEAF(wbflush)
-//XLEAF(mips_wbflush)
- sync
- la t0,wbfltmp
- or t0,K1BASE
- lw zero,0(t0)
- j ra
-END(wbflush)
-
-
-LEAF(sbddelay)
- li t1,CACHEUS
- and t0,ra,0x20000000
- beqz t0,1f
- li t1,ROMUS
-1: mul a0,t1
- subu a0,15 # approx number of loops so far
-
- .set noreorder
- .set nomacro
- nop
-2: bgtz a0,2b
- subu a0,1
- .set macro
- .set reorder
-
- j ra
-END(sbddelay)
-
-#include "meminit.S"
-
-
-LEAF(mips_cycle)
- .set noreorder
- .set nomacro
-1: bgtz a0,1b
- subu a0,1
- .set macro
- .set reorder
- j ra
-END(mips_cycle)
-
-LEAF(init_ns16550_chan_b)
- # enable 16550 fifo if it is there
- li a0,NS16550_CHANB
- li t0,FIFO_ENABLE|FIFO_RCV_RST|FIFO_XMT_RST|FIFO_TRIGGER_4
- sb t0,FIFO(a0)
-
- /* convert baud rate in a1 into register value */
- li t2,NS16550_HZ/(16*115200) # brtc = CLK/16/speed
-
- li t0,CFCR_DLAB # select brtc divisor
- sb t0,CFCR(a0)
- sb t2,DATA(a0) # store divisor lsb
- srl t2,8
- sb t2,IER(a0) # store divisor msb
-
- li t0,CFCR_8BITS # set 8N1 mode
- sb t0,CFCR(a0)
-
- li t0,MCR_DTR|MCR_RTS # Galileo |MCR_IENABLE # enable DTR & RTS
- sb t0,MCR(a0)
- li t0,0 # Galileo IER_ERXRDY # enable receive interrupt(!)
- sb t0,IER(a0)
-
- move v0,zero # indicate success
- j ra
-
-END(init_ns16550_chan_b)
-
-LEAF(init_ns16550_chan_a)
- # enable 16550 fifo if it is there
- li a0,NS16550_CHANA
- li t0,FIFO_ENABLE|FIFO_RCV_RST|FIFO_XMT_RST|FIFO_TRIGGER_4
- sb t0,FIFO(a0)
-
- /* convert baud rate in a1 into register value */
- li t2,NS16550_HZ/(16*9600) # brtc = CLK/16/speed
-
- li t0,CFCR_DLAB # select brtc divisor
- sb t0,CFCR(a0)
- sb t2,DATA(a0) # store divisor lsb
- srl t2,8
- sb t2,IER(a0) # store divisor msb
-
- li t0,CFCR_8BITS # set 8N1 mode
- sb t0,CFCR(a0)
-
- li t0,MCR_DTR|MCR_RTS # Galileo |MCR_IENABLE # enable DTR & RTS
- sb t0,MCR(a0)
- li t0,0 # Galileo IER_ERXRDY # enable receive interrupt(!)
- sb t0,IER(a0)
-
- move v0,zero # indicate success
- j ra
-
-END(init_ns16550_chan_a)
-
-#endif /* EVB64120A */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/xfer.c linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/xfer.c
--- linux-2.4.22.clean/arch/mips/galileo-boards/ev64120/compressed/xfer.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.22/arch/mips/galileo-boards/ev64120/compressed/xfer.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,114 +0,0 @@
-/*
- * arch/mips/galileo/compressed/xfer.c
- *
- * By RidgeRun Inc,
- *
- * Xfer an image from flash to ram.
- * For use with Galileo EVB64120A MIPS eval board.
- */
-
-#include "linux/serial_reg.h"
-
-#define port 0xbd000000
-#define inb(addr) (*(volatile unsigned char *) ((unsigned long)(addr)))
-#define outb(b,addr) (*(volatile unsigned char *) ((unsigned long)(addr)) = (b))
-
-#ifdef RUNNINGFROMFLASH
-// This is where our image of interest is mapped to
-// when the jumbers are set for booting out of flash.
-// (flash part starts at address 0xbfC00000)
-#define srcAddr 0xbfC20000
-#else
-// This is where our image of interest is mapped to
-// when the jumbers are set for booting out of eprom.
-// (flash part starts at address 0xbf000000)
-#define srcAddr 0xbf020000
-#endif
-
-static int PortAddress(unsigned int channel, unsigned char reg);
-static void inline cons_hook(void);
-static void print_message(const char *string);
-
-/******************************
- Routine:
- Description:
- ******************************/
-void XferToRam(void)
-{
- unsigned int temp;
- void (*entry_point) (void);
-
- cons_hook();
-
- print_message("Copying image from Flash to Ram.\n");
- for (temp = 0; temp < (0x100000 - 0x20000); temp = temp + 4) {
- *(volatile unsigned int *) (temp + 0xa0400000) =
- *(volatile unsigned int *) (temp + srcAddr);
- if (*(volatile unsigned int *) (temp + 0xa0400000) !=
- *(volatile unsigned int *) (temp + srcAddr)) {
- print_message
- ("Error!: copy verification failed.\n");
- break;
- }
- }
-
- print_message("Now jumping to the code just xferred to ram.\n");
- entry_point = (void *) 0x80400000;
- entry_point();
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-static int PortAddress(unsigned int channel, unsigned char reg)
-{
- unsigned int channelOffset = 0x20;
- unsigned int regDelta = 4;
- return (port + (channel * channelOffset) + (reg * regDelta));
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-static void cons_hook(void)
-{
- register int comstat;
- unsigned temp;
- unsigned int channel = 1; // Channel 1 is the main serial
- // connector of the EVB64120A. Channel 0
- // is the secondary serial port (typically
- // the unsoldered connector of the board).
-
- temp = *(unsigned int *) 0xb4000464;
- *(unsigned int *) 0xb4000464 = 0xffff4f14;
-
- // Set Baud Rate, baud=115K
- outb(0x83, PortAddress(channel, UART_LCR));
- outb(0x00, PortAddress(channel, UART_DLM));
- outb(0x02, PortAddress(channel, UART_DLL));
- outb(0x03, PortAddress(channel, UART_LCR));
-
- comstat = inb(PortAddress(channel, UART_LSR));
- comstat = inb(PortAddress(channel, UART_RX));
- outb(0x00, PortAddress(channel, UART_IER));
-}
-
-/******************************
- Routine:
- Description:
- ******************************/
-static void print_message(const char *string)
-{
- register int count, loop;
- /* Display Opening Message */
- for (count = 0; string[count]; count++) {
- if (string[count] == '\n') {
- *(char *) 0xbd000020 = '\r';
- }
- *(char *) 0xbd000020 = string[count];
- for (loop = 0; loop < 2000; loop++) {
- }
- }
-}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/ite-boards/generic/time.c linux-2.4.22/arch/mips/ite-boards/generic/time.c
--- linux-2.4.22.clean/arch/mips/ite-boards/generic/time.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/ite-boards/generic/time.c 2003-09-27 14:07:04.000000000 +0200
@@ -114,7 +114,7 @@
static unsigned long r4k_offset; /* Amount to increment compare reg each time */
static unsigned long r4k_cur; /* What counter should be at next timer irq */
-extern unsigned int mips_counter_frequency;
+extern unsigned int mips_hpt_frequency;
/*
* Figure out the r4k offset, the amount to increment the compare
@@ -138,12 +138,12 @@
while (CMOS_READ(RTC_REG_A) & RTC_UIP);
while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
- mips_counter_frequency = read_c0_count();
+ mips_hpt_frequency = read_c0_count();
/* restore interrupts */
local_irq_restore(flags);
- return (mips_counter_frequency / HZ);
+ return (mips_hpt_frequency / HZ);
}
static unsigned long
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/kernel/ipc.c linux-2.4.22/arch/mips/kernel/ipc.c
--- linux-2.4.22.clean/arch/mips/kernel/ipc.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/kernel/ipc.c 2003-09-27 14:07:04.000000000 +0200
@@ -32,7 +32,11 @@
switch (call) {
case SEMOP:
- return sys_semop (first, (struct sembuf *)ptr, second);
+ return sys_semtimedop (first, (struct sembuf *)ptr, second,
+ NULL);
+ case SEMTIMEDOP:
+ return sys_semtimedop (first, (struct sembuf *)ptr, second,
+ (const struct timespec *)fifth);
case SEMGET:
return sys_semget (first, second, third);
case SEMCTL: {
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/kernel/proc.c linux-2.4.22/arch/mips/kernel/proc.c
--- linux-2.4.22.clean/arch/mips/kernel/proc.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/kernel/proc.c 2003-09-21 03:07:51.000000000 +0200
@@ -101,6 +101,11 @@
seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
loops_per_jiffy / (500000/HZ),
(loops_per_jiffy / (5000/HZ)) % 100);
+#ifdef __MIPSEB__
+ seq_printf(m, "byteorder\t\t: big endian\n");
+#else
+ seq_printf(m, "byteorder\t\t: little endian\n");
+#endif
seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
seq_printf(m, "microsecond timers\t: %s\n",
cpu_has_counter ? "yes" : "no");
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/kernel/setup.c linux-2.4.22/arch/mips/kernel/setup.c
--- linux-2.4.22.clean/arch/mips/kernel/setup.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/kernel/setup.c 2003-09-21 03:07:34.000000000 +0200
@@ -231,6 +231,37 @@
}
}
+static inline void parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_end)
+{
+ char c = ' ', *to = command_line, *from = saved_command_line;
+ int len = 0;
+ unsigned long rd_size = 0;
+
+ for (;;) {
+ /*
+ * "rd_start=0xNNNNNNNN" defines the memory address of an initrd
+ * "rd_size=0xNN" it's size
+ */
+ if (c == ' ' && !memcmp(from, "rd_start=", 9)) {
+ if (to != command_line)
+ to--;
+ (*rd_start) = memparse(from + 9, &from);
+ }
+ if (c == ' ' && !memcmp(from, "rd_size=", 8)) {
+ if (to != command_line)
+ to--;
+ rd_size = memparse(from + 8, &from);
+ }
+ c = *(from++);
+ if (!c)
+ break;
+ if (CL_SIZE <= ++len)
+ break;
+ *(to++) = c;
+ }
+ *to = '\0';
+ (*rd_end) = (*rd_start) + rd_size;
+}
#define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT)
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
@@ -241,31 +272,24 @@
static inline void bootmem_init(void)
{
-#ifdef CONFIG_BLK_DEV_INITRD
- unsigned long tmp;
- unsigned long *initrd_header;
-#endif
unsigned long bootmap_size;
unsigned long start_pfn, max_pfn, max_low_pfn, first_usable_pfn;
+ unsigned long end = &_end;
int i;
#ifdef CONFIG_BLK_DEV_INITRD
- tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - 8;
- if (tmp < (unsigned long)&_end)
- tmp += PAGE_SIZE;
- initrd_header = (unsigned long *)tmp;
- if (initrd_header[0] == 0x494E5244) {
- initrd_start = (unsigned long)&initrd_header[2];
- initrd_end = initrd_start + initrd_header[1];
+ parse_rd_cmdline(&initrd_start, &initrd_end);
+ if(initrd_start && initrd_end)
+ end = initrd_end;
+ else {
+ initrd_start = initrd_end = 0;
}
- start_pfn = PFN_UP(__pa((&_end)+(initrd_end - initrd_start) + PAGE_SIZE));
-#else
+#endif /* CONFIG_BLK_DEV_INITRD */
/*
* Partially used pages are not usable - thus
* we are rounding upwards.
*/
- start_pfn = PFN_UP(__pa(&_end));
-#endif /* CONFIG_BLK_DEV_INITRD */
+ start_pfn = PFN_UP(__pa(end));
/* Find the highest page frame number we have available. */
max_pfn = 0;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/kernel/time.c linux-2.4.22/arch/mips/kernel/time.c
--- linux-2.4.22.clean/arch/mips/kernel/time.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/kernel/time.c 2003-09-27 14:07:04.000000000 +0200
@@ -102,9 +102,9 @@
/*
- * Timer ack for a R4k-compatible timer of a known frequency.
+ * Timer ack for an R4k-compatible timer of a known frequency.
*/
-static void c0_fixed_timer_ack(void)
+static void c0_timer_ack(void)
{
unsigned int count;
@@ -129,22 +129,23 @@
return read_c0_count();
}
-/* For unknown frequency. */
+/* For use solely as a high precision timer. */
static void c0_hpt_init(unsigned int count)
{
write_c0_count(read_c0_count() - count);
}
-/* For a known frequency. Used as an interrupt source. */
-static void c0_fixed_hpt_init(unsigned int count)
+/* For use both as a high precision timer and an interrupt source. */
+static void c0_hpt_timer_init(unsigned int count)
{
- expirelo = cycles_per_jiffy;
count = read_c0_count() - count;
- write_c0_count(0);
- write_c0_compare(cycles_per_jiffy);
+ expirelo = (count / cycles_per_jiffy + 1) * cycles_per_jiffy;
+ write_c0_count(expirelo - cycles_per_jiffy);
+ write_c0_compare(expirelo);
write_c0_count(count);
}
+int (*mips_timer_state)(void);
void (*mips_timer_ack)(void);
unsigned int (*mips_hpt_read)(void);
void (*mips_hpt_init)(unsigned int);
@@ -328,9 +329,9 @@
"dsll32 %1,%2,0\n\t"
"or %1,%1,%0\n\t"
"ddivu $0,%1,%4\n\t"
+ "mflo %1\n\t"
"dsll32 %0,%5,0\n\t"
"or %0,%0,%6\n\t"
- "mflo %1\n\t"
"ddivu $0,%0,%1\n\t"
"mflo %0\n\t"
".set pop"
@@ -410,6 +411,7 @@
*/
void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
+ unsigned long j;
unsigned int count;
count = mips_hpt_read();
@@ -447,10 +449,41 @@
* If jiffies has overflown in this timer_interrupt, we must
* update the timer[hi]/[lo] to make fast gettimeoffset funcs
* quotient calc still valid. -arca
- */
- if (!jiffies) {
- timerhi = timerlo = 0;
- mips_hpt_init(count);
+ *
+ * The first timer interrupt comes late as interrupts are
+ * enabled long after timers are initialized. Therefore the
+ * high precision timer is fast, leading to wrong gettimeoffset()
+ * calculations. We deal with it by setting it based on the
+ * number of its ticks between the second and the third interrupt.
+ * That is still somewhat imprecise, but it's a good estimate.
+ * --macro
+ */
+ j = jiffies;
+ if (j < 4) {
+ static unsigned int prev_count;
+ static int hpt_initialized;
+
+ switch (j) {
+ case 0:
+ timerhi = timerlo = 0;
+ mips_hpt_init(count);
+ break;
+ case 2:
+ prev_count = count;
+ break;
+ case 3:
+ if (!hpt_initialized) {
+ unsigned int c3 = 3 * (count - prev_count);
+
+ timerhi = 0;
+ timerlo = c3;
+ mips_hpt_init(count - c3);
+ hpt_initialized = 1;
+ }
+ break;
+ default:
+ break;
+ }
}
#if !defined(CONFIG_SMP)
@@ -516,7 +549,7 @@
*
* 1) board_time_init() -
* a) (optional) set up RTC routines,
- * b) (optional) calibrate and set the mips_counter_frequency
+ * b) (optional) calibrate and set the mips_hpt_frequency
* (only needed if you intended to use fixed_rate_gettimeoffset
* or use cpu counter as timer interrupt source)
* 2) setup xtime based on rtc_get_time().
@@ -531,7 +564,7 @@
void (*board_time_init)(void);
void (*board_timer_setup)(struct irqaction *irq);
-unsigned int mips_counter_frequency;
+unsigned int mips_hpt_frequency;
static struct irqaction timer_irqaction = {
.handler = timer_interrupt,
@@ -539,6 +572,49 @@
.name = "timer",
};
+static unsigned int __init calibrate_hpt(void)
+{
+ u64 frequency;
+ u32 hpt_start, hpt_end, hpt_count, hz;
+
+ const int loops = HZ / 10;
+ int log_2_loops = 0;
+ int i;
+
+ /*
+ * We want to calibrate for 0.1s, but to avoid a 64-bit
+ * division we round the number of loops up to the nearest
+ * power of 2.
+ */
+ while (loops > 1 << log_2_loops)
+ log_2_loops++;
+ i = 1 << log_2_loops;
+
+ /*
+ * Wait for a rising edge of the timer interrupt.
+ */
+ while (mips_timer_state());
+ while (!mips_timer_state());
+
+ /*
+ * Now see how many high precision timer ticks happen
+ * during the calculated number of periods between timer
+ * interrupts.
+ */
+ hpt_start = mips_hpt_read();
+ do {
+ while (mips_timer_state());
+ while (!mips_timer_state());
+ } while (--i);
+ hpt_end = mips_hpt_read();
+
+ hpt_count = hpt_end - hpt_start;
+ hz = HZ;
+ frequency = (u64)hpt_count * (u64)hz;
+
+ return frequency >> log_2_loops;
+}
+
void __init time_init(void)
{
if (board_time_init)
@@ -555,7 +631,7 @@
/* No high precision timer -- sorry. */
mips_hpt_read = null_hpt_read;
mips_hpt_init = null_hpt_init;
- } else if (!mips_counter_frequency) {
+ } else if (!mips_hpt_frequency && !mips_timer_state) {
/* A high precision timer of unknown frequency. */
if (!mips_hpt_read) {
/* No external high precision timer -- use R4k. */
@@ -578,27 +654,36 @@
*/
do_gettimeoffset = calibrate_div64_gettimeoffset;
} else {
- /* We know counter frequency! */
+ /* We know counter frequency. Or we can get it. */
if (!mips_hpt_read) {
/* No external high precision timer -- use R4k. */
mips_hpt_read = c0_hpt_read;
- mips_hpt_init = c0_fixed_hpt_init;
- if (!mips_timer_ack)
- /* R4k timer interrupt ack. */
- mips_timer_ack = c0_fixed_timer_ack;
+ if (mips_timer_state)
+ mips_hpt_init = c0_hpt_init;
+ else {
+ /* No external timer interrupt -- use R4k. */
+ mips_hpt_init = c0_hpt_timer_init;
+ mips_timer_ack = c0_timer_ack;
+ }
}
+ if (!mips_hpt_frequency)
+ mips_hpt_frequency = calibrate_hpt();
do_gettimeoffset = fixed_rate_gettimeoffset;
/* Calculate cache parameters. */
- cycles_per_jiffy = mips_counter_frequency / HZ;
+ cycles_per_jiffy = (mips_hpt_frequency + HZ / 2) / HZ;
/* sll32_usecs_per_cycle = 10^6 * 2^32 / mips_counter_freq */
- /* Any better way to do this? */
- sll32_usecs_per_cycle = mips_counter_frequency / 100000;
- sll32_usecs_per_cycle = 0xffffffff / sll32_usecs_per_cycle;
- sll32_usecs_per_cycle *= 10;
+ do_div64_32(sll32_usecs_per_cycle,
+ 1000000, mips_hpt_frequency / 2,
+ mips_hpt_frequency);
+
+ /* Report the high precision timer rate for a reference. */
+ printk("Using %u.%03u MHz high precision timer.\n",
+ ((mips_hpt_frequency + 500) / 1000) / 1000,
+ ((mips_hpt_frequency + 500) / 1000) % 1000);
}
if (!mips_timer_ack)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/kernel/traps.c linux-2.4.22/arch/mips/kernel/traps.c
--- linux-2.4.22.clean/arch/mips/kernel/traps.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/kernel/traps.c 2003-09-27 14:07:04.000000000 +0200
@@ -523,6 +523,8 @@
simulate_sc(regs, opcode);
return 0;
}
+
+ return -EFAULT; /* Strange things going on ... */
}
asmlinkage void do_ov(struct pt_regs *regs)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/lasat/lasat_board.c linux-2.4.22/arch/mips/lasat/lasat_board.c
--- linux-2.4.22.clean/arch/mips/lasat/lasat_board.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/lasat/lasat_board.c 2003-09-27 14:07:04.000000000 +0200
@@ -24,6 +24,7 @@
* Routines specific to the LASAT boards
*/
#include <linux/types.h>
+#include <linux/crc32.h>
#include <asm/lasat/lasat.h>
#include <linux/kernel.h>
#include <linux/string.h>
@@ -33,9 +34,11 @@
#include "at93c.h"
/* New model description table */
#include "lasat_models.h"
+
+#define EEPROM_CRC(data, len) (~0 ^ crc32(~0, data, len))
+
struct lasat_info lasat_board_info;
-unsigned long crc32(unsigned long, unsigned char *, int);
void update_bcastaddr(void);
int EEPROMRead(unsigned int pos, unsigned char *data, int len)
@@ -68,19 +71,19 @@
ls[LASAT_MTD_NORMAL] = 0x100000;
if (mips_machtype == MACH_LASAT_100) {
- lasat_board_info.li_flash_base = KSEG1ADDR(0x1e000000);
+ lasat_board_info.li_flash_base = 0x1e000000;
- lb[LASAT_MTD_BOOTLOADER] = KSEG1ADDR(0x1e400000);
+ lb[LASAT_MTD_BOOTLOADER] = 0x1e400000;
if (lasat_board_info.li_flash_size > 0x200000) {
ls[LASAT_MTD_CONFIG] = 0x100000;
ls[LASAT_MTD_FS] = 0x500000;
}
} else {
- lasat_board_info.li_flash_base = KSEG1ADDR(0x10000000);
+ lasat_board_info.li_flash_base = 0x10000000;
if (lasat_board_info.li_flash_size < 0x1000000) {
- lb[LASAT_MTD_BOOTLOADER] = KSEG1ADDR(0x10000000);
+ lb[LASAT_MTD_BOOTLOADER] = 0x10000000;
ls[LASAT_MTD_CONFIG] = 0x100000;
if (lasat_board_info.li_flash_size >= 0x400000) {
ls[LASAT_MTD_FS] = lasat_board_info.li_flash_size - 0x300000;
@@ -109,7 +112,7 @@
sizeof(struct lasat_eeprom_struct));
/* Check the CRC */
- crc = crc32(0x0, (unsigned char *)(&lasat_board_info.li_eeprom_info),
+ crc = EEPROM_CRC((unsigned char *)(&lasat_board_info.li_eeprom_info),
sizeof(struct lasat_eeprom_struct) - 4);
if (crc != lasat_board_info.li_eeprom_info.crc32) {
@@ -268,7 +271,7 @@
unsigned long crc;
/* Generate the CRC */
- crc = crc32(0x0, (unsigned char *)(&lasat_board_info.li_eeprom_info),
+ crc = EEPROM_CRC((unsigned char *)(&lasat_board_info.li_eeprom_info),
sizeof(struct lasat_eeprom_struct) - 4);
lasat_board_info.li_eeprom_info.crc32 = crc;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/lasat/Makefile linux-2.4.22/arch/mips/lasat/Makefile
--- linux-2.4.22.clean/arch/mips/lasat/Makefile 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/lasat/Makefile 2003-09-27 14:07:04.000000000 +0200
@@ -5,7 +5,7 @@
O_TARGET := lasatkern.o
obj-y := reset.o setup.o prom.o lasat_board.o \
- crc32.o at93c.o interrupt.o lasatIRQ.o
+ at93c.o interrupt.o lasatIRQ.o
obj-$(CONFIG_LASAT_SYSCTL) += sysctl.o
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/lasat/prom.c linux-2.4.22/arch/mips/lasat/prom.c
--- linux-2.4.22.clean/arch/mips/lasat/prom.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/lasat/prom.c 2003-09-27 14:07:04.000000000 +0200
@@ -78,7 +78,7 @@
{
u32 version = *(u32 *)(RESET_VECTOR + 0x90);
- if (version == 306) {
+ if (version >= 306) {
prom_display = (void *)PROM_DISPLAY_ADDR;
prom_putc = (void *)PROM_PUTC_ADDR;
prom_printf = real_prom_printf;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/lasat/setup.c linux-2.4.22/arch/mips/lasat/setup.c
--- linux-2.4.22.clean/arch/mips/lasat/setup.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/lasat/setup.c 2003-09-27 14:07:04.000000000 +0200
@@ -138,7 +138,7 @@
static void lasat_time_init(void)
{
- mips_counter_frequency = lasat_board_info.li_cpu_hz / 2;
+ mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
}
static void lasat_timer_setup(struct irqaction *irq)
@@ -146,7 +146,7 @@
write_c0_compare(
read_c0_count() +
- mips_counter_frequency / HZ);
+ mips_hpt_frequency / HZ);
change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/lasat/sysctl.c linux-2.4.22/arch/mips/lasat/sysctl.c
--- linux-2.4.22.clean/arch/mips/lasat/sysctl.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/lasat/sysctl.c 2003-09-27 14:07:04.000000000 +0200
@@ -95,32 +95,6 @@
return 0;
}
-static int rtctmp;
-
-#ifdef CONFIG_DS1603
-/* proc function to read/write RealTime Clock */
-int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
- void *buffer, size_t *lenp)
-{
- int r;
- down(&lasat_info_sem);
- if (!write) {
- rtctmp = ds1603_read();
- /* check for time < 0 and set to 0 */
- if (rtctmp < 0)
- rtctmp = 0;
- }
- r = proc_dointvec(table, write, filp, buffer, lenp);
- if ( (!write) || r) {
- up(&lasat_info_sem);
- return r;
- }
- ds1603_set(rtctmp);
- up(&lasat_info_sem);
- return 0;
-}
-#endif
-
/* Sysctl for setting the IP addresses */
int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen,
void *oldval, size_t *oldlenp,
@@ -140,30 +114,6 @@
return 1;
}
-#if CONFIG_DS1603
-/* Same for RTC */
-int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen,
- void *oldval, size_t *oldlenp,
- void *newval, size_t newlen, void **context)
-{
- int r;
- down(&lasat_info_sem);
- rtctmp = ds1603_read();
- if (rtctmp < 0)
- rtctmp = 0;
- r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
- if (r < 0) {
- up(&lasat_info_sem);
- return r;
- }
- if (newval && newlen) {
- ds1603_set(rtctmp);
- }
- up(&lasat_info_sem);
- return 1;
-}
-#endif
-
#ifdef CONFIG_INET
static char lasat_bcastaddr[16];
@@ -328,10 +278,6 @@
0600, NULL, &proc_dolasatstring, &sysctl_lasatstring},
{LASAT_SBOOT, "boot-service", &lasat_boot_to_service, sizeof(int),
0644, NULL, &proc_dointvec, &sysctl_intvec},
-#if CONFIG_DS1603
- {LASAT_RTC, "rtc", &rtctmp, sizeof(int),
- 0644, NULL, &proc_dolasatrtc, &sysctl_lasat_rtc},
-#endif
{LASAT_NAMESTR, "namestr", &lasat_board_info.li_namestr, sizeof(lasat_board_info.li_namestr),
0444, NULL, &proc_dostring, &sysctl_string},
{LASAT_TYPESTR, "typestr", &lasat_board_info.li_typestr, sizeof(lasat_board_info.li_typestr),
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/lasat/sysctl.h linux-2.4.22/arch/mips/lasat/sysctl.h
--- linux-2.4.22.clean/arch/mips/lasat/sysctl.h 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/lasat/sysctl.h 2003-09-27 14:07:04.000000000 +0200
@@ -16,7 +16,6 @@
LASAT_BCAST,
LASAT_PASSWORD,
LASAT_SBOOT,
- LASAT_RTC,
LASAT_NAMESTR,
LASAT_TYPESTR,
};
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/Makefile linux-2.4.22/arch/mips/Makefile
--- linux-2.4.22.clean/arch/mips/Makefile 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/arch/mips/Makefile 2003-09-27 14:07:02.000000000 +0200
@@ -47,7 +47,7 @@
LINKFLAGS += -G 0 -static # -N
MODFLAGS += -mlong-calls
-ifdef CONFIG_KGDB
+ifdef CONFIG_DEBUG_INFO
GCCFLAGS += -g
ifdef CONFIG_SB1XXX_CORELIS
GCCFLAGS += -mno-sched-prolog -fno-omit-frame-pointer
@@ -57,41 +57,51 @@
# CPU-dependent compiler/assembler options for optimization.
#
ifdef CONFIG_CPU_R3000
-GCCFLAGS += -mcpu=r3000 -mips1
+GCCFLAGS += $(call check_gcc, -mtune=r3000, -mcpu=r3000) -mips1
endif
ifdef CONFIG_CPU_TX39XX
-GCCFLAGS += -mcpu=r3000 -mips1
+GCCFLAGS += $(call check_gcc, -mtune=r3000, -mcpu=r3000) -mips1
endif
ifdef CONFIG_CPU_R6000
-GCCFLAGS += -mcpu=r6000 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r6000, -mcpu=r6000) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_R4300
-GCCFLAGS += -mcpu=r4300 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r4300, -mcpu=r4300) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_VR41XX
-GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r4600, -mcpu=r4600) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_R4X00
-GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r4600, -mcpu=r4600) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_TX49XX
-GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r4600, -mcpu=r4600) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_MIPS32
-GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r4600, -mcpu=r4600) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_MIPS64
-GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r4600, -mcpu=r4600) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_R5000
-GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r5000, -mcpu=r5000) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_R5432
-GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r5000, -mcpu=r5000) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_NEVADA
# Cannot use -mmad with currently recommended tools
-GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap
+GCCFLAGS += $(call check_gcc, -mtune=r5000, -mcpu=r5000) \
+ -mips2 -Wa,--trap
endif
ifdef CONFIG_CPU_RM7000
GCCFLAGS += $(call check_gcc, -march=rm7000, -mcpu=r5000) \
@@ -223,6 +233,16 @@
LOADADDR += 0x80100000
endif
+#
+# Cogent CSB250
+#
+ifdef CONFIG_COGENT_CSB250
+LIBS += arch/mips/au1000/csb250/csb250.o \
+ arch/mips/au1000/common/au1000.o
+SUBDIRS += arch/mips/au1000/csb250 arch/mips/au1000/common
+LOADADDR := 0x80100000
+endif
+
ifdef CONFIG_PCI
CORE_FILES += arch/mips/pci/pci-core.o
SUBDIRS += arch/mips/pci
@@ -632,6 +652,9 @@
vmlinux.ecoff: vmlinux
@$(MAKEBOOT) $@
+vmlinux.srec: vmlinux
+ @$(MAKEBOOT) $@
+
archclean:
@$(MAKEBOOT) clean
rm -f arch/$(ARCH)/ld.script
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/Makefile.lib linux-2.4.22/arch/mips/Makefile.lib
--- linux-2.4.22.clean/arch/mips/Makefile.lib 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/arch/mips/Makefile.lib 2003-08-18 04:59:02.000000000 +0200
@@ -0,0 +1 @@
+obj-$(CONFIG_LASAT) += crc32.o
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/mips-boards/generic/time.c linux-2.4.22/arch/mips/mips-boards/generic/time.c
--- linux-2.4.22.clean/arch/mips/mips-boards/generic/time.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/mips-boards/generic/time.c 2003-09-27 14:07:04.000000000 +0200
@@ -102,12 +102,12 @@
while (CMOS_READ(RTC_REG_A) & RTC_UIP);
while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
- mips_counter_frequency = read_c0_count();
+ mips_hpt_frequency = read_c0_count();
/* restore interrupts */
local_irq_restore(flags);
- return (mips_counter_frequency / HZ);
+ return (mips_hpt_frequency / HZ);
}
unsigned long __init mips_rtc_get_time(void)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/mm/cerr-sb1.c linux-2.4.22/arch/mips/mm/cerr-sb1.c
--- linux-2.4.22.clean/arch/mips/mm/cerr-sb1.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/mm/cerr-sb1.c 2003-09-27 14:07:04.000000000 +0200
@@ -193,7 +193,9 @@
prom_printf(" cp0_cerr_i == %08x", cerr_i);
breakout_cerri(cerr_i);
if (CP0_CERRI_IDX_VALID(cerr_i)) {
- if ((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK))
+ /* Check index of EPC, allowing for delay slot */
+ if (((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK)) &&
+ ((eepc & SB1_CACHE_INDEX_MASK) != ((cerr_i & SB1_CACHE_INDEX_MASK) - 4)))
prom_printf(" cerr_i idx doesn't match eepc\n");
else {
res = extract_ic(cerr_i & SB1_CACHE_INDEX_MASK,
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/mm/c-sb1.c linux-2.4.22/arch/mips/mm/c-sb1.c
--- linux-2.4.22.clean/arch/mips/mm/c-sb1.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/mm/c-sb1.c 2003-09-27 14:07:04.000000000 +0200
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
* Copyright (C) 1997, 2001 Ralf Baechle (ralf@gnu.org)
- * Copyright (C) 2000, 2001 Broadcom Corporation
+ * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -596,7 +596,6 @@
* occur
*/
_flush_cache_range = (void *) sb1_nop;
- _flush_cache_page = sb1_flush_cache_page;
_flush_cache_mm = (void (*)(struct mm_struct *))sb1_nop;
_flush_cache_all = sb1_nop;
@@ -605,6 +604,9 @@
_flush_icache_page = sb1_flush_icache_page;
_flush_icache_all = __sb1_flush_icache_all; /* local only */
+ /* This implies an Icache flush too, so can't be nop'ed */
+ _flush_cache_page = sb1_flush_cache_page;
+
_flush_cache_sigtramp = sb1_flush_cache_sigtramp;
_flush_data_cache_page = (void *) sb1_nop;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/mm/sc-ip22.c linux-2.4.22/arch/mips/mm/sc-ip22.c
--- linux-2.4.22.clean/arch/mips/mm/sc-ip22.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/mm/sc-ip22.c 2003-09-28 02:58:28.000000000 +0200
@@ -14,6 +14,7 @@
#include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/bootinfo.h>
+#include <asm/cpu.h>
#include <asm/sgi/ip22.h>
#include <asm/sgi/mc.h>
@@ -170,8 +171,14 @@
void __init indy_sc_init(void)
{
- if (indy_sc_probe()) {
- indy_sc_enable();
- bcops = &indy_sc_ops;
+ struct cpuinfo_mips *c = ¤t_cpu_data;
+ /* second level cache doesn't work on R5k IP22 at the moment */
+ if ( c->cputype == CPU_R5000 ) {
+ printk(KERN_INFO "ScInit: Not enabling second level caches.\n");
+ } else {
+ if (indy_sc_probe()) {
+ indy_sc_enable();
+ bcops = &indy_sc_ops;
+ }
}
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/mm/tlbex-r4k.S linux-2.4.22/arch/mips/mm/tlbex-r4k.S
--- linux-2.4.22.clean/arch/mips/mm/tlbex-r4k.S 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/mm/tlbex-r4k.S 2003-09-27 14:07:04.000000000 +0200
@@ -453,6 +453,7 @@
#endif
invalid_tlbl:
#ifdef TLB_OPTIMIZE
+ .set mips3
/* Test present bit in entry. */
LOAD_PTE(k0, k1)
R5K_HAZARD
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/mm/tlb-sb1.c linux-2.4.22/arch/mips/mm/tlb-sb1.c
--- linux-2.4.22.clean/arch/mips/mm/tlb-sb1.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/mm/tlb-sb1.c 2003-09-27 14:07:04.000000000 +0200
@@ -18,6 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <linux/config.h>
+#include <linux/init.h>
#include <asm/mmu_context.h>
#include <asm/bootinfo.h>
#include <asm/cpu.h>
@@ -95,10 +96,13 @@
old_ctx = read_c0_entryhi() & ASID_MASK;
write_c0_entrylo0(0);
write_c0_entrylo1(0);
- for (entry = 0; entry < current_cpu_data.tlbsize; entry++) {
+
+ entry = read_c0_wired();
+ while (entry < current_cpu_data.tlbsize) {
write_c0_entryhi(KSEG0 + (PAGE_SIZE << 1) * entry);
write_c0_index(entry);
tlb_write_indexed();
+ entry++;
}
write_c0_entryhi(old_ctx);
local_irq_restore(flags);
@@ -110,7 +114,7 @@
* Use increments of the maximum page size (16MB), and check for duplicate
* entries before doing a given write. Then, when we're safe from collisions
* with the firmware, go back and give all the entries invalid addresses with
- * the normal flush routine.
+ * the normal flush routine. Wired entries will be killed as well!
*/
void sb1_sanitize_tlb(void)
{
@@ -252,6 +256,34 @@
local_irq_restore(flags);
}
+void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
+ unsigned long entryhi, unsigned long pagemask)
+{
+ unsigned long flags;
+ unsigned long wired;
+ unsigned long old_pagemask;
+ unsigned long old_ctx;
+
+ local_irq_save(flags);
+ old_ctx = read_c0_entryhi() & 0xff;
+ old_pagemask = read_c0_pagemask();
+ wired = read_c0_wired();
+ write_c0_wired(wired + 1);
+ write_c0_index(wired);
+
+ write_c0_pagemask(pagemask);
+ write_c0_entryhi(entryhi);
+ write_c0_entrylo0(entrylo0);
+ write_c0_entrylo1(entrylo1);
+ tlb_write_indexed();
+
+ write_c0_entryhi(old_ctx);
+ write_c0_pagemask(old_pagemask);
+
+ local_flush_tlb_all();
+ local_irq_restore(flags);
+}
+
/*
* This is called from loadmmu.c. We have to set up all the
* memory management function pointers, as well as initialize
@@ -260,6 +292,7 @@
void sb1_tlb_init(void)
{
write_c0_pagemask(PM_4K);
+ write_c0_wired(0);
/*
* We don't know what state the firmware left the TLB's in, so this is
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/momentum/ocelot_c/setup.c linux-2.4.22/arch/mips/momentum/ocelot_c/setup.c
--- linux-2.4.22.clean/arch/mips/momentum/ocelot_c/setup.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/momentum/ocelot_c/setup.c 2003-09-27 14:07:04.000000000 +0200
@@ -183,9 +183,9 @@
void momenco_time_init(void)
{
#ifdef CONFIG_CPU_SR71000
- mips_counter_frequency = cpu_clock;
+ mips_hpt_frequency = cpu_clock;
#elif defined(CONFIG_CPU_RM7000)
- mips_counter_frequency = cpu_clock / 2;
+ mips_hpt_frequency = cpu_clock / 2;
#else
#error Unknown CPU for this board
#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/sgi-ip22/ip22-time.c linux-2.4.22/arch/mips/sgi-ip22/ip22-time.c
--- linux-2.4.22.clean/arch/mips/sgi-ip22/ip22-time.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/sgi-ip22/ip22-time.c 2003-09-27 14:07:04.000000000 +0200
@@ -177,7 +177,7 @@
(int) (r4k_tick / (500000 / HZ)),
(int) (r4k_tick % (500000 / HZ)));
- mips_counter_frequency = r4k_tick * HZ;
+ mips_hpt_frequency = r4k_tick * HZ;
}
/* Generic SGI handler for (spurious) 8254 interrupts */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/sibyte/cfe/smp.c linux-2.4.22/arch/mips/sibyte/cfe/smp.c
--- linux-2.4.22.clean/arch/mips/sibyte/cfe/smp.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/sibyte/cfe/smp.c 2003-09-27 14:07:04.000000000 +0200
@@ -47,12 +47,12 @@
unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 |
STATUSF_IP1 | STATUSF_IP0;
+ /* cache and TLB setup */
+ load_mmu();
+
/* Enable basic interrupts */
change_c0_status(ST0_IM, imask);
set_c0_status(ST0_IE);
-
- /* cache and TLB setup */
- load_mmu();
}
/*
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/sibyte/sb1250/smp.c linux-2.4.22/arch/mips/sibyte/sb1250/smp.c
--- linux-2.4.22.clean/arch/mips/sibyte/sb1250/smp.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/sibyte/sb1250/smp.c 2003-09-27 14:07:04.000000000 +0200
@@ -62,9 +62,6 @@
void sb1250_smp_finish(void)
{
- extern void sb1_sanitize_tlb(void);
-
- sb1_sanitize_tlb();
sb1250_time_init();
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/tx4927/common/tx4927_setup.c linux-2.4.22/arch/mips/tx4927/common/tx4927_setup.c
--- linux-2.4.22.clean/arch/mips/tx4927/common/tx4927_setup.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/tx4927/common/tx4927_setup.c 2003-09-27 14:07:04.000000000 +0200
@@ -120,7 +120,7 @@
/* to generate the first timer interrupt */
c1 = read_c0_count();
- count = c1 + (mips_counter_frequency / HZ);
+ count = c1 + (mips_hpt_frequency / HZ);
write_c0_compare(count);
c2 = read_c0_count();
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c linux-2.4.22/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
--- linux-2.4.22.clean/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c 2003-09-27 14:07:04.000000000 +0200
@@ -1168,7 +1168,7 @@
":rtc_ds1742_init()+\n");
TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT,
- ":Calibrate mips_counter_frequency-\n");
+ ":Calibrate mips_hpt_frequency-\n");
rtc_ds1742_wait();
/* get the count */
@@ -1181,29 +1181,29 @@
c2 = read_c0_count();
TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT,
- ":Calibrate mips_counter_frequency+\n");
+ ":Calibrate mips_hpt_frequency+\n");
TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT,
":c1=%12u\n", c1);
TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT,
":c2=%12u\n", c2);
/* this diff is as close as we are going to get to counter ticks per sec */
- mips_counter_frequency = abs(c2 - c1);
+ mips_hpt_frequency = abs(c2 - c1);
TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT,
- ":f1=%12u\n", mips_counter_frequency);
+ ":f1=%12u\n", mips_hpt_frequency);
/* round to 1/10th of a MHz */
- mips_counter_frequency /= (100 * 1000);
- mips_counter_frequency *= (100 * 1000);
+ mips_hpt_frequency /= (100 * 1000);
+ mips_hpt_frequency *= (100 * 1000);
TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT,
- ":f2=%12u\n", mips_counter_frequency);
+ ":f2=%12u\n", mips_hpt_frequency);
TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_INFO,
- ":mips_counter_frequency=%uHz (%uMHz)\n",
- mips_counter_frequency,
- mips_counter_frequency / 1000000);
+ ":mips_hpt_frequency=%uHz (%uMHz)\n",
+ mips_hpt_frequency,
+ mips_hpt_frequency / 1000000);
#else
- mips_counter_frequency = 100000000;
+ mips_hpt_frequency = 100000000;
#endif
TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT, "+\n");
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/vr41xx/common/bcu.c linux-2.4.22/arch/mips/vr41xx/common/bcu.c
--- linux-2.4.22.clean/arch/mips/vr41xx/common/bcu.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/vr41xx/common/bcu.c 2003-09-27 14:07:04.000000000 +0200
@@ -36,7 +36,7 @@
* - Added support for NEC VR4111 and VR4121.
*
* Paul Mundt <lethal@chaoticdreams.org>
- * - Calculate mips_counter_frequency properly on VR4131.
+ * - Calculate mips_hpt_frequency properly on VR4131.
*
* MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com>
* - New creation, NEC VR4122 and VR4131 are supported.
@@ -177,7 +177,7 @@
return tclock;
}
-static inline unsigned long calculate_mips_counter_frequency(unsigned long tclock)
+static inline unsigned long calculate_mips_hpt_frequency(unsigned long tclock)
{
/*
* VR4131 Revision 2.0 and 2.1 use a value of (tclock / 2).
@@ -202,5 +202,5 @@
vtclock = calculate_vtclock(clkspeed, pclock);
tclock = calculate_tclock(clkspeed, pclock, vtclock);
- mips_counter_frequency = calculate_mips_counter_frequency(tclock);
+ mips_hpt_frequency = calculate_mips_hpt_frequency(tclock);
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips/vr41xx/common/time.c linux-2.4.22/arch/mips/vr41xx/common/time.c
--- linux-2.4.22.clean/arch/mips/vr41xx/common/time.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips/vr41xx/common/time.c 2003-09-27 14:07:04.000000000 +0200
@@ -89,5 +89,5 @@
setup_irq(MIPS_COUNTER_IRQ, irq);
count = read_c0_count();
- write_c0_compare(count + (mips_counter_frequency / HZ));
+ write_c0_compare(count + (mips_hpt_frequency / HZ));
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/defconfig linux-2.4.22/arch/mips64/defconfig
--- linux-2.4.22.clean/arch/mips64/defconfig 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/defconfig 2003-09-27 14:07:04.000000000 +0200
@@ -137,7 +137,6 @@
# CONFIG_MIPS32_N32 is not set
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
#
# Memory Technology Devices (MTD)
@@ -473,6 +472,7 @@
# File systems
#
# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
CONFIG_AUTOFS_FS=y
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
@@ -482,6 +482,7 @@
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BEFS_DEBUG is not set
# CONFIG_BFS_FS is not set
@@ -531,6 +532,7 @@
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
+# CONFIG_NFS_DIRECTIO is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
@@ -599,10 +601,17 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
# Library routines
#
+# CONFIG_CRC32 is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/defconfig-atlas linux-2.4.22/arch/mips64/defconfig-atlas
--- linux-2.4.22.clean/arch/mips64/defconfig-atlas 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/defconfig-atlas 2003-09-27 14:07:04.000000000 +0200
@@ -132,7 +132,6 @@
# CONFIG_MIPS32_N32 is not set
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
#
# Memory Technology Devices (MTD)
@@ -484,6 +483,7 @@
# File systems
#
# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
CONFIG_AUTOFS_FS=y
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
@@ -493,6 +493,7 @@
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BEFS_DEBUG is not set
# CONFIG_BFS_FS is not set
@@ -542,6 +543,7 @@
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_DIRECTIO is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
@@ -595,11 +597,18 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
# Library routines
#
+# CONFIG_CRC32 is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/defconfig-decstation linux-2.4.22/arch/mips64/defconfig-decstation
--- linux-2.4.22.clean/arch/mips64/defconfig-decstation 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/defconfig-decstation 2003-09-27 14:07:04.000000000 +0200
@@ -70,6 +70,7 @@
CONFIG_BOOT_ELF32=y
CONFIG_IRQ_CPU=y
CONFIG_L1_CACHE_SHIFT=4
+CONFIG_NEW_TIME_C=y
CONFIG_NONCOHERENT_IO=y
# CONFIG_MIPS_AU1000 is not set
@@ -125,7 +126,6 @@
# CONFIG_MIPS32_N32 is not set
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
#
# Memory Technology Devices (MTD)
@@ -476,6 +476,7 @@
# CONFIG_AMD_PM768 is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -491,6 +492,7 @@
# File systems
#
# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
@@ -500,6 +502,7 @@
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BEFS_DEBUG is not set
# CONFIG_BFS_FS is not set
@@ -549,6 +552,7 @@
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_NFS_FS is not set
# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_DIRECTIO is not set
# CONFIG_ROOT_NFS is not set
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
@@ -616,11 +620,18 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
# Library routines
#
+# CONFIG_CRC32 is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/defconfig-ip22 linux-2.4.22/arch/mips64/defconfig-ip22
--- linux-2.4.22.clean/arch/mips64/defconfig-ip22 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/defconfig-ip22 2003-09-27 14:07:05.000000000 +0200
@@ -527,6 +527,7 @@
# File systems
#
# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
CONFIG_AUTOFS_FS=y
CONFIG_AUTOFS4_FS=y
# CONFIG_REISERFS_FS is not set
@@ -536,6 +537,7 @@
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BEFS_DEBUG is not set
# CONFIG_BFS_FS is not set
@@ -585,6 +587,7 @@
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_DIRECTIO is not set
CONFIG_ROOT_NFS=y
CONFIG_NFSD=y
# CONFIG_NFSD_V3 is not set
@@ -690,11 +693,18 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
# Library routines
#
+# CONFIG_CRC32 is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/defconfig-ip27 linux-2.4.22/arch/mips64/defconfig-ip27
--- linux-2.4.22.clean/arch/mips64/defconfig-ip27 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/defconfig-ip27 2003-09-27 14:07:05.000000000 +0200
@@ -137,7 +137,6 @@
# CONFIG_MIPS32_N32 is not set
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
#
# Memory Technology Devices (MTD)
@@ -473,6 +472,7 @@
# File systems
#
# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
CONFIG_AUTOFS_FS=y
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
@@ -482,6 +482,7 @@
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BEFS_DEBUG is not set
# CONFIG_BFS_FS is not set
@@ -531,6 +532,7 @@
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
+# CONFIG_NFS_DIRECTIO is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
@@ -599,10 +601,17 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
# Library routines
#
+# CONFIG_CRC32 is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/defconfig-malta linux-2.4.22/arch/mips64/defconfig-malta
--- linux-2.4.22.clean/arch/mips64/defconfig-malta 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/defconfig-malta 2003-09-27 14:07:05.000000000 +0200
@@ -136,7 +136,6 @@
# CONFIG_MIPS32_N32 is not set
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
#
# Memory Technology Devices (MTD)
@@ -487,6 +486,7 @@
# File systems
#
# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
CONFIG_AUTOFS_FS=y
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
@@ -496,6 +496,7 @@
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BEFS_DEBUG is not set
# CONFIG_BFS_FS is not set
@@ -545,6 +546,7 @@
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
+# CONFIG_NFS_DIRECTIO is not set
CONFIG_ROOT_NFS=y
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
@@ -599,11 +601,18 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
# Library routines
#
+# CONFIG_CRC32 is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/defconfig-sb1250-swarm linux-2.4.22/arch/mips64/defconfig-sb1250-swarm
--- linux-2.4.22.clean/arch/mips64/defconfig-sb1250-swarm 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/defconfig-sb1250-swarm 2003-09-27 14:07:05.000000000 +0200
@@ -157,7 +157,6 @@
# CONFIG_MIPS32_N32 is not set
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
#
# Memory Technology Devices (MTD)
@@ -459,6 +458,7 @@
# File systems
#
# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
@@ -468,6 +468,7 @@
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BEFS_DEBUG is not set
# CONFIG_BFS_FS is not set
@@ -517,6 +518,7 @@
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
+# CONFIG_NFS_DIRECTIO is not set
# CONFIG_ROOT_NFS is not set
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
@@ -571,11 +573,18 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_SB1XXX_CORELIS is not set
# CONFIG_MAGIC_SYSRQ is not set
#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
# Library routines
#
+# CONFIG_CRC32 is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/defconfig-sead linux-2.4.22/arch/mips64/defconfig-sead
--- linux-2.4.22.clean/arch/mips64/defconfig-sead 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/defconfig-sead 2003-09-27 14:07:05.000000000 +0200
@@ -126,7 +126,6 @@
# CONFIG_MIPS32_N32 is not set
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
#
# Memory Technology Devices (MTD)
@@ -276,6 +275,7 @@
# File systems
#
# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
@@ -285,6 +285,7 @@
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BEFS_DEBUG is not set
# CONFIG_BFS_FS is not set
@@ -374,11 +375,18 @@
# CONFIG_RUNTIME_DEBUG is not set
# CONFIG_KGDB is not set
# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_MIPS_UNCACHED is not set
#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
# Library routines
#
+# CONFIG_CRC32 is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZLIB_DEFLATE is not set
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/kernel/cpu-probe.c linux-2.4.22/arch/mips64/kernel/cpu-probe.c
--- linux-2.4.22.clean/arch/mips64/kernel/cpu-probe.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/kernel/cpu-probe.c 2003-09-27 14:07:05.000000000 +0200
@@ -113,18 +113,40 @@
}
}
-static inline void check_mult_sh(void)
+static inline void align_mod(const int align, const int mod)
+{
+ asm volatile(
+ ".set push\n\t"
+ ".set noreorder\n\t"
+ ".balign %0\n\t"
+ ".rept %1\n\t"
+ "nop\n\t"
+ ".endr\n\t"
+ ".set pop"
+ :
+ : "n" (align), "n" (mod));
+}
+
+static inline void mult_sh_align_mod(long *v1, long *v2, long *w,
+ const int align, const int mod)
{
unsigned long flags;
int m1, m2;
- long p, s, v;
+ long p, s, lv1, lv2, lw;
- printk("Checking for the multiply/shift bug... ");
+ /*
+ * We want the multiply and the shift to be isolated from the
+ * rest of the code to disable gcc optimizations. Hence the
+ * asm statements that execute nothing, but make gcc not know
+ * what the values of m1, m2 and s are and what lv2 and p are
+ * used for.
+ */
local_irq_save(flags);
/*
- * The following code leads to a wrong result of dsll32 when
- * executed on R4000 rev. 2.2 or 3.0.
+ * The following code leads to a wrong result of the first
+ * dsll32 when executed on R4000 rev. 2.2 or 3.0 (PRId
+ * 00000422 or 00000430, respectively).
*
* See "MIPS R4000PC/SC Errata, Processor Revision 2.2 and
* 3.0" by MIPS Technologies, Inc., errata #16 and #28 for
@@ -132,52 +154,97 @@
* sigh... --macro
*/
asm volatile(
+ ""
+ : "=r" (m1), "=r" (m2), "=r" (s)
+ : "0" (5), "1" (8), "2" (5));
+ align_mod(align, mod);
+ /*
+ * The trailing nop is needed to fullfill the two-instruction
+ * requirement between reading hi/lo and staring a mult/div.
+ * Leaving it out may cause gas insert a nop itself breaking
+ * the desired alignment of the next chunk.
+ */
+ asm volatile(
".set push\n\t"
".set noat\n\t"
".set noreorder\n\t"
".set nomacro\n\t"
- "mult %1, %2\n\t"
- "dsll32 %0, %3, %4\n\t"
+ "mult %2, %3\n\t"
+ "dsll32 %0, %4, %5\n\t"
"mflo $0\n\t"
+ "dsll32 %1, %4, %5\n\t"
+ "nop\n\t"
".set pop"
- : "=r" (v)
- : "r" (5), "r" (8), "r" (5), "I" (0)
+ : "=&r" (lv1), "=r" (lw)
+ : "r" (m1), "r" (m2), "r" (s), "I" (0)
: "hi", "lo", "accum");
- local_irq_restore(flags);
-
- if (v == 5L << 32) {
- printk("no.\n");
- return;
- }
-
- printk("yes, workaround... ");
- local_irq_save(flags);
- /*
- * We want the multiply and the shift to be isolated from the
- * rest of the code to disable gcc optimizations. Hence the
- * asm statements that execute nothing, but make gcc not know
- * what the values of m1, m2 and s are and what v and p are
- * used for.
- *
- * We have to use single integers for m1 and m2 and a double
+ /* We have to use single integers for m1 and m2 and a double
* one for p to be sure the mulsidi3 gcc's RTL multiplication
* instruction has the workaround applied. Older versions of
- * gcc have correct mulsi3, but other multiplication variants
- * lack the workaround.
+ * gcc have correct umulsi3 and mulsi3, but other
+ * multiplication variants lack the workaround.
*/
asm volatile(
""
: "=r" (m1), "=r" (m2), "=r" (s)
- : "0" (5), "1" (8), "2" (5));
+ : "0" (m1), "1" (m2), "2" (s));
+ align_mod(align, mod);
p = m1 * m2;
- v = s << 32;
+ lv2 = s << 32;
asm volatile(
""
- : "=r" (v)
- : "0" (v), "r" (p));
+ : "=r" (lv2)
+ : "0" (lv2), "r" (p));
local_irq_restore(flags);
- if (v == 5L << 32) {
+ *v1 = lv1;
+ *v2 = lv2;
+ *w = lw;
+}
+
+static inline void check_mult_sh(void)
+{
+ long v1[8], v2[8], w[8];
+ int bug, fix, i;
+
+ printk("Checking for the multiply/shift bug... ");
+
+ /*
+ * Testing discovered false negatives for certain code offsets
+ * into cache lines. Hence we test all possible offsets for
+ * the worst assumption of an R4000 I-cache line width of 32
+ * bytes.
+ *
+ * We can't use a loop as alignment directives need to be
+ * immediates.
+ */
+ mult_sh_align_mod(&v1[0], &v2[0], &w[0], 32, 0);
+ mult_sh_align_mod(&v1[1], &v2[1], &w[1], 32, 1);
+ mult_sh_align_mod(&v1[2], &v2[2], &w[2], 32, 2);
+ mult_sh_align_mod(&v1[3], &v2[3], &w[3], 32, 3);
+ mult_sh_align_mod(&v1[4], &v2[4], &w[4], 32, 4);
+ mult_sh_align_mod(&v1[5], &v2[5], &w[5], 32, 5);
+ mult_sh_align_mod(&v1[6], &v2[6], &w[6], 32, 6);
+ mult_sh_align_mod(&v1[7], &v2[7], &w[7], 32, 7);
+
+ bug = 0;
+ for (i = 0; i < 8; i++)
+ if (v1[i] != w[i])
+ bug = 1;
+
+ if (bug == 0) {
+ printk("no.\n");
+ return;
+ }
+
+ printk("yes, workaround... ");
+
+ fix = 1;
+ for (i = 0; i < 8; i++)
+ if (v2[i] != w[i])
+ fix = 0;
+
+ if (fix == 1) {
printk("yes.\n");
return;
}
@@ -213,7 +280,8 @@
handler = set_except_vector(12, handle_daddi_ov);
/*
* The following code fails to trigger an overflow exception
- * when executed on R4000 rev. 2.2 or 3.0.
+ * when executed on R4000 rev. 2.2 or 3.0 (PRId 00000422 or
+ * 00000430, respectively).
*
* See "MIPS R4000PC/SC Errata, Processor Revision 2.2 and
* 3.0" by MIPS Technologies, Inc., erratum #23 for details.
@@ -273,15 +341,16 @@
/*
* The following code leads to a wrong result of daddiu when
- * executed on R4400 rev. 1.0.
+ * executed on R4400 rev. 1.0 (PRId 00000440).
*
* See "MIPS R4400PC/SC Errata, Processor Revision 1.0" by
* MIPS Technologies, Inc., erratum #7 for details.
*
* According to "MIPS R4000PC/SC Errata, Processor Revision
* 2.2 and 3.0" by MIPS Technologies, Inc., erratum #41 this
- * problem affects R4000 rev. 2.2 and 3.0, too. Testing
- * failed to trigger it so far.
+ * problem affects R4000 rev. 2.2 and 3.0 (PRId 00000422 and
+ * 00000430, respectively), too. Testing failed to trigger it
+ * so far.
*
* I got no permission to duplicate the errata here, sigh...
* --macro
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/kernel/linux32.c linux-2.4.22/arch/mips64/kernel/linux32.c
--- linux-2.4.22.clean/arch/mips64/kernel/linux32.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/kernel/linux32.c 2003-09-27 14:07:05.000000000 +0200
@@ -29,6 +29,7 @@
#include <linux/personality.h>
#include <linux/timex.h>
#include <linux/dnotify.h>
+#include <linux/linkage.h>
#include <linux/module.h>
#include <net/sock.h>
#include <net/scm.h>
@@ -37,6 +38,37 @@
#include <asm/mman.h>
#include <asm/ipc.h>
+extern asmlinkage long sys_socket(int family, int type, int protocol);
+extern asmlinkage long sys_bind(int fd, struct sockaddr *umyaddr, int addrlen);
+extern asmlinkage long sys_connect(int fd, struct sockaddr *uservaddr,
+ int addrlen);
+extern asmlinkage long sys_listen(int fd, int backlog);
+extern asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr,
+ int *upeer_addrlen);
+extern asmlinkage long sys_getsockname(int fd, struct sockaddr *usockaddr,
+ int *usockaddr_len);
+extern asmlinkage long sys_getpeername(int fd, struct sockaddr *usockaddr,
+ int *usockaddr_len);
+extern asmlinkage long sys_socketpair(int family, int type, int protocol,
+ int *usockvec);
+extern asmlinkage long sys_send(int fd, void * buff, size_t len,
+ unsigned flags);
+extern asmlinkage long sys_sendto(int fd, void * buff, size_t len,
+ unsigned flags, struct sockaddr *addr, int addr_len);
+extern asmlinkage long sys_recv(int fd, void * ubuf, size_t size,
+ unsigned flags);
+extern asmlinkage long sys_recvfrom(int fd, void * ubuf, size_t size,
+ unsigned flags, struct sockaddr *addr, int *addr_len);
+extern asmlinkage long sys_shutdown(int fd, int how);
+extern asmlinkage long sys_setsockopt(int fd, int level, int optname,
+ char *optval, int optlen);
+extern asmlinkage long sys_getsockopt(int fd, int level, int optname,
+ char *optval, int *optlen);
+extern asmlinkage long sys_sendmsg(int fd, struct msghdr *msg, unsigned flags);
+extern asmlinkage long sys_recvmsg(int fd, struct msghdr *msg,
+ unsigned int flags);
+
+
/* Use this to get at 32-bit user passed pointers. */
/* A() macro should be used for places where you e.g.
have some internal variable u32 and just want to get
@@ -1463,9 +1495,6 @@
return ret;
}
-extern asmlinkage int sys_setsockopt(int fd, int level, int optname,
- char *optval, int optlen);
-
static int do_set_attach_filter(int fd, int level, int optname,
char *optval, int optlen)
{
@@ -2130,13 +2159,36 @@
break;
default:
- err = -ENOSYS;
+ err = -EINVAL;
break;
}
return err;
}
+static inline void *alloc_user_space(long len)
+{
+ unsigned long sp = (unsigned long) current + THREAD_SIZE - 32;
+
+ return (void *) (sp - len);
+}
+
+static int sys32_semtimedop(int semid, struct sembuf *tsems, int nsems,
+ const struct timespec32 *timeout32)
+{
+ struct timespec32 t32;
+ struct timespec *t64 = alloc_user_space(sizeof(*t64));
+
+ if (copy_from_user(&t32, timeout32, sizeof(t32)))
+ return -EFAULT;
+
+ if (put_user(t32.tv_sec, &t64->tv_sec) ||
+ put_user(t32.tv_nsec, &t64->tv_nsec))
+ return -EFAULT;
+
+ return sys_semtimedop(semid, tsems, nsems, t64);
+}
+
asmlinkage long
sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
{
@@ -2149,8 +2201,12 @@
case SEMOP:
/* struct sembuf is the same on 32 and 64bit :)) */
- err = sys_semop (first, (struct sembuf *)AA(ptr),
- second);
+ err = sys_semtimedop (first, (struct sembuf *)AA(ptr),
+ second, NULL);
+ break;
+ case SEMTIMEDOP:
+ err = sys32_semtimedop(first, (struct sembuf *)AA(ptr), second,
+ (const struct timespec32 *) AA(fifth));
break;
case SEMGET:
err = sys_semget (first, second, third);
@@ -2915,6 +2971,98 @@
return sys_readahead(fd, merge_64(a2, a3), count);
}
+/* Argument list sizes for sys_socketcall */
+#define AL(x) ((x) * sizeof(unsigned int))
+static unsigned char socketcall_nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
+ AL(3),AL(3),AL(4),AL(4),AL(4),AL(6),
+ AL(6),AL(2),AL(5),AL(5),AL(3),AL(3)};
+#undef AL
+
+/*
+ * System call vectors.
+ *
+ * Argument checking cleaned up. Saved 20% in size.
+ * This function doesn't need to set the kernel lock because
+ * it is set by the callees.
+ */
+
+asmlinkage long sys32_socketcall(int call, unsigned int *args32)
+{
+ unsigned int a[6];
+ unsigned int a0,a1;
+ int err;
+
+ if(call<1||call>SYS_RECVMSG)
+ return -EINVAL;
+
+ /* copy_from_user should be SMP safe. */
+ if (copy_from_user(a, args32, socketcall_nargs[call]))
+ return -EFAULT;
+
+ a0=a[0];
+ a1=a[1];
+
+ switch (call) {
+ case SYS_SOCKET:
+ err = sys_socket(a0,a1,a[2]);
+ break;
+ case SYS_BIND:
+ err = sys_bind(a0,(struct sockaddr *)A(a1), a[2]);
+ break;
+ case SYS_CONNECT:
+ err = sys_connect(a0, (struct sockaddr *)A(a1), a[2]);
+ break;
+ case SYS_LISTEN:
+ err = sys_listen(a0,a1);
+ break;
+ case SYS_ACCEPT:
+ err = sys_accept(a0,(struct sockaddr *)A(a1), (int *)A(a[2]));
+ break;
+ case SYS_GETSOCKNAME:
+ err = sys_getsockname(a0,(struct sockaddr *)A(a1), (int *)A(a[2]));
+ break;
+ case SYS_GETPEERNAME:
+ err = sys_getpeername(a0, (struct sockaddr *)A(a1), (int *)A(a[2]));
+ break;
+ case SYS_SOCKETPAIR:
+ err = sys_socketpair(a0,a1, a[2], (int *)A(a[3]));
+ break;
+ case SYS_SEND:
+ err = sys_send(a0, (void *)A(a1), a[2], a[3]);
+ break;
+ case SYS_SENDTO:
+ err = sys_sendto(a0,(void *)A(a1), a[2], a[3],
+ (struct sockaddr *)A(a[4]), a[5]);
+ break;
+ case SYS_RECV:
+ err = sys_recv(a0, (void *)A(a1), a[2], a[3]);
+ break;
+ case SYS_RECVFROM:
+ err = sys_recvfrom(a0, (void *)A(a1), a[2], a[3],
+ (struct sockaddr *)A(a[4]), (int *)A(a[5]));
+ break;
+ case SYS_SHUTDOWN:
+ err = sys_shutdown(a0,a1);
+ break;
+ case SYS_SETSOCKOPT:
+ err = sys_setsockopt(a0, a1, a[2], (char *)A(a[3]), a[4]);
+ break;
+ case SYS_GETSOCKOPT:
+ err = sys_getsockopt(a0, a1, a[2], (char *)A(a[3]), (int *)A(a[4]));
+ break;
+ case SYS_SENDMSG:
+ err = sys_sendmsg(a0, (struct msghdr *) A(a1), a[2]);
+ break;
+ case SYS_RECVMSG:
+ err = sys_recvmsg(a0, (struct msghdr *) A(a1), a[2]);
+ break;
+ default:
+ err = -EINVAL;
+ break;
+ }
+ return err;
+}
+
#ifdef CONFIG_MODULES
/* From sparc64 */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/kernel/scall_64.S linux-2.4.22/arch/mips64/kernel/scall_64.S
--- linux-2.4.22.clean/arch/mips64/kernel/scall_64.S 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/kernel/scall_64.S 2003-09-27 14:07:05.000000000 +0200
@@ -345,3 +345,6 @@
PTR sys_ni_syscall
PTR sys_ni_syscall /* 5210 */
PTR sys_rt_sigreturn
+ PTR sys_ni_syscall
+ PTR sys_ni_syscall
+ PTR sys_semtimedop
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/kernel/scall_n32.S linux-2.4.22/arch/mips64/kernel/scall_n32.S
--- linux-2.4.22.clean/arch/mips64/kernel/scall_n32.S 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/kernel/scall_n32.S 2003-09-27 14:07:05.000000000 +0200
@@ -348,7 +348,7 @@
PTR sys_fcntl
PTR sys_ni_syscall
PTR sys_ni_syscall
- PTR sys_ni_syscall /* 6215 */
+ PTR sys_semtimedop /* 6215 */
PTR sys_ni_syscall
PTR sys_ni_syscall
PTR sys_ni_syscall
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/kernel/scall_o32.S linux-2.4.22/arch/mips64/kernel/scall_o32.S
--- linux-2.4.22.clean/arch/mips64/kernel/scall_o32.S 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/kernel/scall_o32.S 2003-09-27 14:07:05.000000000 +0200
@@ -426,7 +426,7 @@
sys sys32_statfs 2
sys sys32_fstatfs 2 /* 4100 */
sys sys_ni_syscall 0 /* sys_ioperm */
- sys sys_socketcall 2
+ sys sys32_socketcall 2
sys sys_syslog 3
sys sys32_setitimer 3
sys sys32_getitimer 2 /* 4105 */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/kernel/signal32.c linux-2.4.22/arch/mips64/kernel/signal32.c
--- linux-2.4.22.clean/arch/mips64/kernel/signal32.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/kernel/signal32.c 2003-09-27 14:07:06.000000000 +0200
@@ -234,7 +234,7 @@
if (!access_ok(VERIFY_READ, uss, sizeof(*uss)))
return -EFAULT;
err |= __get_user(sp, &uss->ss_sp);
- kss.ss_size = (long) sp;
+ kss.ss_sp = (void *) (long) sp;
err |= __get_user(kss.ss_size, &uss->ss_size);
err |= __get_user(kss.ss_flags, &uss->ss_flags);
if (err)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/kernel/time.c linux-2.4.22/arch/mips64/kernel/time.c
--- linux-2.4.22.clean/arch/mips64/kernel/time.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/kernel/time.c 2003-09-27 14:07:06.000000000 +0200
@@ -102,9 +102,9 @@
/*
- * Timer ack for a R4k-compatible timer of a known frequency.
+ * Timer ack for an R4k-compatible timer of a known frequency.
*/
-static void c0_fixed_timer_ack(void)
+static void c0_timer_ack(void)
{
unsigned int count;
@@ -129,22 +129,23 @@
return read_c0_count();
}
-/* For unknown frequency. */
+/* For use solely as a high precision timer. */
static void c0_hpt_init(unsigned int count)
{
write_c0_count(read_c0_count() - count);
}
-/* For a known frequency. Used as an interrupt source. */
-static void c0_fixed_hpt_init(unsigned int count)
+/* For use both as a high precision timer and an interrupt source. */
+static void c0_hpt_timer_init(unsigned int count)
{
- expirelo = cycles_per_jiffy;
count = read_c0_count() - count;
- write_c0_count(0);
- write_c0_compare(cycles_per_jiffy);
+ expirelo = (count / cycles_per_jiffy + 1) * cycles_per_jiffy;
+ write_c0_count(expirelo - cycles_per_jiffy);
+ write_c0_compare(expirelo);
write_c0_count(count);
}
+int (*mips_timer_state)(void);
void (*mips_timer_ack)(void);
unsigned int (*mips_hpt_read)(void);
void (*mips_hpt_init)(unsigned int);
@@ -185,7 +186,7 @@
* This is revolting. We need to set "xtime" correctly. However,
* the value in this location is the value at the most recent update
* of wall time. Discover what correction gettimeofday() would have
- * done, and then undo it!
+ * made, and then undo it!
*/
tv->tv_usec -= do_gettimeoffset();
tv->tv_usec -= (jiffies - wall_jiffies) * USECS_PER_JIFFY;
@@ -328,9 +329,9 @@
"dsll32 %1,%2,0\n\t"
"or %1,%1,%0\n\t"
"ddivu $0,%1,%4\n\t"
+ "mflo %1\n\t"
"dsll32 %0,%5,0\n\t"
"or %0,%0,%6\n\t"
- "mflo %1\n\t"
"ddivu $0,%0,%1\n\t"
"mflo %0\n\t"
".set pop"
@@ -410,6 +411,7 @@
*/
void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
+ unsigned long j;
unsigned int count;
count = mips_hpt_read();
@@ -447,10 +449,41 @@
* If jiffies has overflown in this timer_interrupt, we must
* update the timer[hi]/[lo] to make fast gettimeoffset funcs
* quotient calc still valid. -arca
- */
- if (!jiffies) {
- timerhi = timerlo = 0;
- mips_hpt_init(count);
+ *
+ * The first timer interrupt comes late as interrupts are
+ * enabled long after timers are initialized. Therefore the
+ * high precision timer is fast, leading to wrong gettimeoffset()
+ * calculations. We deal with it by setting it based on the
+ * number of its ticks between the second and the third interrupt.
+ * That is still somewhat imprecise, but it's a good estimate.
+ * --macro
+ */
+ j = jiffies;
+ if (j < 4) {
+ static unsigned int prev_count;
+ static int hpt_initialized;
+
+ switch (j) {
+ case 0:
+ timerhi = timerlo = 0;
+ mips_hpt_init(count);
+ break;
+ case 2:
+ prev_count = count;
+ break;
+ case 3:
+ if (!hpt_initialized) {
+ unsigned int c3 = 3 * (count - prev_count);
+
+ timerhi = 0;
+ timerlo = c3;
+ mips_hpt_init(count - c3);
+ hpt_initialized = 1;
+ }
+ break;
+ default:
+ break;
+ }
}
#if !defined(CONFIG_SMP)
@@ -516,7 +549,7 @@
*
* 1) board_time_init() -
* a) (optional) set up RTC routines,
- * b) (optional) calibrate and set the mips_counter_frequency
+ * b) (optional) calibrate and set the mips_hpt_frequency
* (only needed if you intended to use fixed_rate_gettimeoffset
* or use cpu counter as timer interrupt source)
* 2) setup xtime based on rtc_get_time().
@@ -531,7 +564,7 @@
void (*board_time_init)(void);
void (*board_timer_setup)(struct irqaction *irq);
-unsigned int mips_counter_frequency;
+unsigned int mips_hpt_frequency;
static struct irqaction timer_irqaction = {
.handler = timer_interrupt,
@@ -539,6 +572,49 @@
.name = "timer",
};
+static unsigned int __init calibrate_hpt(void)
+{
+ u64 frequency;
+ u32 hpt_start, hpt_end, hpt_count, hz;
+
+ const int loops = HZ / 10;
+ int log_2_loops = 0;
+ int i;
+
+ /*
+ * We want to calibrate for 0.1s, but to avoid a 64-bit
+ * division we round the number of loops up to the nearest
+ * power of 2.
+ */
+ while (loops > 1 << log_2_loops)
+ log_2_loops++;
+ i = 1 << log_2_loops;
+
+ /*
+ * Wait for a rising edge of the timer interrupt.
+ */
+ while (mips_timer_state());
+ while (!mips_timer_state());
+
+ /*
+ * Now see how many high precision timer ticks happen
+ * during the calculated number of periods between timer
+ * interrupts.
+ */
+ hpt_start = mips_hpt_read();
+ do {
+ while (mips_timer_state());
+ while (!mips_timer_state());
+ } while (--i);
+ hpt_end = mips_hpt_read();
+
+ hpt_count = hpt_end - hpt_start;
+ hz = HZ;
+ frequency = (u64)hpt_count * (u64)hz;
+
+ return frequency >> log_2_loops;
+}
+
void __init time_init(void)
{
if (board_time_init)
@@ -555,7 +631,7 @@
/* No high precision timer -- sorry. */
mips_hpt_read = null_hpt_read;
mips_hpt_init = null_hpt_init;
- } else if (!mips_counter_frequency) {
+ } else if (!mips_hpt_frequency && !mips_timer_state) {
/* A high precision timer of unknown frequency. */
if (!mips_hpt_read) {
/* No external high precision timer -- use R4k. */
@@ -578,27 +654,36 @@
*/
do_gettimeoffset = calibrate_div64_gettimeoffset;
} else {
- /* We know counter frequency! */
+ /* We know counter frequency. Or we can get it. */
if (!mips_hpt_read) {
/* No external high precision timer -- use R4k. */
mips_hpt_read = c0_hpt_read;
- mips_hpt_init = c0_fixed_hpt_init;
- if (!mips_timer_ack)
- /* R4k timer interrupt ack. */
- mips_timer_ack = c0_fixed_timer_ack;
+ if (mips_timer_state)
+ mips_hpt_init = c0_hpt_init;
+ else {
+ /* No external timer interrupt -- use R4k. */
+ mips_hpt_init = c0_hpt_timer_init;
+ mips_timer_ack = c0_timer_ack;
+ }
}
+ if (!mips_hpt_frequency)
+ mips_hpt_frequency = calibrate_hpt();
do_gettimeoffset = fixed_rate_gettimeoffset;
/* Calculate cache parameters. */
- cycles_per_jiffy = mips_counter_frequency / HZ;
+ cycles_per_jiffy = (mips_hpt_frequency + HZ / 2) / HZ;
/* sll32_usecs_per_cycle = 10^6 * 2^32 / mips_counter_freq */
- /* Any better way to do this? */
- sll32_usecs_per_cycle = mips_counter_frequency / 100000;
- sll32_usecs_per_cycle = 0xffffffff / sll32_usecs_per_cycle;
- sll32_usecs_per_cycle *= 10;
+ do_div64_32(sll32_usecs_per_cycle,
+ 1000000, mips_hpt_frequency / 2,
+ mips_hpt_frequency);
+
+ /* Report the high precision timer rate for a reference. */
+ printk("Using %u.%03u MHz high precision timer.\n",
+ ((mips_hpt_frequency + 500) / 1000) / 1000,
+ ((mips_hpt_frequency + 500) / 1000) % 1000);
}
if (!mips_timer_ack)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/kernel/traps.c linux-2.4.22/arch/mips64/kernel/traps.c
--- linux-2.4.22.clean/arch/mips64/kernel/traps.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/kernel/traps.c 2003-09-27 14:07:06.000000000 +0200
@@ -533,6 +533,8 @@
simulate_sc(regs, opcode);
return 0;
}
+
+ return -EFAULT; /* Strange things going on ... */
}
asmlinkage void do_ov(struct pt_regs *regs)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/Makefile linux-2.4.22/arch/mips64/Makefile
--- linux-2.4.22.clean/arch/mips64/Makefile 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/Makefile 2003-09-27 16:56:50.000000000 +0200
@@ -35,11 +35,11 @@
# crossformat linking we rely on the elf2ecoff tool for format conversion.
#
GCCFLAGS := -I $(TOPDIR)/include/asm/gcc
-GCCFLAGS += -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
+GCCFLAGS += -mabi=64 -Wa,-mabi=o64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
LINKFLAGS += -G 0 -static # -N
MODFLAGS += -mlong-calls
-ifdef CONFIG_KGDB
+ifdef CONFIG_DEBUG_INFO
GCCFLAGS += -g
ifdef CONFIG_SB1XXX_CORELIS
GCCFLAGS += -mno-sched-prolog -fno-omit-frame-pointer
@@ -55,10 +55,10 @@
GCCFLAGS += -mcpu=r4300 -mips3
endif
ifdef CONFIG_CPU_R4X00
-GCCFLAGS += -mcpu=r4600 -mips3
+GCCFLAGS += -march=r4600
endif
ifdef CONFIG_CPU_R5000
-GCCFLAGS += -mcpu=r8000 -mips4
+GCCFLAGS += -march=r5000
endif
ifdef CONFIG_CPU_NEVADA
GCCFLAGS += -mcpu=r8000 -mips3 -mmad
@@ -274,7 +274,6 @@
# convert to ECOFF using elf2ecoff.
#
ifdef CONFIG_BOOT_ELF32
-GCCFLAGS += -Wa,-32 $(shell if $(CC) -Wa,-mgp64 -c -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "-Wa,-mgp64"; fi)
LINKFLAGS += -T arch/mips64/ld.script.elf32
endif
#
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/Makefile.lib linux-2.4.22/arch/mips64/Makefile.lib
--- linux-2.4.22.clean/arch/mips64/Makefile.lib 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/arch/mips64/Makefile.lib 2003-08-18 04:59:02.000000000 +0200
@@ -0,0 +1 @@
+obj-$(CONFIG_LASAT) += crc32.o
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/mm/cerr-sb1.c linux-2.4.22/arch/mips64/mm/cerr-sb1.c
--- linux-2.4.22.clean/arch/mips64/mm/cerr-sb1.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/mm/cerr-sb1.c 2003-09-27 14:07:06.000000000 +0200
@@ -193,7 +193,9 @@
prom_printf(" c0_cerr_i == %08x", cerr_i);
breakout_cerri(cerr_i);
if (CP0_CERRI_IDX_VALID(cerr_i)) {
- if ((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK))
+ /* Check index of EPC, allowing for delay slot */
+ if (((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK)) &&
+ ((eepc & SB1_CACHE_INDEX_MASK) != ((cerr_i & SB1_CACHE_INDEX_MASK) - 4)))
prom_printf(" cerr_i idx doesn't match eepc\n");
else {
res = extract_ic(cerr_i & SB1_CACHE_INDEX_MASK,
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/mm/c-sb1.c linux-2.4.22/arch/mips64/mm/c-sb1.c
--- linux-2.4.22.clean/arch/mips64/mm/c-sb1.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/mm/c-sb1.c 2003-09-27 14:07:06.000000000 +0200
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
* Copyright (C) 1997, 2001 Ralf Baechle (ralf@gnu.org)
- * Copyright (C) 2000, 2001 Broadcom Corporation
+ * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -579,7 +579,6 @@
* occur
*/
_flush_cache_range = (void *) sb1_nop;
- _flush_cache_page = sb1_flush_cache_page;
_flush_cache_mm = (void (*)(struct mm_struct *))sb1_nop;
_flush_cache_all = sb1_nop;
@@ -590,6 +589,9 @@
_flush_cache_sigtramp = sb1_flush_cache_sigtramp;
_flush_data_cache_page = (void *) sb1_nop;
+ /* This implies an Icache flush too, so can't be nop'ed */
+ _flush_cache_page = sb1_flush_cache_page;
+
/* Full flushes */
___flush_cache_all = sb1___flush_cache_all;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/arch/mips64/mm/tlb-sb1.c linux-2.4.22/arch/mips64/mm/tlb-sb1.c
--- linux-2.4.22.clean/arch/mips64/mm/tlb-sb1.c 2003-08-25 13:44:40.000000000 +0200
+++ linux-2.4.22/arch/mips64/mm/tlb-sb1.c 2003-09-27 14:07:06.000000000 +0200
@@ -18,6 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <linux/config.h>
+#include <linux/init.h>
#include <asm/mmu_context.h>
#include <asm/bootinfo.h>
#include <asm/cpu.h>
@@ -98,10 +99,13 @@
old_ctx = read_c0_entryhi() & ASID_MASK;
write_c0_entrylo0(0);
write_c0_entrylo1(0);
- for (entry = 0; entry < current_cpu_data.tlbsize; entry++) {
+
+ entry = read_c0_wired();
+ while (entry < current_cpu_data.tlbsize) {
write_c0_entryhi(KSEG0 + (PAGE_SIZE << 1) * entry);
write_c0_index(entry);
tlb_write_indexed();
+ entry++;
}
write_c0_entryhi(old_ctx);
local_irq_restore(flags);
@@ -113,7 +117,7 @@
* Use increments of the maximum page size (16MB), and check for duplicate
* entries before doing a given write. Then, when we're safe from collisions
* with the firmware, go back and give all the entries invalid addresses with
- * the normal flush routine.
+ * the normal flush routine. Wired entries will be killed as well!
*/
void sb1_sanitize_tlb(void)
{
@@ -254,6 +258,34 @@
local_irq_restore(flags);
}
+void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
+ unsigned long entryhi, unsigned long pagemask)
+{
+ unsigned long flags;
+ unsigned long wired;
+ unsigned long old_pagemask;
+ unsigned long old_ctx;
+
+ local_irq_save(flags);
+ old_ctx = read_c0_entryhi() & 0xff;
+ old_pagemask = read_c0_pagemask();
+ wired = read_c0_wired();
+ write_c0_wired(wired + 1);
+ write_c0_index(wired);
+
+ write_c0_pagemask(pagemask);
+ write_c0_entryhi(entryhi);
+ write_c0_entrylo0(entrylo0);
+ write_c0_entrylo1(entrylo1);
+ tlb_write_indexed();
+
+ write_c0_entryhi(old_ctx);
+ write_c0_pagemask(old_pagemask);
+
+ local_flush_tlb_all();
+ local_irq_restore(flags);
+}
+
/*
* This is called from loadmmu.c. We have to set up all the
* memory management function pointers, as well as initialize
@@ -262,6 +294,7 @@
void sb1_tlb_init(void)
{
write_c0_pagemask(PM_4K);
+ write_c0_wired(0);
/*
* We don't know what state the firmware left the TLB's in, so this is
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/CREDITS linux-2.4.22/CREDITS
--- linux-2.4.22.clean/CREDITS 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/CREDITS 2003-09-27 14:06:41.000000000 +0200
@@ -1872,6 +1872,12 @@
S: Niwot, Colorado 80503
S: USA
+N: Pete Popov
+E: pete_popov@yahoo.com
+D: Linux/MIPS AMD/Alchemy Port and mips hacking and debugging
+S: San Jose, CA 95134
+S: USA
+
N: Robert M. Love
E: rml@tech9.net
E: rml@ufl.edu
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/Documentation/Configure.help linux-2.4.22/Documentation/Configure.help
--- linux-2.4.22.clean/Documentation/Configure.help 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/Documentation/Configure.help 2003-09-27 14:06:46.000000000 +0200
@@ -4628,6 +4628,11 @@
DECstation series (Personal DECstation 5000/20, /25, /33, /50,
Codename "Maxine").
+PMAG-AA TURBOchannel framebuffer support
+CONFIG_FB_PMAG_AA
+ Support for the PMAG-AA TURBOchannel framebuffer card (1280x1024x1)
+ used mainly in the MIPS-based DECstation series.
+
PMAG-BA TURBOchannel framebuffer support
CONFIG_FB_PMAG_BA
Support for the PMAG-BA TURBOchannel framebuffer card (1024x864x8)
@@ -11255,6 +11260,24 @@
say M here and read <file:Documentation/modules.txt>. This is
recommended. The module will be called tg3.o.
+MV-64340 Ethernet support
+CONFIG_MV64340_ETH
+ This driver supports the Marvell Discovery II MV64340 device
+ as an Ethernet controller. Say Y here and select Port 0,1,2
+ as needed. Otherwise, say N.
+
+MV-64340 Port 0
+CONFIG_MV64340_ETH_0
+ Enable port 0 on the MV64340 Ethernet controller.
+
+MV-64340 Port 1
+CONFIG_MV64340_ETH_1
+ Enable port 1 on the MV64340 Ethernet controller.
+
+MV-64340 Port 2
+CONFIG_MV64340_ETH_2
+ Enable port 2 on the MV64340 Ethernet controller.
+
MyriCOM Gigabit Ethernet support
CONFIG_MYRI_SBUS
This driver supports MyriCOM Sbus gigabit Ethernet cards.
@@ -13807,7 +13830,7 @@
DEC MS02-NV NVRAM module support
CONFIG_MTD_MS02NV
- This is a MTD driver for the DEC's MS02-NV (54-20948-01) battery
+ This is an MTD driver for the DEC's MS02-NV (54-20948-01) battery
backed-up NVRAM module. The module was originally meant as an NFS
accelerator. Say Y here if you have a DECstation 5000/2x0 or a
DECsystem 5900 equipped with such a module.
@@ -18238,6 +18261,11 @@
sensor. Currently the device is only supported on a SiByte I2C
adapter, and the driver prints status updates to the system log.
+SGI I2C Algorithm
+CONFIG_I2C_ALGO_SGI
+ Supports the SGI interfaces like the ones found on SGI Indy VINO
+ or SGI O2 MACE.
+
I2C device interface
CONFIG_I2C_CHARDEV
Say Y here to use i2c-* device files, usually found in the /dev
@@ -26519,7 +26547,7 @@
Include kgdb kernel debugger
CONFIG_KGDB
Include in-kernel hooks for kgdb, the Linux kernel source level
- debugger. This project has a web page at
+ debugger. For i386 architecture there is project page at
<http://kgdb.sourceforge.net/>.
Include xmon kernel debugger
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/char/Config.in linux-2.4.22/drivers/char/Config.in
--- linux-2.4.22.clean/drivers/char/Config.in 2003-08-25 13:44:41.000000000 +0200
+++ linux-2.4.22/drivers/char/Config.in 2003-09-27 14:07:51.000000000 +0200
@@ -82,29 +82,49 @@
fi
fi
if [ "$CONFIG_MIPS" = "y" ]; then
- bool ' TX3912/PR31700 serial port support' CONFIG_SERIAL_TX3912
- dep_bool ' Console on TX3912/PR31700 serial port' CONFIG_SERIAL_TX3912_CONSOLE $CONFIG_SERIAL_TX3912
- bool ' Enable Au1000 UART Support' CONFIG_AU1000_UART
- if [ "$CONFIG_AU1000_UART" = "y" ]; then
- bool ' Enable Au1000 serial console' CONFIG_AU1000_SERIAL_CONSOLE
- fi
- bool 'TXx927 SIO support' CONFIG_TXX927_SERIAL
- if [ "$CONFIG_TXX927_SERIAL" = "y" ]; then
- bool 'TXx927 SIO Console support' CONFIG_TXX927_SERIAL_CONSOLE
- fi
- if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
- bool ' Support for sb1250 onchip DUART' CONFIG_SIBYTE_SB1250_DUART
- if [ "$CONFIG_SIBYTE_SB1250_DUART" = "y" ]; then
- bool ' Console on SB1250 DUART' CONFIG_SIBYTE_SB1250_DUART_CONSOLE
- if [ "$CONFIG_SIBYTE_SB1250_DUART_CONSOLE" = "y" ]; then
- define_bool CONFIG_SERIAL_CONSOLE y
- fi
- int ' Output buffers size (in bytes)' CONFIG_SB1250_DUART_OUTPUT_BUF_SIZE 1024
- bool ' Leave port 1 alone (for kgdb or audio)' CONFIG_SIBYTE_SB1250_DUART_NO_PORT_1
- fi
- fi
- fi
+ bool ' TX3912/PR31700 serial port support' CONFIG_SERIAL_TX3912
+ dep_bool ' Console on TX3912/PR31700 serial port' CONFIG_SERIAL_TX3912_CONSOLE $CONFIG_SERIAL_TX3912
+ bool ' TMPTX39XX/49XX serial port support' CONFIG_SERIAL_TXX9
+ dep_bool ' Console on TMPTX39XX/49XX serial port' CONFIG_SERIAL_TXX9_CONSOLE $CONFIG_SERIAL_TXX9
+ if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
+ bool ' Enable Au1x00 UART Support' CONFIG_AU1X00_UART
+ if [ "$CONFIG_AU1X00_UART" = "y" ]; then
+ bool ' Enable Au1x00 serial console' CONFIG_AU1X00_SERIAL_CONSOLE
+ fi
+ dep_tristate ' Au1x00 USB TTY Device support' CONFIG_AU1X00_USB_TTY $CONFIG_SOC_AU1X00
+ if [ "$CONFIG_AU1000_USB_TTY" != "y" ]; then
+ dep_tristate ' Au1x00 USB Raw Device support' CONFIG_AU1X00_USB_RAW $CONFIG_SOC_AU1X00
+ fi
+ if [ "$CONFIG_AU1X00_USB_TTY" != "n" -o \
+ "$CONFIG_AU1X00_USB_RAW" != "n" ]; then
+ define_bool CONFIG_AU1X00_USB_DEVICE y
+ fi
+ fi
+ bool ' TXx927 SIO support' CONFIG_TXX927_SERIAL
+ if [ "$CONFIG_TXX927_SERIAL" = "y" ]; then
+ bool ' TXx927 SIO Console support' CONFIG_TXX927_SERIAL_CONSOLE
+ fi
+ if [ "$CONFIG_SIBYTE_SB1xxx_SOC" = "y" ]; then
+ bool ' Support for BCM1xxx onchip DUART' CONFIG_SIBYTE_SB1250_DUART
+ if [ "$CONFIG_SIBYTE_SB1250_DUART" = "y" ]; then
+ bool ' Console on BCM1xxx DUART' CONFIG_SIBYTE_SB1250_DUART_CONSOLE
+ if [ "$CONFIG_SIBYTE_SB1250_DUART_CONSOLE" = "y" ]; then
+ define_bool CONFIG_SERIAL_CONSOLE y
+ fi
+ fi
+ fi
+ fi
+ if [ "$CONFIG_DECSTATION" = "y" ]; then
+ bool ' DECstation serial support' CONFIG_SERIAL_DEC
+ dep_bool ' Support for console on a DECstation serial port' CONFIG_SERIAL_DEC_CONSOLE $CONFIG_SERIAL_DEC
+ dep_bool ' DZ11 serial support' CONFIG_DZ $CONFIG_SERIAL_DEC $CONFIG_MIPS32
+ dep_bool ' Z85C30 serial support' CONFIG_ZS $CONFIG_SERIAL_DEC $CONFIG_TC
+ fi
+ if [ "$CONFIG_SGI_IP22" = "y" ]; then
+ bool ' SGI Zilog85C30 serial support' CONFIG_IP22_SERIAL
+ fi
fi
+
if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_ZORRO" = "y" ]; then
tristate 'Commodore A2232 serial support (EXPERIMENTAL)' CONFIG_A2232
fi
@@ -116,14 +136,6 @@
fi
bool ' Console on DC21285 serial port' CONFIG_SERIAL_21285_CONSOLE
fi
- if [ "$CONFIG_MIPS" = "y" ]; then
- bool ' TMPTX3912/PR31700 serial port support' CONFIG_SERIAL_TX3912
- dep_bool ' Console on TMPTX3912/PR31700 serial port' CONFIG_SERIAL_TX3912_CONSOLE $CONFIG_SERIAL_TX3912
- bool ' Enable Au1000 UART Support' CONFIG_AU1000_UART
- if [ "$CONFIG_AU1000_UART" = "y" ]; then
- bool ' Enable Au1000 serial console' CONFIG_AU1000_SERIAL_CONSOLE
- fi
- fi
if [ "$CONFIG_PARISC" = "y" ]; then
bool ' PDC software console support' CONFIG_PDC_CONSOLE
fi
@@ -177,6 +189,9 @@
if [ "$CONFIG_ADB" = "y" -a "$CONFIG_ADB_KEYBOARD" = "y" ]; then
dep_tristate ' Apple Desktop Bus mouse support (old driver)' CONFIG_ADBMOUSE $CONFIG_BUSMOUSE
fi
+# if [ "$CONFIG_DECSTATION" = "y" ]; then
+# dep_bool ' MAXINE Access.Bus mouse (VSXXX-BB/GB) support' CONFIG_DTOP_MOUSE $CONFIG_ACCESSBUS
+# fi
fi
tristate 'Mouse Support (not serial and bus mice)' CONFIG_MOUSE
@@ -228,9 +243,6 @@
tristate ' Eurotech CPU-1220/1410 Watchdog Timer' CONFIG_EUROTECH_WDT
tristate ' IB700 SBC Watchdog Timer' CONFIG_IB700_WDT
tristate ' ICP ELectronics Wafer 5823 Watchdog' CONFIG_WAFER_WDT
- if [ "$CONFIG_SGI_IP22" = "y" ]; then
- dep_tristate ' Indy/I2 Hardware Watchdog' CONFIG_INDYDOG $CONFIG_SGI_IP22
- fi
tristate ' Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO
tristate ' Mixcom Watchdog' CONFIG_MIXCOMWD
tristate ' SBC-60XX Watchdog Timer' CONFIG_60XX_WDT
@@ -247,6 +259,7 @@
fi
fi
tristate ' ZF MachZ Watchdog' CONFIG_MACHZ_WDT
+ dep_tristate ' Indy/I2 Hardware Watchdog' CONFIG_INDYDOG $CONFIG_SGI_IP22
dep_tristate ' AMD 766/768 TCO Timer/Watchdog' CONFIG_AMD7XX_TCO $CONFIG_EXPERIMENTAL
fi
endmenu
@@ -276,6 +289,15 @@
if [ "$CONFIG_OBSOLETE" = "y" -a "$CONFIG_ALPHA_BOOK1" = "y" ]; then
bool 'Tadpole ANA H8 Support (OBSOLETE)' CONFIG_H8
fi
+if [ "$CONFIG_MIPS" = "y" -a "$CONFIG_NEW_TIME_C" = "y" ]; then
+ tristate 'Generic MIPS RTC Support' CONFIG_MIPS_RTC
+fi
+if [ "$CONFIG_SGI_IP22" = "y" ]; then
+ bool 'SGI DS1286 RTC support' CONFIG_SGI_DS1286
+fi
+if [ "$CONFIG_SGI_IP27" = "y" ]; then
+ bool 'SGI M48T35 RTC support' CONFIG_SGI_IP27_RTC
+fi
tristate 'Double Talk PC internal speech card support' CONFIG_DTLK
tristate 'Siemens R3964 line discipline' CONFIG_R3964
@@ -290,6 +312,7 @@
if [ "$CONFIG_FTAPE" != "n" ]; then
source drivers/char/ftape/Config.in
fi
+
endmenu
if [ "$CONFIG_GART_IOMMU" = "y" ]; then
@@ -333,16 +356,11 @@
if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
source drivers/char/pcmcia/Config.in
fi
-if [ "$CONFIG_MIPS_AU1000" = "y" ]; then
- tristate ' Alchemy Au1000 GPIO device support' CONFIG_AU1000_GPIO
- tristate ' Au1000/ADS7846 touchscreen support' CONFIG_TS_AU1000_ADS7846
+if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
+ tristate ' Alchemy Au1x00 GPIO device support' CONFIG_AU1X00_GPIO
+ tristate ' Au1000/ADS7846 touchscreen support' CONFIG_TS_AU1X00_ADS7846
fi
if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
tristate ' ITE GPIO' CONFIG_ITE_GPIO
fi
-
-if [ "$CONFIG_X86" = "y" ]; then
- tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
-fi
-
endmenu
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/char/defkeymap.c linux-2.4.22/drivers/char/defkeymap.c
--- linux-2.4.22.clean/drivers/char/defkeymap.c 1999-10-07 19:17:09.000000000 +0200
+++ linux-2.4.22/drivers/char/defkeymap.c 2003-09-27 14:07:51.000000000 +0200
@@ -37,7 +37,7 @@
0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf03e, 0xf10a,
0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- 0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603,
+ 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
0xf20b, 0xf601, 0xf602, 0xf117, 0xf600, 0xf20a, 0xf115, 0xf116,
0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
@@ -56,7 +56,7 @@
0xf912, 0xf913, 0xf30b, 0xf90e, 0xf90f, 0xf910, 0xf30a, 0xf90b,
0xf90c, 0xf90d, 0xf90a, 0xf310, 0xf206, 0xf200, 0xf07c, 0xf516,
0xf517, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- 0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603,
+ 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116,
0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
@@ -94,7 +94,7 @@
0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf200, 0xf200,
0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- 0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603,
+ 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116,
0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
@@ -132,7 +132,7 @@
0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
0xf302, 0xf303, 0xf300, 0xf20c, 0xf206, 0xf200, 0xf200, 0xf50a,
0xf50b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- 0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603,
+ 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf20c,
0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/char/dz.c linux-2.4.22/drivers/char/dz.c
--- linux-2.4.22.clean/drivers/char/dz.c 2003-08-25 13:44:41.000000000 +0200
+++ linux-2.4.22/drivers/char/dz.c 2003-09-27 14:07:51.000000000 +0200
@@ -21,7 +21,7 @@
* [07-SEP-99] Bugfixes
*/
-#define DEBUG_DZ 1
+#undef DEBUG_DZ
#include <linux/config.h>
#include <linux/version.h>
@@ -254,13 +254,19 @@
if (tmp & DZ_PERR) {
*tty->flip.flag_buf_ptr = TTY_PARITY;
+#ifdef DEBUG_DZ
debug_console("PERR\n", 5);
+#endif
} else if (tmp & DZ_FERR) {
*tty->flip.flag_buf_ptr = TTY_FRAME;
+#ifdef DEBUG_DZ
debug_console("FERR\n", 5);
+#endif
}
if (tmp & DZ_OERR) {
+#ifdef DEBUG_DZ
debug_console("OERR\n", 5);
+#endif
if (tty->flip.count < TTY_FLIPBUF_SIZE) {
tty->flip.count++;
tty->flip.flag_buf_ptr++;
@@ -1299,7 +1305,7 @@
int __init dz_init(void)
{
- int i, tmp;
+ int i;
long flags;
struct dz_serial *info;
@@ -1413,7 +1419,7 @@
/* reset the chip */
#ifndef CONFIG_SERIAL_DEC_CONSOLE
dz_out(info, DZ_CSR, DZ_CLR);
- while ((tmp = dz_in(info, DZ_CSR)) & DZ_CLR);
+ while (dz_in(info, DZ_CSR) & DZ_CLR);
iob();
/* enable scanning */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/char/Makefile linux-2.4.22/drivers/char/Makefile
--- linux-2.4.22.clean/drivers/char/Makefile 2003-08-25 13:44:41.000000000 +0200
+++ linux-2.4.22/drivers/char/Makefile 2003-09-27 14:07:51.000000000 +0200
@@ -24,7 +24,7 @@
export-objs := busmouse.o console.o keyboard.o sysrq.o \
misc.o pty.o random.o selection.o serial.o \
sonypi.o tty_io.o tty_ioctl.o generic_serial.o \
- au1000_gpio.o hp_psaux.o nvram.o scx200.o
+ au1000_gpio.o vac-serial.o hp_psaux.o nvram.o scx200.o
mod-subdirs := joystick ftape drm drm-4.0 pcmcia
@@ -140,12 +140,11 @@
ifeq ($(CONFIG_DECSTATION),y)
KEYMAP =
KEYBD =
- SERIAL = decserial.o
endif
ifeq ($(CONFIG_BAGET_MIPS),y)
KEYBD =
- SERIAL =
+ SERIAL = vac-serial.o
endif
ifeq ($(CONFIG_NINO),y)
@@ -171,7 +170,8 @@
obj-$(CONFIG_SERIAL_21285) += serial_21285.o
obj-$(CONFIG_SERIAL_SA1100) += serial_sa1100.o
obj-$(CONFIG_SERIAL_AMBA) += serial_amba.o
-obj-$(CONFIG_TS_AU1000_ADS7846) += au1000_ts.o
+obj-$(CONFIG_TS_AU1X00_ADS7846) += au1000_ts.o
+obj-$(CONFIG_SERIAL_DEC) += decserial.o
ifndef CONFIG_SUN_KEYBOARD
obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
@@ -211,6 +211,9 @@
obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o
obj-$(CONFIG_SERIAL_TX3912) += generic_serial.o serial_tx3912.o
obj-$(CONFIG_TXX927_SERIAL) += serial_txx927.o
+obj-$(CONFIG_SERIAL_TXX9) += generic_serial.o serial_txx9.o
+obj-$(CONFIG_IP22_SERIAL) += sgiserial.o
+obj-$(CONFIG_AU1X00_UART) += au1x00-serial.o
subdir-$(CONFIG_RIO) += rio
subdir-$(CONFIG_INPUT) += joystick
@@ -239,6 +242,9 @@
obj-$(CONFIG_RTC) += rtc.o
obj-$(CONFIG_GEN_RTC) += genrtc.o
obj-$(CONFIG_EFI_RTC) += efirtc.o
+obj-$(CONFIG_SGI_DS1286) += ds1286.o
+obj-$(CONFIG_MIPS_RTC) += mips_rtc.o
+obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o
ifeq ($(CONFIG_PPC),)
obj-$(CONFIG_NVRAM) += nvram.o
endif
@@ -251,7 +257,9 @@
obj-$(CONFIG_BRIQ_PANEL) += briq_panel.o
obj-$(CONFIG_ITE_GPIO) += ite_gpio.o
-obj-$(CONFIG_AU1000_GPIO) += au1000_gpio.o
+obj-$(CONFIG_AU1X00_GPIO) += au1000_gpio.o
+obj-$(CONFIG_AU1X00_USB_TTY) += au1000_usbtty.o
+obj-$(CONFIG_AU1X00_USB_RAW) += au1000_usbraw.o
obj-$(CONFIG_COBALT_LCD) += lcd.o
obj-$(CONFIG_QIC02_TAPE) += tpqic02.o
@@ -302,6 +310,7 @@
obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
obj-$(CONFIG_AMD7XX_TCO) += amd7xx_tco.o
+obj-$(CONFIG_INDYDOG) += indydog.o
subdir-$(CONFIG_MWAVE) += mwave
ifeq ($(CONFIG_MWAVE),y)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/char/rtc.c linux-2.4.22/drivers/char/rtc.c
--- linux-2.4.22.clean/drivers/char/rtc.c 2003-06-13 16:51:33.000000000 +0200
+++ linux-2.4.22/drivers/char/rtc.c 2003-07-05 05:23:35.000000000 +0200
@@ -35,17 +35,16 @@
* 1.09a Pete Zaitcev: Sun SPARC
* 1.09b Jeff Garzik: Modularize, init cleanup
* 1.09c Jeff Garzik: SMP cleanup
- * 1.10 Paul Barton-Davis: add support for async I/O
+ * 1.10 Paul Barton-Davis: add support for async I/O
* 1.10a Andrea Arcangeli: Alpha updates
* 1.10b Andrew Morton: SMP lock fix
* 1.10c Cesar Barros: SMP locking fixes and cleanup
* 1.10d Paul Gortmaker: delete paranoia check in rtc_exit
* 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness.
+ * 1.10f Maciej W. Rozycki: Handle memory-mapped chips properly.
*/
-#define RTC_VERSION "1.10e"
-
-#define RTC_IO_EXTENT 0x10 /* Only really two ports, but... */
+#define RTC_VERSION "1.10f"
/*
* Note that *all* calls to CMOS_READ and CMOS_WRITE are done with
@@ -84,7 +83,9 @@
static int rtc_irq = PCI_IRQ_NONE;
#endif
+#if RTC_IRQ
static int rtc_has_irq = 1;
+#endif
/*
* We sponge a minor off of the misc major. No need slurping
@@ -97,7 +98,9 @@
static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
+#if RTC_IRQ
static struct timer_list rtc_irq_timer;
+#endif
static ssize_t rtc_read(struct file *file, char *buf,
size_t count, loff_t *ppos);
@@ -238,7 +241,15 @@
if (rtc_has_irq == 0)
return -EIO;
- if (count < sizeof(unsigned long))
+ /*
+ * Historically this function used to assume that sizeof(unsigned long)
+ * is the same in userspace and kernelspace. This lead to problems
+ * for configurations with multiple ABIs such a the MIPS o32 and 64
+ * ABIs supported on the same kernel. So now we support read of both
+ * 4 and 8 bytes and assume that's the sizeof(unsigned long) in the
+ * userspace ABI.
+ */
+ if (count != sizeof(unsigned int) && count != sizeof(unsigned long))
return -EINVAL;
add_wait_queue(&rtc_wait, &wait);
@@ -268,9 +279,12 @@
schedule();
} while (1);
- retval = put_user(data, (unsigned long *)buf);
+ if (count == sizeof(unsigned int))
+ retval = put_user(data, (unsigned int *)buf);
+ else
+ retval = put_user(data, (unsigned long *)buf);
if (!retval)
- retval = sizeof(unsigned long);
+ retval = count;
out:
current->state = TASK_RUNNING;
remove_wait_queue(&rtc_wait, &wait);
@@ -706,6 +720,9 @@
struct isa_device *isa_dev;
#endif
#endif
+#ifndef __sparc__
+ void *r;
+#endif
#ifdef __sparc__
for_each_ebus(ebus) {
@@ -752,18 +769,24 @@
}
no_irq:
#else
- if (!request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"))
- {
- printk(KERN_ERR "rtc: I/O port %d is not free.\n", RTC_PORT (0));
+ if (RTC_IOMAPPED)
+ r = request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
+ else
+ r = request_mem_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
+ if (!r) {
+ printk(KERN_ERR "rtc: I/O resource %lx is not free.\n",
+ (long)(RTC_PORT(0)));
return -EIO;
}
#if RTC_IRQ
- if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL))
- {
+ if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) {
/* Yeah right, seeing as irq 8 doesn't even hit the bus. */
printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
- release_region(RTC_PORT(0), RTC_IO_EXTENT);
+ if (RTC_IOMAPPED)
+ release_region(RTC_PORT(0), RTC_IO_EXTENT);
+ else
+ release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
return -EIO;
}
#endif
@@ -847,7 +870,10 @@
if (rtc_has_irq)
free_irq (rtc_irq, &rtc_port);
#else
- release_region (RTC_PORT (0), RTC_IO_EXTENT);
+ if (RTC_IOMAPPED)
+ release_region(RTC_PORT(0), RTC_IO_EXTENT);
+ else
+ release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
#if RTC_IRQ
if (rtc_has_irq)
free_irq (RTC_IRQ, NULL);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/char/sb1250_duart.c linux-2.4.22/drivers/char/sb1250_duart.c
--- linux-2.4.22.clean/drivers/char/sb1250_duart.c 2003-08-25 13:44:41.000000000 +0200
+++ linux-2.4.22/drivers/char/sb1250_duart.c 2003-09-27 14:07:51.000000000 +0200
@@ -910,6 +910,8 @@
port->mode_2, i);
WRITE_SERCSR(V_DUART_BAUD_RATE(115200),
port->clk_sel, i);
+ WRITE_SERCSR(M_DUART_RX_EN|M_DUART_TX_EN,
+ port->cmd, i);
}
return 0;
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/char/serial.c linux-2.4.22/drivers/char/serial.c
--- linux-2.4.22.clean/drivers/char/serial.c 2003-08-25 13:44:41.000000000 +0200
+++ linux-2.4.22/drivers/char/serial.c 2003-09-27 14:07:52.000000000 +0200
@@ -62,6 +62,12 @@
* Robert Schwebel <robert@schwebel.de>,
* Juergen Beisert <jbeisert@eurodsn.de>,
* Theodore Ts'o <tytso@mit.edu>
+ *
+ * 10/00: Added suport for MIPS Atlas board.
+ * 11/00: Hooks for serial kernel debug port support added.
+ * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard,
+ * carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
*/
static char *serial_version = "5.05c";
@@ -413,6 +419,22 @@
return 0;
}
+#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_SEAD)
+
+#include <asm/mips-boards/atlas.h>
+
+static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
+{
+ return (*(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) & 0xff);
+}
+
+static _INLINE_ void serial_out(struct async_struct *info, int offset, int value)
+{
+ *(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) = value;
+}
+
+#else
+
static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
{
switch (info->io_type) {
@@ -447,6 +469,8 @@
outb(value, info->port+offset);
}
}
+#endif
+
/*
* We used to support using pause I/O for certain machines. We
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/i2c/Config.in linux-2.4.22/drivers/i2c/Config.in
--- linux-2.4.22.clean/drivers/i2c/Config.in 2003-08-25 13:44:41.000000000 +0200
+++ linux-2.4.22/drivers/i2c/Config.in 2003-09-27 14:07:55.000000000 +0200
@@ -54,11 +54,12 @@
dep_tristate ' MAX1617 Temperature Sensor' CONFIG_I2C_MAX1617 $CONFIG_I2C_ALGO_SIBYTE
fi
+ dep_tristate 'I2C SGI interfaces' CONFIG_I2C_ALGO_SGI $CONFIG_I2C
+
# This is needed for automatic patch generation: sensors code starts here
# This is needed for automatic patch generation: sensors code ends here
dep_tristate 'I2C device interface' CONFIG_I2C_CHARDEV $CONFIG_I2C
dep_tristate 'I2C /proc interface (required for hardware sensors)' CONFIG_I2C_PROC $CONFIG_I2C
-
fi
endmenu
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/i2c/i2c-algo-sgi.c linux-2.4.22/drivers/i2c/i2c-algo-sgi.c
--- linux-2.4.22.clean/drivers/i2c/i2c-algo-sgi.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/i2c/i2c-algo-sgi.c 2003-09-11 17:36:48.000000000 +0200
@@ -0,0 +1,211 @@
+/*
+ * i2c-algo-sgi.c: i2c driver algorithms for SGI adapters.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-algo-sgi.h>
+
+
+#define SGI_I2C_FORCE_IDLE (0 << 0)
+#define SGI_I2C_NOT_IDLE (1 << 0)
+#define SGI_I2C_WRITE (0 << 1)
+#define SGI_I2C_READ (1 << 1)
+#define SGI_I2C_RELEASE_BUS (0 << 2)
+#define SGI_I2C_HOLD_BUS (1 << 2)
+#define SGI_I2C_XFER_DONE (0 << 4)
+#define SGI_I2C_XFER_BUSY (1 << 4)
+#define SGI_I2C_ACK (0 << 5)
+#define SGI_I2C_NACK (1 << 5)
+#define SGI_I2C_BUS_OK (0 << 7)
+#define SGI_I2C_BUS_ERR (1 << 7)
+
+#define get_control(adap) adap->getctrl(adap->data)
+#define set_control(adap, val) adap->setctrl(adap->data, val)
+#define read_data(adap) adap->rdata(adap->data)
+#define write_data(adap, val) adap->wdata(adap->data, val)
+
+/* I2C debugging? */
+#if 1
+#define DEBUGI2C(x...) printk(x);
+#else
+#define DEBUGI2C(x...)
+#endif
+
+static int wait_xfer_done(struct i2c_algo_sgi_data *adap)
+{
+ int i;
+
+ for (i = 0; i < adap->xfer_timeout; i++) {
+ if ((get_control(adap) & SGI_I2C_XFER_BUSY) == 0)
+ return 0;
+ udelay(1);
+ }
+
+ DEBUGI2C("sgi_i2c: timeout waiting for xfer done.\n");
+
+ return -ETIMEDOUT;
+}
+
+static int wait_ack(struct i2c_algo_sgi_data *adap)
+{
+ int i;
+
+ if (wait_xfer_done(adap))
+ return -ETIMEDOUT;
+ for (i = 0; i < adap->ack_timeout; i++) {
+ if ((get_control(adap) & SGI_I2C_NACK) == 0)
+ return 0;
+ udelay(1);
+ }
+
+ DEBUGI2C("sgi_i2c: timeout waiting for ack.\n");
+
+ return -ETIMEDOUT;
+}
+
+static int force_idle(struct i2c_algo_sgi_data *adap)
+{
+ int i;
+
+ set_control(adap, SGI_I2C_FORCE_IDLE);
+ for (i = 0; i < adap->xfer_timeout; i++) {
+ if ((get_control(adap) & SGI_I2C_NOT_IDLE) == 0)
+ goto out;
+ udelay(1);
+ }
+ return -ETIMEDOUT;
+out:
+ if (get_control(adap) & SGI_I2C_BUS_ERR) {
+ return -EIO;
+ }
+ return 0;
+}
+
+static int do_address(struct i2c_algo_sgi_data *adap, unsigned int addr,
+ int rd, int release)
+{
+ DEBUGI2C("preparing to %s %02x.\n", rd ? "read from" : "write to",
+ addr);
+ /* Check if bus is idle, eventually force it to do so */
+ if ((get_control(adap) & SGI_I2C_NOT_IDLE) == 0)
+ if (force_idle(adap))
+ return -EIO;
+ /* Write out the i2c chip address and specify operation */
+ set_control(adap, (release ? SGI_I2C_RELEASE_BUS : SGI_I2C_HOLD_BUS) |
+ SGI_I2C_WRITE | SGI_I2C_NOT_IDLE);
+ write_data(adap, addr | (rd ? 1 : 0));
+ if (wait_ack(adap))
+ return -EIO;
+ return 0;
+}
+
+static int i2c_read(struct i2c_algo_sgi_data *adap, unsigned char *buf,
+ unsigned int len, int last)
+{
+ int i;
+
+ DEBUGI2C("i2c_read\n");
+ set_control(adap, (last && len < 2 ?
+ SGI_I2C_RELEASE_BUS : SGI_I2C_HOLD_BUS) |
+ SGI_I2C_READ | SGI_I2C_NOT_IDLE);
+ for (i = 0; i < len; i++) {
+ if (last && len == i + 1)
+ set_control(adap, SGI_I2C_RELEASE_BUS |
+ SGI_I2C_READ |
+ SGI_I2C_NOT_IDLE);
+ if (wait_xfer_done(adap))
+ return -EIO;
+ buf[i] = read_data(adap);
+ }
+ return 0;
+
+}
+
+static int i2c_write(struct i2c_algo_sgi_data *adap, unsigned char *buf,
+ unsigned int len, int last)
+{
+ int i;
+
+ DEBUGI2C("i2c_write\n");
+ /* We are already in write state */
+ for (i = 0; i < len; i++) {
+ if (last && len == i + 1)
+ set_control(adap, SGI_I2C_RELEASE_BUS |
+ SGI_I2C_WRITE |
+ SGI_I2C_NOT_IDLE);
+ DEBUGI2C("writing %02x\n", buf[i]);
+ write_data(adap, buf[i]);
+ if (wait_ack(adap))
+ return -EIO;
+ }
+ return 0;
+}
+
+static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[],
+ int num)
+{
+ struct i2c_algo_sgi_data *adap = i2c_adap->algo_data;
+ struct i2c_msg *p;
+ int i, err = 0;
+
+ for (i = 0; !err && i < num; i++) {
+ p = &msgs[i];
+ err = do_address(adap, p->addr, p->flags & I2C_M_RD,
+ p->len == 0);
+ if (err || p->len == 0)
+ continue;
+ if (p->flags & I2C_M_RD)
+ err = i2c_read(adap, p->buf, p->len, num == i + 1);
+ else
+ err = i2c_write(adap, p->buf, p->len, num == i + 1);
+ }
+
+ return err;
+}
+
+static u32 sgi_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_SMBUS_EMUL;
+}
+
+static struct i2c_algorithm sgi_algo = {
+ .name = "SGI algorithm",
+ .id = I2C_ALGO_SGI,
+ .master_xfer = sgi_xfer,
+ .functionality = sgi_func,
+};
+
+/*
+ * registering functions to load algorithms at runtime
+ */
+int i2c_sgi_add_bus(struct i2c_adapter *adap)
+{
+ adap->id |= sgi_algo.id;
+ adap->algo = &sgi_algo;
+
+ return i2c_add_adapter(adap);
+}
+
+
+int i2c_sgi_del_bus(struct i2c_adapter *adap)
+{
+ return i2c_del_adapter(adap);
+}
+
+EXPORT_SYMBOL(i2c_sgi_add_bus);
+EXPORT_SYMBOL(i2c_sgi_del_bus);
+
+MODULE_AUTHOR("Ladislav Michl <ladis@linux-mips.org>");
+MODULE_DESCRIPTION("I2C-Bus SGI algorithm");
+MODULE_LICENSE("GPL");
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/i2c/Makefile linux-2.4.22/drivers/i2c/Makefile
--- linux-2.4.22.clean/drivers/i2c/Makefile 2003-08-25 13:44:41.000000000 +0200
+++ linux-2.4.22/drivers/i2c/Makefile 2003-09-27 14:07:55.000000000 +0200
@@ -5,7 +5,8 @@
O_TARGET := i2c.o
export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \
- i2c-algo-ite.o i2c-proc.o i2c-algo-sibyte.o
+ i2c-algo-ite.o i2c-algo-sibyte.o i2c-algo-sgi.o \
+ i2c-proc.o
obj-$(CONFIG_I2C) += i2c-core.o
obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
@@ -23,6 +24,7 @@
obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o
obj-$(CONFIG_I2C_ALGO_SIBYTE) += i2c-algo-sibyte.o i2c-sibyte.o
obj-$(CONFIG_I2C_MAX1617) += i2c-max1617.o
+obj-$(CONFIG_I2C_ALGO_SGI) += i2c-algo-sgi.o
# This is needed for automatic patch generation: sensors code starts here
# This is needed for automatic patch generation: sensors code ends here
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/media/video/Config.in linux-2.4.22/drivers/media/video/Config.in
--- linux-2.4.22.clean/drivers/media/video/Config.in 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/media/video/Config.in 2003-09-27 14:08:00.000000000 +0200
@@ -39,7 +39,7 @@
dep_tristate ' SAA5249 Teletext processor' CONFIG_VIDEO_SAA5249 $CONFIG_VIDEO_DEV $CONFIG_I2C
dep_tristate ' SAB3036 tuner' CONFIG_TUNER_3036 $CONFIG_VIDEO_DEV $CONFIG_I2C
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- if [ "$CONFIG_SGI_IP22" = "y" ]; then
+ if [ "$CONFIG_SGI_IP22" = "y" -a "$CONFIG_I2C_ALGOSGI" != "n" ]; then
dep_tristate ' SGI Vino Video For Linux (EXPERIMENTAL)' CONFIG_VIDEO_VINO $CONFIG_VIDEO_DEV
fi
dep_tristate ' Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)' CONFIG_VIDEO_STRADIS $CONFIG_VIDEO_DEV $CONFIG_PCI
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/media/video/vino.c linux-2.4.22/drivers/media/video/vino.c
--- linux-2.4.22.clean/drivers/media/video/vino.c 2002-08-03 02:39:44.000000000 +0200
+++ linux-2.4.22/drivers/media/video/vino.c 2003-09-27 14:08:00.000000000 +0200
@@ -1,257 +1,347 @@
/*
- * (incomplete) Driver for the Vino Video input system found in SGI Indys.
+ * (incomplete) Driver for the VINO (Video In No Out) system found in SGI Indys.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
*
- * Copyright (C) 1999 Ulf Carlsson (ulfc@bun.falkenberg.se)
- *
- * This isn't complete yet, please don't expect any video until I've written
- * some more code.
+ * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/wrapper.h>
#include <linux/errno.h>
+#include <linux/irq.h>
+#include <linux/delay.h>
#include <linux/videodev.h>
+#include <linux/i2c.h>
+#include <linux/i2c-algo-sgi.h>
#include <asm/addrspace.h>
#include <asm/system.h>
+#include <asm/bootinfo.h>
+#include <asm/pgtable.h>
+#include <asm/paccess.h>
+#include <asm/io.h>
+#include <asm/sgi/ip22.h>
+#include <asm/sgi/hpc3.h>
+#include <asm/sgi/mc.h>
#include "vino.h"
+/* debugging? */
+#if 1
+#define DEBUG(x...) printk(x);
+#else
+#define DEBUG(x...)
+#endif
+
+
+/* VINO ASIC registers */
+struct sgi_vino *vino;
+
+static const char *vinostr = "VINO IndyCam/TV";
+static int threshold_a = 512;
+static int threshold_b = 512;
+
struct vino_device {
struct video_device vdev;
+#define VINO_CHAN_A 1
+#define VINO_CHAN_B 2
+ int chan;
+};
- unsigned long chan;
-#define VINO_CHAN_A 0
-#define VINO_CHAN_B 1
-
- unsigned long flags;
-#define VINO_DMA_ACTIVE (1<<0)
+struct vino_client {
+ struct i2c_client *driver;
+ int owner;
};
-/* We can actually receive TV and IndyCam input at the same time. Believe it or
- * not..
- */
-static struct vino_device vino[2];
+struct vino_video {
+ struct vino_device chA;
+ struct vino_device chB;
+
+ struct vino_client decoder;
+ struct vino_client camera;
+
+ struct semaphore input_lock;
+
+ /* Loaded into VINO descriptors to clear End Of Descriptors table
+ * interupt condition */
+ unsigned long dummy_page;
+ unsigned int dummy_buf[4] __attribute__((aligned(8)));
+};
-/* Those registers have to be accessed by either *one* 64 bit write or *one* 64
- * bit read. We need some asm to fix this. We can't use mips3 as standard
- * because we just save 32 bits at context switch.
- */
+static struct vino_video *Vino;
-static __inline__ unsigned long long vino_reg_read(unsigned long addr)
+unsigned i2c_vino_getctrl(void *data)
{
- unsigned long long ret __attribute__ ((aligned (64)));
- unsigned long virt_addr = KSEG1ADDR(addr + VINO_BASE);
- unsigned long flags;
-
- save_and_cli(flags);
- __asm__ __volatile__(
- ".set\tmips3\n\t"
- ".set\tnoat\n\t"
- "ld\t$1,(%0)\n\t"
- "sd\t$1,(%1)\n\t"
- ".set\tat\n\t"
- ".set\tmips0"
- :
- :"r" (virt_addr), "r" (&ret));
- restore_flags(flags);
-
- return ret;
+ return vino->i2c_control;
}
-static __inline__ void vino_reg_write(unsigned long long value,
- unsigned long addr)
+void i2c_vino_setctrl(void *data, unsigned val)
{
- unsigned long virt_addr = KSEG1ADDR(addr + VINO_BASE);
- unsigned long flags;
+ vino->i2c_control = val;
+}
- /* we might lose the upper parts of the registers which are not saved
- * if there comes an interrupt in our way, play safe */
+unsigned i2c_vino_rdata(void *data)
+{
+ return vino->i2c_data;
+}
- save_and_cli(flags);
- __asm__ __volatile__(
- ".set\tmips3\n\t"
- ".set\tnoat\n\t"
- "ld\t$1,(%0)\n\t"
- "sd\t$1,(%1)\n\t"
- ".set\tat\n\t"
- ".set\tmips0"
- :
- :"r" (&value), "r" (virt_addr));
- restore_flags(flags);
-}
-
-static __inline__ void vino_reg_and(unsigned long long value,
- unsigned long addr)
-{
- unsigned long virt_addr = KSEG1ADDR(addr + VINO_BASE);
- unsigned long tmp, flags;
-
- __save_and_cli(flags);
- __asm__ __volatile__(
- ".set\tmips3\t\t\t# vino_reg_and\n\t"
- ".set\tnoat\n\t"
- "ld\t$1, (%1)\n\t"
- "ld\t%0, (%2)\n\t"
- "and\t$1, $1, %0\n\t"
- "sd\t$1, (%1)\n\t"
- ".set\tat\n\t"
- ".set\tmips0"
- : "=&r" (tmp)
- : "r" (virt_addr), "r" (&value));
- __restore_flags(flags);
-}
-
-static __inline__ void vino_reg_or(unsigned long long value,
- unsigned long addr)
-{
- unsigned long virt_addr = KSEG1ADDR(addr + VINO_BASE);
- unsigned long tmp, flags;
-
- save_and_cli(flags);
- __asm__ __volatile__(
- ".set\tmips3\n\t"
- ".set\tnoat\n\t"
- "ld\t$1, (%1)\n\t"
- "ld\t%0, (%2)\n\t"
- "or\t$1, $1, %0\n\t"
- "sd\t$1, (%1)\n\t"
- ".set\tat\n\t"
- ".set\tmips0"
- : "=&r" (tmp)
- : "r" (virt_addr), "r" (&value));
- restore_flags(flags);
+void i2c_vino_wdata(void *data, unsigned val)
+{
+ vino->i2c_data = val;
}
-static int vino_dma_setup(void)
+static struct i2c_algo_sgi_data i2c_sgi_vino_data =
{
- return 0;
+ .getctrl = &i2c_vino_getctrl,
+ .setctrl = &i2c_vino_setctrl,
+ .rdata = &i2c_vino_rdata,
+ .wdata = &i2c_vino_wdata,
+ .xfer_timeout = 200,
+ .ack_timeout = 1000,
+};
+
+/*
+ * There are two possible clients on VINO I2C bus, so we limit usage only
+ * to them.
+ */
+static int i2c_vino_client_reg(struct i2c_client *client)
+{
+ int res = 0;
+
+ down(&Vino->input_lock);
+ switch (client->driver->id) {
+ case I2C_DRIVERID_SAA7191:
+ if (Vino->decoder.driver)
+ res = -EBUSY;
+ else
+ Vino->decoder.driver = client;
+ break;
+ case I2C_DRIVERID_INDYCAM:
+ if (Vino->camera.driver)
+ res = -EBUSY;
+ else
+ Vino->camera.driver = client;
+ break;
+ default:
+ res = -ENODEV;
+ }
+ up(&Vino->input_lock);
+
+ return res;
}
-static void vino_dma_stop(void)
+static int i2c_vino_client_unreg(struct i2c_client *client)
{
+ int res = 0;
+
+ down(&Vino->input_lock);
+ if (client == Vino->decoder.driver) {
+ if (Vino->decoder.owner)
+ res = -EBUSY;
+ else
+ Vino->decoder.driver = NULL;
+ } else if (client == Vino->camera.driver) {
+ if (Vino->camera.owner)
+ res = -EBUSY;
+ else
+ Vino->camera.driver = NULL;
+ }
+ up(&Vino->input_lock);
+ return res;
}
-static int vino_init(void)
+static struct i2c_adapter vino_i2c_adapter =
{
- unsigned long ret;
- unsigned short rev, id;
- unsigned long long foo;
- unsigned long *bar;
-
- bar = (unsigned long *) &foo;
-
- ret = vino_reg_read(VINO_REVID);
-
- rev = (ret & VINO_REVID_REV_MASK);
- id = (ret & VINO_REVID_ID_MASK) >> 4;
-
- printk("Vino: ID:%02hx Rev:%02hx\n", id, rev);
-
- foo = vino_reg_read(VINO_A_DESC_DATA0);
- printk("0x%lx", bar[0]);
- printk("%lx ", bar[1]);
- foo = vino_reg_read(VINO_A_DESC_DATA1);
- printk("0x%lx", bar[0]);
- printk("%lx ", bar[1]);
- foo = vino_reg_read(VINO_A_DESC_DATA2);
- printk("0x%lx", bar[0]);
- printk("%lx ", bar[1]);
- foo = vino_reg_read(VINO_A_DESC_DATA3);
- printk("0x%lx", bar[0]);
- printk("%lx\n", bar[1]);
- foo = vino_reg_read(VINO_B_DESC_DATA0);
- printk("0x%lx", bar[0]);
- printk("%lx ", bar[1]);
- foo = vino_reg_read(VINO_B_DESC_DATA1);
- printk("0x%lx", bar[0]);
- printk("%lx ", bar[1]);
- foo = vino_reg_read(VINO_B_DESC_DATA2);
- printk("0x%lx", bar[0]);
- printk("%lx ", bar[1]);
- foo = vino_reg_read(VINO_B_DESC_DATA3);
- printk("0x%lx", bar[0]);
- printk("%lx\n", bar[1]);
+ .name = "VINO I2C bus",
+ .id = I2C_HW_SGI_VINO,
+ .algo_data = &i2c_sgi_vino_data,
+ .client_register = &i2c_vino_client_reg,
+ .client_unregister = &i2c_vino_client_unreg,
+};
- return 0;
+static int vino_i2c_add_bus(void)
+{
+ return i2c_sgi_add_bus(&vino_i2c_adapter);
}
-static void vino_dma_go(struct vino_device *v)
+static int vino_i2c_del_bus(void)
{
-
+ return i2c_sgi_del_bus(&vino_i2c_adapter);
}
-/* Reset the vino back to default state */
-static void vino_setup(struct vino_device *v)
+static void vino_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
-
}
static int vino_open(struct video_device *dev, int flags)
{
+ struct vino_device *videv = (struct vino_device *)dev;
+
return 0;
}
static void vino_close(struct video_device *dev)
{
+ struct vino_device *videv = (struct vino_device *)dev;
}
-static int vino_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
+static int vino_mmap(struct video_device *dev, const char *adr,
+ unsigned long size)
{
- return 0;
+ struct vino_device *videv = (struct vino_device *)dev;
+
+ return -EINVAL;
}
-static int vino_mmap(struct video_device *dev, const char *adr,
- unsigned long size)
+static int vino_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
{
- return 0;
+ struct vino_device *videv = (struct vino_device *)dev;
+
+ return -EINVAL;
}
-static struct video_device vino_dev = {
- owner: THIS_MODULE,
- name: "Vino IndyCam/TV",
- type: VID_TYPE_CAPTURE,
- hardware: VID_HARDWARE_VINO,
- open: vino_open,
- close: vino_close,
- ioctl: vino_ioctl,
- mmap: vino_mmap,
+static const struct video_device vino_device = {
+ .owner = THIS_MODULE,
+ .type = VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE,
+ .hardware = VID_HARDWARE_VINO,
+ .name = "VINO",
+ .open = vino_open,
+ .close = vino_close,
+ .ioctl = vino_ioctl,
+ .mmap = vino_mmap,
};
-int __init init_vino(struct video_device *dev)
+static int __init vino_init(void)
{
- int err;
-
- err = vino_init();
- if (err)
- return err;
+ unsigned long rev;
+ int i, ret = 0;
+
+ /* VINO is Indy specific beast */
+ if (ip22_is_fullhouse())
+ return -ENODEV;
-#if 0
- if (video_register_device(&vinodev, VFL_TYPE_GRABBER) == -1) {
+ /*
+ * VINO is in the EISA address space, so the sysid register will tell
+ * us if the EISA_PRESENT pin on MC has been pulled low.
+ *
+ * If EISA_PRESENT is not set we definitely don't have a VINO equiped
+ * system.
+ */
+ if (!(sgimc->systemid & SGIMC_SYSID_EPRESENT)) {
+ printk(KERN_ERR "VINO not found\n");
return -ENODEV;
}
-#endif
- return 0;
-}
+ vino = (struct sgi_vino *)ioremap(VINO_BASE, sizeof(struct sgi_vino));
+ if (!vino)
+ return -EIO;
+
+ /* Okay, once we know that VINO is present we'll read its revision
+ * safe way. One never knows... */
+ if (get_dbe(rev, &(vino->rev_id))) {
+ printk(KERN_ERR "VINO: failed to read revision register\n");
+ ret = -ENODEV;
+ goto out_unmap;
+ }
+ if (VINO_ID_VALUE(rev) != VINO_CHIP_ID) {
+ printk(KERN_ERR "VINO is not VINO (Rev/ID: 0x%04lx)\n", rev);
+ ret = -ENODEV;
+ goto out_unmap;
+ }
+ printk(KERN_INFO "VINO Rev: 0x%02lx\n", VINO_REV_NUM(rev));
-#ifdef MODULE
-int init_module(void)
-{
- int err;
+ Vino = (struct vino_video *)
+ kmalloc(sizeof(struct vino_video), GFP_KERNEL);
+ if (!Vino) {
+ ret = -ENOMEM;
+ goto out_unmap;
+ }
- err = vino_init();
- if (err)
- return err;
+ Vino->dummy_page = get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ if (!Vino->dummy_page) {
+ ret = -ENOMEM;
+ goto out_free_vino;
+ }
+ for (i = 0; i < 4; i++)
+ Vino->dummy_buf[i] = PHYSADDR(Vino->dummy_page);
+
+ vino->control = 0;
+ /* prevent VINO from throwing spurious interrupts */
+ vino->a.next_4_desc = PHYSADDR(Vino->dummy_buf);
+ vino->b.next_4_desc = PHYSADDR(Vino->dummy_buf);
+ udelay(5);
+ vino->intr_status = 0;
+ /* set threshold level */
+ vino->a.fifo_thres = threshold_a;
+ vino->b.fifo_thres = threshold_b;
+
+ init_MUTEX(&Vino->input_lock);
+
+ if (request_irq(SGI_VINO_IRQ, vino_interrupt, 0, vinostr, NULL)) {
+ printk(KERN_ERR "VINO: irq%02d registration failed\n",
+ SGI_VINO_IRQ);
+ ret = -EAGAIN;
+ goto out_free_page;
+ }
+
+ ret = vino_i2c_add_bus();
+ if (ret) {
+ printk(KERN_ERR "VINO: I2C bus registration failed\n");
+ goto out_free_irq;
+ }
+
+ if (video_register_device(&Vino->chA.vdev, VFL_TYPE_GRABBER, -1) < 0) {
+ printk("%s, chnl %d: device registration failed.\n",
+ Vino->chA.vdev.name, Vino->chA.chan);
+ ret = -EINVAL;
+ goto out_i2c_del_bus;
+ }
+ if (video_register_device(&Vino->chB.vdev, VFL_TYPE_GRABBER, -1) < 0) {
+ printk("%s, chnl %d: device registration failed.\n",
+ Vino->chB.vdev.name, Vino->chB.chan);
+ ret = -EINVAL;
+ goto out_unregister_vdev;
+ }
return 0;
+
+out_unregister_vdev:
+ video_unregister_device(&Vino->chA.vdev);
+out_i2c_del_bus:
+ vino_i2c_del_bus();
+out_free_irq:
+ free_irq(SGI_VINO_IRQ, NULL);
+out_free_page:
+ free_page(Vino->dummy_page);
+out_free_vino:
+ kfree(Vino);
+out_unmap:
+ iounmap(vino);
+
+ return ret;
}
-void cleanup_module(void)
+static void __exit vino_exit(void)
{
+ video_unregister_device(&Vino->chA.vdev);
+ video_unregister_device(&Vino->chB.vdev);
+ vino_i2c_del_bus();
+ free_irq(SGI_VINO_IRQ, NULL);
+ free_page(Vino->dummy_page);
+ kfree(Vino);
+ iounmap(vino);
}
-#endif
+
+module_init(vino_init);
+module_exit(vino_exit);
+
+MODULE_DESCRIPTION("Video4Linux driver for SGI Indy VINO (IndyCam)");
+MODULE_LICENSE("GPL");
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/media/video/vino.h linux-2.4.22/drivers/media/video/vino.h
--- linux-2.4.22.clean/drivers/media/video/vino.h 2001-09-07 18:28:38.000000000 +0200
+++ linux-2.4.22/drivers/media/video/vino.h 2003-09-27 14:08:00.000000000 +0200
@@ -1,64 +1,116 @@
/*
- * Copyright (C) 1999 Ulf Carlsson (ulfc@bun.falkenberg.se)
- * Copyright (C) 2001 Ralf Baechle (ralf@gnu.org)
+ * Copyright (C) 1999 Ulf Karlsson <ulfc@bun.falkenberg.se>
+ * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
*/
-#define VINO_BASE 0x00080000 /* In EISA address space */
-
-#define VINO_REVID 0x0000
-#define VINO_CTRL 0x0008
-#define VINO_INTSTAT 0x0010 /* Interrupt status */
-#define VINO_I2C_CTRL 0x0018
-#define VINO_I2C_DATA 0x0020
-#define VINO_A_ALPHA 0x0028 /* Channel A ... */
-#define VINO_A_CLIPS 0x0030 /* Clipping start */
-#define VINO_A_CLIPE 0x0038 /* Clipping end */
-#define VINO_A_FRAMERT 0x0040 /* Framerate */
-#define VINO_A_FLDCNT 0x0048 /* Field counter */
-#define VINO_A_LNSZ 0x0050
-#define VINO_A_LNCNT 0x0058
-#define VINO_A_PGIX 0x0060 /* Page index */
-#define VINO_A_DESC_PTR 0x0068 /* Ptr to next four descriptors */
-#define VINO_A_DESC_TLB_PTR 0x0070 /* Ptr to start of descriptor table */
-#define VINO_A_DESC_DATA0 0x0078 /* Descriptor data 0 */
-#define VINO_A_DESC_DATA1 0x0080 /* ... */
-#define VINO_A_DESC_DATA2 0x0088
-#define VINO_A_DESC_DATA3 0x0090
-#define VINO_A_FIFO_THRESHOLD 0x0098 /* FIFO threshold */
-#define VINO_A_FIFO_RP 0x00a0
-#define VINO_A_FIFO_WP 0x00a8
-#define VINO_B_ALPHA 0x00b0 /* Channel B ... */
-#define VINO_B_CLIPS 0x00b8
-#define VINO_B_CLIPE 0x00c0
-#define VINO_B_FRAMERT 0x00c8
-#define VINO_B_FLDCNT 0x00d0
-#define VINO_B_LNSZ 0x00d8
-#define VINO_B_LNCNT 0x00e0
-#define VINO_B_PGIX 0x00e8
-#define VINO_B_DESC_PTR 0x00f0
-#define VINO_B_DESC_TLB_PTR 0x00f8
-#define VINO_B_DESC_DATA0 0x0100
-#define VINO_B_DESC_DATA1 0x0108
-#define VINO_B_DESC_DATA2 0x0110
-#define VINO_B_DESC_DATA3 0x0118
-#define VINO_B_FIFO_THRESHOLD 0x0120
-#define VINO_B_FIFO_RP 0x0128
-#define VINO_B_FIFO_WP 0x0130
-
-/* Bits in the VINO_REVID register */
-
-#define VINO_REVID_REV_MASK 0x000f /* bits 0:3 */
-#define VINO_REVID_ID_MASK 0x00f0 /* bits 4:7 */
-
-/* Bits in the VINO_CTRL register */
+#ifndef _vino_h_
+#define _vino_h_
+/* VINO AISIC register definitions */
+#define VINO_BASE 0x00080000 /* Vino is in the EISA address space,
+ * but it is not an EISA bus card */
+
+typedef volatile unsigned long vino_reg;
+
+#ifdef __mips64
+struct sgi_vino_channel {
+ vino_reg alpha;
+ vino_reg clip_start;
+ vino_reg clip_end;
+ vino_reg frame_rate;
+ vino_reg field_counter;
+ vino_reg line_size;
+ vino_reg line_count;
+ vino_reg page_index;
+ vino_reg next_4_desc;
+ vino_reg start_desc_tbl;
+ vino_reg desc_0;
+ vino_reg desc_1;
+ vino_reg desc_2;
+ vino_reg desc_3;
+ vino_reg fifo_thres;
+ vino_reg fifo_read;
+ vino_reg fifo_write;
+};
+
+struct sgi_vino {
+ vino_reg rev_id;
+ vino_reg control;
+ vino_reg intr_status;
+ vino_reg i2c_control;
+ vino_reg i2c_data;
+ struct sgi_vino_channel a;
+ struct sgi_vino_channel b;
+};
+
+#else
+
+struct sgi_vino_channel {
+ vino_reg alpha_;
+ vino_reg alpha;
+ vino_reg clip_start_;
+ vino_reg clip_start;
+ vino_reg clip_end_;
+ vino_reg clip_end;
+ vino_reg frame_rate_;
+ vino_reg frame_rate;
+ vino_reg field_counter_;
+ vino_reg field_counter;
+ vino_reg line_size_;
+ vino_reg line_size;
+ vino_reg line_count_;
+ vino_reg line_count;
+ vino_reg page_index_;
+ vino_reg page_index;
+ vino_reg next_4_desc_;
+ vino_reg next_4_desc;
+ vino_reg start_desc_tbl_;
+ vino_reg start_desc_tbl;
+ vino_reg desc_0_;
+ vino_reg desc_0;
+ vino_reg desc_1_;
+ vino_reg desc_1;
+ vino_reg desc_2_;
+ vino_reg desc_2;
+ vino_reg desc_3_;
+ vino_reg desc_3;
+ vino_reg fifo_thres_;
+ vino_reg fifo_thres;
+ vino_reg fifo_read_;
+ vino_reg fifo_read;
+ vino_reg fifo_write_;
+ vino_reg fifo_write;
+};
+
+struct sgi_vino {
+ vino_reg rev_id_;
+ vino_reg rev_id;
+ vino_reg control_;
+ vino_reg control;
+ vino_reg intr_status_;
+ vino_reg intr_status;
+ vino_reg i2c_control_;
+ vino_reg i2c_control;
+ vino_reg i2c_data_;
+ vino_reg i2c_data;
+ struct sgi_vino_channel a;
+ struct sgi_vino_channel b;
+};
+#endif
+
+/* Bits in the rev_id register */
+#define VINO_CHIP_ID 0xb
+#define VINO_REV_NUM(x) ((x) & 0x0f)
+#define VINO_ID_VALUE(x) (((x) & 0xf0) >> 4)
+
+/* Bits in the control register */
#define VINO_CTRL_LITTLE_ENDIAN (1<<0)
#define VINO_CTRL_A_FIELD_TRANS_INT (1<<1) /* Field transferred int */
#define VINO_CTRL_A_FIFO_OF_INT (1<<2) /* FIFO overflow int */
#define VINO_CTRL_A_END_DESC_TBL_INT (1<<3) /* End of desc table int */
#define VINO_CTRL_B_FIELD_TRANS_INT (1<<4) /* Field transferred int */
#define VINO_CTRL_B_FIFO_OF_INT (1<<5) /* FIFO overflow int */
-#define VINO_CTRL_B_END_DESC_TLB_INT (1<<6) /* End of desc table int */
+#define VINO_CTRL_B_END_DESC_TBL_INT (1<<6) /* End of desc table int */
#define VINO_CTRL_A_DMA_ENBL (1<<7)
#define VINO_CTRL_A_INTERLEAVE_ENBL (1<<8)
#define VINO_CTRL_A_SYNC_ENBL (1<<9)
@@ -73,15 +125,19 @@
#define VINO_CTRL_B_INTERLEAVE_ENBL (1<<20)
#define VINO_CTRL_B_SYNC_ENBL (1<<21)
#define VINO_CTRL_B_SELECT (1<<22) /* 1=D1 0=Philips */
-#define VINO_CTRL_B_RGB (1<<22) /* 1=RGB 0=YUV */
-#define VINO_CTRL_B_LUMA_ONLY (1<<23)
-#define VINO_CTRL_B_DEC_ENBL (1<<24) /* Decimation */
+#define VINO_CTRL_B_RGB (1<<23) /* 1=RGB 0=YUV */
+#define VINO_CTRL_B_LUMA_ONLY (1<<24)
+#define VINO_CTRL_B_DEC_ENBL (1<<25) /* Decimation */
#define VINO_CTRL_B_DEC_SCALE_MASK 0x1c000000 /* bits 25:28 */
#define VINO_CTRL_B_DEC_HOR_ONLY (1<<29) /* Decimation horizontal only */
#define VINO_CTRL_B_DITHER (1<<30) /* ChanB 24 -> 8 bit dither */
-/* Bits in the Interrupt and Status register */
+/* Bits in the Descriptor data register */
+#define VINO_DESC_JUMP (1<<30)
+#define VINO_DESC_STOP (1<<31)
+#define VINO_DESC_VALID (1<<32)
+/* Bits in the Interrupt and Status register */
#define VINO_INTSTAT_A_FIELD_TRANS (1<<0) /* Field transferred int */
#define VINO_INTSTAT_A_FIFO_OF (1<<1) /* FIFO overflow int */
#define VINO_INTSTAT_A_END_DESC_TBL (1<<2) /* End of desc table int */
@@ -89,29 +145,13 @@
#define VINO_INTSTAT_B_FIFO_OF (1<<4) /* FIFO overflow int */
#define VINO_INTSTAT_B_END_DESC_TBL (1<<5) /* End of desc table int */
-/* Bits in the Clipping Start register */
-
-#define VINO_CLIPS_START 0x3ff /* bits 0:9 */
-#define VINO_CLIPS_ODD_MASK 0x7fc00 /* bits 10:18 */
-#define VINO_CLIPS_EVEN_MASK 0xff80000 /* bits 19:27 */
-
-/* Bits in the Clipping End register */
-
-#define VINO_CLIPE_END 0x3ff /* bits 0:9 */
-#define VINO_CLIPE_ODD_MASK 0x7fc00 /* bits 10:18 */
-#define VINO_CLIPE_EVEN_MASK 0xff80000 /* bits 19:27 */
+/* Bits in the Clipping register */
+#define VINO_CLIP_START(x) ((x) & 0x3ff) /* bits 0:9 */
+#define VINO_CLIP_ODD(x) (((x) & 0x1ff) << 10) /* bits 10:18 */
+#define VINO_CLIP_EVEN(x) (((x) & 0x1ff) << 19) /* bits 19:27 */
/* Bits in the Frame Rate register */
+#define VINO_FRAMERT_PAL (1<<0) /* 0=NTSC 1=PAL */
+#define VINO_FRAMERT_RT(x) (((x) & 0x1fff) << 1) /* bits 1:12 */
-#define VINO_FRAMERT_PAL (1<<0) /* 0=NTSC 1=PAL */
-#define VINO_FRAMERT_RT_MASK 0x1ffe /* bits 1:12 */
-
-/* Bits in the VINO_I2C_CTRL */
-
-#define VINO_CTRL_I2C_IDLE (1<<0) /* write: 0=force idle
- * read: 0=idle 1=not idle */
-#define VINO_CTRL_I2C_DIR (1<<1) /* 0=read 1=write */
-#define VINO_CTRL_I2C_MORE_BYTES (1<<2) /* 0=last byte 1=more bytes */
-#define VINO_CTRL_I2C_TRANS_BUSY (1<<4) /* 0=trans done 1=trans busy */
-#define VINO_CTRL_I2C_ACK (1<<5) /* 0=ack received 1=ack not */
-#define VINO_CTRL_I2C_BUS_ERROR (1<<7) /* 0=no bus err 1=bus err */
+#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/devices/docprobe.c linux-2.4.22/drivers/mtd/devices/docprobe.c
--- linux-2.4.22.clean/drivers/mtd/devices/docprobe.c 2003-06-13 16:51:34.000000000 +0200
+++ linux-2.4.22/drivers/mtd/devices/docprobe.c 2003-06-16 01:42:21.000000000 +0200
@@ -89,10 +89,10 @@
0xe4000000,
#elif defined(CONFIG_MOMENCO_OCELOT)
0x2f000000,
- 0xff000000,
+ 0xff000000,
#elif defined(CONFIG_MOMENCO_OCELOT_G) || defined (CONFIG_MOMENCO_OCELOT_C)
- 0xff000000,
-##else
+ 0xff000000,
+#else
#warning Unknown architecture for DiskOnChip. No default probe locations defined
#endif
0 };
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/devices/ms02-nv.c linux-2.4.22/drivers/mtd/devices/ms02-nv.c
--- linux-2.4.22.clean/drivers/mtd/devices/ms02-nv.c 2003-06-13 16:51:34.000000000 +0200
+++ linux-2.4.22/drivers/mtd/devices/ms02-nv.c 2003-07-16 15:24:18.000000000 +0200
@@ -1,10 +1,10 @@
/*
- * Copyright (c) 2001 Maciej W. Rozycki
+ * Copyright (c) 2001 Maciej W. Rozycki
*
- * This program 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.
+ * This program 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.
*
* $Id: update-2.4.22-mipsorg-0.030928.1.patch,v 1.1.1.1 2004/06/06 14:14:18 rpm Exp $
*/
@@ -29,7 +29,7 @@
static char version[] __initdata =
- "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n";
+ "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n";
MODULE_AUTHOR("Maciej W. Rozycki <macro@ds2.pg.gda.pl>");
MODULE_DESCRIPTION("DEC MS02-NV NVRAM module driver");
@@ -293,12 +293,12 @@
switch (mips_machtype) {
case MACH_DS5000_200:
- csr = (volatile u32 *)KN02_CSR_ADDR;
+ csr = (volatile u32 *)KN02_CSR_BASE;
if (*csr & KN02_CSR_BNK32M)
stride = 2;
break;
case MACH_DS5000_2X0:
- case MACH_DS5000:
+ case MACH_DS5900:
csr = (volatile u32 *)KN03_MCR_BASE;
if (*csr & KN03_MCR_BNK32M)
stride = 2;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/devices/ms02-nv.h linux-2.4.22/drivers/mtd/devices/ms02-nv.h
--- linux-2.4.22.clean/drivers/mtd/devices/ms02-nv.h 2002-11-29 00:53:13.000000000 +0100
+++ linux-2.4.22/drivers/mtd/devices/ms02-nv.h 2003-07-16 15:24:18.000000000 +0200
@@ -1,32 +1,94 @@
/*
- * Copyright (c) 2001 Maciej W. Rozycki
+ * Copyright (c) 2001, 2003 Maciej W. Rozycki
*
- * This program 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.
+ * DEC MS02-NV (54-20948-01) battery backed-up NVRAM module for
+ * DECstation/DECsystem 5000/2x0 and DECsystem 5900 and 5900/260
+ * systems.
+ *
+ * This program 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.
*/
#include <linux/ioport.h>
#include <linux/mtd/mtd.h>
+/*
+ * Addresses are decoded as follows:
+ *
+ * 0x000000 - 0x3fffff SRAM
+ * 0x400000 - 0x7fffff CSR
+ *
+ * Within the SRAM area the following ranges are forced by the system
+ * firmware:
+ *
+ * 0x000000 - 0x0003ff diagnostic area, destroyed upon a reboot
+ * 0x000400 - ENDofRAM storage area, available to operating systems
+ *
+ * but we can't really use the available area right from 0x000400 as
+ * the first word is used by the firmware as a status flag passed
+ * from an operating system. If anything but the valid data magic
+ * ID value is found, the firmware considers the SRAM clean, i.e.
+ * containing no valid data, and disables the battery resulting in
+ * data being erased as soon as power is switched off. So the choice
+ * for the start address of the user-available is 0x001000 which is
+ * nicely page aligned. The area between 0x000404 and 0x000fff may
+ * be used by the driver for own needs.
+ *
+ * The diagnostic area defines two status words to be read by an
+ * operating system, a magic ID to distinguish a MS02-NV board from
+ * anything else and a status information providing results of tests
+ * as well as the size of SRAM available, which can be 1MB or 2MB
+ * (that's what the firmware handles; no idea if 2MB modules ever
+ * existed).
+ *
+ * The firmware only handles the MS02-NV board if installed in the
+ * last (15th) slot, so for any other location the status information
+ * stored in the SRAM cannot be relied upon. But from the hardware
+ * point of view there is no problem using up to 14 such boards in a
+ * system -- only the 1st slot needs to be filled with a DRAM module.
+ * The MS02-NV board is ECC-protected, like other MS02 memory boards.
+ *
+ * The state of the battery as provided by the CSR is reflected on
+ * the two onboard LEDs. When facing the battery side of the board,
+ * with the LEDs at the top left and the battery at the bottom right
+ * (i.e. looking from the back side of the system box), their meaning
+ * is as follows (the system has to be powered on):
+ *
+ * left LED battery disable status: lit = enabled
+ * right LED battery condition status: lit = OK
+ */
+
/* MS02-NV iomem register offsets. */
#define MS02NV_CSR 0x400000 /* control & status register */
+/* MS02-NV CSR status bits. */
+#define MS02NV_CSR_BATT_OK 0x01 /* battery OK */
+#define MS02NV_CSR_BATT_OFF 0x02 /* battery disabled */
+
+
/* MS02-NV memory offsets. */
#define MS02NV_DIAG 0x0003f8 /* diagnostic status */
#define MS02NV_MAGIC 0x0003fc /* MS02-NV magic ID */
-#define MS02NV_RAM 0x000400 /* general-purpose RAM start */
+#define MS02NV_VALID 0x000400 /* valid data magic ID */
+#define MS02NV_RAM 0x001000 /* user-exposed RAM start */
-/* MS02-NV diagnostic status constants. */
-#define MS02NV_DIAG_SIZE_MASK 0xf0 /* RAM size mask */
-#define MS02NV_DIAG_SIZE_SHIFT 0x10 /* RAM size shift (left) */
+/* MS02-NV diagnostic status bits. */
+#define MS02NV_DIAG_TEST 0x01 /* SRAM test done (?) */
+#define MS02NV_DIAG_RO 0x02 /* SRAM r/o test done */
+#define MS02NV_DIAG_RW 0x04 /* SRAM r/w test done */
+#define MS02NV_DIAG_FAIL 0x08 /* SRAM test failed */
+#define MS02NV_DIAG_SIZE_MASK 0xf0 /* SRAM size mask */
+#define MS02NV_DIAG_SIZE_SHIFT 0x10 /* SRAM size shift (left) */
/* MS02-NV general constants. */
#define MS02NV_ID 0x03021966 /* MS02-NV magic ID value */
+#define MS02NV_VALID_ID 0xbd100248 /* valid data magic ID value */
#define MS02NV_SLOT_SIZE 0x800000 /* size of the address space
decoded by the module */
+
typedef volatile u32 ms02nv_uint;
struct ms02nv_private {
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/maps/Config.in linux-2.4.22/drivers/mtd/maps/Config.in
--- linux-2.4.22.clean/drivers/mtd/maps/Config.in 2003-06-13 16:51:34.000000000 +0200
+++ linux-2.4.22/drivers/mtd/maps/Config.in 2003-06-27 02:04:27.000000000 +0200
@@ -51,11 +51,19 @@
dep_tristate ' Pb1000 MTD support' CONFIG_MTD_PB1000 $CONFIG_MIPS_PB1000
dep_tristate ' Pb1500 MTD support' CONFIG_MTD_PB1500 $CONFIG_MIPS_PB1500
dep_tristate ' Pb1100 MTD support' CONFIG_MTD_PB1100 $CONFIG_MIPS_PB1100
+ dep_tristate ' Bosporus MTD support' CONFIG_MTD_BOSPORUS $CONFIG_MIPS_BOSPORUS
+ dep_tristate ' XXS1500 boot flash device' CONFIG_MTD_XXS1500 $CONFIG_MIPS_XXS1500
+ dep_tristate ' MTX-1 flash device' CONFIG_MTD_MTX1 $CONFIG_MIPS_MTX1
if [ "$CONFIG_MTD_PB1500" = "y" -o "$CONFIG_MTD_PB1500" = "m" \
-o "$CONFIG_MTD_PB1100" = "y" -o "$CONFIG_MTD_PB1100" = "m" ]; then
bool ' Pb[15]00 boot flash device' CONFIG_MTD_PB1500_BOOT
bool ' Pb[15]00 user flash device (2nd 32MiB bank)' CONFIG_MTD_PB1500_USER
fi
+ tristate ' Db1x00 MTD support' CONFIG_MTD_DB1X00
+ if [ "$CONFIG_MTD_DB1X00" = "y" -o "$CONFIG_MTD_DB1X00" = "m" ]; then
+ bool ' Db1x00 boot flash device' CONFIG_MTD_DB1X00_BOOT
+ bool ' Db1x00 user flash device (2nd bank)' CONFIG_MTD_DB1X00_USER
+ fi
dep_tristate ' Flash chip mapping on ITE QED-4N-S01B, Globespan IVR or custom board' CONFIG_MTD_CSTM_MIPS_IXX $CONFIG_MTD_CFI $CONFIG_MTD_JEDEC $CONFIG_MTD_PARTITIONS
if [ "$CONFIG_MTD_CSTM_MIPS_IXX" = "y" -o "$CONFIG_MTD_CSTM_MIPS_IXX" = "m" ]; then
hex ' Physical start address of flash mapping' CONFIG_MTD_CSTM_MIPS_IXX_START 0x8000000
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/maps/db1x00-flash.c linux-2.4.22/drivers/mtd/maps/db1x00-flash.c
--- linux-2.4.22.clean/drivers/mtd/maps/db1x00-flash.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/mtd/maps/db1x00-flash.c 2003-02-16 07:25:24.000000000 +0100
@@ -0,0 +1,285 @@
+/*
+ * Flash memory access on Alchemy Db1xxx boards
+ *
+ * (C) 2003 Pete Popov <ppopov@pacbell.net>
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/io.h>
+#include <asm/au1000.h>
+#include <asm/db1x00.h>
+
+#ifdef DEBUG_RW
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
+static unsigned long window_addr;
+static unsigned long window_size;
+static unsigned long flash_size;
+
+static BCSR * const bcsr = (BCSR *)0xAE000000;
+
+__u8 physmap_read8(struct map_info *map, unsigned long ofs)
+{
+ __u8 ret;
+ ret = __raw_readb(map->map_priv_1 + ofs);
+ DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+__u16 physmap_read16(struct map_info *map, unsigned long ofs)
+{
+ __u16 ret;
+ ret = __raw_readw(map->map_priv_1 + ofs);
+ DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+__u32 physmap_read32(struct map_info *map, unsigned long ofs)
+{
+ __u32 ret;
+ ret = __raw_readl(map->map_priv_1 + ofs);
+ DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+{
+ DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
+ memcpy_fromio(to, map->map_priv_1 + from, len);
+}
+
+void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
+{
+ DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writeb(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
+{
+ DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writew(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
+{
+ DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writel(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+{
+ DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
+ memcpy_toio(map->map_priv_1 + to, from, len);
+}
+
+static struct map_info db1x00_map = {
+ name: "Db1x00 flash",
+ read8: physmap_read8,
+ read16: physmap_read16,
+ read32: physmap_read32,
+ copy_from: physmap_copy_from,
+ write8: physmap_write8,
+ write16: physmap_write16,
+ write32: physmap_write32,
+ copy_to: physmap_copy_to,
+};
+
+static unsigned char flash_buswidth = 4;
+
+/*
+ * The Db1x boards support different flash densities. We setup
+ * the mtd_partition structures below for default of 64Mbit
+ * flash densities, and override the partitions sizes, if
+ * necessary, after we check the board status register.
+ */
+
+#ifdef DB1X00_BOTH_BANKS
+/* both banks will be used. Combine the first bank and the first
+ * part of the second bank together into a single jffs/jffs2
+ * partition.
+ */
+static struct mtd_partition db1x00_partitions[] = {
+ {
+ name: "User FS",
+ size: 0x1c00000,
+ offset: 0x0000000
+ },{
+ name: "yamon",
+ size: 0x0100000,
+ offset: MTDPART_OFS_APPEND,
+ mask_flags: MTD_WRITEABLE
+ },{
+ name: "raw kernel",
+ size: (0x300000-0x40000), /* last 256KB is yamon env */
+ offset: MTDPART_OFS_APPEND,
+ }
+};
+#elif defined(DB1X00_BOOT_ONLY)
+static struct mtd_partition db1x00_partitions[] = {
+ {
+ name: "User FS",
+ size: 0x00c00000,
+ offset: 0x0000000
+ },{
+ name: "yamon",
+ size: 0x0100000,
+ offset: MTDPART_OFS_APPEND,
+ mask_flags: MTD_WRITEABLE
+ },{
+ name: "raw kernel",
+ size: (0x300000-0x40000), /* last 256KB is yamon env */
+ offset: MTDPART_OFS_APPEND,
+ }
+};
+#elif defined(DB1X00_USER_ONLY)
+static struct mtd_partition db1x00_partitions[] = {
+ {
+ name: "User FS",
+ size: 0x0e00000,
+ offset: 0x0000000
+ },{
+ name: "raw kernel",
+ size: MTDPART_SIZ_FULL,
+ offset: MTDPART_OFS_APPEND,
+ }
+};
+#else
+#error MTD_DB1X00 define combo error /* should never happen */
+#endif
+
+
+#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
+
+static struct mtd_partition *parsed_parts;
+static struct mtd_info *mymtd;
+
+/*
+ * Probe the flash density and setup window address and size
+ * based on user CONFIG options. There are times when we don't
+ * want the MTD driver to be probing the boot or user flash,
+ * so having the option to enable only one bank is important.
+ */
+int setup_flash_params()
+{
+ switch ((bcsr->status >> 14) & 0x3) {
+ case 0: /* 64Mbit devices */
+ flash_size = 0x800000; /* 8MB per part */
+#if defined(DB1X00_BOTH_BANKS)
+ window_addr = 0x1E000000;
+ window_size = 0x2000000;
+#elif defined(DB1X00_BOOT_ONLY)
+ window_addr = 0x1F000000;
+ window_size = 0x1000000;
+#else /* USER ONLY */
+ window_addr = 0x1E000000;
+ window_size = 0x1000000;
+#endif
+ break;
+ case 1:
+ /* 128 Mbit devices */
+ flash_size = 0x1000000; /* 16MB per part */
+#if defined(DB1X00_BOTH_BANKS)
+ window_addr = 0x1C000000;
+ window_size = 0x4000000;
+ /* USERFS from 0x1C00 0000 to 0x1FC0 0000 */
+ db1x00_partitions[0].size = 0x3C00000;
+#elif defined(DB1X00_BOOT_ONLY)
+ window_addr = 0x1E000000;
+ window_size = 0x2000000;
+ /* USERFS from 0x1E00 0000 to 0x1FC0 0000 */
+ db1x00_partitions[0].size = 0x1C00000;
+#else /* USER ONLY */
+ window_addr = 0x1C000000;
+ window_size = 0x2000000;
+ /* USERFS from 0x1C00 0000 to 0x1DE00000 */
+ db1x00_partitions[0].size = 0x1DE0000;
+#endif
+ break;
+ case 2:
+ /* 256 Mbit devices */
+ flash_size = 0x4000000; /* 64MB per part */
+#if defined(DB1X00_BOTH_BANKS)
+ return 1;
+#elif defined(DB1X00_BOOT_ONLY)
+ /* Boot ROM flash bank only; no user bank */
+ window_addr = 0x1C000000;
+ window_size = 0x4000000;
+ /* USERFS from 0x1C00 0000 to 0x1FC00000 */
+ db1x00_partitions[0].size = 0x3C00000;
+#else /* USER ONLY */
+ return 1;
+#endif
+ break;
+ default:
+ return 1;
+ }
+ return 0;
+}
+
+int __init db1x00_mtd_init(void)
+{
+ struct mtd_partition *parts;
+ int nb_parts = 0;
+ char *part_type;
+
+ /* Default flash buswidth */
+ db1x00_map.buswidth = flash_buswidth;
+
+ if (setup_flash_params())
+ return -ENXIO;
+
+ /*
+ * Static partition definition selection
+ */
+ part_type = "static";
+ parts = db1x00_partitions;
+ nb_parts = NB_OF(db1x00_partitions);
+ db1x00_map.size = window_size;
+
+ /*
+ * Now let's probe for the actual flash. Do it here since
+ * specific machine settings might have been set above.
+ */
+ printk(KERN_NOTICE "Db1xxx flash: probing %d-bit flash bus\n",
+ db1x00_map.buswidth*8);
+ db1x00_map.map_priv_1 =
+ (unsigned long)ioremap(window_addr, window_size);
+ mymtd = do_map_probe("cfi_probe", &db1x00_map);
+ if (!mymtd) return -ENXIO;
+ mymtd->module = THIS_MODULE;
+
+ add_mtd_partitions(mymtd, parts, nb_parts);
+ return 0;
+}
+
+static void __exit db1x00_mtd_cleanup(void)
+{
+ if (mymtd) {
+ del_mtd_partitions(mymtd);
+ map_destroy(mymtd);
+ if (parsed_parts)
+ kfree(parsed_parts);
+ }
+}
+
+module_init(db1x00_mtd_init);
+module_exit(db1x00_mtd_cleanup);
+
+MODULE_AUTHOR("Pete Popov");
+MODULE_DESCRIPTION("Db1x00 mtd map driver");
+MODULE_LICENSE("GPL");
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/maps/lasat.c linux-2.4.22/drivers/mtd/maps/lasat.c
--- linux-2.4.22.clean/drivers/mtd/maps/lasat.c 2003-06-13 16:51:34.000000000 +0200
+++ linux-2.4.22/drivers/mtd/maps/lasat.c 2003-09-27 14:08:01.000000000 +0200
@@ -1,15 +1,6 @@
/*
* Flash device on lasat 100 and 200 boards
*
- * Presumably (C) 2002 Brian Murphy <brian@murphy.dk> or whoever he
- * works for.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation.
- *
- * $Id: update-2.4.22-mipsorg-0.030928.1.patch,v 1.1.1.1 2004/06/06 14:14:18 rpm Exp $
- *
*/
#include <linux/module.h>
@@ -21,7 +12,6 @@
#include <linux/mtd/partitions.h>
#include <linux/config.h>
#include <asm/lasat/lasat.h>
-#include <asm/lasat/lasat_mtd.h>
static struct mtd_info *mymtd;
@@ -69,30 +59,33 @@
}
static struct map_info sp_map = {
- .name = "SP flash",
- .buswidth = 4,
- .read8 = sp_read8,
- .read16 = sp_read16,
- .read32 = sp_read32,
- .copy_from = sp_copy_from,
- .write8 = sp_write8,
- .write16 = sp_write16,
- .write32 = sp_write32,
- .copy_to = sp_copy_to
+ name: "SP flash",
+ buswidth: 4,
+ read8: sp_read8,
+ read16: sp_read16,
+ read32: sp_read32,
+ copy_from: sp_copy_from,
+ write8: sp_write8,
+ write16: sp_write16,
+ write32: sp_write32,
+ copy_to: sp_copy_to
};
static struct mtd_partition partition_info[LASAT_MTD_LAST];
-static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Filesystem", "Config"};
+static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Config", "Filesystem"};
static int __init init_sp(void)
{
int i;
+ int nparts = 0;
/* this does not play well with the old flash code which
* protects and uprotects the flash when necessary */
printk(KERN_NOTICE "Unprotecting flash\n");
*lasat_misc->flash_wp_reg |= 1 << lasat_misc->flash_wp_bit;
- sp_map.map_priv_1 = lasat_flash_partition_start(LASAT_MTD_BOOTLOADER);
+ sp_map.map_priv_1 = ioremap_nocache(
+ lasat_flash_partition_start(LASAT_MTD_BOOTLOADER),
+ lasat_board_info.li_flash_size);
sp_map.size = lasat_board_info.li_flash_size;
printk(KERN_NOTICE "sp flash device: %lx at %lx\n",
@@ -109,12 +102,15 @@
for (i=0; i < LASAT_MTD_LAST; i++) {
size = lasat_flash_partition_size(i);
- partition_info[i].size = size;
- partition_info[i].offset = offset;
- offset += size;
+ if (size != 0) {
+ nparts++;
+ partition_info[i].size = size;
+ partition_info[i].offset = offset;
+ offset += size;
+ }
}
- add_mtd_partitions( mymtd, partition_info, LASAT_MTD_LAST );
+ add_mtd_partitions( mymtd, partition_info, nparts );
return 0;
}
@@ -124,11 +120,11 @@
static void __exit cleanup_sp(void)
{
if (mymtd) {
- del_mtd_partitions(mymtd);
- map_destroy(mymtd);
+ del_mtd_partitions(mymtd);
+ map_destroy(mymtd);
}
if (sp_map.map_priv_1) {
- sp_map.map_priv_1 = 0;
+ sp_map.map_priv_1 = 0;
}
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/maps/Makefile linux-2.4.22/drivers/mtd/maps/Makefile
--- linux-2.4.22.clean/drivers/mtd/maps/Makefile 2003-06-13 16:51:34.000000000 +0200
+++ linux-2.4.22/drivers/mtd/maps/Makefile 2003-06-27 02:04:34.000000000 +0200
@@ -52,7 +52,11 @@
obj-$(CONFIG_MTD_PB1000) += pb1xxx-flash.o
obj-$(CONFIG_MTD_PB1100) += pb1xxx-flash.o
obj-$(CONFIG_MTD_PB1500) += pb1xxx-flash.o
+obj-$(CONFIG_MTD_XXS1500) += xxs1500.o
+obj-$(CONFIG_MTD_MTX1) += mtx-1.o
obj-$(CONFIG_MTD_LASAT) += lasat.o
+obj-$(CONFIG_MTD_DB1X00) += db1x00-flash.o
+obj-$(CONFIG_MTD_BOSPORUS) += pb1xxx-flash.o
obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o
obj-$(CONFIG_MTD_EDB7312) += edb7312.o
obj-$(CONFIG_MTD_IMPA7) += impa7.o
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/maps/mtx-1.c linux-2.4.22/drivers/mtd/maps/mtx-1.c
--- linux-2.4.22.clean/drivers/mtd/maps/mtx-1.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/mtd/maps/mtx-1.c 2003-06-27 02:04:35.000000000 +0200
@@ -0,0 +1,181 @@
+/*
+ * Flash memory access on 4G Systems MTX-1 board
+ *
+ * (C) 2003 Pete Popov <ppopov@mvista.com>
+ * Bruno Randolf <bruno.randolf@4g-systems.de>
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/io.h>
+#include <asm/au1000.h>
+
+#ifdef DEBUG_RW
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
+#ifdef CONFIG_MIPS_MTX1
+#define WINDOW_ADDR 0x1E000000
+#define WINDOW_SIZE 0x2000000
+#endif
+
+__u8 physmap_read8(struct map_info *map, unsigned long ofs)
+{
+ __u8 ret;
+ ret = __raw_readb(map->map_priv_1 + ofs);
+ DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+__u16 physmap_read16(struct map_info *map, unsigned long ofs)
+{
+ __u16 ret;
+ ret = __raw_readw(map->map_priv_1 + ofs);
+ DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+__u32 physmap_read32(struct map_info *map, unsigned long ofs)
+{
+ __u32 ret;
+ ret = __raw_readl(map->map_priv_1 + ofs);
+ DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+{
+ DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
+ memcpy_fromio(to, map->map_priv_1 + from, len);
+}
+
+void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
+{
+ DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writeb(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
+{
+ DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writew(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
+{
+ DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writel(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+{
+ DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
+ memcpy_toio(map->map_priv_1 + to, from, len);
+}
+
+
+
+static struct map_info mtx1_map = {
+ name: "MTX-1 flash",
+ read8: physmap_read8,
+ read16: physmap_read16,
+ read32: physmap_read32,
+ copy_from: physmap_copy_from,
+ write8: physmap_write8,
+ write16: physmap_write16,
+ write32: physmap_write32,
+ copy_to: physmap_copy_to,
+};
+
+
+static unsigned long flash_size = 0x01000000;
+static unsigned char flash_buswidth = 4;
+static struct mtd_partition mtx1_partitions[] = {
+ {
+ name: "user fs",
+ size: 0x1c00000,
+ offset: 0,
+ },{
+ name: "yamon",
+ size: 0x0100000,
+ offset: MTDPART_OFS_APPEND,
+ mask_flags: MTD_WRITEABLE
+ },{
+ name: "raw kernel",
+ size: 0x02c0000,
+ offset: MTDPART_OFS_APPEND,
+ },{
+ name: "yamon env vars",
+ size: 0x0040000,
+ offset: MTDPART_OFS_APPEND,
+ mask_flags: MTD_WRITEABLE
+ }
+};
+
+
+#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
+
+static struct mtd_partition *parsed_parts;
+static struct mtd_info *mymtd;
+
+int __init mtx1_mtd_init(void)
+{
+ struct mtd_partition *parts;
+ int nb_parts = 0;
+ char *part_type;
+
+ /* Default flash buswidth */
+ mtx1_map.buswidth = flash_buswidth;
+
+ /*
+ * Static partition definition selection
+ */
+ part_type = "static";
+ parts = mtx1_partitions;
+ nb_parts = NB_OF(mtx1_partitions);
+ mtx1_map.size = flash_size;
+
+ /*
+ * Now let's probe for the actual flash. Do it here since
+ * specific machine settings might have been set above.
+ */
+ printk(KERN_NOTICE "MTX-1 flash: probing %d-bit flash bus\n",
+ mtx1_map.buswidth*8);
+ mtx1_map.map_priv_1 =
+ (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+ mymtd = do_map_probe("cfi_probe", &mtx1_map);
+ if (!mymtd) return -ENXIO;
+ mymtd->module = THIS_MODULE;
+
+ add_mtd_partitions(mymtd, parts, nb_parts);
+ return 0;
+}
+
+static void __exit mtx1_mtd_cleanup(void)
+{
+ if (mymtd) {
+ del_mtd_partitions(mymtd);
+ map_destroy(mymtd);
+ if (parsed_parts)
+ kfree(parsed_parts);
+ }
+}
+
+module_init(mtx1_mtd_init);
+module_exit(mtx1_mtd_cleanup);
+
+MODULE_AUTHOR("Pete Popov");
+MODULE_DESCRIPTION("MTX-1 CFI map driver");
+MODULE_LICENSE("GPL");
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/maps/pb1xxx-flash.c linux-2.4.22/drivers/mtd/maps/pb1xxx-flash.c
--- linux-2.4.22.clean/drivers/mtd/maps/pb1xxx-flash.c 2003-06-13 16:51:34.000000000 +0200
+++ linux-2.4.22/drivers/mtd/maps/pb1xxx-flash.c 2003-05-19 08:27:22.000000000 +0200
@@ -192,6 +192,34 @@
#else
#error MTD_PB1500 define combo error /* should never happen */
#endif
+#elif defined(CONFIG_MTD_BOSPORUS)
+static unsigned char flash_buswidth = 2;
+static unsigned long flash_size = 0x02000000;
+#define WINDOW_ADDR 0x1F000000
+#define WINDOW_SIZE 0x2000000
+static struct mtd_partition pb1xxx_partitions[] = {
+ {
+ name: "User FS",
+ size: 0x00400000,
+ offset: 0x00000000,
+ },{
+ name: "Yamon-2",
+ size: 0x00100000,
+ offset: 0x00400000,
+ },{
+ name: "Root FS",
+ size: 0x00700000,
+ offset: 0x00500000,
+ },{
+ name: "Yamon-1",
+ size: 0x00100000,
+ offset: 0x00C00000,
+ },{
+ name: "Kernel",
+ size: 0x00300000,
+ offset: 0x00D00000,
+ }
+};
#else
#error Unsupported board
#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/mtd/maps/xxs1500.c linux-2.4.22/drivers/mtd/maps/xxs1500.c
--- linux-2.4.22.clean/drivers/mtd/maps/xxs1500.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/mtd/maps/xxs1500.c 2003-08-02 04:06:01.000000000 +0200
@@ -0,0 +1,186 @@
+/*
+ * Flash memory access on MyCable XXS1500 board
+ *
+ * (C) 2003 Pete Popov <ppopov@mvista.com>
+ *
+ * $Id: update-2.4.22-mipsorg-0.030928.1.patch,v 1.1.1.1 2004/06/06 14:14:18 rpm Exp $
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/io.h>
+#include <asm/au1000.h>
+
+#ifdef DEBUG_RW
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
+#ifdef CONFIG_MIPS_XXS1500
+#define WINDOW_ADDR 0x1F000000
+#define WINDOW_SIZE 0x1000000
+#endif
+
+__u8 physmap_read8(struct map_info *map, unsigned long ofs)
+{
+ __u8 ret;
+ ret = __raw_readb(map->map_priv_1 + ofs);
+ DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+__u16 physmap_read16(struct map_info *map, unsigned long ofs)
+{
+ __u16 ret;
+ ret = __raw_readw(map->map_priv_1 + ofs);
+ DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+__u32 physmap_read32(struct map_info *map, unsigned long ofs)
+{
+ __u32 ret;
+ ret = __raw_readl(map->map_priv_1 + ofs);
+ DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
+ return ret;
+}
+
+void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+{
+ DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
+ memcpy_fromio(to, map->map_priv_1 + from, len);
+}
+
+void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
+{
+ DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writeb(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
+{
+ DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writew(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
+{
+ DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
+ __raw_writel(d, map->map_priv_1 + adr);
+ mb();
+}
+
+void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+{
+ DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
+ memcpy_toio(map->map_priv_1 + to, from, len);
+}
+
+
+
+static struct map_info xxs1500_map = {
+ name: "XXS1500 flash",
+ read8: physmap_read8,
+ read16: physmap_read16,
+ read32: physmap_read32,
+ copy_from: physmap_copy_from,
+ write8: physmap_write8,
+ write16: physmap_write16,
+ write32: physmap_write32,
+ copy_to: physmap_copy_to,
+};
+
+
+static unsigned long flash_size = 0x00800000;
+static unsigned char flash_buswidth = 4;
+static struct mtd_partition xxs1500_partitions[] = {
+ {
+ name: "kernel image",
+ size: 0x00200000,
+ offset: 0,
+ },{
+ name: "user fs 0",
+ size: (0x00C00000-0x200000),
+ offset: MTDPART_OFS_APPEND,
+ },{
+ name: "yamon",
+ size: 0x00100000,
+ offset: MTDPART_OFS_APPEND,
+ mask_flags: MTD_WRITEABLE
+ },{
+ name: "user fs 1",
+ size: 0x2c0000,
+ offset: MTDPART_OFS_APPEND,
+ },{
+ name: "yamon env vars",
+ size: 0x040000,
+ offset: MTDPART_OFS_APPEND,
+ mask_flags: MTD_WRITEABLE
+ }
+};
+
+
+#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
+
+static struct mtd_partition *parsed_parts;
+static struct mtd_info *mymtd;
+
+int __init xxs1500_mtd_init(void)
+{
+ struct mtd_partition *parts;
+ int nb_parts = 0;
+ char *part_type;
+
+ /* Default flash buswidth */
+ xxs1500_map.buswidth = flash_buswidth;
+
+ /*
+ * Static partition definition selection
+ */
+ part_type = "static";
+ parts = xxs1500_partitions;
+ nb_parts = NB_OF(xxs1500_partitions);
+ xxs1500_map.size = flash_size;
+
+ /*
+ * Now let's probe for the actual flash. Do it here since
+ * specific machine settings might have been set above.
+ */
+ printk(KERN_NOTICE "XXS1500 flash: probing %d-bit flash bus\n",
+ xxs1500_map.buswidth*8);
+ xxs1500_map.map_priv_1 =
+ (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+ mymtd = do_map_probe("cfi_probe", &xxs1500_map);
+ if (!mymtd) return -ENXIO;
+ mymtd->module = THIS_MODULE;
+
+ add_mtd_partitions(mymtd, parts, nb_parts);
+ return 0;
+}
+
+static void __exit xxs1500_mtd_cleanup(void)
+{
+ if (mymtd) {
+ del_mtd_partitions(mymtd);
+ map_destroy(mymtd);
+ if (parsed_parts)
+ kfree(parsed_parts);
+ }
+}
+
+module_init(xxs1500_mtd_init);
+module_exit(xxs1500_mtd_cleanup);
+
+MODULE_AUTHOR("Pete Popov");
+MODULE_DESCRIPTION("XXS1500 CFI map driver");
+MODULE_LICENSE("GPL");
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/au1000_eth.c linux-2.4.22/drivers/net/au1000_eth.c
--- linux-2.4.22.clean/drivers/net/au1000_eth.c 2002-11-29 00:53:13.000000000 +0100
+++ linux-2.4.22/drivers/net/au1000_eth.c 2003-08-09 22:19:13.000000000 +0200
@@ -1,8 +1,9 @@
/*
*
- * Alchemy Semi Au1000 ethernet driver
+ * Alchemy Au1x00 ethernet driver
*
- * Copyright 2001 MontaVista Software Inc.
+ * Copyright 2001,2002,2003 MontaVista Software Inc.
+ * Copyright 2002 TimeSys Corp.
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
@@ -22,8 +23,15 @@
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* ########################################################################
+ *
+ *
*/
-#include <linux/config.h>
+
+#ifndef __mips__
+#error This driver only works with MIPS architectures!
+#endif
+
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
@@ -44,22 +52,27 @@
#include <asm/irq.h>
#include <asm/bitops.h>
#include <asm/io.h>
+#include <asm/processor.h>
#include <asm/au1000.h>
+#include <asm/cpu.h>
#include "au1000_eth.h"
+
#ifdef AU1000_ETH_DEBUG
-static int au1000_debug = 10;
+static int au1000_debug = 5;
#else
static int au1000_debug = 3;
#endif
+MODULE_LICENSE("GPL");
+
// prototypes
static void *dma_alloc(size_t, dma_addr_t *);
static void dma_free(void *, size_t);
static void hard_stop(struct net_device *);
static void enable_rx_tx(struct net_device *dev);
-static int __init au1000_probe1(struct net_device *, long, int, int);
+static struct net_device * au1000_probe(u32 ioaddr, int irq, int port_num);
static int au1000_init(struct net_device *);
static int au1000_open(struct net_device *);
static int au1000_close(struct net_device *);
@@ -101,27 +114,8 @@
*/
-/*
- * Base address and interupt of the Au1xxx ethernet macs
- */
-static struct {
- unsigned int port;
- int irq;
-} au1000_iflist[NUM_INTERFACES] = {
- {AU1000_ETH0_BASE, AU1000_ETH0_IRQ},
- {AU1000_ETH1_BASE, AU1000_ETH1_IRQ}
- },
- au1500_iflist[NUM_INTERFACES] = {
- {AU1500_ETH0_BASE, AU1000_ETH0_IRQ},
- {AU1500_ETH1_BASE, AU1000_ETH1_IRQ}
- },
- au1100_iflist[NUM_INTERFACES] = {
- {AU1000_ETH0_BASE, AU1000_ETH0_IRQ},
- {NULL, NULL}
- };
-
static char version[] __devinitdata =
- "au1000eth.c:1.0 ppopov@mvista.com\n";
+ "au1000eth.c:1.4 ppopov@mvista.com\n";
/* These addresses are only used if yamon doesn't tell us what
* the mac address is, and the mac address is not passed on the
@@ -138,6 +132,7 @@
#define cpu_to_dma32 cpu_to_be32
#define dma32_to_cpu be32_to_cpu
+struct au1000_private *au_macs[NUM_ETH_INTERFACES];
/* FIXME
* All of the PHY code really should be detached from the MAC
@@ -156,7 +151,6 @@
s16 data;
/* Stop auto-negotiation */
- //printk("bcm_5201_init\n");
data = mdio_read(dev, phy_addr, MII_CONTROL);
mdio_write(dev, phy_addr, MII_CONTROL, data & ~MII_CNTL_AUTO);
@@ -171,12 +165,8 @@
data |= MII_CNTL_RST_AUTO | MII_CNTL_AUTO;
mdio_write(dev, phy_addr, MII_CONTROL, data);
- /* Enable TX LED instead of FDX */
- data = mdio_read(dev, phy_addr, MII_INT);
- data &= ~MII_FDX_LED;
- mdio_write(dev, phy_addr, MII_INT, data);
-
- if (au1000_debug > 4) dump_mii(dev, phy_addr);
+ if (au1000_debug > 4)
+ dump_mii(dev, phy_addr);
return 0;
}
@@ -184,7 +174,6 @@
{
s16 mii_control, timeout;
- //printk("bcm_5201_reset\n");
mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
mdio_write(dev, phy_addr, MII_CONTROL, mii_control | MII_CNTL_RESET);
mdelay(1);
@@ -247,8 +236,8 @@
printk("lsi_80227_init\n");
/* restart auto-negotiation */
- mdio_write(dev, phy_addr, 0, 0x3200);
-
+ mdio_write(dev, phy_addr, MII_CONTROL,
+ MII_CNTL_F100 | MII_CNTL_AUTO | MII_CNTL_RST_AUTO); // | MII_CNTL_FDX);
mdelay(1);
/* set up LEDs to correct display */
@@ -299,9 +288,9 @@
mii_data = mdio_read(dev, aup->phy_addr, MII_STATUS);
if (mii_data & MII_STAT_LINK) {
*link = 1;
- mii_data = mdio_read(dev, aup->phy_addr, MII_LSI_STAT);
- if (mii_data & MII_LSI_STAT_SPD) {
- if (mii_data & MII_LSI_STAT_FDX) {
+ mii_data = mdio_read(dev, aup->phy_addr, MII_LSI_PHY_STAT);
+ if (mii_data & MII_LSI_PHY_STAT_SPD) {
+ if (mii_data & MII_LSI_PHY_STAT_FDX) {
*speed = IF_PORT_100BASEFX;
dev->if_port = IF_PORT_100BASEFX;
}
@@ -342,12 +331,303 @@
return 0;
}
+int am79c874_init(struct net_device *dev, int phy_addr)
+{
+ s16 data;
+
+ /* 79c874 has quit resembled bit assignments to BCM5201 */
+ if (au1000_debug > 4)
+ printk("am79c847_init\n");
+
+ /* Stop auto-negotiation */
+ data = mdio_read(dev, phy_addr, MII_CONTROL);
+ mdio_write(dev, phy_addr, MII_CONTROL, data & ~MII_CNTL_AUTO);
+
+ /* Set advertisement to 10/100 and Half/Full duplex
+ * (full capabilities) */
+ data = mdio_read(dev, phy_addr, MII_ANADV);
+ data |= MII_NWAY_TX | MII_NWAY_TX_FDX | MII_NWAY_T_FDX | MII_NWAY_T;
+ mdio_write(dev, phy_addr, MII_ANADV, data);
+
+ /* Restart auto-negotiation */
+ data = mdio_read(dev, phy_addr, MII_CONTROL);
+ data |= MII_CNTL_RST_AUTO | MII_CNTL_AUTO;
+
+ mdio_write(dev, phy_addr, MII_CONTROL, data);
+
+ if (au1000_debug > 4) dump_mii(dev, phy_addr);
+ return 0;
+}
+
+int am79c874_reset(struct net_device *dev, int phy_addr)
+{
+ s16 mii_control, timeout;
+
+ if (au1000_debug > 4)
+ printk("am79c874_reset\n");
+
+ mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
+ mdio_write(dev, phy_addr, MII_CONTROL, mii_control | MII_CNTL_RESET);
+ mdelay(1);
+ for (timeout = 100; timeout > 0; --timeout) {
+ mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
+ if ((mii_control & MII_CNTL_RESET) == 0)
+ break;
+ mdelay(1);
+ }
+ if (mii_control & MII_CNTL_RESET) {
+ printk(KERN_ERR "%s PHY reset timeout !\n", dev->name);
+ return -1;
+ }
+ return 0;
+}
+
+int
+am79c874_status(struct net_device *dev, int phy_addr, u16 *link, u16 *speed)
+{
+ u16 mii_data;
+ struct au1000_private *aup;
+
+ // printk("am79c874_status\n");
+ if (!dev) {
+ printk(KERN_ERR "am79c874_status error: NULL dev\n");
+ return -1;
+ }
+
+ aup = (struct au1000_private *) dev->priv;
+ mii_data = mdio_read(dev, aup->phy_addr, MII_STATUS);
+
+ if (mii_data & MII_STAT_LINK) {
+ *link = 1;
+ mii_data = mdio_read(dev, aup->phy_addr, MII_AMD_PHY_STAT);
+ if (mii_data & MII_AMD_PHY_STAT_SPD) {
+ if (mii_data & MII_AMD_PHY_STAT_FDX) {
+ *speed = IF_PORT_100BASEFX;
+ dev->if_port = IF_PORT_100BASEFX;
+ }
+ else {
+ *speed = IF_PORT_100BASETX;
+ dev->if_port = IF_PORT_100BASETX;
+ }
+ }
+ else {
+ *speed = IF_PORT_10BASET;
+ dev->if_port = IF_PORT_10BASET;
+ }
+
+ }
+ else {
+ *link = 0;
+ *speed = 0;
+ dev->if_port = IF_PORT_UNKNOWN;
+ }
+ return 0;
+}
+
+int lxt971a_init(struct net_device *dev, int phy_addr)
+{
+ if (au1000_debug > 4)
+ printk("lxt971a_init\n");
+
+ /* restart auto-negotiation */
+ mdio_write(dev, phy_addr, MII_CONTROL,
+ MII_CNTL_F100 | MII_CNTL_AUTO | MII_CNTL_RST_AUTO | MII_CNTL_FDX);
+
+ /* set up LEDs to correct display */
+ mdio_write(dev, phy_addr, 20, 0x0422);
+
+ if (au1000_debug > 4)
+ dump_mii(dev, phy_addr);
+ return 0;
+}
+
+int lxt971a_reset(struct net_device *dev, int phy_addr)
+{
+ s16 mii_control, timeout;
+
+ if (au1000_debug > 4) {
+ printk("lxt971a_reset\n");
+ dump_mii(dev, phy_addr);
+ }
+
+ mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
+ mdio_write(dev, phy_addr, MII_CONTROL, mii_control | MII_CNTL_RESET);
+ mdelay(1);
+ for (timeout = 100; timeout > 0; --timeout) {
+ mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
+ if ((mii_control & MII_CNTL_RESET) == 0)
+ break;
+ mdelay(1);
+ }
+ if (mii_control & MII_CNTL_RESET) {
+ printk(KERN_ERR "%s PHY reset timeout !\n", dev->name);
+ return -1;
+ }
+ return 0;
+}
+
+int
+lxt971a_status(struct net_device *dev, int phy_addr, u16 *link, u16 *speed)
+{
+ u16 mii_data;
+ struct au1000_private *aup;
+
+ if (!dev) {
+ printk(KERN_ERR "lxt971a_status error: NULL dev\n");
+ return -1;
+ }
+ aup = (struct au1000_private *) dev->priv;
+
+ mii_data = mdio_read(dev, aup->phy_addr, MII_STATUS);
+ if (mii_data & MII_STAT_LINK) {
+ *link = 1;
+ mii_data = mdio_read(dev, aup->phy_addr, MII_INTEL_PHY_STAT);
+ if (mii_data & MII_INTEL_PHY_STAT_SPD) {
+ if (mii_data & MII_INTEL_PHY_STAT_FDX) {
+ *speed = IF_PORT_100BASEFX;
+ dev->if_port = IF_PORT_100BASEFX;
+ }
+ else {
+ *speed = IF_PORT_100BASETX;
+ dev->if_port = IF_PORT_100BASETX;
+ }
+ }
+ else {
+ *speed = IF_PORT_10BASET;
+ dev->if_port = IF_PORT_10BASET;
+ }
+
+ }
+ else {
+ *link = 0;
+ *speed = 0;
+ dev->if_port = IF_PORT_UNKNOWN;
+ }
+ return 0;
+}
+
+int ks8995m_init(struct net_device *dev, int phy_addr)
+{
+ s16 data;
+
+// printk("ks8995m_init\n");
+ /* Stop auto-negotiation */
+ data = mdio_read(dev, phy_addr, MII_CONTROL);
+ mdio_write(dev, phy_addr, MII_CONTROL, data & ~MII_CNTL_AUTO);
+
+ /* Set advertisement to 10/100 and Half/Full duplex
+ * (full capabilities) */
+ data = mdio_read(dev, phy_addr, MII_ANADV);
+ data |= MII_NWAY_TX | MII_NWAY_TX_FDX | MII_NWAY_T_FDX | MII_NWAY_T;
+ mdio_write(dev, phy_addr, MII_ANADV, data);
+
+ /* Restart auto-negotiation */
+ data = mdio_read(dev, phy_addr, MII_CONTROL);
+ data |= MII_CNTL_RST_AUTO | MII_CNTL_AUTO;
+ mdio_write(dev, phy_addr, MII_CONTROL, data);
+
+ if (au1000_debug > 4) dump_mii(dev, phy_addr);
+
+ return 0;
+}
+
+int ks8995m_reset(struct net_device *dev, int phy_addr)
+{
+ s16 mii_control, timeout;
+
+// printk("ks8995m_reset\n");
+ mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
+ mdio_write(dev, phy_addr, MII_CONTROL, mii_control | MII_CNTL_RESET);
+ mdelay(1);
+ for (timeout = 100; timeout > 0; --timeout) {
+ mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
+ if ((mii_control & MII_CNTL_RESET) == 0)
+ break;
+ mdelay(1);
+ }
+ if (mii_control & MII_CNTL_RESET) {
+ printk(KERN_ERR "%s PHY reset timeout !\n", dev->name);
+ return -1;
+ }
+ return 0;
+}
+
+int ks8995m_status(struct net_device *dev, int phy_addr, u16 *link, u16 *speed)
+{
+ u16 mii_data;
+ struct au1000_private *aup;
+
+ if (!dev) {
+ printk(KERN_ERR "ks8995m_status error: NULL dev\n");
+ return -1;
+ }
+ aup = (struct au1000_private *) dev->priv;
+
+ mii_data = mdio_read(dev, aup->phy_addr, MII_STATUS);
+ if (mii_data & MII_STAT_LINK) {
+ *link = 1;
+ mii_data = mdio_read(dev, aup->phy_addr, MII_AUX_CNTRL);
+ if (mii_data & MII_AUX_100) {
+ if (mii_data & MII_AUX_FDX) {
+ *speed = IF_PORT_100BASEFX;
+ dev->if_port = IF_PORT_100BASEFX;
+ }
+ else {
+ *speed = IF_PORT_100BASETX;
+ dev->if_port = IF_PORT_100BASETX;
+ }
+ }
+ else {
+ *speed = IF_PORT_10BASET;
+ dev->if_port = IF_PORT_10BASET;
+ }
+
+ }
+ else {
+ *link = 0;
+ *speed = 0;
+ dev->if_port = IF_PORT_UNKNOWN;
+ }
+ return 0;
+}
+
+#ifdef CONFIG_MIPS_BOSPORUS
+int stub_init(struct net_device *dev, int phy_addr)
+{
+ //printk("PHY stub_init\n");
+ return 0;
+}
+
+int stub_reset(struct net_device *dev, int phy_addr)
+{
+ //printk("PHY stub_reset\n");
+ return 0;
+}
+
+int
+stub_status(struct net_device *dev, int phy_addr, u16 *link, u16 *speed)
+{
+ //printk("PHY stub_status\n");
+ *link = 1;
+ /* hmmm, revisit */
+ *speed = IF_PORT_100BASEFX;
+ dev->if_port = IF_PORT_100BASEFX;
+ return 0;
+}
+#endif
+
struct phy_ops bcm_5201_ops = {
bcm_5201_init,
bcm_5201_reset,
bcm_5201_status,
};
+struct phy_ops am79c874_ops = {
+ am79c874_init,
+ am79c874_reset,
+ am79c874_status,
+};
+
struct phy_ops am79c901_ops = {
am79c901_init,
am79c901_reset,
@@ -360,26 +640,82 @@
lsi_80227_status,
};
+struct phy_ops lxt971a_ops = {
+ lxt971a_init,
+ lxt971a_reset,
+ lxt971a_status,
+};
+
+struct phy_ops ks8995m_ops = {
+ ks8995m_init,
+ ks8995m_reset,
+ ks8995m_status,
+};
+
+#ifdef CONFIG_MIPS_BOSPORUS
+struct phy_ops stub_ops = {
+ stub_init,
+ stub_reset,
+ stub_status,
+};
+#endif
+
static struct mii_chip_info {
const char * name;
u16 phy_id0;
u16 phy_id1;
struct phy_ops *phy_ops;
+ int dual_phy;
} mii_chip_table[] = {
- {"Broadcom BCM5201 10/100 BaseT PHY", 0x0040, 0x6212, &bcm_5201_ops },
- {"AMD 79C901 HomePNA PHY", 0x0000, 0x35c8, &am79c901_ops },
- {"LSI 80227 10/100 BaseT PHY", 0x0016, 0xf840, &lsi_80227_ops },
- {"Broadcom BCM5221 10/100 BaseT PHY", 0x0040, 0x61e4, &bcm_5201_ops },
+ {"Broadcom BCM5201 10/100 BaseT PHY",0x0040,0x6212, &bcm_5201_ops,0},
+ {"Broadcom BCM5221 10/100 BaseT PHY",0x0040,0x61e4, &bcm_5201_ops,0},
+ {"Broadcom BCM5222 10/100 BaseT PHY",0x0040,0x6322, &bcm_5201_ops,1},
+ {"AMD 79C901 HomePNA PHY",0x0000,0x35c8, &am79c901_ops,0},
+ {"AMD 79C874 10/100 BaseT PHY",0x0022,0x561b, &am79c874_ops,0},
+ {"LSI 80227 10/100 BaseT PHY",0x0016,0xf840, &lsi_80227_ops,0},
+ {"Intel LXT971A Dual Speed PHY",0x0013,0x78e2, &lxt971a_ops,0},
+ {"Kendin KS8995M 10/100 BaseT PHY",0x0022,0x1450, &ks8995m_ops,0},
+#ifdef CONFIG_MIPS_BOSPORUS
+ {"Stub", 0x1234, 0x5678, &stub_ops },
+#endif
{0,},
};
static int mdio_read(struct net_device *dev, int phy_id, int reg)
{
struct au1000_private *aup = (struct au1000_private *) dev->priv;
+ volatile u32 *mii_control_reg;
+ volatile u32 *mii_data_reg;
u32 timedout = 20;
u32 mii_control;
- while (aup->mac->mii_control & MAC_MII_BUSY) {
+ #ifdef CONFIG_BCM5222_DUAL_PHY
+ /* First time we probe, it's for the mac0 phy.
+ * Since we haven't determined yet that we have a dual phy,
+ * aup->mii->mii_control_reg won't be setup and we'll
+ * default to the else statement.
+ * By the time we probe for the mac1 phy, the mii_control_reg
+ * will be setup to be the address of the mac0 phy control since
+ * both phys are controlled through mac0.
+ */
+ if (aup->mii && aup->mii->mii_control_reg) {
+ mii_control_reg = aup->mii->mii_control_reg;
+ mii_data_reg = aup->mii->mii_data_reg;
+ }
+ else if (au_macs[0]->mii && au_macs[0]->mii->mii_control_reg) {
+ /* assume both phys are controlled through mac0 */
+ mii_control_reg = au_macs[0]->mii->mii_control_reg;
+ mii_data_reg = au_macs[0]->mii->mii_data_reg;
+ }
+ else
+ #endif
+ {
+ /* default control and data reg addresses */
+ mii_control_reg = &aup->mac->mii_control;
+ mii_data_reg = &aup->mac->mii_data;
+ }
+
+ while (*mii_control_reg & MAC_MII_BUSY) {
mdelay(1);
if (--timedout == 0) {
printk(KERN_ERR "%s: read_MII busy timeout!!\n",
@@ -391,10 +727,10 @@
mii_control = MAC_SET_MII_SELECT_REG(reg) |
MAC_SET_MII_SELECT_PHY(phy_id) | MAC_MII_READ;
- aup->mac->mii_control = mii_control;
+ *mii_control_reg = mii_control;
timedout = 20;
- while (aup->mac->mii_control & MAC_MII_BUSY) {
+ while (*mii_control_reg & MAC_MII_BUSY) {
mdelay(1);
if (--timedout == 0) {
printk(KERN_ERR "%s: mdio_read busy timeout!!\n",
@@ -402,16 +738,36 @@
return -1;
}
}
- return (int)aup->mac->mii_data;
+ return (int)*mii_data_reg;
}
static void mdio_write(struct net_device *dev, int phy_id, int reg, u16 value)
{
struct au1000_private *aup = (struct au1000_private *) dev->priv;
+ volatile u32 *mii_control_reg;
+ volatile u32 *mii_data_reg;
u32 timedout = 20;
u32 mii_control;
- while (aup->mac->mii_control & MAC_MII_BUSY) {
+ #ifdef CONFIG_BCM5222_DUAL_PHY
+ if (aup->mii && aup->mii->mii_control_reg) {
+ mii_control_reg = aup->mii->mii_control_reg;
+ mii_data_reg = aup->mii->mii_data_reg;
+ }
+ else if (au_macs[0]->mii && au_macs[0]->mii->mii_control_reg) {
+ /* assume both phys are controlled through mac0 */
+ mii_control_reg = au_macs[0]->mii->mii_control_reg;
+ mii_data_reg = au_macs[0]->mii->mii_data_reg;
+ }
+ else
+ #endif
+ {
+ /* default control and data reg addresses */
+ mii_control_reg = &aup->mac->mii_control;
+ mii_data_reg = &aup->mac->mii_data;
+ }
+
+ while (*mii_control_reg & MAC_MII_BUSY) {
mdelay(1);
if (--timedout == 0) {
printk(KERN_ERR "%s: mdio_write busy timeout!!\n",
@@ -423,8 +779,8 @@
mii_control = MAC_SET_MII_SELECT_REG(reg) |
MAC_SET_MII_SELECT_PHY(phy_id) | MAC_MII_WRITE;
- aup->mac->mii_data = value;
- aup->mac->mii_control = mii_control;
+ *mii_data_reg = value;
+ *mii_control_reg = mii_control;
}
@@ -442,12 +798,13 @@
}
}
-static int __init mii_probe (struct net_device * dev)
+static int mii_probe (struct net_device * dev)
{
struct au1000_private *aup = (struct au1000_private *) dev->priv;
int phy_addr;
-
- aup->mii = NULL;
+#ifdef CONFIG_MIPS_BOSPORUS
+ int phy_found=0;
+#endif
/* search for total of 32 possible mii phy addresses */
for (phy_addr = 0; phy_addr < 32; phy_addr++) {
@@ -455,6 +812,14 @@
u16 phy_id0, phy_id1;
int i;
+ #ifdef CONFIG_BCM5222_DUAL_PHY
+ /* Mask the already found phy, try next one */
+ if (au_macs[0]->mii && au_macs[0]->mii->mii_control_reg) {
+ if (au_macs[0]->phy_addr == phy_addr)
+ continue;
+ }
+ #endif
+
mii_status = mdio_read(dev, phy_addr, MII_STATUS);
if (mii_status == 0xffff || mii_status == 0x0000)
/* the mii is not accessable, try next one */
@@ -467,6 +832,65 @@
for (i = 0; mii_chip_table[i].phy_id1; i++) {
if (phy_id0 == mii_chip_table[i].phy_id0 &&
phy_id1 == mii_chip_table[i].phy_id1) {
+ struct mii_phy * mii_phy = aup->mii;
+
+ printk(KERN_INFO "%s: %s at phy address %d\n",
+ dev->name, mii_chip_table[i].name,
+ phy_addr);
+#ifdef CONFIG_MIPS_BOSPORUS
+ phy_found = 1;
+#endif
+ mii_phy->chip_info = mii_chip_table+i;
+ aup->phy_addr = phy_addr;
+ aup->phy_ops = mii_chip_table[i].phy_ops;
+ aup->phy_ops->phy_init(dev,phy_addr);
+
+ // Check for dual-phy and then store required
+ // values and set indicators. We need to do
+ // this now since mdio_{read,write} need the
+ // control and data register addresses.
+ #ifdef CONFIG_BCM5222_DUAL_PHY
+ if ( mii_chip_table[i].dual_phy) {
+
+ /* assume both phys are controlled
+ * through MAC0. Board specific? */
+
+ /* sanity check */
+ if (!au_macs[0] || !au_macs[0]->mii)
+ return -1;
+ aup->mii->mii_control_reg = (u32 *)
+ &au_macs[0]->mac->mii_control;
+ aup->mii->mii_data_reg = (u32 *)
+ &au_macs[0]->mac->mii_data;
+ }
+ #endif
+ goto found;
+ }
+ }
+ }
+found:
+
+#ifdef CONFIG_MIPS_BOSPORUS
+ /* This is a workaround for the Micrel/Kendin 5 port switch
+ The second MAC doesn't see a PHY connected... so we need to
+ trick it into thinking we have one.
+
+ If this kernel is run on another Au1500 development board
+ the stub will be found as well as the actual PHY. However,
+ the last found PHY will be used... usually at Addr 31 (Db1500).
+ */
+ if ( (!phy_found) )
+ {
+ u16 phy_id0, phy_id1;
+ int i;
+
+ phy_id0 = 0x1234;
+ phy_id1 = 0x5678;
+
+ /* search our mii table for the current mii */
+ for (i = 0; mii_chip_table[i].phy_id1; i++) {
+ if (phy_id0 == mii_chip_table[i].phy_id0 &&
+ phy_id1 == mii_chip_table[i].phy_id1) {
struct mii_phy * mii_phy;
printk(KERN_INFO "%s: %s at phy address %d\n",
@@ -476,31 +900,39 @@
GFP_KERNEL);
if (mii_phy) {
mii_phy->chip_info = mii_chip_table+i;
- mii_phy->phy_addr = phy_addr;
+ aup->phy_addr = phy_addr;
mii_phy->next = aup->mii;
aup->phy_ops =
mii_chip_table[i].phy_ops;
aup->mii = mii_phy;
aup->phy_ops->phy_init(dev,phy_addr);
} else {
- printk(KERN_ERR "%s: out of memory\n",
+ printk(KERN_ERR "%s: out of memory\n",
dev->name);
return -1;
}
- /* the current mii is on our mii_info_table,
- try next address */
+ mii_phy->chip_info = mii_chip_table+i;
+ aup->phy_addr = phy_addr;
+ aup->phy_ops = mii_chip_table[i].phy_ops;
+ aup->phy_ops->phy_init(dev,phy_addr);
break;
}
}
}
+ if (aup->mac_id == 0) {
+ /* the Bosporus phy responds to addresses 0-5 but
+ * 5 is the correct one.
+ */
+ aup->phy_addr = 5;
+ }
+#endif
if (aup->mii == NULL) {
- printk(KERN_ERR "%s: No MII transceivers found!\n", dev->name);
+ printk(KERN_ERR "%s: Au1x No MII transceivers found!\n",
+ dev->name);
return -1;
}
- /* use last PHY */
- aup->phy_addr = aup->mii->phy_addr;
printk(KERN_INFO "%s: Using %s as default\n",
dev->name, aup->mii->chip_info->name);
@@ -521,7 +953,6 @@
if (pDB) {
aup->pDBfree = pDB->pnext;
}
- //printk("GetFreeDB: %x\n", pDB);
return pDB;
}
@@ -587,6 +1018,7 @@
static void reset_mac(struct net_device *dev)
{
+ int i;
u32 flags;
struct au1000_private *aup = (struct au1000_private *) dev->priv;
@@ -597,11 +1029,27 @@
spin_lock_irqsave(&aup->lock, flags);
del_timer(&aup->timer);
hard_stop(dev);
- *aup->enable = MAC_EN_CLOCK_ENABLE;
- au_sync_delay(2);
- *aup->enable = 0;
- au_sync_delay(2);
+ #ifdef CONFIG_BCM5222_DUAL_PHY
+ if (aup->mac_id != 0) {
+ #endif
+ /* If BCM5222, we can't leave MAC0 in reset because then
+ * we can't access the dual phy for ETH1 */
+ *aup->enable = MAC_EN_CLOCK_ENABLE;
+ au_sync_delay(2);
+ *aup->enable = 0;
+ au_sync_delay(2);
+ #ifdef CONFIG_BCM5222_DUAL_PHY
+ }
+ #endif
aup->tx_full = 0;
+ for (i = 0; i < NUM_RX_DMA; i++) {
+ /* reset control bits */
+ aup->rx_dma_ring[i]->buff_stat &= ~0xf;
+ }
+ for (i = 0; i < NUM_TX_DMA; i++) {
+ /* reset control bits */
+ aup->tx_dma_ring[i]->buff_stat &= ~0xf;
+ }
spin_unlock_irqrestore(&aup->lock, flags);
}
@@ -616,95 +1064,110 @@
{
int i;
- for (i=0; i<NUM_RX_DMA; i++) {
+ for (i = 0; i < NUM_RX_DMA; i++) {
aup->rx_dma_ring[i] =
(volatile rx_dma_t *) (rx_base + sizeof(rx_dma_t)*i);
}
- for (i=0; i<NUM_TX_DMA; i++) {
+ for (i = 0; i < NUM_TX_DMA; i++) {
aup->tx_dma_ring[i] =
(volatile tx_dma_t *) (tx_base + sizeof(tx_dma_t)*i);
}
}
+static struct {
+ int port;
+ u32 base_addr;
+ int irq;
+ struct net_device *dev;
+} iflist[2];
+
+static int num_ifs;
+
+/*
+ * Setup the base address and interupt of the Au1xxx ethernet macs
+ * based on cpu type and whether the interface is enabled in sys_pinfunc
+ * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
+ */
static int __init au1000_init_module(void)
{
- int i;
- int prid;
- int base_addr, irq;
-
- prid = read_32bit_cp0_register(CP0_PRID);
- for (i=0; i<NUM_INTERFACES; i++) {
- if ( (prid & 0xffff0000) == 0x00030000 ) {
- base_addr = au1000_iflist[i].port;
- irq = au1000_iflist[i].irq;
- } else if ( (prid & 0xffff0000) == 0x01030000 ) {
- base_addr = au1500_iflist[i].port;
- irq = au1500_iflist[i].irq;
- } else if ( (prid & 0xffff0000) == 0x02030000 ) {
- base_addr = au1100_iflist[i].port;
- irq = au1100_iflist[i].irq;
- } else {
- printk(KERN_ERR "au1000 eth: unknown Processor ID\n");
- return -ENODEV;
- }
- // check for valid entries, au1100 only has one entry
- if (base_addr && irq) {
- if (au1000_probe1(NULL, base_addr, irq, i) != 0) {
- return -ENODEV;
- }
+ struct cpuinfo_mips *c = ¤t_cpu_data;
+ int ni = (int)((au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4);
+ struct net_device *dev;
+ int i, found_one = 0;
+
+ iflist[0].irq = AU1000_ETH0_IRQ;
+ iflist[1].irq = AU1000_ETH1_IRQ;
+ switch (c->cputype) {
+ case CPU_AU1000:
+ num_ifs = 2 - ni;
+ iflist[0].base_addr = AU1000_ETH0_BASE;
+ iflist[1].base_addr = AU1000_ETH1_BASE;
+ break;
+ case CPU_AU1100:
+ num_ifs = 1 - ni;
+ iflist[0].base_addr = AU1000_ETH0_BASE;
+ break;
+ case CPU_AU1500:
+ num_ifs = 2 - ni;
+ iflist[0].base_addr = AU1500_ETH0_BASE;
+ iflist[1].base_addr = AU1500_ETH1_BASE;
+ break;
+ default:
+ num_ifs = 0;
}
+ for(i = 0; i < num_ifs; i++) {
+ dev = au1000_probe(iflist[i].base_addr, iflist[i].irq, i);
+ iflist[i].dev = dev;
+ if (dev)
+ found_one++;
}
+ if (!found_one)
+ return -ENODEV;
return 0;
}
-static int __init
-au1000_probe1(struct net_device *dev, long ioaddr, int irq, int port_num)
+static struct net_device *
+au1000_probe(u32 ioaddr, int irq, int port_num)
{
static unsigned version_printed = 0;
struct au1000_private *aup = NULL;
- int i, retval = 0;
+ struct net_device *dev = NULL;
db_dest_t *pDB, *pDBfree;
char *pmac, *argptr;
char ethaddr[6];
+ int i, err;
- if (!request_region(ioaddr, MAC_IOSIZE, "Au1000 ENET")) {
- return -ENODEV;
- }
+ if (!request_region(ioaddr, MAC_IOSIZE, "Au1x00 ENET"))
+ return NULL;
- if (version_printed++ == 0) printk(version);
+ if (version_printed++ == 0)
+ printk(version);
+ dev = alloc_etherdev(sizeof(struct au1000_private));
if (!dev) {
- dev = init_etherdev(0, sizeof(struct au1000_private));
+ printk (KERN_ERR "au1000 eth: alloc_etherdev failed\n");
+ return NULL;
}
- if (!dev) {
- printk (KERN_ERR "au1000 eth: init_etherdev failed\n");
- return -ENODEV;
+
+ if ((err = register_netdev(dev))) {
+ printk(KERN_ERR "Au1x_eth Cannot register net device err %d\n",
+ err);
+ kfree(dev);
+ return NULL;
}
- printk("%s: Au1xxx ethernet found at 0x%lx, irq %d\n",
+ printk("%s: Au1x Ethernet found at 0x%x, irq %d\n",
dev->name, ioaddr, irq);
- /* Initialize our private structure */
- if (dev->priv == NULL) {
- aup = (struct au1000_private *)
- kmalloc(sizeof(*aup), GFP_KERNEL);
- if (aup == NULL) {
- retval = -ENOMEM;
- goto free_region;
- }
- dev->priv = aup;
- }
-
aup = dev->priv;
- memset(aup, 0, sizeof(*aup));
-
/* Allocate the data buffers */
aup->vaddr = (u32)dma_alloc(MAX_BUF_SIZE *
(NUM_TX_BUFFS+NUM_RX_BUFFS), &aup->dma_addr);
if (!aup->vaddr) {
- retval = -ENOMEM;
- goto free_region;
+ kfree(dev);
+ release_region(ioaddr, MAC_IOSIZE);
+ return NULL;
}
/* aup->mac is the base address of the MAC's registers */
@@ -737,7 +1200,10 @@
((unsigned long)AU1500_MAC0_ENABLE);
memcpy(dev->dev_addr, au1000_mac_addr, sizeof(dev->dev_addr));
setup_hw_rings(aup, MAC0_RX_DMA_ADDR, MAC0_TX_DMA_ADDR);
+ aup->mac_id = 0;
+ au_macs[0] = aup;
break;
+
case AU1000_ETH1_BASE:
case AU1500_ETH1_BASE:
if (ioaddr == AU1000_ETH1_BASE)
@@ -749,15 +1215,16 @@
memcpy(dev->dev_addr, au1000_mac_addr, sizeof(dev->dev_addr));
dev->dev_addr[4] += 0x10;
setup_hw_rings(aup, MAC1_RX_DMA_ADDR, MAC1_TX_DMA_ADDR);
+ aup->mac_id = 1;
+ au_macs[1] = aup;
break;
+
default:
printk(KERN_ERR "%s: bad ioaddr\n", dev->name);
break;
}
- aup->phy_addr = PHY_ADDRESS;
-
/* bring the device out of reset, otherwise probing the mii
* will hang */
*aup->enable = MAC_EN_CLOCK_ENABLE;
@@ -766,14 +1233,22 @@
MAC_EN_RESET2 | MAC_EN_CLOCK_ENABLE;
au_sync_delay(2);
+ aup->mii = kmalloc(sizeof(struct mii_phy), GFP_KERNEL);
+ if (!aup->mii) {
+ printk(KERN_ERR "%s: out of memory\n", dev->name);
+ goto err_out;
+ }
+ aup->mii->mii_control_reg = 0;
+ aup->mii->mii_data_reg = 0;
+
if (mii_probe(dev) != 0) {
- goto free_region;
+ goto err_out;
}
pDBfree = NULL;
/* setup the data buffer descriptors and attach a buffer to each one */
pDB = aup->db;
- for (i=0; i<(NUM_TX_BUFFS+NUM_RX_BUFFS); i++) {
+ for (i = 0; i < (NUM_TX_BUFFS+NUM_RX_BUFFS); i++) {
pDB->pnext = pDBfree;
pDBfree = pDB;
pDB->vaddr = (u32 *)((unsigned)aup->vaddr + MAX_BUF_SIZE*i);
@@ -782,15 +1257,19 @@
}
aup->pDBfree = pDBfree;
- for (i=0; i<NUM_RX_DMA; i++) {
+ for (i = 0; i < NUM_RX_DMA; i++) {
pDB = GetFreeDB(aup);
- if (!pDB) goto free_region;
+ if (!pDB) {
+ goto err_out;
+ }
aup->rx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
aup->rx_db_inuse[i] = pDB;
}
- for (i=0; i<NUM_TX_DMA; i++) {
+ for (i = 0; i < NUM_TX_DMA; i++) {
pDB = GetFreeDB(aup);
- if (!pDB) goto free_region;
+ if (!pDB) {
+ goto err_out;
+ }
aup->tx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
aup->tx_dma_ring[i]->len = 0;
aup->tx_db_inuse[i] = pDB;
@@ -809,32 +1288,36 @@
dev->tx_timeout = au1000_tx_timeout;
dev->watchdog_timeo = ETH_TX_TIMEOUT;
-
- /* Fill in the fields of the device structure with ethernet values. */
- ether_setup(dev);
-
/*
* The boot code uses the ethernet controller, so reset it to start
* fresh. au1000_init() expects that the device is in reset state.
*/
reset_mac(dev);
- return 0;
-free_region:
- release_region(ioaddr, MAC_IOSIZE);
+ return dev;
+
+err_out:
+ /* here we should have a valid dev plus aup-> register addresses
+ * so we can reset the mac properly.*/
+ reset_mac(dev);
+ if (aup->mii)
+ kfree(aup->mii);
+ for (i = 0; i < NUM_RX_DMA; i++) {
+ if (aup->rx_db_inuse[i])
+ ReleaseDB(aup, aup->rx_db_inuse[i]);
+ }
+ for (i = 0; i < NUM_TX_DMA; i++) {
+ if (aup->tx_db_inuse[i])
+ ReleaseDB(aup, aup->tx_db_inuse[i]);
+ }
+ dma_free((void *)aup->vaddr, MAX_BUF_SIZE *
+ (NUM_TX_BUFFS+NUM_RX_BUFFS));
unregister_netdev(dev);
- if (aup->vaddr)
- dma_free((void *)aup->vaddr,
- MAX_BUF_SIZE * (NUM_TX_BUFFS+NUM_RX_BUFFS));
- if (dev->priv != NULL)
- kfree(dev->priv);
- printk(KERN_ERR "%s: au1000_probe1 failed. Returns %d\n",
- dev->name, retval);
kfree(dev);
- return retval;
+ release_region(ioaddr, MAC_IOSIZE);
+ return NULL;
}
-
/*
* Initialize the interface.
*
@@ -852,7 +1335,8 @@
u32 control;
u16 link, speed;
- if (au1000_debug > 4) printk("%s: au1000_init\n", dev->name);
+ if (au1000_debug > 4)
+ printk("%s: au1000_init\n", dev->name);
spin_lock_irqsave(&aup->lock, flags);
@@ -872,7 +1356,7 @@
aup->mac->mac_addr_low = dev->dev_addr[3]<<24 | dev->dev_addr[2]<<16 |
dev->dev_addr[1]<<8 | dev->dev_addr[0];
- for (i=0; i<NUM_RX_DMA; i++) {
+ for (i = 0; i < NUM_RX_DMA; i++) {
aup->rx_dma_ring[i]->buff_stat |= RX_DMA_ENABLE;
}
au_sync();
@@ -992,24 +1476,48 @@
if (au1000_debug > 4)
printk("%s: close: dev=%p\n", dev->name, dev);
+ reset_mac(dev);
+
spin_lock_irqsave(&aup->lock, flags);
/* stop the device */
- if (netif_device_present(dev)) {
- netif_stop_queue(dev);
- }
+ netif_stop_queue(dev);
/* disable the interrupt */
free_irq(dev->irq, dev);
spin_unlock_irqrestore(&aup->lock, flags);
- reset_mac(dev);
MOD_DEC_USE_COUNT;
return 0;
}
static void __exit au1000_cleanup_module(void)
{
+ int i, j;
+ struct net_device *dev;
+ struct au1000_private *aup;
+
+ for (i = 0; i < num_ifs; i++) {
+ dev = iflist[i].dev;
+ if (dev) {
+ aup = (struct au1000_private *) dev->priv;
+ unregister_netdev(dev);
+ if (aup->mii)
+ kfree(aup->mii);
+ for (j = 0; j < NUM_RX_DMA; j++) {
+ if (aup->rx_db_inuse[j])
+ ReleaseDB(aup, aup->rx_db_inuse[j]);
+ }
+ for (j = 0; j < NUM_TX_DMA; j++) {
+ if (aup->tx_db_inuse[j])
+ ReleaseDB(aup, aup->tx_db_inuse[j]);
+ }
+ dma_free((void *)aup->vaddr, MAX_BUF_SIZE *
+ (NUM_TX_BUFFS+NUM_RX_BUFFS));
+ kfree(dev);
+ release_region(iflist[i].base_addr, MAC_IOSIZE);
+ }
+ }
}
@@ -1081,7 +1589,7 @@
db_dest_t *pDB;
int i;
- if (au1000_debug > 4)
+ if (au1000_debug > 5)
printk("%s: tx: aup %x len=%d, data=%p, head %d\n",
dev->name, (unsigned)aup, skb->len,
skb->data, aup->tx_head);
@@ -1106,11 +1614,11 @@
pDB = aup->tx_db_inuse[aup->tx_head];
memcpy((void *)pDB->vaddr, skb->data, skb->len);
- if (skb->len < MAC_MIN_PKT_SIZE) {
- for (i=skb->len; i<MAC_MIN_PKT_SIZE; i++) {
+ if (skb->len < ETH_ZLEN) {
+ for (i=skb->len; i<ETH_ZLEN; i++) {
((char *)pDB->vaddr)[i] = 0;
}
- ptxd->len = MAC_MIN_PKT_SIZE;
+ ptxd->len = ETH_ZLEN;
}
else
ptxd->len = skb->len;
@@ -1159,8 +1667,9 @@
volatile rx_dma_t *prxd;
u32 buff_stat, status;
db_dest_t *pDB;
+ u32 frmlen;
- if (au1000_debug > 4)
+ if (au1000_debug > 5)
printk("%s: au1000_rx head %d\n", dev->name, aup->rx_head);
prxd = aup->rx_dma_ring[aup->rx_head];
@@ -1172,7 +1681,9 @@
if (!(status & RX_ERROR)) {
/* good frame */
- skb = dev_alloc_skb((status & RX_FRAME_LEN_MASK) + 2);
+ frmlen = (status & RX_FRAME_LEN_MASK);
+ frmlen -= 4; /* Remove FCS */
+ skb = dev_alloc_skb(frmlen + 2);
if (skb == NULL) {
printk(KERN_ERR
"%s: Memory squeeze, dropping packet.\n",
@@ -1182,9 +1693,9 @@
}
skb->dev = dev;
skb_reserve(skb, 2); /* 16 byte IP header align */
- eth_copy_and_sum(skb, (unsigned char *)pDB->vaddr,
- status & RX_FRAME_LEN_MASK, 0);
- skb_put(skb, status & RX_FRAME_LEN_MASK);
+ eth_copy_and_sum(skb,
+ (unsigned char *)pDB->vaddr, frmlen, 0);
+ skb_put(skb, frmlen);
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb); /* pass the packet to upper layers */
}
@@ -1236,8 +1747,11 @@
printk(KERN_ERR "%s: isr: null dev ptr\n", dev->name);
return;
}
- au1000_tx_ack(dev);
+
+ /* Handle RX interrupts first to minimize chance of overrun */
+
au1000_rx(dev);
+ au1000_tx_ack(dev);
}
@@ -1250,6 +1764,8 @@
printk(KERN_ERR "%s: au1000_tx_timeout: dev=%p\n", dev->name, dev);
reset_mac(dev);
au1000_init(dev);
+ dev->trans_start = jiffies;
+ netif_wake_queue(dev);
}
@@ -1305,27 +1821,19 @@
static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
- u16 *data = (u16 *)&rq->ifr_data;
+ //u16 *data = (u16 *)&rq->ifr_data;
/* fixme */
- switch (cmd) {
- case SIOCGMIIPHY: /* Get the address of the PHY in use. */
- case SIOCDEVPRIVATE: /* binary compat, remove in 2.5 */
- data[0] = PHY_ADDRESS;
-
- case SIOCGMIIREG: /* Read the specified MII register. */
- case SIOCDEVPRIVATE+1: /* binary compat, remove in 2.5 */
+ switch(cmd) {
+ case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */
+ //data[0] = PHY_ADDRESS;
+ case SIOCDEVPRIVATE+1: /* Read the specified MII register. */
//data[3] = mdio_read(ioaddr, data[0], data[1]);
return 0;
-
- case SIOCSMIIREG: /* Write the specified MII register */
- case SIOCDEVPRIVATE+2: /* binary compat, remove in 2.5 */
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
+ case SIOCDEVPRIVATE+2: /* Write the specified MII register */
//mdio_write(ioaddr, data[0], data[1], data[2]);
return 0;
-
- default:
+ default:
return -EOPNOTSUPP;
}
}
@@ -1389,7 +1897,6 @@
/* set Speed to 100Mbps, Half Duplex */
/* disable auto negotiation and enable 100MBit Mode */
control = mdio_read(dev, aup->phy_addr, MII_CONTROL);
- printk("read control %x\n", control);
control &= ~(MII_CNTL_AUTO | MII_CNTL_FDX);
control |= MII_CNTL_F100;
mdio_write(dev, aup->phy_addr, MII_CONTROL, control);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/au1000_eth.h linux-2.4.22/drivers/net/au1000_eth.h
--- linux-2.4.22.clean/drivers/net/au1000_eth.h 2002-11-29 00:53:13.000000000 +0100
+++ linux-2.4.22/drivers/net/au1000_eth.h 2003-06-05 02:00:35.000000000 +0200
@@ -1,10 +1,13 @@
/*
- * Alchemy Semi Au1000 ethernet driver include file
+ *
+ * Alchemy Au1x00 ethernet driver include file
*
* Author: Pete Popov <ppopov@mvista.com>
*
* Copyright 2001 MontaVista Software Inc.
*
+ * ########################################################################
+ *
* This program is free software; you can distribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation.
@@ -17,14 +20,16 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * ########################################################################
+ *
+ *
*/
-#include <linux/config.h>
-#define NUM_INTERFACES 2
#define MAC_IOSIZE 0x10000
-#define NUM_RX_DMA 4 /* Au1000 has 4 rx hardware descriptors */
-#define NUM_TX_DMA 4 /* Au1000 has 4 tx hardware descriptors */
+#define NUM_RX_DMA 4 /* Au1x00 has 4 rx hardware descriptors */
+#define NUM_TX_DMA 4 /* Au1x00 has 4 tx hardware descriptors */
#define NUM_RX_BUFFS 4
#define NUM_TX_BUFFS 4
@@ -33,12 +38,6 @@
#define ETH_TX_TIMEOUT HZ/4
#define MAC_MIN_PKT_SIZE 64
-#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1100)
-#define PHY_ADDRESS 0
-#define PHY_CONTROL_DEFAULT 0x3000
-#define PHY_CONTROL_REG_ADDR 0
-#endif
-
#define MULTICAST_FILTER_LIMIT 64
/* FIXME
@@ -54,11 +53,13 @@
#define MII_ANLPAR 0x0005
#define MII_AEXP 0x0006
#define MII_ANEXT 0x0007
-#define MII_LSI_CONFIG 0x0011
-#define MII_LSI_STAT 0x0012
-#define MII_AUX_CNTRL 0x0018
-#define MII_INT 0x001A
+#define MII_LSI_PHY_CONFIG 0x0011
+/* Status register */
+#define MII_LSI_PHY_STAT 0x0012
+#define MII_AMD_PHY_STAT MII_LSI_PHY_STAT
+#define MII_INTEL_PHY_STAT 0x0011
+#define MII_AUX_CNTRL 0x0018
/* mii registers specific to AMD 79C901 */
#define MII_STATUS_SUMMARY = 0x0018
@@ -121,23 +122,30 @@
#define MII_STSSUM_AUTO 0x0002
#define MII_STSSUM_SPD 0x0001
-/* lsi status register */
-
-#define MII_LSI_STAT_FDX 0x0040
-#define MII_LSI_STAT_SPD 0x0080
+/* lsi phy status register */
+#define MII_LSI_PHY_STAT_FDX 0x0040
+#define MII_LSI_PHY_STAT_SPD 0x0080
+
+/* amd phy status register */
+#define MII_AMD_PHY_STAT_FDX 0x0800
+#define MII_AMD_PHY_STAT_SPD 0x0400
+
+/* intel phy status register */
+#define MII_INTEL_PHY_STAT_FDX 0x0200
+#define MII_INTEL_PHY_STAT_SPD 0x4000
/* Auxilliary Control/Status Register */
#define MII_AUX_FDX 0x0001
#define MII_AUX_100 0x0002
#define MII_AUX_F100 0x0004
#define MII_AUX_ANEG 0x0008
-#define MII_FDX_LED 0x8000
typedef struct mii_phy {
struct mii_phy * next;
struct mii_chip_info * chip_info;
- int phy_addr;
u16 status;
+ u32 *mii_control_reg;
+ u32 *mii_data_reg;
} mii_phy_t;
struct phy_ops {
@@ -204,6 +212,7 @@
u32 tx_tail;
u32 tx_full;
+ int mac_id;
mii_phy_t *mii;
struct phy_ops *phy_ops;
@@ -217,7 +226,7 @@
u8 *hash_table;
u32 hash_mode;
u32 intr_work_done; /* number of Rx and Tx pkts processed in the isr */
- u32 phy_addr; /* PHY address */
+ int phy_addr; /* phy address */
u32 options; /* User-settable misc. driver options. */
u32 drv_flags;
struct net_device_stats stats;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/Config.in linux-2.4.22/drivers/net/Config.in
--- linux-2.4.22.clean/drivers/net/Config.in 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/net/Config.in 2003-09-27 14:08:03.000000000 +0200
@@ -62,18 +62,18 @@
if [ "$CONFIG_MIPS_GT96100" = "y" ]; then
bool ' MIPS GT96100 Ethernet support' CONFIG_MIPS_GT96100ETH
fi
- if [ "$CONFIG_MIPS_AU1000" = "y" ]; then
- bool ' MIPS AU1000 Ethernet support' CONFIG_MIPS_AU1000_ENET
+ if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
+ tristate ' MIPS Au1x00 Ethernet support' CONFIG_MIPS_AU1X00_ENET
+ if [ "$CONFIG_MIPS_AU1X00_ENET" = "y" ]; then
+ bool ' Broadcom 5222 Dual Phy Support' CONFIG_BCM5222_DUAL_PHY
+ fi
fi
- if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
+ if [ "$CONFIG_SIBYTE_SB1xxx_SOC" = "y" ]; then
tristate ' SB1250 Ethernet support' CONFIG_NET_SB1250_MAC
fi
if [ "$CONFIG_SGI_IP27" = "y" ]; then
bool ' SGI IOC3 Ethernet' CONFIG_SGI_IOC3_ETH
fi
- if [ "$CONFIG_SGI_IP32" = "y" ]; then
- tristate ' SGI O2 MACE Fast Ethernet support' CONFIG_SGI_O2MACE_ETH
- fi
if [ "$CONFIG_IA64_SGI_SN1" = "y" ]; then
bool ' SGI IOC3 Ethernet' CONFIG_SGI_IOC3_ETH
fi
@@ -211,7 +211,7 @@
tristate ' TI ThunderLAN support' CONFIG_TLAN
fi
if [ "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then
- dep_tristate ' TOSHIBA TC35815 Ethernet support' CONFIG_TC35815 $CONFIG_PCI
+ dep_tristate ' TOSHIBA TC35815 Ethernet support' CONFIG_TC35815 $CONFIG_PCI
fi
dep_tristate ' VIA Rhine support' CONFIG_VIA_RHINE $CONFIG_PCI
dep_mbool ' Use MMIO instead of PIO (EXPERIMENTAL)' CONFIG_VIA_RHINE_MMIO $CONFIG_VIA_RHINE $CONFIG_EXPERIMENTAL
@@ -232,11 +232,14 @@
dep_tristate ' D-Link DE620 pocket adapter support' CONFIG_DE620 $CONFIG_ISA
fi
if [ "$CONFIG_SGI_IP22" = "y" ]; then
- bool ' SGI Seeq ethernet controller support' CONFIG_SGISEEQ
+ tristate ' SGI Seeq ethernet controller support' CONFIG_SGISEEQ
fi
if [ "$CONFIG_DECSTATION" = "y" ]; then
tristate ' DEC LANCE ethernet controller support' CONFIG_DECLANCE
fi
+ if [ "$CONFIG_DECSTATION" = "y" ]; then
+ tristate ' PMAD-AA TC ethernet controller support' CONFIG_PMADAA
+ fi
if [ "$CONFIG_BAGET_MIPS" = "y" ]; then
tristate ' Baget AMD LANCE support' CONFIG_BAGETLANCE
fi
@@ -271,6 +274,12 @@
dep_tristate 'SysKonnect SK-98xx and SK-95xx Gigabit Ethernet Adapter family support' CONFIG_SK98LIN $CONFIG_PCI
dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI
+if [ "$CONFIG_MOMENCO_OCELOT_C" = "y" -o "$CONFIG_MOMENCO_JAGUAR_ATX" = "y" ]; then
+ bool ' MV-64340 Ethernet support' CONFIG_MV64340_ETH
+ dep_bool ' MV-64340 Port 0' CONFIG_MV64340_ETH_0 $CONFIG_MV64340_ETH
+ dep_bool ' MV-64340 Port 1' CONFIG_MV64340_ETH_1 $CONFIG_MV64340_ETH
+ dep_bool ' MV-64340 Port 2' CONFIG_MV64340_ETH_2 $CONFIG_MV64340_ETH
+fi
endmenu
if [ "$CONFIG_PPC_ISERIES" = "y" ]; then
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/de4x5.c linux-2.4.22/drivers/net/de4x5.c
--- linux-2.4.22.clean/drivers/net/de4x5.c 2003-06-13 16:51:34.000000000 +0200
+++ linux-2.4.22/drivers/net/de4x5.c 2003-02-25 23:03:07.000000000 +0100
@@ -999,7 +999,7 @@
static void srom_repair(struct net_device *dev, int card);
static int test_bad_enet(struct net_device *dev, int status);
static int an_exception(struct de4x5_bus_type *lp);
-#if !defined(__sparc_v9__) && !defined(__powerpc__) && !defined(__alpha__)
+#ifdef CONFIG_EISA
static void eisa_probe(struct net_device *dev, u_long iobase);
#endif
static void pci_probe(struct net_device *dev, u_long iobase);
@@ -1053,7 +1053,7 @@
#endif /* MODULE */
static char name[DE4X5_NAME_LENGTH + 1];
-#if !defined(__sparc_v9__) && !defined(__powerpc__) && !defined(__alpha__)
+#ifdef CONFIG_EISA
static u_char de4x5_irq[] = EISA_ALLOWED_IRQ_LIST;
static int lastEISA;
# ifdef DE4X5_FORCE_EISA /* Force an EISA bus probe or not */
@@ -1131,7 +1131,7 @@
u_long iobase = dev->base_addr;
pci_probe(dev, iobase);
-#if !defined(__sparc_v9__) && !defined(__powerpc__) && !defined(__alpha__)
+#ifdef CONFIG_EISA
if ((lastPCI == NO_MORE_PCI) && ((num_de4x5s == 0) || forceEISA)) {
eisa_probe(dev, iobase);
}
@@ -2093,7 +2093,7 @@
return;
}
-#if !defined(__sparc_v9__) && !defined(__powerpc__) && !defined(__alpha__)
+#ifdef CONFIG_EISA
/*
** EISA bus I/O device probe. Probe from slot 1 since slot 0 is usually
** the motherboard. Upto 15 EISA devices are supported.
@@ -5363,7 +5363,7 @@
t = *q;
*q = '\0';
-#if !defined(__sparc_v9__) && !defined(__powerpc__) && !defined(__alpha__)
+#ifdef CONFIG_EISA
if (strstr(p, "force_eisa") || strstr(p, "FORCE_EISA")) forceEISA = 1;
#endif
if (strstr(p, "fdx") || strstr(p, "FDX")) lp->params.fdx = 1;
@@ -5865,7 +5865,7 @@
u_int class = DE4X5_CLASS_CODE;
u_int device;
-#if !defined(__sparc_v9__) && !defined(__powerpc__) && !defined(__alpha__)
+#ifdef CONFIG_EISA
char name[DE4X5_STRLEN];
u_long iobase = 0x1000;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/declance.c linux-2.4.22/drivers/net/declance.c
--- linux-2.4.22.clean/drivers/net/declance.c 2003-06-13 16:51:34.000000000 +0200
+++ linux-2.4.22/drivers/net/declance.c 2003-09-21 03:01:50.000000000 +0200
@@ -5,7 +5,7 @@
*
* adopted from sunlance.c by Richard van den Berg
*
- * Copyright (C) 2002 Maciej W. Rozycki
+ * Copyright (C) 2002, 2003 Maciej W. Rozycki
*
* additional sources:
* - PMAD-AA TURBOchannel Ethernet Module Functional Specification,
@@ -52,6 +52,7 @@
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/spinlock.h>
#include <linux/stddef.h>
#include <linux/string.h>
@@ -271,7 +272,7 @@
lp->tx_old - lp->tx_new-1)
/* The lance control ports are at an absolute address, machine and tc-slot
- * dependant.
+ * dependent.
* DECstations do only 32-bit access and the LANCE uses 16 bit addresses,
* so we have to give the structure an extra member making rap pointing
* at the right address
@@ -783,19 +784,29 @@
/* Associate IRQ with lance_interrupt */
if (request_irq(dev->irq, &lance_interrupt, 0, "lance", dev)) {
- printk("lance: Can't get IRQ %d\n", dev->irq);
+ printk("%s: Can't get IRQ %d\n", dev->name, dev->irq);
return -EAGAIN;
}
if (lp->dma_irq >= 0) {
+ unsigned long flags;
+
if (request_irq(lp->dma_irq, &lance_dma_merr_int, 0,
"lance error", dev)) {
free_irq(dev->irq, dev);
- printk("lance: Can't get DMA IRQ %d\n", lp->dma_irq);
+ printk("%s: Can't get DMA IRQ %d\n", dev->name,
+ lp->dma_irq);
return -EAGAIN;
}
+
+ spin_lock_irqsave(&ioasic_ssr_lock, flags);
+
+ fast_mb();
/* Enable I/O ASIC LANCE DMA. */
- fast_wmb();
- ioasic_write(SSR, ioasic_read(SSR) | LANCE_DMA_EN);
+ ioasic_write(IO_REG_SSR,
+ ioasic_read(IO_REG_SSR) | IO_SSR_LANCE_DMA_EN);
+
+ fast_mb();
+ spin_unlock_irqrestore(&ioasic_ssr_lock, flags);
}
status = init_restart_lance(lp);
@@ -821,9 +832,18 @@
writereg(&ll->rdp, LE_C0_STOP);
if (lp->dma_irq >= 0) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&ioasic_ssr_lock, flags);
+
+ fast_mb();
/* Disable I/O ASIC LANCE DMA. */
- ioasic_write(SSR, ioasic_read(SSR) & ~LANCE_DMA_EN);
+ ioasic_write(IO_REG_SSR,
+ ioasic_read(IO_REG_SSR) & ~IO_SSR_LANCE_DMA_EN);
+
fast_iob();
+ spin_unlock_irqrestore(&ioasic_ssr_lock, flags);
+
free_irq(lp->dma_irq, dev);
}
free_irq(dev->irq, dev);
@@ -856,8 +876,8 @@
volatile struct lance_regs *ll = lp->ll;
printk(KERN_ERR "%s: transmit timed out, status %04x, reset\n",
- dev->name, ll->rdp);
- lance_reset(dev);
+ dev->name, ll->rdp);
+ lance_reset(dev);
netif_wake_queue(dev);
}
@@ -872,10 +892,9 @@
len = skblen;
- if(len < ETH_ZLEN)
- {
+ if (len < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
- if(skb == NULL)
+ if (skb == NULL)
return 0;
len = ETH_ZLEN;
}
@@ -890,7 +909,7 @@
skblen);
/* Clear the slack of the packet, do I need this? */
- /* For a firewall its a good idea - AC */
+ /* For a firewall it's a good idea - AC */
/*
if (len != skblen)
memset ((char *) &ib->tx_buf [entry][skblen], 0, (len - skblen) << 1);
@@ -927,7 +946,7 @@
volatile u16 *mcast_table = (u16 *) & ib->filter;
struct dev_mc_list *dmi = dev->mc_list;
char *addrs;
- int i, j, bit, byte;
+ int i;
u32 crc;
/* set all multicast bits */
@@ -1005,6 +1024,8 @@
static int __init dec_lance_init(const int type, const int slot)
{
static unsigned version_printed;
+ static const char fmt[] = "declance%d";
+ char name[10];
struct net_device *dev;
struct lance_private *lp;
volatile struct lance_regs *ll;
@@ -1019,13 +1040,26 @@
if (dec_lance_debug && version_printed++ == 0)
printk(version);
- dev = init_etherdev(NULL, sizeof(struct lance_private));
- if (!dev)
- return -ENOMEM;
+ i = 0;
+ dev = root_lance_dev;
+ while (dev) {
+ i++;
+ lp = (struct lance_private *)dev->priv;
+ dev = lp->next;
+ }
+ snprintf(name, sizeof(name), fmt, i);
+
+ dev = alloc_etherdev(sizeof(struct lance_private));
+ if (!dev) {
+ printk(KERN_ERR "%s: Unable to allocate etherdev, aborting.\n",
+ name);
+ ret = -ENOMEM;
+ goto err_out;
+ }
SET_MODULE_OWNER(dev);
/*
- * init_etherdev ensures the data structures used by the LANCE
+ * alloc_etherdev ensures the data structures used by the LANCE
* are aligned.
*/
lp = (struct lance_private *) dev->priv;
@@ -1036,7 +1070,7 @@
switch (type) {
#ifdef CONFIG_TC
case ASIC_LANCE:
- dev->base_addr = system_base + LANCE;
+ dev->base_addr = system_base + IOASIC_LANCE;
/* buffer space for the on-board LANCE shared memory */
/*
@@ -1045,7 +1079,7 @@
dev->mem_start = KSEG1ADDR(0x00020000);
dev->mem_end = dev->mem_start + 0x00020000;
dev->irq = dec_interrupt[DEC_IRQ_LANCE];
- esar_base = system_base + ESAR;
+ esar_base = system_base + IOASIC_ESAR;
/* Workaround crash with booting KN04 2.1k from Disk */
memset((void *)dev->mem_start, 0,
@@ -1074,7 +1108,8 @@
/* Setup I/O ASIC LANCE DMA. */
lp->dma_irq = dec_interrupt[DEC_IRQ_LANCE_MERR];
- ioasic_write(LANCE_DMA_P, PHYSADDR(dev->mem_start) << 3);
+ ioasic_write(IO_REG_LANCE_DMA_P,
+ PHYSADDR(dev->mem_start) << 3);
break;
@@ -1139,9 +1174,10 @@
break;
default:
- printk("declance_init called with unknown type\n");
+ printk(KERN_ERR "%s: declance_init called with unknown type\n",
+ name);
ret = -ENODEV;
- goto err_out;
+ goto err_out_free_dev;
}
ll = (struct lance_regs *) dev->base_addr;
@@ -1151,19 +1187,21 @@
/* First, check for test pattern */
if (esar[0x60] != 0xff && esar[0x64] != 0x00 &&
esar[0x68] != 0x55 && esar[0x6c] != 0xaa) {
- printk("Ethernet station address prom not found!\n");
+ printk(KERN_ERR
+ "%s: Ethernet station address prom not found!\n",
+ name);
ret = -ENODEV;
- goto err_out;
+ goto err_out_free_dev;
}
/* Check the prom contents */
for (i = 0; i < 8; i++) {
if (esar[i * 4] != esar[0x3c - i * 4] &&
esar[i * 4] != esar[0x40 + i * 4] &&
esar[0x3c - i * 4] != esar[0x40 + i * 4]) {
- printk("Something is wrong with the ethernet "
- "station address prom!\n");
+ printk(KERN_ERR "%s: Something is wrong with the "
+ "ethernet station address prom!\n", name);
ret = -ENODEV;
- goto err_out;
+ goto err_out_free_dev;
}
}
@@ -1176,13 +1214,13 @@
*/
switch (type) {
case ASIC_LANCE:
- printk("%s: IOASIC onboard LANCE, addr = ", dev->name);
+ printk("%s: IOASIC onboard LANCE, addr = ", name);
break;
case PMAD_LANCE:
- printk("%s: PMAD-AA, addr = ", dev->name);
+ printk("%s: PMAD-AA, addr = ", name);
break;
case PMAX_LANCE:
- printk("%s: PMAX onboard LANCE, addr = ", dev->name);
+ printk("%s: PMAX onboard LANCE, addr = ", name);
break;
}
for (i = 0; i < 6; i++) {
@@ -1219,11 +1257,20 @@
lp->multicast_timer.data = (unsigned long) dev;
lp->multicast_timer.function = &lance_set_multicast_retry;
+ ret = register_netdev(dev);
+ if (ret) {
+ printk(KERN_ERR
+ "%s: Unable to register netdev, aborting.\n", name);
+ goto err_out_free_dev;
+ }
+
+ printk("%s: registered as %s.\n", name, dev->name);
return 0;
-err_out:
- unregister_netdev(dev);
+err_out_free_dev:
kfree(dev);
+
+err_out:
return ret;
}
@@ -1233,6 +1280,9 @@
{
int count = 0;
+#if 0
+ /* We use this driver for the onboard LANCE only */
+
/* Scan slots for PMAD-AA cards first. */
#ifdef CONFIG_TC
if (TURBOCHANNEL) {
@@ -1245,6 +1295,7 @@
}
}
#endif
+#endif
/* Then handle onboard devices. */
if (dec_interrupt[DEC_IRQ_LANCE] >= 0) {
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/gt96100eth.c linux-2.4.22/drivers/net/gt96100eth.c
--- linux-2.4.22.clean/drivers/net/gt96100eth.c 2002-11-29 00:53:13.000000000 +0100
+++ linux-2.4.22/drivers/net/gt96100eth.c 2003-07-05 15:17:04.000000000 +0200
@@ -700,7 +700,8 @@
struct net_device *dev = NULL;
if (gtif->irq < 0) {
- printk(KERN_ERR "%s: irq unknown - probing not supported\n", __FUNCTION_);
+ printk(KERN_ERR "%s: irq unknown - probing not supported\n",
+ __FUNCTION__);
return -ENODEV;
}
@@ -1363,7 +1364,8 @@
gp->tx_full = 0;
if (gp->last_psr & psrLink) {
netif_wake_queue(dev);
- dbg(2, "%s: Tx Ring was full, queue waked\n", __FUNCTION_);
+ dbg(2, "%s: Tx Ring was full, queue waked\n",
+ __FUNCTION__);
}
}
@@ -1444,7 +1446,7 @@
if ((psr & psrLink) && !gp->tx_full &&
netif_queue_stopped(dev)) {
dbg(0, ": Link up, waking queue.\n",
- __FUNCTION_);
+ __FUNCTION__);
netif_wake_queue(dev);
} else if (!(psr & psrLink) &&
!netif_queue_stopped(dev)) {
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/ioc3-eth.c linux-2.4.22/drivers/net/ioc3-eth.c
--- linux-2.4.22.clean/drivers/net/ioc3-eth.c 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/net/ioc3-eth.c 2003-09-27 14:08:05.000000000 +0200
@@ -377,82 +377,6 @@
ip->dev->dev_addr[i - 2] = nic[i];
}
-#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_SGI_SN2)
-/*
- * Get the ether-address on SN1 nodes
- */
-static void ioc3_get_eaddr_sn(struct ioc3_private *ip)
-{
- int ibrick_mac_addr_get(nasid_t, char *);
- struct ioc3 *ioc3 = ip->regs;
- nasid_t nasid_of_ioc3;
- char io7eaddr[20];
- long mac;
- int err_val;
-
- /*
- * err_val = ibrick_mac_addr_get(get_nasid(), io7eaddr );
- *
- * BAD!! The above call uses get_nasid() and assumes that
- * the ioc3 pointed to by struct ioc3 is hooked up to the
- * cbrick that we're running on. The proper way to make this call
- * is to figure out which nasid the ioc3 is connected to
- * and use that to call ibrick_mac_addr_get. Below is
- * a hack to do just that.
- */
-
- /*
- * Get the nasid of the ioc3 from the ioc3's base addr.
- * FIXME: the 8 at the end assumes we're in memory mode,
- * not node mode (for that, we'd change it to a 9).
- * Is there a call to extract this info from a physical
- * addr somewhere in an sn header file already? If so,
- * we should probably use that, or restructure this routine
- * to use pci_dev and generic numa nodeid getting stuff.
- */
- nasid_of_ioc3 = (((unsigned long)ioc3 >> 33) & ~(-1 << 8));
- err_val = ibrick_mac_addr_get(nasid_of_ioc3, io7eaddr );
-
-
- if (err_val) {
- /* Couldn't read the eeprom; try OSLoadOptions. */
- printk("WARNING: ibrick_mac_addr_get failed: %d\n", err_val);
-
- /* this is where we hardwire the mac address
- * 1st ibrick had 08:00:69:11:34:75
- * 2nd ibrick had 08:00:69:11:35:35
- *
- * Eagan Machines:
- * mankato1 08:00:69:11:BE:95
- * warroad 08:00:69:11:bd:60
- * duron 08:00:69:11:34:60
- *
- * an easy way to get the mac address is to hook
- * up an ip35, then from L1 do 'cti serial'
- * and then look for MAC line XXX THIS DOESN"T QUITE WORK!!
- */
- printk("ioc3_get_eaddr: setting ethernet address to:\n -----> ");
- ip->dev->dev_addr[0] = 0x8;
- ip->dev->dev_addr[1] = 0x0;
- ip->dev->dev_addr[2] = 0x69;
- ip->dev->dev_addr[3] = 0x11;
- ip->dev->dev_addr[4] = 0x34;
- ip->dev->dev_addr[5] = 0x60;
- }
- else {
- long simple_strtol(const char *,char **,unsigned int);
-
- mac = simple_strtol(io7eaddr, (char **)0, 16);
- ip->dev->dev_addr[0] = (mac >> 40) & 0xff;
- ip->dev->dev_addr[1] = (mac >> 32) & 0xff;
- ip->dev->dev_addr[2] = (mac >> 24) & 0xff;
- ip->dev->dev_addr[3] = (mac >> 16) & 0xff;
- ip->dev->dev_addr[4] = (mac >> 8) & 0xff;
- ip->dev->dev_addr[5] = mac & 0xff;
- }
-}
-#endif
-
/*
* Ok, this is hosed by design. It's necessary to know what machine the
* NIC is in in order to know how to read the NIC address. We also have
@@ -460,30 +384,15 @@
*/
static void ioc3_get_eaddr(struct ioc3_private *ip)
{
- void (*do_get_eaddr)(struct ioc3_private *ip) = NULL;
int i;
- /*
- * We should also use this code for PCI cards, no matter what host
- * machine but how to know that we're a PCI card?
- */
-#ifdef CONFIG_SGI_IP27
- do_get_eaddr = ioc3_get_eaddr_nic;
-#endif
-#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_SGI_SN2)
- do_get_eaddr = ioc3_get_eaddr_sn;
-#endif
- if (!do_get_eaddr) {
- printk(KERN_ERR "Don't know how to read MAC address of this "
- "IOC3 NIC\n");
- return;
- }
+ ioc3_get_eaddr_nic(ip);
printk("Ethernet address is ");
for (i = 0; i < 6; i++) {
printk("%02x", ip->dev->dev_addr[i]);
- if (i < 7)
+ if (i < 5)
printk(":");
}
printk(".\n");
@@ -588,7 +497,7 @@
ip->stats.rx_frame_errors++;
next:
ip->rx_skbs[n_entry] = new_skb;
- rxr[n_entry] = cpu_to_be32((0xa5UL << 56) |
+ rxr[n_entry] = cpu_to_be64((0xa5UL << 56) |
((unsigned long) rxb & TO_PHYS_MASK));
rxb->w0 = 0; /* Clear valid flag */
n_entry = (n_entry + 1) & 511; /* Update erpir */
@@ -1610,6 +1519,7 @@
struct ioc3_private *ip = dev->priv;
struct ioc3 *ioc3 = ip->regs;
+ unregister_netdev(dev);
iounmap(ioc3);
pci_release_regions(pdev);
kfree(dev);
@@ -1622,10 +1532,10 @@
MODULE_DEVICE_TABLE(pci, ioc3_pci_tbl);
static struct pci_driver ioc3_driver = {
- name: "ioc3-eth",
- id_table: ioc3_pci_tbl,
- probe: ioc3_probe,
- remove: __devexit_p(ioc3_remove_one),
+ .name = "ioc3-eth",
+ .id_table = ioc3_pci_tbl,
+ .probe = ioc3_probe,
+ .remove = __devexit_p(ioc3_remove_one),
};
static int __init ioc3_init_module(void)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/irda/au1k_ir.c linux-2.4.22/drivers/net/irda/au1k_ir.c
--- linux-2.4.22.clean/drivers/net/irda/au1k_ir.c 2002-08-03 02:39:44.000000000 +0200
+++ linux-2.4.22/drivers/net/irda/au1k_ir.c 2003-07-09 22:05:55.000000000 +0200
@@ -46,7 +46,13 @@
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/au1000.h>
+#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100)
#include <asm/pb1000.h>
+#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
+#include <asm/db1x00.h>
+#else
+#error au1k_ir: unsupported board
+#endif
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
@@ -71,10 +77,16 @@
static int qos_mtt_bits = 0x07; /* 1 ms or more */
static struct net_device *ir_devs[NUM_IR_IFF];
static char version[] __devinitdata =
- "au1k_ircc:1.0 ppopov@mvista.com\n";
+ "au1k_ircc:1.2 ppopov@mvista.com\n";
#define RUN_AT(x) (jiffies + (x))
+#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
+static BCSR * const bcsr = (BCSR *)0xAE000000;
+#endif
+
+static spinlock_t ir_lock = SPIN_LOCK_UNLOCKED;
+
/*
* IrDA peripheral bug. You have to read the register
* twice to get the right value.
@@ -126,7 +138,7 @@
if (ret != NULL) {
memset(ret, 0, size);
*dma_handle = virt_to_bus(ret);
- ret = KSEG0ADDR(ret);
+ ret = (void *)KSEG0ADDR(ret);
}
return ret;
}
@@ -134,7 +146,7 @@
static void dma_free(void *vaddr, size_t size)
{
- vaddr = KSEG0ADDR(vaddr);
+ vaddr = (void *)KSEG0ADDR(vaddr);
free_pages((unsigned long) vaddr, get_order(size));
}
@@ -211,7 +223,7 @@
struct au1k_private *aup = NULL;
int i, retval = 0, err;
db_dest_t *pDB, *pDBfree;
- unsigned long temp;
+ dma_addr_t temp;
dev->priv = kmalloc(sizeof(struct au1k_private), GFP_KERNEL);
if (dev->priv == NULL) {
@@ -292,6 +304,14 @@
aup->tx_ring[i]->flags = 0;
aup->tx_db_inuse[i] = pDB;
}
+
+#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
+ /* power on */
+ bcsr->resets &= ~BCSR_RESETS_IRDA_MODE_MASK;
+ bcsr->resets |= BCSR_RESETS_IRDA_MODE_FULL;
+ au_sync();
+#endif
+
return 0;
out:
@@ -532,13 +552,13 @@
flags = ptxd->flags;
if (flags & AU_OWN) {
- printk(KERN_INFO "%s: tx_full\n", dev->name);
+ printk(KERN_DEBUG "%s: tx_full\n", dev->name);
netif_stop_queue(dev);
aup->tx_full = 1;
return 1;
}
else if (((aup->tx_head + 1) & (NUM_IR_DESC - 1)) == aup->tx_tail) {
- printk(KERN_INFO "%s: tx_full\n", dev->name);
+ printk(KERN_DEBUG "%s: tx_full\n", dev->name);
netif_stop_queue(dev);
aup->tx_full = 1;
return 1;
@@ -558,6 +578,7 @@
memcpy((void *)pDB->vaddr, skb->data, skb->len);
ptxd->count_0 = skb->len & 0xff;
ptxd->count_1 = (skb->len >> 8) & 0xff;
+
}
else {
/* SIR */
@@ -565,6 +586,7 @@
ptxd->count_0 = len & 0xff;
ptxd->count_1 = (len >> 8) & 0xff;
ptxd->flags |= IR_DIS_CRC;
+ au_writel(au_readl(0xae00000c) & ~(1<<13), 0xae00000c);
}
ptxd->flags |= AU_OWN;
au_sync();
@@ -699,12 +721,14 @@
u32 control;
int ret = 0, timeout = 10, i;
volatile ring_dest_t *ptxd;
+#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
+ unsigned long irda_resets;
+#endif
if (speed == aup->speed)
return ret;
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&ir_lock, flags);
/* disable PHY first */
writel(read_ir_reg(IR_ENABLE) & ~0x8000, IR_ENABLE);
@@ -745,10 +769,20 @@
ptxd->flags = AU_OWN;
}
- if (speed == 4000000)
+ if (speed == 4000000) {
+#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
+ bcsr->resets |= BCSR_RESETS_FIR_SEL;
+#else /* Pb1000 and Pb1100 */
writel(1<<13, CPLD_AUX1);
- else
+#endif
+ }
+ else {
+#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
+ bcsr->resets &= ~BCSR_RESETS_FIR_SEL;
+#else /* Pb1000 and Pb1100 */
writel(readl(CPLD_AUX1) & ~(1<<13), CPLD_AUX1);
+#endif
+ }
switch (speed) {
case 9600:
@@ -794,18 +828,18 @@
}
else {
if (control & (1<<11))
- printk(KERN_INFO "%s Valid SIR config\n", dev->name);
+ printk(KERN_DEBUG "%s Valid SIR config\n", dev->name);
if (control & (1<<12))
- printk(KERN_INFO "%s Valid MIR config\n", dev->name);
+ printk(KERN_DEBUG "%s Valid MIR config\n", dev->name);
if (control & (1<<13))
- printk(KERN_INFO "%s Valid FIR config\n", dev->name);
+ printk(KERN_DEBUG "%s Valid FIR config\n", dev->name);
if (control & (1<<10))
- printk(KERN_INFO "%s TX enabled\n", dev->name);
+ printk(KERN_DEBUG "%s TX enabled\n", dev->name);
if (control & (1<<9))
- printk(KERN_INFO "%s RX enabled\n", dev->name);
+ printk(KERN_DEBUG "%s RX enabled\n", dev->name);
}
- restore_flags(flags);
+ spin_unlock_irqrestore(&ir_lock, flags);
return ret;
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/Makefile linux-2.4.22/drivers/net/Makefile
--- linux-2.4.22.clean/drivers/net/Makefile 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/net/Makefile 2003-09-29 20:40:26.000000000 +0200
@@ -115,6 +115,7 @@
# end link order section
#
+obj-$(CONFIG_MV64340_ETH) += mv64340_eth.o
obj-$(CONFIG_AIRONET4500) += aironet4500_core.o
obj-$(CONFIG_AIRONET4500_CS) += aironet4500_core.o
obj-$(CONFIG_AIRONET4500_NONCS) += aironet4500_card.o
@@ -175,7 +176,6 @@
obj-$(CONFIG_SUN3LANCE) += sun3lance.o
obj-$(CONFIG_DEFXX) += defxx.o
obj-$(CONFIG_SGISEEQ) += sgiseeq.o
-obj-$(CONFIG_SGI_O2MACE_ETH) += meth.o
obj-$(CONFIG_AT1700) += at1700.o
obj-$(CONFIG_FMV18X) += fmv18x.o
obj-$(CONFIG_EL1) += 3c501.o
@@ -218,7 +218,7 @@
obj-$(CONFIG_EQUALIZER) += eql.o
obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o
obj-$(CONFIG_MIPS_GT96100ETH) += gt96100eth.o
-obj-$(CONFIG_MIPS_AU1000_ENET) += au1000_eth.o
+obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o
obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
obj-$(CONFIG_BAGETLANCE) += bagetlance.o
obj-$(CONFIG_DECLANCE) += declance.o
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/meth.c linux-2.4.22/drivers/net/meth.c
--- linux-2.4.22.clean/drivers/net/meth.c 2002-11-29 00:53:14.000000000 +0100
+++ linux-2.4.22/drivers/net/meth.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,863 +0,0 @@
-/*
- * meth.c -- O2 Builtin 10/100 Ethernet driver
- *
- * Copyright (C) 2001 Ilya Volynets
- *
- * This program 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.
- */
-#include <linux/module.h>
-#include <linux/init.h>
-
-#include <linux/sched.h>
-#include <linux/kernel.h> /* printk() */
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/errno.h> /* error codes */
-#include <linux/types.h> /* size_t */
-#include <linux/interrupt.h> /* mark_bh */
-#include <linux/pci.h>
-
-#include <linux/in.h>
-#include <linux/netdevice.h> /* struct device, and other headers */
-#include <linux/etherdevice.h> /* eth_type_trans */
-#include <linux/ip.h> /* struct iphdr */
-#include <linux/tcp.h> /* struct tcphdr */
-#include <linux/skbuff.h>
-#include <linux/mii.h> /*MII definitions */
-
-#include <asm/ip32/crime.h>
-#include <asm/ip32/mace.h>
-#include <asm/ip32/ip32_ints.h>
-
-#include "meth.h"
-
-#include <linux/in6.h>
-#include <asm/checksum.h>
-
-#ifndef MFE_DEBUG
-#define MFE_DEBUG 0
-#endif
-
-#if MFE_DEBUG>=1
-#define DPRINTK(str,args...) printk (KERN_DEBUG "meth(%ld): %s: " str, jiffies, __FUNCTION__ , ## args)
-#define MFE_RX_DEBUG 2
-#else
-#define DPRINTK(str,args...)
-#define MFE_RX_DEBUG 0
-#endif
-
-
-static const char *version="meth.c: Ilya Volynets (ilya@theIlya.com)";
-static const char *meth_str="SGI O2 Fast Ethernet";
-MODULE_AUTHOR("Ilya Volynets");
-MODULE_DESCRIPTION("SGI O2 Builtin Fast Ethernet driver");
-
-/* This is a load-time options */
-/*static int eth = 0;
-MODULE_PARM(eth, "i");*/
-
-#define HAVE_TX_TIMEOUT
-/* The maximum time waited (in jiffies) before assuming a Tx failed. (400ms) */
-#define TX_TIMEOUT (400*HZ/1000)
-
-#ifdef HAVE_TX_TIMEOUT
-static int timeout = TX_TIMEOUT;
-MODULE_PARM(timeout, "i");
-#endif
-
-int meth_eth;
-
-
-/*
- * This structure is private to each device. It is used to pass
- * packets in and out, so there is place for a packet
- */
-
-typedef struct meth_private {
- struct net_device_stats stats;
- volatile struct meth_regs *regs;
- u64 mode; /* in-memory copy of MAC control register */
- int phy_addr; /* address of phy, used by mdio_* functions, initialized in mdio_probe*/
- tx_packet *tx_ring;
- dma_addr_t tx_ring_dma;
- int free_space;
- struct sk_buff *tx_skbs[TX_RING_ENTRIES];
- dma_addr_t tx_skb_dmas[TX_RING_ENTRIES];
- int tx_read,tx_write;
- int tx_count;
-
- rx_packet *rx_ring[RX_RING_ENTRIES];
- dma_addr_t rx_ring_dmas[RX_RING_ENTRIES];
- int rx_write;
-
- spinlock_t meth_lock;
-} meth_private;
-
-extern struct net_device meth_devs[];
-void meth_tx_timeout (struct net_device *dev);
-void meth_interrupt(int irq, void *dev_id, struct pt_regs *pregs);
-
-/* global, initialized in ip32-setup.c */
-char o2meth_eaddr[8]={0,0,0,0,0,0,0,0};
-
-static inline void load_eaddr(struct net_device *dev,
- volatile struct meth_regs *regs)
-{
- int i;
- DPRINTK("Loading MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
- (int)o2meth_eaddr[0]&0xFF,(int)o2meth_eaddr[1]&0xFF,(int)o2meth_eaddr[2]&0xFF,
- (int)o2meth_eaddr[3]&0xFF,(int)o2meth_eaddr[4]&0xFF,(int)o2meth_eaddr[5]&0xFF);
- //memcpy(dev->dev_addr,o2meth_eaddr+2,6);
- for (i=0; i<6; i++)
- dev->dev_addr[i]=o2meth_eaddr[i];
- regs->mac_addr= //dev->dev_addr[0]|(dev->dev_addr[1]<<8)|
- //dev->dev_addr[2]<<16|(dev->dev_addr[3]<<24)|
- //dev->dev_addr[4]<<32|(dev->dev_addr[5]<<40);
- (*(u64*)o2meth_eaddr)>>16;
- DPRINTK("MAC, finally is %0lx\n",regs->mac_addr);
-}
-
-/*
- *Waits for BUSY status of mdio bus to clear
- */
-#define WAIT_FOR_PHY(___regs, ___rval) \
- while((___rval=___regs->phy_data)&MDIO_BUSY){ \
- udelay(25); \
- }
-/*read phy register, return value read */
-static int mdio_read(meth_private *priv,int phyreg)
-{
- volatile meth_regs* regs=priv->regs;
- volatile u32 rval;
- WAIT_FOR_PHY(regs,rval)
- regs->phy_registers=(priv->phy_addr<<5)|(phyreg&0x1f);
- udelay(25);
- regs->phy_trans_go=1;
- udelay(25);
- WAIT_FOR_PHY(regs,rval)
- return rval&MDIO_DATA_MASK;
-}
-
-/*write phy register */
-static void mdio_write(meth_private* priv,int pfyreg,int val)
-{
- volatile meth_regs* regs=priv->regs;
- int rval;
-/// DPRINTK("Trying to write value %i to reguster %i\n",val, pfyreg);
- spin_lock_irq(&priv->meth_lock);
- WAIT_FOR_PHY(regs,rval)
- regs->phy_registers=(priv->phy_addr<<5)|(pfyreg&0x1f);
- regs->phy_data=val;
- udelay(25);
- WAIT_FOR_PHY(regs,rval)
- spin_unlock_irq(&priv->meth_lock);
-}
-
-/* Modify phy register using given mask and value */
-static void mdio_update(meth_private* priv,int phyreg, int val, int mask)
-{
- int rval;
- DPRINTK("RMW value %i to PHY register %i with mask %i\n",val,phyreg,mask);
- rval=mdio_read(priv,phyreg);
- rval=(rval&~mask)|(val&mask);
- mdio_write(priv,phyreg,rval);
-}
-
-/* handle errata data on MDIO bus */
-//static void mdio_errata(meth_private *priv)
-//{
- /* Hmmm... what the hell is phyerrata? does it come from sys init parameters in IRIX */
-//}
-static int mdio_probe(meth_private *priv)
-{
- int i, p2, p3;
- DPRINTK("Detecting PHY kind\n");
- /* check if phy is detected already */
- if(priv->phy_addr>=0&&priv->phy_addr<32)
- return 0;
- spin_lock_irq(&priv->meth_lock);
- for (i=0;i<32;++i){
- priv->phy_addr=(char)i;
- p2=mdio_read(priv,2);
-#ifdef MFE_DEBUG
- p3=mdio_read(priv,3);
- switch ((p2<<12)|(p3>>4)){
- case PHY_QS6612X:
- DPRINTK("PHY is QS6612X\n");
- break;
- case PHY_ICS1889:
- DPRINTK("PHY is ICS1889\n");
- break;
- case PHY_ICS1890:
- DPRINTK("PHY is ICS1890\n");
- break;
- case PHY_DP83840:
- DPRINTK("PHY is DP83840\n");
- break;
- }
-#endif
- if(p2!=0xffff&&p2!=0x0000){
- DPRINTK("PHY code: %x\n",(p2<<12)|(p3>>4));
- break;
- }
- }
- spin_unlock_irq(&priv->meth_lock);
- if(priv->phy_addr<32) {
- return 0;
- }
- DPRINTK("Oopsie! PHY is not known!\n");
- priv->phy_addr=-1;
- return -ENODEV;
-}
-
-static void meth_check_link(struct net_device *dev)
-{
- struct meth_private *priv = (struct meth_private *) dev->priv;
- int mii_partner = mdio_read(priv, 5);
- int mii_advertising = mdio_read(priv, 4);
- int negotiated = mii_advertising & mii_partner;
- int duplex, speed;
-
- if (mii_partner == 0xffff)
- return;
-
- duplex = ((negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040)?METH_PHY_FDX:0;
- speed = (negotiated & 0x0380)?METH_100MBIT:0;
-
- if ((priv->mode & METH_PHY_FDX) ^ duplex)
- {
- DPRINTK("Setting %s-duplex\n", duplex ? "full" : "half");
- if (duplex)
- priv->mode |= METH_PHY_FDX;
- else
- priv->mode &= ~METH_PHY_FDX;
- priv->regs->mac_ctrl = priv->mode;
- }
-
- if ((priv->mode & METH_100MBIT) ^ speed)
- {
- DPRINTK("Setting %dMbs mode\n", speed ? 100 : 10);
- if (duplex)
- priv->mode |= METH_100MBIT;
- else
- priv->mode &= ~METH_100MBIT;
- priv->regs->mac_ctrl = priv->mode;
- }
-}
-
-
-static int meth_init_tx_ring(meth_private *priv)
-{
- /* Init TX ring */
- DPRINTK("Initializing TX ring\n");
- priv->tx_ring = (tx_packet *) pci_alloc_consistent(NULL,TX_RING_BUFFER_SIZE,&(priv->tx_ring_dma));
- if(!priv->tx_ring)
- return -ENOMEM;
- memset(priv->tx_ring, 0, TX_RING_BUFFER_SIZE);
- priv->tx_count = priv->tx_read = priv->tx_write = 0;
- priv->regs->tx_ring_base = priv->tx_ring_dma;
- priv->free_space = TX_RING_ENTRIES;
- /* Now init skb save area */
- memset(priv->tx_skbs,0,sizeof(priv->tx_skbs));
- memset(priv->tx_skb_dmas,0,sizeof(priv->tx_skb_dmas));
- DPRINTK("Done with TX ring init\n");
- return 0;
-}
-
-static int meth_init_rx_ring(meth_private *priv)
-{
- int i;
- DPRINTK("Initializing RX ring\n");
- for(i=0;i<RX_RING_ENTRIES;i++){
- DPRINTK("\t1:\t%i\t",i);
- /*if(!(priv->rx_ring[i]=get_free_page(GFP_KERNEL)))
- return -ENOMEM;
- DPRINTK("\t2:\t%i\n",i);*/
- priv->rx_ring[i]=(rx_packet*)pci_alloc_consistent(NULL,METH_RX_BUFF_SIZE,&(priv->rx_ring_dmas[i]));
- /* I'll need to re-sync it after each RX */
- DPRINTK("\t%p\n",priv->rx_ring[i]);
- priv->regs->rx_fifo=priv->rx_ring_dmas[i];
- }
- priv->rx_write = 0;
- DPRINTK("Done with RX ring\n");
- return 0;
-}
-static void meth_free_tx_ring(meth_private *priv)
-{
- int i;
-
- /* Remove any pending skb */
- for (i = 0; i < TX_RING_ENTRIES; i++) {
- if (priv->tx_skbs[i])
- dev_kfree_skb(priv->tx_skbs[i]);
- priv->tx_skbs[i] = NULL;
- }
- pci_free_consistent(NULL,
- TX_RING_BUFFER_SIZE,
- priv->tx_ring,
- priv->tx_ring_dma);
-}
-static void meth_free_rx_ring(meth_private *priv)
-{
- int i;
-
- for(i=0;i<RX_RING_ENTRIES;i++)
- pci_free_consistent(NULL,
- METH_RX_BUFF_SIZE,
- priv->rx_ring[i],
- priv->rx_ring_dmas[i]);
-}
-
-int meth_reset(struct net_device *dev)
-{
- struct meth_private *priv = (struct meth_private *) dev->priv;
-
- /* Reset card */
- priv->regs->mac_ctrl = SGI_MAC_RESET;
- priv->regs->mac_ctrl = 0;
- udelay(25);
- DPRINTK("MAC control after reset: %016lx\n", priv->regs->mac_ctrl);
-
- /* Load ethernet address */
- load_eaddr(dev, priv->regs);
- /* Should load some "errata", but later */
-
- /* Check for device */
- if(mdio_probe(priv) < 0) {
- DPRINTK("Unable to find PHY\n");
- return -ENODEV;
- }
-
- /* Initial mode -- 10|Half-duplex|Accept normal packets */
- priv->mode=METH_ACCEPT_MCAST|METH_DEFAULT_IPG;
- if(dev->flags | IFF_PROMISC)
- priv->mode |= METH_PROMISC;
- priv->regs->mac_ctrl = priv->mode;
-
- /* Autonegociate speed and duplex mode */
- meth_check_link(dev);
-
- /* Now set dma control, but don't enable DMA, yet */
- priv->regs->dma_ctrl= (4 << METH_RX_OFFSET_SHIFT) |
- (RX_RING_ENTRIES << METH_RX_DEPTH_SHIFT);
-
- return(0);
-}
-
-/*============End Helper Routines=====================*/
-
-/*
- * Open and close
- */
-
-int meth_open(struct net_device *dev)
-{
- meth_private *priv=dev->priv;
- volatile meth_regs *regs=priv->regs;
-
- MOD_INC_USE_COUNT;
-
- /* Start DMA */
- regs->dma_ctrl|=
- METH_DMA_TX_EN|/*METH_DMA_TX_INT_EN|*/
- METH_DMA_RX_EN|METH_DMA_RX_INT_EN;
-
- if(request_irq(dev->irq,meth_interrupt,SA_SHIRQ,meth_str,dev)){
- printk(KERN_ERR "%s: Can't get irq %d\n", dev->name, dev->irq);
- return -EAGAIN;
- }
- netif_start_queue(dev);
- DPRINTK("Opened... DMA control=0x%08lx\n", regs->dma_ctrl);
- return 0;
-}
-
-int meth_release(struct net_device *dev)
-{
- netif_stop_queue(dev); /* can't transmit any more */
- /* shut down dma */
- ((meth_private*)(dev->priv))->regs->dma_ctrl&=
- ~(METH_DMA_TX_EN|METH_DMA_TX_INT_EN|
- METH_DMA_RX_EN|METH_DMA_RX_INT_EN);
- free_irq(dev->irq, dev);
- MOD_DEC_USE_COUNT;
- return 0;
-}
-
-/*
- * Configuration changes (passed on by ifconfig)
- */
-int meth_config(struct net_device *dev, struct ifmap *map)
-{
- if (dev->flags & IFF_UP) /* can't act on a running interface */
- return -EBUSY;
-
- /* Don't allow changing the I/O address */
- if (map->base_addr != dev->base_addr) {
- printk(KERN_WARNING "meth: Can't change I/O address\n");
- return -EOPNOTSUPP;
- }
-
- /* Allow changing the IRQ */
- if (map->irq != dev->irq) {
- printk(KERN_WARNING "meth: Can't change IRQ\n");
- return -EOPNOTSUPP;
- }
- DPRINTK("Configured\n");
-
- /* ignore other fields */
- return 0;
-}
-
-/*
- * Receive a packet: retrieve, encapsulate and pass over to upper levels
- */
-void meth_rx(struct net_device* dev)
-{
- struct sk_buff *skb;
- struct meth_private *priv = (struct meth_private *) dev->priv;
- rx_packet *rxb;
- DPRINTK("RX...\n");
- // TEMP while((rxb=priv->rx_ring[priv->rx_write])->status.raw&0x8000000000000000){
- while((rxb=priv->rx_ring[priv->rx_write])->status.raw&0x8000000000000000){
- int len=rxb->status.parsed.rx_len - 4; /* omit CRC */
- DPRINTK("(%i)\n",priv->rx_write);
- /* length sanity check */
- if(len < 60 || len > 1518) {
- printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x.\n",
- dev->name, priv->rx_write, rxb->status.raw);
- priv->stats.rx_errors++;
- priv->stats.rx_length_errors++;
- }
- if(!(rxb->status.raw&METH_RX_STATUS_ERRORS)){
- skb=alloc_skb(len+2,GFP_ATOMIC);/* Should be atomic -- we are in interrupt */
- if(!skb){
- /* Ouch! No memory! Drop packet on the floor */
- DPRINTK("!!!>>>Ouch! Not enough Memory for RX buffer!\n");
- priv->stats.rx_dropped++;
- } else {
- skb_reserve(skb, 2); /* align IP on 16B boundary */
- memcpy(skb_put(skb, len), rxb->buf, len);
- /* Write metadata, and then pass to the receive level */
- skb->dev = dev;
- skb->protocol = eth_type_trans(skb, dev);
- //skb->ip_summed = CHECKSUM_UNNECESSARY; /* don't check it */
-
- DPRINTK("passing packet\n");
- DPRINTK("len = %d rxb->status = %x\n",
- len, rxb->status.raw);
- netif_rx(skb);
- dev->last_rx = jiffies;
- priv->stats.rx_packets++;
- priv->stats.rx_bytes+=len;
- DPRINTK("There we go... Whew...\n");
- }
- }
- priv->regs->rx_fifo=priv->rx_ring_dmas[priv->rx_write];
- rxb->status.raw=0;
- priv->rx_write=(priv->rx_write+1)&(RX_RING_ENTRIES-1);
- }
-}
-
-static int meth_tx_full(struct net_device *dev)
-{
- struct meth_private *priv = (struct meth_private *) dev->priv;
-
- return(priv->tx_count >= TX_RING_ENTRIES-1);
-}
-
-void meth_tx_cleanup(struct net_device* dev, int rptr)
-{
- meth_private *priv=dev->priv;
- tx_packet* status;
- struct sk_buff *skb;
-
- spin_lock(&priv->meth_lock);
-
- /* Stop DMA */
- priv->regs->dma_ctrl &= ~(METH_DMA_TX_INT_EN);
-
- while(priv->tx_read != rptr){
- skb = priv->tx_skbs[priv->tx_read];
- status = &priv->tx_ring[priv->tx_read];
- if(!status->header.res.sent)
- break;
- if(status->header.raw & METH_TX_STATUS_DONE) {
- priv->stats.tx_packets++;
- priv->stats.tx_bytes += skb->len;
- }
- dev_kfree_skb_irq(skb);
- priv->tx_skbs[priv->tx_read] = NULL;
- status->header.raw = 0;
- priv->tx_read = (priv->tx_read+1)&(TX_RING_ENTRIES-1);
- priv->tx_count --;
- }
-
- /* wake up queue if it was stopped */
- if (netif_queue_stopped(dev) && ! meth_tx_full(dev)) {
- netif_wake_queue(dev);
- }
-
- spin_unlock(priv->meth_lock);
-}
-
-/*
- * The typical interrupt entry point
- */
-void meth_interrupt(int irq, void *dev_id, struct pt_regs *pregs)
-{
- struct meth_private *priv;
- union {
- u32 reg; /*Whole status register */
- struct {
- u32 : 2,
- rx_seq : 5,
- tx_read : 9,
-
- rx_read : 8,
- int_mask: 8;
- } parsed;
- } status;
- /*
- * As usual, check the "device" pointer for shared handlers.
- * Then assign "struct device *dev"
- */
- struct net_device *dev = (struct net_device *)dev_id;
- /* ... and check with hw if it's really ours */
-
- if (!dev /*paranoid*/ ) return;
-
- /* Lock the device */
- priv = (struct meth_private *) dev->priv;
-
- status.reg = priv->regs->int_flags;
-
- DPRINTK("Interrupt, status %08x...\n",status.reg);
- if (status.parsed.int_mask & METH_INT_RX_THRESHOLD) {
- /* send it to meth_rx for handling */
- meth_rx(dev);
- }
-
- if (status.parsed.int_mask & (METH_INT_TX_EMPTY|METH_INT_TX_PKT)) {
- /* a transmission is over: free the skb */
- meth_tx_cleanup(dev, status.parsed.tx_read);
- }
- /* check for errors too... */
- if (status.parsed.int_mask & (METH_INT_TX_LINK_FAIL))
- printk(KERN_WARNING "meth: link failure\n");
- if (status.parsed.int_mask & (METH_INT_MEM_ERROR))
- printk(KERN_WARNING "meth: memory error\n");
- if (status.parsed.int_mask & (METH_INT_TX_ABORT))
- printk(KERN_WARNING "meth: aborted\n");
- DPRINTK("Interrupt handling done...\n");
-
- priv->regs->int_flags=status.reg&0xff; /* clear interrupts */
-}
-
-/*
- * Transmits packets that fit into TX descriptor (are <=120B)
- */
-static void meth_tx_short_prepare(meth_private* priv, struct sk_buff* skb)
-{
- tx_packet *desc=&priv->tx_ring[priv->tx_write];
- int len = (skb->len<ETH_ZLEN)?ETH_ZLEN:skb->len;
-
- DPRINTK("preparing short packet\n");
- /* maybe I should set whole thing to 0 first... */
- memcpy(desc->data.dt+(120-len),skb->data,skb->len);
- if(skb->len < len)
- memset(desc->data.dt+120-len+skb->len,0,len-skb->len);
- desc->header.raw=METH_TX_CMD_INT_EN|(len-1)|((128-len)<<16);
- DPRINTK("desc=%016lx\n",desc->header.raw);
-}
-#define TX_CATBUF1 BIT(25)
-static void meth_tx_1page_prepare(meth_private* priv, struct sk_buff* skb)
-{
- tx_packet *desc=&priv->tx_ring[priv->tx_write];
- void *buffer_data = (void *)(((u64)skb->data + 7ULL) & (~7ULL));
- int unaligned_len = (int)((u64)buffer_data - (u64)skb->data);
- int buffer_len = skb->len - unaligned_len;
- dma_addr_t catbuf;
-
- DPRINTK("preparing 1 page...\n");
- DPRINTK("length=%d data=%p\n", skb->len, skb->data);
- DPRINTK("unaligned_len=%d\n", unaligned_len);
- DPRINTK("buffer_data=%p buffer_len=%d\n",
- buffer_data,
- buffer_len);
-
- desc->header.raw=METH_TX_CMD_INT_EN|TX_CATBUF1|(skb->len-1);
-
- /* unaligned part */
- if(unaligned_len){
- memcpy(desc->data.dt+(120-unaligned_len),
- skb->data, unaligned_len);
- desc->header.raw |= (128-unaligned_len) << 16;
- }
-
- /* first page */
- catbuf = pci_map_single(NULL,
- buffer_data,
- buffer_len,
- PCI_DMA_TODEVICE);
- DPRINTK("catbuf=%x\n", catbuf);
- desc->data.cat_buf[0].form.start_addr = catbuf >> 3;
- desc->data.cat_buf[0].form.len = buffer_len-1;
- DPRINTK("desc=%016lx\n",desc->header.raw);
- DPRINTK("cat_buf[0].raw=%016lx\n",desc->data.cat_buf[0].raw);
-}
-#define TX_CATBUF2 BIT(26)
-static void meth_tx_2page_prepare(meth_private* priv, struct sk_buff* skb)
-{
- tx_packet *desc=&priv->tx_ring[priv->tx_write];
- void *buffer1_data = (void *)(((u64)skb->data + 7ULL) & (~7ULL));
- void *buffer2_data = (void *)PAGE_ALIGN((u64)skb->data);
- int unaligned_len = (int)((u64)buffer1_data - (u64)skb->data);
- int buffer1_len = (int)((u64)buffer2_data - (u64)buffer1_data);
- int buffer2_len = skb->len - buffer1_len - unaligned_len;
- dma_addr_t catbuf1, catbuf2;
-
- DPRINTK("preparing 2 pages... \n");
- DPRINTK("length=%d data=%p\n", skb->len, skb->data);
- DPRINTK("unaligned_len=%d\n", unaligned_len);
- DPRINTK("buffer1_data=%p buffer1_len=%d\n",
- buffer1_data,
- buffer1_len);
- DPRINTK("buffer2_data=%p buffer2_len=%d\n",
- buffer2_data,
- buffer2_len);
-
- desc->header.raw=METH_TX_CMD_INT_EN|TX_CATBUF1|TX_CATBUF2|(skb->len-1);
- /* unaligned part */
- if(unaligned_len){
- memcpy(desc->data.dt+(120-unaligned_len),
- skb->data, unaligned_len);
- desc->header.raw |= (128-unaligned_len) << 16;
- }
-
- /* first page */
- catbuf1 = pci_map_single(NULL,
- buffer1_data,
- buffer1_len,
- PCI_DMA_TODEVICE);
- DPRINTK("catbuf1=%x\n", catbuf1);
- desc->data.cat_buf[0].form.start_addr = catbuf1 >> 3;
- desc->data.cat_buf[0].form.len = buffer1_len-1;
- /* second page */
- catbuf2 = pci_map_single(NULL,
- buffer2_data,
- buffer2_len,
- PCI_DMA_TODEVICE);
- DPRINTK("catbuf2=%x\n", catbuf2);
- desc->data.cat_buf[1].form.start_addr = catbuf2 >> 3;
- desc->data.cat_buf[1].form.len = buffer2_len-1;
- DPRINTK("desc=%016lx\n",desc->header.raw);
- DPRINTK("cat_buf[0].raw=%016lx\n",desc->data.cat_buf[0].raw);
- DPRINTK("cat_buf[1].raw=%016lx\n",desc->data.cat_buf[1].raw);
-}
-
-
-void meth_add_to_tx_ring(meth_private *priv, struct sk_buff* skb)
-{
- DPRINTK("Transmitting data...\n");
- if(skb->len <= 120) {
- /* Whole packet fits into descriptor */
- meth_tx_short_prepare(priv,skb);
- } else if(PAGE_ALIGN((u64)skb->data) !=
- PAGE_ALIGN((u64)skb->data+skb->len-1)) {
- /* Packet crosses page boundary */
- meth_tx_2page_prepare(priv,skb);
- } else {
- /* Packet is in one page */
- meth_tx_1page_prepare(priv,skb);
- }
-
- /* Remember the skb, so we can free it at interrupt time */
- priv->tx_skbs[priv->tx_write] = skb;
- priv->tx_write = (priv->tx_write+1) & (TX_RING_ENTRIES-1);
- priv->regs->tx_info.wptr = priv->tx_write;
- priv->tx_count ++;
- /* Enable DMA transfer */
- priv->regs->dma_ctrl |= METH_DMA_TX_INT_EN;
-}
-
-/*
- * Transmit a packet (called by the kernel)
- */
-int meth_tx(struct sk_buff *skb, struct net_device *dev)
-{
- struct meth_private *priv = (struct meth_private *) dev->priv;
-
- spin_lock_irq(&priv->meth_lock);
-
- meth_add_to_tx_ring(priv, skb);
- dev->trans_start = jiffies; /* save the timestamp */
-
- /* If TX ring is full, tell the upper layer to stop sending packets */
- if (meth_tx_full(dev)) {
- DPRINTK("TX full: stopping\n");
- netif_stop_queue(dev);
- }
-
- spin_unlock_irq(&priv->meth_lock);
-
- return 0;
-}
-
-/*
- * Deal with a transmit timeout.
- */
-
-void meth_tx_timeout (struct net_device *dev)
-{
- struct meth_private *priv = (struct meth_private *) dev->priv;
-
- printk(KERN_WARNING "%s: transmit timed out\n", dev->name);
-
- /* Protect against concurrent rx interrupts */
- spin_lock_irq(&priv->meth_lock);
-
- /* Try to reset the adaptor. */
- meth_reset(dev);
-
- priv->stats.tx_errors++;
-
- /* Clear all rings */
- meth_free_tx_ring(priv);
- meth_free_rx_ring(priv);
- meth_init_tx_ring(priv);
- meth_init_rx_ring(priv);
-
- /* Restart dma */
- priv->regs->dma_ctrl|=METH_DMA_TX_EN|METH_DMA_RX_EN|METH_DMA_RX_INT_EN;
-
- /* Enable interrupt */
- spin_unlock_irq(&priv->meth_lock);
-
- dev->trans_start = jiffies;
- netif_wake_queue(dev);
-
- return;
-}
-
-/*
- * Ioctl commands
- */
-int meth_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-{
-
- DPRINTK("ioctl\n");
- return 0;
-}
-
-/*
- * Return statistics to the caller
- */
-struct net_device_stats *meth_stats(struct net_device *dev)
-{
- struct meth_private *priv = (struct meth_private *) dev->priv;
- return &priv->stats;
-}
-
-/*
- * The init function (sometimes called probe).
- * It is invoked by register_netdev()
- */
-int meth_init(struct net_device *dev)
-{
- meth_private *priv;
- int ret;
- /*
- * Then, assign other fields in dev, using ether_setup() and some
- * hand assignments
- */
- ether_setup(dev); /* assign some of the fields */
-
- dev->open = meth_open;
- dev->stop = meth_release;
- dev->set_config = meth_config;
- dev->hard_start_xmit = meth_tx;
- dev->do_ioctl = meth_ioctl;
- dev->get_stats = meth_stats;
-#ifdef HAVE_TX_TIMEOUT
- dev->tx_timeout = meth_tx_timeout;
- dev->watchdog_timeo = timeout;
-#endif
- dev->irq = MACE_ETHERNET_IRQ;
- SET_MODULE_OWNER(dev);
-
- /*
- * Then, allocate the priv field. This encloses the statistics
- * and a few private fields.
- */
- priv = kmalloc(sizeof(struct meth_private), GFP_KERNEL);
- if (priv == NULL)
- return -ENOMEM;
- dev->priv=priv;
- memset(priv, 0, sizeof(struct meth_private));
- spin_lock_init(&((struct meth_private *) dev->priv)->meth_lock);
- /*
- * Make the usual checks: check_region(), probe irq, ... -ENODEV
- * should be returned if no device found. No resource should be
- * grabbed: this is done on open().
- */
- priv->regs=(meth_regs*)SGI_MFE;
- dev->base_addr=SGI_MFE;
- priv->phy_addr = -1; /* No phy is known yet... */
-
- /* Initialize the hardware */
- if((ret=meth_reset(dev)) < 0)
- return ret;
-
- /* Allocate the ring buffers */
- if((ret=meth_init_tx_ring(priv))<0||(ret=meth_init_rx_ring(priv))<0){
- meth_free_tx_ring(priv);
- meth_free_rx_ring(priv);
- return ret;
- }
-
- printk("SGI O2 Fast Ethernet rev. %ld\n", priv->regs->mac_ctrl >> 29);
-
- return 0;
-}
-
-/*
- * The devices
- */
-
-struct net_device meth_devs[1] = {
- { init: meth_init, } /* init, nothing more */
-};
-
-/*
- * Finally, the module stuff
- */
-
-int meth_init_module(void)
-{
- int result, device_present = 0;
-
- strcpy(meth_devs[0].name, "eth%d");
-
- if ( (result = register_netdev(meth_devs)) )
- printk("meth: error %i registering device \"%s\"\n",
- result, meth_devs->name);
- else device_present++;
-#ifndef METH_DEBUG
- EXPORT_NO_SYMBOLS;
-#endif
-
- return device_present ? 0 : -ENODEV;
-}
-
-void meth_cleanup(void)
-{
- kfree(meth_devs->priv);
- unregister_netdev(meth_devs);
- return;
-}
-
-module_init(meth_init_module);
-module_exit(meth_cleanup);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/meth.h linux-2.4.22/drivers/net/meth.h
--- linux-2.4.22.clean/drivers/net/meth.h 2002-11-29 00:53:14.000000000 +0100
+++ linux-2.4.22/drivers/net/meth.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,273 +0,0 @@
-
-/*
- * snull.h -- definitions for the network module
- *
- * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet
- * Copyright (C) 2001 O'Reilly & Associates
- *
- * The source code in this file can be freely used, adapted,
- * and redistributed in source or binary form, so long as an
- * acknowledgment appears in derived source files. The citation
- * should list that the code comes from the book "Linux Device
- * Drivers" by Alessandro Rubini and Jonathan Corbet, published
- * by O'Reilly & Associates. No warranty is attached;
- * we cannot take responsibility for errors or fitness for use.
- */
-
-/* version dependencies have been confined to a separate file */
-
-#define SGI_MFE (MACE_BASE+MACE_ENET)
-/* (0xBF280000)*/
-
-/* Tunable parameters */
-#define TX_RING_ENTRIES 64 /* 64-512?*/
-
-#define RX_RING_ENTRIES 16 /* Do not change */
-/* Internal constants */
-#define TX_RING_BUFFER_SIZE (TX_RING_ENTRIES*sizeof(tx_packet))
-#define RX_BUFFER_SIZE 1546 /* ethenet packet size */
-#define METH_RX_BUFF_SIZE 4096
-#define RX_BUFFER_OFFSET (sizeof(rx_status_vector)+2) /* staus vector + 2 bytes of padding */
-#define RX_BUCKET_SIZE 256
-
-
-
-/* For more detailed explanations of what each field menas,
- see Nick's great comments to #defines below (or docs, if
- you are lucky enough toget hold of them :)*/
-
-/* tx status vector is written over tx command header upon
- dma completion. */
-
-typedef struct tx_status_vector {
- u64 sent:1; /* always set to 1...*/
- u64 pad0:34;/* always set to 0 */
- u64 flags:9; /*I'm too lazy to specify each one separately at the moment*/
- u64 col_retry_cnt:4; /*collision retry count*/
- u64 len:16; /*Transmit length in bytes*/
-} tx_status_vector;
-
-/*
- * Each packet is 128 bytes long.
- * It consists of header, 0-3 concatination
- * buffer pointers and up to 120 data bytes.
- */
-typedef struct tx_packet_hdr {
- u64 pad1:36; /*should be filled with 0 */
- u64 cat_ptr3_valid:1, /*Concatination pointer valid flags*/
- cat_ptr2_valid:1,
- cat_ptr1_valid:1;
- u64 tx_int_flag:1; /*Generate TX intrrupt when packet has been sent*/
- u64 term_dma_flag:1; /*Terminate transmit DMA on transmit abort conditions*/
- u64 data_offset:7; /*Starting byte offset in ring data block*/
- u64 data_len:16; /*Length of valid data in bytes-1*/
-} tx_packet_hdr;
-typedef union tx_cat_ptr {
- struct {
- u64 pad2:16; /* should be 0 */
- u64 len:16; /*length of buffer data - 1*/
- u64 start_addr:29; /*Physical starting address*/
- u64 pad1:3; /* should be zero */
- } form;
- u64 raw;
-} tx_cat_ptr;
-
-typedef struct tx_packet {
- union {
- tx_packet_hdr header;
- tx_status_vector res;
- u64 raw;
- }header;
- union {
- tx_cat_ptr cat_buf[3];
- char dt[120];
- } data;
-} tx_packet;
-
-typedef union rx_status_vector {
- struct {
- u64 pad1:1;/*fill it with ones*/
- u64 pad2:15;/*fill with 0*/
- u64 ip_chk_sum:16;
- u64 seq_num:5;
- u64 mac_addr_match:1;
- u64 mcast_addr_match:1;
- u64 carrier_event_seen:1;
- u64 bad_packet:1;
- u64 long_event_seen:1;
- u64 invalid_preamble:1;
- u64 broadcast:1;
- u64 multicast:1;
- u64 crc_error:1;
- u64 huh:1;/*???*/
- u64 rx_code_violation:1;
- u64 rx_len:16;
- } parsed;
- u64 raw;
-} rx_status_vector;
-
-typedef struct rx_packet {
- rx_status_vector status;
- u64 pad[3]; /* For whatever reason, there needs to be 4 double-word offset */
- u16 pad2;
- char buf[METH_RX_BUFF_SIZE-sizeof(rx_status_vector)-3*sizeof(u64)-sizeof(u16)];/* data */
-} rx_packet;
-
-typedef struct meth_regs {
- u64 mac_ctrl; /*0x00,rw,31:0*/
- u64 int_flags; /*0x08,rw,30:0*/
- u64 dma_ctrl; /*0x10,rw,15:0*/
- u64 timer; /*0x18,rw,5:0*/
- u64 int_tx; /*0x20,wo,0:0*/
- u64 int_rx; /*0x28,wo,9:4*/
- struct {
- u32 tx_info_pad;
- u32 rptr:16,wptr:16;
- } tx_info; /*0x30,rw,31:0*/
- u64 tx_info_al; /*0x38,rw,31:0*/
- struct {
- u32 rx_buff_pad1;
- u32 rx_buff_pad2:8,
- wptr:8,
- rptr:8,
- depth:8;
- } rx_buff; /*0x40,ro,23:0*/
- u64 rx_buff_al1; /*0x48,ro,23:0*/
- u64 rx_buff_al2; /*0x50,ro,23:0*/
- u64 int_update; /*0x58,wo,31:0*/
- u32 phy_data_pad;
- u32 phy_data; /*0x60,rw,16:0*/
- u32 phy_reg_pad;
- u32 phy_registers; /*0x68,rw,9:0*/
- u64 phy_trans_go; /*0x70,wo,0:0*/
- u64 backoff_seed; /*0x78,wo,10:0*/
- u64 imq_reserved[4];/*0x80,ro,64:0(x4)*/
- /*===================================*/
- u64 mac_addr; /*0xA0,rw,47:0, I think it's MAC address, but I'm not sure*/
- u64 mcast_addr; /*0xA8,rw,47:0, This seems like secondary MAC address*/
- u64 mcast_filter; /*0xB0,rw,63:0*/
- u64 tx_ring_base; /*0xB8,rw,31:13*/
- /* Following are read-only debugging info register */
- u64 tx_pkt1_hdr; /*0xC0,ro,63:0*/
- u64 tx_pkt1_ptr[3]; /*0xC8,ro,63:0(x3)*/
- u64 tx_pkt2_hdr; /*0xE0,ro,63:0*/
- u64 tx_pkt2_ptr[3]; /*0xE8,ro,63:0(x3)*/
- /*===================================*/
- u32 rx_pad;
- u32 rx_fifo;
- u64 reserved[31];
-}meth_regs;
-
- /* Bits in METH_MAC */
-
-#define SGI_MAC_RESET BIT(0) /* 0: MAC110 active in run mode, 1: Global reset signal to MAC110 core is active */
-#define METH_PHY_FDX BIT(1) /* 0: Disable full duplex, 1: Enable full duplex */
-#define METH_PHY_LOOP BIT(2) /* 0: Normal operation, follows 10/100mbit and M10T/MII select, 1: loops internal MII bus */
- /* selects ignored */
-#define METH_100MBIT BIT(3) /* 0: 10meg mode, 1: 100meg mode */
-#define METH_PHY_MII BIT(4) /* 0: MII selected, 1: SIA selected */
- /* Note: when loopback is set this bit becomes collision control. Setting this bit will */
- /* cause a collision to be reported. */
-
- /* Bits 5 and 6 are used to determine the the Destination address filter mode */
-#define METH_ACCEPT_MY 0 /* 00: Accept PHY address only */
-#define METH_ACCEPT_MCAST 0x20 /* 01: Accept physical, broadcast, and multicast filter matches only */
-#define METH_ACCEPT_AMCAST 0x40 /* 10: Accept physical, broadcast, and all multicast packets */
-#define METH_PROMISC 0x60 /* 11: Promiscious mode */
-
-#define METH_PHY_LINK_FAIL BIT(7) /* 0: Link failure detection disabled, 1: Hardware scans for link failure in PHY */
-
-#define METH_MAC_IPG 0x1ffff00
-
-#define METH_DEFAULT_IPG ((17<<15) | (11<<22) | (21<<8))
- /* 0x172e5c00 */ /* 23, 23, 23 */ /*0x54A9500 *//*21,21,21*/
- /* Bits 8 through 14 are used to determine Inter-Packet Gap between "Back to Back" packets */
- /* The gap depends on the clock speed of the link, 80ns per increment for 100baseT, 800ns */
- /* per increment for 10BaseT */
-
- /* Bits 15 through 21 are used to determine IPGR1 */
-
- /* Bits 22 through 28 are used to determine IPGR2 */
-
-#define METH_REV_SHIFT 29 /* Bits 29 through 31 are used to determine the revision */
- /* 000: Inital revision */
- /* 001: First revision, Improved TX concatenation */
-
-
-/* DMA control bits */
-#define METH_RX_OFFSET_SHIFT 12 /* Bits 12:14 of DMA control register indicate starting offset of packet data for RX operation */
-#define METH_RX_DEPTH_SHIFT 4 /* Bits 8:4 define RX fifo depth -- when # of RX fifo entries != depth, interrupt is generted */
-
-#define METH_DMA_TX_EN BIT(1) /* enable TX DMA */
-#define METH_DMA_TX_INT_EN BIT(0) /* enable TX Buffer Empty interrupt */
-#define METH_DMA_RX_EN BIT(15) /* Enable RX */
-#define METH_DMA_RX_INT_EN BIT(9) /* Enable interrupt on RX packet */
-
-
-/* RX status bits */
-
-#define METH_RX_ST_RCV_CODE_VIOLATION BIT(16)
-#define METH_RX_ST_DRBL_NBL BIT(17)
-#define METH_RX_ST_CRC_ERR BIT(18)
-#define METH_RX_ST_MCAST_PKT BIT(19)
-#define METH_RX_ST_BCAST_PKT BIT(20)
-#define METH_RX_ST_INV_PREAMBLE_CTX BIT(21)
-#define METH_RX_ST_LONG_EVT_SEEN BIT(22)
-#define METH_RX_ST_BAD_PACKET BIT(23)
-#define METH_RX_ST_CARRIER_EVT_SEEN BIT(24)
-#define METH_RX_ST_MCAST_FILTER_MATCH BIT(25)
-#define METH_RX_ST_PHYS_ADDR_MATCH BIT(26)
-
-#define METH_RX_STATUS_ERRORS \
- ( \
- METH_RX_ST_RCV_CODE_VIOLATION| \
- METH_RX_ST_CRC_ERR| \
- METH_RX_ST_INV_PREAMBLE_CTX| \
- METH_RX_ST_LONG_EVT_SEEN| \
- METH_RX_ST_BAD_PACKET| \
- METH_RX_ST_CARRIER_EVT_SEEN \
- )
- /* Bits in METH_INT */
- /* Write _1_ to corresponding bit to clear */
-#define METH_INT_TX_EMPTY BIT(0) /* 0: No interrupt pending, 1: The TX ring buffer is empty */
-#define METH_INT_TX_PKT BIT(1) /* 0: No interrupt pending */
- /* 1: A TX message had the INT request bit set, the packet has been sent. */
-#define METH_INT_TX_LINK_FAIL BIT(2) /* 0: No interrupt pending, 1: PHY has reported a link failure */
-#define METH_INT_MEM_ERROR BIT(3) /* 0: No interrupt pending */
- /* 1: A memory error occurred durring DMA, DMA stopped, Fatal */
-#define METH_INT_TX_ABORT BIT(4) /* 0: No interrupt pending, 1: The TX aborted operation, DMA stopped, FATAL */
-#define METH_INT_RX_THRESHOLD BIT(5) /* 0: No interrupt pending, 1: Selected receive threshold condition Valid */
-#define METH_INT_RX_UNDERFLOW BIT(6) /* 0: No interrupt pending, 1: FIFO was empty, packet could not be queued */
-#define METH_INT_RX_OVERFLOW BIT(7) /* 0: No interrupt pending, 1: DMA FIFO Overflow, DMA stopped, FATAL */
-
-#define METH_INT_RX_RPTR_MASK 0x0001F00 /* Bits 8 through 12 alias of RX read-pointer */
-
- /* Bits 13 through 15 are always 0. */
-
-#define METH_INT_TX_RPTR_MASK 0x1FF0000 /* Bits 16 through 24 alias of TX read-pointer */
-
-#define METH_INT_SEQ_MASK 0x2E000000 /* Bits 25 through 29 are the starting seq number for the message at the */
- /* top of the queue */
-
-#define METH_ERRORS ( \
- METH_INT_RX_OVERFLOW| \
- METH_INT_RX_UNDERFLOW| \
- METH_INT_MEM_ERROR| \
- METH_INT_TX_ABORT)
-
-#define METH_INT_MCAST_HASH BIT(30) /* If RX DMA is enabled the hash select logic output is latched here */
-
-/* TX status bits */
-#define METH_TX_STATUS_DONE BIT(23) /* Packet was transmitted successfully */
-
-/* Tx command header bits */
-#define METH_TX_CMD_INT_EN BIT(24) /* Generate TX interrupt when packet is sent */
-
-/* Phy MDIO interface busy flag */
-#define MDIO_BUSY BIT(16)
-#define MDIO_DATA_MASK 0xFFFF
-/* PHY defines */
-#define PHY_QS6612X 0x0181441 /* Quality TX */
-#define PHY_ICS1889 0x0015F41 /* ICS FX */
-#define PHY_ICS1890 0x0015F42 /* ICS TX */
-#define PHY_DP83840 0x20005C0 /* National TX */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/mv64340_eth.c linux-2.4.22/drivers/net/mv64340_eth.c
--- linux-2.4.22.clean/drivers/net/mv64340_eth.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/net/mv64340_eth.c 2003-09-09 01:00:28.000000000 +0200
@@ -0,0 +1,3003 @@
+/*
+ * drivers/net/mv64340_eth.c - Driver for MV64340X ethernet ports
+ * Copyright (C) 2002 Matthew Dharm <mdharm@momenco.com>
+ *
+ * Based on the 64360 driver from:
+ * Copyright (C) 2002 rabeeh@galileo.co.il
+ *
+ * Copyright (C) 2003 Ralf Baechle <ralf@linux-mips.org>
+ *
+ * This program 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+#include <linux/config.h>
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/config.h>
+#include <linux/sched.h>
+#include <linux/ptrace.h>
+#include <linux/fcntl.h>
+#include <linux/ioport.h>
+#include <linux/interrupt.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/ip.h>
+#include <linux/init.h>
+#include <linux/in.h>
+#include <linux/pci.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <net/ip.h>
+
+#include <asm/bitops.h>
+#include <asm/io.h>
+#include <asm/types.h>
+#include <asm/pgtable.h>
+#include <asm/system.h>
+
+#include "mv64340_eth.h"
+
+/*************************************************************************
+**************************************************************************
+**************************************************************************
+* The first part is the high level driver of the gigE ethernet ports. *
+**************************************************************************
+**************************************************************************
+*************************************************************************/
+
+/* Definition for configuring driver */
+#undef MV64340_RX_QUEUE_FILL_ON_TASK
+
+/* Constants */
+#define EXTRA_BYTES 32
+#define WRAP ETH_HLEN + 2 + 4 + 16
+#define BUFFER_MTU dev->mtu + WRAP
+#define INT_CAUSE_UNMASK_ALL 0x0007ffff
+#define INT_CAUSE_UNMASK_ALL_EXT 0x0011ffff
+#ifdef MV64340_RX_FILL_ON_TASK
+#define INT_CAUSE_MASK_ALL 0x00000000
+#define INT_CAUSE_CHECK_BITS INT_CAUSE_UNMASK_ALL
+#define INT_CAUSE_CHECK_BITS_EXT INT_CAUSE_UNMASK_ALL_EXT
+#endif
+
+/* Static function declarations */
+static int mv64340_eth_real_open(struct net_device *);
+static int mv64340_eth_real_stop(struct net_device *);
+static int mv64340_eth_change_mtu(struct net_device *, int);
+static struct net_device_stats *mv64340_eth_get_stats(struct net_device *);
+static void eth_port_init_mac_tables(ETH_PORT eth_port_num);
+#ifdef MV64340_NAPI
+static int mv64340_poll(struct net_device *dev, int *budget);
+#endif
+
+static unsigned char prom_mac_addr_base[6];
+
+/**************************************************
+ * Helper functions - used inside the driver only *
+ **************************************************/
+
+static inline void __netif_rx_complete(struct net_device *dev)
+{
+ if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
+ list_del(&dev->poll_list);
+ clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
+}
+
+static void *mv64340_eth_malloc_ring(unsigned int size)
+{
+ dma_addr_t dma_handle;
+ void *result;
+ /* Assumes allocated buffer is cache line alligned */
+ result = pci_alloc_consistent(NULL, size, &dma_handle);
+ memset(result, 0, size);
+ return result;
+}
+
+/**********************************************************************
+ * mv64340_eth_change_mtu
+ *
+ * Changes MTU (maximum transfer unit) of the gigabit ethenret port
+ *
+ * Input : pointer to ethernet interface network device structure
+ * new mtu size
+ * Output : 0 upon success, -EINVAL upon failure
+ **********************************************************************/
+static int mv64340_eth_change_mtu(struct net_device *dev, int new_mtu)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ unsigned long flags;
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ spin_lock_irqsave(&port_private->lock, flags);
+
+ if ((new_mtu > 9500) || (new_mtu < 64)) {
+ spin_unlock_irqrestore(&port_private->lock, flags);
+ return -EINVAL;
+ }
+
+ dev->mtu = new_mtu;
+ /*
+ * Stop then re-open the interface. This will allocate RX skb's with
+ * the new MTU.
+ * There is a possible danger that the open will not successed, due
+ * to memory is full, which might fail the open function.
+ */
+ if (netif_running(dev)) {
+ if (mv64340_eth_real_stop(dev))
+ printk(KERN_ERR
+ "%s: Fatal error on stopping device\n",
+ dev->name);
+ if (mv64340_eth_real_open(dev))
+ printk(KERN_ERR
+ "%s: Fatal error on opening device\n",
+ dev->name);
+ }
+
+ spin_unlock_irqrestore(&port_private->lock, flags);
+ return 0;
+}
+
+/**********************************************************************
+ * mv64340_eth_rx_task
+ *
+ * Fills / refills RX queue on a certain gigabit ethernet port
+ *
+ * Input : pointer to ethernet interface network device structure
+ * Output : N/A
+ **********************************************************************/
+static void mv64340_eth_rx_task(void *data)
+{
+ struct net_device *dev = (struct net_device *) data;
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ PKT_INFO pkt_info;
+ struct sk_buff *skb;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ if (test_and_set_bit(0, &port_private->rx_task_busy)) {
+ panic("%s: Error in test_set_bit / clear_bit\n", dev->name);
+ }
+
+ while (port_private->rx_ring_skbs < (port_private->rx_ring_size - 5)) {
+ /* The +8 for buffer allignment and another 32 byte extra */
+ skb = dev_alloc_skb(BUFFER_MTU + 8 + EXTRA_BYTES);
+ if (!skb)
+ break;
+ port_private->rx_ring_skbs++;
+ pkt_info.cmd_sts = ETH_RX_ENABLE_INTERRUPT;
+ pkt_info.byte_cnt = dev->mtu + ETH_HLEN + 4 + 2 + EXTRA_BYTES;
+ /* Allign buffer to 8 bytes */
+ if (pkt_info.byte_cnt & ~0x7) {
+ pkt_info.byte_cnt &= ~0x7;
+ pkt_info.byte_cnt += 8;
+ }
+ pkt_info.buf_ptr =
+ pci_map_single(0, skb->data,
+ dev->mtu + ETH_HLEN + 4 + 2 + EXTRA_BYTES,
+ PCI_DMA_FROMDEVICE);
+ pkt_info.return_info = skb;
+ if (eth_rx_return_buff(ethernet_private, &pkt_info) != ETH_OK) {
+ printk(KERN_ERR
+ "%s: Error allocating RX Ring\n", dev->name);
+ break;
+ }
+ skb_reserve(skb, 2);
+ }
+ clear_bit(0, &port_private->rx_task_busy);
+ /*
+ * If RX ring is empty of SKB, set a timer to try allocating
+ * again in a later time .
+ */
+ if ((port_private->rx_ring_skbs == 0) &&
+ (port_private->rx_timer_flag == 0)) {
+ printk(KERN_INFO "%s: Rx ring is empty\n", dev->name);
+ /* After 100mSec */
+ port_private->timeout.expires = jiffies + (HZ / 10);
+ add_timer(&port_private->timeout);
+ port_private->rx_timer_flag = 1;
+ }
+#if MV64340_RX_QUEUE_FILL_ON_TASK
+ else {
+ /* Return interrupts */
+ MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num),
+ INT_CAUSE_UNMASK_ALL);
+ }
+#endif
+}
+
+
+/**********************************************************************
+ * mv64340_eth_rx_task_timer_wrapper
+ *
+ * Timer routine to wake up RX queue filling task. This function is
+ * used only in case the RX queue is empty, and all alloc_skb has
+ * failed (due to out of memory event).
+ *
+ * Input : pointer to ethernet interface network device structure
+ * Output : N/A
+ **********************************************************************/
+static void mv64340_eth_rx_task_timer_wrapper(unsigned long data)
+{
+ struct net_device *dev = (struct net_device *) data;
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+
+ port_private->rx_timer_flag = 0;
+ mv64340_eth_rx_task((void *) data);
+}
+
+
+/**********************************************************************
+ * mv64340_eth_update_mac_address
+ *
+ * Update the MAC address of the port in the address table
+ *
+ * Input : pointer to ethernet interface network device structure
+ * Output : N/A
+ **********************************************************************/
+static void mv64340_eth_update_mac_address(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private = dev->priv;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ eth_port_init_mac_tables(port_num);
+ memcpy(ethernet_private->port_mac_addr, dev->dev_addr, 6);
+ eth_port_uc_addr_set(port_num, ethernet_private->port_mac_addr);
+}
+
+/**********************************************************************
+ * mv64340_eth_set_rx_mode
+ *
+ * Change from promiscuos to regular rx mode
+ *
+ * Input : pointer to ethernet interface network device structure
+ * Output : N/A
+ **********************************************************************/
+static void mv64340_eth_set_rx_mode(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private = (ETH_PORT_INFO *) dev->priv;
+
+ if (dev->flags & IFF_PROMISC) {
+ ethernet_set_config_reg
+ (ethernet_private->port_num,
+ ethernet_get_config_reg(ethernet_private->port_num) |
+ ETH_UNICAST_PROMISCUOUS_MODE);
+ } else {
+ ethernet_set_config_reg
+ (ethernet_private->port_num,
+ ethernet_get_config_reg(ethernet_private->port_num) &
+ ~(unsigned int) ETH_UNICAST_PROMISCUOUS_MODE);
+ }
+}
+
+
+/**********************************************************************
+ * mv64340_eth_set_mac_address
+ *
+ * Change the interface's mac address.
+ * No special hardware thing should be done because interface is always
+ * put in promiscuous mode.
+ *
+ * Input : pointer to ethernet interface network device structure and
+ * a pointer to the designated entry to be added to the cache.
+ * Output : zero upon success, negative upon failure
+ **********************************************************************/
+static int mv64340_eth_set_mac_address(struct net_device *dev, void *addr)
+{
+ int i;
+
+ for (i = 0; i < 6; i++)
+ /* +2 is for the offset of the HW addr type */
+ dev->dev_addr[i] = ((unsigned char *) addr)[i + 2];
+ mv64340_eth_update_mac_address(dev);
+ return 0;
+}
+
+/**********************************************************************
+ * mv64340_eth_tx_timeout
+ *
+ * Called upon a timeout on transmitting a packet
+ *
+ * Input : pointer to ethernet interface network device structure.
+ * Output : N/A
+ **********************************************************************/
+static void mv64340_eth_tx_timeout(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private = dev->priv;
+ printk(KERN_INFO "%s: TX timeout ", dev->name);
+ printk(KERN_INFO "Resetting card \n");
+
+ /* Do the reset outside of interrupt context */
+ schedule_task(ðernet_private->tx_timeout_task);
+}
+
+/**********************************************************************
+ * mv64340_eth_tx_timeout_task
+ *
+ * Actual routine to reset the adapter when a timeout on Tx has occurred
+ **********************************************************************/
+static void mv64340_eth_tx_timeout_task(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private = dev->priv;
+
+ netif_device_detach(dev);
+ eth_port_reset(ethernet_private->port_num);
+ eth_port_start(ethernet_private);
+ netif_device_attach(dev);
+}
+
+/**********************************************************************
+ * mv64340_eth_free_tx_queue
+ *
+ * Input : dev - a pointer to the required interface
+ *
+ * Output : 0 if was able to release skb , nonzero otherwise
+ **********************************************************************/
+
+static int mv64340_eth_free_tx_queue(struct net_device *dev,
+ unsigned int eth_int_cause_ext)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ PKT_INFO pkt_info;
+ int released = 1;
+ struct net_device_stats *stats;
+
+ spin_lock(&(port_private->lock));
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+ stats = &port_private->stats;
+
+ /* Check only queue 0 */
+ if (eth_int_cause_ext & (BIT0 | BIT8))
+ while (eth_tx_return_desc(ethernet_private, &pkt_info) ==
+ ETH_OK) {
+ if (pkt_info.cmd_sts & BIT0) {
+ printk("%s: Error in TX\n", dev->name);
+ stats->tx_errors++;
+ }
+ /*
+ * If return_info is different than 0, release the skb.
+ * The case where return_info is not 0 is only in case
+ * when transmitted a scatter/gather packet, where only
+ * last skb releases the whole chain.
+ */
+ if (pkt_info.return_info) {
+ dev_kfree_skb_irq((struct sk_buff *)
+ pkt_info.return_info);
+ released = 0;
+ if (skb_shinfo(pkt_info.return_info)->nr_frags)
+ pci_unmap_page(0, pkt_info.buf_ptr,
+ pkt_info.byte_cnt,
+ PCI_DMA_TODEVICE);
+
+ if (port_private->tx_ring_skbs != 1)
+ port_private->tx_ring_skbs--;
+ }
+ else
+ pci_unmap_page(0, pkt_info.buf_ptr,
+ pkt_info.byte_cnt,
+ PCI_DMA_TODEVICE);
+
+ /*
+ * Decrement the number of outstanding skbs counter on the
+ * TX queue.
+ */
+ if (port_private->tx_ring_skbs == 0)
+ panic
+ ("ERROR - TX outstanding SKBs counter is corrupted\n");
+
+ }
+
+ spin_unlock(&(port_private->lock));
+ return released;
+}
+
+/**********************************************************************
+ * mv64340_eth_receive
+ *
+ * This function is forward packets that are received from the port's
+ * queues toward kernel core or FastRoute them to another interface.
+ *
+ * Input : dev - a pointer to the required interface
+ * max - maximum number to receive (0 means unlimted)
+ *
+ * Output : number of served packets
+ **********************************************************************/
+#ifdef MV64340_NAPI
+static int mv64340_eth_receive_queue(struct net_device *dev, unsigned int max,
+ int budget)
+#else
+static int mv64340_eth_receive_queue(struct net_device *dev, unsigned int max)
+#endif
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ PKT_INFO pkt_info;
+ struct sk_buff *skb;
+ unsigned int received_packets = 0;
+ struct net_device_stats *stats;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+ stats = &port_private->stats;
+
+#ifdef MV64340_NAPI
+ while ((eth_port_receive(ethernet_private, &pkt_info) == ETH_OK)
+ &&
+ budget > 0) {
+#else
+ while ((--max)
+ && (eth_port_receive(ethernet_private, &pkt_info) ==
+ ETH_OK)) {
+#endif
+ port_private->rx_ring_skbs--;
+ received_packets++;
+#ifdef MV64340_NAPI
+ budget--;
+#endif
+ /* Update statistics. Note byte count includes 4 byte CRC count */
+ stats->rx_packets++;
+ stats->rx_bytes += pkt_info.byte_cnt;
+ skb = (struct sk_buff *) pkt_info.return_info;
+ /*
+ * In case received a packet without first / last bits on OR the error
+ * summary bit is on, the packets needs to be dropeed.
+ */
+ if (
+ ((pkt_info.cmd_sts
+ & (ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC)) !=
+ (ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC))
+ || (pkt_info.cmd_sts & ETH_ERROR_SUMMARY)) {
+ stats->rx_dropped++;
+ if (
+ (pkt_info.cmd_sts & (ETH_RX_FIRST_DESC |
+ ETH_RX_LAST_DESC)) !=
+ (ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC)) {
+ if (net_ratelimit())
+ printk(KERN_ERR
+ "%s: Received packet spread on multiple"
+ " descriptors\n",
+ dev->name);
+ }
+ if (pkt_info.cmd_sts & ETH_ERROR_SUMMARY) {
+ stats->rx_errors++;
+ }
+ dev_kfree_skb_irq(skb);
+ } else {
+ struct ethhdr *eth_h;
+ struct iphdr *ip_h;
+
+ /*
+ * The -4 is for the CRC in the trailer of the
+ * received packet
+ */
+ skb_put(skb, pkt_info.byte_cnt - 4);
+ skb->dev = dev;
+
+ eth_h = (struct ethhdr *) skb->data;
+ ip_h = (struct iphdr *) (skb->data + ETH_HLEN);
+ if (pkt_info.cmd_sts & ETH_LAYER_4_CHECKSUM_OK) {
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+ skb->csum = htons((pkt_info.cmd_sts
+ & 0x0007fff8) >> 3);
+ }
+ else
+ skb->ip_summed = CHECKSUM_NONE;
+ skb->protocol = eth_type_trans(skb, dev);
+#ifdef MV64340_NAPI
+ netif_receive_skb(skb);
+#else
+ netif_rx(skb);
+#endif
+ }
+ }
+
+ return received_packets;
+}
+
+/**********************************************************************
+ * mv64340_eth_int_handler
+ *
+ * Main interrupt handler for the gigbit ethernet ports
+ *
+ * Input : irq - irq number (not used)
+ * dev_id - a pointer to the required interface's data structure
+ * regs - not used
+ * Output : N/A
+ **********************************************************************/
+
+static void mv64340_eth_int_handler(int irq, void *dev_id, struct pt_regs *regs)
+{
+ struct net_device *dev = (struct net_device *) dev_id;
+ u32 eth_int_cause = 0, eth_int_cause_ext = 0;
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ /* Read interrupt cause registers */
+ eth_int_cause =
+ MV_READ_DATA(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num));
+ if (eth_int_cause & BIT1)
+ eth_int_cause_ext =
+ MV_READ_DATA(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG
+ (port_num));
+ else
+ eth_int_cause_ext = 0;
+
+ /* Mask with shadowed mask registers */
+#ifdef MV64340_RX_QUEUE_FILL_ON_TASK
+ eth_int_cause &= INT_CAUSE_CHECK_BITS;
+ eth_int_cause_ext &= INT_CAUSE_CHECK_BITS_EXT;
+#else
+ eth_int_cause &= INT_CAUSE_UNMASK_ALL;
+ eth_int_cause_ext &= INT_CAUSE_UNMASK_ALL_EXT;
+#endif
+
+ /*
+ * If no real interrupt occured, exit.
+ * This can happen when using gigE interrupt coalescing mechanism.
+ */
+ if ((eth_int_cause == 0x0) && (eth_int_cause_ext == 0x0)) {
+ return;
+ }
+
+#ifdef MV64340_NAPI
+ if (!(eth_int_cause & 0x0007fffd)) {
+ /* Dont ack the Rx interrupt */
+#endif
+ /*
+ * Clear specific ethernet port intrerrupt registers by acknowleding
+ * relevant bits.
+ */
+ MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num),
+ ~eth_int_cause);
+ if (eth_int_cause_ext != 0x0)
+ MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num),
+ ~eth_int_cause_ext);
+#ifdef MV64340_NAPI
+ }
+#endif
+
+ if (eth_int_cause_ext & 0x0000ffff) {
+ /*
+ * Check if released more than one packet.
+ * Otherwise don't wake up queue
+ */
+ if (mv64340_eth_free_tx_queue(dev, eth_int_cause_ext) == 0) {
+ /*
+ * If the interface was stopped before, and link is up,
+ * wakeup TX queue. Note that this might be a problematic
+ * issue since the multiple TX queues in the system controller,
+ * and in which few queues are stucked.
+ * If this is the case, then a TX packet to a stucked queue is
+ * forwarded to another TX queue of the interface ; BUT in the
+ * current implementation only one TX / RX queues are used.
+ */
+ if (netif_queue_stopped(dev)
+ && (dev->flags & IFF_RUNNING)
+ &&
+ (MV64340_TX_QUEUE_SIZE > port_private->tx_ring_skbs + 1)) {
+ netif_wake_queue(dev);
+ }
+ }
+ }
+ if (eth_int_cause & 0x0007fffd) {
+ unsigned int total_received = 0;
+ /* Rx Return Buffer / Resource Error Priority queue 0 */
+#ifdef MV64340_NAPI
+ if (eth_int_cause & (BIT2 | BIT11)) {
+ if (netif_rx_schedule_prep(dev)) {
+ /* Mask all the interrupts */
+ MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num),0);
+ MV_WRITE(MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port_num), 0);
+ __netif_rx_schedule(dev);
+ }
+ }
+#else
+ if (eth_int_cause & (BIT2 | BIT11)) {
+ total_received +=
+ mv64340_eth_receive_queue(dev, 0);
+ }
+ /*
+ * After forwarded received packets to upper layer, add a task in an
+ * interrupts enabled context that refills the RX ring with skb's.
+ */
+#if MV64340_RX_QUEUE_FILL_ON_TASK
+ /* Unmask all interrupts on ethernet port */
+ MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num),
+ INT_CAUSE_MASK_ALL);
+ queue_task(&port_private->rx_task, &tq_immediate);
+ mark_bh(IMMEDIATE_BH);
+#else
+ port_private->rx_task.routine(dev);
+#endif
+#endif
+
+ }
+
+ /* PHY status changed */
+ if (eth_int_cause_ext & (BIT16 | BIT20)) {
+ unsigned int phy_reg_data;
+
+ /* Check Link status on ethernet port */
+ eth_port_read_smi_reg(port_num, 1, &phy_reg_data);
+ if (!(phy_reg_data & 0x20)) {
+ netif_stop_queue(dev);
+ dev->flags &= ~(IFF_RUNNING);
+ } else {
+ netif_wake_queue(dev);
+ dev->flags |= (IFF_RUNNING);
+
+ /*
+ * Start all TX queues on ethernet port. This is good in case of
+ * previous packets where not transmitted, due to link down and
+ * this command re-enables all TX queues.
+ * Note that it is possible to get a TX resource error interrupt
+ * after issuing this, since not all TX queues are enabled,
+ * or has anything to send.
+ */
+ MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num), 1);
+ }
+ }
+ return;
+}
+
+/**********************************************************************
+ * mv64340_eth_open
+ *
+ * This function is called when openning the network device. The function
+ * should initialize all the hardware, initialize cyclic Rx/Tx
+ * descriptors chain and buffers and allocate an IRQ to the network
+ * device.
+ *
+ * Input : a pointer to the network device structure
+ *
+ * Output : zero of success , nonzero if fails.
+ **********************************************************************/
+
+static int mv64340_eth_open(struct net_device *dev)
+{
+ int retval;
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ spin_lock_irq(&(port_private->lock));
+
+ retval =
+ request_irq(ETH_PORT0_IRQ_NUM + port_num, mv64340_eth_int_handler,
+ (SA_INTERRUPT | SA_SAMPLE_RANDOM), dev->name, dev);
+
+ if (retval != 0) {
+ printk(KERN_ERR "Can not assign IRQ number to MV64340_eth%d\n",
+ port_num);
+ return -1;
+ } else {
+ dev->irq = ETH_PORT0_IRQ_NUM + port_num;
+ }
+
+ if (mv64340_eth_real_open(dev)) {
+ printk("%s: Error opening interface\n", dev->name);
+ free_irq(dev->irq, dev);
+ spin_unlock_irq(ðernet_priv->lock);
+ return -EBUSY;
+ }
+ MOD_INC_USE_COUNT;
+ spin_unlock_irq(ðernet_priv->lock);
+ return 0;
+}
+
+/* Helper function for mv64340_eth_open */
+static int mv64340_eth_real_open(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ u32 phy_reg_data;
+ unsigned int size;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ /* Stop RX Queues */
+ MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num),
+ 0x0000ff00);
+
+ /* Clear the ethernet port interrupts */
+ MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
+ MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
+
+ /* Unmask RX buffer and TX end interrupt */
+ MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num),
+ INT_CAUSE_UNMASK_ALL);
+
+ /* Unmask phy and link status changes interrupts */
+ MV_WRITE(MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
+ INT_CAUSE_UNMASK_ALL_EXT);
+
+ /* Set the MAC Address */
+ memcpy(ethernet_private->port_mac_addr, dev->dev_addr, 6);
+ eth_port_init(ethernet_private);
+
+ /* Set rx_task pointers */
+ port_private->rx_task.sync = 0;
+ port_private->rx_task.routine = mv64340_eth_rx_task;
+ port_private->rx_task.data = dev;
+
+ memset(&port_private->timeout, 0, sizeof(struct timer_list));
+ port_private->timeout.function = mv64340_eth_rx_task_timer_wrapper;
+ port_private->timeout.data = (unsigned long) dev;
+
+ port_private->rx_task_busy = 0;
+ port_private->rx_timer_flag = 0;
+
+ /* Allocate TX ring */
+ port_private->tx_ring_skbs = 0;
+ port_private->tx_ring_size = MV64340_TX_QUEUE_SIZE;
+ size = port_private->tx_ring_size * sizeof(ETH_TX_DESC);
+ ethernet_private->tx_desc_area_size = size;
+
+ /* Assumes allocated ring is 16 bytes alligned */
+ ethernet_private->p_tx_desc_area =
+ (ETH_TX_DESC *) MV64340_NIC_SRAM_BASE_TX;
+ if (!ethernet_private->p_tx_desc_area) {
+ printk(KERN_ERR
+ "%s: Cannot allocate Tx Ring (size %d bytes)\n",
+ dev->name, size);
+ return -ENOMEM;
+ }
+ memset((void *) ethernet_private->p_tx_desc_area, 0,
+ ethernet_private->tx_desc_area_size);
+
+ /* Dummy will be replaced upon real tx */
+ ether_init_tx_desc_ring(ethernet_private,
+ port_private->tx_ring_size,
+ (unsigned long)ethernet_private->p_tx_desc_area);
+
+ /* Allocate RX ring */
+ /* Meantime RX Ring are fixed - but must be configurable by user */
+ port_private->rx_ring_size = MV64340_RX_QUEUE_SIZE;
+ port_private->rx_ring_skbs = 0;
+ size = port_private->rx_ring_size * sizeof(ETH_RX_DESC);
+ ethernet_private->rx_desc_area_size = size;
+
+ /* Assumes allocated ring is 16 bytes alligned */
+ ethernet_private->p_rx_desc_area =
+ (ETH_RX_DESC *) mv64340_eth_malloc_ring(size);
+ if (!ethernet_private->p_rx_desc_area) {
+ printk(KERN_ERR
+ "%s: Cannot allocate Rx ring (size %d bytes)\n",
+ dev->name, size);
+ printk(KERN_ERR
+ "%s: Freeing previously allocated TX queues...",
+ dev->name);
+ pci_free_consistent(0, ethernet_private->tx_desc_area_size,
+ (void *)
+ ethernet_private->p_tx_desc_area,
+ virt_to_bus(ethernet_private->
+ p_tx_desc_area));
+ return -ENOMEM;
+ }
+ memset((void *) ethernet_private->p_rx_desc_area, 0,
+ ethernet_private->rx_desc_area_size);
+ if (
+ (ether_init_rx_desc_ring(ethernet_private, port_private->rx_ring_size, 1536, /* Dummy, will be replaced later */
+ (unsigned long) ethernet_private->p_rx_desc_area,
+ 0)) == false)
+ panic("%s: Error initializing RX Ring\n", dev->name);
+
+ /* Fill RX ring with skb's */
+ mv64340_eth_rx_task(dev);
+
+ eth_port_start(ethernet_private);
+
+ /* Interrupt Coalescing */
+
+ port_private->rx_int_coal =
+ eth_port_set_rx_coal (port_num, 133000000, MV64340_RX_COAL);
+
+ port_private->tx_int_coal =
+ eth_port_set_tx_coal (port_num, 133000000, MV64340_TX_COAL);
+
+ /* Increase the Rx side buffer size */
+
+ MV_WRITE (MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num), (0x5 << 17) |
+ (MV_READ_DATA (MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num))
+ & 0xfff1ffff));
+
+ /* Check Link status on phy */
+ eth_port_read_smi_reg(port_num, 1, &phy_reg_data);
+ if (!(phy_reg_data & 0x20)) {
+ netif_stop_queue(dev);
+ dev->flags &= ~(IFF_RUNNING);
+ } else {
+ netif_start_queue(dev);
+ dev->flags |= (IFF_RUNNING);
+ }
+ return 0;
+}
+
+
+static void mv64340_eth_free_tx_rings(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num, curr;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ /* Stop Tx Queues */
+ MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num),
+ 0x0000ff00);
+
+ /* Free TX rings */
+ /* Free outstanding skb's on TX rings */
+ for (curr = 0;
+ (port_private->tx_ring_skbs) && (curr < MV64340_TX_QUEUE_SIZE);
+ curr++) {
+ if (ethernet_private->tx_skb[curr]) {
+ dev_kfree_skb(ethernet_private->tx_skb[curr]);
+ port_private->tx_ring_skbs--;
+ }
+ }
+ if (port_private->tx_ring_skbs != 0)
+ printk
+ ("%s: Error on Tx descriptor free - could not free %d"
+ " descriptors\n", dev->name,
+ port_private->tx_ring_skbs);
+ pci_free_consistent(0, ethernet_private->tx_desc_area_size,
+ (void *) ethernet_private->p_tx_desc_area,
+ virt_to_bus(ethernet_private->p_tx_desc_area));
+}
+
+static void mv64340_eth_free_rx_rings(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ int curr;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+
+ /* Stop RX Queues */
+ MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num),
+ 0x0000ff00);
+
+ /* Free RX rings */
+ /* Free preallocated skb's on RX rings */
+ for (curr = 0;
+ port_private->rx_ring_skbs && (curr < MV64340_RX_QUEUE_SIZE);
+ curr++) {
+ if (ethernet_private->rx_skb[curr]) {
+ dev_kfree_skb(ethernet_private->rx_skb[curr]);
+ port_private->rx_ring_skbs--;
+ }
+ }
+
+ if (port_private->rx_ring_skbs != 0)
+ printk(KERN_ERR
+ "%s: Error in freeing Rx Ring. %d skb's still"
+ " stuck in RX Ring - ignoring them\n", dev->name,
+ port_private->rx_ring_skbs);
+ pci_free_consistent(0, ethernet_private->rx_desc_area_size,
+ (void *) ethernet_private->p_rx_desc_area,
+ virt_to_bus(ethernet_private->p_rx_desc_area));
+}
+
+/**********************************************************************
+ * mv64340_eth_stop
+ *
+ * This function is used when closing the network device.
+ * It updates the hardware,
+ * release all memory that holds buffers and descriptors and release the IRQ.
+ * Input : a pointer to the device structure
+ * Output : zero if success , nonzero if fails
+ *********************************************************************/
+
+static int mv64340_eth_stop(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ spin_lock_irq(&(port_private->lock));
+
+ mv64340_eth_real_stop(dev);
+
+ free_irq(dev->irq, dev);
+ MOD_DEC_USE_COUNT;
+ spin_unlock_irq(ðernet_priv->lock);
+ return 0;
+};
+
+/* Helper function for mv64340_eth_stop */
+
+static int mv64340_eth_real_stop(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ netif_stop_queue(dev);
+
+ mv64340_eth_free_tx_rings(dev);
+ mv64340_eth_free_rx_rings(dev);
+
+ eth_port_reset(ethernet_private->port_num);
+
+ /* Disable ethernet port interrupts */
+ MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
+ MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
+
+ /* Mask RX buffer and TX end interrupt */
+ MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num), 0);
+
+ /* Mask phy and link status changes interrupts */
+ MV_WRITE(MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port_num), 0);
+
+ return 0;
+}
+
+#ifdef MV64340_NAPI
+static void mv64340_tx(struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ PKT_INFO pkt_info;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+
+ port_num = port_private->port_num;
+
+ while (eth_tx_return_desc(ethernet_private, &pkt_info) == ETH_OK) {
+ if (pkt_info.return_info) {
+ dev_kfree_skb_irq((struct sk_buff *)
+ pkt_info.return_info);
+ if (skb_shinfo(pkt_info.return_info)->nr_frags)
+ pci_unmap_page(0, pkt_info.buf_ptr,
+ pkt_info.byte_cnt,
+ PCI_DMA_TODEVICE);
+
+ if (port_private->tx_ring_skbs != 1)
+ port_private->tx_ring_skbs--;
+ } else
+ pci_unmap_page(0, pkt_info.buf_ptr,
+ pkt_info.byte_cnt,
+ PCI_DMA_TODEVICE);
+ }
+
+ if (netif_queue_stopped(dev) &&
+ (dev->flags & IFF_RUNNING) &&
+ (MV64340_TX_QUEUE_SIZE > port_private->tx_ring_skbs + 1)) {
+ netif_wake_queue(dev);
+ }
+}
+
+/**********************************************************************
+ * mv64340_poll
+ *
+ * This function is used in case of NAPI
+ ***********************************************************************/
+static int mv64340_poll(struct net_device *netdev, int *budget)
+{
+ ETH_PORT_INFO *ethernet_private = netdev->priv;
+ struct mv64340_eth_priv *port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ int done = 1, orig_budget, work_done;
+ unsigned long flags;
+ unsigned int port_num = port_private->port_num;
+
+ spin_lock_irqsave(&port_private->lock, flags);
+ mv64340_tx(netdev);
+
+ orig_budget = *budget;
+ if (orig_budget > netdev->quota)
+ orig_budget = netdev->quota;
+ work_done = mv64340_eth_receive_queue(netdev, 0, orig_budget);
+ port_private->rx_task.routine(netdev);
+ *budget -= work_done;
+ netdev->quota -= work_done;
+ if (work_done >= orig_budget)
+ done = 0;
+
+ if (done) {
+ __netif_rx_complete(netdev);
+ MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num),0);
+ MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num),0);
+ MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num),
+ INT_CAUSE_UNMASK_ALL);
+ MV_WRITE(MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
+ INT_CAUSE_UNMASK_ALL_EXT);
+ }
+
+ spin_unlock_irqrestore(&port_private->lock, flags);
+ return (done ? 0 : 1);
+}
+#endif
+
+/**********************************************************************
+ * mv64340_eth_start_xmit
+ *
+ * This function is queues a packet in the Tx descriptor for
+ * required port.
+ *
+ * Input : skb - a pointer to socket buffer
+ * dev - a pointer to the required port
+ *
+ * Output : zero upon success
+ **********************************************************************/
+
+static int mv64340_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+ PKT_INFO pkt_info;
+ unsigned long flags;
+ ETH_FUNC_RET_STATUS status;
+ struct net_device_stats *stats;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+ stats = &port_private->stats;
+
+ if (netif_queue_stopped(dev)) {
+ printk(KERN_ERR
+ "%s: Tried sending packet when interface is stopped\n",
+ dev->name);
+ return 1;
+ }
+
+ /* This is a hard error, log it. */
+ if ((MV64340_TX_QUEUE_SIZE - port_private->tx_ring_skbs) <=
+ (skb_shinfo(skb)->nr_frags + 1)) {
+ netif_stop_queue(dev);
+ printk(KERN_ERR
+ "%s: Bug in mv64340_eth - Trying to transmit when"
+ " queue full !\n", dev->name);
+ return 1;
+ }
+
+ /* Paranoid check - this shouldn't happen */
+ if (skb == NULL) {
+ stats->tx_dropped++;
+ return 1;
+ }
+
+ spin_lock_irqsave(&port_private->lock, flags);
+
+ /* Update packet info data structure -- DMA owned, first last */
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+ if (!skb_shinfo(skb)->nr_frags) {
+#endif
+ pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT |
+ ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC;
+
+ pkt_info.byte_cnt = skb->len;
+ pkt_info.buf_ptr = pci_map_single
+ (0, skb->data, skb->len, PCI_DMA_TODEVICE);
+
+ pkt_info.return_info = skb;
+ status = eth_port_send(ethernet_private, &pkt_info);
+ if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL))
+ printk(KERN_ERR "%s: Error on transmitting packet\n",
+ dev->name);
+ port_private->tx_ring_skbs++;
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+ }
+ else {
+ unsigned int frag;
+ u32 ipheader;
+
+ /* first frag which is skb header */
+ pkt_info.byte_cnt = skb_headlen(skb);
+ pkt_info.buf_ptr = pci_map_single(0, skb->data,
+ skb_headlen(skb), PCI_DMA_TODEVICE);
+ pkt_info.return_info = 0;
+ pkt_info.cmd_sts = ETH_TX_FIRST_DESC;
+
+ ipheader = ( (skb->nh.iph->ihl << 11) & (BIT14
+ | BIT13
+ | BIT12
+ | BIT11));
+
+ if (skb->ip_summed == CHECKSUM_HW) {
+ /* Fly baby fly */
+ pkt_info.cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
+ ETH_GEN_IP_V_4_CHECKSUM |
+ BIT10 |
+ ipheader;
+ pkt_info.l4i_chk = 0x0000;
+ }
+ status = eth_port_send(ethernet_private, &pkt_info);
+ if ((status == ETH_ERROR))
+ printk(KERN_ERR "%s: Error on transmitting packet\n", dev->name);
+ if (status == ETH_QUEUE_FULL)
+ printk("Error on Queue Full \n");
+ if (status == ETH_QUEUE_LAST_RESOURCE)
+ printk("Tx resource error \n");
+
+ /* Check for the remaining frags */
+ for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
+ skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag];
+ pkt_info.l4i_chk = 0x0000;
+ pkt_info.cmd_sts = 0x00000000;
+
+ /* Last Frag enables interrupt and frees the skb */
+ if (frag == (skb_shinfo(skb)->nr_frags - 1)) {
+ pkt_info.cmd_sts |= ETH_TX_ENABLE_INTERRUPT |
+ ETH_TX_LAST_DESC;
+ pkt_info.return_info = skb;
+ port_private->tx_ring_skbs++;
+ }
+ else {
+ pkt_info.return_info = 0;
+ }
+ pkt_info.byte_cnt = this_frag->size;
+ if (this_frag->size < 8)
+ printk("%d : \n", skb_shinfo(skb)->nr_frags);
+
+ pkt_info.buf_ptr = pci_map_page(0,
+ this_frag->page,
+ this_frag->page_offset,
+ this_frag->size,
+ PCI_DMA_TODEVICE);
+
+ status = eth_port_send(ethernet_private, &pkt_info);
+ if ((status == ETH_ERROR))
+ printk(KERN_ERR "%s: Error on transmitting packet\n",
+ dev->name);
+
+ if (status == ETH_QUEUE_LAST_RESOURCE)
+ printk("Tx resource error \n");
+
+ if (status == ETH_QUEUE_FULL)
+ printk("Queue is full \n");
+
+ }
+ }
+#endif
+
+ /* Check if TX queue can handle another skb. If not, then
+ * signal higher layers to stop requesting TX
+ */
+ if (MV64340_TX_QUEUE_SIZE <= (port_private->tx_ring_skbs + 1))
+ /*
+ * Stop getting skb's from upper layers.
+ * Getting skb's from upper layers will be enabled again after
+ * packets are released.
+ */
+ netif_stop_queue(dev);
+
+
+ /* Update statistics and start of transmittion time */
+ stats->tx_bytes += skb->len;
+ stats->tx_packets++;
+ dev->trans_start = jiffies;
+
+ spin_unlock_irqrestore(ðernet_priv->lock, flags);
+ return 0; /* success */
+}
+
+/**********************************************************************
+ * mv64340_eth_get_stats
+ *
+ * Returns a pointer to the interface statistics.
+ *
+ * Input : dev - a pointer to the required interface
+ *
+ * Output : a pointer to the interface's statistics
+ **********************************************************************/
+
+static struct net_device_stats *mv64340_eth_get_stats(struct net_device
+ *dev)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ unsigned int port_num;
+
+ ethernet_private = dev->priv;
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_num = port_private->port_num;
+
+ return &port_private->stats;
+}
+
+/**********************************************************************
+ * mv64340_eth_init
+ *
+ * First function called after registering the network device.
+ * It's purpose is to initialize the device as an ethernet device,
+ * fill the structure that was given in registration with pointers
+ * to functions, and setting the MAC address of the interface
+ *
+ * Input : number of port to initialize
+ * Output : -ENONMEM if failed , 0 if success
+ **********************************************************************/
+static int mv64340_eth_init(int port_num)
+{
+ ETH_PORT_INFO *ethernet_private;
+ struct mv64340_eth_priv *port_private;
+ struct net_device *dev;
+ int err;
+
+ dev = alloc_etherdev(sizeof(ETH_PORT_INFO));
+ if (!dev)
+ return -ENOMEM;
+
+ dev->open = mv64340_eth_open;
+ dev->stop = mv64340_eth_stop;
+ dev->hard_start_xmit = mv64340_eth_start_xmit;
+ dev->get_stats = mv64340_eth_get_stats;
+ dev->set_mac_address = mv64340_eth_set_mac_address;
+ dev->set_multicast_list = mv64340_eth_set_rx_mode;
+
+ /* No need to Tx Timeout */
+ dev->tx_timeout = mv64340_eth_tx_timeout;
+#ifdef MV64340_NAPI
+ dev->poll = mv64340_poll;
+ dev->weight = 64;
+#endif
+ dev->watchdog_timeo = 2 * HZ;
+ dev->tx_queue_len = MV64340_TX_QUEUE_SIZE;
+ dev->flags &= ~(IFF_RUNNING);
+ dev->base_addr = 0;
+ dev->change_mtu = &mv64340_eth_change_mtu;
+
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+#ifdef MAX_SKB_FRAGS
+#ifndef CONFIG_JAGUAR_DMALOW
+ /*
+ * Zero copy can only work if we use Discovery II memory. Else, we will
+ * have to map the buffers to ISA memory which is only 16 MB
+ */
+ dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_HW_CSUM;
+#endif
+#endif
+#endif
+
+ ethernet_private = dev->priv;
+
+ /* Allocate memory for stats data structure and spinlock etc... */
+ ethernet_private->port_private = (void *)
+ kmalloc(sizeof(struct mv64340_eth_priv), GFP_KERNEL);
+ if (!ethernet_private->port_private) {
+ err = -ENOMEM;
+ goto out_free_dev;
+ }
+ memset(ethernet_private->port_private, 0,
+ sizeof(struct mv64340_eth_priv));
+ if (port_num == 0)
+ ethernet_private->port_num = ETH_0;
+ else if (port_num == 1)
+ ethernet_private->port_num = ETH_1;
+ else if (port_num == 2)
+ ethernet_private->port_num = ETH_2;
+ else {
+ printk(KERN_ERR "%s: Invalid port number\n", dev->name);
+ kfree(ethernet_private->port_private);
+
+ err = -ENODEV;
+ goto out_free_dev;
+ }
+
+ port_private =
+ (struct mv64340_eth_priv *) ethernet_private->port_private;
+ port_private->port_num = port_num;
+
+ memset(&port_private->stats, 0, sizeof(struct net_device_stats));
+
+ /* Configure the timeout task */
+ INIT_TQUEUE(ðernet_private->tx_timeout_task,
+ (void (*)(void *))mv64340_eth_tx_timeout_task, dev);
+
+ /* Init spinlock */
+ spin_lock_init(&port_private->lock);
+
+ /* set MAC addresses */
+ memcpy(dev->dev_addr, prom_mac_addr_base, 6);
+ dev->dev_addr[5] += port_num;
+
+ err = register_netdev(dev);
+ if (err)
+ goto out_free_dev;
+
+ printk(KERN_NOTICE "%s: port %d with MAC address %02x:%02x:%02x:%02x:%02x:%02x\n",
+ dev->name, port_num,
+ dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
+ dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+
+ if (dev->features & NETIF_F_SG)
+ printk("Scatter Gather Enabled ");
+
+ if (dev->features & NETIF_F_IP_CSUM)
+ printk("TX TCP/IP Checksumming Supported \n");
+
+ printk("RX TCP/UDP Checksum Offload ON, \n");
+ printk("TX and RX Interrupt Coalescing ON \n");
+
+#ifdef MV64340_NAPI
+ printk("RX NAPI Enabled \n");
+#endif
+
+ return 0;
+
+out_free_dev:
+ kfree(dev->priv); /* free_netdev(dev) in 2.6 */
+ kfree(dev);
+
+ return err;
+}
+
+/**********************************************************************
+ * mv64340_init_module
+ *
+ * Registers the network drivers into the Linux kernel
+ *
+ * Input : N/A
+ *
+ * Output : N/A
+ **********************************************************************/
+static int __init mv64340_init_module(void)
+{
+ printk(KERN_NOTICE "MV-64340 10/100/1000 Ethernet Driver\n");
+#ifdef CONFIG_MV64340_ETH_0
+ if (mv64340_eth_init(0)) {
+ printk(KERN_ERR
+ "Error registering MV-64360 ethernet port 0\n");
+ }
+#endif
+#ifdef CONFIG_MV64340_ETH_1
+ if (mv64340_eth_init(1)) {
+ printk(KERN_ERR
+ "Error registering MV-64360 ethernet port 1\n");
+ }
+#endif
+#ifdef CONFIG_MV64340_ETH_2
+ if (mv64340_eth_init(2)) {
+ printk(KERN_ERR
+ "Error registering MV-64360 ethernet port 2\n");
+ }
+#endif
+ return 0;
+}
+
+/**********************************************************************
+ * mv64340_cleanup_module
+ *
+ * Registers the network drivers into the Linux kernel
+ *
+ * Input : N/A
+ *
+ * Output : N/A
+ **********************************************************************/
+static void __init mv64340_cleanup_module(void)
+{
+ /* Nothing to do here ! it's not a removable module */
+}
+
+module_init(mv64340_init_module);
+module_exit(mv64340_cleanup_module);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Rabeeh Khoury, Assaf Hoffman, and Matthew Dharm");
+MODULE_DESCRIPTION("Ethernet driver for Marvell MV64340");
+
+/*************************************************************************
+**************************************************************************
+**************************************************************************
+* The second part is the low level driver of the gigE ethernet ports. *
+**************************************************************************
+**************************************************************************
+*************************************************************************/
+
+
+
+
+/********************************************************************************
+ * Marvell's Gigabit Ethernet controller low level driver
+ *
+ * DESCRIPTION:
+ * This file introduce low level API to Marvell's Gigabit Ethernet
+ * controller. This Gigabit Ethernet Controller driver API controls
+ * 1) Operations (i.e. port init, start, reset etc').
+ * 2) Data flow (i.e. port send, receive etc').
+ * Each Gigabit Ethernet port is controlled via ETH_PORT_INFO
+ * struct.
+ * This struct includes user configuration information as well as
+ * driver internal data needed for its operations.
+ *
+ * Supported Features:
+ * - This low level driver is OS independent. Allocating memory for
+ * the descriptor rings and buffers are not within the scope of
+ * this driver.
+ * - The user is free from Rx/Tx queue managing.
+ * - This low level driver introduce functionality API that enable
+ * the to operate Marvell's Gigabit Ethernet Controller in a
+ * convenient way.
+ * - Simple Gigabit Ethernet port operation API.
+ * - Simple Gigabit Ethernet port data flow API.
+ * - Data flow and operation API support per queue functionality.
+ * - Support cached descriptors for better performance.
+ * - Enable access to all four DRAM banks and internal SRAM memory
+ * spaces.
+ * - PHY access and control API.
+ * - Port control register configuration API.
+ * - Full control over Unicast and Multicast MAC configurations.
+ *
+ * Operation flow:
+ *
+ * Initialization phase
+ * This phase complete the initialization of the ETH_PORT_INFO
+ * struct.
+ * User information regarding port configuration has to be set
+ * prior to calling the port initialization routine.
+ *
+ * In this phase any port Tx/Rx activity is halted, MIB counters
+ * are cleared, PHY address is set according to user parameter and
+ * access to DRAM and internal SRAM memory spaces.
+ *
+ * Driver ring initialization
+ * Allocating memory for the descriptor rings and buffers is not
+ * within the scope of this driver. Thus, the user is required to
+ * allocate memory for the descriptors ring and buffers. Those
+ * memory parameters are used by the Rx and Tx ring initialization
+ * routines in order to curve the descriptor linked list in a form
+ * of a ring.
+ * Note: Pay special attention to alignment issues when using
+ * cached descriptors/buffers. In this phase the driver store
+ * information in the ETH_PORT_INFO struct regarding each queue
+ * ring.
+ *
+ * Driver start
+ * This phase prepares the Ethernet port for Rx and Tx activity.
+ * It uses the information stored in the ETH_PORT_INFO struct to
+ * initialize the various port registers.
+ *
+ * Data flow:
+ * All packet references to/from the driver are done using PKT_INFO
+ * struct.
+ * This struct is a unified struct used with Rx and Tx operations.
+ * This way the user is not required to be familiar with neither
+ * Tx nor Rx descriptors structures.
+ * The driver's descriptors rings are management by indexes.
+ * Those indexes controls the ring resources and used to indicate
+ * a SW resource error:
+ * 'current'
+ * This index points to the current available resource for use. For
+ * example in Rx process this index will point to the descriptor
+ * that will be passed to the user upon calling the receive routine.
+ * In Tx process, this index will point to the descriptor
+ * that will be assigned with the user packet info and transmitted.
+ * 'used'
+ * This index points to the descriptor that need to restore its
+ * resources. For example in Rx process, using the Rx buffer return
+ * API will attach the buffer returned in packet info to the
+ * descriptor pointed by 'used'. In Tx process, using the Tx
+ * descriptor return will merely return the user packet info with
+ * the command status of the transmitted buffer pointed by the
+ * 'used' index. Nevertheless, it is essential to use this routine
+ * to update the 'used' index.
+ * 'first'
+ * This index supports Tx Scatter-Gather. It points to the first
+ * descriptor of a packet assembled of multiple buffers. For example
+ * when in middle of Such packet we have a Tx resource error the
+ * 'curr' index get the value of 'first' to indicate that the ring
+ * returned to its state before trying to transmit this packet.
+ *
+ * Receive operation:
+ * The eth_port_receive API set the packet information struct,
+ * passed by the caller, with received information from the
+ * 'current' SDMA descriptor.
+ * It is the user responsibility to return this resource back
+ * to the Rx descriptor ring to enable the reuse of this source.
+ * Return Rx resource is done using the eth_rx_return_buff API.
+ *
+ * Transmit operation:
+ * The eth_port_send API supports Scatter-Gather which enables to
+ * send a packet spanned over multiple buffers. This means that
+ * for each packet info structure given by the user and put into
+ * the Tx descriptors ring, will be transmitted only if the 'LAST'
+ * bit will be set in the packet info command status field. This
+ * API also consider restriction regarding buffer alignments and
+ * sizes.
+ * The user must return a Tx resource after ensuring the buffer
+ * has been transmitted to enable the Tx ring indexes to update.
+ *
+ * BOARD LAYOUT
+ * This device is on-board. No jumper diagram is necessary.
+ *
+ * EXTERNAL INTERFACE
+ *
+ * Prior to calling the initialization routine eth_port_init() the user
+ * must set the following fields under ETH_PORT_INFO struct:
+ * port_num User Ethernet port number.
+ * port_mac_addr[6] User defined port MAC address.
+ * port_config User port configuration value.
+ * port_config_extend User port config extend value.
+ * port_sdma_config User port SDMA config value.
+ * port_serial_control User port serial control value.
+ * *port_private User scratch pad for user specific data structures.
+ *
+ * This driver introduce a set of default values:
+ * PORT_CONFIG_VALUE Default port configuration value
+ * PORT_CONFIG_EXTEND_VALUE Default port extend configuration value
+ * PORT_SDMA_CONFIG_VALUE Default sdma control value
+ * PORT_SERIAL_CONTROL_VALUE Default port serial control value
+ *
+ * This driver data flow is done using the PKT_INFO struct which is
+ * a unified struct for Rx and Tx operations:
+ * byte_cnt Tx/Rx descriptor buffer byte count.
+ * l4i_chk CPU provided TCP Checksum. For Tx operation only.
+ * cmd_sts Tx/Rx descriptor command status.
+ * buf_ptr Tx/Rx descriptor buffer pointer.
+ * return_info Tx/Rx user resource return information.
+ *
+ *******************************************************************************/
+/* includes */
+
+/* defines */
+/* SDMA command macros */
+#define ETH_ENABLE_TX_QUEUE(eth_port) \
+ MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port), 1)
+
+#define ETH_DISABLE_TX_QUEUE(eth_port) \
+ MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port), (1 << 8))
+
+#define ETH_ENABLE_RX_QUEUE(rx_queue, eth_port) \
+MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port), (1 << rx_queue))
+
+#define ETH_DISABLE_RX_QUEUE(rx_queue, eth_port) \
+MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port), (1 << (8 + rx_queue)))
+
+#define LINK_UP_TIMEOUT 100000
+#define PHY_BUSY_TIMEOUT 10000000
+
+/* locals */
+
+/* PHY routines */
+#ifdef MDD_CUT
+static void ethernet_phy_set(ETH_PORT eth_port_num, int phy_addr);
+#endif
+static int ethernet_phy_get(ETH_PORT eth_port_num);
+
+/* Ethernet Port routines */
+static bool eth_port_uc_addr(ETH_PORT eth_port_num,
+ unsigned char uc_nibble, int option);
+
+#ifdef MDD_CUT
+static void eth_b_copy(unsigned int src_addr, unsigned int dst_addr,
+ int byte_count);
+#endif
+
+/*******************************************************************************
+* eth_port_init - Initialize the Ethernet port driver
+*
+* DESCRIPTION:
+* This function prepares the ethernet port to start its activity:
+* 1) Completes the ethernet port driver struct initialization toward port
+* start routine.
+* 2) Resets the device to a quiescent state in case of warm reboot.
+* 3) Enable SDMA access to all four DRAM banks as well as internal SRAM.
+* 4) Clean MAC tables. The reset status of those tables is unknown.
+* 5) Set PHY address.
+* Note: Call this routine prior to eth_port_start routine and after setting
+* user values in the user fields of Ethernet port control struct.
+*
+* INPUT:
+* ETH_PORT_INFO *p_eth_port_ctrl Ethernet port control struct
+*
+* OUTPUT:
+* See description.
+*
+* RETURN:
+* None.
+*
+*******************************************************************************/
+static void eth_port_init(ETH_PORT_INFO * p_eth_port_ctrl)
+{
+ p_eth_port_ctrl->port_config = PORT_CONFIG_VALUE;
+ p_eth_port_ctrl->port_config_extend = PORT_CONFIG_EXTEND_VALUE;
+#if defined(__BIG_ENDIAN)
+ p_eth_port_ctrl->port_sdma_config = PORT_SDMA_CONFIG_VALUE;
+#elif defined(__LITTLE_ENDIAN)
+ p_eth_port_ctrl->port_sdma_config = PORT_SDMA_CONFIG_VALUE |
+ ETH_BLM_RX_NO_SWAP | ETH_BLM_TX_NO_SWAP;
+#else
+#error One of __LITTLE_ENDIAN or __BIG_ENDIAN must be defined!
+#endif
+ p_eth_port_ctrl->port_serial_control = PORT_SERIAL_CONTROL_VALUE;
+
+ p_eth_port_ctrl->port_rx_queue_command = 0;
+ p_eth_port_ctrl->port_tx_queue_command = 0;
+
+ p_eth_port_ctrl->rx_resource_err = false;
+ p_eth_port_ctrl->tx_resource_err = false;
+
+ eth_port_reset(p_eth_port_ctrl->port_num);
+
+ eth_port_init_mac_tables(p_eth_port_ctrl->port_num);
+
+ ethernet_phy_reset(p_eth_port_ctrl->port_num);
+}
+
+/*******************************************************************************
+* eth_port_start - Start the Ethernet port activity.
+*
+* DESCRIPTION:
+* This routine prepares the Ethernet port for Rx and Tx activity:
+* 1. Initialize Tx and Rx Current Descriptor Pointer for each queue that
+* has been initialized a descriptor's ring (using ether_init_tx_desc_ring
+* for Tx and ether_init_rx_desc_ring for Rx)
+* 2. Initialize and enable the Ethernet configuration port by writing to
+* the port's configuration and command registers.
+* 3. Initialize and enable the SDMA by writing to the SDMA's
+* configuration and command registers.
+* After completing these steps, the ethernet port SDMA can starts to
+* perform Rx and Tx activities.
+*
+* Note: Each Rx and Tx queue descriptor's list must be initialized prior
+* to calling this function (use ether_init_tx_desc_ring for Tx queues and
+* ether_init_rx_desc_ring for Rx queues).
+*
+* INPUT:
+* ETH_PORT_INFO *p_eth_port_ctrl Ethernet port control struct
+*
+* OUTPUT:
+* Ethernet port is ready to receive and transmit.
+*
+* RETURN:
+* false if the port PHY is not up.
+* true otherwise.
+*
+*******************************************************************************/
+static bool eth_port_start(ETH_PORT_INFO * p_eth_port_ctrl)
+{
+ int tx_curr_desc;
+ int rx_curr_desc;
+ unsigned int phy_reg_data;
+ ETH_PORT eth_port_num = p_eth_port_ctrl->port_num;
+
+ /* Assignment of Tx CTRP of given queue */
+ tx_curr_desc = p_eth_port_ctrl->tx_curr_desc_q;
+ MV_WRITE(MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(eth_port_num),
+ (u32)&(p_eth_port_ctrl->p_tx_desc_area[tx_curr_desc]));
+
+ /* Assignment of Rx CRDP of given queue */
+ rx_curr_desc = p_eth_port_ctrl->rx_curr_desc_q;
+ MV_WRITE(MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(eth_port_num),
+ virt_to_bus(&(p_eth_port_ctrl->p_rx_desc_area[rx_curr_desc])));
+
+ /* Add the assigned Ethernet address to the port's address table */
+ eth_port_uc_addr_set(p_eth_port_ctrl->port_num,
+ p_eth_port_ctrl->port_mac_addr);
+
+ /* Assign port configuration and command. */
+ MV_WRITE(MV64340_ETH_PORT_CONFIG_REG(eth_port_num),
+ p_eth_port_ctrl->port_config);
+
+ MV_WRITE(MV64340_ETH_PORT_CONFIG_EXTEND_REG(eth_port_num),
+ p_eth_port_ctrl->port_config_extend);
+
+ MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num),
+ p_eth_port_ctrl->port_serial_control);
+
+ MV_SET_REG_BITS(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num),
+ ETH_SERIAL_PORT_ENABLE);
+
+ /* Assign port SDMA configuration */
+ MV_WRITE(MV64340_ETH_SDMA_CONFIG_REG(eth_port_num),
+ p_eth_port_ctrl->port_sdma_config);
+
+ /* Enable port Rx. */
+ MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port_num),
+ p_eth_port_ctrl->port_rx_queue_command);
+
+ /* Check if link is up */
+ eth_port_read_smi_reg(eth_port_num, 1, &phy_reg_data);
+
+ if (!(phy_reg_data & 0x20))
+ return false;
+
+ return true;
+}
+
+/*******************************************************************************
+* eth_port_uc_addr_set - This function Set the port Unicast address.
+*
+* DESCRIPTION:
+* This function Set the port Ethernet MAC address.
+*
+* INPUT:
+* ETH_PORT eth_port_num Port number.
+* char * p_addr Address to be set
+*
+* OUTPUT:
+* Set MAC address low and high registers. also calls eth_port_uc_addr()
+* To set the unicast table with the proper information.
+*
+* RETURN:
+* N/A.
+*
+*******************************************************************************/
+static void eth_port_uc_addr_set(ETH_PORT eth_port_num,
+ unsigned char *p_addr)
+{
+ unsigned int mac_h;
+ unsigned int mac_l;
+
+ mac_l = (p_addr[4] << 8) | (p_addr[5]);
+ mac_h = (p_addr[0] << 24) | (p_addr[1] << 16) |
+ (p_addr[2] << 8) | (p_addr[3] << 0);
+
+ MV_WRITE(MV64340_ETH_MAC_ADDR_LOW(eth_port_num), mac_l);
+ MV_WRITE(MV64340_ETH_MAC_ADDR_HIGH(eth_port_num), mac_h);
+
+ /* Accept frames of this address */
+ eth_port_uc_addr(eth_port_num, p_addr[5], ACCEPT_MAC_ADDR);
+
+ return;
+}
+
+/*******************************************************************************
+* eth_port_uc_addr - This function Set the port unicast address table
+*
+* DESCRIPTION:
+* This function locates the proper entry in the Unicast table for the
+* specified MAC nibble and sets its properties according to function
+* parameters.
+*
+* INPUT:
+* ETH_PORT eth_port_num Port number.
+* unsigned char uc_nibble Unicast MAC Address last nibble.
+* int option 0 = Add, 1 = remove address.
+*
+* OUTPUT:
+* This function add/removes MAC addresses from the port unicast address
+* table.
+*
+* RETURN:
+* true is output succeeded.
+* false if option parameter is invalid.
+*
+*******************************************************************************/
+static bool eth_port_uc_addr(ETH_PORT eth_port_num,
+ unsigned char uc_nibble, int option)
+{
+ unsigned int unicast_reg;
+ unsigned int tbl_offset;
+ unsigned int reg_offset;
+
+ /* Locate the Unicast table entry */
+ uc_nibble = (0xf & uc_nibble);
+ tbl_offset = (uc_nibble / 4) * 4; /* Register offset from unicast table base */
+ reg_offset = uc_nibble % 4; /* Entry offset within the above register */
+
+ switch (option) {
+ case REJECT_MAC_ADDR:
+ /* Clear accepts frame bit at specified unicast DA table entry */
+ unicast_reg =
+ MV_READ_DATA(
+ (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
+ (eth_port_num) + tbl_offset));
+
+ unicast_reg &= (0x0E << (8 * reg_offset));
+
+ MV_WRITE(
+ (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
+ (eth_port_num) + tbl_offset), unicast_reg);
+ break;
+
+ case ACCEPT_MAC_ADDR:
+ /* Set accepts frame bit at unicast DA filter table entry */
+ unicast_reg =
+ MV_READ_DATA(
+ (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
+ (eth_port_num) + tbl_offset));
+
+ unicast_reg |= (0x01 << (8 * reg_offset));
+
+ MV_WRITE(
+ (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
+ (eth_port_num) + tbl_offset), unicast_reg);
+
+ break;
+
+ default:
+ return false;
+ }
+ return true;
+}
+
+/*******************************************************************************
+* eth_port_init_mac_tables - Clear all entrance in the UC, SMC and OMC tables
+*
+* DESCRIPTION:
+* Go through all the DA filter tables (Unicast, Special Multicast & Other
+* Multicast) and set each entry to 0.
+*
+* INPUT:
+* ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+*
+* OUTPUT:
+* Multicast and Unicast packets are rejected.
+*
+* RETURN:
+* None.
+*
+*******************************************************************************/
+static void eth_port_init_mac_tables(ETH_PORT eth_port_num)
+{
+ int table_index;
+
+ /* Clear DA filter unicast table (Ex_dFUT) */
+ for (table_index = 0; table_index <= 0xC; table_index += 4)
+ MV_WRITE(
+ (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
+ (eth_port_num) + table_index), 0);
+
+ for (table_index = 0; table_index <= 0xFC; table_index += 4) {
+ /* Clear DA filter special multicast table (Ex_dFSMT) */
+ MV_WRITE(
+ (MV64340_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE
+ (eth_port_num) + table_index), 0);
+ /* Clear DA filter other multicast table (Ex_dFOMT) */
+ MV_WRITE((MV64340_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE
+ (eth_port_num) + table_index), 0);
+ }
+}
+
+/*******************************************************************************
+* eth_clear_mib_counters - Clear all MIB counters
+*
+* DESCRIPTION:
+* This function clears all MIB counters of a specific ethernet port.
+* A read from the MIB counter will reset the counter.
+*
+* INPUT:
+* ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+*
+* OUTPUT:
+* After reading all MIB counters, the counters resets.
+*
+* RETURN:
+* MIB counter value.
+*
+*******************************************************************************/
+static void eth_clear_mib_counters(ETH_PORT eth_port_num)
+{
+ int i;
+ unsigned int dummy;
+
+ /* Perform dummy reads from MIB counters */
+ for (i = ETH_MIB_GOOD_OCTETS_RECEIVED_LOW;
+ i < ETH_MIB_LATE_COLLISION; i += 4)
+ dummy =
+ MV_READ_DATA(
+ (MV64340_ETH_MIB_COUNTERS_BASE
+ (eth_port_num) + i));
+
+ return;
+}
+
+
+#ifdef MDD_CUT
+/*******************************************************************************
+* ethernet_phy_set - Set the ethernet port PHY address.
+*
+* DESCRIPTION:
+* This routine set the ethernet port PHY address according to given
+* parameter.
+*
+* INPUT:
+* ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+*
+* OUTPUT:
+* Set PHY Address Register with given PHY address parameter.
+*
+* RETURN:
+* None.
+*
+*******************************************************************************/
+static void ethernet_phy_set(ETH_PORT eth_port_num, int phy_addr)
+{
+ unsigned int reg_data;
+
+ reg_data = MV_READ_DATA(MV64340_ETH_PHY_ADDR_REG);
+
+ reg_data &= ~(0x1F << (5 * eth_port_num));
+ reg_data |= (phy_addr << (5 * eth_port_num));
+
+ MV_WRITE(MV64340_ETH_PHY_ADDR_REG, reg_data);
+
+ return;
+}
+#endif
+
+/*******************************************************************************
+ * ethernet_phy_get - Get the ethernet port PHY address.
+ *
+ * DESCRIPTION:
+ * This routine returns the given ethernet port PHY address.
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+ *
+ * OUTPUT:
+ * None.
+ *
+ * RETURN:
+ * PHY address.
+ *
+ *******************************************************************************/
+static int ethernet_phy_get(ETH_PORT eth_port_num)
+{
+ unsigned int reg_data;
+
+ reg_data = MV_READ_DATA(MV64340_ETH_PHY_ADDR_REG);
+
+ return ((reg_data >> (5 * eth_port_num)) & 0x1f);
+}
+
+/*******************************************************************************
+ * ethernet_phy_reset - Reset Ethernet port PHY.
+ *
+ * DESCRIPTION:
+ * This routine utilize the SMI interface to reset the ethernet port PHY.
+ * The routine waits until the link is up again or link up is timeout.
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+ *
+ * OUTPUT:
+ * The ethernet port PHY renew its link.
+ *
+ * RETURN:
+ * None.
+ *
+*******************************************************************************/
+static bool ethernet_phy_reset(ETH_PORT eth_port_num)
+{
+ unsigned int time_out = 50;
+ unsigned int phy_reg_data;
+
+ /* Reset the PHY */
+ eth_port_read_smi_reg(eth_port_num, 0, &phy_reg_data);
+ phy_reg_data |= 0x8000; /* Set bit 15 to reset the PHY */
+ eth_port_write_smi_reg(eth_port_num, 0, phy_reg_data);
+
+ /* Poll on the PHY LINK */
+ do {
+ eth_port_read_smi_reg(eth_port_num, 1, &phy_reg_data);
+
+ if (time_out-- == 0)
+ return false;
+ }
+ while (!(phy_reg_data & 0x20));
+
+ return true;
+}
+
+/*******************************************************************************
+ * eth_port_reset - Reset Ethernet port
+ *
+ * DESCRIPTION:
+ * This routine resets the chip by aborting any SDMA engine activity and
+ * clearing the MIB counters. The Receiver and the Transmit unit are in
+ * idle state after this command is performed and the port is disabled.
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+ *
+ * OUTPUT:
+ * Channel activity is halted.
+ *
+ * RETURN:
+ * None.
+ *
+ *******************************************************************************/
+static void eth_port_reset(ETH_PORT eth_port_num)
+{
+ unsigned int reg_data;
+
+ /* Stop Tx port activity. Check port Tx activity. */
+ reg_data =
+ MV_READ_DATA(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port_num));
+
+ if (reg_data & 0xFF) {
+ /* Issue stop command for active channels only */
+ MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG
+ (eth_port_num), (reg_data << 8));
+
+ /* Wait for all Tx activity to terminate. */
+ do {
+ /* Check port cause register that all Tx queues are stopped */
+ reg_data =
+ MV_READ_DATA
+ (MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG
+ (eth_port_num));
+ }
+ while (reg_data & 0xFF);
+ }
+
+ /* Stop Rx port activity. Check port Rx activity. */
+ reg_data =
+ MV_READ_DATA(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG
+ (eth_port_num));
+
+ if (reg_data & 0xFF) {
+ /* Issue stop command for active channels only */
+ MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG
+ (eth_port_num), (reg_data << 8));
+
+ /* Wait for all Rx activity to terminate. */
+ do {
+ /* Check port cause register that all Rx queues are stopped */
+ reg_data =
+ MV_READ_DATA
+ (MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG
+ (eth_port_num));
+ }
+ while (reg_data & 0xFF);
+ }
+
+
+ /* Clear all MIB counters */
+ eth_clear_mib_counters(eth_port_num);
+
+ /* Reset the Enable bit in the Configuration Register */
+ reg_data =
+ MV_READ_DATA(MV64340_ETH_PORT_SERIAL_CONTROL_REG (eth_port_num));
+ reg_data &= ~ETH_SERIAL_PORT_ENABLE;
+ MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num), reg_data);
+
+ return;
+}
+
+/*******************************************************************************
+ * ethernet_set_config_reg - Set specified bits in configuration register.
+ *
+ * DESCRIPTION:
+ * This function sets specified bits in the given ethernet
+ * configuration register.
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+ * unsigned int value 32 bit value.
+ *
+ * OUTPUT:
+ * The set bits in the value parameter are set in the configuration
+ * register.
+ *
+ * RETURN:
+ * None.
+ *
+ *******************************************************************************/
+static void ethernet_set_config_reg(ETH_PORT eth_port_num,
+ unsigned int value)
+{
+ unsigned int eth_config_reg;
+
+ eth_config_reg =
+ MV_READ_DATA(MV64340_ETH_PORT_CONFIG_REG(eth_port_num));
+ eth_config_reg |= value;
+ MV_WRITE(MV64340_ETH_PORT_CONFIG_REG(eth_port_num),
+ eth_config_reg);
+
+ return;
+}
+
+/*******************************************************************************
+ * ethernet_get_config_reg - Get the port configuration register
+ *
+ * DESCRIPTION:
+ * This function returns the configuration register value of the given
+ * ethernet port.
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+ *
+ * OUTPUT:
+ * None.
+ *
+ * RETURN:
+ * Port configuration register value.
+ *
+ *******************************************************************************/
+static unsigned int ethernet_get_config_reg(ETH_PORT eth_port_num)
+{
+ unsigned int eth_config_reg;
+
+ eth_config_reg = MV_READ_DATA(MV64340_ETH_PORT_CONFIG_EXTEND_REG
+ (eth_port_num));
+ return eth_config_reg;
+}
+
+
+/*******************************************************************************
+ * eth_port_read_smi_reg - Read PHY registers
+ *
+ * DESCRIPTION:
+ * This routine utilize the SMI interface to interact with the PHY in
+ * order to perform PHY register read.
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+ * unsigned int phy_reg PHY register address offset.
+ * unsigned int *value Register value buffer.
+ *
+ * OUTPUT:
+ * Write the value of a specified PHY register into given buffer.
+ *
+ * RETURN:
+ * false if the PHY is busy or read data is not in valid state.
+ * true otherwise.
+ *
+ *******************************************************************************/
+static bool eth_port_read_smi_reg(ETH_PORT eth_port_num,
+ unsigned int phy_reg,
+ unsigned int *value)
+{
+ unsigned int reg_value;
+ unsigned int time_out = PHY_BUSY_TIMEOUT;
+ int phy_addr;
+
+ phy_addr = ethernet_phy_get(eth_port_num);
+
+ /* first check that it is not busy */
+ do {
+ reg_value = MV_READ_DATA(MV64340_ETH_SMI_REG);
+ if (time_out-- == 0) {
+ return false;
+ }
+ }
+ while (reg_value & ETH_SMI_BUSY);
+
+ /* not busy */
+
+ MV_WRITE(MV64340_ETH_SMI_REG,
+ (phy_addr << 16) | (phy_reg << 21) | ETH_SMI_OPCODE_READ);
+
+ time_out = PHY_BUSY_TIMEOUT; /* initialize the time out var again */
+
+ do {
+ reg_value = MV_READ_DATA(MV64340_ETH_SMI_REG);
+ if (time_out-- == 0) {
+ return false;
+ }
+ }
+ while (reg_value & ETH_SMI_READ_VALID);
+
+ /* Wait for the data to update in the SMI register */
+ for (time_out = 0; time_out < PHY_BUSY_TIMEOUT; time_out++);
+
+ reg_value = MV_READ_DATA(MV64340_ETH_SMI_REG);
+
+ *value = reg_value & 0xffff;
+
+ return true;
+}
+
+/*******************************************************************************
+ * eth_port_write_smi_reg - Write to PHY registers
+ *
+ * DESCRIPTION:
+ * This routine utilize the SMI interface to interact with the PHY in
+ * order to perform writes to PHY registers.
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet Port number. See ETH_PORT enum.
+ * unsigned int phy_reg PHY register address offset.
+ * unsigned int value Register value.
+ *
+ * OUTPUT:
+ * Write the given value to the specified PHY register.
+ *
+ * RETURN:
+ * false if the PHY is busy.
+ * true otherwise.
+ *
+ *******************************************************************************/
+static bool eth_port_write_smi_reg(ETH_PORT eth_port_num,
+ unsigned int phy_reg,
+ unsigned int value)
+{
+ unsigned int reg_value;
+ unsigned int time_out = PHY_BUSY_TIMEOUT;
+ int phy_addr;
+
+ phy_addr = ethernet_phy_get(eth_port_num);
+
+ /* first check that it is not busy */
+ do {
+ reg_value = MV_READ_DATA(MV64340_ETH_SMI_REG);
+ if (time_out-- == 0) {
+ return false;
+ }
+ }
+ while (reg_value & ETH_SMI_BUSY);
+
+ /* not busy */
+ MV_WRITE(MV64340_ETH_SMI_REG, (phy_addr << 16) | (phy_reg << 21) |
+ ETH_SMI_OPCODE_WRITE | (value & 0xffff));
+ return true;
+}
+
+/*******************************************************************************
+ * ether_init_rx_desc_ring - Curve a Rx chain desc list and buffer in memory.
+ *
+ * DESCRIPTION:
+ * This function prepares a Rx chained list of descriptors and packet
+ * buffers in a form of a ring. The routine must be called after port
+ * initialization routine and before port start routine.
+ * The Ethernet SDMA engine uses CPU bus addresses to access the various
+ * devices in the system (i.e. DRAM). This function uses the ethernet
+ * struct 'virtual to physical' routine (set by the user) to set the ring
+ * with physical addresses.
+ *
+ * INPUT:
+ * ETH_PORT_INFO *p_eth_port_ctrl Ethernet Port Control srtuct.
+ * int rx_desc_num Number of Rx descriptors
+ * int rx_buff_size Size of Rx buffer
+ * unsigned int rx_desc_base_addr Rx descriptors memory area base addr.
+ * unsigned int rx_buff_base_addr Rx buffer memory area base addr.
+ *
+ * OUTPUT:
+ * The routine updates the Ethernet port control struct with information
+ * regarding the Rx descriptors and buffers.
+ *
+ * RETURN:
+ * false if the given descriptors memory area is not aligned according to
+ * Ethernet SDMA specifications.
+ * true otherwise.
+ *
+ *******************************************************************************/
+static bool ether_init_rx_desc_ring(ETH_PORT_INFO * p_eth_port_ctrl,
+ int rx_desc_num,
+ int rx_buff_size,
+ unsigned long rx_desc_base_addr,
+ unsigned long rx_buff_base_addr)
+{
+ volatile ETH_RX_DESC* p_rx_desc;
+ unsigned long buffer_addr;
+ int ix; /* a counter */
+
+ buffer_addr = rx_buff_base_addr;
+
+ p_rx_desc = (ETH_RX_DESC *) rx_desc_base_addr;
+
+ /* Rx desc Must be 4LW aligned (i.e. Descriptor_Address[3:0]=0000). */
+ if (rx_buff_base_addr & 0xF)
+ return false;
+
+ /* Rx buffers are limited to 64K bytes and Minimum size is 8 bytes */
+ if ((rx_buff_size < 8) || (rx_buff_size > RX_BUFFER_MAX_SIZE))
+ return false;
+
+ /* Rx buffers must be 64-bit aligned. */
+ if ((rx_buff_base_addr + rx_buff_size) & 0x7)
+ return false;
+
+ /* initialize the Rx descriptors ring */
+ for (ix = 0; ix < rx_desc_num; ix++) {
+ p_rx_desc[ix].buf_size = rx_buff_size;
+ p_rx_desc[ix].byte_cnt = 0x0000;
+ p_rx_desc[ix].cmd_sts =
+ ETH_BUFFER_OWNED_BY_DMA | ETH_RX_ENABLE_INTERRUPT;
+ p_rx_desc[ix].next_desc_ptr = virt_to_bus(&(p_rx_desc[ix+1]));
+ p_rx_desc[ix].buf_ptr = buffer_addr;
+
+ dma_cache_wback_inv((unsigned long)p_rx_desc, sizeof(ETH_RX_DESC));
+ p_eth_port_ctrl->rx_skb[ix] = NULL;
+ buffer_addr += rx_buff_size;
+ }
+
+ /* Closing Rx descriptors ring */
+ p_rx_desc[rx_desc_num-1].next_desc_ptr = virt_to_bus(&(p_rx_desc[0]));
+ dma_cache_wback_inv((unsigned long)p_rx_desc, sizeof(ETH_RX_DESC));
+
+ /* Save Rx desc pointer to driver struct. */
+ p_eth_port_ctrl->rx_curr_desc_q = 0;
+ p_eth_port_ctrl->rx_used_desc_q = 0;
+
+ p_eth_port_ctrl->p_rx_desc_area = (ETH_RX_DESC *) rx_desc_base_addr;
+ p_eth_port_ctrl->rx_desc_area_size = rx_desc_num * sizeof(ETH_RX_DESC);
+
+ p_eth_port_ctrl->port_rx_queue_command |= 1;
+
+ return true;
+}
+
+/*******************************************************************************
+ * ether_init_tx_desc_ring - Curve a Tx chain desc list and buffer in memory.
+ *
+ * DESCRIPTION:
+ * This function prepares a Tx chained list of descriptors and packet
+ * buffers in a form of a ring. The routine must be called after port
+ * initialization routine and before port start routine.
+ * The Ethernet SDMA engine uses CPU bus addresses to access the various
+ * devices in the system (i.e. DRAM). This function uses the ethernet
+ * struct 'virtual to physical' routine (set by the user) to set the ring
+ * with physical addresses.
+ *
+ * INPUT:
+ * ETH_PORT_INFO *p_eth_port_ctrl Ethernet Port Control srtuct.
+ * int tx_desc_num Number of Tx descriptors
+ * int tx_buff_size Size of Tx buffer
+ * unsigned int tx_desc_base_addr Tx descriptors memory area base addr.
+ *
+ * OUTPUT:
+ * The routine updates the Ethernet port control struct with information
+ * regarding the Tx descriptors and buffers.
+ *
+ * RETURN:
+ * false if the given descriptors memory area is not aligned according to
+ * Ethernet SDMA specifications.
+ * true otherwise.
+ *
+ *******************************************************************************/
+static bool ether_init_tx_desc_ring(ETH_PORT_INFO * p_eth_port_ctrl,
+ int tx_desc_num,
+ unsigned long tx_desc_base_addr)
+{
+
+ ETH_TX_DESC *p_tx_desc;
+ int ix; /* a counter */
+
+ /* Tx desc Must be 4LW aligned (i.e. Descriptor_Address[3:0]=0000). */
+ if (tx_desc_base_addr & 0xF)
+ return false;
+
+ /* save the first desc pointer to link with the last descriptor */
+ p_tx_desc = (ETH_TX_DESC *) tx_desc_base_addr;
+
+ /* Initialize the Tx descriptors ring */
+ for (ix = 0; ix < tx_desc_num; ix++) {
+ p_tx_desc[ix].byte_cnt = 0x0000;
+ p_tx_desc[ix].l4i_chk = 0x0000;
+ p_tx_desc[ix].cmd_sts = 0x00000000;
+ p_tx_desc[ix].next_desc_ptr = (u32)&(p_tx_desc[ix+1]);
+ p_tx_desc[ix].buf_ptr = 0x00000000;
+ dma_cache_wback_inv((unsigned long)&(p_tx_desc[ix]), sizeof(ETH_TX_DESC));
+ p_eth_port_ctrl->tx_skb[ix] = NULL;
+ }
+
+ /* Closing Tx descriptors ring */
+ p_tx_desc[tx_desc_num-1].next_desc_ptr = (u32)&(p_tx_desc[0]);
+ dma_cache_wback_inv((unsigned long)&(p_tx_desc[tx_desc_num-1]),
+ sizeof(ETH_TX_DESC));
+
+ /* Set Tx desc pointer in driver struct. */
+ p_eth_port_ctrl->tx_curr_desc_q = 0;
+ p_eth_port_ctrl->tx_used_desc_q = 0;
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+ p_eth_port_ctrl->tx_first_desc_q = 0;
+#endif
+ /* Init Tx ring base and size parameters */
+ p_eth_port_ctrl->p_tx_desc_area = (ETH_TX_DESC*) tx_desc_base_addr;
+ p_eth_port_ctrl->tx_desc_area_size = tx_desc_num * sizeof(ETH_TX_DESC);
+
+ /* Add the queue to the list of Tx queues of this port */
+ p_eth_port_ctrl->port_tx_queue_command |= 1;
+
+ return true;
+}
+
+/*******************************************************************************
+ * eth_port_send - Send an Ethernet packet
+ *
+ * DESCRIPTION:
+ * This routine send a given packet described by p_pktinfo parameter. It
+ * supports transmitting of a packet spaned over multiple buffers. The
+ * routine updates 'curr' and 'first' indexes according to the packet
+ * segment passed to the routine. In case the packet segment is first,
+ * the 'first' index is update. In any case, the 'curr' index is updated.
+ * If the routine get into Tx resource error it assigns 'curr' index as
+ * 'first'. This way the function can abort Tx process of multiple
+ * descriptors per packet.
+ *
+ * INPUT:
+ * ETH_PORT_INFO *p_eth_port_ctrl Ethernet Port Control srtuct.
+ * PKT_INFO *p_pkt_info User packet buffer.
+ *
+ * OUTPUT:
+ * Tx ring 'curr' and 'first' indexes are updated.
+ *
+ * RETURN:
+ * ETH_QUEUE_FULL in case of Tx resource error.
+ * ETH_ERROR in case the routine can not access Tx desc ring.
+ * ETH_QUEUE_LAST_RESOURCE if the routine uses the last Tx resource.
+ * ETH_OK otherwise.
+ *
+ *******************************************************************************/
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+/*
+ * Modified to include the first descriptor pointer in case of SG
+ */
+static ETH_FUNC_RET_STATUS eth_port_send(ETH_PORT_INFO * p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info)
+{
+ int tx_desc_curr, tx_desc_used, tx_first_desc, tx_next_desc;
+ volatile ETH_TX_DESC* current_descriptor;
+ volatile ETH_TX_DESC* first_descriptor;
+ u32 command_status, first_chip_ptr;
+
+ /* Do not process Tx ring in case of Tx ring resource error */
+ if (p_eth_port_ctrl->tx_resource_err == true)
+ return ETH_QUEUE_FULL;
+
+ /* Get the Tx Desc ring indexes */
+ tx_desc_curr = p_eth_port_ctrl->tx_curr_desc_q;
+ tx_desc_used = p_eth_port_ctrl->tx_used_desc_q;
+
+ current_descriptor = &(p_eth_port_ctrl->p_tx_desc_area[tx_desc_curr]);
+ if (current_descriptor == NULL)
+ return ETH_ERROR;
+
+ tx_next_desc = (tx_desc_curr + 1) % MV64340_TX_QUEUE_SIZE;
+ command_status = p_pkt_info->cmd_sts | ETH_ZERO_PADDING | ETH_GEN_CRC;
+
+ if (command_status & ETH_TX_FIRST_DESC) {
+ tx_first_desc = tx_desc_curr;
+ p_eth_port_ctrl->tx_first_desc_q = tx_first_desc;
+
+ /* fill first descriptor */
+ first_descriptor = &(p_eth_port_ctrl->p_tx_desc_area[tx_desc_curr]);
+ first_descriptor->l4i_chk = p_pkt_info->l4i_chk;
+ first_descriptor->cmd_sts = command_status;
+ first_descriptor->byte_cnt = p_pkt_info->byte_cnt;
+ first_descriptor->buf_ptr = p_pkt_info->buf_ptr;
+ first_descriptor->next_desc_ptr = (u32)&(p_eth_port_ctrl->p_tx_desc_area[tx_next_desc]);
+ dma_cache_wback_inv((u32)first_descriptor, sizeof(ETH_TX_DESC));
+ wmb();
+ }
+ else {
+ tx_first_desc = p_eth_port_ctrl->tx_first_desc_q;
+ first_descriptor = &(p_eth_port_ctrl->p_tx_desc_area[tx_first_desc]);
+ if (first_descriptor == NULL) {
+ printk("First desc is NULL !!\n");
+ return ETH_ERROR;
+ }
+ if (command_status & ETH_TX_LAST_DESC)
+ current_descriptor->next_desc_ptr = 0x00000000;
+ else {
+ command_status |= ETH_BUFFER_OWNED_BY_DMA;
+ current_descriptor->next_desc_ptr = (u32)&(p_eth_port_ctrl->p_tx_desc_area[tx_next_desc]);
+ }
+ }
+
+ if (p_pkt_info->byte_cnt < 8) {
+ printk(" < 8 problem \n");
+ return ETH_ERROR;
+ }
+
+ current_descriptor->buf_ptr = p_pkt_info->buf_ptr;
+ current_descriptor->byte_cnt = p_pkt_info->byte_cnt;
+ current_descriptor->l4i_chk = p_pkt_info->l4i_chk;
+ current_descriptor->cmd_sts = command_status;
+ dma_cache_wback_inv((u32)current_descriptor, sizeof(ETH_TX_DESC));
+
+ p_eth_port_ctrl->tx_skb[tx_desc_curr] =
+ (struct sk_buff*)p_pkt_info->return_info;
+
+ dma_cache_wback_inv((u32)p_eth_port_ctrl, sizeof(ETH_PORT_INFO));
+ wmb();
+
+ /* Set last desc with DMA ownership and interrupt enable. */
+ if (command_status & ETH_TX_LAST_DESC) {
+ current_descriptor->cmd_sts = command_status |
+ ETH_TX_ENABLE_INTERRUPT |
+ ETH_BUFFER_OWNED_BY_DMA;
+
+ if (!(command_status & ETH_TX_FIRST_DESC) ) {
+ first_descriptor->cmd_sts |= ETH_BUFFER_OWNED_BY_DMA;
+ dma_cache_wback_inv((u32)first_descriptor, sizeof(ETH_TX_DESC));
+ }
+ dma_cache_wback_inv((u32)current_descriptor, sizeof(ETH_TX_DESC));
+ wmb();
+
+ first_chip_ptr = MV_READ_DATA(MV64340_ETH_CURRENT_SERVED_TX_DESC_PTR(p_eth_port_ctrl->port_num));
+
+ /* Apply send command */
+ if (first_chip_ptr == 0x00000000) {
+ MV_WRITE(MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(p_eth_port_ctrl->port_num), (u32)&(p_eth_port_ctrl->p_tx_desc_area[tx_first_desc]));
+ }
+
+ ETH_ENABLE_TX_QUEUE(p_eth_port_ctrl->port_num);
+
+ /* Finish Tx packet. Update first desc in case of Tx resource error */
+ tx_first_desc = tx_next_desc;
+ p_eth_port_ctrl->tx_first_desc_q = tx_first_desc;
+ }
+ else {
+ if (! (command_status & ETH_TX_FIRST_DESC) ) {
+ current_descriptor->cmd_sts = command_status;
+ dma_cache_wback_inv((u32)current_descriptor,
+ sizeof(ETH_TX_DESC));
+ wmb();
+ }
+ }
+
+ /* Check for ring index overlap in the Tx desc ring */
+ if (tx_next_desc == tx_desc_used) {
+ p_eth_port_ctrl->tx_resource_err = true;
+ p_eth_port_ctrl->tx_curr_desc_q = tx_first_desc;
+ return ETH_QUEUE_LAST_RESOURCE;
+ }
+
+ p_eth_port_ctrl->tx_curr_desc_q = tx_next_desc;
+ dma_cache_wback_inv((u32) p_eth_port_ctrl, sizeof(ETH_PORT_INFO));
+ wmb();
+ return ETH_OK;
+}
+#else
+static ETH_FUNC_RET_STATUS eth_port_send(ETH_PORT_INFO * p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info)
+{
+ int tx_desc_curr;
+ int tx_desc_used;
+ volatile ETH_TX_DESC* current_descriptor;
+ unsigned int command_status;
+
+ /* Do not process Tx ring in case of Tx ring resource error */
+ if (p_eth_port_ctrl->tx_resource_err == true)
+ return ETH_QUEUE_FULL;
+
+ /* Get the Tx Desc ring indexes */
+ tx_desc_curr = p_eth_port_ctrl->tx_curr_desc_q;
+ tx_desc_used = p_eth_port_ctrl->tx_used_desc_q;
+ current_descriptor = &(p_eth_port_ctrl->p_tx_desc_area[tx_desc_curr]);
+
+ if (current_descriptor == NULL)
+ return ETH_ERROR;
+
+ command_status = p_pkt_info->cmd_sts | ETH_ZERO_PADDING | ETH_GEN_CRC;
+
+/* XXX Is this for real ?!?!? */
+ /* Buffers with a payload smaller than 8 bytes must be aligned to a
+ * 64-bit boundary. We use the memory allocated for Tx descriptor.
+ * This memory is located in TX_BUF_OFFSET_IN_DESC offset within the
+ * Tx descriptor. */
+ if (p_pkt_info->byte_cnt <= 8) {
+ printk(KERN_ERR
+ "You have failed in the < 8 bytes errata - fixme\n");
+ return ETH_ERROR;
+ }
+ current_descriptor->buf_ptr = p_pkt_info->buf_ptr;
+ current_descriptor->byte_cnt = p_pkt_info->byte_cnt;
+ p_eth_port_ctrl->tx_skb[tx_desc_curr] =
+ (struct sk_buff*)p_pkt_info->return_info;
+
+ mb();
+
+ /* Set last desc with DMA ownership and interrupt enable. */
+ current_descriptor->cmd_sts = command_status |
+ ETH_BUFFER_OWNED_BY_DMA | ETH_TX_ENABLE_INTERRUPT;
+
+#if 0
+ /* Flush CPU pipe */
+ dma_cache_wback_inv(current_descriptor, sizeof(ETH_TX_DESC));
+ mb();
+#endif
+
+ /* Apply send command */
+ ETH_ENABLE_TX_QUEUE(p_eth_port_ctrl->port_num);
+
+ /* Finish Tx packet. Update first desc in case of Tx resource error */
+ tx_desc_curr = (tx_desc_curr + 1) % MV64340_TX_QUEUE_SIZE;
+
+ /* Update the current descriptor */
+ p_eth_port_ctrl->tx_curr_desc_q = tx_desc_curr;
+
+ /* Check for ring index overlap in the Tx desc ring */
+ if (tx_desc_curr == tx_desc_used) {
+ p_eth_port_ctrl->tx_resource_err = true;
+ return ETH_QUEUE_LAST_RESOURCE;
+ }
+
+ return ETH_OK;
+}
+#endif
+
+/*******************************************************************************
+ * eth_tx_return_desc - Free all used Tx descriptors
+ *
+ * DESCRIPTION:
+ * This routine returns the transmitted packet information to the caller.
+ * It uses the 'first' index to support Tx desc return in case a transmit
+ * of a packet spanned over multiple buffer still in process.
+ * In case the Tx queue was in "resource error" condition, where there are
+ * no available Tx resources, the function resets the resource error flag.
+ *
+ * INPUT:
+ * ETH_PORT_INFO *p_eth_port_ctrl Ethernet Port Control srtuct.
+ * PKT_INFO *p_pkt_info User packet buffer.
+ *
+ * OUTPUT:
+ * Tx ring 'first' and 'used' indexes are updated.
+ *
+ * RETURN:
+ * ETH_ERROR in case the routine can not access Tx desc ring.
+ * ETH_RETRY in case there is transmission in process.
+ * ETH_END_OF_JOB if the routine has nothing to release.
+ * ETH_OK otherwise.
+ *
+ *******************************************************************************/
+static ETH_FUNC_RET_STATUS eth_tx_return_desc(ETH_PORT_INFO * p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info)
+{
+ int tx_desc_used, tx_desc_curr;
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+ int tx_first_desc;
+#endif
+ volatile ETH_TX_DESC *p_tx_desc_used;
+ unsigned int command_status;
+
+ /* Get the Tx Desc ring indexes */
+ tx_desc_curr = p_eth_port_ctrl->tx_curr_desc_q;
+ tx_desc_used = p_eth_port_ctrl->tx_used_desc_q;
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+ tx_first_desc = p_eth_port_ctrl->tx_first_desc_q;
+#endif
+ p_tx_desc_used = &(p_eth_port_ctrl->p_tx_desc_area[tx_desc_used]);
+
+ /* XXX Sanity check */
+ if (p_tx_desc_used == NULL)
+ return ETH_ERROR;
+
+ command_status = p_tx_desc_used->cmd_sts;
+
+ /* Still transmitting... */
+#ifndef MV64340_CHECKSUM_OFFLOAD_TX
+ if (command_status & (ETH_BUFFER_OWNED_BY_DMA)) {
+ dma_cache_wback_inv((unsigned long)p_tx_desc_used,
+ sizeof(ETH_TX_DESC));
+ return ETH_RETRY;
+ }
+#endif
+ /* Stop release. About to overlap the current available Tx descriptor */
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+ if ((tx_desc_used == tx_first_desc) &&
+#else
+ if ((tx_desc_used == tx_desc_curr) &&
+#endif
+ (p_eth_port_ctrl->tx_resource_err == false)) {
+ dma_cache_wback_inv((unsigned long)p_tx_desc_used,
+ sizeof(ETH_TX_DESC));
+ return ETH_END_OF_JOB;
+ }
+
+ /* Pass the packet information to the caller */
+ p_pkt_info->cmd_sts = command_status;
+ p_pkt_info->return_info = p_eth_port_ctrl->tx_skb[tx_desc_used];
+ p_eth_port_ctrl->tx_skb[tx_desc_used] = NULL;
+
+ /* Update the next descriptor to release. */
+ p_eth_port_ctrl->tx_used_desc_q =
+ (tx_desc_used + 1) % MV64340_TX_QUEUE_SIZE;
+
+ /* Any Tx return cancels the Tx resource error status */
+ if (p_eth_port_ctrl->tx_resource_err == true)
+ p_eth_port_ctrl->tx_resource_err = false;
+
+ dma_cache_wback_inv((unsigned long)p_tx_desc_used, sizeof(ETH_TX_DESC));
+
+ return ETH_OK;
+}
+
+/*******************************************************************************
+ * eth_port_receive - Get received information from Rx ring.
+ *
+ * DESCRIPTION:
+ * This routine returns the received data to the caller. There is no
+ * data copying during routine operation. All information is returned
+ * using pointer to packet information struct passed from the caller.
+ * If the routine exhausts Rx ring resources then the resource error flag
+ * is set.
+ *
+ * INPUT:
+ * ETH_PORT_INFO *p_eth_port_ctrl Ethernet Port Control srtuct.
+ * PKT_INFO *p_pkt_info User packet buffer.
+ *
+ * OUTPUT:
+ * Rx ring current and used indexes are updated.
+ *
+ * RETURN:
+ * ETH_ERROR in case the routine can not access Rx desc ring.
+ * ETH_QUEUE_FULL if Rx ring resources are exhausted.
+ * ETH_END_OF_JOB if there is no received data.
+ * ETH_OK otherwise.
+ *
+ *******************************************************************************/
+static ETH_FUNC_RET_STATUS eth_port_receive(ETH_PORT_INFO *
+ p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info)
+{
+ int rx_curr_desc;
+ int rx_next_curr_desc;
+ int rx_used_desc;
+ unsigned int command_status;
+ volatile ETH_RX_DESC* p_rx_desc;
+
+ /* Do not process Rx ring in case of Rx ring resource error */
+ if (p_eth_port_ctrl->rx_resource_err == true)
+ return ETH_QUEUE_FULL;
+
+ /* Get the Rx Desc ring 'curr and 'used' indexes */
+ rx_curr_desc = p_eth_port_ctrl->rx_curr_desc_q;
+ rx_used_desc = p_eth_port_ctrl->rx_used_desc_q;
+
+ p_rx_desc = &(p_eth_port_ctrl->p_rx_desc_area[rx_curr_desc]);
+
+ /* The following parameters are used to save readings from memory */
+ command_status = p_rx_desc->cmd_sts;
+
+ /* Nothing to receive... */
+ if (command_status & (ETH_BUFFER_OWNED_BY_DMA)) {
+ dma_cache_wback_inv((unsigned long)p_rx_desc, sizeof(ETH_RX_DESC));
+ return ETH_END_OF_JOB;
+ }
+
+ p_pkt_info->byte_cnt = (p_rx_desc->byte_cnt) - RX_BUF_OFFSET;
+ p_pkt_info->cmd_sts = command_status;
+ p_pkt_info->buf_ptr = (p_rx_desc->buf_ptr) + RX_BUF_OFFSET;
+ p_pkt_info->return_info = p_eth_port_ctrl->rx_skb[rx_curr_desc];
+ p_pkt_info->l4i_chk = p_rx_desc->buf_size;
+
+ /* Clean the return info field to indicate that the packet has been */
+ /* moved to the upper layers */
+ p_eth_port_ctrl->rx_skb[rx_curr_desc] = NULL;
+
+ /* Update current index in data structure */
+ rx_next_curr_desc = (rx_curr_desc + 1) % MV64340_RX_QUEUE_SIZE;
+ p_eth_port_ctrl->rx_curr_desc_q = rx_next_curr_desc;
+
+ /* Rx descriptors exhausted. Set the Rx ring resource error flag */
+ if (rx_next_curr_desc == rx_used_desc)
+ p_eth_port_ctrl->rx_resource_err = true;
+
+ dma_cache_wback_inv((unsigned long)p_rx_desc, sizeof(ETH_RX_DESC));
+ mb();
+ return ETH_OK;
+}
+
+/*******************************************************************************
+ * eth_rx_return_buff - Returns a Rx buffer back to the Rx ring.
+ *
+ * DESCRIPTION:
+ * This routine returns a Rx buffer back to the Rx ring. It retrieves the
+ * next 'used' descriptor and attached the returned buffer to it.
+ * In case the Rx ring was in "resource error" condition, where there are
+ * no available Rx resources, the function resets the resource error flag.
+ *
+ * INPUT:
+ * ETH_PORT_INFO *p_eth_port_ctrl Ethernet Port Control srtuct.
+ * PKT_INFO *p_pkt_info Information on the returned buffer.
+ *
+ * OUTPUT:
+ * New available Rx resource in Rx descriptor ring.
+ *
+ * RETURN:
+ * ETH_ERROR in case the routine can not access Rx desc ring.
+ * ETH_OK otherwise.
+ *
+ *******************************************************************************/
+static ETH_FUNC_RET_STATUS eth_rx_return_buff(ETH_PORT_INFO * p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info)
+{
+ int used_rx_desc; /* Where to return Rx resource */
+ volatile ETH_RX_DESC* p_used_rx_desc;
+
+ /* Get 'used' Rx descriptor */
+ used_rx_desc = p_eth_port_ctrl->rx_used_desc_q;
+ p_used_rx_desc = &(p_eth_port_ctrl->p_rx_desc_area[used_rx_desc]);
+
+ p_used_rx_desc->buf_ptr = p_pkt_info->buf_ptr;
+ p_used_rx_desc->buf_size = p_pkt_info->byte_cnt;
+ p_eth_port_ctrl->rx_skb[used_rx_desc] = p_pkt_info->return_info;
+
+ /* Flush the write pipe */
+ mb();
+
+ /* Return the descriptor to DMA ownership */
+ p_used_rx_desc->cmd_sts =
+ ETH_BUFFER_OWNED_BY_DMA | ETH_RX_ENABLE_INTERRUPT;
+
+ /* Flush descriptor and CPU pipe */
+ dma_cache_wback_inv((unsigned long)p_used_rx_desc, sizeof(ETH_RX_DESC));
+ mb();
+
+ /* Move the used descriptor pointer to the next descriptor */
+ p_eth_port_ctrl->rx_used_desc_q =
+ (used_rx_desc + 1) % MV64340_RX_QUEUE_SIZE;
+
+ /* Any Rx return cancels the Rx resource error status */
+ if (p_eth_port_ctrl->rx_resource_err == true)
+ p_eth_port_ctrl->rx_resource_err = false;
+
+ return ETH_OK;
+}
+
+/*******************************************************************************
+ * eth_port_set_rx_coal - Sets coalescing interrupt mechanism on RX path
+ *
+ * DESCRIPTION:
+ * This routine sets the RX coalescing interrupt mechanism parameter.
+ * This parameter is a timeout counter, that counts in 64 t_clk
+ * chunks ; that when timeout event occurs a maskable interrupt
+ * occurs.
+ * The parameter is calculated using the tClk of the MV-643xx chip
+ * , and the required delay of the interrupt in usec.
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet port number
+ * unsigned int t_clk t_clk of the MV-643xx chip in HZ units
+ * unsigned int delay Delay in usec
+ *
+ * OUTPUT:
+ * Interrupt coalescing mechanism value is set in MV-643xx chip.
+ *
+ * RETURN:
+ * The interrupt coalescing value set in the gigE port.
+ *
+ *******************************************************************************/
+static unsigned int eth_port_set_rx_coal(ETH_PORT eth_port_num,
+ unsigned int t_clk,
+ unsigned int delay)
+{
+ unsigned int coal;
+ coal = ((t_clk / 1000000) * delay) / 64;
+ /* Set RX Coalescing mechanism */
+ MV_WRITE(MV64340_ETH_SDMA_CONFIG_REG(eth_port_num),
+ ((coal & 0x3fff) << 8) |
+ (MV_READ_DATA(MV64340_ETH_SDMA_CONFIG_REG(eth_port_num))
+ & 0xffc000ff));
+ return coal;
+}
+
+/*******************************************************************************
+ * eth_port_set_tx_coal - Sets coalescing interrupt mechanism on TX path
+ *
+ * DESCRIPTION:
+ * This routine sets the TX coalescing interrupt mechanism parameter.
+ * This parameter is a timeout counter, that counts in 64 t_clk
+ * chunks ; that when timeout event occurs a maskable interrupt
+ * occurs.
+ * The parameter is calculated using the t_cLK frequency of the
+ * MV-643xx chip and the required delay in the interrupt in uSec
+ *
+ * INPUT:
+ * ETH_PORT eth_port_num Ethernet port number
+ * unsigned int t_clk t_clk of the MV-643xx chip in HZ units
+ * unsigned int delay Delay in uSeconds
+ *
+ * OUTPUT:
+ * Interrupt coalescing mechanism value is set in MV-643xx chip.
+ *
+ * RETURN:
+ * The interrupt coalescing value set in the gigE port.
+ *
+ *******************************************************************************/
+static unsigned int eth_port_set_tx_coal(ETH_PORT eth_port_num,
+ unsigned int t_clk,
+ unsigned int delay)
+{
+ unsigned int coal;
+ coal = ((t_clk / 1000000) * delay) / 64;
+ /* Set TX Coalescing mechanism */
+ MV_WRITE(MV64340_ETH_TX_FIFO_URGENT_THRESHOLD_REG(eth_port_num),
+ coal << 4);
+ return coal;
+}
+
+#ifdef MDD_CUT
+/*******************************************************************************
+ * eth_b_copy - Copy bytes from source to destination
+ *
+ * DESCRIPTION:
+ * This function supports the eight bytes limitation on Tx buffer size.
+ * The routine will zero eight bytes starting from the destination address
+ * followed by copying bytes from the source address to the destination.
+ *
+ * INPUT:
+ * unsigned int src_addr 32 bit source address.
+ * unsigned int dst_addr 32 bit destination address.
+ * int byte_count Number of bytes to copy.
+ *
+ * OUTPUT:
+ * See description.
+ *
+ * RETURN:
+ * None.
+ *
+ *******************************************************************************/
+static void eth_b_copy(unsigned int src_addr, unsigned int dst_addr,
+ int byte_count)
+{
+ /* Zero the dst_addr area */
+ *(unsigned int *) dst_addr = 0x0;
+
+ while (byte_count != 0) {
+ *(char *) dst_addr = *(char *) src_addr;
+ dst_addr++;
+ src_addr++;
+ byte_count--;
+ }
+}
+#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/mv64340_eth.h linux-2.4.22/drivers/net/mv64340_eth.h
--- linux-2.4.22.clean/drivers/net/mv64340_eth.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/net/mv64340_eth.h 2003-09-09 01:00:28.000000000 +0200
@@ -0,0 +1,635 @@
+#ifndef __MV64340_ETH_H__
+#define __MV64340_ETH_H__
+
+#include <linux/config.h>
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/config.h>
+#include <linux/spinlock.h>
+
+#include <asm/mv64340.h>
+
+#define BIT0 0x00000001
+#define BIT1 0x00000002
+#define BIT2 0x00000004
+#define BIT3 0x00000008
+#define BIT4 0x00000010
+#define BIT5 0x00000020
+#define BIT6 0x00000040
+#define BIT7 0x00000080
+#define BIT8 0x00000100
+#define BIT9 0x00000200
+#define BIT10 0x00000400
+#define BIT11 0x00000800
+#define BIT12 0x00001000
+#define BIT13 0x00002000
+#define BIT14 0x00004000
+#define BIT15 0x00008000
+#define BIT16 0x00010000
+#define BIT17 0x00020000
+#define BIT18 0x00040000
+#define BIT19 0x00080000
+#define BIT20 0x00100000
+#define BIT21 0x00200000
+#define BIT22 0x00400000
+#define BIT23 0x00800000
+#define BIT24 0x01000000
+#define BIT25 0x02000000
+#define BIT26 0x04000000
+#define BIT27 0x08000000
+#define BIT28 0x10000000
+#define BIT29 0x20000000
+#define BIT30 0x40000000
+#define BIT31 0x80000000
+
+/*************************************************************************
+**************************************************************************
+**************************************************************************
+* The first part is the high level driver of the gigE ethernet ports. *
+**************************************************************************
+**************************************************************************
+*************************************************************************/
+
+#define ETH_PORT0_IRQ_NUM 48 /* main high register, bit0 */
+#define ETH_PORT1_IRQ_NUM ETH_PORT0_IRQ_NUM+1 /* main high register, bit1 */
+#define ETH_PORT2_IRQ_NUM ETH_PORT0_IRQ_NUM+2 /* main high register, bit1 */
+
+/* Checksum offload for Tx is broken */
+#define MV64340_CHECKSUM_OFFLOAD_TX 1
+#define MV64340_NIC_SRAM_BASE_TX 0xfe000000
+#define MV64340_NAPI 1
+
+/*
+ * Number of RX / TX descriptors on RX / TX rings.
+ * Note that allocating RX descriptors is done by allocating the RX
+ * ring AND a preallocated RX buffers (skb's) for each descriptor.
+ * The TX descriptors only allocates the TX descriptors ring,
+ * with no pre allocated TX buffers (skb's are allocated by higher layers.
+ */
+
+/* Default TX ring size is 1000 descriptors */
+#define MV64340_TX_QUEUE_SIZE 1000
+
+/* Default RX ring size is 400 descriptors */
+#define MV64340_RX_QUEUE_SIZE 400
+
+#define MV64340_TX_COAL 100
+#define MV64340_RX_COAL 100
+
+/* Private data structure used for ethernet device */
+struct mv64340_eth_priv {
+ unsigned int port_num;
+ struct net_device_stats stats;
+ spinlock_t lock;
+ /* Size of Tx Ring per queue */
+ unsigned int tx_ring_size;
+ /* Ammont of SKBs outstanding on Tx queue */
+ unsigned int tx_ring_skbs;
+ /* Size of Rx Ring per queue */
+ unsigned int rx_ring_size;
+ /* Ammount of SKBs allocated to Rx Ring per queue */
+ unsigned int rx_ring_skbs;
+
+ /*
+ * rx_task used to fill RX ring out of bottom half context
+ */
+ struct tq_struct rx_task;
+
+ /*
+ * Used in case RX Ring is empty, which can be caused when
+ * system does not have resources (skb's)
+ */
+ struct timer_list timeout;
+ long rx_task_busy __attribute__ ((aligned(SMP_CACHE_BYTES)));
+ unsigned rx_timer_flag;
+
+ u32 rx_int_coal;
+ u32 tx_int_coal;
+};
+
+
+/*************************************************************************
+**************************************************************************
+**************************************************************************
+* The second part is the low level driver of the gigE ethernet ports. *
+**************************************************************************
+**************************************************************************
+*************************************************************************/
+
+
+/********************************************************************************
+ * Header File for : MV-643xx network interface header
+ *
+ * DESCRIPTION:
+ * This header file contains macros typedefs and function declaration for
+ * the Marvell Gig Bit Ethernet Controller.
+ *
+ * DEPENDENCIES:
+ * None.
+ *
+ *******************************************************************************/
+
+typedef enum _bool { false, true } bool;
+
+/* defines */
+
+/* Default port configuration value */
+#define PORT_CONFIG_VALUE \
+ ETH_UNICAST_NORMAL_MODE | \
+ ETH_DEFAULT_RX_QUEUE_0 | \
+ ETH_DEFAULT_RX_ARP_QUEUE_0 | \
+ ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \
+ ETH_RECEIVE_BC_IF_IP | \
+ ETH_RECEIVE_BC_IF_ARP | \
+ ETH_CAPTURE_TCP_FRAMES_DIS | \
+ ETH_CAPTURE_UDP_FRAMES_DIS | \
+ ETH_DEFAULT_RX_TCP_QUEUE_0 | \
+ ETH_DEFAULT_RX_UDP_QUEUE_0 | \
+ ETH_DEFAULT_RX_BPDU_QUEUE_0
+
+/* Default port extend configuration value */
+#define PORT_CONFIG_EXTEND_VALUE \
+ ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \
+ ETH_PARTITION_DISABLE
+
+
+/* Default sdma control value */
+#define PORT_SDMA_CONFIG_VALUE \
+ ETH_RX_BURST_SIZE_16_64BIT | \
+ GT_ETH_IPG_INT_RX(0) | \
+ ETH_TX_BURST_SIZE_16_64BIT;
+
+#define GT_ETH_IPG_INT_RX(value) \
+ ((value & 0x3fff) << 8)
+
+/* Default port serial control value */
+#define PORT_SERIAL_CONTROL_VALUE \
+ ETH_FORCE_LINK_PASS | \
+ ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \
+ ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \
+ ETH_ADV_SYMMETRIC_FLOW_CTRL | \
+ ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
+ ETH_FORCE_BP_MODE_NO_JAM | \
+ BIT9 | \
+ ETH_DO_NOT_FORCE_LINK_FAIL | \
+ ETH_RETRANSMIT_16_ATTEMPTS | \
+ ETH_ENABLE_AUTO_NEG_SPEED_GMII | \
+ ETH_DTE_ADV_0 | \
+ ETH_DISABLE_AUTO_NEG_BYPASS | \
+ ETH_AUTO_NEG_NO_CHANGE | \
+ ETH_MAX_RX_PACKET_9700BYTE | \
+ ETH_CLR_EXT_LOOPBACK | \
+ ETH_SET_FULL_DUPLEX_MODE | \
+ ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX
+
+#define RX_BUFFER_MAX_SIZE 0x4000000
+#define TX_BUFFER_MAX_SIZE 0x4000000
+
+/* MAC accepet/reject macros */
+#define ACCEPT_MAC_ADDR 0
+#define REJECT_MAC_ADDR 1
+
+/* Buffer offset from buffer pointer */
+#define RX_BUF_OFFSET 0x2
+
+/* Gigabit Ethernet Unit Global Registers */
+
+/* MIB Counters register definitions */
+#define ETH_MIB_GOOD_OCTETS_RECEIVED_LOW 0x0
+#define ETH_MIB_GOOD_OCTETS_RECEIVED_HIGH 0x4
+#define ETH_MIB_BAD_OCTETS_RECEIVED 0x8
+#define ETH_MIB_INTERNAL_MAC_TRANSMIT_ERR 0xc
+#define ETH_MIB_GOOD_FRAMES_RECEIVED 0x10
+#define ETH_MIB_BAD_FRAMES_RECEIVED 0x14
+#define ETH_MIB_BROADCAST_FRAMES_RECEIVED 0x18
+#define ETH_MIB_MULTICAST_FRAMES_RECEIVED 0x1c
+#define ETH_MIB_FRAMES_64_OCTETS 0x20
+#define ETH_MIB_FRAMES_65_TO_127_OCTETS 0x24
+#define ETH_MIB_FRAMES_128_TO_255_OCTETS 0x28
+#define ETH_MIB_FRAMES_256_TO_511_OCTETS 0x2c
+#define ETH_MIB_FRAMES_512_TO_1023_OCTETS 0x30
+#define ETH_MIB_FRAMES_1024_TO_MAX_OCTETS 0x34
+#define ETH_MIB_GOOD_OCTETS_SENT_LOW 0x38
+#define ETH_MIB_GOOD_OCTETS_SENT_HIGH 0x3c
+#define ETH_MIB_GOOD_FRAMES_SENT 0x40
+#define ETH_MIB_EXCESSIVE_COLLISION 0x44
+#define ETH_MIB_MULTICAST_FRAMES_SENT 0x48
+#define ETH_MIB_BROADCAST_FRAMES_SENT 0x4c
+#define ETH_MIB_UNREC_MAC_CONTROL_RECEIVED 0x50
+#define ETH_MIB_FC_SENT 0x54
+#define ETH_MIB_GOOD_FC_RECEIVED 0x58
+#define ETH_MIB_BAD_FC_RECEIVED 0x5c
+#define ETH_MIB_UNDERSIZE_RECEIVED 0x60
+#define ETH_MIB_FRAGMENTS_RECEIVED 0x64
+#define ETH_MIB_OVERSIZE_RECEIVED 0x68
+#define ETH_MIB_JABBER_RECEIVED 0x6c
+#define ETH_MIB_MAC_RECEIVE_ERROR 0x70
+#define ETH_MIB_BAD_CRC_EVENT 0x74
+#define ETH_MIB_COLLISION 0x78
+#define ETH_MIB_LATE_COLLISION 0x7c
+
+/* Port serial status reg (PSR) */
+#define ETH_INTERFACE_GMII_MII 0
+#define ETH_INTERFACE_PCM BIT0
+#define ETH_LINK_IS_DOWN 0
+#define ETH_LINK_IS_UP BIT1
+#define ETH_PORT_AT_HALF_DUPLEX 0
+#define ETH_PORT_AT_FULL_DUPLEX BIT2
+#define ETH_RX_FLOW_CTRL_DISABLED 0
+#define ETH_RX_FLOW_CTRL_ENBALED BIT3
+#define ETH_GMII_SPEED_100_10 0
+#define ETH_GMII_SPEED_1000 BIT4
+#define ETH_MII_SPEED_10 0
+#define ETH_MII_SPEED_100 BIT5
+#define ETH_NO_TX 0
+#define ETH_TX_IN_PROGRESS BIT7
+#define ETH_BYPASS_NO_ACTIVE 0
+#define ETH_BYPASS_ACTIVE BIT8
+#define ETH_PORT_NOT_AT_PARTITION_STATE 0
+#define ETH_PORT_AT_PARTITION_STATE BIT9
+#define ETH_PORT_TX_FIFO_NOT_EMPTY 0
+#define ETH_PORT_TX_FIFO_EMPTY BIT10
+
+
+/* These macros describes the Port configuration reg (Px_cR) bits */
+#define ETH_UNICAST_NORMAL_MODE 0
+#define ETH_UNICAST_PROMISCUOUS_MODE BIT0
+#define ETH_DEFAULT_RX_QUEUE_0 0
+#define ETH_DEFAULT_RX_QUEUE_1 BIT1
+#define ETH_DEFAULT_RX_QUEUE_2 BIT2
+#define ETH_DEFAULT_RX_QUEUE_3 (BIT2 | BIT1)
+#define ETH_DEFAULT_RX_QUEUE_4 BIT3
+#define ETH_DEFAULT_RX_QUEUE_5 (BIT3 | BIT1)
+#define ETH_DEFAULT_RX_QUEUE_6 (BIT3 | BIT2)
+#define ETH_DEFAULT_RX_QUEUE_7 (BIT3 | BIT2 | BIT1)
+#define ETH_DEFAULT_RX_ARP_QUEUE_0 0
+#define ETH_DEFAULT_RX_ARP_QUEUE_1 BIT4
+#define ETH_DEFAULT_RX_ARP_QUEUE_2 BIT5
+#define ETH_DEFAULT_RX_ARP_QUEUE_3 (BIT5 | BIT4)
+#define ETH_DEFAULT_RX_ARP_QUEUE_4 BIT6
+#define ETH_DEFAULT_RX_ARP_QUEUE_5 (BIT6 | BIT4)
+#define ETH_DEFAULT_RX_ARP_QUEUE_6 (BIT6 | BIT5)
+#define ETH_DEFAULT_RX_ARP_QUEUE_7 (BIT6 | BIT5 | BIT4)
+#define ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP 0
+#define ETH_REJECT_BC_IF_NOT_IP_OR_ARP BIT7
+#define ETH_RECEIVE_BC_IF_IP 0
+#define ETH_REJECT_BC_IF_IP BIT8
+#define ETH_RECEIVE_BC_IF_ARP 0
+#define ETH_REJECT_BC_IF_ARP BIT9
+#define ETH_TX_AM_NO_UPDATE_ERROR_SUMMARY BIT12
+#define ETH_CAPTURE_TCP_FRAMES_DIS 0
+#define ETH_CAPTURE_TCP_FRAMES_EN BIT14
+#define ETH_CAPTURE_UDP_FRAMES_DIS 0
+#define ETH_CAPTURE_UDP_FRAMES_EN BIT15
+#define ETH_DEFAULT_RX_TCP_QUEUE_0 0
+#define ETH_DEFAULT_RX_TCP_QUEUE_1 BIT16
+#define ETH_DEFAULT_RX_TCP_QUEUE_2 BIT17
+#define ETH_DEFAULT_RX_TCP_QUEUE_3 (BIT17 | BIT16)
+#define ETH_DEFAULT_RX_TCP_QUEUE_4 BIT18
+#define ETH_DEFAULT_RX_TCP_QUEUE_5 (BIT18 | BIT16)
+#define ETH_DEFAULT_RX_TCP_QUEUE_6 (BIT18 | BIT17)
+#define ETH_DEFAULT_RX_TCP_QUEUE_7 (BIT18 | BIT17 | BIT16)
+#define ETH_DEFAULT_RX_UDP_QUEUE_0 0
+#define ETH_DEFAULT_RX_UDP_QUEUE_1 BIT19
+#define ETH_DEFAULT_RX_UDP_QUEUE_2 BIT20
+#define ETH_DEFAULT_RX_UDP_QUEUE_3 (BIT20 | BIT19)
+#define ETH_DEFAULT_RX_UDP_QUEUE_4 (BIT21
+#define ETH_DEFAULT_RX_UDP_QUEUE_5 (BIT21 | BIT19)
+#define ETH_DEFAULT_RX_UDP_QUEUE_6 (BIT21 | BIT20)
+#define ETH_DEFAULT_RX_UDP_QUEUE_7 (BIT21 | BIT20 | BIT19)
+#define ETH_DEFAULT_RX_BPDU_QUEUE_0 0
+#define ETH_DEFAULT_RX_BPDU_QUEUE_1 BIT22
+#define ETH_DEFAULT_RX_BPDU_QUEUE_2 BIT23
+#define ETH_DEFAULT_RX_BPDU_QUEUE_3 (BIT23 | BIT22)
+#define ETH_DEFAULT_RX_BPDU_QUEUE_4 BIT24
+#define ETH_DEFAULT_RX_BPDU_QUEUE_5 (BIT24 | BIT22)
+#define ETH_DEFAULT_RX_BPDU_QUEUE_6 (BIT24 | BIT23)
+#define ETH_DEFAULT_RX_BPDU_QUEUE_7 (BIT24 | BIT23 | BIT22)
+
+
+/* These macros describes the Port configuration extend reg (Px_cXR) bits*/
+#define ETH_CLASSIFY_EN BIT0
+#define ETH_SPAN_BPDU_PACKETS_AS_NORMAL 0
+#define ETH_SPAN_BPDU_PACKETS_TO_RX_QUEUE_7 BIT1
+#define ETH_PARTITION_DISABLE 0
+#define ETH_PARTITION_ENABLE BIT2
+
+
+/* Tx/Rx queue command reg (RQCR/TQCR)*/
+#define ETH_QUEUE_0_ENABLE BIT0
+#define ETH_QUEUE_1_ENABLE BIT1
+#define ETH_QUEUE_2_ENABLE BIT2
+#define ETH_QUEUE_3_ENABLE BIT3
+#define ETH_QUEUE_4_ENABLE BIT4
+#define ETH_QUEUE_5_ENABLE BIT5
+#define ETH_QUEUE_6_ENABLE BIT6
+#define ETH_QUEUE_7_ENABLE BIT7
+#define ETH_QUEUE_0_DISABLE BIT8
+#define ETH_QUEUE_1_DISABLE BIT9
+#define ETH_QUEUE_2_DISABLE BIT10
+#define ETH_QUEUE_3_DISABLE BIT11
+#define ETH_QUEUE_4_DISABLE BIT12
+#define ETH_QUEUE_5_DISABLE BIT13
+#define ETH_QUEUE_6_DISABLE BIT14
+#define ETH_QUEUE_7_DISABLE BIT15
+
+
+/* These macros describes the Port Sdma configuration reg (SDCR) bits */
+#define ETH_RIFB BIT0
+#define ETH_RX_BURST_SIZE_1_64BIT 0
+#define ETH_RX_BURST_SIZE_2_64BIT BIT1
+#define ETH_RX_BURST_SIZE_4_64BIT BIT2
+#define ETH_RX_BURST_SIZE_8_64BIT (BIT2 | BIT1)
+#define ETH_RX_BURST_SIZE_16_64BIT BIT3
+#define ETH_BLM_RX_NO_SWAP BIT4
+#define ETH_BLM_RX_BYTE_SWAP 0
+#define ETH_BLM_TX_NO_SWAP BIT5
+#define ETH_BLM_TX_BYTE_SWAP 0
+#define ETH_DESCRIPTORS_BYTE_SWAP BIT6
+#define ETH_DESCRIPTORS_NO_SWAP 0
+#define ETH_TX_BURST_SIZE_1_64BIT 0
+#define ETH_TX_BURST_SIZE_2_64BIT BIT22
+#define ETH_TX_BURST_SIZE_4_64BIT BIT23
+#define ETH_TX_BURST_SIZE_8_64BIT (BIT23 | BIT22)
+#define ETH_TX_BURST_SIZE_16_64BIT BIT24
+
+
+
+/* These macros describes the Port serial control reg (PSCR) bits */
+#define ETH_SERIAL_PORT_DISABLE 0
+#define ETH_SERIAL_PORT_ENABLE BIT0
+#define ETH_FORCE_LINK_PASS BIT1
+#define ETH_DO_NOT_FORCE_LINK_PASS 0
+#define ETH_ENABLE_AUTO_NEG_FOR_DUPLX 0
+#define ETH_DISABLE_AUTO_NEG_FOR_DUPLX BIT2
+#define ETH_ENABLE_AUTO_NEG_FOR_FLOW_CTRL 0
+#define ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL BIT3
+#define ETH_ADV_NO_FLOW_CTRL 0
+#define ETH_ADV_SYMMETRIC_FLOW_CTRL BIT4
+#define ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX 0
+#define ETH_FORCE_FC_MODE_TX_PAUSE_DIS BIT5
+#define ETH_FORCE_BP_MODE_NO_JAM 0
+#define ETH_FORCE_BP_MODE_JAM_TX BIT7
+#define ETH_FORCE_BP_MODE_JAM_TX_ON_RX_ERR BIT8
+#define ETH_FORCE_LINK_FAIL 0
+#define ETH_DO_NOT_FORCE_LINK_FAIL BIT10
+#define ETH_RETRANSMIT_16_ATTEMPTS 0
+#define ETH_RETRANSMIT_FOREVER BIT11
+#define ETH_DISABLE_AUTO_NEG_SPEED_GMII BIT13
+#define ETH_ENABLE_AUTO_NEG_SPEED_GMII 0
+#define ETH_DTE_ADV_0 0
+#define ETH_DTE_ADV_1 BIT14
+#define ETH_DISABLE_AUTO_NEG_BYPASS 0
+#define ETH_ENABLE_AUTO_NEG_BYPASS BIT15
+#define ETH_AUTO_NEG_NO_CHANGE 0
+#define ETH_RESTART_AUTO_NEG BIT16
+#define ETH_MAX_RX_PACKET_1518BYTE 0
+#define ETH_MAX_RX_PACKET_1522BYTE BIT17
+#define ETH_MAX_RX_PACKET_1552BYTE BIT18
+#define ETH_MAX_RX_PACKET_9022BYTE (BIT18 | BIT17)
+#define ETH_MAX_RX_PACKET_9192BYTE BIT19
+#define ETH_MAX_RX_PACKET_9700BYTE (BIT19 | BIT17)
+#define ETH_SET_EXT_LOOPBACK BIT20
+#define ETH_CLR_EXT_LOOPBACK 0
+#define ETH_SET_FULL_DUPLEX_MODE BIT21
+#define ETH_SET_HALF_DUPLEX_MODE 0
+#define ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX BIT22
+#define ETH_DISABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX 0
+#define ETH_SET_GMII_SPEED_TO_10_100 0
+#define ETH_SET_GMII_SPEED_TO_1000 BIT23
+#define ETH_SET_MII_SPEED_TO_10 0
+#define ETH_SET_MII_SPEED_TO_100 BIT24
+
+
+/* SMI reg */
+#define ETH_SMI_BUSY BIT28 /* 0 - Write, 1 - Read */
+#define ETH_SMI_READ_VALID BIT27 /* 0 - Write, 1 - Read */
+#define ETH_SMI_OPCODE_WRITE 0 /* Completion of Read operation */
+#define ETH_SMI_OPCODE_READ BIT26 /* Operation is in progress */
+
+/* SDMA command status fields macros */
+
+/* Tx & Rx descriptors status */
+#define ETH_ERROR_SUMMARY (BIT0)
+
+/* Tx & Rx descriptors command */
+#define ETH_BUFFER_OWNED_BY_DMA (BIT31)
+
+/* Tx descriptors status */
+#define ETH_LC_ERROR (0 )
+#define ETH_UR_ERROR (BIT1 )
+#define ETH_RL_ERROR (BIT2 )
+#define ETH_LLC_SNAP_FORMAT (BIT9 )
+
+/* Rx descriptors status */
+#define ETH_CRC_ERROR (0 )
+#define ETH_OVERRUN_ERROR (BIT1 )
+#define ETH_MAX_FRAME_LENGTH_ERROR (BIT2 )
+#define ETH_RESOURCE_ERROR ((BIT2 | BIT1))
+#define ETH_VLAN_TAGGED (BIT19)
+#define ETH_BPDU_FRAME (BIT20)
+#define ETH_TCP_FRAME_OVER_IP_V_4 (0 )
+#define ETH_UDP_FRAME_OVER_IP_V_4 (BIT21)
+#define ETH_OTHER_FRAME_TYPE (BIT22)
+#define ETH_LAYER_2_IS_ETH_V_2 (BIT23)
+#define ETH_FRAME_TYPE_IP_V_4 (BIT24)
+#define ETH_FRAME_HEADER_OK (BIT25)
+#define ETH_RX_LAST_DESC (BIT26)
+#define ETH_RX_FIRST_DESC (BIT27)
+#define ETH_UNKNOWN_DESTINATION_ADDR (BIT28)
+#define ETH_RX_ENABLE_INTERRUPT (BIT29)
+#define ETH_LAYER_4_CHECKSUM_OK (BIT30)
+
+/* Rx descriptors byte count */
+#define ETH_FRAME_FRAGMENTED (BIT2)
+
+/* Tx descriptors command */
+#define ETH_LAYER_4_CHECKSUM_FIRST_DESC (BIT10)
+#define ETH_FRAME_SET_TO_VLAN (BIT15)
+#define ETH_TCP_FRAME (0 )
+#define ETH_UDP_FRAME (BIT16)
+#define ETH_GEN_TCP_UDP_CHECKSUM (BIT17)
+#define ETH_GEN_IP_V_4_CHECKSUM (BIT18)
+#define ETH_ZERO_PADDING (BIT19)
+#define ETH_TX_LAST_DESC (BIT20)
+#define ETH_TX_FIRST_DESC (BIT21)
+#define ETH_GEN_CRC (BIT22)
+#define ETH_TX_ENABLE_INTERRUPT (BIT23)
+#define ETH_AUTO_MODE (BIT30)
+
+/* typedefs */
+
+typedef enum _eth_port {
+ ETH_0 = 0,
+ ETH_1 = 1,
+ ETH_2 = 2
+} ETH_PORT;
+
+typedef enum _eth_func_ret_status {
+ ETH_OK, /* Returned as expected. */
+ ETH_ERROR, /* Fundamental error. */
+ ETH_RETRY, /* Could not process request. Try later. */
+ ETH_END_OF_JOB, /* Ring has nothing to process. */
+ ETH_QUEUE_FULL, /* Ring resource error. */
+ ETH_QUEUE_LAST_RESOURCE /* Ring resources about to exhaust. */
+} ETH_FUNC_RET_STATUS;
+
+typedef enum _eth_target {
+ ETH_TARGET_DRAM,
+ ETH_TARGET_DEVICE,
+ ETH_TARGET_CBS,
+ ETH_TARGET_PCI0,
+ ETH_TARGET_PCI1
+} ETH_TARGET;
+
+/* These are for big-endian machines. Little endian needs different
+ * definitions.
+ */
+#if defined(__BIG_ENDIAN)
+typedef struct _eth_rx_desc {
+ u16 byte_cnt; /* Descriptor buffer byte count */
+ u16 buf_size; /* Buffer size */
+ u32 cmd_sts; /* Descriptor command status */
+ u32 next_desc_ptr; /* Next descriptor pointer */
+ u32 buf_ptr; /* Descriptor buffer pointer */
+} ETH_RX_DESC;
+
+typedef struct _eth_tx_desc {
+ u16 byte_cnt; /* buffer byte count */
+ u16 l4i_chk; /* CPU provided TCP checksum */
+ u32 cmd_sts; /* Command/status field */
+ u32 next_desc_ptr; /* Pointer to next descriptor */
+ u32 buf_ptr; /* pointer to buffer for this descriptor */
+} ETH_TX_DESC;
+
+#elif defined(__LITTLE_ENDIAN)
+typedef struct _eth_rx_desc {
+ u32 cmd_sts; /* Descriptor command status */
+ u16 buf_size; /* Buffer size */
+ u16 byte_cnt; /* Descriptor buffer byte count */
+ u32 buf_ptr; /* Descriptor buffer pointer */
+ u32 next_desc_ptr; /* Next descriptor pointer */
+} ETH_RX_DESC;
+
+typedef struct _eth_tx_desc {
+ u32 cmd_sts; /* Command/status field */
+ u16 l4i_chk; /* CPU provided TCP checksum */
+ u16 byte_cnt; /* buffer byte count */
+ u32 buf_ptr; /* pointer to buffer for this descriptor */
+ u32 next_desc_ptr; /* Pointer to next descriptor */
+} ETH_TX_DESC;
+#else
+#error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined
+#endif
+
+/* Unified struct for Rx and Tx operations. The user is not required to */
+/* be familier with neither Tx nor Rx descriptors. */
+typedef struct _pkt_info {
+ unsigned short byte_cnt; /* Descriptor buffer byte count */
+ unsigned short l4i_chk; /* Tx CPU provided TCP Checksum */
+ unsigned int cmd_sts; /* Descriptor command status */
+ unsigned int buf_ptr; /* Descriptor buffer pointer */
+ struct sk_buff* return_info; /* User resource return information */
+} PKT_INFO;
+
+
+/* Ethernet port specific infomation */
+
+typedef struct _eth_port_ctrl {
+ ETH_PORT port_num; /* User Ethernet port number */
+ u8 port_mac_addr[6]; /* User defined port MAC address. */
+ u32 port_config; /* User port configuration value */
+ u32 port_config_extend; /* User port config extend value */
+ u32 port_sdma_config; /* User port SDMA config value */
+ u32 port_serial_control; /* User port serial control value */
+ u32 port_tx_queue_command; /* Port active Tx queues summary */
+ u32 port_rx_queue_command; /* Port active Rx queues summary */
+
+ /* User scratch pad for user specific data structures */
+ void* port_private;
+
+ bool rx_resource_err; /* Rx ring resource error flag */
+ bool tx_resource_err; /* Tx ring resource error flag */
+
+ /* Tx/Rx rings managment indexes fields. For driver use */
+
+ /* Next available and first returning Rx resource */
+ int rx_curr_desc_q, rx_used_desc_q;
+
+ /* Next available and first returning Tx resource */
+ int tx_curr_desc_q, tx_used_desc_q;
+#ifdef MV64340_CHECKSUM_OFFLOAD_TX
+ int tx_first_desc_q;
+#endif
+ /* Tx/Rx rings size and base variables fields. For driver use */
+ volatile ETH_RX_DESC *p_rx_desc_area;
+ unsigned int rx_desc_area_size;
+ struct sk_buff* rx_skb[MV64340_RX_QUEUE_SIZE];
+
+ volatile ETH_TX_DESC *p_tx_desc_area;
+ unsigned int tx_desc_area_size;
+ struct sk_buff* tx_skb[MV64340_TX_QUEUE_SIZE];
+ struct tq_struct tx_timeout_task;
+} ETH_PORT_INFO;
+
+
+/* ethernet.h API list */
+
+/* Port operation control routines */
+static void eth_port_init(ETH_PORT_INFO * p_eth_port_ctrl);
+static void eth_port_reset(ETH_PORT eth_port_num);
+static bool eth_port_start(ETH_PORT_INFO * p_eth_port_ctrl);
+
+static void ethernet_set_config_reg(ETH_PORT eth_port_num,
+ unsigned int value);
+static unsigned int ethernet_get_config_reg(ETH_PORT eth_port_num);
+
+/* Interrupt Coalesting functions */
+static unsigned int eth_port_set_rx_coal(ETH_PORT, unsigned int,
+ unsigned int);
+static unsigned int eth_port_set_tx_coal(ETH_PORT, unsigned int,
+ unsigned int);
+
+/* Port MAC address routines */
+static void eth_port_uc_addr_set(ETH_PORT eth_port_num,
+ unsigned char *p_addr);
+
+/* PHY and MIB routines */
+static bool ethernet_phy_reset(ETH_PORT eth_port_num);
+
+static bool eth_port_write_smi_reg(ETH_PORT eth_port_num,
+ unsigned int phy_reg,
+ unsigned int value);
+
+static bool eth_port_read_smi_reg(ETH_PORT eth_port_num,
+ unsigned int phy_reg,
+ unsigned int *value);
+
+static void eth_clear_mib_counters(ETH_PORT eth_port_num);
+
+/* Port data flow control routines */
+static ETH_FUNC_RET_STATUS eth_port_send(ETH_PORT_INFO * p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info);
+static ETH_FUNC_RET_STATUS eth_tx_return_desc(ETH_PORT_INFO *
+ p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info);
+static ETH_FUNC_RET_STATUS eth_port_receive(ETH_PORT_INFO *
+ p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info);
+static ETH_FUNC_RET_STATUS eth_rx_return_buff(ETH_PORT_INFO *
+ p_eth_port_ctrl,
+ PKT_INFO * p_pkt_info);
+
+
+static bool ether_init_tx_desc_ring(ETH_PORT_INFO * p_eth_port_ctrl,
+ int tx_desc_num,
+ unsigned long tx_desc_base_addr);
+
+static bool ether_init_rx_desc_ring(ETH_PORT_INFO * p_eth_port_ctrl,
+ int rx_desc_num,
+ int rx_buff_size,
+ unsigned long rx_desc_base_addr,
+ unsigned long rx_buff_base_addr);
+
+#endif /* MV64340_ETH_ */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/pcnet32.c linux-2.4.22/drivers/net/pcnet32.c
--- linux-2.4.22.clean/drivers/net/pcnet32.c 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/net/pcnet32.c 2003-09-27 14:08:05.000000000 +0200
@@ -752,8 +752,12 @@
if (irq_line) {
dev->irq = irq_line;
}
-
+
+#ifdef CONFIG_LASAT
+ if (dev->irq >= 0)
+#else
if (dev->irq >= 2)
+#endif
printk(" assigned IRQ %d.\n", dev->irq);
else {
unsigned long irq_mask = probe_irq_on();
@@ -808,7 +812,10 @@
u16 val;
int i;
- if (dev->irq == 0 ||
+ if (
+#ifndef CONFIG_LASAT
+ dev->irq == 0 ||
+#endif
request_irq(dev->irq, &pcnet32_interrupt,
lp->shared_irq ? SA_SHIRQ : 0, lp->name, (void *)dev)) {
return -EAGAIN;
@@ -1345,6 +1352,10 @@
if (!rx_in_place) {
skb_reserve(skb,2); /* 16 byte align */
skb_put(skb,pkt_len); /* Make room */
+ pci_dma_sync_single(lp->pci_dev,
+ lp->rx_dma_addr[entry],
+ pkt_len,
+ PCI_DMA_FROMDEVICE);
eth_copy_and_sum(skb,
(unsigned char *)(lp->rx_skbuff[entry]->tail),
pkt_len,0);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/sb1250-mac.c linux-2.4.22/drivers/net/sb1250-mac.c
--- linux-2.4.22.clean/drivers/net/sb1250-mac.c 2002-11-29 00:53:14.000000000 +0100
+++ linux-2.4.22/drivers/net/sb1250-mac.c 2003-07-08 01:48:07.000000000 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Broadcom Corporation
+ * Copyright (C) 2001,2002,2003 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -17,10 +17,10 @@
*/
/*
- This driver is designed for the Broadcom BCM12500 SOC chip's built-in
+ This driver is designed for the Broadcom SiByte SOC built-in
Ethernet controllers.
- The author may be reached as mpl@broadcom.com
+ Written by Mitch Lichtenberg at Broadcom Corp.
*/
@@ -31,6 +31,7 @@
These may be modified when a driver module is loaded. */
static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
+static int noisy_mii = 1; /* mii status msgs */
/* Used to pass the media type, etc.
Both 'options[]' and 'full_duplex[]' should exist for driver
@@ -44,8 +45,10 @@
static int full_duplex[MAX_UNITS] = {-1, -1, -1};
#endif
+#ifdef CONFIG_SBMAC_COALESCE
static int int_pktcnt = 0;
static int int_timeout = 0;
+#endif
/* Operational parameters that usually are not changed. */
@@ -74,8 +77,7 @@
#include <asm/processor.h> /* Processor type for cache alignment. */
#include <asm/bitops.h>
#include <asm/io.h>
-#include <asm/sibyte/sb1250.h>
-#include <asm/sibyte/64bit.h>
+#include <asm/cache.h>
/* This is only here until the firmware is ready. In that case,
the firmware leaves the ethernet address in the register for us. */
@@ -89,26 +91,29 @@
/* These identify the driver base version and may not be removed. */
#if 0
static char version1[] __devinitdata =
-"sb1250-mac.c:1.00 1/11/2001 Written by Mitch Lichtenberg (mpl@broadcom.com)\n";
+"sb1250-mac.c:1.00 1/11/2001 Written by Mitch Lichtenberg\n";
#endif
-MODULE_AUTHOR("Mitch Lichtenberg (mpl@broadcom.com)");
-MODULE_DESCRIPTION("Broadcom BCM12500 SOC GB Ethernet driver");
+MODULE_AUTHOR("Mitch Lichtenberg (Broadcom Corp.)");
+MODULE_DESCRIPTION("Broadcom SiByte SOC GB Ethernet driver");
MODULE_PARM(debug, "i");
+MODULE_PARM(noisy_mii, "i");
MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i");
MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
MODULE_PARM(int_pktcnt, "i");
MODULE_PARM(int_timeout, "i");
+#include <asm/sibyte/sb1250.h>
#include <asm/sibyte/sb1250_defs.h>
#include <asm/sibyte/sb1250_regs.h>
#include <asm/sibyte/sb1250_mac.h>
#include <asm/sibyte/sb1250_dma.h>
#include <asm/sibyte/sb1250_int.h>
-#include <asm/sibyte/sb1250_scd.h> /* Only to check SOC part number. */
+#include <asm/sibyte/sb1250_scd.h>
+#include <asm/sibyte/64bit.h>
/**********************************************************************
@@ -117,8 +122,6 @@
typedef unsigned long sbmac_port_t;
-typedef uint64_t sbmac_physaddr_t;
-typedef uint64_t sbmac_enetaddr_t;
typedef enum { sbmac_speed_auto, sbmac_speed_10,
sbmac_speed_100, sbmac_speed_1000 } sbmac_speed_t;
@@ -142,17 +145,11 @@
(d)->sbdma_dscrtable : (d)->f+1)
-#define CACHELINESIZE 32
-#define NUMCACHEBLKS(x) (((x)+CACHELINESIZE-1)/CACHELINESIZE)
-#define KMALLOC(x) kmalloc((x),GFP_KERNEL)
-#define KFREE(x) kfree(x)
-#define KVTOPHYS(x) virt_to_bus((void *)(x))
+#define NUMCACHEBLKS(x) (((x)+SMP_CACHE_BYTES-1)/SMP_CACHE_BYTES)
+#define SBMAC_READCSR(t) in64((unsigned long)t)
+#define SBMAC_WRITECSR(t,v) out64(v, (unsigned long)t)
-#define SBMAC_READCSR(t) (in64((unsigned long)(t)))
-#define SBMAC_WRITECSR(t,v) (out64(v, (unsigned long)(t)))
-
-#define PKSEG1(x) ((sbmac_port_t) KSEG1ADDR(x))
#define SBMAC_MAX_TXDESCR 32
#define SBMAC_MAX_RXDESCR 32
@@ -172,7 +169,6 @@
} sbdmadscr_t;
typedef unsigned long paddr_t;
-typedef unsigned long vaddr_t;
/**********************************************************************
* DMA Controller structure
@@ -190,8 +186,8 @@
int sbdma_txdir; /* direction (1=transmit) */
int sbdma_maxdescr; /* total # of descriptors in ring */
#ifdef CONFIG_SBMAC_COALESCE
- int sbdma_int_pktcnt; /* # descriptors rx before interrupt*/
- int sbdma_int_timeout; /* # usec rx interrupt */
+ int sbdma_int_pktcnt; /* # descriptors rx/tx before interrupt*/
+ int sbdma_int_timeout; /* # usec rx/tx interrupt */
#endif
sbmac_port_t sbdma_config0; /* DMA config register 0 */
@@ -212,7 +208,6 @@
paddr_t sbdma_dscrtable_phys; /* and also the phys addr */
sbdmadscr_t *sbdma_addptr; /* next dscr for sw to add */
sbdmadscr_t *sbdma_remptr; /* next dscr for sw to remove */
-
} sbmacdma_t;
@@ -232,10 +227,10 @@
struct net_device_stats sbm_stats;
int sbm_devflags; /* current device flags */
- int sbm_phy_oldbmsr;
- int sbm_phy_oldanlpar;
- int sbm_phy_oldk1stsr;
- int sbm_phy_oldlinkstat;
+ int sbm_phy_oldbmsr;
+ int sbm_phy_oldanlpar;
+ int sbm_phy_oldk1stsr;
+ int sbm_phy_oldlinkstat;
int sbm_buffersize;
unsigned char sbm_phys[2];
@@ -244,7 +239,7 @@
* Controller-specific things
*/
- sbmac_port_t sbm_base; /* MAC's base address */
+ unsigned long sbm_base; /* MAC's base address */
sbmac_state_t sbm_state; /* current state */
sbmac_port_t sbm_macenable; /* MAC Enable Register */
@@ -260,13 +255,12 @@
sbmac_duplex_t sbm_duplex; /* current duplex */
sbmac_fc_t sbm_fc; /* current flow control setting */
- u_char sbm_hwaddr[ETHER_ADDR_LEN];
+ unsigned char sbm_hwaddr[ETHER_ADDR_LEN];
sbmacdma_t sbm_txdma; /* for now, only use channel 0 */
sbmacdma_t sbm_rxdma;
int rx_hw_checksum;
int sbe_idx;
-
};
@@ -295,12 +289,11 @@
static void sbmac_channel_stop(struct sbmac_softc *s);
static sbmac_state_t sbmac_set_channel_state(struct sbmac_softc *,sbmac_state_t);
static void sbmac_promiscuous_mode(struct sbmac_softc *sc,int onoff);
-/*static void sbmac_init_and_start(struct sbmac_softc *sc);*/
static uint64_t sbmac_addr2reg(unsigned char *ptr);
static void sbmac_intr(int irq,void *dev_instance,struct pt_regs *rgs);
static int sbmac_start_tx(struct sk_buff *skb, struct net_device *dev);
static void sbmac_setmulti(struct sbmac_softc *sc);
-static int sbmac_init(struct net_device *dev);
+static int sbmac_init(struct net_device *dev, int idx);
static int sbmac_set_speed(struct sbmac_softc *s,sbmac_speed_t speed);
static int sbmac_set_duplex(struct sbmac_softc *s,sbmac_duplex_t duplex,sbmac_fc_t fc);
@@ -325,7 +318,6 @@
********************************************************************* */
static uint64_t sbmac_orig_hwaddr[MAX_UNITS];
-static uint64_t chip_revision;
/**********************************************************************
@@ -347,8 +339,8 @@
#define BMCR_DUPLEX 0x0100
#define BMCR_COLTEST 0x0080
#define BMCR_SPEED1 0x0040
-#define BMCR_SPEED1000 (BMCR_SPEED1)
-#define BMCR_SPEED100 (BMCR_SPEED0)
+#define BMCR_SPEED1000 BMCR_SPEED1
+#define BMCR_SPEED100 BMCR_SPEED0
#define BMCR_SPEED10 0
#define BMSR_100BT4 0x8000
@@ -511,7 +503,8 @@
curmask = 1 << (bitcnt - 1);
for (i = 0; i < bitcnt; i++) {
- if (data & curmask) bits |= M_MAC_MDIO_OUT;
+ if (data & curmask)
+ bits |= M_MAC_MDIO_OUT;
else bits &= ~M_MAC_MDIO_OUT;
SBMAC_WRITECSR(s->sbm_mdio,bits);
SBMAC_WRITECSR(s->sbm_mdio,bits | M_MAC_MDC);
@@ -533,7 +526,7 @@
* regidx = index of register to read
*
* Return value:
- * value read, or 0 if an error occured.
+ * value read, or 0 if an error occurred.
********************************************************************* */
static unsigned int sbmac_mii_read(struct sbmac_softc *s,int phyaddr,int regidx)
@@ -575,7 +568,7 @@
SBMAC_WRITECSR(s->sbm_mdio,M_MAC_MDIO_DIR_INPUT);
/*
- * If an error occured, the PHY will signal '1' back
+ * If an error occurred, the PHY will signal '1' back
*/
error = SBMAC_READCSR(s->sbm_mdio) & M_MAC_MDIO_IN;
@@ -592,7 +585,8 @@
regval <<= 1;
if (error == 0) {
- if (SBMAC_READCSR(s->sbm_mdio) & M_MAC_MDIO_IN) regval |= 1;
+ if (SBMAC_READCSR(s->sbm_mdio) & M_MAC_MDIO_IN)
+ regval |= 1;
}
SBMAC_WRITECSR(s->sbm_mdio,M_MAC_MDIO_DIR_INPUT | M_MAC_MDC);
@@ -602,7 +596,8 @@
/* Switch back to output */
SBMAC_WRITECSR(s->sbm_mdio,M_MAC_MDIO_DIR_OUTPUT);
- if (error == 0) return regval;
+ if (error == 0)
+ return regval;
return 0;
}
@@ -672,66 +667,68 @@
d->sbdma_channel = chan;
d->sbdma_txdir = txrx;
+#if 0
/* RMON clearing */
s->sbe_idx =(s->sbm_base - A_MAC_BASE_0)/MAC_SPACING;
+#endif
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_BYTES)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_COLLISIONS)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_LATE_COL)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_EX_COL)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_FCS_ERROR)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_ABORT)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_BAD)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_GOOD)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_RUNT)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_OVERSIZE)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_BYTES)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_MCAST)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_BCAST)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_BAD)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_GOOD)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_RUNT)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_OVERSIZE)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_FCS_ERROR)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_LENGTH_ERROR)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_CODE_ERROR)), 0);
- SBMAC_WRITECSR(PKSEG1(
- A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_ALIGN_ERROR)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_BYTES)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_COLLISIONS)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_LATE_COL)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_EX_COL)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_FCS_ERROR)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_ABORT)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_BAD)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_GOOD)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_RUNT)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_TX_OVERSIZE)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_BYTES)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_MCAST)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_BCAST)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_BAD)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_GOOD)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_RUNT)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_OVERSIZE)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_FCS_ERROR)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_LENGTH_ERROR)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_CODE_ERROR)), 0);
+ SBMAC_WRITECSR(KSEG1ADDR(
+ A_MAC_REGISTER(s->sbe_idx, R_MAC_RMON_RX_ALIGN_ERROR)), 0);
/*
* initialize register pointers
*/
d->sbdma_config0 =
- PKSEG1(s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_CONFIG0));
+ s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_CONFIG0);
d->sbdma_config1 =
- PKSEG1(s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_CONFIG1));
+ s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_CONFIG1);
d->sbdma_dscrbase =
- PKSEG1(s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_DSCR_BASE));
+ s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_DSCR_BASE);
d->sbdma_dscrcnt =
- PKSEG1(s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_DSCR_CNT));
+ s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_DSCR_CNT);
d->sbdma_curdscr =
- PKSEG1(s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_CUR_DSCRADDR));
+ s->sbm_base + R_MAC_DMA_REGISTER(txrx,chan,R_MAC_DMA_CUR_DSCRADDR);
/*
* Allocate memory for the ring
@@ -740,47 +737,39 @@
d->sbdma_maxdescr = maxdescr;
d->sbdma_dscrtable = (sbdmadscr_t *)
- KMALLOC(d->sbdma_maxdescr*sizeof(sbdmadscr_t));
+ kmalloc(d->sbdma_maxdescr*sizeof(sbdmadscr_t), GFP_KERNEL);
memset(d->sbdma_dscrtable,0,d->sbdma_maxdescr*sizeof(sbdmadscr_t));
d->sbdma_dscrtable_end = d->sbdma_dscrtable + d->sbdma_maxdescr;
- d->sbdma_dscrtable_phys = KVTOPHYS(d->sbdma_dscrtable);
+ d->sbdma_dscrtable_phys = virt_to_phys(d->sbdma_dscrtable);
/*
* And context table
*/
d->sbdma_ctxtable = (struct sk_buff **)
- KMALLOC(d->sbdma_maxdescr*sizeof(struct sk_buff *));
+ kmalloc(d->sbdma_maxdescr*sizeof(struct sk_buff *), GFP_KERNEL);
memset(d->sbdma_ctxtable,0,d->sbdma_maxdescr*sizeof(struct sk_buff *));
#ifdef CONFIG_SBMAC_COALESCE
- /*
- * Setup Rx DMA coalescing defaults
- */
-
- if ( txrx == DMA_RX ) {
- if ( int_pktcnt ) {
- d->sbdma_int_pktcnt = int_pktcnt;
- }
- else {
- d->sbdma_int_pktcnt = 1;
- }
+ /*
+ * Setup Rx/Tx DMA coalescing defaults
+ */
- if ( int_timeout ) {
- d->sbdma_int_timeout = int_timeout;
- }
- else {
- d->sbdma_int_timeout = 0;
- }
- }
- else {
- d->sbdma_int_pktcnt = 0;
- d->sbdma_int_timeout = 0;
- }
+ if ( int_pktcnt ) {
+ d->sbdma_int_pktcnt = int_pktcnt;
+ } else {
+ d->sbdma_int_pktcnt = 1;
+ }
+
+ if ( int_timeout ) {
+ d->sbdma_int_timeout = int_timeout;
+ } else {
+ d->sbdma_int_timeout = 0;
+ }
#endif
}
@@ -800,43 +789,34 @@
static void sbdma_channel_start(sbmacdma_t *d, int rxtx )
{
- /*
- * Turn on the DMA channel
- */
+ /*
+ * Turn on the DMA channel
+ */
#ifdef CONFIG_SBMAC_COALESCE
- if (rxtx == DMA_RX) {
- SBMAC_WRITECSR(d->sbdma_config1,
+ SBMAC_WRITECSR(d->sbdma_config1,
V_DMA_INT_TIMEOUT(d->sbdma_int_timeout) |
0);
- SBMAC_WRITECSR(d->sbdma_config0,
- M_DMA_EOP_INT_EN |
- V_DMA_RINGSZ(d->sbdma_maxdescr) |
- V_DMA_INT_PKTCNT(d->sbdma_int_pktcnt) |
- 0);
- }
- else {
- SBMAC_WRITECSR(d->sbdma_config1,0);
SBMAC_WRITECSR(d->sbdma_config0,
+ M_DMA_EOP_INT_EN |
V_DMA_RINGSZ(d->sbdma_maxdescr) |
+ V_DMA_INT_PKTCNT(d->sbdma_int_pktcnt) |
0);
- }
#else
- SBMAC_WRITECSR(d->sbdma_config1,0);
- SBMAC_WRITECSR(d->sbdma_config0,
- V_DMA_RINGSZ(d->sbdma_maxdescr) |
- 0);
+ SBMAC_WRITECSR(d->sbdma_config1,0);
+ SBMAC_WRITECSR(d->sbdma_config0,
+ V_DMA_RINGSZ(d->sbdma_maxdescr) |
+ 0);
#endif
-
- SBMAC_WRITECSR(d->sbdma_dscrbase,d->sbdma_dscrtable_phys);
-
- /*
- * Initialize ring pointers
- */
-
- d->sbdma_addptr = d->sbdma_dscrtable;
- d->sbdma_remptr = d->sbdma_dscrtable;
+ SBMAC_WRITECSR(d->sbdma_dscrbase,d->sbdma_dscrtable_phys);
+
+ /*
+ * Initialize ring pointers
+ */
+
+ d->sbdma_addptr = d->sbdma_dscrtable;
+ d->sbdma_remptr = d->sbdma_dscrtable;
}
/**********************************************************************
@@ -921,7 +901,7 @@
if (nextdsc == d->sbdma_remptr) {
return -ENOSPC;
}
-
+
/*
* Allocate a sk_buff if we don't already have one.
* If we do have an sk_buff, reset it so that it's empty.
@@ -935,22 +915,22 @@
* 3. The buffer can be aligned such that the IP addresses are
* naturally aligned.
*
- * Remember, the SB1250's MAC writes whole cache lines at a time,
+ * Remember, the SOCs MAC writes whole cache lines at a time,
* without reading the old contents first. So, if the sk_buff's
- * data portion starts in the middle of a cache line, the SB1250
+ * data portion starts in the middle of a cache line, the SOC
* DMA will trash the beginning (and ending) portions.
*/
if (sb == NULL) {
- sb_new = dev_alloc_skb(ENET_PACKET_SIZE + CACHELINESIZE*2 + ETHER_ALIGN);
+ sb_new = dev_alloc_skb(ENET_PACKET_SIZE + SMP_CACHE_BYTES * 2 + ETHER_ALIGN);
if (sb_new == NULL) {
printk(KERN_INFO "%s: sk_buff allocation failed\n",
d->sbdma_eth->sbm_dev->name);
return -ENOBUFS;
}
-
- sbdma_align_skb(sb_new,CACHELINESIZE,ETHER_ALIGN);
-
+
+ sbdma_align_skb(sb_new, SMP_CACHE_BYTES, ETHER_ALIGN);
+
/* mark skbuff owned by our device */
sb_new->dev = d->sbdma_eth->sbm_dev;
}
@@ -958,7 +938,7 @@
sb_new = sb;
/*
* nothing special to reinit buffer, it's already aligned
- * and sb->tail already points to a good place.
+ * and sb->data already points to a good place.
*/
}
@@ -967,18 +947,18 @@
*/
#ifdef CONFIG_SBMAC_COALESCE
- /*
- * Do not interrupt per DMA transfer.
- */
- dsc->dscr_a = KVTOPHYS(sb_new->tail) |
- V_DMA_DSCRA_A_SIZE(NUMCACHEBLKS(pktsize+ETHER_ALIGN)) |
- 0;
+ /*
+ * Do not interrupt per DMA transfer.
+ */
+ dsc->dscr_a = virt_to_phys(sb_new->tail) |
+ V_DMA_DSCRA_A_SIZE(NUMCACHEBLKS(pktsize+ETHER_ALIGN)) |
+ 0;
#else
- dsc->dscr_a = KVTOPHYS(sb_new->tail) |
+ dsc->dscr_a = virt_to_phys(sb_new->tail) |
V_DMA_DSCRA_A_SIZE(NUMCACHEBLKS(pktsize+ETHER_ALIGN)) |
M_DMA_DSCRA_INTERRUPT;
#endif
-
+
/* receiving: no options */
dsc->dscr_b = 0;
@@ -1057,12 +1037,14 @@
* while doing the calculation.
*/
- phys = KVTOPHYS(sb->data);
- ncb = NUMCACHEBLKS(length+(phys & (CACHELINESIZE-1)));
-
+ phys = virt_to_phys(sb->data);
+ ncb = NUMCACHEBLKS(length+(phys & (SMP_CACHE_BYTES - 1)));
+
dsc->dscr_a = phys |
V_DMA_DSCRA_A_SIZE(ncb) |
+#ifndef CONFIG_SBMAC_COALESCE
M_DMA_DSCRA_INTERRUPT |
+#endif
M_DMA_ETHTX_SOP;
/* transmitting: set outbound options and length */
@@ -1139,7 +1121,8 @@
int idx;
for (idx = 0; idx < SBMAC_MAX_RXDESCR-1; idx++) {
- if (sbdma_add_rcvbuffer(d,NULL) != 0) break;
+ if (sbdma_add_rcvbuffer(d,NULL) != 0)
+ break;
}
}
@@ -1190,7 +1173,8 @@
* the hardware is working on right now.
*/
- if (curidx == hwidx) break;
+ if (curidx == hwidx)
+ break;
/*
* Otherwise, get the packet's sk_buff ptr back
@@ -1211,49 +1195,47 @@
if (!(dsc->dscr_a & M_DMA_ETHRX_BAD)) {
/*
- * Set length into the packet
- */
- skb_put(sb,len);
-
- /*
* Add a new buffer to replace the old one. If we fail
* to allocate a buffer, we're going to drop this
* packet and put it right back on the receive ring.
*/
if (sbdma_add_rcvbuffer(d,NULL) == -ENOBUFS) {
- sbdma_add_rcvbuffer(d,sb); /* re-add old buffer */
- }
- else {
- /*
- * Buffer has been replaced on the receive ring.
- * Pass the buffer to the kernel
- */
- sc->sbm_stats.rx_bytes += len;
- sc->sbm_stats.rx_packets++;
- sb->protocol = eth_type_trans(sb,d->sbdma_eth->sbm_dev);
- if (sc->rx_hw_checksum == ENABLE) {
- /* if the ip checksum is good indicate in skb.
- else set CHECKSUM_NONE as device failed to
- checksum the packet */
-
- if (((dsc->dscr_b) |M_DMA_ETHRX_BADTCPCS) ||
- ((dsc->dscr_a)| M_DMA_ETHRX_BADIP4CS)){
- sb->ip_summed = CHECKSUM_NONE;
- } else {
- printk(KERN_DEBUG "hw checksum fail .\n");
- sb->ip_summed = CHECKSUM_UNNECESSARY;
- }
- } /*rx_hw_checksum */
-
- netif_rx(sb);
- }
- }
- else {
+ sc->sbm_stats.rx_dropped++;
+ sbdma_add_rcvbuffer(d,sb); /* re-add old buffer */
+ } else {
+ /*
+ * Set length into the packet
+ */
+ skb_put(sb,len);
+
+ /*
+ * Buffer has been replaced on the
+ * receive ring. Pass the buffer to
+ * the kernel
+ */
+ sc->sbm_stats.rx_bytes += len;
+ sc->sbm_stats.rx_packets++;
+ sb->protocol = eth_type_trans(sb,d->sbdma_eth->sbm_dev);
+ /* Check hw IPv4/TCP checksum if supported */
+ if (sc->rx_hw_checksum == ENABLE) {
+ if (!((dsc->dscr_a) & M_DMA_ETHRX_BADIP4CS) &&
+ !((dsc->dscr_a) & M_DMA_ETHRX_BADTCPCS)) {
+ sb->ip_summed = CHECKSUM_UNNECESSARY;
+ /* don't need to set sb->csum */
+ } else {
+ sb->ip_summed = CHECKSUM_NONE;
+ }
+ }
+
+ netif_rx(sb);
+ }
+ } else {
/*
* Packet was mangled somehow. Just drop it and
* put it back on the receive ring.
*/
+ sc->sbm_stats.rx_errors++;
sbdma_add_rcvbuffer(d,sb);
}
@@ -1309,36 +1291,17 @@
*/
curidx = d->sbdma_remptr - d->sbdma_dscrtable;
- {
- /* XXX This is gross, ugly, and only here because justin hacked it
- in to fix a problem without really understanding it.
-
- It seems that, for whatever reason, this routine is invoked immediately upon the enabling of interrupts.
- So then the Read below returns zero, making hwidx a negative number, and anti-hilarity
- ensues.
-
- I'm guessing there's a proper fix involving clearing out interrupt state from old packets
- before enabling interrupts, but I'm not sure.
-
- Anyways, this hack seems to work, and is Good Enough for 11 PM. :)
-
- -Justin
- */
-
- uint64_t tmp = SBMAC_READCSR(d->sbdma_curdscr);
- if (!tmp) {
- break;
- }
- hwidx = (int) (((tmp & M_DMA_CURDSCR_ADDR) -
- d->sbdma_dscrtable_phys) / sizeof(sbdmadscr_t));
- }
+ hwidx = (int) (((SBMAC_READCSR(d->sbdma_curdscr) & M_DMA_CURDSCR_ADDR) -
+ d->sbdma_dscrtable_phys) / sizeof(sbdmadscr_t));
+
/*
* If they're the same, that means we've processed all
* of the descriptors up to (but not including) the one that
* the hardware is working on right now.
*/
- if (curidx == hwidx) break;
+ if (curidx == hwidx)
+ break;
/*
* Otherwise, get the packet's sk_buff ptr back
@@ -1405,14 +1368,14 @@
* figure out the addresses of some ports
*/
- s->sbm_macenable = PKSEG1(s->sbm_base + R_MAC_ENABLE);
- s->sbm_maccfg = PKSEG1(s->sbm_base + R_MAC_CFG);
- s->sbm_fifocfg = PKSEG1(s->sbm_base + R_MAC_THRSH_CFG);
- s->sbm_framecfg = PKSEG1(s->sbm_base + R_MAC_FRAMECFG);
- s->sbm_rxfilter = PKSEG1(s->sbm_base + R_MAC_ADFILTER_CFG);
- s->sbm_isr = PKSEG1(s->sbm_base + R_MAC_STATUS);
- s->sbm_imr = PKSEG1(s->sbm_base + R_MAC_INT_MASK);
- s->sbm_mdio = PKSEG1(s->sbm_base + R_MAC_MDIO);
+ s->sbm_macenable = s->sbm_base + R_MAC_ENABLE;
+ s->sbm_maccfg = s->sbm_base + R_MAC_CFG;
+ s->sbm_fifocfg = s->sbm_base + R_MAC_THRSH_CFG;
+ s->sbm_framecfg = s->sbm_base + R_MAC_FRAMECFG;
+ s->sbm_rxfilter = s->sbm_base + R_MAC_ADFILTER_CFG;
+ s->sbm_isr = s->sbm_base + R_MAC_STATUS;
+ s->sbm_imr = s->sbm_base + R_MAC_INT_MASK;
+ s->sbm_mdio = s->sbm_base + R_MAC_MDIO;
s->sbm_phys[0] = 1;
s->sbm_phys[1] = 0;
@@ -1451,12 +1414,12 @@
static void sbdma_uninitctx(struct sbmacdma_s *d)
{
if (d->sbdma_dscrtable) {
- KFREE(d->sbdma_dscrtable);
+ kfree(d->sbdma_dscrtable);
d->sbdma_dscrtable = NULL;
}
if (d->sbdma_ctxtable) {
- KFREE(d->sbdma_ctxtable);
+ kfree(d->sbdma_ctxtable);
d->sbdma_ctxtable = NULL;
}
}
@@ -1486,13 +1449,14 @@
uint64_t reg;
sbmac_port_t port;
uint64_t cfg,fifo,framecfg;
- int idx;
+ int idx, th_value;
/*
* Don't do this if running
*/
- if (s->sbm_state == sbmac_state_on) return;
+ if (s->sbm_state == sbmac_state_on)
+ return;
/*
* Bring the controller out of reset, but leave it off.
@@ -1519,31 +1483,35 @@
0;
/*
- * Be sure that RD_THRSH+WR_THRSH <= 32
+ * Be sure that RD_THRSH+WR_THRSH <= 32 for pass1 pars
+ * and make sure that RD_THRSH + WR_THRSH <=128 for pass2 and above
* Use a larger RD_THRSH for gigabit
*/
+ if (periph_rev >= 2)
+ th_value = 64;
+ else
+ th_value = 28;
fifo = V_MAC_TX_WR_THRSH(4) | /* Must be '4' or '8' */
((s->sbm_speed == sbmac_speed_1000)
- ? V_MAC_TX_RD_THRSH(28) : V_MAC_TX_RD_THRSH(4)) |
+ ? V_MAC_TX_RD_THRSH(th_value) : V_MAC_TX_RD_THRSH(4)) |
V_MAC_TX_RL_THRSH(4) |
V_MAC_RX_PL_THRSH(4) |
V_MAC_RX_RD_THRSH(4) | /* Must be '4' */
V_MAC_RX_PL_THRSH(4) |
V_MAC_RX_RL_THRSH(8) |
0;
-
+
framecfg = V_MAC_MIN_FRAMESZ_DEFAULT |
V_MAC_MAX_FRAMESZ_DEFAULT |
V_MAC_BACKOFF_SEL(1);
-
-
+
/*
* Clear out the hash address map
*/
- port = PKSEG1(s->sbm_base + R_MAC_HASH_BASE);
- for (idx = 0; idx < MAC_HASH_COUNT; idx++) {
+ port = s->sbm_base + R_MAC_HASH_BASE;
+ for (idx = 0; idx < MAC_HASH_COUNT; idx++) {
SBMAC_WRITECSR(port,0);
port += sizeof(uint64_t);
}
@@ -1552,7 +1520,7 @@
* Clear out the exact-match table
*/
- port = PKSEG1(s->sbm_base + R_MAC_ADDR_BASE);
+ port = s->sbm_base + R_MAC_ADDR_BASE;
for (idx = 0; idx < MAC_ADDR_COUNT; idx++) {
SBMAC_WRITECSR(port,0);
port += sizeof(uint64_t);
@@ -1562,14 +1530,14 @@
* Clear out the DMA Channel mapping table registers
*/
- port = PKSEG1(s->sbm_base + R_MAC_CHUP0_BASE);
+ port = s->sbm_base + R_MAC_CHUP0_BASE;
for (idx = 0; idx < MAC_CHMAP_COUNT; idx++) {
SBMAC_WRITECSR(port,0);
port += sizeof(uint64_t);
}
- port = PKSEG1(s->sbm_base + R_MAC_CHLO0_BASE);
+ port = s->sbm_base + R_MAC_CHLO0_BASE;
for (idx = 0; idx < MAC_CHMAP_COUNT; idx++) {
SBMAC_WRITECSR(port,0);
port += sizeof(uint64_t);
@@ -1582,13 +1550,13 @@
reg = sbmac_addr2reg(s->sbm_hwaddr);
- port = PKSEG1(s->sbm_base + R_MAC_ADDR_BASE);
+ port = s->sbm_base + R_MAC_ADDR_BASE;
SBMAC_WRITECSR(port,reg);
- port = PKSEG1(s->sbm_base + R_MAC_ETHERNET_ADDR);
+ port = s->sbm_base + R_MAC_ETHERNET_ADDR;
#ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
/*
- * Pass1 SB1250s do not receive packets addressed to the
+ * Pass1 SOCs do not receive packets addressed to the
* destination address in the R_MAC_ETHERNET_ADDR register.
* Set the value to zero.
*/
@@ -1646,7 +1614,7 @@
* Accept any TX interrupt and EOP count/timer RX interrupts on ch 0
*/
SBMAC_WRITECSR(s->sbm_imr,
- (M_MAC_INT_CHANNEL << S_MAC_TX_CH0) |
+ ((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_TX_CH0) |
((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_RX_CH0));
#else
/*
@@ -1702,7 +1670,8 @@
{
/* don't do this if already stopped */
- if (s->sbm_state == sbmac_state_off) return;
+ if (s->sbm_state == sbmac_state_off)
+ return;
/* don't accept any packets, disable all interrupts */
@@ -1795,7 +1764,8 @@
{
uint64_t reg;
- if (sc->sbm_state != sbmac_state_on) return;
+ if (sc->sbm_state != sbmac_state_on)
+ return;
if (onoff) {
reg = SBMAC_READCSR(sc->sbm_rxfilter);
@@ -1825,15 +1795,15 @@
{
uint64_t reg;
- reg = SBMAC_READCSR(sc->sbm_rxfilter);
- reg &= ~M_MAC_IPHDR_OFFSET;
/* Hard code the off set to 15 for now */
- reg |= 15 << S_MAC_IPHDR_OFFSET;
+ reg = SBMAC_READCSR(sc->sbm_rxfilter);
+ reg &= ~M_MAC_IPHDR_OFFSET | V_MAC_IPHDR_OFFSET(15);
SBMAC_WRITECSR(sc->sbm_rxfilter,reg);
/* read system identification to determine revision */
- if (sb1250_pass >= K_SYS_REVISION_PASS2) {
- printk(KERN_INFO "pass2 - enabling Rx rcv tcp checksum\n");
+ if (periph_rev >= 2) {
+ printk(KERN_INFO "%s: enabling TCP rcv checksum\n",
+ sc->sbm_dev->name);
sc->rx_hw_checksum = ENABLE;
} else {
sc->rx_hw_checksum = DISABLE;
@@ -1841,31 +1811,6 @@
}
-#if 0
-/**********************************************************************
- * SBMAC_INIT_AND_START(sc)
- *
- * Stop the channel and restart it. This is generally used
- * when we have to do something to the channel that requires
- * a swift kick.
- *
- * Input parameters:
- * sc - softc
- ********************************************************************* */
-
-static void sbmac_init_and_start(struct sbmac_softc *sc)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&(sc->sbm_lock),flags);
-
- sbmac_set_channel_state(sc,sbmac_state_on);
-
- spin_unlock_irqrestore(&(sc->sbm_lock),flags);
-}
-#endif
-
-
/**********************************************************************
* SBMAC_ADDR2REG(ptr)
*
@@ -1927,7 +1872,8 @@
s->sbm_speed = speed;
- if (s->sbm_state == sbmac_state_on) return 0; /* save for next restart */
+ if (s->sbm_state == sbmac_state_on)
+ return 0; /* save for next restart */
/*
* Read current register values
@@ -1987,7 +1933,6 @@
SBMAC_WRITECSR(s->sbm_maccfg,cfg);
return 1;
-
}
/**********************************************************************
@@ -2017,7 +1962,8 @@
s->sbm_duplex = duplex;
s->sbm_fc = fc;
- if (s->sbm_state == sbmac_state_on) return 0; /* save for next restart */
+ if (s->sbm_state == sbmac_state_on)
+ return 0; /* save for next restart */
/*
* Read current register values
@@ -2116,7 +2062,8 @@
isr = SBMAC_READCSR(sc->sbm_isr) & ~M_MAC_COUNTER_ADDR;
- if (isr == 0) break;
+ if (isr == 0)
+ break;
/*
* Transmits on channel 0
@@ -2151,7 +2098,6 @@
sbdma_rx_process(sc,&(sc->sbm_rxdma));
}
}
-
}
@@ -2224,12 +2170,12 @@
*/
for (idx = 1; idx < MAC_ADDR_COUNT; idx++) {
- port = PKSEG1(sc->sbm_base + R_MAC_ADDR_BASE+(idx*sizeof(uint64_t)));
+ port = sc->sbm_base + R_MAC_ADDR_BASE+(idx*sizeof(uint64_t));
SBMAC_WRITECSR(port,0);
}
for (idx = 0; idx < MAC_HASH_COUNT; idx++) {
- port = PKSEG1(sc->sbm_base + R_MAC_HASH_BASE+(idx*sizeof(uint64_t)));
+ port = sc->sbm_base + R_MAC_HASH_BASE+(idx*sizeof(uint64_t));
SBMAC_WRITECSR(port,0);
}
@@ -2266,8 +2212,7 @@
mclist = dev->mc_list;
while (mclist && (idx < MAC_ADDR_COUNT)) {
reg = sbmac_addr2reg(mclist->dmi_addr);
- port = PKSEG1(sc->sbm_base +
- R_MAC_ADDR_BASE+(idx*sizeof(uint64_t)));
+ port = sc->sbm_base + R_MAC_ADDR_BASE+(idx * sizeof(uint64_t));
SBMAC_WRITECSR(port,reg);
idx++;
mclist = mclist->next;
@@ -2304,10 +2249,14 @@
{
int digit;
- if ((str >= '0') && (str <= '9')) digit = str - '0';
- else if ((str >= 'a') && (str <= 'f')) digit = str - 'a' + 10;
- else if ((str >= 'A') && (str <= 'F')) digit = str - 'A' + 10;
- else return -1;
+ if ((str >= '0') && (str <= '9'))
+ digit = str - '0';
+ else if ((str >= 'a') && (str <= 'f'))
+ digit = str - 'a' + 10;
+ else if ((str >= 'A') && (str <= 'F'))
+ digit = str - 'A' + 10;
+ else
+ return -1;
return digit;
}
@@ -2326,16 +2275,18 @@
* 0 if ok, else -1
********************************************************************* */
-static int sbmac_parse_hwaddr(char *str,u_char *hwaddr)
+static int sbmac_parse_hwaddr(char *str, unsigned char *hwaddr)
{
int digit1,digit2;
int idx = 6;
while (*str && (idx > 0)) {
digit1 = sbmac_parse_xdigit(*str);
- if (digit1 < 0) return -1;
+ if (digit1 < 0)
+ return -1;
str++;
- if (!*str) return -1;
+ if (!*str)
+ return -1;
if ((*str == ':') || (*str == '-')) {
digit2 = digit1;
@@ -2343,15 +2294,18 @@
}
else {
digit2 = sbmac_parse_xdigit(*str);
- if (digit2 < 0) return -1;
+ if (digit2 < 0)
+ return -1;
str++;
}
*hwaddr++ = (digit1 << 4) | digit2;
idx--;
- if (*str == '-') str++;
- if (*str == ':') str++;
+ if (*str == '-')
+ str++;
+ if (*str == ':')
+ str++;
}
return 0;
}
@@ -2359,11 +2313,11 @@
static int sb1250_change_mtu(struct net_device *_dev, int new_mtu)
{
- if (new_mtu > ENET_PACKET_SIZE)
- return -EINVAL;
- _dev->mtu = new_mtu;
+ if (new_mtu > ENET_PACKET_SIZE)
+ return -EINVAL;
+ _dev->mtu = new_mtu;
printk(KERN_INFO "changing the mtu to %d\n", new_mtu);
- return 0;
+ return 0;
}
/**********************************************************************
@@ -2378,19 +2332,20 @@
* status
********************************************************************* */
-static int sbmac_init(struct net_device *dev)
+static int sbmac_init(struct net_device *dev, int idx)
{
struct sbmac_softc *sc;
- u_char *eaddr;
+ unsigned char *eaddr;
uint64_t ea_reg;
- int idx;
+ int i;
sc = (struct sbmac_softc *)dev->priv;
/* Determine controller base address */
- sc->sbm_base = (sbmac_port_t) dev->base_addr;
+ sc->sbm_base = KSEG1ADDR(dev->base_addr);
sc->sbm_dev = dev;
+ sc->sbe_idx = idx;
eaddr = sc->sbm_hwaddr;
@@ -2399,16 +2354,15 @@
* for us in the ethernet address register for each mac.
*/
- ea_reg = SBMAC_READCSR(PKSEG1(sc->sbm_base + R_MAC_ETHERNET_ADDR));
- SBMAC_WRITECSR(PKSEG1(sc->sbm_base + R_MAC_ETHERNET_ADDR), 0);
- for (idx = 0; idx < 6; idx++) {
- eaddr[idx] = (uint8_t) (ea_reg & 0xFF);
+ ea_reg = SBMAC_READCSR(sc->sbm_base + R_MAC_ETHERNET_ADDR);
+ SBMAC_WRITECSR(sc->sbm_base + R_MAC_ETHERNET_ADDR, 0);
+ for (i = 0; i < 6; i++) {
+ eaddr[i] = (uint8_t) (ea_reg & 0xFF);
ea_reg >>= 8;
}
-
- for (idx = 0; idx < 6; idx++) {
- dev->dev_addr[idx] = eaddr[idx];
+ for (i = 0; i < 6; i++) {
+ dev->dev_addr[i] = eaddr[i];
}
@@ -2416,8 +2370,8 @@
* Init packet size
*/
- sc->sbm_buffersize = ENET_PACKET_SIZE + CACHELINESIZE*2 + ETHER_ALIGN;
-
+ sc->sbm_buffersize = ENET_PACKET_SIZE + SMP_CACHE_BYTES * 2 + ETHER_ALIGN;
+
/*
* Initialize context (get pointers to registers and stuff), then
* allocate the memory for the descriptor tables.
@@ -2427,13 +2381,13 @@
/*
- * Display Ethernet address (this is called during the config process
- * so we need to finish off the config message that was being displayed)
+ * Display Ethernet address (this is called during the config
+ * process so we need to finish off the config message that
+ * was being displayed)
*/
printk(KERN_INFO
- "%s: SB1250 Ethernet at 0x%08lX, address: %02X-%02X-%02X-%02X-%02X-%02X\n",
- dev->name,
- (unsigned long) sc->sbm_base,
+ "%s: SiByte Ethernet at 0x%08lX, address: %02X-%02X-%02X-%02X-%02X-%02X\n",
+ dev->name, dev->base_addr,
eaddr[0],eaddr[1],eaddr[2],eaddr[3],eaddr[4],eaddr[5]);
/*
@@ -2454,16 +2408,10 @@
dev->change_mtu = sb1250_change_mtu;
- if (sb1250_pass >= K_SYS_REVISION_PASS3) {
- /* In pass3 we do dumb checksum in TX */
- dev->features |= NETIF_F_IP_CSUM;
- }
-
- /* This is needed for PASS2 for Rx H/W checksum feature */
- sbmac_set_iphdr_offset( sc);
+ /* This is needed for PASS2 for Rx H/W checksum feature */
+ sbmac_set_iphdr_offset(sc);
return 0;
-
}
@@ -2478,9 +2426,12 @@
}
/*
- * map/route interrupt
+ * map/route interrupt (clear status first, in case something
+ * weird is pending; we haven't initialized the mac registers
+ * yet)
*/
-
+
+ SBMAC_READCSR(sc->sbm_isr);
if (request_irq(dev->irq, &sbmac_intr, SA_SHIRQ, dev->name, dev)) {
MOD_DEC_USE_COUNT;
return -EBUSY;
@@ -2490,7 +2441,7 @@
* Configure default speed
*/
- sbmac_mii_poll(sc,1);
+ sbmac_mii_poll(sc,noisy_mii);
/*
* Turn on the channel
@@ -2572,7 +2523,8 @@
chg = 1;
}
- if (chg == 0) return 0;
+ if (chg == 0)
+ return 0;
p += sprintf(p,"Link speed: ");
@@ -2616,9 +2568,6 @@
p += sprintf(p,"Unknown");
}
-#ifdef CONFIG_NET_SB1250_MAC_QUIET
- noisy = 0;
-#endif
if (noisy) {
printk(KERN_INFO "%s: %s\n",s->sbm_dev->name,buffer);
}
@@ -2627,8 +2576,6 @@
}
-
-
static void sbmac_timer(unsigned long data)
{
struct net_device *dev = (struct net_device *)data;
@@ -2655,19 +2602,19 @@
* Poll the PHY to see what speed we should be running at
*/
- if (sbmac_mii_poll(sc,1)) {
- if (sc->sbm_state != sbmac_state_off) {
- /*
- * something changed, restart the channel
- */
- if (debug > 1) {
- printk("%s: restarting channel because speed changed\n",
- sc->sbm_dev->name);
- }
- sbmac_channel_stop(sc);
- sbmac_channel_start(sc);
+ if (sbmac_mii_poll(sc,noisy_mii)) {
+ if (sc->sbm_state != sbmac_state_off) {
+ /*
+ * something changed, restart the channel
+ */
+ if (debug > 1) {
+ printk("%s: restarting channel because speed changed\n",
+ sc->sbm_dev->name);
+ }
+ sbmac_channel_stop(sc);
+ sbmac_channel_start(sc);
}
- }
+ }
spin_unlock_irq (&sc->sbm_lock);
@@ -2735,7 +2682,8 @@
spin_unlock_irqrestore(&sc->sbm_lock, flags);
if (msg_flag) {
- printk(KERN_NOTICE "%s: Promiscuous mode %sabled.\n", dev->name,(msg_flag==1)?"en":"dis");
+ printk(KERN_NOTICE "%s: Promiscuous mode %sabled.\n",
+ dev->name,(msg_flag==1)?"en":"dis");
}
/*
@@ -2786,31 +2734,29 @@
{
struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv;
unsigned long flags;
-
+
sbmac_set_channel_state(sc,sbmac_state_off);
-
+
del_timer_sync(&sc->sbm_timer);
-
+
spin_lock_irqsave(&sc->sbm_lock, flags);
-
+
netif_stop_queue(dev);
-
+
if (debug > 1) {
printk(KERN_DEBUG "%s: Shutting down ethercard\n",dev->name);
}
-
+
spin_unlock_irqrestore(&sc->sbm_lock, flags);
-
- /* Make sure there is no irq-handler running on a different CPU. */
+
synchronize_irq();
-
free_irq(dev->irq, dev);
-
+
sbdma_emptyring(&(sc->sbm_txdma));
sbdma_emptyring(&(sc->sbm_rxdma));
MOD_DEC_USE_COUNT;
-
+
return 0;
}
@@ -2827,8 +2773,8 @@
port = A_MAC_CHANNEL_BASE(chan);
sbmac_parse_hwaddr(addr,eaddr);
val = sbmac_addr2reg(eaddr);
- SBMAC_WRITECSR(PKSEG1(port+R_MAC_ETHERNET_ADDR),val);
- val = SBMAC_READCSR(PKSEG1(port+R_MAC_ETHERNET_ADDR));
+ SBMAC_WRITECSR(KSEG1ADDR(port+R_MAC_ETHERNET_ADDR),val);
+ val = SBMAC_READCSR(KSEG1ADDR(port+R_MAC_ETHERNET_ADDR));
}
#endif
@@ -2862,15 +2808,15 @@
* Walk through the Ethernet controllers and find
* those who have their MAC addresses set.
*/
- chip_revision = SBMAC_READCSR(PKSEG1(A_SCD_SYSTEM_REVISION));
- switch ((int)G_SYS_PART(chip_revision)) {
- case 0x1150:
- case 0x1250:
+ switch (soc_type) {
+ case K_SYS_SOC_TYPE_BCM1250:
+ case K_SYS_SOC_TYPE_BCM1250_ALT:
chip_max_units = 3;
break;
- case 0x1120:
- case 0x1125:
- case 0x1126:
+ case K_SYS_SOC_TYPE_BCM1120:
+ case K_SYS_SOC_TYPE_BCM1125:
+ case K_SYS_SOC_TYPE_BCM1125H:
+ case K_SYS_SOC_TYPE_BCM1250_ALT2: /* Hybrid */
chip_max_units = 2;
break;
default:
@@ -2894,9 +2840,10 @@
* If we find a zero, skip this MAC.
*/
- sbmac_orig_hwaddr[idx] = SBMAC_READCSR(PKSEG1(port+R_MAC_ETHERNET_ADDR));
+ sbmac_orig_hwaddr[idx] = SBMAC_READCSR(KSEG1ADDR(port+R_MAC_ETHERNET_ADDR));
if (sbmac_orig_hwaddr[idx] == 0) {
- printk( KERN_DEBUG "sbmac: not configuring MAC at %x\n",(uint32_t)port);
+ printk(KERN_DEBUG "sbmac: not configuring MAC at "
+ "%lx\n", port);
continue;
}
@@ -2908,15 +2855,16 @@
if (!dev)
return -ENOMEM; /* return ENOMEM */
+ printk(KERN_DEBUG "sbmac: configuring MAC at %lx\n", port);
+
dev->irq = K_INT_MAC_0 + idx;
dev->base_addr = port;
dev->mem_end = 0;
/*dev->init = sbmac_init;*/
- sbmac_init(dev);
+ sbmac_init(dev, macidx);
dev_sbmac[macidx] = dev;
macidx++;
-
}
/*
@@ -2935,7 +2883,8 @@
sbmac_port_t port;
for (idx = 0; idx < MAX_UNITS; idx++) {
dev = dev_sbmac[idx];
- if (dev == NULL) continue;
+ if (dev == NULL)
+ continue;
if (dev->priv != NULL) {
struct sbmac_softc *sc = (struct sbmac_softc *) dev->priv;
@@ -2946,8 +2895,8 @@
}
port = A_MAC_CHANNEL_BASE(idx);
- SBMAC_WRITECSR(PKSEG1(port+R_MAC_ETHERNET_ADDR), sbmac_orig_hwaddr[idx] );
- KFREE(dev);
+ SBMAC_WRITECSR(KSEG1ADDR(port+R_MAC_ETHERNET_ADDR), sbmac_orig_hwaddr[idx] );
+ kfree(dev);
dev_sbmac[idx] = NULL;
}
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/sgiseeq.c linux-2.4.22/drivers/net/sgiseeq.c
--- linux-2.4.22.clean/drivers/net/sgiseeq.c 2003-06-13 16:51:35.000000000 +0200
+++ linux-2.4.22/drivers/net/sgiseeq.c 2003-09-21 03:32:42.000000000 +0200
@@ -5,51 +5,45 @@
*/
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/init.h>
#include <linux/types.h>
#include <linux/interrupt.h>
-#include <linux/ptrace.h>
#include <linux/ioport.h>
+#include <linux/socket.h>
#include <linux/in.h>
+#include <linux/route.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/delay.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <asm/byteorder.h>
#include <asm/io.h>
-#include <asm/segment.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/page.h>
#include <asm/pgtable.h>
-#include <linux/errno.h>
-#include <asm/byteorder.h>
-
-#include <linux/socket.h>
-#include <linux/route.h>
-
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-
-#include <asm/sgi/sgihpc.h>
-#include <asm/sgi/sgint23.h>
+#include <asm/sgi/hpc3.h>
+#include <asm/sgi/ip22.h>
#include <asm/sgialib.h>
#include "sgiseeq.h"
-static char *version =
- "sgiseeq.c: David S. Miller (dm@engr.sgi.com)\n";
+static char *version = "sgiseeq.c: David S. Miller (dm@engr.sgi.com)\n";
static char *sgiseeqstr = "SGI Seeq8003";
-/* If you want speed, you do something silly, it always has worked
- * for me. So, with that in mind, I've decided to make this driver
- * look completely like a stupid Lance from a driver architecture
- * perspective. Only difference is that here our "ring buffer" looks
- * and acts like a real Lance one does but is layed out like how the
- * HPC DMA and the Seeq want it to. You'd be surprised how a stupid
- * idea like this can pay off in performance, not to mention making
- * this driver 2,000 times easier to write. ;-)
+/*
+ * If you want speed, you do something silly, it always has worked for me. So,
+ * with that in mind, I've decided to make this driver look completely like a
+ * stupid Lance from a driver architecture perspective. Only difference is that
+ * here our "ring buffer" looks and acts like a real Lance one does but is
+ * layed out like how the HPC DMA and the Seeq want it to. You'd be surprised
+ * how a stupid idea like this can pay off in performance, not to mention
+ * making this driver 2,000 times easier to write. ;-)
*/
/* Tune these if we tend to run out often etc. */
@@ -79,9 +73,10 @@
signed int buf_vaddr;
};
-/* Warning: This structure is layed out in a certain way because
- * HPC dma descriptors must be 8-byte aligned. So don't
- * touch this without some care.
+/*
+ * Warning: This structure is layed out in a certain way because HPC dma
+ * descriptors must be 8-byte aligned. So don't touch this without
+ * some care.
*/
struct sgiseeq_init_block { /* Note the name ;-) */
/* Ptrs to the descriptors in KSEG1 uncached space. */
@@ -96,8 +91,8 @@
struct sgiseeq_private {
volatile struct sgiseeq_init_block srings;
char *name;
- volatile struct hpc3_ethregs *hregs;
- volatile struct sgiseeq_regs *sregs;
+ struct hpc3_ethregs *hregs;
+ struct sgiseeq_regs *sregs;
/* Ring entry counters. */
unsigned int rx_new, tx_new;
@@ -108,17 +103,23 @@
unsigned char mode;
struct net_device_stats stats;
+
+ struct net_device *next_module;
+ spinlock_t tx_lock;
};
-static inline void hpc3_eth_reset(volatile struct hpc3_ethregs *hregs)
+/* A list of all installed seeq devices, for removing the driver module. */
+static struct net_device *root_sgiseeq_dev;
+
+static inline void hpc3_eth_reset(struct hpc3_ethregs *hregs)
{
hregs->rx_reset = (HPC3_ERXRST_CRESET | HPC3_ERXRST_CLRIRQ);
udelay(20);
hregs->rx_reset = 0;
}
-static inline void reset_hpc3_and_seeq(volatile struct hpc3_ethregs *hregs,
- volatile struct sgiseeq_regs *sregs)
+static inline void reset_hpc3_and_seeq(struct hpc3_ethregs *hregs,
+ struct sgiseeq_regs *sregs)
{
hregs->rx_ctrl = hregs->tx_ctrl = 0;
hpc3_eth_reset(hregs);
@@ -128,15 +129,15 @@
SEEQ_RCMD_IDRIB | SEEQ_RCMD_ICRC)
static inline void seeq_go(struct sgiseeq_private *sp,
- volatile struct hpc3_ethregs *hregs,
- volatile struct sgiseeq_regs *sregs)
+ struct hpc3_ethregs *hregs,
+ struct sgiseeq_regs *sregs)
{
sregs->rstat = sp->mode | RSTAT_GO_BITS;
hregs->rx_ctrl = HPC3_ERXCTRL_ACTIVE;
}
static inline void seeq_load_eaddr(struct net_device *dev,
- volatile struct sgiseeq_regs *sregs)
+ struct sgiseeq_regs *sregs)
{
int i;
@@ -161,15 +162,9 @@
seeq_load_eaddr(dev, sp->sregs);
- /* XXX for now just accept packets directly to us
- * XXX and ether-broadcast. Will do multicast and
- * XXX promiscuous mode later. -davem
- */
- sp->mode = SEEQ_RCMD_RBCAST;
-
/* Setup tx ring. */
for(i = 0; i < SEEQ_TX_BUFFERS; i++) {
- if(!ib->tx_desc[i].tdma.pbuf) {
+ if (!ib->tx_desc[i].tdma.pbuf) {
unsigned long buffer;
buffer = (unsigned long) kmalloc(PKT_BUF_SZ, GFP_KERNEL);
@@ -177,7 +172,6 @@
return -ENOMEM;
ib->tx_desc[i].buf_vaddr = KSEG1ADDR(buffer);
ib->tx_desc[i].tdma.pbuf = PHYSADDR(buffer);
-// flush_cache_all();
}
ib->tx_desc[i].tdma.cntinfo = (TCNTINFO_INIT);
}
@@ -192,7 +186,6 @@
return -ENOMEM;
ib->rx_desc[i].buf_vaddr = KSEG1ADDR(buffer);
ib->rx_desc[i].rdma.pbuf = PHYSADDR(buffer);
-// flush_cache_all();
}
ib->rx_desc[i].rdma.cntinfo = (RCNTINFO_INIT);
}
@@ -209,10 +202,10 @@
static int once;
struct sgiseeq_rx_desc *r = gpriv->srings.rx_desc;
struct sgiseeq_tx_desc *t = gpriv->srings.tx_desc;
- volatile struct hpc3_ethregs *hregs = gpriv->hregs;
+ struct hpc3_ethregs *hregs = gpriv->hregs;
int i;
- if(once)
+ if (once)
return;
once++;
printk("RING DUMP:\n");
@@ -248,9 +241,9 @@
#define RDMACFG_INIT (HPC3_ERXDCFG_FRXDC | HPC3_ERXDCFG_FEOP | HPC3_ERXDCFG_FIRQ)
static int init_seeq(struct net_device *dev, struct sgiseeq_private *sp,
- volatile struct sgiseeq_regs *sregs)
+ struct sgiseeq_regs *sregs)
{
- volatile struct hpc3_ethregs *hregs = sp->hregs;
+ struct hpc3_ethregs *hregs = sp->hregs;
int err;
reset_hpc3_and_seeq(hregs, sregs);
@@ -291,8 +284,8 @@
}
static inline void rx_maybe_restart(struct sgiseeq_private *sp,
- volatile struct hpc3_ethregs *hregs,
- volatile struct sgiseeq_regs *sregs)
+ struct hpc3_ethregs *hregs,
+ struct sgiseeq_regs *sregs)
{
if (!(hregs->rx_ctrl & HPC3_ERXCTRL_ACTIVE)) {
hregs->rx_ndptr = PHYSADDR(&sp->srings.rx_desc[sp->rx_new]);
@@ -305,8 +298,8 @@
(rd) = &(sp)->srings.rx_desc[(sp)->rx_new])
static inline void sgiseeq_rx(struct net_device *dev, struct sgiseeq_private *sp,
- volatile struct hpc3_ethregs *hregs,
- volatile struct sgiseeq_regs *sregs)
+ struct hpc3_ethregs *hregs,
+ struct sgiseeq_regs *sregs)
{
struct sgiseeq_rx_desc *rd;
struct sk_buff *skb = 0;
@@ -333,12 +326,17 @@
/* Copy out of kseg1 to avoid silly cache flush. */
eth_copy_and_sum(skb, pkt_pointer + 2, len, 0);
skb->protocol = eth_type_trans(skb, dev);
- netif_rx(skb);
- dev->last_rx = jiffies;
- sp->stats.rx_packets++;
- sp->stats.rx_bytes += len;
+ if (memcmp(skb->mac.ethernet->h_source, dev->dev_addr, 6)) {
+ netif_rx(skb);
+ dev->last_rx = jiffies;
+ sp->stats.rx_packets++;
+ sp->stats.rx_bytes += len;
+ } else {
+ /* Silently drop my own packets */
+ dev_kfree_skb_irq(skb);
+ }
} else {
- printk ("%s: Memory squeeze, deferring packet.\n",
+ printk (KERN_NOTICE "%s: Memory squeeze, deferring packet.\n",
dev->name);
sp->stats.rx_dropped++;
}
@@ -356,7 +354,7 @@
}
static inline void tx_maybe_reset_collisions(struct sgiseeq_private *sp,
- volatile struct sgiseeq_regs *sregs)
+ struct sgiseeq_regs *sregs)
{
if (sp->is_edlc) {
sregs->rw.wregs.control = sp->control & ~(SEEQ_CTRL_XCNT);
@@ -365,7 +363,7 @@
}
static inline void kick_tx(struct sgiseeq_tx_desc *td,
- volatile struct hpc3_ethregs *hregs)
+ struct hpc3_ethregs *hregs)
{
/* If the HPC aint doin nothin, and there are more packets
* with ETXD cleared and XIU set we must make very certain
@@ -383,8 +381,8 @@
}
static inline void sgiseeq_tx(struct net_device *dev, struct sgiseeq_private *sp,
- volatile struct hpc3_ethregs *hregs,
- volatile struct sgiseeq_regs *sregs)
+ struct hpc3_ethregs *hregs,
+ struct sgiseeq_regs *sregs)
{
struct sgiseeq_tx_desc *td;
unsigned long status = hregs->tx_ctrl;
@@ -409,7 +407,7 @@
if (!(td->tdma.cntinfo & (HPCDMA_XIU)))
break;
if (!(td->tdma.cntinfo & (HPCDMA_ETXD))) {
- if(!(status & HPC3_ETXCTRL_ACTIVE)) {
+ if (!(status & HPC3_ETXCTRL_ACTIVE)) {
hregs->tx_ndptr = PHYSADDR(td);
hregs->tx_ctrl = HPC3_ETXCTRL_ACTIVE;
}
@@ -426,8 +424,10 @@
{
struct net_device *dev = (struct net_device *) dev_id;
struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv;
- volatile struct hpc3_ethregs *hregs = sp->hregs;
- volatile struct sgiseeq_regs *sregs = sp->sregs;
+ struct hpc3_ethregs *hregs = sp->hregs;
+ struct sgiseeq_regs *sregs = sp->sregs;
+
+ spin_lock(&sp->tx_lock);
/* Ack the IRQ and set software state. */
hregs->rx_reset = HPC3_ERXRST_CLRIRQ;
@@ -435,59 +435,47 @@
/* Always check for received packets. */
sgiseeq_rx(dev, sp, hregs, sregs);
- /* Only check for tx acks iff we have something queued. */
+ /* Only check for tx acks if we have something queued. */
if (sp->tx_old != sp->tx_new)
sgiseeq_tx(dev, sp, hregs, sregs);
if ((TX_BUFFS_AVAIL(sp) > 0) && netif_queue_stopped(dev)) {
netif_wake_queue(dev);
}
+ spin_unlock(&sp->tx_lock);
}
static int sgiseeq_open(struct net_device *dev)
{
struct sgiseeq_private *sp = (struct sgiseeq_private *)dev->priv;
- volatile struct sgiseeq_regs *sregs = sp->sregs;
- unsigned long flags;
- int err;
-
- __save_and_cli(flags);
+ struct sgiseeq_regs *sregs = sp->sregs;
- err = -EAGAIN;
- if (request_irq(dev->irq, sgiseeq_interrupt, 0, sgiseeqstr, dev)) {
- printk("Seeq8003: Can't get irq %d\n", dev->irq);
- goto out;
- }
- err = init_seeq(dev, sp, sregs);
+ int err = init_seeq(dev, sp, sregs);
if (err)
- goto out;
+ return err;
netif_start_queue(dev);
-out:
- __restore_flags(flags);
- return err;
+ return 0;
}
static int sgiseeq_close(struct net_device *dev)
{
struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv;
- volatile struct sgiseeq_regs *sregs = sp->sregs;
+ struct sgiseeq_regs *sregs = sp->sregs;
netif_stop_queue(dev);
/* Shutdown the Seeq. */
reset_hpc3_and_seeq(sp->hregs, sregs);
- free_irq(dev->irq, dev);
-
return 0;
}
static inline int sgiseeq_reset(struct net_device *dev)
{
struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv;
- volatile struct sgiseeq_regs *sregs = sp->sregs;
+ struct sgiseeq_regs *sregs = sp->sregs;
int err;
err = init_seeq(dev, sp, sregs);
@@ -509,12 +497,12 @@
static int sgiseeq_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv;
- volatile struct hpc3_ethregs *hregs = sp->hregs;
+ struct hpc3_ethregs *hregs = sp->hregs;
unsigned long flags;
struct sgiseeq_tx_desc *td;
int skblen, len, entry;
- save_and_cli(flags);
+ spin_lock_irqsave(&sp->tx_lock, flags);
/* Setup... */
skblen = skb->len;
@@ -530,14 +518,14 @@
* 2) Do no allow the HPC to look at a new descriptor until
* we have completely set up it's state. This means, do
* not clear HPCDMA_EOX in the current last descritptor
- * until the one we are adding looks consistant and could
+ * until the one we are adding looks consistent and could
* be processes right now.
* 3) The tx interrupt code must notice when we've added a new
* entry and the HPC got to the end of the chain before we
* added this new entry and restarted it.
*/
memcpy((char *)(long)td->buf_vaddr, skb->data, skblen);
- if(len != skblen)
+ if (len != skblen)
memset((char *)(long)td->buf_vaddr + skb->len, 0, len-skblen);
td->tdma.cntinfo = (len & HPCDMA_BCNT) |
(HPCDMA_XIU | HPCDMA_EOXP | HPCDMA_XIE | HPCDMA_EOX);
@@ -558,14 +546,14 @@
if (!TX_BUFFS_AVAIL(sp))
netif_stop_queue(dev);
- restore_flags(flags);
+ spin_unlock_irqrestore(&sp->tx_lock, flags);
return 0;
}
static void timeout(struct net_device *dev)
{
- printk("%s: transmit timed out, resetting\n", dev->name);
+ printk(KERN_NOTICE "%s: transmit timed out, resetting\n", dev->name);
sgiseeq_reset(dev);
dev->trans_start = jiffies;
@@ -581,6 +569,22 @@
static void sgiseeq_set_multicast(struct net_device *dev)
{
+ struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv;
+ unsigned char oldmode = sp->mode;
+
+ if(dev->flags & IFF_PROMISC)
+ sp->mode = SEEQ_RCMD_RANY;
+ else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count)
+ sp->mode = SEEQ_RCMD_RBMCAST;
+ else
+ sp->mode = SEEQ_RCMD_RBCAST;
+
+ /* XXX I know this sucks, but is there a better way to reprogram
+ * XXX the receiver? At least, this shouldn't happen too often.
+ */
+
+ if (oldmode != sp->mode)
+ sgiseeq_reset(dev);
}
static inline void setup_tx_ring(struct sgiseeq_tx_desc *buf, int nbufs)
@@ -608,42 +612,50 @@
buf[i].rdma.pnext = PHYSADDR(&buf[0]);
}
-static char onboard_eth_addr[6];
-
#define ALIGNED(x) ((((unsigned long)(x)) + 0xf) & ~(0xf))
-int sgiseeq_init(struct net_device *dev, struct sgiseeq_regs *sregs,
- struct hpc3_ethregs *hregs, int irq)
+int sgiseeq_init(struct hpc3_regs* regs, int irq)
{
- static unsigned version_printed;
- int i;
+ struct net_device *dev;
struct sgiseeq_private *sp;
+ int err, i;
- dev->priv = (struct sgiseeq_private *) get_free_page(GFP_KERNEL);
- if (dev->priv == NULL)
- return -ENOMEM;
+ dev = alloc_etherdev(0);
+ if (!dev) {
+ printk(KERN_ERR "Sgiseeq: Etherdev alloc failed, aborting.\n");
+ err = -ENOMEM;
+ goto err_out;
+ }
+ /* Make private data page aligned */
+ sp = (struct sgiseeq_private *) get_zeroed_page(GFP_KERNEL);
+ if (!sp) {
+ printk(KERN_ERR "Sgiseeq: Page alloc failed, aborting.\n");
+ err = -ENOMEM;
+ goto err_out_free_dev;
+ }
+
+ if (request_irq(irq, sgiseeq_interrupt, 0, sgiseeqstr, dev)) {
+ printk(KERN_ERR "Seeq8003: Can't get irq %d\n", dev->irq);
+ err = -EAGAIN;
+ goto err_out_free_page;
+ }
+
+#define EADDR_NVOFS 250
+ for (i = 0; i < 3; i++) {
+ unsigned short tmp = ip22_nvram_read(EADDR_NVOFS / 2 + i);
- if (!version_printed++)
- printk(version);
-
- printk("%s: SGI Seeq8003 ", dev->name);
-
- for (i = 0; i < 6; i++)
- printk("%2.2x%c",
- dev->dev_addr[i] = onboard_eth_addr[i],
- i == 5 ? ' ': ':');
-
- printk("\n");
+ dev->dev_addr[2 * i] = tmp >> 8;
+ dev->dev_addr[2 * i + 1] = tmp & 0xff;
+ }
- sp = (struct sgiseeq_private *) dev->priv;
#ifdef DEBUG
gpriv = sp;
gdev = dev;
#endif
- memset((char *)dev->priv, 0, sizeof(struct sgiseeq_private));
- sp->sregs = sregs;
- sp->hregs = hregs;
+ sp->sregs = (struct sgiseeq_regs *) &hpc3c0->eth_ext[0];
+ sp->hregs = &hpc3c0->ethregs;
sp->name = sgiseeqstr;
+ sp->mode = SEEQ_RCMD_RBCAST;
sp->srings.rx_desc = (struct sgiseeq_rx_desc *)
(KSEG1ADDR(ALIGNED(&sp->srings.rxvector[0])));
@@ -659,71 +671,78 @@
setup_tx_ring(sp->srings.tx_desc, SEEQ_TX_BUFFERS);
/* Reset the chip. */
- hpc3_eth_reset((volatile struct hpc3_ethregs *) hregs);
+ hpc3_eth_reset(sp->hregs);
- sp->is_edlc = !(sregs->rw.rregs.collision_tx[0] & 0xff);
- if (sp->is_edlc) {
+ sp->is_edlc = !(sp->sregs->rw.rregs.collision_tx[0] & 0xff);
+ if (sp->is_edlc)
sp->control = (SEEQ_CTRL_XCNT | SEEQ_CTRL_ACCNT |
SEEQ_CTRL_SFLAG | SEEQ_CTRL_ESHORT |
SEEQ_CTRL_ENCARR);
+
+ dev->open = sgiseeq_open;
+ dev->stop = sgiseeq_close;
+ dev->hard_start_xmit = sgiseeq_start_xmit;
+ dev->tx_timeout = timeout;
+ dev->watchdog_timeo = (200 * HZ) / 1000;
+ dev->get_stats = sgiseeq_get_stats;
+ dev->set_multicast_list = sgiseeq_set_multicast;
+ dev->irq = irq;
+ dev->dma = 0;
+ dev->priv = sp;
+
+ if (register_netdev(dev)) {
+ printk(KERN_ERR "Sgiseeq: Cannot register net device, "
+ "aborting.\n");
+ err = -ENODEV;
+ goto err_out_free_irq;
}
- dev->open = sgiseeq_open;
- dev->stop = sgiseeq_close;
- dev->hard_start_xmit = sgiseeq_start_xmit;
- dev->tx_timeout = timeout;
- dev->watchdog_timeo = (200 * HZ) / 1000;
- dev->get_stats = sgiseeq_get_stats;
- dev->set_multicast_list = sgiseeq_set_multicast;
- dev->irq = irq;
- dev->dma = 0;
- ether_setup(dev);
+ printk(KERN_INFO "%s: SGI Seeq8003 ", dev->name);
+ for (i = 0; i < 6; i++)
+ printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
+
+ sp->next_module = root_sgiseeq_dev;
+ root_sgiseeq_dev = dev;
return 0;
-}
-static inline unsigned char str2hexnum(unsigned char c)
-{
- if (c >= '0' && c <= '9')
- return c - '0';
- if (c >= 'a' && c <= 'f')
- return c - 'a' + 10;
- return 0; /* foo */
+err_out_free_irq:
+ free_irq(irq, dev);
+err_out_free_page:
+ free_page((unsigned long) sp);
+err_out_free_dev:
+ kfree(dev);
+
+err_out:
+ return err;
}
-static inline void str2eaddr(unsigned char *ea, unsigned char *str)
+static int __init sgiseeq_probe(void)
{
- int i;
+ printk(version);
- for (i = 0; i < 6; i++) {
- unsigned char num;
-
- if(*str == ':')
- str++;
- num = str2hexnum(*str++) << 4;
- num |= (str2hexnum(*str++));
- ea[i] = num;
- }
+ /* On board adapter on 1st HPC is always present */
+ return sgiseeq_init(hpc3c0, SGI_ENET_IRQ);
}
-int sgiseeq_probe(struct net_device *dev)
+static void __exit sgiseeq_exit(void)
{
- static int initialized;
- char *ep;
-
- if (initialized) /* Already initialized? */
- return 1;
- initialized++;
+ struct net_device *next, *dev;
+ struct sgiseeq_private *sp;
+ int irq;
- /* First get the ethernet address of the onboard interface from ARCS.
- * This is fragile; PROM doesn't like running from cache.
- * On MIPS64 it crashes for some other, yet unknown reason ...
- */
- ep = ArcGetEnvironmentVariable("eaddr");
- str2eaddr(onboard_eth_addr, ep);
- return sgiseeq_init(dev,
- (struct sgiseeq_regs *) (KSEG1ADDR(0x1fbd4000)),
- &hpc3c0->ethregs, SGI_ENET_IRQ);
+ for (dev = root_sgiseeq_dev; dev; dev = next) {
+ sp = (struct sgiseeq_private *) dev->priv;
+ next = sp->next_module;
+ irq = dev->irq;
+ unregister_netdev(dev);
+ free_irq(irq, dev);
+ free_page((unsigned long) dev->priv);
+ kfree(dev);
+ }
}
+module_init(sgiseeq_probe);
+module_exit(sgiseeq_exit);
+
MODULE_LICENSE("GPL");
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/net/Space.c linux-2.4.22/drivers/net/Space.c
--- linux-2.4.22.clean/drivers/net/Space.c 2002-08-03 02:39:44.000000000 +0200
+++ linux-2.4.22/drivers/net/Space.c 2003-05-17 03:55:31.000000000 +0200
@@ -83,7 +83,6 @@
extern int SK_init(struct net_device *);
extern int seeq8005_probe(struct net_device *);
extern int smc_init( struct net_device * );
-extern int sgiseeq_probe(struct net_device *);
extern int atarilance_probe(struct net_device *);
extern int sun3lance_probe(struct net_device *);
extern int sun3_82586_probe(struct net_device *);
@@ -366,14 +365,6 @@
{NULL, 0},
};
-
-static struct devprobe sgi_probes[] __initdata = {
-#ifdef CONFIG_SGISEEQ
- {sgiseeq_probe, 0},
-#endif
- {NULL, 0},
-};
-
static struct devprobe mips_probes[] __initdata = {
#ifdef CONFIG_MIPS_JAZZ_SONIC
{sonic_probe, 0},
@@ -408,8 +399,6 @@
return 0;
if (probe_list(dev, mips_probes) == 0)
return 0;
- if (probe_list(dev, sgi_probes) == 0)
- return 0;
if (probe_list(dev, eisa_probes) == 0)
return 0;
if (probe_list(dev, mca_probes) == 0)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/parport/Config.in linux-2.4.22/drivers/parport/Config.in
--- linux-2.4.22.clean/drivers/parport/Config.in 2001-12-21 18:41:55.000000000 +0100
+++ linux-2.4.22/drivers/parport/Config.in 2003-03-25 00:45:07.000000000 +0100
@@ -61,6 +61,12 @@
define_tristate CONFIG_PARPORT_SUNBPP n
fi
+ if [ "$CONFIG_SGI_IP22" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ dep_tristate ' SGI Indy/Indigo2 hardware (EXPERIMENTAL)' CONFIG_PARPORT_IP22 $CONFIG_PARPORT
+ else
+ define_tristate CONFIG_PARPORT_IP22 n
+ fi
+
# If exactly one hardware type is selected then parport will optimise away
# support for loading any others. Defeat this if the user is keen.
bool ' Support foreign hardware' CONFIG_PARPORT_OTHER
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/parport/init.c linux-2.4.22/drivers/parport/init.c
--- linux-2.4.22.clean/drivers/parport/init.c 2002-11-29 00:53:14.000000000 +0100
+++ linux-2.4.22/drivers/parport/init.c 2003-03-25 00:45:07.000000000 +0100
@@ -164,6 +164,9 @@
#ifdef CONFIG_PARPORT_SUNBPP
parport_sunbpp_init();
#endif
+#ifdef CONFIG_PARPORT_IP22
+ parport_ip22_init();
+#endif
return 0;
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/parport/Makefile linux-2.4.22/drivers/parport/Makefile
--- linux-2.4.22.clean/drivers/parport/Makefile 2001-09-14 01:04:43.000000000 +0200
+++ linux-2.4.22/drivers/parport/Makefile 2003-03-25 00:45:07.000000000 +0100
@@ -23,12 +23,13 @@
obj-$(CONFIG_PARPORT) += parport.o
obj-$(CONFIG_PARPORT_PC) += parport_pc.o
obj-$(CONFIG_PARPORT_SERIAL) += parport_serial.o
-obj-$(CONFIG_PARPORT_PC_PCMCIA)+= parport_cs.o
+obj-$(CONFIG_PARPORT_PC_PCMCIA) += parport_cs.o
obj-$(CONFIG_PARPORT_AMIGA) += parport_amiga.o
obj-$(CONFIG_PARPORT_MFC3) += parport_mfc3.o
obj-$(CONFIG_PARPORT_ATARI) += parport_atari.o
obj-$(CONFIG_PARPORT_SUNBPP) += parport_sunbpp.o
obj-$(CONFIG_PARPORT_GSC) += parport_gsc.o
+obj-$(CONFIG_PARPORT_IP22) += parport_ip22.o
include $(TOPDIR)/Rules.make
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/parport/parport_ip22.c linux-2.4.22/drivers/parport/parport_ip22.c
--- linux-2.4.22.clean/drivers/parport/parport_ip22.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/parport/parport_ip22.c 2003-03-25 00:45:07.000000000 +0100
@@ -0,0 +1,315 @@
+/*
+ * Low-level parallel port routines for the SGI Indy/Indigo2 builtin port
+ *
+ * Copyright (c) 2002 Vincent Stehl <vincent.stehle@free.fr>
+ * (shamelessly based on other parport_xxx.c)
+ * See the "COPYING" license file at the top-level.
+ *
+ * PI1 registers have the same bits as the PC parallel port registers, but
+ * all PI1 bits are "direct"; i.e. no invertion: A 1 is TTL "high" (5 V),
+ * a 0 is TTL "low" (0 V). There are also some bits on the PI1, which have
+ * no equivalents on the PC. They are for non-SPP modes.
+ *
+ * Here follows a little summary of the signals and their meanings:
+ *
+ * A "/" in front of a signal means that the _bit_ is inverted: i.e. a "1"
+ * bit value means a TTL "low" (0 V) signal.
+ *
+ * A "-" in front of a signal means that it is low active: i.e. a TTL "low"
+ * (0 V) value means that the signal is active.
+ *
+ * Internal only signals are between ()'s.
+ *
+ * Control
+ * -------
+ * PC SGI
+ *
+ * 7 6 5 4 3 2 1 0
+ * \ \ \ \ \ \ \ `- /-STROBE -STROBE
+ * \ \ \ \ \ \ `-- /-AUTO FEED -AFD
+ * \ \ \ \ \ `--- -INIT -INIT
+ * \ \ \ \ `---- /-SELECT -SLIN
+ * \ \ \ `----- (IRQ 1=enabled)
+ * \ \ `------ (DIRECTION 0=forward)
+ * \ `------- (SEL ?)
+ * `--------
+ *
+ * Status
+ * ------
+ * PC SGI
+ *
+ * 7 6 5 4 3 2 1 0
+ * \ \ \ \ \ \ \ `- DEVID
+ * \ \ \ \ \ \ `-- " "
+ * \ \ \ \ \ `--- NOINK
+ * \ \ \ \ `---- -ERROR -ERROR
+ * \ \ \ `----- SELECT IN ONLINE
+ * \ \ `------ PAPER END PE
+ * \ `------- -ACK -ACK
+ * `-------- / BUSY BUSY
+ *
+ * Note that some of those information have been "guessed" with a multimeter
+ * and some spare nights :)
+ *
+ * Reminder: all functions await PC-style values, i.e. one should convert
+ * status and control.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/parport.h>
+#include <asm/sgi/ioc.h>
+
+#define DEBUG
+
+#ifdef DEBUG
+#define DPRINTK printk
+#else
+#define DPRINTK(x...) do { } while (0)
+#endif
+
+const unsigned char control_invert = PARPORT_CONTROL_STROBE
+ | PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_SELECT;
+const unsigned char status_invert = PARPORT_STATUS_BUSY;
+
+static struct parport *this_port = NULL;
+
+static inline void debug_dump_registers(void)
+{
+#ifdef DEBUG
+ printk(KERN_DEBUG
+ "PI1 registers:\n"
+ " data= %02x\n"
+ " control= %02x\n"
+ " status= %02x\n"
+ " dma control= %02x\n"
+ " interrupt status= %02x\n"
+ " interrupt mask= %02x\n"
+ " timer 1= %02x\n"
+ " timer 2= %02x\n"
+ " timer 3= %02x\n"
+ " timer 4= %02x\n"
+ ,
+ sgioc->pport.data,
+ sgioc->pport.ctrl,
+ sgioc->pport.status,
+ sgioc->pport.dmactrl,
+ sgioc->pport.intrstat,
+ sgioc->pport.intrmask,
+ sgioc->pport.timer1,
+ sgioc->pport.timer2,
+ sgioc->pport.timer3,
+ sgioc->pport.timer4
+ );
+#endif
+}
+
+static unsigned char parport_ip22_read_data(struct parport *p)
+{
+ unsigned char data = sgioc->pport.data;
+ DPRINTK("parport_ip22_read_data: %#x\n", data);
+ return data;
+}
+
+static void parport_ip22_write_data(struct parport *p, unsigned char data)
+{
+ DPRINTK("parport_ip22_write_data: %#x\n", data);
+ sgioc->pport.data = data;
+}
+
+static unsigned char parport_ip22_read_control(struct parport *p)
+{
+ const unsigned char mask = PARPORT_CONTROL_STROBE
+ | PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_INIT
+ | PARPORT_CONTROL_SELECT;
+ unsigned char pctrl = sgioc->pport.ctrl,
+ control = ((pctrl & mask) ^ control_invert);
+ DPRINTK("parport_ip22_read_control: %#x, %#x\n", pctrl, control);
+ return control;
+}
+
+static void parport_ip22_write_control(struct parport *p, unsigned char control)
+{
+ const unsigned char mask = PARPORT_CONTROL_STROBE
+ | PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_INIT
+ | PARPORT_CONTROL_SELECT,
+ /* we enforce some necessary bits */
+ force = 0x30;
+ unsigned char pctrl = ((control & mask) ^ control_invert) | force;
+ DPRINTK("parport_ip22_write_control: %#x, %#x\n", control, pctrl);
+ sgioc->pport.ctrl = pctrl;
+}
+
+static unsigned char parport_ip22_frob_control(struct parport *p,
+ unsigned char mask, unsigned char val)
+{
+ unsigned char old;
+ DPRINTK(KERN_DEBUG "parport_ip22_frob_control mask %02x, value %02x\n",mask,val);
+ old = parport_ip22_read_control(p);
+ parport_ip22_write_control(p, (old & ~mask) ^ val);
+ return old;
+}
+
+static unsigned char parport_ip22_read_status(struct parport *p)
+{
+ const unsigned mask = PARPORT_STATUS_ERROR | PARPORT_STATUS_SELECT
+ | PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_ACK
+ | PARPORT_STATUS_BUSY;
+ unsigned char pstat = sgioc->pport.status,
+ status = ((pstat & mask) ^ status_invert);
+ DPRINTK("parport_ip22_read_status: %#x, %#x\n", pstat, status);
+ return status;
+}
+
+static void parport_ip22_init_state(struct pardevice *d, struct parport_state *s)
+{
+ DPRINTK("parport_ip22_init_state\n");
+}
+
+static void parport_ip22_save_state(struct parport *p, struct parport_state *s)
+{
+ DPRINTK("parport_ip22_save_state\n");
+}
+
+static void parport_ip22_restore_state(struct parport *p, struct parport_state *s)
+{
+ DPRINTK("parport_ip22_restore_state\n");
+}
+
+static void parport_ip22_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ DPRINTK("parport_ip22_interrupt\n");
+ parport_generic_irq(irq, (struct parport *) dev_id, regs);
+}
+
+static void parport_ip22_enable_irq(struct parport *p)
+{
+ DPRINTK("parport_ip22_enable_irq\n");
+}
+
+static void parport_ip22_disable_irq(struct parport *p)
+{
+ DPRINTK("parport_ip22_disable_irq\n");
+}
+
+static void parport_ip22_data_forward(struct parport *p)
+{
+ DPRINTK("parport_ip22_data_forward\n");
+ sgioc->pport.ctrl &= ~SGIOC_PCTRL_DIRECTION;
+}
+
+static void parport_ip22_data_reverse(struct parport *p)
+{
+ DPRINTK("parport_ip22_data_reverse\n");
+ sgioc->pport.ctrl |= SGIOC_PCTRL_DIRECTION;
+}
+
+static void parport_ip22_inc_use_count(void)
+{
+ DPRINTK("parport_ip22_inc_use_count\n");
+# ifdef MODULE
+ MOD_INC_USE_COUNT;
+# endif
+}
+
+static void parport_ip22_dec_use_count(void)
+{
+ DPRINTK("parport_ip22_dec_use_count\n");
+# ifdef MODULE
+ MOD_DEC_USE_COUNT;
+# endif
+}
+
+static struct parport_operations parport_ip22_ops = {
+ parport_ip22_write_data,
+ parport_ip22_read_data,
+ parport_ip22_write_control,
+ parport_ip22_read_control,
+ parport_ip22_frob_control,
+ parport_ip22_read_status,
+ parport_ip22_enable_irq,
+ parport_ip22_disable_irq,
+ parport_ip22_data_forward,
+ parport_ip22_data_reverse,
+ parport_ip22_init_state,
+ parport_ip22_save_state,
+ parport_ip22_restore_state,
+ parport_ip22_inc_use_count,
+ parport_ip22_dec_use_count,
+ parport_ieee1284_epp_write_data,
+ parport_ieee1284_epp_read_data,
+ parport_ieee1284_epp_write_addr,
+ parport_ieee1284_epp_read_addr,
+ parport_ieee1284_ecp_write_data,
+ parport_ieee1284_ecp_read_data,
+ parport_ieee1284_ecp_write_addr,
+ parport_ieee1284_write_compat,
+ parport_ieee1284_read_nibble,
+ parport_ieee1284_read_byte
+};
+
+static void init_hardware(void)
+{
+ sgioc->pport.intrmask = 0xfc;
+ sgioc->pport.dmactrl = 1;
+ sgioc->pport.ctrl = 0x3f;
+ sgioc->pport.timer1 = 0;
+ sgioc->pport.timer2 = 0;
+ sgioc->pport.timer3 = 0;
+ sgioc->pport.timer4 = 0;
+ sgioc->pport.data = 0;
+}
+
+int __init parport_ip22_init(void)
+{
+ struct parport *p;
+
+ DPRINTK("parport_ip22_init\n");
+ p = parport_register_port((unsigned long)&sgioc->pport.data, PARPORT_IRQ_NONE,
+ PARPORT_DMA_NONE, &parport_ip22_ops);
+ if (!p)
+ return -EBUSY;
+
+/* TODO
+ err = request_irq(IRQ_AMIGA_CIAA_FLG, amiga_interrupt, 0, p->name, p);
+ if (err)
+ goto out_irq;
+*/
+
+ /* tell what we are capable of */
+ p->modes = PARPORT_MODE_PCSPP;
+
+/* TODO
+ | PARPORT_MODE_TRISTATE;*/
+
+ /* remember for exit */
+ this_port = p;
+
+ /* put hardware into known initial state */
+ init_hardware();
+
+ printk(KERN_INFO "%s: SGI Indy/Indigo2 built-in port\n", p->name);
+ parport_proc_register(p);
+ parport_announce_port(p);
+
+ return 0;
+}
+
+void __exit parport_ip22_exit(void)
+{
+ DPRINTK("parport_ip22_exit\n");
+ if (this_port->irq != PARPORT_IRQ_NONE)
+ free_irq(this_port->irq, this_port);
+
+ parport_proc_unregister(this_port);
+ parport_unregister_port(this_port);
+}
+
+MODULE_AUTHOR("Vincent Stehl <vincent.stehle@free.fr>");
+MODULE_DESCRIPTION("Driver for SGI Indy/Indigo2 parallel port");
+MODULE_SUPPORTED_DEVICE("SGI PI1 parallel port");
+MODULE_LICENSE("GPL");
+
+module_init(parport_ip22_init);
+module_exit(parport_ip22_exit);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/pci/pci.c linux-2.4.22/drivers/pci/pci.c
--- linux-2.4.22.clean/drivers/pci/pci.c 2003-06-13 16:51:35.000000000 +0200
+++ linux-2.4.22/drivers/pci/pci.c 2003-02-25 23:03:08.000000000 +0100
@@ -1276,11 +1276,17 @@
{
unsigned int buses;
unsigned short cr;
+ unsigned short bctl;
struct pci_bus *child;
int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
DBG("Scanning behind PCI bridge %s, config %06x, pass %d\n", dev->slot_name, buses & 0xffffff, pass);
+ /* Disable MasterAbortMode during probing to avoid reporting
+ of bus errors (in some architectures) */
+ pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl);
+ pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
+ bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
if ((buses & 0xffff00) && !pcibios_assign_all_busses()) {
/*
* Bus already configured by firmware, process it in the first
@@ -1339,6 +1345,7 @@
pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
pci_write_config_word(dev, PCI_COMMAND, cr);
}
+ pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bctl);
sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number);
return max;
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/pcmcia/Config.in linux-2.4.22/drivers/pcmcia/Config.in
--- linux-2.4.22.clean/drivers/pcmcia/Config.in 2002-08-03 02:39:44.000000000 +0200
+++ linux-2.4.22/drivers/pcmcia/Config.in 2003-07-14 18:14:06.000000000 +0200
@@ -29,5 +29,20 @@
if [ "$CONFIG_8xx" = "y" ]; then
dep_tristate ' M8xx support' CONFIG_PCMCIA_M8XX $CONFIG_PCMCIA
fi
+ if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
+ dep_tristate ' Au1x00 PCMCIA support' CONFIG_PCMCIA_AU1X00 $CONFIG_PCMCIA
+ if [ "$CONFIG_PCMCIA_AU1X00" != "n" ]; then
+ bool ' Pb1x00 board support' CONFIG_PCMCIA_PB1X00
+ bool ' Db1x00 board support' CONFIG_PCMCIA_DB1X00
+ bool ' XXS1500 board support' CONFIG_PCMCIA_XXS1500
+ fi
+ fi
+ if [ "$CONFIG_SIBYTE_SB1xxx_SOC" = "y" ]; then
+ dep_bool ' SiByte PCMCIA support' CONFIG_PCMCIA_SIBYTE $CONFIG_PCMCIA $CONFIG_BLK_DEV_IDE_SIBYTE
+ fi
+ if [ "$CONFIG_VRC4173" != "n" ]; then
+ dep_tristate ' NEC VRC4173 CARDU support' CONFIG_PCMCIA_VRC4173 $CONFIG_PCMCIA
+ fi
fi
+
endmenu
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/pcmcia/Makefile linux-2.4.22/drivers/pcmcia/Makefile
--- linux-2.4.22.clean/drivers/pcmcia/Makefile 2002-08-03 02:39:44.000000000 +0200
+++ linux-2.4.22/drivers/pcmcia/Makefile 2003-07-14 18:14:06.000000000 +0200
@@ -59,8 +59,15 @@
endif
endif
+obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
+au1000_ss-objs-y := au1000_generic.o
+au1000_ss-objs-$(CONFIG_PCMCIA_PB1X00) += au1000_pb1x00.o
+au1000_ss-objs-$(CONFIG_PCMCIA_DB1X00) += au1000_db1x00.o
+au1000_ss-objs-$(CONFIG_PCMCIA_XXS1500) += au1000_xxs1500.o
+
obj-$(CONFIG_PCMCIA_SA1100) += sa1100_cs.o
obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o
+obj-$(CONFIG_PCMCIA_SIBYTE) += sibyte_generic.o
sa1100_cs-objs-y := sa1100_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_ADSBITSY) += sa1100_adsbitsy.o sa1111_generic.o
@@ -82,6 +89,8 @@
sa1100_cs-objs-$(CONFIG_SA1100_XP860) += sa1100_xp860.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_YOPY) += sa1100_yopy.o
+obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o
+
include $(TOPDIR)/Rules.make
pcmcia_core.o: $(pcmcia_core-objs)
@@ -90,5 +99,8 @@
sa1100_cs.o: $(sa1100_cs-objs-y)
$(LD) -r -o $@ $(sa1100_cs-objs-y)
+au1x00_ss.o: $(au1000_ss-objs-y)
+ $(LD) -r -o $@ $(au1000_ss-objs-y)
+
yenta_socket.o: $(yenta_socket-objs)
$(LD) $(LD_RFLAG) -r -o $@ $(yenta_socket-objs)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/pcmcia/sibyte_generic.c linux-2.4.22/drivers/pcmcia/sibyte_generic.c
--- linux-2.4.22.clean/drivers/pcmcia/sibyte_generic.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/pcmcia/sibyte_generic.c 2003-07-14 18:14:06.000000000 +0200
@@ -0,0 +1,688 @@
+/*
+ * Copyright (C) 2003 Broadcom Corporation
+ * originally contributed to SiByte, Inc as
+ * "sb1250pc.c 0.10 (Stanley Chen & James Liao)"
+ *
+ * This program 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Notes / Apologies:
+ * - only ATA cards tested so far
+ * - requires hack in cs.c to avoid poking the CISCOR register
+ * - ack_intr routine might be improved to avoid error msgs.
+ * - remove and re-insert doesn't work (crash or fail to probe drive)
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/ioport.h>
+#include <linux/sched.h>
+#include <linux/proc_fs.h>
+#include <linux/timer.h>
+#include <linux/ide.h>
+
+#include <pcmcia/version.h>
+#include <pcmcia/cs_types.h>
+#include <pcmcia/ss.h>
+#include <pcmcia/bulkmem.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/cs.h>
+#include "cs_internal.h"
+
+#include <asm/io.h>
+
+#include <asm/sibyte/board.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/sb1250_scd.h>
+#include <asm/sibyte/sb1250_int.h>
+#include <asm/sibyte/sb1250_genbus.h>
+#include <asm/sibyte/64bit.h>
+
+#define PFX "sibyte-pcmcia: "
+
+MODULE_AUTHOR("Kip Walker, Stanley Chen & James Liao");
+MODULE_DESCRIPTION("SiByte PCMCIA socket driver");
+
+#undef PCMCIA_DEBUG
+#ifdef PCMCIA_DEBUG
+#define DPRINTK(args...) do { printk(KERN_DEBUG args); } while (0)
+#else
+#define DPRINTK(n, args...) do { } while (0)
+#endif
+
+static unsigned long sb_pcmcia_base = PCMCIA_PHYS;
+static unsigned long sb_pcmcia_size;
+#define SIBYTE_CS_REG(pcaddr) (IO_SPACE_BASE + sb_pcmcia_base - mips_io_port_base + pcaddr)
+#define SB_PC_PORT 0xff00
+extern void sibyte_set_ideops(ide_hwif_t *hwif);
+
+/* The card status change interrupt */
+static int cs_irq = K_INT_PCMCIA;
+
+/* Memory map windows */
+static struct pccard_mem_map sibyte_memmap[MAX_WIN];
+static struct pccard_io_map sibyte_iomap[MAX_IO_WIN];
+
+/*====================================================================*/
+/* Socket structures */
+/*====================================================================*/
+
+
+static void sb1250pc_interrupt(int irq, void *dev, struct pt_regs *regs);
+static struct pccard_operations sb1250pc_operations;
+
+typedef struct socket_handler_t {
+ void (*handler)(void *info, u_int events);
+ void *info;
+} socket_handler_t;
+
+static socket_handler_t socket_handler;
+
+/*
+ * cap features:
+ * full 32-bit addressing for 16-bit PCcard memory windows
+ * 16-bit card memory and IO accesses need bus_ops
+ * only 16-bit PCcards
+ * align memory windows
+ * statically mapped memory windows
+ */
+static socket_cap_t sb1250pc_cap = {
+ features: (SS_CAP_PAGE_REGS |
+// SS_CAP_VIRTUAL_BUS |
+ SS_CAP_PCCARD |
+ SS_CAP_MEM_ALIGN | SS_CAP_STATIC_MAP),
+ irq_mask: 0, /* tell ide layer to take PCI irq */
+ map_size: 0x4000000, /* 64MB minimum window size (What *should* this be?)*/
+ io_offset: SB_PC_PORT, /* This is ide5 -- just a special token for ide-sibyte */
+ pci_irq: K_INT_PC_READY, /* XXXKW This serves as IREQ# for CompactFlash */
+ cb_dev: NULL,
+ bus: NULL
+};
+
+/*====================================================================*/
+/* Useful macros */
+/*====================================================================*/
+
+#define READ_PHYSADDR(addr) (*(volatile u32 *)(KSEG1ADDR(addr)))
+#define WRITE_PHYSADDR(addr, data) (*(volatile u32 *)(KSEG1ADDR(addr))) = (data)
+
+#define READ_CSR32(reg) csr_in32(IO_SPACE_BASE + (reg))
+#define WRITE_CSR32(data, reg) csr_out32(data, IO_SPACE_BASE + (reg))
+
+#define sb1250pc_write_config(data) WRITE_CSR32(data, A_IO_PCMCIA_CFG)
+#define sb1250pc_read_config() READ_CSR32(A_IO_PCMCIA_CFG)
+#define sb1250pc_read_status() READ_CSR32(A_IO_PCMCIA_STATUS)
+
+#define CARDPRESENT(s) (((s) & (M_PCMCIA_STATUS_CD1 | M_PCMCIA_STATUS_CD2)) == 0)
+
+int sb_pcmcia_ack_intr(struct hwif_s *hwif)
+{
+ /*
+ * XXXKW verify interrupt and return appropriate value?
+ * Simple check of the bit in A_GPIO_READ didn't DTRT
+ */
+
+ /* Clear out the GPIO edge detector */
+ WRITE_CSR32(1 << K_GPIO_PC_READY, A_GPIO_CLR_EDGE);
+ return 1;
+}
+
+/*====================================================================*/
+/* Interrupt handling */
+/*====================================================================*/
+
+static unsigned int pending_events;
+static spinlock_t pending_event_lock = SPIN_LOCK_UNLOCKED;
+
+static void sb1250pc_bh(void *dummy)
+{
+ unsigned int events;
+
+ spin_lock_irq(&pending_event_lock);
+ events = pending_events;
+ pending_events = 0;
+ spin_unlock_irq(&pending_event_lock);
+
+ if (socket_handler.handler)
+ socket_handler.handler(socket_handler.info, events);
+}
+
+static struct tq_struct sb1250pc_task =
+{
+ routine: sb1250pc_bh
+};
+
+static void sb1250pc_interrupt(int irq, void *dev, struct pt_regs *regs)
+{
+ unsigned int events = 0;
+ uint32_t status;
+
+ status = sb1250pc_read_status();
+
+ if (status & M_PCMCIA_STATUS_CDCHG) {
+ events = SS_DETECT;
+ if (CARDPRESENT(status)) {
+ events |= SS_INSERTION;
+ } else {
+ events |= SS_EJECTION;
+ }
+ }
+#if 0
+ /* XXXKW ignore everything but CD? */
+ if (status & M_PCMCIA_STATUS_RDYCHG) {
+ if (status & M_PCMCIA_STATUS_RDY) {
+ /* XXXKW if ide, ack the interrupt? */
+ events |= SS_READY;
+ }
+ }
+#endif
+
+ if (events) {
+ DPRINTK(PFX " passing %x to bh\n", events);
+
+ /* Pass the events off to the bottom-half */
+ spin_lock(&pending_event_lock);
+ pending_events |= events;
+ spin_unlock(&pending_event_lock);
+ schedule_task(&sb1250pc_task);
+ }
+}
+
+/*====================================================================*/
+/* PC Card Operations */
+/*====================================================================*/
+
+static int sb1250pc_register_callback(unsigned int lsock,
+ void (*handler)(void *, unsigned int),
+ void * info)
+{
+ DPRINTK(PFX "sb1250pc_register_callback(%d)\n", lsock);
+
+ socket_handler.handler = handler;
+ socket_handler.info = info;
+ if (handler == NULL) {
+ MOD_DEC_USE_COUNT;
+ } else {
+ MOD_INC_USE_COUNT;
+ }
+ return 0;
+}
+
+/*====================================================================*/
+
+static int sb1250pc_get_status(unsigned int lsock, u_int *value)
+{
+ u_int val;
+ uint32_t status;
+#if PCMCIA_DEBUG
+ u32 config;
+#endif
+
+ status = sb1250pc_read_status();
+#if PCMCIA_DEBUG
+ config = sb1250pc_read_config();
+#endif
+
+ val = CARDPRESENT(status) ? SS_DETECT : 0;
+ val |= (status & M_PCMCIA_CFG_RESET) ? SS_RESET : 0;
+ val |= (status & (M_PCMCIA_STATUS_3VEN | M_PCMCIA_STATUS_5VEN)) ?
+ SS_POWERON : 0;
+ val |= (status & M_PCMCIA_STATUS_RDY) ? SS_READY : 0;
+ val |= (status & M_PCMCIA_STATUS_WP) ? SS_WRPROT : 0;
+ val |= ((status & M_PCMCIA_STATUS_VS2) &&
+ (~status & M_PCMCIA_STATUS_VS1)) ? SS_3VCARD : 0;
+ val |= (status & (M_PCMCIA_STATUS_CDCHG | M_PCMCIA_STATUS_WPCHG
+ | M_PCMCIA_STATUS_RDYCHG)) ? SS_STSCHG : 0;
+ /* XXXKW SS_INSERTION on cdchange? */
+
+ DPRINTK(PFX "GetStatus(%d) = %x", lsock, val);
+#if PCMCIA_DEBUG
+ DPRINTK(" [config(0x%4.4x) status(0x%4.4x)]", config, status);
+#endif
+ DPRINTK("\n");
+
+ *value = val;
+ return 0;
+}
+
+/*====================================================================*/
+
+static int sb1250pc_inquire_socket(unsigned int lsock, socket_cap_t *cap)
+{
+ *cap = sb1250pc_cap;
+
+ DPRINTK(PFX "InquireSocket(%d) = features 0x%4.4x, irq_mask "
+ "0x%4.4x, map_size 0x%4.4x\n", lsock, cap->features,
+ cap->irq_mask, cap->map_size);
+
+ return 0;
+}
+
+/*====================================================================*/
+
+// This garbage function never seems to get called...
+static int sb1250pc_get_socket(unsigned int lsock, socket_state_t *state)
+{
+ DPRINTK(PFX "Does GetSocket(%d) ever get called???", lsock);
+ return -1;
+} /* sb1250pc_get_socket */
+
+/*====================================================================*/
+
+static uint32_t sibyte_set_power(uint32_t config, int vcc)
+{
+ config &= ~(M_PCMCIA_CFG_3VEN | M_PCMCIA_CFG_5VEN);
+ if (vcc == 33) {
+ config |= M_PCMCIA_CFG_3VEN;
+ } else if (vcc == 50) {
+ config |= M_PCMCIA_CFG_5VEN;
+ }
+
+ sb1250pc_write_config(config);
+ return config;
+}
+
+static int sb1250pc_set_socket(unsigned int lsock, socket_state_t *state)
+{
+ uint32_t config;
+
+ DPRINTK(PFX "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
+ "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags,
+ state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
+
+ config = sb1250pc_read_config();
+
+ config = sibyte_set_power(config, state->Vcc);
+
+ if (state->flags & SS_DEBOUNCED)
+ state->flags &= ~SS_DEBOUNCED; /* SS_DEBOUNCED is oneshot */
+ /* XXXKW SS_OUTPUT_ENA? */
+ /* XXXKW SS_PWR_AUTO? */
+ /* XXXKW SS_IOCARD? */
+
+ if (state->csc_mask & SS_DETECT)
+ config &= ~M_PCMCIA_CFG_CDMASK;
+ else
+ config |= M_PCMCIA_CFG_CDMASK;
+
+ config &= ~M_PCMCIA_CFG_RESET;
+ if (state->flags & SS_RESET) {
+ DPRINTK(PFX " resetting PCMCIA\n");
+ config |= M_PCMCIA_CFG_RESET;
+ }
+ sb1250pc_write_config(config);
+
+ DPRINTK(PFX " new config: %x\n", sb1250pc_read_config());
+
+ return 0;
+}
+
+/*====================================================================*/
+
+static int sb1250pc_get_io_map(unsigned int lsock, struct pccard_io_map *io)
+{
+ *io = sibyte_iomap[io->map];
+
+ DPRINTK(PFX "GetIOMap(%d, %d) = %#2.2x, %d ns, "
+ "%#4.4x-%#4.4x\n", lsock, io->map, io->flags,
+ io->speed, io->start, io->stop);
+ return 0;
+} /* sb1250pc_get_io_map */
+
+static int sb1250pc_set_io_map(unsigned int lsock, struct pccard_io_map *io)
+{
+ unsigned int speed;
+ unsigned long start;
+ u32 config;
+
+ /* SB1250 uses direct mapping */
+ DPRINTK(PFX "SetIOMap(%d, %d, %#2.2x, %d ns, "
+ "%#4.4x-%#4.4x) called\n", lsock, io->map, io->flags,
+ io->speed, io->start, io->stop);
+
+ if (io->map >= MAX_IO_WIN) {
+ DPRINTK(KERN_ERR PFX "map (%d) out of range\n", io->map);
+ return -1;
+ }
+
+ if (io->flags & MAP_ACTIVE) {
+ speed = (io->speed > 0) ? io->speed : 255;
+ }
+
+ config = sb1250pc_read_config();
+
+ if (io->flags & MAP_ATTRIB) {
+ DPRINTK(PFX " Setting pcmcia_cfg_reg to 1 (Attribute Mode)\n");
+ config |= M_PCMCIA_CFG_ATTRMEM;
+ } else {
+ DPRINTK(PFX " Setting pcmcia_cfg_reg to 0 (Data Mode)\n");
+ config &= ~M_PCMCIA_CFG_ATTRMEM;
+ }
+ sb1250pc_write_config(config);
+
+ start = io->start;
+
+ if (io->stop == 1) {
+ io->stop = PAGE_SIZE - 1;
+ }
+
+ if (io->start == 0)
+ io->start = sb_pcmcia_base;
+
+ io->stop = io->start + (io->stop - start);
+
+ sibyte_iomap[io->map] = *io;
+
+ DPRINTK(PFX "SetIOMap(%d, %d, %#2.2x, %d ns, "
+ "%#4.4x-%#4.4x) returns\n", lsock, io->map, io->flags,
+ io->speed, io->start, io->stop);
+ return 0;
+} /* sb1250pc_set_io_map */
+
+/*====================================================================*/
+
+static int sb1250pc_get_mem_map(unsigned int lsock, struct pccard_mem_map *mem)
+{
+ if(mem->map >= MAX_WIN)
+ return -EINVAL;
+
+ *mem = sibyte_memmap[mem->map];
+
+ DPRINTK(PFX "GetMemMap(%d, mem[%d, %#2.2x, %d ns, "
+ "%#5.5lx-%#5.5lx, %#5.5x) called\n", lsock, mem->map, mem->flags,
+ mem->speed, mem->sys_start, mem->sys_stop, mem->card_start);
+
+ return 0;
+}
+
+static int sb1250pc_set_mem_map(unsigned int lsock, struct pccard_mem_map *mem)
+{
+ u32 old_config, new_config;
+
+ if (mem->map >= MAX_WIN) {
+ DPRINTK(KERN_ERR PFX "map (%d) out of range\n", mem->map);
+ return -1;
+ }
+
+ if (mem->sys_start == 0)
+ mem->sys_start = mem->card_start + sb_pcmcia_base;
+
+ if (mem->sys_stop == 0)
+ mem->sys_stop = mem->sys_start + sb_pcmcia_size - 1;
+
+ old_config = sb1250pc_read_config();
+
+ DPRINTK(PFX " Setting mem_map %p\n", mem);
+ if (mem->flags & MAP_ATTRIB) {
+ DPRINTK(PFX " Setting pcmcia_cfg_reg to 1 (Attribute Mode)\n");
+ new_config = old_config | M_PCMCIA_CFG_ATTRMEM;
+ } else {
+ DPRINTK(PFX " Setting pcmcia_cfg_reg to 0 (Data Mode)\n");
+ new_config = old_config & ~M_PCMCIA_CFG_ATTRMEM;
+ }
+ if (new_config != old_config)
+ sb1250pc_write_config(new_config);
+
+ sibyte_memmap[mem->map] = *mem;
+
+ DPRINTK(PFX "SetMemMap(%d, mem[%d, %#2.2x, %d ns], "
+ "%#5.5lx-%#5.5lx, %#5.5x)\n", lsock, mem->map, mem->flags,
+ mem->speed, mem->sys_start, mem->sys_stop, mem->card_start);
+
+ return 0;
+}
+
+/*====================================================================*/
+
+#ifdef CONFIG_PROC_FS
+/* sb1250pc_proc_status()
+ * Implements the /proc/bus/pccard/??/status file.
+ *
+ * Returns: the number of characters added to the buffer
+ *
+ * Be aware that reading status clears the "change" bits; this seems
+ * unlikely to bite us by making us miss interrupts.
+ */
+static int sb1250pc_proc_status(char *buf, char **start, off_t pos,
+ int count, int *eof, void *data)
+{
+ char *p = buf;
+ u32 addr, temp;
+ u32 status, config;
+ //unsigned int sock = (unsigned int) data;
+
+ config = sb1250pc_read_config();
+ status = sb1250pc_read_status();
+ p += sprintf(p, "config(0x%4.4x) status(0x%4.4x)\n", config, status);
+
+ for (addr = sb_pcmcia_base; addr < sb_pcmcia_base + 8; addr+=4) {
+ temp = READ_PHYSADDR(addr);
+ p += sprintf(p, " Looking up addr 0x%x: 0x%8.8x\n", addr, temp);
+ }
+
+ return p - buf;
+}
+
+static void sb1250pc_proc_setup(unsigned int sock, struct proc_dir_entry *base)
+{
+ struct proc_dir_entry *entry;
+
+ if ((entry = create_proc_entry("sb1250pc", 0, base)) == NULL) {
+ printk(KERN_ERR PFX "Unable to install \"sb1250pc\" procfs entry\n");
+ return;
+ } else
+ printk(KERN_INFO PFX "Setting up \"sb1250pc\" procfs entry\n");
+
+ entry->read_proc = sb1250pc_proc_status;
+ entry->data = (void *) sock;
+}
+
+#endif
+
+/*====================================================================*/
+
+static int sibyte_pcmcia_initted = 0;
+
+static int sb1250pc_init(unsigned int s)
+{
+ u32 config, status;
+
+ DPRINTK(PFX "Initializing SB1250 PCMCIA:\n");
+
+ /* Read status to clear interrupt sources */
+ status = sb1250pc_read_status();
+
+ /*
+ * Before getting setting up the IRQ, set the config:
+ * reset off, auto-power off
+ * interrupt mask: WP, CD, Ready off
+ */
+ config = sb1250pc_read_config();
+ config = M_PCMCIA_CFG_CDMASK | M_PCMCIA_CFG_WPMASK | M_PCMCIA_CFG_RDYMASK;
+ sb1250pc_write_config(config);
+
+ if (!sibyte_pcmcia_initted) {
+ uint32_t gpio_ctrl;
+ /* Set up the GPIO for PC_READY for use in ide-cs */
+ gpio_ctrl = READ_CSR32(A_GPIO_INT_TYPE);
+ gpio_ctrl &= ~M_GPIO_INTR_TYPEX(K_GPIO_PC_READY);
+ gpio_ctrl |= V_GPIO_INTR_TYPEX(K_GPIO_PC_READY, K_GPIO_INTR_EDGE);
+ WRITE_CSR32(gpio_ctrl, A_GPIO_INT_TYPE);
+ WRITE_CSR32(1 << K_GPIO_PC_READY, A_GPIO_CLR_EDGE);
+
+ /* Invert to get busy->ready transition */
+ gpio_ctrl = READ_CSR32(A_GPIO_INPUT_INVERT);
+ gpio_ctrl |= 1 << K_GPIO_PC_READY;
+ WRITE_CSR32(gpio_ctrl, A_GPIO_INPUT_INVERT);
+
+ /* Should not be any pending since we masked all sources */
+ if (request_irq(cs_irq, sb1250pc_interrupt, 0, "pcmcia", NULL))
+ return -ENODEV;
+ DPRINTK(PFX " IRQ %d registered\n", cs_irq);
+
+ sibyte_pcmcia_initted = 1;
+ }
+
+ status = sb1250pc_read_status();
+ DPRINTK(PFX " config(0x%4.4x) status(0x%4.4x)\n", config, status);
+
+ sb1250pc_set_socket(s, &dead_socket);
+
+ return 0;
+}
+
+static int sb1250pc_suspend(unsigned int sock)
+{
+ free_irq(cs_irq, NULL);
+ DPRINTK(KERN_INFO PFX " IRQ %d freed\n", cs_irq);
+ return sb1250pc_set_socket(sock, &dead_socket);
+}
+
+static struct pccard_operations sb1250pc_operations = {
+ sb1250pc_init,
+ sb1250pc_suspend,
+ sb1250pc_register_callback,
+ sb1250pc_inquire_socket,
+ sb1250pc_get_status,
+ sb1250pc_get_socket,
+ sb1250pc_set_socket,
+ sb1250pc_get_io_map,
+ sb1250pc_set_io_map,
+ sb1250pc_get_mem_map,
+ sb1250pc_set_mem_map,
+#ifdef CONFIG_PROC_FS
+ sb1250pc_proc_setup
+#endif
+};
+
+/*
+ * XXXKW This is a hack. The ide-cs stuff seems to leave us in
+ * Attribute mode. Since I know that a SELECT_DRIVE will happen as
+ * the first I/O access, use this opportunity to enter data mode.
+ */
+static void sibyte_pcmcia_selectproc(ide_drive_t *drive)
+{
+ sb1250pc_write_config(sb1250pc_read_config() & ~M_PCMCIA_CFG_ATTRMEM);
+}
+
+static int sibyte_pc_prep_ide(void)
+{
+ int i;
+ ide_hwif_t *hwif = NULL;
+
+ /* Stake early claim on an ide_hwif */
+ for (i = 0; i < MAX_HWIFS; i++) {
+ if (!ide_hwifs[i].io_ports[IDE_DATA_OFFSET]) {
+ hwif = &ide_hwifs[i];
+ break;
+ }
+ }
+ if (hwif == NULL) {
+ printk("No space for SiByte onboard PCMCIA driver in ide_hwifs[]. Not enabled.\n");
+ return 1;
+ }
+
+ /*
+ * Prime the hwif with port values, so when a card is
+ * detected, the 'io_offset' from the capabilities will lead
+ * it here
+ */
+ hwif->hw.io_ports[IDE_DATA_OFFSET] = SIBYTE_CS_REG(0);
+ hwif->hw.io_ports[IDE_ERROR_OFFSET] = SIBYTE_CS_REG(1);
+ hwif->hw.io_ports[IDE_NSECTOR_OFFSET] = SIBYTE_CS_REG(2);
+ hwif->hw.io_ports[IDE_SECTOR_OFFSET] = SIBYTE_CS_REG(3);
+ hwif->hw.io_ports[IDE_LCYL_OFFSET] = SIBYTE_CS_REG(4);
+ hwif->hw.io_ports[IDE_HCYL_OFFSET] = SIBYTE_CS_REG(5);
+ hwif->hw.io_ports[IDE_SELECT_OFFSET] = SIBYTE_CS_REG(6);
+ hwif->hw.io_ports[IDE_STATUS_OFFSET] = SIBYTE_CS_REG(7);
+ hwif->hw.io_ports[IDE_CONTROL_OFFSET] = SIBYTE_CS_REG(6); /* XXXKW ? */
+ hwif->hw.ack_intr = sb_pcmcia_ack_intr;
+ hwif->selectproc = sibyte_pcmcia_selectproc;
+ hwif->hold = 1;
+ hwif->mmio = 2;
+ sibyte_set_ideops(&ide_hwifs[i]);
+
+ printk("SiByte onboard PCMCIA-IDE configured as device %i\n", i);
+
+ return 0;
+}
+
+static int __init sibyte_pcmcia_init(void)
+{
+ servinfo_t info;
+ u32 addr, temp;
+ u64 cfg;
+
+ CardServices(GetCardServicesInfo, &info);
+ if (info.Revision != CS_RELEASE_CODE) {
+ printk(KERN_ERR PFX "Card Services release does not match!\n");
+ return -1;
+ }
+
+ cfg = in64(IO_SPACE_BASE + A_SCD_SYSTEM_CFG);
+ if (!(cfg & M_SYS_PCMCIA_ENABLE)) {
+ printk(KERN_INFO PFX "chip not configured for PCMCIA\n");
+ return -1;
+ }
+
+ /* Find memory base address and size */
+ addr = A_IO_EXT_REG(R_IO_EXT_REG(R_IO_EXT_MULT_SIZE, PCMCIA_CS));
+ temp = G_IO_MULT_SIZE(csr_in32(IO_SPACE_BASE + addr));
+ printk(PFX "Looking up addr 0x%x: 0x%4.4x (IO size)\n", addr, temp);
+ sb_pcmcia_size = (temp+1) << S_IO_REGSIZE;
+
+ addr = A_IO_EXT_REG(R_IO_EXT_REG(R_IO_EXT_START_ADDR, PCMCIA_CS));
+ temp = G_IO_START_ADDR(csr_in32(KSEG1|addr));
+ printk(PFX "Looking up addr 0x%x: 0x%4.4x (IO Base Address)\n", addr, temp);
+ if (temp << S_IO_ADDRBASE != PCMCIA_PHYS)
+ panic(PFX "pcmcia base doesn't match gencs value\n");
+
+ /* check and request memory region */
+ if (check_mem_region(sb_pcmcia_base, sb_pcmcia_size)) {
+ printk(KERN_ERR PFX "Can't request memory region?\n");
+ } else {
+ request_mem_region(sb_pcmcia_base, sb_pcmcia_size, "sibyte-pcmcia");
+ printk(PFX "Memory region 0x%8.8lx of size 0x%8.8lx requested.\n",
+ sb_pcmcia_base, sb_pcmcia_size);
+ }
+
+ /* register with socket services */
+ if (register_ss_entry(1, &sb1250pc_operations)) {
+ printk(KERN_ERR PFX "register_ss_entry() failed\n");
+ release_region(sb_pcmcia_base, sb_pcmcia_size);
+ return -ENODEV;
+ }
+
+ if (!sibyte_pc_prep_ide()) {
+ /* XXXKW hack for ide-cs warning squash */
+ request_region(sb1250pc_cap.io_offset, 16, "ide-cs");
+ request_mem_region(SIBYTE_CS_REG(0), 8, "sibyte-ide-cs");
+ }
+
+ return 0;
+}
+
+static void __exit sibyte_pcmcia_exit(void)
+{
+ /* XXXKW untested as module */
+ unregister_ss_entry(&sb1250pc_operations);
+ release_region(sb_pcmcia_base, sb_pcmcia_size);
+}
+
+module_init(sibyte_pcmcia_init);
+module_exit(sibyte_pcmcia_exit);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/pcmcia/vrc4173_cardu.c linux-2.4.22/drivers/pcmcia/vrc4173_cardu.c
--- linux-2.4.22.clean/drivers/pcmcia/vrc4173_cardu.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/pcmcia/vrc4173_cardu.c 2003-09-27 14:08:10.000000000 +0200
@@ -0,0 +1,628 @@
+/*
+ * FILE NAME
+ * drivers/pcmcia/vrc4173_cardu.c
+ *
+ * BRIEF MODULE DESCRIPTION
+ * NEC VRC4173 CARDU driver for Socket Services
+ * (This device doesn't support CardBus. it is supporting only 16bit PC Card.)
+ *
+ * Copyright 2002,2003 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+ *
+ * This program 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/spinlock.h>
+#include <linux/types.h>
+
+#include <asm/io.h>
+
+#include <pcmcia/ss.h>
+
+#include "vrc4173_cardu.h"
+
+MODULE_DESCRIPTION("NEC VRC4173 CARDU driver for Socket Services");
+MODULE_AUTHOR("Yoichi Yuasa <yuasa@hh.iij4u.or.jp>");
+MODULE_LICENSE("GPL");
+
+static int vrc4173_cardu_slots;
+
+static vrc4173_socket_t cardu_sockets[CARDU_MAX_SOCKETS];
+
+extern struct socket_info_t *pcmcia_register_socket (int slot,
+ struct pccard_operations *vtable,
+ int use_bus_pm);
+extern void pcmcia_unregister_socket(struct socket_info_t *s);
+
+static inline uint8_t exca_readb(vrc4173_socket_t *socket, uint16_t offset)
+{
+ return readb(socket->base + EXCA_REGS_BASE + offset);
+}
+
+static inline uint16_t exca_readw(vrc4173_socket_t *socket, uint16_t offset)
+{
+ uint16_t val;
+
+ val = readb(socket->base + EXCA_REGS_BASE + offset);
+ val |= (u16)readb(socket->base + EXCA_REGS_BASE + offset + 1) << 8;
+
+ return val;
+}
+
+static inline void exca_writeb(vrc4173_socket_t *socket, uint16_t offset, uint8_t val)
+{
+ writeb(val, socket->base + EXCA_REGS_BASE + offset);
+}
+
+static inline void exca_writew(vrc4173_socket_t *socket, uint8_t offset, uint16_t val)
+{
+ writeb((u8)val, socket->base + EXCA_REGS_BASE + offset);
+ writeb((u8)(val >> 8), socket->base + EXCA_REGS_BASE + offset + 1);
+}
+
+static inline uint32_t cardbus_socket_readl(vrc4173_socket_t *socket, u16 offset)
+{
+ return readl(socket->base + CARDBUS_SOCKET_REGS_BASE + offset);
+}
+
+static inline void cardbus_socket_writel(vrc4173_socket_t *socket, u16 offset, uint32_t val)
+{
+ writel(val, socket->base + CARDBUS_SOCKET_REGS_BASE + offset);
+}
+
+static void cardu_pciregs_init(struct pci_dev *dev)
+{
+ u32 syscnt;
+ u16 brgcnt;
+ u8 devcnt;
+
+ pci_write_config_dword(dev, 0x1c, 0x10000000);
+ pci_write_config_dword(dev, 0x20, 0x17fff000);
+ pci_write_config_dword(dev, 0x2c, 0);
+ pci_write_config_dword(dev, 0x30, 0xfffc);
+
+ pci_read_config_word(dev, BRGCNT, &brgcnt);
+ brgcnt &= ~IREQ_INT;
+ pci_write_config_word(dev, BRGCNT, brgcnt);
+
+ pci_read_config_dword(dev, SYSCNT, &syscnt);
+ syscnt &= ~(BAD_VCC_REQ_DISB|PCPCI_EN|CH_ASSIGN_MASK|SUB_ID_WR_EN|PCI_CLK_RIN);
+ syscnt |= (CH_ASSIGN_NODMA|ASYN_INT_MODE);
+ pci_write_config_dword(dev, SYSCNT, syscnt);
+
+ pci_read_config_byte(dev, DEVCNT, &devcnt);
+ devcnt &= ~(ZOOM_VIDEO_EN|SR_PCI_INT_SEL_MASK|PCI_INT_MODE|IRQ_MODE);
+ devcnt |= (SR_PCI_INT_SEL_NONE|IFG);
+ pci_write_config_byte(dev, DEVCNT, devcnt);
+
+ pci_write_config_byte(dev, CHIPCNT, S_PREF_DISB);
+
+ pci_write_config_byte(dev, SERRDIS, 0);
+}
+
+static int cardu_init(unsigned int slot)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[slot];
+
+ cardu_pciregs_init(socket->dev);
+
+ /* CARD_SC bits are cleared by reading CARD_SC. */
+ exca_writeb(socket, GLO_CNT, 0);
+
+ socket->cap.features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS;
+ socket->cap.irq_mask = 0;
+ socket->cap.map_size = 0x1000;
+ socket->cap.pci_irq = socket->dev->irq;
+ socket->events = 0;
+ spin_lock_init(socket->event_lock);
+
+ /* Enable PC Card status interrupts */
+ exca_writeb(socket, CARD_SCI, CARD_DT_EN|RDY_EN|BAT_WAR_EN|BAT_DEAD_EN);
+
+ return 0;
+}
+
+static int cardu_suspend(unsigned int slot)
+{
+ return -EINVAL;
+}
+
+static int cardu_register_callback(unsigned int sock,
+ void (*handler)(void *, unsigned int),
+ void * info)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+
+ socket->handler = handler;
+ socket->info = info;
+
+ if (handler)
+ MOD_INC_USE_COUNT;
+ else
+ MOD_DEC_USE_COUNT;
+
+ return 0;
+}
+
+static int cardu_inquire_socket(unsigned int sock, socket_cap_t *cap)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+
+ *cap = socket->cap;
+
+ return 0;
+}
+
+static int cardu_get_status(unsigned int sock, u_int *value)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+ uint32_t state;
+ uint8_t status;
+ u_int val = 0;
+
+ status = exca_readb(socket, IF_STATUS);
+ if (status & CARD_PWR) val |= SS_POWERON;
+ if (status & READY) val |= SS_READY;
+ if (status & CARD_WP) val |= SS_WRPROT;
+ if ((status & (CARD_DETECT1|CARD_DETECT2)) == (CARD_DETECT1|CARD_DETECT2))
+ val |= SS_DETECT;
+ if (exca_readb(socket, INT_GEN_CNT) & CARD_TYPE_IO) {
+ if (status & STSCHG) val |= SS_STSCHG;
+ } else {
+ status &= BV_DETECT_MASK;
+ if (status != BV_DETECT_GOOD) {
+ if (status == BV_DETECT_WARN) val |= SS_BATWARN;
+ else val |= SS_BATDEAD;
+ }
+ }
+
+ state = cardbus_socket_readl(socket, SKT_PRE_STATE);
+ if (state & VOL_3V_CARD_DT) val |= SS_3VCARD;
+ if (state & VOL_XV_CARD_DT) val |= SS_XVCARD;
+ if (state & CB_CARD_DT) val |= SS_CARDBUS;
+ if (!(state &
+ (VOL_YV_CARD_DT|VOL_XV_CARD_DT|VOL_3V_CARD_DT|VOL_5V_CARD_DT|CCD20|CCD10)))
+ val |= SS_PENDING;
+
+ *value = val;
+
+ return 0;
+}
+
+static inline u_char get_Vcc_value(uint8_t val)
+{
+ switch (val & VCC_MASK) {
+ case VCC_3V:
+ return 33;
+ case VCC_5V:
+ return 50;
+ }
+
+ return 0;
+}
+
+static inline u_char get_Vpp_value(uint8_t val)
+{
+ switch (val & VPP_MASK) {
+ case VPP_12V:
+ return 120;
+ case VPP_VCC:
+ return get_Vcc_value(val);
+ }
+
+ return 0;
+}
+
+static int cardu_get_socket(unsigned int sock, socket_state_t *state)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+ uint8_t val;
+
+ val = exca_readb(socket, PWR_CNT);
+ state->Vcc = get_Vcc_value(val);
+ state->Vpp = get_Vpp_value(val);
+ state->flags = 0;
+ if (val & CARD_OUT_EN) state->flags |= SS_OUTPUT_ENA;
+
+ val = exca_readb(socket, INT_GEN_CNT);
+ if (!(val & CARD_REST0)) state->flags |= SS_RESET;
+ if (val & CARD_TYPE_IO) state->flags |= SS_IOCARD;
+
+ return 0;
+}
+
+static inline uint8_t set_Vcc_value(u_char Vcc)
+{
+ switch (Vcc) {
+ case 33:
+ return VCC_3V;
+ case 50:
+ return VCC_5V;
+ }
+
+ return VCC_0V;
+}
+
+static inline uint8_t set_Vpp_value(u_char Vpp)
+{
+ switch (Vpp) {
+ case 33:
+ case 50:
+ return VPP_VCC;
+ case 120:
+ return VPP_12V;
+ }
+
+ return VPP_0V;
+}
+
+static int cardu_set_socket(unsigned int sock, socket_state_t *state)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+ uint8_t val;
+
+ if (((state->Vpp == 33) || (state->Vpp == 50)) && (state->Vpp != state->Vcc))
+ return -EINVAL;
+
+ val = set_Vcc_value(state->Vcc);
+ val |= set_Vpp_value(state->Vpp);
+ if (state->flags & SS_OUTPUT_ENA) val |= CARD_OUT_EN;
+ exca_writeb(socket, PWR_CNT, val);
+
+ val = exca_readb(socket, INT_GEN_CNT) & CARD_REST0;
+ if (state->flags & SS_RESET) val &= ~CARD_REST0;
+ else val |= CARD_REST0;
+ if (state->flags & SS_IOCARD) val |= CARD_TYPE_IO;
+ exca_writeb(socket, INT_GEN_CNT, val);
+
+ return 0;
+}
+
+static int cardu_get_io_map(unsigned int sock, struct pccard_io_map *io)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+ uint8_t ioctl, window;
+ u_char map;
+
+ map = io->map;
+ if (map > 1)
+ return -EINVAL;
+
+ io->start = exca_readw(socket, IO_WIN_SA(map));
+ io->stop = exca_readw(socket, IO_WIN_EA(map));
+
+ ioctl = exca_readb(socket, IO_WIN_CNT);
+ window = exca_readb(socket, ADR_WIN_EN);
+ io->flags = (window & IO_WIN_EN(map)) ? MAP_ACTIVE : 0;
+ if (ioctl & IO_WIN_DATA_AUTOSZ(map))
+ io->flags |= MAP_AUTOSZ;
+ else if (ioctl & IO_WIN_DATA_16BIT(map))
+ io->flags |= MAP_16BIT;
+
+ return 0;
+}
+
+static int cardu_set_io_map(unsigned int sock, struct pccard_io_map *io)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+ uint16_t ioctl;
+ uint8_t window, enable;
+ u_char map;
+
+ map = io->map;
+ if (map > 1)
+ return -EINVAL;
+
+ window = exca_readb(socket, ADR_WIN_EN);
+ enable = IO_WIN_EN(map);
+
+ if (window & enable) {
+ window &= ~enable;
+ exca_writeb(socket, ADR_WIN_EN, window);
+ }
+
+ exca_writew(socket, IO_WIN_SA(map), io->start);
+ exca_writew(socket, IO_WIN_EA(map), io->stop);
+
+ ioctl = exca_readb(socket, IO_WIN_CNT) & ~IO_WIN_CNT_MASK(map);
+ if (io->flags & MAP_AUTOSZ) ioctl |= IO_WIN_DATA_AUTOSZ(map);
+ else if (io->flags & MAP_16BIT) ioctl |= IO_WIN_DATA_16BIT(map);
+ exca_writeb(socket, IO_WIN_CNT, ioctl);
+
+ if (io->flags & MAP_ACTIVE)
+ exca_writeb(socket, ADR_WIN_EN, window | enable);
+
+ return 0;
+}
+
+static int cardu_get_mem_map(unsigned int sock, struct pccard_mem_map *mem)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+ uint32_t start, stop, offset, page;
+ uint8_t window;
+ u_char map;
+
+ map = mem->map;
+ if (map > 4)
+ return -EINVAL;
+
+ window = exca_readb(socket, ADR_WIN_EN);
+ mem->flags = (window & MEM_WIN_EN(map)) ? MAP_ACTIVE : 0;
+
+ start = exca_readw(socket, MEM_WIN_SA(map));
+ mem->flags |= (start & MEM_WIN_DSIZE) ? MAP_16BIT : 0;
+ start = (start & 0x0fff) << 12;
+
+ stop = exca_readw(socket, MEM_WIN_EA(map));
+ stop = ((stop & 0x0fff) << 12) + 0x0fff;
+
+ offset = exca_readw(socket, MEM_WIN_OA(map));
+ mem->flags |= (offset & MEM_WIN_WP) ? MAP_WRPROT : 0;
+ mem->flags |= (offset & MEM_WIN_REGSET) ? MAP_ATTRIB : 0;
+ offset = ((offset & 0x3fff) << 12) + start;
+ mem->card_start = offset & 0x03ffffff;
+
+ page = exca_readb(socket, MEM_WIN_SAU(map)) << 24;
+ mem->sys_start = start + page;
+ mem->sys_stop = start + page;
+
+ return 0;
+}
+
+static int cardu_set_mem_map(unsigned int sock, struct pccard_mem_map *mem)
+{
+ vrc4173_socket_t *socket = &cardu_sockets[sock];
+ uint16_t value;
+ uint8_t window, enable;
+ u_long sys_start, sys_stop, card_start;
+ u_char map;
+
+ map = mem->map;
+ sys_start = mem->sys_start;
+ sys_stop = mem->sys_stop;
+ card_start = mem->card_start;
+
+ if (map > 4 || sys_start > sys_stop || ((sys_start ^ sys_stop) >> 24) ||
+ (card_start >> 26))
+ return -EINVAL;
+
+ window = exca_readb(socket, ADR_WIN_EN);
+ enable = MEM_WIN_EN(map);
+ if (window & enable) {
+ window &= ~enable;
+ exca_writeb(socket, ADR_WIN_EN, window);
+ }
+
+ exca_writeb(socket, MEM_WIN_SAU(map), sys_start >> 24);
+
+ value = (sys_start >> 12) & 0x0fff;
+ if (mem->flags & MAP_16BIT) value |= MEM_WIN_DSIZE;
+ exca_writew(socket, MEM_WIN_SA(map), value);
+
+ value = (sys_stop >> 12) & 0x0fff;
+ exca_writew(socket, MEM_WIN_EA(map), value);
+
+ value = ((card_start - sys_start) >> 12) & 0x3fff;
+ if (mem->flags & MAP_WRPROT) value |= MEM_WIN_WP;
+ if (mem->flags & MAP_ATTRIB) value |= MEM_WIN_REGSET;
+ exca_writew(socket, MEM_WIN_OA(map), value);
+
+ if (mem->flags & MAP_ACTIVE)
+ exca_writeb(socket, ADR_WIN_EN, window | enable);
+
+ return 0;
+}
+
+static void cardu_proc_setup(unsigned int sock, struct proc_dir_entry *base)
+{
+}
+
+static struct pccard_operations cardu_operations = {
+ .init = cardu_init,
+ .suspend = cardu_suspend,
+ .register_callback = cardu_register_callback,
+ .inquire_socket = cardu_inquire_socket,
+ .get_status = cardu_get_status,
+ .get_socket = cardu_get_socket,
+ .set_socket = cardu_set_socket,
+ .get_io_map = cardu_get_io_map,
+ .set_io_map = cardu_set_io_map,
+ .get_mem_map = cardu_get_mem_map,
+ .set_mem_map = cardu_set_mem_map,
+ .proc_setup = cardu_proc_setup,
+};
+
+static void cardu_bh(void *data)
+{
+ vrc4173_socket_t *socket = (vrc4173_socket_t *)data;
+ uint16_t events;
+
+ spin_lock_irq(&socket->event_lock);
+ events = socket->events;
+ socket->events = 0;
+ spin_unlock_irq(&socket->event_lock);
+
+ if (socket->handler)
+ socket->handler(socket->info, events);
+}
+
+static uint16_t get_events(vrc4173_socket_t *socket)
+{
+ uint16_t events = 0;
+ uint8_t csc, status;
+
+ status = exca_readb(socket, IF_STATUS);
+ csc = exca_readb(socket, CARD_SC);
+ if ((csc & CARD_DT_CHG) &&
+ ((status & (CARD_DETECT1|CARD_DETECT2)) == (CARD_DETECT1|CARD_DETECT2)))
+ events |= SS_DETECT;
+
+ if ((csc & RDY_CHG) && (status & READY))
+ events |= SS_READY;
+
+ if (exca_readb(socket, INT_GEN_CNT) & CARD_TYPE_IO) {
+ if ((csc & BAT_DEAD_ST_CHG) && (status & STSCHG))
+ events |= SS_STSCHG;
+ } else {
+ if (csc & (BAT_WAR_CHG|BAT_DEAD_ST_CHG)) {
+ if ((status & BV_DETECT_MASK) != BV_DETECT_GOOD) {
+ if (status == BV_DETECT_WARN) events |= SS_BATWARN;
+ else events |= SS_BATDEAD;
+ }
+ }
+ }
+
+ return events;
+}
+
+static void cardu_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ vrc4173_socket_t *socket = (vrc4173_socket_t *)dev_id;
+ uint16_t events;
+
+ socket->tq_task.routine = cardu_bh;
+ socket->tq_task.data = socket;
+
+ events = get_events(socket);
+ if (events) {
+ spin_lock(&socket->event_lock);
+ socket->events |= events;
+ spin_unlock(&socket->event_lock);
+ schedule_task(&socket->tq_task);
+ }
+}
+
+static int __devinit vrc4173_cardu_probe(struct pci_dev *dev,
+ const struct pci_device_id *ent)
+{
+ vrc4173_socket_t *socket;
+ unsigned long start, len, flags;
+ int slot, err;
+
+ slot = vrc4173_cardu_slots++;
+ socket = &cardu_sockets[slot];
+ if (socket->noprobe != 0)
+ return -EBUSY;
+
+ sprintf(socket->name, "NEC VRC4173 CARDU%1d", slot+1);
+
+ if ((err = pci_enable_device(dev)) < 0)
+ return err;
+
+ start = pci_resource_start(dev, 0);
+ if (start == 0)
+ return -ENODEV;
+
+ len = pci_resource_len(dev, 0);
+ if (len == 0)
+ return -ENODEV;
+
+ if (((flags = pci_resource_flags(dev, 0)) & IORESOURCE_MEM) == 0)
+ return -EBUSY;
+
+ if ((err = pci_request_regions(dev, socket->name)) < 0)
+ return err;
+
+ socket->base = ioremap(start, len);
+ if (socket->base == NULL)
+ return -ENODEV;
+
+ socket->dev = dev;
+
+ socket->pcmcia_socket = pcmcia_register_socket(slot, &cardu_operations, 1);
+ if (socket->pcmcia_socket == NULL) {
+ iounmap(socket->base);
+ socket->base = NULL;
+ return -ENOMEM;
+ }
+
+ if (request_irq(dev->irq, cardu_interrupt, SA_SHIRQ, socket->name, socket) < 0) {
+ pcmcia_unregister_socket(socket->pcmcia_socket);
+ socket->pcmcia_socket = NULL;
+ iounmap(socket->base);
+ socket->base = NULL;
+ return -EBUSY;
+ }
+
+ printk(KERN_INFO "%s at %#08lx, IRQ %d\n", socket->name, start, dev->irq);
+
+ return 0;
+}
+
+static int __devinit vrc4173_cardu_setup(char *options)
+{
+ if (options == NULL || *options == '\0')
+ return 0;
+
+ if (strncmp(options, "cardu1:", 7) == 0) {
+ options += 7;
+ if (*options != '\0') {
+ if (strncmp(options, "noprobe", 7) == 0) {
+ cardu_sockets[CARDU1].noprobe = 1;
+ options += 7;
+ }
+
+ if (*options != ',')
+ return 0;
+ } else
+ return 0;
+ }
+
+ if (strncmp(options, "cardu2:", 7) == 0) {
+ options += 7;
+ if ((*options != '\0') && (strncmp(options, "noprobe", 7) == 0))
+ cardu_sockets[CARDU2].noprobe = 1;
+ }
+
+ return 0;
+}
+
+__setup("vrc4173_cardu=", vrc4173_cardu_setup);
+
+static struct pci_device_id vrc4173_cardu_id_table[] __devinitdata = {
+ { .vendor = PCI_VENDOR_ID_NEC,
+ .device = PCI_DEVICE_ID_NEC_NAPCCARD,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID, },
+ {0, }
+};
+
+static struct pci_driver vrc4173_cardu_driver = {
+ .name = "NEC VRC4173 CARDU",
+ .probe = vrc4173_cardu_probe,
+ .id_table = vrc4173_cardu_id_table,
+};
+
+static int __devinit vrc4173_cardu_init(void)
+{
+ vrc4173_cardu_slots = 0;
+
+ return pci_module_init(&vrc4173_cardu_driver);
+}
+
+static void __devexit vrc4173_cardu_exit(void)
+{
+ pci_unregister_driver(&vrc4173_cardu_driver);
+}
+
+module_init(vrc4173_cardu_init);
+module_exit(vrc4173_cardu_exit);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/pcmcia/vrc4173_cardu.h linux-2.4.22/drivers/pcmcia/vrc4173_cardu.h
--- linux-2.4.22.clean/drivers/pcmcia/vrc4173_cardu.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/pcmcia/vrc4173_cardu.h 2003-09-27 14:08:10.000000000 +0200
@@ -0,0 +1,247 @@
+/*
+ * FILE NAME
+ * drivers/pcmcia/vrc4173_cardu.h
+ *
+ * BRIEF MODULE DESCRIPTION
+ * Include file for NEC VRC4173 CARDU.
+ *
+ * Copyright 2002 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+ *
+ * This program 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef _VRC4173_CARDU_H
+#define _VRC4173_CARDU_H
+
+#include <linux/pci.h>
+
+#include <pcmcia/ss.h>
+
+#define CARDU_MAX_SOCKETS 2
+#define CARDU1 0
+#define CARDU2 1
+
+/*
+ * PCI Configuration Registers
+ */
+#define BRGCNT 0x3e
+ #define POST_WR_EN 0x0400
+ #define MEM1_PREF_EN 0x0200
+ #define MEM0_PREF_EN 0x0100
+ #define IREQ_INT 0x0080
+ #define CARD_RST 0x0040
+ #define MABORT_MODE 0x0020
+ #define VGA_EN 0x0008
+ #define ISA_EN 0x0004
+ #define SERR_EN 0x0002
+ #define PERR_EN 0x0001
+
+#define SYSCNT 0x80
+ #define BAD_VCC_REQ_DISB 0x00200000
+ #define PCPCI_EN 0x00080000
+ #define CH_ASSIGN_MASK 0x00070000
+ #define CH_ASSIGN_NODMA 0x00040000
+ #define SUB_ID_WR_EN 0x00000008
+ #define ASYN_INT_MODE 0x00000004
+ #define PCI_CLK_RIN 0x00000002
+
+#define DEVCNT 0x91
+ #define ZOOM_VIDEO_EN 0x40
+ #define SR_PCI_INT_SEL_MASK 0x18
+ #define SR_PCI_INT_SEL_NONE 0x00
+ #define PCI_INT_MODE 0x04
+ #define IRQ_MODE 0x02
+ #define IFG 0x01
+
+#define CHIPCNT 0x9c
+ #define S_PREF_DISB 0x10
+
+#define SERRDIS 0x9f
+ #define SERR_DIS_MAB 0x10
+ #define SERR_DIS_TAB 0x08
+ #define SERR_DIS_DT_PERR 0x04
+
+/*
+ * ExCA Registers
+ */
+#define EXCA_REGS_BASE 0x800
+#define EXCA_REGS_SIZE 0x800
+
+#define ID_REV 0x000
+ #define IF_TYPE_16BIT 0x80
+
+#define IF_STATUS 0x001
+ #define CARD_PWR 0x40
+ #define READY 0x20
+ #define CARD_WP 0x10
+ #define CARD_DETECT2 0x08
+ #define CARD_DETECT1 0x04
+ #define BV_DETECT_MASK 0x03
+ #define BV_DETECT_GOOD 0x03 /* Memory card */
+ #define BV_DETECT_WARN 0x02
+ #define BV_DETECT_BAD1 0x01
+ #define BV_DETECT_BAD0 0x00
+ #define STSCHG 0x02 /* I/O card */
+ #define SPKR 0x01
+
+#define PWR_CNT 0x002
+ #define CARD_OUT_EN 0x80
+ #define VCC_MASK 0x18
+ #define VCC_3V 0x18
+ #define VCC_5V 0x10
+ #define VCC_0V 0x00
+ #define VPP_MASK 0x03
+ #define VPP_12V 0x02
+ #define VPP_VCC 0x01
+ #define VPP_0V 0x00
+
+#define INT_GEN_CNT 0x003
+ #define CARD_REST0 0x40
+ #define CARD_TYPE_MASK 0x20
+ #define CARD_TYPE_IO 0x20
+ #define CARD_TYPE_MEM 0x00
+
+#define CARD_SC 0x004
+ #define CARD_DT_CHG 0x08
+ #define RDY_CHG 0x04
+ #define BAT_WAR_CHG 0x02
+ #define BAT_DEAD_ST_CHG 0x01
+
+#define CARD_SCI 0x005
+ #define CARD_DT_EN 0x08
+ #define RDY_EN 0x04
+ #define BAT_WAR_EN 0x02
+ #define BAT_DEAD_EN 0x01
+
+#define ADR_WIN_EN 0x006
+ #define IO_WIN_EN(x) (0x40 << (x))
+ #define MEM_WIN_EN(x) (0x01 << (x))
+
+#define IO_WIN_CNT 0x007
+ #define IO_WIN_CNT_MASK(x) (0x03 << ((x) << 2))
+ #define IO_WIN_DATA_AUTOSZ(x) (0x02 << ((x) << 2))
+ #define IO_WIN_DATA_16BIT(x) (0x01 << ((x) << 2))
+
+#define IO_WIN_SA(x) (0x008 + ((x) << 2))
+#define IO_WIN_EA(x) (0x00a + ((x) << 2))
+
+#define MEM_WIN_SA(x) (0x010 + ((x) << 3))
+ #define MEM_WIN_DSIZE 0x8000
+
+#define MEM_WIN_EA(x) (0x012 + ((x) << 3))
+
+#define MEM_WIN_OA(x) (0x014 + ((x) << 3))
+ #define MEM_WIN_WP 0x8000
+ #define MEM_WIN_REGSET 0x4000
+
+#define GEN_CNT 0x016
+ #define VS2_STATUS 0x80
+ #define VS1_STATUS 0x40
+ #define EXCA_REG_RST_EN 0x02
+
+#define GLO_CNT 0x01e
+ #define FUN_INT_LEV 0x08
+ #define INT_WB_CLR 0x04
+ #define CSC_INT_LEV 0x02
+
+#define IO_WIN_OAL(x) (0x036 + ((x) << 1))
+#define IO_WIN_OAH(x) (0x037 + ((x) << 1))
+
+#define MEM_WIN_SAU(x) (0x040 + (x))
+
+#define IO_SETUP_TIM 0x080
+#define IO_CMD_TIM 0x081
+#define IO_HOLD_TIM 0x082
+#define MEM_SETUP_TIM(x) (0x084 + ((x) << 2))
+#define MEM_CMD_TIM(x) (0x085 + ((x) << 2))
+#define MEM_HOLD_TIM(x) (0x086 + ((x) << 2))
+ #define TIM_CLOCKS(x) ((x) - 1)
+
+#define MEM_TIM_SEL1 0x08c
+#define MEM_TIM_SEL2 0x08d
+ #define MEM_WIN_TIMSEL1(x) (0x03 << (((x) & 3) << 1))
+
+#define MEM_WIN_PWEN 0x091
+ #define POSTWEN 0x01
+
+/*
+ * CardBus Socket Registers
+ */
+#define CARDBUS_SOCKET_REGS_BASE 0x000
+#define CARDBUS_SOCKET_REGS_SIZE 0x800
+
+#define SKT_EV 0x000
+ #define POW_CYC_EV 0x00000008
+ #define CCD2_EV 0x00000004
+ #define CCD1_EV 0x00000002
+ #define CSTSCHG_EV 0x00000001
+
+#define SKT_MASK 0x004
+ #define POW_CYC_MASK 0x00000008
+ #define CCD_MASK 0x00000006
+ #define CSC_MASK 0x00000001
+
+#define SKT_PRE_STATE 0x008
+#define SKT_FORCE_EV 0x00c
+ #define VOL_3V_SKT 0x20000000
+ #define VOL_5V_SKT 0x10000000
+ #define CVS_TEST 0x00004000
+ #define VOL_YV_CARD_DT 0x00002000
+ #define VOL_XV_CARD_DT 0x00001000
+ #define VOL_3V_CARD_DT 0x00000800
+ #define VOL_5V_CARD_DT 0x00000400
+ #define BAD_VCC_REQ 0x00000200
+ #define DATA_LOST 0x00000100
+ #define NOT_A_CARD 0x00000080
+ #define CREADY 0x00000040
+ #define CB_CARD_DT 0x00000020
+ #define R2_CARD_DT 0x00000010
+ #define POW_UP 0x00000008
+ #define CCD20 0x00000004
+ #define CCD10 0x00000002
+ #define CSTSCHG 0x00000001
+
+#define SKT_CNT 0x010
+ #define STP_CLK_EN 0x00000080
+ #define VCC_CNT_MASK 0x00000070
+ #define VCC_CNT_3V 0x00000030
+ #define VCC_CNT_5V 0x00000020
+ #define VCC_CNT_0V 0x00000000
+ #define VPP_CNT_MASK 0x00000007
+ #define VPP_CNT_3V 0x00000003
+ #define VPP_CNT_5V 0x00000002
+ #define VPP_CNT_12V 0x00000001
+ #define VPP_CNT_0V 0x00000000
+
+typedef struct vrc4173_socket {
+ int noprobe;
+ struct pci_dev *dev;
+ void *base;
+ void (*handler)(void *, unsigned int);
+ void *info;
+ socket_cap_t cap;
+ spinlock_t event_lock;
+ uint16_t events;
+ struct socket_info_t *pcmcia_socket;
+ struct tq_struct tq_task;
+ char name[20];
+} vrc4173_socket_t;
+
+#endif /* _VRC4173_CARDU_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/scsi/NCR53C9x.c linux-2.4.22/drivers/scsi/NCR53C9x.c
--- linux-2.4.22.clean/drivers/scsi/NCR53C9x.c 2002-11-29 00:53:14.000000000 +0100
+++ linux-2.4.22/drivers/scsi/NCR53C9x.c 2002-11-25 13:18:58.000000000 +0100
@@ -917,7 +917,7 @@
if (esp->dma_mmu_get_scsi_one)
esp->dma_mmu_get_scsi_one(esp, sp);
else
- sp->SCp.have_data_in = (int) sp->SCp.ptr =
+ sp->SCp.ptr =
(char *) virt_to_phys(sp->request_buffer);
} else {
sp->SCp.buffer = (struct scatterlist *) sp->buffer;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/scsi/NCR53C9x.h linux-2.4.22/drivers/scsi/NCR53C9x.h
--- linux-2.4.22.clean/drivers/scsi/NCR53C9x.h 2001-09-14 23:40:00.000000000 +0200
+++ linux-2.4.22/drivers/scsi/NCR53C9x.h 2002-07-24 19:55:47.000000000 +0200
@@ -144,12 +144,7 @@
#ifndef MULTIPLE_PAD_SIZES
-#ifdef CONFIG_CPU_HAS_WB
-#include <asm/wbflush.h>
-#define esp_write(__reg, __val) do{(__reg) = (__val); wbflush();} while(0)
-#else
-#define esp_write(__reg, __val) ((__reg) = (__val))
-#endif
+#define esp_write(__reg, __val) do{(__reg) = (__val); iob();} while(0)
#define esp_read(__reg) (__reg)
struct ESP_regs {
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/scsi/sgiwd93.c linux-2.4.22/drivers/scsi/sgiwd93.c
--- linux-2.4.22.clean/drivers/scsi/sgiwd93.c 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/scsi/sgiwd93.c 2003-09-27 17:15:25.000000000 +0200
@@ -13,6 +13,7 @@
*
*/
#include <linux/init.h>
+#include <linux/interrupt.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/blk.h>
@@ -37,13 +38,19 @@
#include <linux/stat.h>
+#if 0
+#define DPRINTK(args...) printk(args)
+#else
+#define DPRINTK(args...)
+#endif
+
struct hpc_chunk {
struct hpc_dma_desc desc;
u32 _padding; /* align to quadword boundary */
};
-struct Scsi_Host *sgiwd93_host = NULL;
-struct Scsi_Host *sgiwd93_host1 = NULL;
+struct Scsi_Host *sgiwd93_host;
+struct Scsi_Host *sgiwd93_host1;
/* Wuff wuff, wuff, wd33c93.c, wuff wuff, object oriented, bow wow. */
static inline void write_wd33c93_count(const wd33c93_regs regs,
@@ -79,10 +86,8 @@
spin_unlock_irqrestore(&io_request_lock, flags);
}
-#undef DEBUG_DMA
-
static inline
-void fill_hpc_entries (struct hpc_chunk **hcp, char *addr, unsigned long len)
+void fill_hpc_entries(struct hpc_chunk **hcp, char *addr, unsigned long len)
{
unsigned long physaddr;
unsigned long count;
@@ -104,48 +109,47 @@
static int dma_setup(Scsi_Cmnd *cmd, int datainp)
{
- struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)cmd->host->hostdata;
- struct hpc3_scsiregs *hregs = (struct hpc3_scsiregs *) cmd->host->base;
+ struct WD33C93_hostdata *hdata =
+ (struct WD33C93_hostdata *) cmd->host->hostdata;
+ struct hpc3_scsiregs *hregs =
+ (struct hpc3_scsiregs *) cmd->host->base;
struct hpc_chunk *hcp = (struct hpc_chunk *) hdata->dma_bounce_buffer;
-#ifdef DEBUG_DMA
- printk("dma_setup: datainp<%d> hcp<%p> ",
- datainp, hcp);
-#endif
+ DPRINTK("dma_setup: datainp<%d> hcp<%p> ", datainp, hcp);
hdata->dma_dir = datainp;
/*
- * wd33c93 shouldn't pass us bogus dma_setups, but
- * it does:-( The other wd33c93 drivers deal with
- * it the same way (which isn't that obvious).
- * IMHO a better fix would be, not to do these
- * dma setups in the first place
+ * wd33c93 shouldn't pass us bogus dma_setups, but it does:-( The
+ * other wd33c93 drivers deal with it the same way (which isn't that
+ * obvious). IMHO a better fix would be, not to do these dma setups
+ * in the first place.
*/
if (cmd->SCp.ptr == NULL || cmd->SCp.this_residual == 0)
return 1;
- fill_hpc_entries (&hcp, cmd->SCp.ptr, cmd->SCp.this_residual);
+ fill_hpc_entries(&hcp, cmd->SCp.ptr, cmd->SCp.this_residual);
- /* To make sure, if we trip an HPC bug, that we transfer
- * every single byte, we tag on an extra zero length dma
- * descriptor at the end of the chain.
+ /*
+ * To make sure, if we trip an HPC bug, that we transfer every single
+ * byte, we tag on an extra zero length dma descriptor at the end of
+ * the chain.
*/
hcp->desc.pbuf = 0;
- hcp->desc.cntinfo = (HPCDMA_EOX);
+ hcp->desc.cntinfo = HPCDMA_EOX;
-#ifdef DEBUG_DMA
- printk(" HPCGO\n");
-#endif
+ DPRINTK(" HPCGO\n");
/* Start up the HPC. */
hregs->ndptr = PHYSADDR(hdata->dma_bounce_buffer);
- if(datainp) {
- dma_cache_inv((unsigned long) cmd->SCp.ptr, cmd->SCp.this_residual);
- hregs->ctrl = (HPC3_SCTRL_ACTIVE);
+ if (datainp) {
+ dma_cache_inv((unsigned long) cmd->SCp.ptr,
+ cmd->SCp.this_residual);
+ hregs->ctrl = HPC3_SCTRL_ACTIVE;
} else {
- dma_cache_wback_inv((unsigned long) cmd->SCp.ptr, cmd->SCp.this_residual);
- hregs->ctrl = (HPC3_SCTRL_ACTIVE | HPC3_SCTRL_DIR);
+ dma_cache_wback_inv((unsigned long) cmd->SCp.ptr,
+ cmd->SCp.this_residual);
+ hregs->ctrl = HPC3_SCTRL_ACTIVE | HPC3_SCTRL_DIR;
}
return 0;
@@ -154,7 +158,8 @@
static void dma_stop(struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
int status)
{
- struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)instance->hostdata;
+ struct WD33C93_hostdata *hdata =
+ (struct WD33C93_hostdata *) instance->hostdata;
struct hpc3_scsiregs *hregs;
if (!SCpnt)
@@ -162,21 +167,17 @@
hregs = (struct hpc3_scsiregs *) SCpnt->host->base;
-#ifdef DEBUG_DMA
- printk("dma_stop: status<%d> ", status);
-#endif
+ DPRINTK("dma_stop: status<%d> ", status);
/* First stop the HPC and flush it's FIFO. */
- if(hdata->dma_dir) {
+ if (hdata->dma_dir) {
hregs->ctrl |= HPC3_SCTRL_FLUSH;
- while(hregs->ctrl & HPC3_SCTRL_ACTIVE)
+ while (hregs->ctrl & HPC3_SCTRL_ACTIVE)
barrier();
}
hregs->ctrl = 0;
-#ifdef DEBUG_DMA
- printk("\n");
-#endif
+ DPRINTK("\n");
}
void sgiwd93_reset(unsigned long base)
@@ -184,7 +185,7 @@
struct hpc3_scsiregs *hregs = (struct hpc3_scsiregs *) base;
hregs->ctrl = HPC3_SCTRL_CRESET;
- udelay (50);
+ udelay(50);
hregs->ctrl = 0;
}
@@ -195,8 +196,8 @@
start = (unsigned long) buf;
end = start + PAGE_SIZE;
- while(start < end) {
- hcp->desc.pnext = PHYSADDR((hcp + 1));
+ while (start < end) {
+ hcp->desc.pnext = PHYSADDR(hcp + 1);
hcp->desc.cntinfo = HPCDMA_EOX;
hcp++;
start += sizeof(struct hpc_chunk);
@@ -208,95 +209,77 @@
dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
}
-int __init sgiwd93_detect(Scsi_Host_Template *SGIblows)
+static struct Scsi_Host * __init sgiwd93_setup_scsi(
+ Scsi_Host_Template *SGIblows, int unit, int irq,
+ struct hpc3_scsiregs *hregs, unsigned char *wdregs)
{
- static unsigned char called = 0;
- struct hpc3_scsiregs *hregs = &hpc3c0->scsi_chan0;
- struct hpc3_scsiregs *hregs1 = &hpc3c0->scsi_chan1;
struct WD33C93_hostdata *hdata;
- struct WD33C93_hostdata *hdata1;
+ struct Scsi_Host *host;
wd33c93_regs regs;
uchar *buf;
-
- if(called)
- return 0; /* Should bitch on the console about this... */
- SGIblows->proc_name = "SGIWD93";
+ host = scsi_register(SGIblows, sizeof(struct WD33C93_hostdata));
+ if (!host)
+ return NULL;
- sgiwd93_host = scsi_register(SGIblows, sizeof(struct WD33C93_hostdata));
- if(sgiwd93_host == NULL)
- return 0;
- sgiwd93_host->base = (unsigned long) hregs;
- sgiwd93_host->irq = SGI_WD93_0_IRQ;
+ host->base = (unsigned long) hregs;
+ host->irq = irq;
buf = (uchar *) get_zeroed_page(GFP_KERNEL);
if (!buf) {
- printk(KERN_WARNING "sgiwd93: Could not allocate memory for host0 buffer.\n");
- scsi_unregister(sgiwd93_host);
- return 0;
+ printk(KERN_WARNING "sgiwd93: Could not allocate memory for "
+ "host %d buffer.\n", unit);
+ goto out_unregister;
}
init_hpc_chain(buf);
-
- /* HPC_SCSI_REG0 | 0x03 | KSEG1 */
- regs.SASR = (unsigned char*) KSEG1ADDR (0x1fbc0003);
- regs.SCMD = (unsigned char*) KSEG1ADDR (0x1fbc0007);
- wd33c93_init(sgiwd93_host, regs, dma_setup, dma_stop, WD33C93_FS_16_20);
- hdata = (struct WD33C93_hostdata *)sgiwd93_host->hostdata;
+ regs.SASR = wdregs + 3;
+ regs.SCMD = wdregs + 7;
+
+ wd33c93_init(host, regs, dma_setup, dma_stop, WD33C93_FS_16_20);
+
+ hdata = (struct WD33C93_hostdata *) host->hostdata;
hdata->no_sync = 0;
- hdata->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
+ hdata->dma_bounce_buffer = (uchar *) KSEG1ADDR(buf);
- if (request_irq(SGI_WD93_0_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host)) {
- printk(KERN_WARNING "sgiwd93: Could not register IRQ %d (for host 0).\n", SGI_WD93_0_IRQ);
-#ifdef MODULE
- wd33c93_release();
-#endif
- free_page((unsigned long)buf);
- scsi_unregister(sgiwd93_host);
- return 0;
+ if (request_irq(irq, sgiwd93_intr, 0, "SGI WD93", (void *) host)) {
+ printk(KERN_WARNING "sgiwd93: Could not register irq %d "
+ "for host %d.\n", irq, unit);
+ goto out_free;
}
- /* set up second controller on the Indigo2 */
- if(ip22_is_fullhouse()) {
- sgiwd93_host1 = scsi_register(SGIblows, sizeof(struct WD33C93_hostdata));
- if(sgiwd93_host1 != NULL)
- {
- sgiwd93_host1->base = (unsigned long) hregs1;
- sgiwd93_host1->irq = SGI_WD93_1_IRQ;
-
- buf = (uchar *) get_zeroed_page(GFP_KERNEL);
- if (!buf) {
- printk(KERN_WARNING "sgiwd93: Could not allocate memory for host1 buffer.\n");
- scsi_unregister(sgiwd93_host1);
- called = 1;
- return 1; /* We registered host0 so return success*/
- }
- init_hpc_chain(buf);
-
- /* HPC_SCSI_REG1 | 0x03 | KSEG1 */
- regs.SASR = (unsigned char*) KSEG1ADDR(0x1fbc8003);
- regs.SCMD = (unsigned char*) KSEG1ADDR(0x1fbc8007);
- wd33c93_init(sgiwd93_host1, regs, dma_setup, dma_stop,
- WD33C93_FS_16_20);
-
- hdata1 = (struct WD33C93_hostdata *)sgiwd93_host1->hostdata;
- hdata1->no_sync = 0;
- hdata1->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
-
- if (request_irq(SGI_WD93_1_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host1)) {
- printk(KERN_WARNING "sgiwd93: Could not allocate irq %d (for host1).\n", SGI_WD93_1_IRQ);
-#ifdef MODULE
- wd33c93_release();
-#endif
- free_page((unsigned long)buf);
- scsi_unregister(sgiwd93_host1);
- /* Fall through since host0 registered OK */
- }
- }
+ return host;
+
+out_free:
+ free_page((unsigned long)buf);
+ wd33c93_release();
+
+out_unregister:
+ scsi_unregister(host);
+
+ return NULL;
+}
+
+int __init sgiwd93_detect(Scsi_Host_Template *SGIblows)
+{
+ int found = 0;
+
+ SGIblows->proc_name = "SGIWD93";
+ sgiwd93_host = sgiwd93_setup_scsi(SGIblows, 0, SGI_WD93_0_IRQ,
+ &hpc3c0->scsi_chan0,
+ (unsigned char *)hpc3c0->scsi0_ext);
+ if (sgiwd93_host)
+ found++;
+
+ /* Set up second controller on the Indigo2 */
+ if (ip22_is_fullhouse()) {
+ sgiwd93_host1 = sgiwd93_setup_scsi(SGIblows, 1, SGI_WD93_1_IRQ,
+ &hpc3c0->scsi_chan1,
+ (unsigned char *)hpc3c0->scsi1_ext);
+ if (sgiwd93_host1)
+ found++;
}
-
- called = 1;
- return 1; /* Found one. */
+ return found;
}
#define HOSTS_C
@@ -313,7 +296,7 @@
free_irq(SGI_WD93_0_IRQ, sgiwd93_intr);
free_page(KSEG0ADDR(hdata->dma_bounce_buffer));
wd33c93_release();
- if(ip22_is_fullhouse()) {
+ if (ip22_is_fullhouse()) {
free_irq(SGI_WD93_1_IRQ, sgiwd93_intr);
free_page(KSEG0ADDR(hdata1->dma_bounce_buffer));
wd33c93_release();
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/sound/au1000.c linux-2.4.22/drivers/sound/au1000.c
--- linux-2.4.22.clean/drivers/sound/au1000.c 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/sound/au1000.c 2003-09-27 14:08:57.000000000 +0200
@@ -2027,7 +2027,7 @@
s->codec = ac97_alloc_codec();
if(s->codec == NULL)
{
- error("Out of memory");
+ err("Out of memory");
return -1;
}
s->codec->private_data = s;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/sound/nec_vrc5477.c linux-2.4.22/drivers/sound/nec_vrc5477.c
--- linux-2.4.22.clean/drivers/sound/nec_vrc5477.c 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/sound/nec_vrc5477.c 2003-09-27 14:09:06.000000000 +0200
@@ -1965,7 +1965,7 @@
return -1;
}
-static void __devinit vrc5477_ac97_remove(struct pci_dev *dev)
+static void __devexit vrc5477_ac97_remove(struct pci_dev *dev)
{
struct vrc5477_ac97_state *s = pci_get_drvdata(dev);
@@ -2001,7 +2001,7 @@
name: VRC5477_AC97_MODULE_NAME,
id_table: id_table,
probe: vrc5477_ac97_probe,
- remove: vrc5477_ac97_remove
+ remove: __devexit_p(vrc5477_ac97_remove)
};
static int __init init_vrc5477_ac97(void)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/sound/trident.c linux-2.4.22/drivers/sound/trident.c
--- linux-2.4.22.clean/drivers/sound/trident.c 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/sound/trident.c 2003-09-27 14:09:07.000000000 +0200
@@ -66,7 +66,7 @@
* with nothing in between.
* v0.14.10a
* June 21 2002 Muli Ben-Yehuda <mulix@actcom.co.il>
- * use a debug macro instead of #ifdef CONFIG_DEBUG, trim to 80 columns
+ * use a debug macro instead of #ifdef CONFIG_RUNTIME_DEBUG, trim to 80 columns
* per line, use 'do {} while (0)' in statement macros.
* v0.14.10
* June 6 2002 Lei Hu <Lei_hu@ali.com.tw>
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/video/bt431.h linux-2.4.22/drivers/video/bt431.h
--- linux-2.4.22.clean/drivers/video/bt431.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/video/bt431.h 2003-09-23 14:10:50.000000000 +0200
@@ -0,0 +1,236 @@
+/*
+ * linux/drivers/video/bt431.h
+ *
+ * Copyright 2003 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License. See the file COPYING in the main directory of this
+ * archive for more details.
+ */
+#include <linux/types.h>
+#include <asm/system.h>
+
+/*
+ * Bt431 cursor generator registers, 32-bit aligned.
+ * Two twin Bt431 are used on the DECstation's PMAG-AA.
+ */
+struct bt431_regs {
+ volatile u16 addr_lo;
+ u16 pad0;
+ volatile u16 addr_hi;
+ u16 pad1;
+ volatile u16 addr_cmap;
+ u16 pad2;
+ volatile u16 addr_reg;
+ u16 pad3;
+};
+
+static inline u16 bt431_set_value(u8 val)
+{
+ return ((val << 8) | (val & 0xff)) & 0xffff;
+}
+
+static inline u8 bt431_get_value(u16 val)
+{
+ return val & 0xff;
+}
+
+/*
+ * Additional registers addressed indirectly.
+ */
+#define BT431_REG_CMD 0x0000
+#define BT431_REG_CXLO 0x0001
+#define BT431_REG_CXHI 0x0002
+#define BT431_REG_CYLO 0x0003
+#define BT431_REG_CYHI 0x0004
+#define BT431_REG_WXLO 0x0005
+#define BT431_REG_WXHI 0x0006
+#define BT431_REG_WYLO 0x0007
+#define BT431_REG_WYHI 0x0008
+#define BT431_REG_WWLO 0x0009
+#define BT431_REG_WWHI 0x000a
+#define BT431_REG_WHLO 0x000b
+#define BT431_REG_WHHI 0x000c
+
+#define BT431_REG_CRAM_BASE 0x0000
+#define BT431_REG_CRAM_END 0x01ff
+
+/*
+ * Command register.
+ */
+#define BT431_CMD_CURS_ENABLE 0x40
+#define BT431_CMD_XHAIR_ENABLE 0x20
+#define BT431_CMD_OR_CURSORS 0x10
+#define BT431_CMD_AND_CURSORS 0x00
+#define BT431_CMD_1_1_MUX 0x00
+#define BT431_CMD_4_1_MUX 0x04
+#define BT431_CMD_5_1_MUX 0x08
+#define BT431_CMD_xxx_MUX 0x0c
+#define BT431_CMD_THICK_1 0x00
+#define BT431_CMD_THICK_3 0x01
+#define BT431_CMD_THICK_5 0x02
+#define BT431_CMD_THICK_7 0x03
+
+static inline void bt431_select_reg(struct bt431_regs *regs, int ir)
+{
+ /*
+ * The compiler splits the write in two bytes without these
+ * helper variables.
+ */
+ volatile u16 *lo = &(regs->addr_lo);
+ volatile u16 *hi = &(regs->addr_hi);
+
+ mb();
+ *lo = bt431_set_value(ir & 0xff);
+ wmb();
+ *hi = bt431_set_value((ir >> 8) & 0xff);
+}
+
+/* Autoincrement read/write. */
+static inline u8 bt431_read_reg_inc(struct bt431_regs *regs)
+{
+ /*
+ * The compiler splits the write in two bytes without the
+ * helper variable.
+ */
+ volatile u16 *r = &(regs->addr_reg);
+
+ mb();
+ return bt431_get_value(*r);
+}
+
+static inline void bt431_write_reg_inc(struct bt431_regs *regs, u8 value)
+{
+ /*
+ * The compiler splits the write in two bytes without the
+ * helper variable.
+ */
+ volatile u16 *r = &(regs->addr_reg);
+
+ mb();
+ *r = bt431_set_value(value);
+}
+
+static inline u8 bt431_read_reg(struct bt431_regs *regs, int ir)
+{
+ bt431_select_reg(regs, ir);
+ return bt431_read_reg_inc(regs);
+}
+
+static inline void bt431_write_reg(struct bt431_regs *regs, int ir, u8 value)
+{
+ bt431_select_reg(regs, ir);
+ bt431_write_reg_inc(regs, value);
+}
+
+/* Autoincremented read/write for the cursor map. */
+static inline u16 bt431_read_cmap_inc(struct bt431_regs *regs)
+{
+ /*
+ * The compiler splits the write in two bytes without the
+ * helper variable.
+ */
+ volatile u16 *r = &(regs->addr_cmap);
+
+ mb();
+ return *r;
+}
+
+static inline void bt431_write_cmap_inc(struct bt431_regs *regs, u16 value)
+{
+ /*
+ * The compiler splits the write in two bytes without the
+ * helper variable.
+ */
+ volatile u16 *r = &(regs->addr_cmap);
+
+ mb();
+ *r = value;
+}
+
+static inline u16 bt431_read_cmap(struct bt431_regs *regs, int cr)
+{
+ bt431_select_reg(regs, cr);
+ return bt431_read_cmap_inc(regs);
+}
+
+static inline void bt431_write_cmap(struct bt431_regs *regs, int cr, u16 value)
+{
+ bt431_select_reg(regs, cr);
+ bt431_write_cmap_inc(regs, value);
+}
+
+static inline void bt431_enable_cursor(struct bt431_regs *regs)
+{
+ bt431_write_reg(regs, BT431_REG_CMD,
+ BT431_CMD_CURS_ENABLE | BT431_CMD_OR_CURSORS
+ | BT431_CMD_4_1_MUX | BT431_CMD_THICK_1);
+}
+
+static inline void bt431_erase_cursor(struct bt431_regs *regs)
+{
+ bt431_write_reg(regs, BT431_REG_CMD, BT431_CMD_4_1_MUX);
+}
+
+static inline void bt431_position_cursor(struct bt431_regs *regs, u16 x, u16 y)
+{
+ /*
+ * Magic from the MACH sources.
+ *
+ * Cx = x + D + H - P
+ * P = 37 if 1:1, 52 if 4:1, 57 if 5:1
+ * D = pixel skew between outdata and external data
+ * H = pixels between HSYNCH falling and active video
+ *
+ * Cy = y + V - 32
+ * V = scanlines between HSYNCH falling, two or more
+ * clocks after VSYNCH falling, and active video
+ */
+ x += 412 - 52;
+ y += 68 - 32;
+
+ /* Use autoincrement. */
+ bt431_select_reg(regs, BT431_REG_CXLO);
+ bt431_write_reg_inc(regs, x & 0xff); /* BT431_REG_CXLO */
+ bt431_write_reg_inc(regs, (x >> 8) & 0x0f); /* BT431_REG_CXHI */
+ bt431_write_reg_inc(regs, y & 0xff); /* BT431_REG_CYLO */
+ bt431_write_reg_inc(regs, (y >> 8) & 0x0f); /* BT431_REG_CYHI */
+}
+
+static inline void bt431_set_font(struct bt431_regs *regs, u8 fgc,
+ u16 width, u16 height)
+{
+ int i;
+ u16 fgp = fgc ? 0xffff : 0x0000;
+ u16 bgp = fgc ? 0x0000 : 0xffff;
+
+ bt431_select_reg(regs, BT431_REG_CRAM_BASE);
+ for (i = BT431_REG_CRAM_BASE; i <= BT431_REG_CRAM_END; i++) {
+ u16 value;
+
+ if (height << 6 <= i << 3)
+ value = bgp;
+ else if (width <= i % 8 << 3)
+ value = bgp;
+ else if (((width >> 3) & 0xffff) > i % 8)
+ value = fgp;
+ else
+ value = fgp & ~(bgp << (width % 8 << 1));
+
+ bt431_write_cmap_inc(regs, value);
+ }
+}
+
+static inline void bt431_init_cursor(struct bt431_regs *regs)
+{
+ /* no crosshair window */
+ bt431_select_reg(regs, BT431_REG_WXLO);
+ bt431_write_reg_inc(regs, 0x00); /* BT431_REG_WXLO */
+ bt431_write_reg_inc(regs, 0x00); /* BT431_REG_WXHI */
+ bt431_write_reg_inc(regs, 0x00); /* BT431_REG_WYLO */
+ bt431_write_reg_inc(regs, 0x00); /* BT431_REG_WYHI */
+ bt431_write_reg_inc(regs, 0x00); /* BT431_REG_WWLO */
+ bt431_write_reg_inc(regs, 0x00); /* BT431_REG_WWHI */
+ bt431_write_reg_inc(regs, 0x00); /* BT431_REG_WHLO */
+ bt431_write_reg_inc(regs, 0x00); /* BT431_REG_WHHI */
+}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/video/bt455.h linux-2.4.22/drivers/video/bt455.h
--- linux-2.4.22.clean/drivers/video/bt455.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/video/bt455.h 2003-09-23 14:10:50.000000000 +0200
@@ -0,0 +1,95 @@
+/*
+ * linux/drivers/video/bt455.h
+ *
+ * Copyright 2003 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License. See the file COPYING in the main directory of this
+ * archive for more details.
+ */
+#include <linux/types.h>
+#include <asm/system.h>
+
+/*
+ * Bt455 byte-wide registers, 32-bit aligned.
+ */
+struct bt455_regs {
+ volatile u8 addr_cmap;
+ u8 pad0[3];
+ volatile u8 addr_cmap_data;
+ u8 pad1[3];
+ volatile u8 addr_clr;
+ u8 pad2[3];
+ volatile u8 addr_ovly;
+ u8 pad3[3];
+};
+
+static inline void bt455_select_reg(struct bt455_regs *regs, int ir)
+{
+ mb();
+ regs->addr_cmap = ir & 0x0f;
+}
+
+/*
+ * Read/write to a Bt455 color map register.
+ */
+static inline void bt455_read_cmap_entry(struct bt455_regs *regs, int cr,
+ u8* red, u8* green, u8* blue)
+{
+ bt455_select_reg(regs, cr);
+ mb();
+ *red = regs->addr_cmap_data & 0x0f;
+ rmb();
+ *green = regs->addr_cmap_data & 0x0f;
+ rmb();
+ *blue = regs->addr_cmap_data & 0x0f;
+}
+
+static inline void bt455_write_cmap_entry(struct bt455_regs *regs, int cr,
+ u8 red, u8 green, u8 blue)
+{
+ bt455_select_reg(regs, cr);
+ wmb();
+ regs->addr_cmap_data = red & 0x0f;
+ wmb();
+ regs->addr_cmap_data = green & 0x0f;
+ wmb();
+ regs->addr_cmap_data = blue & 0x0f;
+}
+
+static inline void bt455_write_ovly_entry(struct bt455_regs *regs, int cr,
+ u8 red, u8 green, u8 blue)
+{
+ bt455_select_reg(regs, cr);
+ wmb();
+ regs->addr_ovly = red & 0x0f;
+ wmb();
+ regs->addr_ovly = green & 0x0f;
+ wmb();
+ regs->addr_ovly = blue & 0x0f;
+}
+
+static inline void bt455_set_cursor(struct bt455_regs *regs)
+{
+ mb();
+ regs->addr_ovly = 0x0f;
+ wmb();
+ regs->addr_ovly = 0x0f;
+ wmb();
+ regs->addr_ovly = 0x0f;
+}
+
+static inline void bt455_erase_cursor(struct bt455_regs *regs)
+{
+ /* bt455_write_cmap_entry(regs, 8, 0x00, 0x00, 0x00); */
+ /* bt455_write_cmap_entry(regs, 9, 0x00, 0x00, 0x00); */
+ bt455_write_ovly_entry(regs, 8, 0x03, 0x03, 0x03);
+ bt455_write_ovly_entry(regs, 9, 0x07, 0x07, 0x07);
+
+ wmb();
+ regs->addr_ovly = 0x09;
+ wmb();
+ regs->addr_ovly = 0x09;
+ wmb();
+ regs->addr_ovly = 0x09;
+}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/video/Config.in linux-2.4.22/drivers/video/Config.in
--- linux-2.4.22.clean/drivers/video/Config.in 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/video/Config.in 2003-09-27 14:09:26.000000000 +0200
@@ -218,6 +218,7 @@
tristate ' HD64461 Frame Buffer support' CONFIG_FB_HIT
fi
if [ "$CONFIG_DECSTATION" = "y" ]; then
+ dep_bool ' PMAG-AA TURBOchannel framebuffer support' CONFIG_FB_PMAG_AA $CONFIG_TC
dep_bool ' PMAG-BA TURBOchannel framebuffer support' CONFIG_FB_PMAG_BA $CONFIG_TC
dep_bool ' PMAGB-B TURBOchannel framebuffer support' CONFIG_FB_PMAGB_B $CONFIG_TC
dep_bool ' Maxine (Personal DECstation) onboard framebuffer support' CONFIG_FB_MAXINE $CONFIG_TC
@@ -296,8 +297,9 @@
"$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \
"$CONFIG_FB_SGIVW" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \
"$CONFIG_FB_SA1100" = "y" -o "$CONFIG_FB_3DFX" = "y" -o \
- "$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \
- "$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \
+ "$CONFIG_FB_PMAG_AA" = "y" -o "$CONFIG_FB_PMAG_BA" = "y" -o \
+ "$CONFIG_FB_PMAGB_B" = "y" -o "$CONFIG_FB_MAXINE" = "y" -o \
+ "$CONFIG_FB_TX3912" = "y" -o \
"$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" -o \
"$CONFIG_FB_STI" = "y" -o "$CONFIG_FB_HP300" = "y" -o \
"$CONFIG_FB_INTEL" = "y" ]; then
@@ -318,8 +320,9 @@
"$CONFIG_FB_P9100" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \
"$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_3DFX" = "m" -o \
"$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_CYBER2000" = "m" -o \
- "$CONFIG_FB_PMAG_BA" = "m" -o "$CONFIG_FB_PMAGB_B" = "m" -o \
- "$CONFIG_FB_MAXINE" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \
+ "$CONFIG_FB_PMAG_AA" = "m" -o "$CONFIG_FB_PMAG_BA" = "m" -o \
+ "$CONFIG_FB_PMAGB_B" = "m" -o "$CONFIG_FB_MAXINE" = "m" -o \
+ "$CONFIG_FB_RADEON" = "m" -o \
"$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_SIS" = "m" -o \
"$CONFIG_FB_TX3912" = "m" -o "$CONFIG_FB_NEOMAGIC" = "m" -o \
"$CONFIG_FB_STI" = "m" -o "$CONFIG_FB_INTEL" = "m" ]; then
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/video/fbmem.c linux-2.4.22/drivers/video/fbmem.c
--- linux-2.4.22.clean/drivers/video/fbmem.c 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/video/fbmem.c 2003-09-27 14:09:27.000000000 +0200
@@ -124,9 +124,10 @@
extern int sisfb_setup(char*);
extern int stifb_init(void);
extern int stifb_setup(char*);
+extern int pmagaafb_init(void);
extern int pmagbafb_init(void);
extern int pmagbbfb_init(void);
-extern void maxinefb_init(void);
+extern int maxinefb_init(void);
extern int tx3912fb_init(void);
extern int radeonfb_init(void);
extern int radeonfb_setup(char*);
@@ -313,6 +314,9 @@
#ifdef CONFIG_FB_PVR2
{ "pvr2", pvr2fb_init, pvr2fb_setup },
#endif
+#ifdef CONFIG_FB_PMAG_AA
+ { "pmagaafb", pmagaafb_init, NULL },
+#endif
#ifdef CONFIG_FB_PMAG_BA
{ "pmagbafb", pmagbafb_init, NULL },
#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/video/Makefile linux-2.4.22/drivers/video/Makefile
--- linux-2.4.22.clean/drivers/video/Makefile 2003-08-25 13:44:42.000000000 +0200
+++ linux-2.4.22/drivers/video/Makefile 2003-09-27 14:09:26.000000000 +0200
@@ -81,6 +81,7 @@
obj-$(CONFIG_FB_CGFOURTEEN) += cgfourteenfb.o sbusfb.o
obj-$(CONFIG_FB_P9100) += p9100fb.o sbusfb.o
obj-$(CONFIG_FB_LEO) += leofb.o sbusfb.o
+obj-$(CONFIG_FB_PMAG_AA) += pmag-aa-fb.o
obj-$(CONFIG_FB_PMAG_BA) += pmag-ba-fb.o
obj-$(CONFIG_FB_PMAGB_B) += pmagb-b-fb.o
obj-$(CONFIG_FB_MAXINE) += maxinefb.o
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/drivers/video/pmag-aa-fb.c linux-2.4.22/drivers/video/pmag-aa-fb.c
--- linux-2.4.22.clean/drivers/video/pmag-aa-fb.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/drivers/video/pmag-aa-fb.c 2003-09-23 14:10:50.000000000 +0200
@@ -0,0 +1,514 @@
+/*
+ * linux/drivers/video/pmag-aa-fb.c
+ * Copyright 2002 Karsten Merker <merker@debian.org>
+ *
+ * PMAG-AA TurboChannel framebuffer card support ... derived from
+ * pmag-ba-fb.c, which is Copyright (C) 1999, 2000, 2001 by
+ * Michael Engel <engel@unix-ag.org>, Karsten Merker <merker@debian.org>
+ * and Harald Koerfgen <hkoerfg@web.de>, which itself is derived from
+ * "HP300 Topcat framebuffer support (derived from macfb of all things)
+ * Phil Blundell <philb@gnu.org> 1998"
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License. See the file COPYING in the main directory of this
+ * archive for more details.
+ *
+ * 2002-09-28 Karsten Merker <merker@linuxtag.org>
+ * Version 0.01: First try to get a PMAG-AA running.
+ *
+ * 2003-02-24 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+ * Version 0.02: Major code cleanup.
+ *
+ * 2003-09-21 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+ * Hardware cursor support.
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/timer.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/slab.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/fb.h>
+#include <linux/console.h>
+
+#include <asm/bootinfo.h>
+#include <asm/dec/machtype.h>
+#include <asm/dec/tc.h>
+
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+
+#include "bt455.h"
+#include "bt431.h"
+
+/* Version information */
+#define DRIVER_VERSION "0.02"
+#define DRIVER_AUTHOR "Karsten Merker <merker@linuxtag.org>"
+#define DRIVER_DESCRIPTION "PMAG-AA Framebuffer Driver"
+
+/* Prototypes */
+static int aafb_set_var(struct fb_var_screeninfo *var, int con,
+ struct fb_info *info);
+
+/*
+ * Bt455 RAM DAC register base offset (rel. to TC slot base address).
+ */
+#define PMAG_AA_BT455_OFFSET 0x100000
+
+/*
+ * Bt431 cursor generator offset (rel. to TC slot base address).
+ */
+#define PMAG_AA_BT431_OFFSET 0x180000
+
+/*
+ * Begin of PMAG-AA framebuffer memory relative to TC slot address,
+ * resolution is 1280x1024x1 (8 bits deep, but only LSB is used).
+ */
+#define PMAG_AA_ONBOARD_FBMEM_OFFSET 0x200000
+
+struct aafb_cursor {
+ struct timer_list timer;
+ int enable;
+ int on;
+ int vbl_cnt;
+ int blink_rate;
+ u16 x, y, width, height;
+};
+
+#define CURSOR_TIMER_FREQ (HZ / 50)
+#define CURSOR_BLINK_RATE (20)
+#define CURSOR_DRAW_DELAY (2)
+
+struct aafb_info {
+ struct fb_info info;
+ struct display disp;
+ struct aafb_cursor cursor;
+ struct bt455_regs *bt455;
+ struct bt431_regs *bt431;
+ unsigned long fb_start;
+ unsigned long fb_size;
+ unsigned long fb_line_length;
+};
+
+/*
+ * Max 3 TURBOchannel slots -> max 3 PMAG-AA.
+ */
+static struct aafb_info my_fb_info[3];
+
+static struct aafb_par {
+} current_par;
+
+static int currcon = -1;
+
+static void aafb_set_cursor(struct aafb_info *info, int on)
+{
+ struct aafb_cursor *c = &info->cursor;
+
+ if (on) {
+ bt431_position_cursor(info->bt431, c->x, c->y);
+ bt431_enable_cursor(info->bt431);
+ } else
+ bt431_erase_cursor(info->bt431);
+}
+
+static void aafbcon_cursor(struct display *disp, int mode, int x, int y)
+{
+ struct aafb_info *info = (struct aafb_info *)disp->fb_info;
+ struct aafb_cursor *c = &info->cursor;
+
+ x *= fontwidth(disp);
+ y *= fontheight(disp);
+
+ if (c->x == x && c->y == y && (mode == CM_ERASE) == !c->enable)
+ return;
+
+ c->enable = 0;
+ if (c->on)
+ aafb_set_cursor(info, 0);
+ c->x = x - disp->var.xoffset;
+ c->y = y - disp->var.yoffset;
+
+ switch (mode) {
+ case CM_ERASE:
+ c->on = 0;
+ break;
+ case CM_DRAW:
+ case CM_MOVE:
+ if (c->on)
+ aafb_set_cursor(info, c->on);
+ else
+ c->vbl_cnt = CURSOR_DRAW_DELAY;
+ c->enable = 1;
+ break;
+ }
+}
+
+static int aafbcon_set_font(struct display *disp, int width, int height)
+{
+ struct aafb_info *info = (struct aafb_info *)disp->fb_info;
+ struct aafb_cursor *c = &info->cursor;
+ u8 fgc = ~attr_bgcol_ec(disp, disp->conp);
+
+ if (width > 64 || height > 64 || width < 0 || height < 0)
+ return -EINVAL;
+
+ c->height = height;
+ c->width = width;
+
+ bt431_set_font(info->bt431, fgc, width, height);
+
+ return 1;
+}
+
+static void aafb_cursor_timer_handler(unsigned long data)
+{
+ struct aafb_info *info = (struct aafb_info *)data;
+ struct aafb_cursor *c = &info->cursor;
+
+ if (!c->enable)
+ goto out;
+
+ if (c->vbl_cnt && --c->vbl_cnt == 0) {
+ c->on ^= 1;
+ aafb_set_cursor(info, c->on);
+ c->vbl_cnt = c->blink_rate;
+ }
+
+out:
+ c->timer.expires = jiffies + CURSOR_TIMER_FREQ;
+ add_timer(&c->timer);
+}
+
+static void __init aafb_cursor_init(struct aafb_info *info)
+{
+ struct aafb_cursor *c = &info->cursor;
+
+ c->enable = 1;
+ c->on = 1;
+ c->x = c->y = 0;
+ c->width = c->height = 0;
+ c->vbl_cnt = CURSOR_DRAW_DELAY;
+ c->blink_rate = CURSOR_BLINK_RATE;
+
+ init_timer(&c->timer);
+ c->timer.data = (unsigned long)info;
+ c->timer.function = aafb_cursor_timer_handler;
+ mod_timer(&c->timer, jiffies + CURSOR_TIMER_FREQ);
+}
+
+static void __exit aafb_cursor_exit(struct aafb_info *info)
+{
+ struct aafb_cursor *c = &info->cursor;
+
+ del_timer_sync(&c->timer);
+}
+
+static struct display_switch aafb_switch8 = {
+ .setup = fbcon_cfb8_setup,
+ .bmove = fbcon_cfb8_bmove,
+ .clear = fbcon_cfb8_clear,
+ .putc = fbcon_cfb8_putc,
+ .putcs = fbcon_cfb8_putcs,
+ .revc = fbcon_cfb8_revc,
+ .cursor = aafbcon_cursor,
+ .set_font = aafbcon_set_font,
+ .clear_margins = fbcon_cfb8_clear_margins,
+ .fontwidthmask = FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
+};
+
+static void aafb_get_par(struct aafb_par *par)
+{
+ *par = current_par;
+}
+
+static int aafb_get_fix(struct fb_fix_screeninfo *fix, int con,
+ struct fb_info *info)
+{
+ struct aafb_info *ip = (struct aafb_info *)info;
+
+ memset(fix, 0, sizeof(struct fb_fix_screeninfo));
+ strcpy(fix->id, "PMAG-AA");
+ fix->smem_start = ip->fb_start;
+ fix->smem_len = ip->fb_size;
+ fix->type = FB_TYPE_PACKED_PIXELS;
+ fix->ypanstep = 1;
+ fix->ywrapstep = 1;
+ fix->visual = FB_VISUAL_MONO10;
+ fix->line_length = 1280;
+ fix->accel = FB_ACCEL_NONE;
+
+ return 0;
+}
+
+static void aafb_set_disp(struct display *disp, int con,
+ struct aafb_info *info)
+{
+ struct fb_fix_screeninfo fix;
+
+ disp->fb_info = &info->info;
+ aafb_set_var(&disp->var, con, &info->info);
+ if (disp->conp && disp->conp->vc_sw && disp->conp->vc_sw->con_cursor)
+ disp->conp->vc_sw->con_cursor(disp->conp, CM_ERASE);
+ disp->dispsw = &aafb_switch8;
+ disp->dispsw_data = 0;
+
+ aafb_get_fix(&fix, con, &info->info);
+ disp->screen_base = (u8 *) fix.smem_start;
+ disp->visual = fix.visual;
+ disp->type = fix.type;
+ disp->type_aux = fix.type_aux;
+ disp->ypanstep = fix.ypanstep;
+ disp->ywrapstep = fix.ywrapstep;
+ disp->line_length = fix.line_length;
+ disp->next_line = 2048;
+ disp->can_soft_blank = 1;
+ disp->inverse = 0;
+ disp->scrollmode = SCROLL_YREDRAW;
+
+ aafbcon_set_font(disp, fontwidth(disp), fontheight(disp));
+}
+
+static int aafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+ struct fb_info *info)
+{
+ static u16 color[2] = {0x0000, 0x000f};
+ static struct fb_cmap aafb_cmap = {0, 2, color, color, color, NULL};
+
+ fb_copy_cmap(&aafb_cmap, cmap, kspc ? 0 : 2);
+ return 0;
+}
+
+static int aafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+ struct fb_info *info)
+{
+ u16 color[2] = {0x0000, 0x000f};
+
+ if (cmap->start == 0
+ && cmap->len == 2
+ && memcmp(cmap->red, color, sizeof(color)) == 0
+ && memcmp(cmap->green, color, sizeof(color)) == 0
+ && memcmp(cmap->blue, color, sizeof(color)) == 0
+ && cmap->transp == NULL)
+ return 0;
+ else
+ return -EINVAL;
+}
+
+static int aafb_ioctl(struct inode *inode, struct file *file, u32 cmd,
+ unsigned long arg, int con, struct fb_info *info)
+{
+ /* TODO: Not yet implemented */
+ return -ENOIOCTLCMD;
+}
+
+static int aafb_switch(int con, struct fb_info *info)
+{
+ struct aafb_info *ip = (struct aafb_info *)info;
+ struct display *old = (currcon < 0) ? &ip->disp : (fb_display + currcon);
+ struct display *new = (con < 0) ? &ip->disp : (fb_display + con);
+
+ if (old->conp && old->conp->vc_sw && old->conp->vc_sw->con_cursor)
+ old->conp->vc_sw->con_cursor(old->conp, CM_ERASE);
+
+ /* Set the current console. */
+ currcon = con;
+ aafb_set_disp(new, con, ip);
+
+ return 0;
+}
+
+static void aafb_encode_var(struct fb_var_screeninfo *var,
+ struct aafb_par *par)
+{
+ var->xres = 1280;
+ var->yres = 1024;
+ var->xres_virtual = 2048;
+ var->yres_virtual = 1024;
+ var->xoffset = 0;
+ var->yoffset = 0;
+ var->bits_per_pixel = 8;
+ var->grayscale = 1;
+ var->red.offset = 0;
+ var->red.length = 0;
+ var->red.msb_right = 0;
+ var->green.offset = 0;
+ var->green.length = 1;
+ var->green.msb_right = 0;
+ var->blue.offset = 0;
+ var->blue.length = 0;
+ var->blue.msb_right = 0;
+ var->transp.offset = 0;
+ var->transp.length = 0;
+ var->transp.msb_right = 0;
+ var->nonstd = 0;
+ var->activate &= ~FB_ACTIVATE_MASK & FB_ACTIVATE_NOW;
+ var->accel_flags = 0;
+ var->sync = FB_SYNC_ON_GREEN;
+ var->vmode &= ~FB_VMODE_MASK & FB_VMODE_NONINTERLACED;
+}
+
+static int aafb_get_var(struct fb_var_screeninfo *var, int con,
+ struct fb_info *info)
+{
+ if (con < 0) {
+ struct aafb_par par;
+
+ memset(var, 0, sizeof(struct fb_var_screeninfo));
+ aafb_get_par(&par);
+ aafb_encode_var(var, &par);
+ } else
+ *var = info->var;
+
+ return 0;
+}
+
+static int aafb_set_var(struct fb_var_screeninfo *var, int con,
+ struct fb_info *info)
+{
+ struct aafb_par par;
+
+ aafb_get_par(&par);
+ aafb_encode_var(var, &par);
+ info->var = *var;
+
+ return 0;
+}
+
+static int aafb_update_var(int con, struct fb_info *info)
+{
+ struct aafb_info *ip = (struct aafb_info *)info;
+ struct display *disp = (con < 0) ? &ip->disp : (fb_display + con);
+
+ if (con == currcon)
+ aafbcon_cursor(disp, CM_ERASE, ip->cursor.x, ip->cursor.y);
+
+ return 0;
+}
+
+/* 0 unblanks, any other blanks. */
+
+static void aafb_blank(int blank, struct fb_info *info)
+{
+ struct aafb_info *ip = (struct aafb_info *)info;
+ u8 val = blank ? 0x00 : 0x0f;
+
+ bt455_write_cmap_entry(ip->bt455, 1, val, val, val);
+ aafbcon_cursor(&ip->disp, CM_ERASE, ip->cursor.x, ip->cursor.y);
+}
+
+static struct fb_ops aafb_ops = {
+ .owner = THIS_MODULE,
+ .fb_get_fix = aafb_get_fix,
+ .fb_get_var = aafb_get_var,
+ .fb_set_var = aafb_set_var,
+ .fb_get_cmap = aafb_get_cmap,
+ .fb_set_cmap = aafb_set_cmap,
+ .fb_ioctl = aafb_ioctl
+};
+
+static int __init init_one(int slot)
+{
+ unsigned long base_addr = get_tc_base_addr(slot);
+ struct aafb_info *ip = &my_fb_info[slot];
+
+ memset(ip, 0, sizeof(struct aafb_info));
+
+ /*
+ * Framebuffer display memory base address and friends.
+ */
+ ip->bt455 = (struct bt455_regs *) (base_addr + PMAG_AA_BT455_OFFSET);
+ ip->bt431 = (struct bt431_regs *) (base_addr + PMAG_AA_BT431_OFFSET);
+ ip->fb_start = base_addr + PMAG_AA_ONBOARD_FBMEM_OFFSET;
+ ip->fb_size = 2048 * 1024; /* fb_fix_screeninfo.smem_length
+ seems to be physical */
+ ip->fb_line_length = 2048;
+
+ /*
+ * Let there be consoles..
+ */
+ strcpy(ip->info.modename, "PMAG-AA");
+ ip->info.node = -1;
+ ip->info.flags = FBINFO_FLAG_DEFAULT;
+ ip->info.fbops = &aafb_ops;
+ ip->info.disp = &ip->disp;
+ ip->info.changevar = NULL;
+ ip->info.switch_con = &aafb_switch;
+ ip->info.updatevar = &aafb_update_var;
+ ip->info.blank = &aafb_blank;
+
+ aafb_set_disp(&ip->disp, currcon, ip);
+
+ /*
+ * Configure the RAM DACs.
+ */
+ bt455_erase_cursor(ip->bt455);
+
+ /* Init colormap. */
+ bt455_write_cmap_entry(ip->bt455, 0, 0x00, 0x00, 0x00);
+ bt455_write_cmap_entry(ip->bt455, 1, 0x0f, 0x0f, 0x0f);
+
+ /* Init hardware cursor. */
+ bt431_init_cursor(ip->bt431);
+ aafb_cursor_init(ip);
+
+ /* Clear the screen. */
+ memset ((void *)ip->fb_start, 0, ip->fb_size);
+
+ if (register_framebuffer(&ip->info) < 0)
+ return -EINVAL;
+
+ printk(KERN_INFO "fb%d: %s frame buffer in TC slot %d\n",
+ GET_FB_IDX(ip->info.node), ip->info.modename, slot);
+
+ return 0;
+}
+
+static int __exit exit_one(int slot)
+{
+ struct aafb_info *ip = &my_fb_info[slot];
+
+ if (unregister_framebuffer(&ip->info) < 0)
+ return -EINVAL;
+
+ return 0;
+}
+
+/*
+ * Initialise the framebuffer.
+ */
+int __init pmagaafb_init(void)
+{
+ int sid;
+ int found = 0;
+
+ while ((sid = search_tc_card("PMAG-AA")) >= 0) {
+ found = 1;
+ claim_tc_card(sid);
+ init_one(sid);
+ }
+
+ return found ? 0 : -ENODEV;
+}
+
+static void __exit pmagaafb_exit(void)
+{
+ int sid;
+
+ while ((sid = search_tc_card("PMAG-AA")) >= 0) {
+ exit_one(sid);
+ release_tc_card(sid);
+ }
+}
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESCRIPTION);
+MODULE_LICENSE("GPL");
+#ifdef MODULE
+module_init(pmagaafb_init);
+module_exit(pmagaafb_exit);
+#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/fs/binfmt_elf.c linux-2.4.22/fs/binfmt_elf.c
--- linux-2.4.22.clean/fs/binfmt_elf.c 2003-08-25 13:44:43.000000000 +0200
+++ linux-2.4.22/fs/binfmt_elf.c 2003-09-27 14:09:31.000000000 +0200
@@ -598,6 +598,9 @@
bprm->argc++;
}
}
+ } else {
+ /* Executables without an interpreter also need a personality */
+ SET_PERSONALITY(elf_ex, ibcs2_interpreter);
}
/* Flush all traces of the currently running executable */
@@ -1110,7 +1113,11 @@
elf.e_entry = 0;
elf.e_phoff = sizeof(elf);
elf.e_shoff = 0;
+#ifdef ELF_CORE_EFLAGS
+ elf.e_flags = ELF_CORE_EFLAGS;
+#else
elf.e_flags = 0;
+#endif
elf.e_ehsize = sizeof(elf);
elf.e_phentsize = sizeof(struct elf_phdr);
elf.e_phnum = segs+1; /* Include notes */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/fs/partitions/check.c linux-2.4.22/fs/partitions/check.c
--- linux-2.4.22.clean/fs/partitions/check.c 2002-11-29 00:53:15.000000000 +0100
+++ linux-2.4.22/fs/partitions/check.c 2002-09-11 14:45:26.000000000 +0200
@@ -43,6 +43,9 @@
#ifdef CONFIG_ACORN_PARTITION
acorn_partition,
#endif
+#ifdef CONFIG_SGI_PARTITION
+ sgi_partition,
+#endif
#ifdef CONFIG_EFI_PARTITION
efi_partition, /* this must come before msdos */
#endif
@@ -67,9 +70,6 @@
#ifdef CONFIG_MAC_PARTITION
mac_partition,
#endif
-#ifdef CONFIG_SGI_PARTITION
- sgi_partition,
-#endif
#ifdef CONFIG_ULTRIX_PARTITION
ultrix_partition,
#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/fs/proc/array.c linux-2.4.22/fs/proc/array.c
--- linux-2.4.22.clean/fs/proc/array.c 2003-06-13 16:51:37.000000000 +0200
+++ linux-2.4.22/fs/proc/array.c 2003-07-05 05:23:45.000000000 +0200
@@ -361,15 +361,15 @@
task->cmin_flt,
task->maj_flt,
task->cmaj_flt,
- task->times.tms_utime,
- task->times.tms_stime,
- task->times.tms_cutime,
- task->times.tms_cstime,
+ hz_to_std(task->times.tms_utime),
+ hz_to_std(task->times.tms_stime),
+ hz_to_std(task->times.tms_cutime),
+ hz_to_std(task->times.tms_cstime),
priority,
nice,
0UL /* removed */,
task->it_real_value,
- task->start_time,
+ hz_to_std(task->start_time),
vsize,
mm ? mm->rss : 0, /* you might want to shift this left 3 */
task->rlim[RLIMIT_RSS].rlim_cur,
@@ -691,14 +691,14 @@
len = sprintf(buffer,
"cpu %lu %lu\n",
- task->times.tms_utime,
- task->times.tms_stime);
+ hz_to_std(task->times.tms_utime),
+ hz_to_std(task->times.tms_stime));
for (i = 0 ; i < smp_num_cpus; i++)
len += sprintf(buffer + len, "cpu%d %lu %lu\n",
i,
- task->per_cpu_utime[cpu_logical_map(i)],
- task->per_cpu_stime[cpu_logical_map(i)]);
+ hz_to_std(task->per_cpu_utime[cpu_logical_map(i)]),
+ hz_to_std(task->per_cpu_stime[cpu_logical_map(i)]));
return len;
}
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/fs/proc/proc_misc.c linux-2.4.22/fs/proc/proc_misc.c
--- linux-2.4.22.clean/fs/proc/proc_misc.c 2003-08-25 13:44:43.000000000 +0200
+++ linux-2.4.22/fs/proc/proc_misc.c 2003-09-27 14:09:33.000000000 +0200
@@ -306,16 +306,16 @@
{
int i, len = 0;
extern unsigned long total_forks;
- unsigned long jif = jiffies;
+ unsigned long jif = hz_to_std(jiffies);
unsigned int sum = 0, user = 0, nice = 0, system = 0;
int major, disk;
for (i = 0 ; i < smp_num_cpus; i++) {
int cpu = cpu_logical_map(i), j;
- user += kstat.per_cpu_user[cpu];
- nice += kstat.per_cpu_nice[cpu];
- system += kstat.per_cpu_system[cpu];
+ user += hz_to_std(kstat.per_cpu_user[cpu]);
+ nice += hz_to_std(kstat.per_cpu_nice[cpu]);
+ system += hz_to_std(kstat.per_cpu_system[cpu]);
#if !defined(CONFIG_ARCH_S390)
for (j = 0 ; j < NR_IRQS ; j++)
sum += kstat.irqs[cpu][j];
@@ -329,10 +329,10 @@
proc_sprintf(page, &off, &len,
"cpu%d %u %u %u %lu\n",
i,
- kstat.per_cpu_user[cpu_logical_map(i)],
- kstat.per_cpu_nice[cpu_logical_map(i)],
- kstat.per_cpu_system[cpu_logical_map(i)],
- jif - ( kstat.per_cpu_user[cpu_logical_map(i)] \
+ hz_to_std(kstat.per_cpu_user[cpu_logical_map(i)]),
+ hz_to_std(kstat.per_cpu_nice[cpu_logical_map(i)]),
+ hz_to_std(kstat.per_cpu_system[cpu_logical_map(i)]),
+ jif - hz_to_std( kstat.per_cpu_user[cpu_logical_map(i)] \
+ kstat.per_cpu_nice[cpu_logical_map(i)] \
+ kstat.per_cpu_system[cpu_logical_map(i)]));
proc_sprintf(page, &off, &len,
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/fs/stat.c linux-2.4.22/fs/stat.c
--- linux-2.4.22.clean/fs/stat.c 2003-08-25 13:44:43.000000000 +0200
+++ linux-2.4.22/fs/stat.c 2003-09-27 14:09:31.000000000 +0200
@@ -26,7 +26,7 @@
}
-#if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) && !defined(CONFIG_ARCH_S390) && !defined(__hppa__) && !defined(__x86_64__)
+#if defined(__i386__) || defined(__m68k__) || defined(__ppc__) || defined(__sh__)
/*
* For backward compatibility? Maybe this should be moved
@@ -129,7 +129,7 @@
}
-#if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) && !defined(CONFIG_ARCH_S390) && !defined(__hppa__) && !defined(__x86_64__)
+#if defined(__i386__) || defined(__m68k__) || defined(__ppc__) || defined(__sh__)
/*
* For backward compatibility? Maybe this should be moved
* into arch/i386 instead?
@@ -165,7 +165,7 @@
return error;
}
-#if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) && !defined(CONFIG_ARCH_S390) && !defined(__hppa__) && !defined(__x86_64__)
+#if defined(__i386__) || defined(__m68k__) || defined(__ppc__) || defined(__sh__)
/*
* For backward compatibility? Maybe this should be moved
@@ -203,7 +203,7 @@
return error;
}
-#if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) && !defined(CONFIG_ARCH_S390) && !defined(__hppa__) && !defined(__x86_64__)
+#if defined(__i386__) || defined(__m68k__) || defined(__ppc__) || defined(__sh__)
/*
* For backward compatibility? Maybe this should be moved
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-alpha/param.h linux-2.4.22/include/asm-alpha/param.h
--- linux-2.4.22.clean/include/asm-alpha/param.h 2000-11-08 08:37:31.000000000 +0100
+++ linux-2.4.22/include/asm-alpha/param.h 2000-11-28 04:59:03.000000000 +0100
@@ -13,6 +13,9 @@
# else
# define HZ 1200
# endif
+#ifdef __KERNEL__
+# define hz_to_std(a) (a)
+#endif
#endif
#define EXEC_PAGESIZE 8192
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-i386/param.h linux-2.4.22/include/asm-i386/param.h
--- linux-2.4.22.clean/include/asm-i386/param.h 2000-10-27 20:04:43.000000000 +0200
+++ linux-2.4.22/include/asm-i386/param.h 2000-11-23 03:00:55.000000000 +0100
@@ -3,6 +3,9 @@
#ifndef HZ
#define HZ 100
+#ifdef __KERNEL__
+#define hz_to_std(a) (a)
+#endif
#endif
#define EXEC_PAGESIZE 4096
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-ia64/param.h linux-2.4.22/include/asm-ia64/param.h
--- linux-2.4.22.clean/include/asm-ia64/param.h 2001-04-05 21:51:47.000000000 +0200
+++ linux-2.4.22/include/asm-ia64/param.h 2001-06-13 19:28:11.000000000 +0200
@@ -20,6 +20,10 @@
# define HZ 1024
#endif
+#ifdef __KERNEL__
+#define hz_to_std(a) (a)
+#endif
+
#define EXEC_PAGESIZE 65536
#ifndef NGROUPS
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-m68k/param.h linux-2.4.22/include/asm-m68k/param.h
--- linux-2.4.22.clean/include/asm-m68k/param.h 2001-01-04 22:00:55.000000000 +0100
+++ linux-2.4.22/include/asm-m68k/param.h 2001-01-11 05:02:45.000000000 +0100
@@ -3,6 +3,9 @@
#ifndef HZ
#define HZ 100
+#ifdef __KERNEL__
+#define hz_to_std(a) (a)
+#endif
#endif
#define EXEC_PAGESIZE 8192
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips/bootinfo.h linux-2.4.22/include/asm-mips/bootinfo.h
--- linux-2.4.22.clean/include/asm-mips/bootinfo.h 2003-08-25 13:44:43.000000000 +0200
+++ linux-2.4.22/include/asm-mips/bootinfo.h 2003-09-27 14:09:45.000000000 +0200
@@ -176,6 +176,7 @@
#define MACH_DB1500 5 /* Au1500-based eval board */
#define MACH_XXS1500 6 /* Au1500-based eval board */
#define MACH_MTX1 7 /* 4G MTX-1 Au1500-based board */
+#define MACH_CSB250 8 /* Cogent Au1500 */
/*
* Valid machtype for group NEC_VR41XX
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips/csb250.h linux-2.4.22/include/asm-mips/csb250.h
--- linux-2.4.22.clean/include/asm-mips/csb250.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/include/asm-mips/csb250.h 2003-09-08 02:05:46.000000000 +0200
@@ -0,0 +1,40 @@
+/*
+ * Cogent Computer Systems CSB250 Alchemy Au1500
+ *
+ * Copyright 2002 Cogent Computer Systems, Inc.
+ * dan@embeddededge.com
+ *
+ * ########################################################################
+ *
+ * This program is free software; you can distribute it and/or modify it
+ * under the terms of the GNU General Public License (Version 2) as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * ########################################################################
+ *
+ *
+ */
+#ifndef __ASM_CSB250_H
+#define __ASM_CSB250_H
+
+/* I don't know how to define all of these, yet.
+ *
+ * 0x0 0000 0000 32/64 MByte SDRAM
+ * 0x0 1C00 0000 AM29LLV642 Flash
+ * 0x0 1E00 0000 AM29LLV642 Flash
+ * 0xD 1000 0000 HT6542B PS/2 controller
+ * 0xE 1800 0000 S1D13506 LCD Controller
+ */
+
+#define RTC_I2C 0x58 /* I2C address of DS1307 RTC */
+
+#endif /* __ASM_CSB250_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips/msgbuf.h linux-2.4.22/include/asm-mips/msgbuf.h
--- linux-2.4.22.clean/include/asm-mips/msgbuf.h 2002-11-29 00:53:15.000000000 +0100
+++ linux-2.4.22/include/asm-mips/msgbuf.h 2003-10-13 10:46:52.000000000 +0200
@@ -1,23 +1,41 @@
#ifndef _ASM_MSGBUF_H
#define _ASM_MSGBUF_H
+#include <linux/config.h>
+
/*
- * The msqid64_ds structure for alpha architecture.
+ * The msqid64_ds structure for the MIPS architecture.
* Note extra padding because this structure is passed back and forth
* between kernel and user space.
*
* Pad space is left for:
- * - 2 miscellaneous 64-bit values
+ * - extension of time_t to 64-bit on 32-bitsystem to solve the y2038 problem
+ * - 2 miscellaneous unsigned long values
*/
struct msqid64_ds {
struct ipc64_perm msg_perm;
+#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused1;
+#endif
__kernel_time_t msg_stime; /* last msgsnd time */
+#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN)
unsigned long __unused1;
+#endif
+#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused2;
+#endif
__kernel_time_t msg_rtime; /* last msgrcv time */
+#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN)
unsigned long __unused2;
+#endif
+#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused3;
+#endif
__kernel_time_t msg_ctime; /* last change time */
+#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN)
unsigned long __unused3;
+#endif
unsigned long msg_cbytes; /* current number of bytes on queue */
unsigned long msg_qnum; /* number of messages in queue */
unsigned long msg_qbytes; /* max number of bytes on queue */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips/pgtable-32.h linux-2.4.22/include/asm-mips/pgtable-32.h
--- linux-2.4.22.clean/include/asm-mips/pgtable-32.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips/pgtable-32.h 2003-09-27 14:09:45.000000000 +0200
@@ -5,15 +5,28 @@
* traditional mips two-level paging structure:
*/
+#ifdef CONFIG_64BIT_PHYS_ADDR
+#define PMD_SHIFT 21
+#define PTRS_PER_PTE 512
+#define PTRS_PER_PMD 1
+#define PTRS_PER_PGD 2048
+#define PGD_ORDER 1
+#else
#define PMD_SHIFT 22
#define PTRS_PER_PTE 1024
#define PTRS_PER_PMD 1
#define PTRS_PER_PGD 1024
#define PGD_ORDER 0
+#endif
#if !defined (_LANGUAGE_ASSEMBLY)
+#ifdef CONFIG_64BIT_PHYS_ADDR
+#define pte_ERROR(e) \
+ printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e))
+#else
#define pte_ERROR(e) \
printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low)
+#endif
#define pmd_ERROR(e) \
printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
#define pgd_ERROR(e) \
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips/siginfo.h linux-2.4.22/include/asm-mips/siginfo.h
--- linux-2.4.22.clean/include/asm-mips/siginfo.h 2002-11-29 00:53:15.000000000 +0100
+++ linux-2.4.22/include/asm-mips/siginfo.h 2003-09-27 14:09:45.000000000 +0200
@@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1998, 1999 by Ralf Baechle
+ * Copyright (C) 1998, 1999, 2003 by Ralf Baechle
*/
#ifndef _ASM_SIGINFO_H
#define _ASM_SIGINFO_H
@@ -209,19 +209,18 @@
* thread manager then catches and does the appropriate nonsense.
* However, everything is written out here so as to not get lost.
*/
-#define SIGEV_NONE 128 /* other notification: meaningless */
-#define SIGEV_SIGNAL 129 /* notify via signal */
-#define SIGEV_CALLBACK 130 /* ??? */
-#define SIGEV_THREAD 131 /* deliver via thread creation */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
#define SIGEV_MAX_SIZE 64
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
+#define SIGEV_HEAD_SIZE (sizeof(long) + 2*sizeof(int))
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE-SIGEV_HEAD_SIZE) / sizeof(int))
-/* XXX This one isn't yet IRIX / ABI compatible. */
typedef struct sigevent {
- int sigev_notify;
sigval_t sigev_value;
int sigev_signo;
+ int sigev_notify;
union {
int _pad[SIGEV_PAD_SIZE];
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips/time.h linux-2.4.22/include/asm-mips/time.h
--- linux-2.4.22.clean/include/asm-mips/time.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips/time.h 2003-09-27 14:09:45.000000000 +0200
@@ -36,9 +36,11 @@
extern int (*rtc_set_mmss)(unsigned long);
/*
- * Timer interrupt ack function.
- * May be NULL if the interrupt is self-recoverable.
+ * Timer interrupt functions.
+ * mips_timer_state is needed for high precision timer calibration.
+ * mips_timer_ack may be NULL if the interrupt is self-recoverable.
*/
+extern int (*mips_timer_state)(void);
extern void (*mips_timer_ack)(void);
/*
@@ -88,9 +90,10 @@
extern void (*board_timer_setup)(struct irqaction *irq);
/*
- * mips_counter_frequency - must be set if you intend to use
- * counter as timer interrupt source or use fixed_rate_gettimeoffset.
+ * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
+ * counter as a timer interrupt source; otherwise it can be set up
+ * automagically with an aid of mips_timer_state.
*/
-extern unsigned int mips_counter_frequency;
+extern unsigned int mips_hpt_frequency;
#endif /* _ASM_TIME_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips/uaccess.h linux-2.4.22/include/asm-mips/uaccess.h
--- linux-2.4.22.clean/include/asm-mips/uaccess.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips/uaccess.h 2003-09-27 14:09:45.000000000 +0200
@@ -3,12 +3,13 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1996, 1997, 1998, 1999, 2000, 03 by Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_UACCESS_H
#define _ASM_UACCESS_H
+#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/sched.h>
@@ -73,7 +74,7 @@
* this function, memory access functions may still return -EFAULT.
*/
#define access_ok(type, addr, size) \
- __access_ok((unsigned long)(addr), (size), __access_mask)
+ likely(__access_ok((unsigned long)(addr), (size), __access_mask))
/*
* verify_area: - Obsolete, use access_ok()
@@ -194,84 +195,84 @@
#define __GET_USER_DW __get_user_asm_ll32
#endif
-#define __get_user_nocheck(x,ptr,size) \
-({ \
- long __gu_err; \
- __typeof(*(ptr)) __gu_val; \
- long __gu_addr; \
- __asm__("":"=r" (__gu_val)); \
- __gu_addr = (long) (ptr); \
- __asm__("":"=r" (__gu_err)); \
- switch (size) { \
- case 1: __get_user_asm("lb"); break; \
- case 2: __get_user_asm("lh"); break; \
- case 4: __get_user_asm("lw"); break; \
- case 8: __GET_USER_DW; break; \
- default: __get_user_unknown(); break; \
- } x = (__typeof__(*(ptr))) __gu_val; \
- __gu_err; \
-})
-
-#define __get_user_check(x,ptr,size) \
-({ \
- long __gu_err; \
- __typeof__(*(ptr)) __gu_val; \
- long __gu_addr; \
- __asm__("":"=r" (__gu_val)); \
- __gu_addr = (long) (ptr); \
- __asm__("":"=r" (__gu_err)); \
- if (__access_ok(__gu_addr,size,__access_mask)) { \
- switch (size) { \
- case 1: __get_user_asm("lb"); break; \
- case 2: __get_user_asm("lh"); break; \
- case 4: __get_user_asm("lw"); break; \
- case 8: __GET_USER_DW; break; \
- default: __get_user_unknown(); break; \
- } \
- } x = (__typeof__(*(ptr))) __gu_val; \
- __gu_err; \
-})
-
-#define __get_user_asm(insn) \
-({ \
- __asm__ __volatile__( \
- "1:\t" insn "\t%1,%2\n\t" \
- "move\t%0,$0\n" \
- "2:\n\t" \
- ".section\t.fixup,\"ax\"\n" \
- "3:\tli\t%0,%3\n\t" \
- "move\t%1,$0\n\t" \
- "j\t2b\n\t" \
- ".previous\n\t" \
- ".section\t__ex_table,\"a\"\n\t" \
- ".word\t1b,3b\n\t" \
- ".previous" \
- :"=r" (__gu_err), "=r" (__gu_val) \
- :"o" (__m(__gu_addr)), "i" (-EFAULT)); \
+#define __get_user_nocheck(x,ptr,size) \
+({ \
+ long __gu_err; \
+ __typeof(*(ptr)) __gu_val; \
+ long __gu_addr; \
+ __asm__("":"=r" (__gu_val)); \
+ __gu_addr = (long) (ptr); \
+ __asm__("":"=r" (__gu_err)); \
+ switch (size) { \
+ case 1: __get_user_asm("lb"); break; \
+ case 2: __get_user_asm("lh"); break; \
+ case 4: __get_user_asm("lw"); break; \
+ case 8: __GET_USER_DW; break; \
+ default: __get_user_unknown(); break; \
+ } x = (__typeof__(*(ptr))) __gu_val; \
+ __gu_err; \
+})
+
+#define __get_user_check(x,ptr,size) \
+({ \
+ long __gu_err; \
+ __typeof__(*(ptr)) __gu_val; \
+ long __gu_addr; \
+ __asm__("":"=r" (__gu_val)); \
+ __gu_addr = (long) (ptr); \
+ __asm__("":"=r" (__gu_err)); \
+ if (access_ok(VERIFY_READ, __gu_addr, size)) { \
+ switch (size) { \
+ case 1: __get_user_asm("lb"); break; \
+ case 2: __get_user_asm("lh"); break; \
+ case 4: __get_user_asm("lw"); break; \
+ case 8: __GET_USER_DW; break; \
+ default: __get_user_unknown(); break; \
+ } \
+ } x = (__typeof__(*(ptr))) __gu_val; \
+ __gu_err; \
+})
+
+#define __get_user_asm(insn) \
+({ \
+ __asm__ __volatile__( \
+ "1:\t" insn "\t%1,%2\n\t" \
+ "move\t%0,$0\n" \
+ "2:\n\t" \
+ ".section\t.fixup,\"ax\"\n" \
+ "3:\tli\t%0,%3\n\t" \
+ "move\t%1,$0\n\t" \
+ "j\t2b\n\t" \
+ ".previous\n\t" \
+ ".section\t__ex_table,\"a\"\n\t" \
+ ".word\t1b,3b\n\t" \
+ ".previous" \
+ :"=r" (__gu_err), "=r" (__gu_val) \
+ :"o" (__m(__gu_addr)), "i" (-EFAULT)); \
})
/*
* Get a long long 64 using 32 bit registers.
*/
-#define __get_user_asm_ll32 \
-({ \
-__asm__ __volatile__( \
- "1:\tlw\t%1,%2\n" \
- "2:\tlw\t%D1,%3\n\t" \
- "move\t%0,$0\n" \
- "3:\t.section\t.fixup,\"ax\"\n" \
- "4:\tli\t%0,%4\n\t" \
- "move\t%1,$0\n\t" \
- "move\t%D1,$0\n\t" \
- "j\t3b\n\t" \
- ".previous\n\t" \
- ".section\t__ex_table,\"a\"\n\t" \
- ".word\t1b,4b\n\t" \
- ".word\t2b,4b\n\t" \
- ".previous" \
- :"=r" (__gu_err), "=&r" (__gu_val) \
- :"o" (__m(__gu_addr)), "o" (__m(__gu_addr + 4)), \
- "i" (-EFAULT)); \
+#define __get_user_asm_ll32 \
+({ \
+__asm__ __volatile__( \
+ "1:\tlw\t%1,%2\n" \
+ "2:\tlw\t%D1,%3\n\t" \
+ "move\t%0,$0\n" \
+ "3:\t.section\t.fixup,\"ax\"\n" \
+ "4:\tli\t%0,%4\n\t" \
+ "move\t%1,$0\n\t" \
+ "move\t%D1,$0\n\t" \
+ "j\t3b\n\t" \
+ ".previous\n\t" \
+ ".section\t__ex_table,\"a\"\n\t" \
+ ".word\t1b,4b\n\t" \
+ ".word\t2b,4b\n\t" \
+ ".previous" \
+ :"=r" (__gu_err), "=&r" (__gu_val) \
+ :"o" (__m(__gu_addr)), "o" (__m(__gu_addr + 4)), \
+ "i" (-EFAULT)); \
})
extern void __get_user_unknown(void);
@@ -286,79 +287,79 @@
#define __PUT_USER_DW __put_user_asm_ll32
#endif
-#define __put_user_nocheck(x,ptr,size) \
-({ \
- long __pu_err; \
- __typeof__(*(ptr)) __pu_val; \
- long __pu_addr; \
- __pu_val = (x); \
- __pu_addr = (long) (ptr); \
- __asm__("":"=r" (__pu_err)); \
- switch (size) { \
- case 1: __put_user_asm("sb"); break; \
- case 2: __put_user_asm("sh"); break; \
- case 4: __put_user_asm("sw"); break; \
- case 8: __PUT_USER_DW; break; \
- default: __put_user_unknown(); break; \
- } \
- __pu_err; \
-})
-
-#define __put_user_check(x,ptr,size) \
-({ \
- long __pu_err; \
- __typeof__(*(ptr)) __pu_val; \
- long __pu_addr; \
- __pu_val = (x); \
- __pu_addr = (long) (ptr); \
- __asm__("":"=r" (__pu_err)); \
- if (__access_ok(__pu_addr,size,__access_mask)) { \
- switch (size) { \
- case 1: __put_user_asm("sb"); break; \
- case 2: __put_user_asm("sh"); break; \
- case 4: __put_user_asm("sw"); break; \
- case 8: __PUT_USER_DW; break; \
- default: __put_user_unknown(); break; \
- } \
- } \
- __pu_err; \
-})
-
-#define __put_user_asm(insn) \
-({ \
- __asm__ __volatile__( \
- "1:\t" insn "\t%z1, %2\t\t\t# __put_user_asm\n\t" \
- "move\t%0, $0\n" \
- "2:\n\t" \
- ".section\t.fixup,\"ax\"\n" \
- "3:\tli\t%0, %3\n\t" \
- "j\t2b\n\t" \
- ".previous\n\t" \
- ".section\t__ex_table,\"a\"\n\t" \
- ".word\t1b, 3b\n\t" \
- ".previous" \
- :"=r" (__pu_err) \
- :"Jr" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT)); \
-})
-
-#define __put_user_asm_ll32 \
-({ \
-__asm__ __volatile__( \
- "1:\tsw\t%1, %2\t\t\t# __put_user_asm_ll32\n\t" \
- "2:\tsw\t%D1, %3\n" \
- "move\t%0, $0\n" \
- "3:\n\t" \
- ".section\t.fixup,\"ax\"\n" \
- "4:\tli\t%0, %4\n\t" \
- "j\t3b\n\t" \
- ".previous\n\t" \
- ".section\t__ex_table,\"a\"\n\t" \
- ".word\t1b,4b\n\t" \
- ".word\t2b,4b\n\t" \
- ".previous" \
- :"=r" (__pu_err) \
- :"r" (__pu_val), "o" (__m(__pu_addr)), "o" (__m(__pu_addr + 4)), \
- "i" (-EFAULT)); \
+#define __put_user_nocheck(x,ptr,size) \
+({ \
+ long __pu_err; \
+ __typeof__(*(ptr)) __pu_val; \
+ long __pu_addr; \
+ __pu_val = (x); \
+ __pu_addr = (long) (ptr); \
+ __asm__("":"=r" (__pu_err)); \
+ switch (size) { \
+ case 1: __put_user_asm("sb"); break; \
+ case 2: __put_user_asm("sh"); break; \
+ case 4: __put_user_asm("sw"); break; \
+ case 8: __PUT_USER_DW; break; \
+ default: __put_user_unknown(); break; \
+ } \
+ __pu_err; \
+})
+
+#define __put_user_check(x,ptr,size) \
+({ \
+ long __pu_err; \
+ __typeof__(*(ptr)) __pu_val; \
+ long __pu_addr; \
+ __pu_val = (x); \
+ __pu_addr = (long) (ptr); \
+ __asm__("":"=r" (__pu_err)); \
+ if (access_ok(VERIFY_WRITE, __pu_addr, size)) { \
+ switch (size) { \
+ case 1: __put_user_asm("sb"); break; \
+ case 2: __put_user_asm("sh"); break; \
+ case 4: __put_user_asm("sw"); break; \
+ case 8: __PUT_USER_DW; break; \
+ default: __put_user_unknown(); break; \
+ } \
+ } \
+ __pu_err; \
+})
+
+#define __put_user_asm(insn) \
+({ \
+ __asm__ __volatile__( \
+ "1:\t" insn "\t%z1, %2\t\t\t# __put_user_asm\n\t" \
+ "move\t%0, $0\n" \
+ "2:\n\t" \
+ ".section\t.fixup,\"ax\"\n" \
+ "3:\tli\t%0, %3\n\t" \
+ "j\t2b\n\t" \
+ ".previous\n\t" \
+ ".section\t__ex_table,\"a\"\n\t" \
+ ".word\t1b, 3b\n\t" \
+ ".previous" \
+ :"=r" (__pu_err) \
+ :"Jr" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT)); \
+})
+
+#define __put_user_asm_ll32 \
+({ \
+__asm__ __volatile__( \
+ "1:\tsw\t%1, %2\t\t\t# __put_user_asm_ll32\n\t" \
+ "2:\tsw\t%D1, %3\n" \
+ "move\t%0, $0\n" \
+ "3:\n\t" \
+ ".section\t.fixup,\"ax\"\n" \
+ "4:\tli\t%0, %4\n\t" \
+ "j\t3b\n\t" \
+ ".previous\n\t" \
+ ".section\t__ex_table,\"a\"\n\t" \
+ ".word\t1b,4b\n\t" \
+ ".word\t2b,4b\n\t" \
+ ".previous" \
+ :"=r" (__pu_err) \
+ :"r" (__pu_val), "o" (__m(__pu_addr)), "o" (__m(__pu_addr + 4)),\
+ "i" (-EFAULT)); \
})
extern void __put_user_unknown(void);
@@ -368,13 +369,13 @@
* jump instructions
*/
#ifdef MODULE
-#define __MODULE_JAL(destination) \
- ".set\tnoat\n\t" \
- "la\t$1, " #destination "\n\t" \
- "jalr\t$1\n\t" \
+#define __MODULE_JAL(destination) \
+ ".set\tnoat\n\t" \
+ "la\t$1, " #destination "\n\t" \
+ "jalr\t$1\n\t" \
".set\tat\n\t"
#else
-#define __MODULE_JAL(destination) \
+#define __MODULE_JAL(destination) \
"jal\t" #destination "\n\t"
#endif
@@ -566,14 +567,14 @@
return res;
}
-#define clear_user(addr,n) \
-({ \
- void * __cl_addr = (addr); \
- unsigned long __cl_size = (n); \
- if (__cl_size && access_ok(VERIFY_WRITE, \
- ((unsigned long)(__cl_addr)), __cl_size)) \
- __cl_size = __clear_user(__cl_addr, __cl_size); \
- __cl_size; \
+#define clear_user(addr,n) \
+({ \
+ void * __cl_addr = (addr); \
+ unsigned long __cl_size = (n); \
+ if (__cl_size && access_ok(VERIFY_WRITE, \
+ ((unsigned long)(__cl_addr)), __cl_size)) \
+ __cl_size = __clear_user(__cl_addr, __cl_size); \
+ __cl_size; \
})
/*
@@ -732,9 +733,9 @@
extern unsigned long search_exception_table(unsigned long addr);
/* Returns the new pc */
-#define fixup_exception(map_reg, fixup_unit, pc) \
-({ \
- fixup_unit; \
+#define fixup_exception(map_reg, fixup_unit, pc) \
+({ \
+ fixup_unit; \
})
#endif /* _ASM_UACCESS_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips64/kmap_types.h linux-2.4.22/include/asm-mips64/kmap_types.h
--- linux-2.4.22.clean/include/asm-mips64/kmap_types.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/include/asm-mips64/kmap_types.h 2003-09-29 18:38:01.000000000 +0200
@@ -0,0 +1,16 @@
+#ifndef _ASM_KMAP_TYPES_H
+#define _ASM_KMAP_TYPES_H
+
+enum km_type {
+ KM_BOUNCE_READ,
+ KM_SKB_SUNRPC_DATA,
+ KM_SKB_DATA_SOFTIRQ,
+ KM_USER0,
+ KM_USER1,
+ KM_BH_IRQ,
+ KM_SOFTIRQ0,
+ KM_SOFTIRQ1,
+ KM_TYPE_NR
+};
+
+#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips64/sigcontext.h linux-2.4.22/include/asm-mips64/sigcontext.h
--- linux-2.4.22.clean/include/asm-mips64/sigcontext.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips64/sigcontext.h 2003-09-27 14:09:46.000000000 +0200
@@ -27,6 +27,7 @@
unsigned int sc_badvaddr;
};
+#ifdef __KERNEL__
struct sigcontext32 {
u32 sc_regmask; /* Unused */
u32 sc_status;
@@ -46,5 +47,6 @@
u32 sc_sigset[4]; /* kernel's sigset_t */
};
+#endif /* __KERNEL__ */
#endif /* _ASM_SIGCONTEXT_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips64/siginfo.h linux-2.4.22/include/asm-mips64/siginfo.h
--- linux-2.4.22.clean/include/asm-mips64/siginfo.h 2002-11-29 00:53:15.000000000 +0100
+++ linux-2.4.22/include/asm-mips64/siginfo.h 2003-09-27 14:17:45.000000000 +0200
@@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1998, 1999, 2001 Ralf Baechle
+ * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
* Copyright (C) 2000, 2001 Silicon Graphics, Inc.
*/
#ifndef _ASM_SIGINFO_H
@@ -282,19 +282,18 @@
* thread manager then catches and does the appropriate nonsense.
* However, everything is written out here so as to not get lost.
*/
-#define SIGEV_NONE 128 /* other notification: meaningless */
-#define SIGEV_SIGNAL 129 /* notify via signal */
-#define SIGEV_CALLBACK 130 /* ??? */
-#define SIGEV_THREAD 131 /* deliver via thread creation */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
#define SIGEV_MAX_SIZE 64
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
+#define SIGEV_HEAD_SIZE (sizeof(long) + 2*sizeof(int))
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE-SIGEV_HEAD_SIZE) / sizeof(int))
-/* XXX This one isn't yet IRIX / ABI compatible. */
typedef struct sigevent {
- int sigev_notify;
sigval_t sigev_value;
int sigev_signo;
+ int sigev_notify;
union {
int _pad[SIGEV_PAD_SIZE];
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips64/sn/addrs.h linux-2.4.22/include/asm-mips64/sn/addrs.h
--- linux-2.4.22.clean/include/asm-mips64/sn/addrs.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips64/sn/addrs.h 2003-09-27 14:44:43.000000000 +0200
@@ -16,7 +16,6 @@
#endif /* !__ASSEMBLY__ */
#include <asm/addrspace.h>
-#include <asm/reg.h>
#include <asm/sn/kldir.h>
#if defined(CONFIG_SGI_IP27)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips64/stackframe.h linux-2.4.22/include/asm-mips64/stackframe.h
--- linux-2.4.22.clean/include/asm-mips64/stackframe.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips64/stackframe.h 2003-09-27 14:58:49.000000000 +0200
@@ -50,8 +50,6 @@
.macro SAVE_TEMP
mfhi v1
- sd $8, PT_R8(sp)
- sd $9, PT_R9(sp)
sd v1, PT_HI(sp)
mflo v1
sd $10, PT_R10(sp)
@@ -135,6 +133,8 @@
sd $6, PT_R6(sp)
dmfc0 v1, CP0_EPC
sd $7, PT_R7(sp)
+ sd $8, PT_R8(sp)
+ sd $9, PT_R9(sp)
sd v1, PT_EPC(sp)
sd $25, PT_R25(sp)
sd $28, PT_R28(sp)
@@ -164,8 +164,6 @@
.macro RESTORE_TEMP
ld $24, PT_LO(sp)
- ld $8, PT_R8(sp)
- ld $9, PT_R9(sp)
mtlo $24
ld $24, PT_HI(sp)
ld $10, PT_R10(sp)
@@ -210,6 +208,8 @@
ld $31, PT_R31(sp)
ld $28, PT_R28(sp)
ld $25, PT_R25(sp)
+ ld $9, PT_R9(sp)
+ ld $8, PT_R8(sp)
ld $7, PT_R7(sp)
ld $6, PT_R6(sp)
ld $5, PT_R5(sp)
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips64/time.h linux-2.4.22/include/asm-mips64/time.h
--- linux-2.4.22.clean/include/asm-mips64/time.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips64/time.h 2003-09-27 14:58:50.000000000 +0200
@@ -36,9 +36,11 @@
extern int (*rtc_set_mmss)(unsigned long);
/*
- * Timer interrupt ack function.
- * May be NULL if the interrupt is self-recoverable.
+ * Timer interrupt functions.
+ * mips_timer_state is needed for high precision timer calibration.
+ * mips_timer_ack may be NULL if the interrupt is self-recoverable.
*/
+extern int (*mips_timer_state)(void);
extern void (*mips_timer_ack)(void);
/*
@@ -88,9 +90,10 @@
extern void (*board_timer_setup)(struct irqaction *irq);
/*
- * mips_counter_frequency - must be set if you intend to use
- * counter as timer interrupt source or use fixed_rate_gettimeoffset.
+ * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
+ * counter as a timer interrupt source; otherwise it can be set up
+ * automagically with an aid of mips_timer_state.
*/
-extern unsigned int mips_counter_frequency;
+extern unsigned int mips_hpt_frequency;
#endif /* _ASM_TIME_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips64/uaccess.h linux-2.4.22/include/asm-mips64/uaccess.h
--- linux-2.4.22.clean/include/asm-mips64/uaccess.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips64/uaccess.h 2003-09-27 14:45:02.000000000 +0200
@@ -3,12 +3,13 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1996, 1997, 1998, 1999, 2000, 03 by Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_UACCESS_H
#define _ASM_UACCESS_H
+#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/sched.h>
@@ -73,7 +74,7 @@
* this function, memory access functions may still return -EFAULT.
*/
#define access_ok(type, addr, size) \
- __access_ok((unsigned long)(addr), (size), __access_mask)
+ likely(__access_ok((unsigned long)(addr), (size), __access_mask))
/*
* verify_area: - Obsolete, use access_ok()
@@ -184,117 +185,117 @@
struct __large_struct { unsigned long buf[100]; };
#define __m(x) (*(struct __large_struct *)(x))
-#define __get_user_nocheck(x,ptr,size) \
-({ \
- long __gu_err; \
- __typeof(*(ptr)) __gu_val; \
- long __gu_addr; \
- __asm__("":"=r" (__gu_val)); \
- __gu_addr = (long) (ptr); \
- __asm__("":"=r" (__gu_err)); \
- switch (size) { \
- case 1: __get_user_asm("lb"); break; \
- case 2: __get_user_asm("lh"); break; \
- case 4: __get_user_asm("lw"); break; \
- case 8: __get_user_asm("ld"); break; \
- default: __get_user_unknown(); break; \
- } x = (__typeof__(*(ptr))) __gu_val; \
- __gu_err; \
-})
-
-#define __get_user_check(x,ptr,size) \
-({ \
- long __gu_err; \
- __typeof__(*(ptr)) __gu_val; \
- long __gu_addr; \
- __asm__("":"=r" (__gu_val)); \
- __gu_addr = (long) (ptr); \
- __asm__("":"=r" (__gu_err)); \
- if (__access_ok(__gu_addr,size,__access_mask)) { \
- switch (size) { \
- case 1: __get_user_asm("lb"); break; \
- case 2: __get_user_asm("lh"); break; \
- case 4: __get_user_asm("lw"); break; \
- case 8: __get_user_asm("ld"); break; \
- default: __get_user_unknown(); break; \
- } \
- } x = (__typeof__(*(ptr))) __gu_val; \
- __gu_err; \
-})
-
-#define __get_user_asm(insn) \
-({ \
- __asm__ __volatile__( \
- "1:\t" insn "\t%1,%2\n\t" \
- "move\t%0,$0\n" \
- "2:\n\t" \
- ".section\t.fixup,\"ax\"\n" \
- "3:\tli\t%0,%3\n\t" \
- "move\t%1,$0\n\t" \
- "j\t2b\n\t" \
- ".previous\n\t" \
- ".section\t__ex_table,\"a\"\n\t" \
- ".dword\t1b,3b\n\t" \
- ".previous" \
- :"=r" (__gu_err), "=r" (__gu_val) \
- :"o" (__m(__gu_addr)), "i" (-EFAULT)); \
+#define __get_user_nocheck(x,ptr,size) \
+({ \
+ long __gu_err; \
+ __typeof(*(ptr)) __gu_val; \
+ long __gu_addr; \
+ __asm__("":"=r" (__gu_val)); \
+ __gu_addr = (long) (ptr); \
+ __asm__("":"=r" (__gu_err)); \
+ switch (size) { \
+ case 1: __get_user_asm("lb"); break; \
+ case 2: __get_user_asm("lh"); break; \
+ case 4: __get_user_asm("lw"); break; \
+ case 8: __get_user_asm("ld"); break; \
+ default: __get_user_unknown(); break; \
+ } x = (__typeof__(*(ptr))) __gu_val; \
+ __gu_err; \
+})
+
+#define __get_user_check(x,ptr,size) \
+({ \
+ long __gu_err; \
+ __typeof__(*(ptr)) __gu_val; \
+ long __gu_addr; \
+ __asm__("":"=r" (__gu_val)); \
+ __gu_addr = (long) (ptr); \
+ __asm__("":"=r" (__gu_err)); \
+ if (access_ok(VERIFY_READ, __gu_addr, size)) { \
+ switch (size) { \
+ case 1: __get_user_asm("lb"); break; \
+ case 2: __get_user_asm("lh"); break; \
+ case 4: __get_user_asm("lw"); break; \
+ case 8: __get_user_asm("ld"); break; \
+ default: __get_user_unknown(); break; \
+ } \
+ } x = (__typeof__(*(ptr))) __gu_val; \
+ __gu_err; \
+})
+
+#define __get_user_asm(insn) \
+({ \
+ __asm__ __volatile__( \
+ "1:\t" insn "\t%1,%2\n\t" \
+ "move\t%0,$0\n" \
+ "2:\n\t" \
+ ".section\t.fixup,\"ax\"\n" \
+ "3:\tli\t%0,%3\n\t" \
+ "move\t%1,$0\n\t" \
+ "j\t2b\n\t" \
+ ".previous\n\t" \
+ ".section\t__ex_table,\"a\"\n\t" \
+ ".dword\t1b,3b\n\t" \
+ ".previous" \
+ :"=r" (__gu_err), "=r" (__gu_val) \
+ :"o" (__m(__gu_addr)), "i" (-EFAULT)); \
})
extern void __get_user_unknown(void);
-#define __put_user_nocheck(x,ptr,size) \
-({ \
- long __pu_err; \
- __typeof__(*(ptr)) __pu_val; \
- long __pu_addr; \
- __pu_val = (x); \
- __pu_addr = (long) (ptr); \
- __asm__("":"=r" (__pu_err)); \
- switch (size) { \
- case 1: __put_user_asm("sb"); break; \
- case 2: __put_user_asm("sh"); break; \
- case 4: __put_user_asm("sw"); break; \
- case 8: __put_user_asm("sd"); break; \
- default: __put_user_unknown(); break; \
- } \
- __pu_err; \
-})
-
-#define __put_user_check(x,ptr,size) \
-({ \
- long __pu_err; \
- __typeof__(*(ptr)) __pu_val; \
- long __pu_addr; \
- __pu_val = (x); \
- __pu_addr = (long) (ptr); \
- __asm__("":"=r" (__pu_err)); \
- if (__access_ok(__pu_addr,size,__access_mask)) { \
- switch (size) { \
- case 1: __put_user_asm("sb"); break; \
- case 2: __put_user_asm("sh"); break; \
- case 4: __put_user_asm("sw"); break; \
- case 8: __put_user_asm("sd"); break; \
- default: __put_user_unknown(); break; \
- } \
- } \
- __pu_err; \
-})
-
-#define __put_user_asm(insn) \
-({ \
- __asm__ __volatile__( \
- "1:\t" insn "\t%z1, %2\t\t\t# __put_user_asm\n\t" \
- "move\t%0, $0\n" \
- "2:\n\t" \
- ".section\t.fixup,\"ax\"\n" \
- "3:\tli\t%0, %3\n\t" \
- "j\t2b\n\t" \
- ".previous\n\t" \
- ".section\t__ex_table,\"a\"\n\t" \
- ".dword\t1b, 3b\n\t" \
- ".previous" \
- :"=r" (__pu_err) \
- :"Jr" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT)); \
+#define __put_user_nocheck(x,ptr,size) \
+({ \
+ long __pu_err; \
+ __typeof__(*(ptr)) __pu_val; \
+ long __pu_addr; \
+ __pu_val = (x); \
+ __pu_addr = (long) (ptr); \
+ __asm__("":"=r" (__pu_err)); \
+ switch (size) { \
+ case 1: __put_user_asm("sb"); break; \
+ case 2: __put_user_asm("sh"); break; \
+ case 4: __put_user_asm("sw"); break; \
+ case 8: __put_user_asm("sd"); break; \
+ default: __put_user_unknown(); break; \
+ } \
+ __pu_err; \
+})
+
+#define __put_user_check(x,ptr,size) \
+({ \
+ long __pu_err; \
+ __typeof__(*(ptr)) __pu_val; \
+ long __pu_addr; \
+ __pu_val = (x); \
+ __pu_addr = (long) (ptr); \
+ __asm__("":"=r" (__pu_err)); \
+ if (access_ok(VERIFY_WRITE, __pu_addr, size)) { \
+ switch (size) { \
+ case 1: __put_user_asm("sb"); break; \
+ case 2: __put_user_asm("sh"); break; \
+ case 4: __put_user_asm("sw"); break; \
+ case 8: __put_user_asm("sd"); break; \
+ default: __put_user_unknown(); break; \
+ } \
+ } \
+ __pu_err; \
+})
+
+#define __put_user_asm(insn) \
+({ \
+ __asm__ __volatile__( \
+ "1:\t" insn "\t%z1, %2\t\t\t# __put_user_asm\n\t" \
+ "move\t%0, $0\n" \
+ "2:\n\t" \
+ ".section\t.fixup,\"ax\"\n" \
+ "3:\tli\t%0, %3\n\t" \
+ "j\t2b\n\t" \
+ ".previous\n\t" \
+ ".section\t__ex_table,\"a\"\n\t" \
+ ".dword\t1b, 3b\n\t" \
+ ".previous" \
+ :"=r" (__pu_err) \
+ :"Jr" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT)); \
})
extern void __put_user_unknown(void);
@@ -304,13 +305,13 @@
* jump instructions
*/
#ifdef MODULE
-#define __MODULE_JAL(destination) \
- ".set\tnoat\n\t" \
- "dla\t$1, " #destination "\n\t" \
- "jalr\t$1\n\t" \
+#define __MODULE_JAL(destination) \
+ ".set\tnoat\n\t" \
+ "dla\t$1, " #destination "\n\t" \
+ "jalr\t$1\n\t" \
".set\tat\n\t"
#else
-#define __MODULE_JAL(destination) \
+#define __MODULE_JAL(destination) \
"jal\t" #destination "\n\t"
#endif
@@ -503,14 +504,14 @@
return res;
}
-#define clear_user(addr,n) \
-({ \
- void * __cl_addr = (addr); \
- unsigned long __cl_size = (n); \
- if (__cl_size && access_ok(VERIFY_WRITE, \
- ((unsigned long)(__cl_addr)), __cl_size)) \
- __cl_size = __clear_user(__cl_addr, __cl_size); \
- __cl_size; \
+#define clear_user(addr,n) \
+({ \
+ void * __cl_addr = (addr); \
+ unsigned long __cl_size = (n); \
+ if (__cl_size && access_ok(VERIFY_WRITE, \
+ ((unsigned long)(__cl_addr)), __cl_size)) \
+ __cl_size = __clear_user(__cl_addr, __cl_size); \
+ __cl_size; \
})
/*
@@ -669,9 +670,9 @@
extern unsigned long search_exception_table(unsigned long addr);
/* Returns the new pc */
-#define fixup_exception(map_reg, fixup_unit, pc) \
-({ \
- fixup_unit; \
+#define fixup_exception(map_reg, fixup_unit, pc) \
+({ \
+ fixup_unit; \
})
#endif /* _ASM_UACCESS_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-mips64/unistd.h linux-2.4.22/include/asm-mips64/unistd.h
--- linux-2.4.22.clean/include/asm-mips64/unistd.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/asm-mips64/unistd.h 2003-09-27 14:09:46.000000000 +0200
@@ -480,11 +480,14 @@
#define __NR_unused209 (__NR_Linux + 209)
#define __NR_unused210 (__NR_Linux + 210)
#define __NR_rt_sigreturn (__NR_Linux + 211)
+#define __NR_unused212 (__NR_Linux + 212)
+#define __NR_unused213 (__NR_Linux + 213)
+#define __NR_semtimedop (__NR_Linux + 214)
/*
* Offset of the last Linux flavoured syscall
*/
-#define __NR_Linux_syscalls 211
+#define __NR_Linux_syscalls 214
/*
* Linux N32 syscalls are in the range from 6000 to 6999.
@@ -705,7 +708,7 @@
#define __NR_N32_fcntl64 (__NR_N32_Linux + 212)
#define __NR_N32_unused213 (__NR_N32_Linux + 213)
#define __NR_N32_unused214 (__NR_N32_Linux + 214)
-#define __NR_N32_unused215 (__NR_N32_Linux + 215)
+#define __NR_N32_semtimedop (__NR_N32_Linux + 215)
#define __NR_N32_unused216 (__NR_N32_Linux + 216)
#define __NR_N32_unused217 (__NR_N32_Linux + 217)
#define __NR_N32_unused218 (__NR_N32_Linux + 218)
@@ -883,7 +886,7 @@
\
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ "li\t$2, %7\t\t\t# " #name "\n\t" \
"syscall\n\t" \
"move\t%0, $2\n\t" \
".set\treorder" \
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-ppc/param.h linux-2.4.22/include/asm-ppc/param.h
--- linux-2.4.22.clean/include/asm-ppc/param.h 2003-06-13 16:51:38.000000000 +0200
+++ linux-2.4.22/include/asm-ppc/param.h 2003-07-05 05:23:46.000000000 +0200
@@ -3,6 +3,9 @@
#ifndef HZ
#define HZ 100
+#ifdef __KERNEL__
+#define hz_to_std(a) (a)
+#endif
#endif
#define EXEC_PAGESIZE 4096
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-s390/param.h linux-2.4.22/include/asm-s390/param.h
--- linux-2.4.22.clean/include/asm-s390/param.h 2001-02-13 23:13:44.000000000 +0100
+++ linux-2.4.22/include/asm-s390/param.h 2001-03-09 21:34:48.000000000 +0100
@@ -11,6 +11,9 @@
#ifndef HZ
#define HZ 100
+#ifdef __KERNEL__
+#define hz_to_std(a) (a)
+#endif
#endif
#define EXEC_PAGESIZE 4096
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-sh/param.h linux-2.4.22/include/asm-sh/param.h
--- linux-2.4.22.clean/include/asm-sh/param.h 2001-01-04 22:19:13.000000000 +0100
+++ linux-2.4.22/include/asm-sh/param.h 2001-01-11 05:02:45.000000000 +0100
@@ -3,6 +3,9 @@
#ifndef HZ
#define HZ 100
+#ifdef __KERNEL__
+#define hz_to_std(a) (a)
+#endif
#endif
#define EXEC_PAGESIZE 4096
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-sparc/param.h linux-2.4.22/include/asm-sparc/param.h
--- linux-2.4.22.clean/include/asm-sparc/param.h 2000-10-30 23:34:12.000000000 +0100
+++ linux-2.4.22/include/asm-sparc/param.h 2000-11-23 03:00:56.000000000 +0100
@@ -4,6 +4,9 @@
#ifndef HZ
#define HZ 100
+#ifdef __KERNEL__
+#define hz_to_std(a) (a)
+#endif
#endif
#define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/asm-sparc64/param.h linux-2.4.22/include/asm-sparc64/param.h
--- linux-2.4.22.clean/include/asm-sparc64/param.h 2000-10-30 23:34:12.000000000 +0100
+++ linux-2.4.22/include/asm-sparc64/param.h 2000-11-23 03:00:56.000000000 +0100
@@ -4,6 +4,9 @@
#ifndef HZ
#define HZ 100
+#ifdef __KERNEL__
+#define hz_to_std(a) (a)
+#endif
#endif
#define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/byteorder/generic.h linux-2.4.22/include/linux/byteorder/generic.h
--- linux-2.4.22.clean/include/linux/byteorder/generic.h 2002-08-03 02:39:45.000000000 +0200
+++ linux-2.4.22/include/linux/byteorder/generic.h 2003-09-27 14:09:53.000000000 +0200
@@ -122,7 +122,7 @@
#define be16_to_cpus __be16_to_cpus
#endif
-
+#if defined(__KERNEL__)
/*
* Handle ntohl and suches. These have various compatibility
* issues - like we want to give the prototype even though we
@@ -146,35 +146,26 @@
* Do the prototypes. Somebody might want to take the
* address or some such sick thing..
*/
-#if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
extern __u32 ntohl(__u32);
extern __u32 htonl(__u32);
-#else
-extern unsigned long int ntohl(unsigned long int);
-extern unsigned long int htonl(unsigned long int);
-#endif
extern unsigned short int ntohs(unsigned short int);
extern unsigned short int htons(unsigned short int);
-
-#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) && !defined(__STRICT_ANSI__)
+#if defined(__GNUC__) && defined(__OPTIMIZE__)
#define ___htonl(x) __cpu_to_be32(x)
#define ___htons(x) __cpu_to_be16(x)
#define ___ntohl(x) __be32_to_cpu(x)
#define ___ntohs(x) __be16_to_cpu(x)
-#if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
#define htonl(x) ___htonl(x)
#define ntohl(x) ___ntohl(x)
-#else
-#define htonl(x) ((unsigned long)___htonl(x))
-#define ntohl(x) ((unsigned long)___ntohl(x))
-#endif
#define htons(x) ___htons(x)
#define ntohs(x) ___ntohs(x)
#endif /* OPTIMIZE */
+#endif /* KERNEL */
+
#endif /* _LINUX_BYTEORDER_GENERIC_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/elf.h linux-2.4.22/include/linux/elf.h
--- linux-2.4.22.clean/include/linux/elf.h 2002-11-29 00:53:15.000000000 +0100
+++ linux-2.4.22/include/linux/elf.h 2003-09-27 14:52:03.000000000 +0200
@@ -32,11 +32,16 @@
#define PT_LOPROC 0x70000000
#define PT_HIPROC 0x7fffffff
#define PT_MIPS_REGINFO 0x70000000
+#define PT_MIPS_OPTIONS 0x70000001
/* Flags in the e_flags field of the header */
#define EF_MIPS_NOREORDER 0x00000001
#define EF_MIPS_PIC 0x00000002
#define EF_MIPS_CPIC 0x00000004
+#define EF_MIPS_ABI2 0x00000020
+#define EF_MIPS_OPTIONS_FIRST 0x00000080
+#define EF_MIPS_32BITMODE 0x00000100
+#define EF_MIPS_ABI 0x0000f000
#define EF_MIPS_ARCH 0xf0000000
/* These constants define the different elf file types */
@@ -60,7 +65,7 @@
#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
-#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
#define EM_PARISC 15 /* HPPA */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/fb.h linux-2.4.22/include/linux/fb.h
--- linux-2.4.22.clean/include/linux/fb.h 2003-06-13 16:51:38.000000000 +0200
+++ linux-2.4.22/include/linux/fb.h 2003-09-27 14:59:26.000000000 +0200
@@ -95,9 +95,11 @@
#define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */
#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
-#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
+#define FB_ACCEL_EPSON_SED1356 39 /* Epson SED1356 */
+#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
+
#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/i2c-algo-sgi.h linux-2.4.22/include/linux/i2c-algo-sgi.h
--- linux-2.4.22.clean/include/linux/i2c-algo-sgi.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/include/linux/i2c-algo-sgi.h 2003-09-11 17:36:48.000000000 +0200
@@ -0,0 +1,27 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
+ */
+
+#ifndef I2C_ALGO_SGI_H
+#define I2C_ALGO_SGI_H 1
+
+#include <linux/i2c.h>
+
+struct i2c_algo_sgi_data {
+ void *data; /* private data for lowlevel routines */
+ unsigned (*getctrl)(void *data);
+ void (*setctrl)(void *data, unsigned val);
+ unsigned (*rdata)(void *data);
+ void (*wdata)(void *data, unsigned val);
+
+ int xfer_timeout;
+ int ack_timeout;
+};
+
+int i2c_sgi_add_bus(struct i2c_adapter *);
+int i2c_sgi_del_bus(struct i2c_adapter *);
+
+#endif /* I2C_ALGO_SGI_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/i2c-id.h linux-2.4.22/include/linux/i2c-id.h
--- linux-2.4.22.clean/include/linux/i2c-id.h 2003-06-13 16:51:38.000000000 +0200
+++ linux-2.4.22/include/linux/i2c-id.h 2003-09-27 14:09:52.000000000 +0200
@@ -91,6 +91,9 @@
#define I2C_DRIVERID_SP5055 44 /* Satellite tuner */
#define I2C_DRIVERID_STV0030 45 /* Multipurpose switch */
#define I2C_DRIVERID_ADV717X 48 /* video encoder */
+#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
+#define I2C_DRIVERID_SAA7191 57 /* video decoder */
+#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
#define I2C_DRIVERID_EXP1 0xF1
@@ -149,6 +152,10 @@
#define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */
+#define I2C_ALGO_SIBYTE 0x120000 /* Broadcom SiByte SOCs */
+
+#define I2C_ALGO_SGI 0x130000 /* SGI algorithm */
+
#define I2C_ALGO_EXP 0x800000 /* experimental */
#define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */
@@ -190,6 +197,13 @@
/* --- MPC8xx PowerPC adapters */
#define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */
+/* --- Broadcom SiByte adapters */
+#define I2C_HW_SIBYTE 0x00
+
+/* --- SGI adapters */
+#define I2C_HW_SGI_VINO 0x00
+#define I2C_HW_SGI_MACE 0x01
+
/* --- SMBus only adapters */
#define I2C_HW_SMBUS_PIIX4 0x00
#define I2C_HW_SMBUS_ALI15X3 0x01
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/mc146818rtc.h linux-2.4.22/include/linux/mc146818rtc.h
--- linux-2.4.22.clean/include/linux/mc146818rtc.h 2001-11-22 20:46:58.000000000 +0100
+++ linux-2.4.22/include/linux/mc146818rtc.h 2003-09-27 14:59:53.000000000 +0200
@@ -98,4 +98,12 @@
#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
#endif
+#ifndef RTC_IO_EXTENT
+#define RTC_IO_EXTENT 0x10 /* Only really two ports, but... */
+#endif
+
+#ifndef RTC_IOMAPPED
+#define RTC_IOMAPPED 1 /* Default to I/O mapping. */
+#endif
+
#endif /* _MC146818RTC_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/miscdevice.h linux-2.4.22/include/linux/miscdevice.h
--- linux-2.4.22.clean/include/linux/miscdevice.h 2003-06-13 16:51:38.000000000 +0200
+++ linux-2.4.22/include/linux/miscdevice.h 2003-09-27 14:45:54.000000000 +0200
@@ -20,9 +20,11 @@
#define RTC_MINOR 135
#define EFI_RTC_MINOR 136 /* EFI Time services */
#define SUN_OPENPROM_MINOR 139
+#define LCD_MINOR 140 /* Inofficial Linux/MIPS only alloc */
#define NVRAM_MINOR 144
#define I2O_MINOR 166
#define MICROCODE_MINOR 184
+#define GPIO_MINOR 185
#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
#define MPT_MINOR 220
#define MISC_DYNAMIC_MINOR 255
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/pci_ids.h linux-2.4.22/include/linux/pci_ids.h
--- linux-2.4.22.clean/include/linux/pci_ids.h 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/include/linux/pci_ids.h 2003-09-27 14:09:53.000000000 +0200
@@ -508,9 +508,11 @@
#define PCI_DEVICE_ID_MIRO_36050 0x5601
#define PCI_VENDOR_ID_NEC 0x1033
+#define PCI_DEVICE_ID_NEC_NAPCCARD 0x003e
#define PCI_DEVICE_ID_NEC_PCX2 0x0046
#define PCI_DEVICE_ID_NEC_NILE4 0x005a
#define PCI_DEVICE_ID_NEC_VRC5476 0x009b
+#define PCI_DEVICE_ID_NEC_VRC4173 0x00a5
#define PCI_DEVICE_ID_NEC_VRC5477_AC97 0x00a6
#define PCI_VENDOR_ID_FD 0x1036
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/sched.h linux-2.4.22/include/linux/sched.h
--- linux-2.4.22.clean/include/linux/sched.h 2003-06-13 16:51:39.000000000 +0200
+++ linux-2.4.22/include/linux/sched.h 2003-09-27 14:45:02.000000000 +0200
@@ -615,6 +615,10 @@
extern int in_group_p(gid_t);
extern int in_egroup_p(gid_t);
+extern ATTRIB_NORET void cpu_idle(void);
+
+extern void release_task(struct task_struct * p);
+
extern void proc_caches_init(void);
extern void flush_signals(struct task_struct *);
extern void flush_signal_handlers(struct task_struct *);
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/spinlock.h linux-2.4.22/include/linux/spinlock.h
--- linux-2.4.22.clean/include/linux/spinlock.h 2002-11-29 00:53:15.000000000 +0100
+++ linux-2.4.22/include/linux/spinlock.h 2003-09-27 14:45:02.000000000 +0200
@@ -3,6 +3,8 @@
#include <linux/config.h>
+#include <asm/system.h>
+
/*
* These are the generic versions of the spinlocks and read-write
* locks..
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/threads.h linux-2.4.22/include/linux/threads.h
--- linux-2.4.22.clean/include/linux/threads.h 2002-02-25 20:38:13.000000000 +0100
+++ linux-2.4.22/include/linux/threads.h 2002-02-26 07:00:31.000000000 +0100
@@ -9,7 +9,11 @@
*/
#ifdef CONFIG_SMP
-#define NR_CPUS 32 /* Max processors that can be running in SMP */
+#ifdef __mips__
+#define NR_CPUS _MIPS_SZLONG
+#else
+#define NR_CPUS 64 /* Max processors that can be running in SMP */
+#endif
#else
#define NR_CPUS 1
#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/linux/videodev.h linux-2.4.22/include/linux/videodev.h
--- linux-2.4.22.clean/include/linux/videodev.h 2003-06-13 16:51:39.000000000 +0200
+++ linux-2.4.22/include/linux/videodev.h 2003-03-06 01:51:47.000000000 +0100
@@ -405,6 +405,7 @@
#define VID_HARDWARE_CPIA2 33
#define VID_HARDWARE_VICAM 34 /* ViCam, 3Com Homeconnect */
#define VID_HARDWARE_SF16FMR2 35
+#define VID_HARDWARE_SAA7114H 36
#endif /* __LINUX_VIDEODEV_H */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/pcmcia/cs_types.h linux-2.4.22/include/pcmcia/cs_types.h
--- linux-2.4.22.clean/include/pcmcia/cs_types.h 2001-10-11 18:43:29.000000000 +0200
+++ linux-2.4.22/include/pcmcia/cs_types.h 2002-02-15 20:54:43.000000000 +0100
@@ -36,7 +36,7 @@
#include <sys/types.h>
#endif
-#ifdef __arm__
+#if defined(__arm__) || defined(__mips__)
typedef u_int ioaddr_t;
#else
typedef u_short ioaddr_t;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/include/video/e1356fb.h linux-2.4.22/include/video/e1356fb.h
--- linux-2.4.22.clean/include/video/e1356fb.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.22/include/video/e1356fb.h 2003-04-27 04:56:07.000000000 +0200
@@ -0,0 +1,73 @@
+/*
+ * e1356fb.h -- Epson SED1356 Framebuffer Driver IOCTL Interface
+ *
+ * Copyright 2001, 2002, 2003 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ * stevel@mvista.com or source@mvista.com
+ *
+ * This program 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * IOCTLs to SED1356 fb driver. 0x45 is 'E' for Epson.
+ */
+#define FBIO_SED1356_BITBLT 0x4500
+
+typedef struct {
+ int operation;
+ int rop;
+ int src_y;
+ int src_x;
+ int src_width;
+ int src_height;
+ int dst_y;
+ int dst_x;
+ int dst_width;
+ int dst_height;
+ int pattern_x;
+ int pattern_y;
+ int attribute;
+ unsigned int bg_color;
+ unsigned int fg_color;
+ unsigned short* src;
+ int srcsize;
+ int srcstride;
+} blt_info_t;
+
+enum blt_attribute_t {
+ BLT_ATTR_TRANSPARENT = 1
+};
+
+enum blt_operation_t {
+ BLT_WRITE_ROP = 0,
+ BLT_READ,
+ BLT_MOVE_POS_ROP,
+ BLT_MOVE_NEG_ROP,
+ BLT_WRITE_TRANSP,
+ BLT_MOVE_POS_TRANSP,
+ BLT_PAT_FILL_ROP,
+ BLT_PAT_FILL_TRANSP,
+ BLT_COLOR_EXP,
+ BLT_COLOR_EXP_TRANSP,
+ BLT_MOVE_COLOR_EXP,
+ BLT_MOVE_COLOR_EXP_TRANSP,
+ BLT_SOLID_FILL
+};
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/init/main.c linux-2.4.22/init/main.c
--- linux-2.4.22.clean/init/main.c 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/init/main.c 2003-09-27 14:09:55.000000000 +0200
@@ -290,7 +290,6 @@
extern void setup_arch(char **);
-extern void cpu_idle(void);
unsigned long wait_init_idle;
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/kernel/exit.c linux-2.4.22/kernel/exit.c
--- linux-2.4.22.clean/kernel/exit.c 2002-11-29 00:53:15.000000000 +0100
+++ linux-2.4.22/kernel/exit.c 2003-01-11 18:53:18.000000000 +0100
@@ -26,7 +26,7 @@
int getrusage(struct task_struct *, int, struct rusage *);
-static void release_task(struct task_struct * p)
+void release_task(struct task_struct * p)
{
if (p != current) {
#ifdef CONFIG_SMP
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/kernel/printk.c linux-2.4.22/kernel/printk.c
--- linux-2.4.22.clean/kernel/printk.c 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/kernel/printk.c 2003-09-27 14:09:55.000000000 +0200
@@ -99,7 +99,7 @@
/*
* Setup a list of consoles. Called from init/main.c
*/
-static int __init console_setup(char *str)
+int __init console_setup(char *str)
{
struct console_cmdline *c;
char name[sizeof(c->name)];
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/kernel/signal.c linux-2.4.22/kernel/signal.c
--- linux-2.4.22.clean/kernel/signal.c 2003-06-13 16:51:39.000000000 +0200
+++ linux-2.4.22/kernel/signal.c 2003-02-25 23:03:13.000000000 +0100
@@ -14,6 +14,7 @@
#include <linux/init.h>
#include <linux/sched.h>
+#include <asm/param.h>
#include <asm/uaccess.h>
/*
@@ -28,6 +29,14 @@
#define SIG_SLAB_DEBUG 0
#endif
+#define DEBUG_SIG 0
+
+#if DEBUG_SIG
+#define SIG_SLAB_DEBUG (SLAB_DEBUG_FREE | SLAB_RED_ZONE /* | SLAB_POISON */)
+#else
+#define SIG_SLAB_DEBUG 0
+#endif
+
static kmem_cache_t *sigqueue_cachep;
atomic_t nr_queued_signals;
@@ -270,6 +279,11 @@
signal_pending(current));
#endif
+#if DEBUG_SIG
+printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
+ signal_pending(current));
+#endif
+
sig = next_signal(current, mask);
if (sig) {
if (current->notifier) {
@@ -293,6 +307,10 @@
printk(" %d -> %d\n", signal_pending(current), sig);
#endif
+#if DEBUG_SIG
+printk(" %d -> %d\n", signal_pending(current), sig);
+#endif
+
return sig;
}
@@ -540,6 +558,11 @@
printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
#endif
+
+#if DEBUG_SIG
+printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
+#endif
+
ret = -EINVAL;
if (sig < 0 || sig > _NSIG)
goto out_nolock;
@@ -778,8 +801,8 @@
info.si_uid = tsk->uid;
/* FIXME: find out whether or not this is supposed to be c*time. */
- info.si_utime = tsk->times.tms_utime;
- info.si_stime = tsk->times.tms_stime;
+ info.si_utime = hz_to_std(tsk->times.tms_utime);
+ info.si_stime = hz_to_std(tsk->times.tms_stime);
status = tsk->exit_code & 0x7f;
why = SI_KERNEL; /* shouldn't happen */
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/kernel/sys.c linux-2.4.22/kernel/sys.c
--- linux-2.4.22.clean/kernel/sys.c 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/kernel/sys.c 2003-09-27 14:09:55.000000000 +0200
@@ -810,16 +810,23 @@
asmlinkage long sys_times(struct tms * tbuf)
{
+ struct tms temp;
+
/*
* In the SMP world we might just be unlucky and have one of
* the times increment as we use it. Since the value is an
* atomically safe type this is just fine. Conceptually its
* as if the syscall took an instant longer to occur.
*/
- if (tbuf)
- if (copy_to_user(tbuf, ¤t->times, sizeof(struct tms)))
+ if (tbuf) {
+ temp.tms_utime = hz_to_std(current->times.tms_utime);
+ temp.tms_stime = hz_to_std(current->times.tms_stime);
+ temp.tms_cutime = hz_to_std(current->times.tms_cutime);
+ temp.tms_cstime = hz_to_std(current->times.tms_cstime);
+ if (copy_to_user(tbuf, &temp, sizeof(struct tms)))
return -EFAULT;
- return jiffies;
+ }
+ return hz_to_std(jiffies);
}
/*
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/lib/Makefile linux-2.4.22/lib/Makefile
--- linux-2.4.22.clean/lib/Makefile 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/lib/Makefile 2003-09-27 14:09:55.000000000 +0200
@@ -26,6 +26,7 @@
subdir-$(CONFIG_ZLIB_INFLATE) += zlib_inflate
subdir-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate
+-include $(TOPDIR)/arch/$(ARCH)/Makefile.lib
include $(TOPDIR)/drivers/net/Makefile.lib
include $(TOPDIR)/drivers/usb/Makefile.lib
include $(TOPDIR)/fs/Makefile.lib
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/lib/string.c linux-2.4.22/lib/string.c
--- linux-2.4.22.clean/lib/string.c 2002-08-03 02:39:46.000000000 +0200
+++ linux-2.4.22/lib/string.c 2002-06-27 00:36:48.000000000 +0200
@@ -356,7 +356,7 @@
*
* Do not use memset() to access IO space, use memset_io() instead.
*/
-void * memset(void * s,int c,size_t count)
+void * memset(void * s,int c, size_t count)
{
char *xs = (char *) s;
@@ -474,14 +474,15 @@
void * memscan(void * addr, int c, size_t size)
{
unsigned char * p = (unsigned char *) addr;
+ unsigned char * e = p + size;
- while (size) {
- if (*p == c)
+ while (p != e) {
+ if (*p == (unsigned char)c)
return (void *) p;
p++;
- size--;
}
- return (void *) p;
+
+ return (void *) p;
}
#endif
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/MAINTAINERS linux-2.4.22/MAINTAINERS
--- linux-2.4.22.clean/MAINTAINERS 2003-08-25 13:44:39.000000000 +0200
+++ linux-2.4.22/MAINTAINERS 2003-09-27 14:06:41.000000000 +0200
@@ -940,7 +940,7 @@
IOC3 DRIVER
P: Ralf Baechle
-M: ralf@oss.sgi.com
+M: ralf@linux-mips.org
L: linux-mips@linux-mips.org
S: Maintained
@@ -1130,6 +1130,13 @@
M: zab@zabbo.net
S: Odd Fixes
+MARVELL MV64340 ETHERNET DRIVER
+P: Manish Lachwani
+M: Manish_Lachwani@pmc-sierra.com
+L: linux-mips@linux-mips.org
+L: netdev@oss.sgi.com
+S: Supported
+
MATROX FRAMEBUFFER DRIVER
P: Petr Vandrovec
M: vandrove@vc.cvut.cz
@@ -1151,7 +1158,7 @@
MIPS
P: Ralf Baechle
-M: ralf@gnu.org
+M: ralf@linux-mips.org
W: http://oss.sgi.com/mips/mips-howto.html
L: linux-mips@linux-mips.org
S: Maintained
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/Makefile linux-2.4.22/Makefile
--- linux-2.4.22.clean/Makefile 2003-08-25 13:44:44.000000000 +0200
+++ linux-2.4.22/Makefile 2003-09-27 17:01:16.000000000 +0200
@@ -5,7 +5,7 @@
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+ARCH = mips
KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -19,7 +19,7 @@
HOSTCC = gcc
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-CROSS_COMPILE =
+CROSS_COMPILE =
#
# Include the make variables (CC, etc...)
@@ -175,7 +175,6 @@
DRIVERS-$(CONFIG_PPC32) += drivers/macintosh/macintosh.o
DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o
DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o
-DRIVERS-$(CONFIG_SGI_IP22) += drivers/sgi/sgi.a
DRIVERS-$(CONFIG_VT) += drivers/video/video.o
DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a
DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o
@@ -220,6 +219,7 @@
drivers/scsi/aic7xxx/aicasm/aicdb.h \
drivers/scsi/aic7xxx/aicasm/y.tab.h \
drivers/scsi/53c700_d.h \
+ drivers/tc/lk201-map.c \
net/khttpd/make_times_h \
net/khttpd/times.h \
submenu*
@@ -460,10 +460,11 @@
$(MAKE) -C Documentation/DocBook mrproper
distclean: mrproper
- rm -f core `find . \( -not -type d \) -and \
- \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
- -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
- -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
+ find . \( -not -type d \) -and \
+ \( -name core -o -name '*.orig' -o -name '*.rej' \
+ -o -name '*~' -o -name '*.bak' -o -name '#*#' \
+ -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \
+ -o -name TAGS -o -name tags \) -print | env -i xargs rm -f
backup: mrproper
cd .. && tar cf - linux/ | gzip -9 > backup.gz
@@ -490,7 +491,7 @@
$(MAKE) -C Documentation/DocBook man
sums:
- find . -type f -print | sort | xargs sum > .SUMS
+ find . -type f -print | sort | env -i xargs sum > .SUMS
dep-files: scripts/mkdep archdep include/linux/version.h
rm -f .depend .hdepend
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/mm/mmap.c linux-2.4.22/mm/mmap.c
--- linux-2.4.22.clean/mm/mmap.c 2003-06-13 16:51:39.000000000 +0200
+++ linux-2.4.22/mm/mmap.c 2003-12-01 14:16:40.000000000 +0100
@@ -1041,6 +1041,9 @@
if (!len)
return addr;
+ if ((addr + len) > TASK_SIZE || (addr + len) < addr)
+ return -EINVAL;
+
/*
* mlock MCL_FUTURE?
*/
diff -Naur --exclude='*.orig' --exclude=CVS --exclude=.cvsignore --exclude='.#*' --exclude=README.Debian linux-2.4.22.clean/Rules.make linux-2.4.22/Rules.make
--- linux-2.4.22.clean/Rules.make 2002-08-03 02:39:42.000000000 +0200
+++ linux-2.4.22/Rules.make 2003-08-13 17:39:03.000000000 +0200
@@ -96,12 +96,12 @@
$(O_TARGET): $(obj-y)
rm -f $@
ifneq "$(strip $(obj-y))" ""
- $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^)
+ $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^)
else
$(AR) rcs $@
endif
@ ( \
- echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFLAGS) $$(obj-y))))' ; \
+ echo 'ifeq ($(strip $(subst $(comma),:,$(LDFLAGS) $(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(LDFLAGS) $$(EXTRA_LDFLAGS) $$(obj-y))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
echo 'endif' \
) > $(dir $@)/.$(notdir $@).flags
|