summaryrefslogtreecommitdiffstats
path: root/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0032-Create-snapshot-of-OpenBMC.patch
blob: f84dc629c1fd471eb1e16c6aba2f8a383a5d6f89 (plain)
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
From 19459c799ac0a521082d6d79e68ffc3decb18ea2 Mon Sep 17 00:00:00 2001
From: Ori Bernstein <orib@fb.com>
Date: Thu, 3 Sep 2015 11:28:27 -0700
Subject: [PATCH] Create snapshot of OpenBMC

---
 .../arch/arm/configs/wedge_defconfig               |    1 +
 .../arch/arm/configs/yosemite_defconfig            | 1480 ++++++++++++++++++++
 .../arch/arm/include/asm/ioctls.h                  |    1 +
 .../arch/arm/mach-aspeed/Kconfig                   |   12 +
 .../arch/arm/mach-aspeed/gpio.c                    |    2 +-
 .../arm/mach-aspeed/include/mach/debug-macro.S     |    4 +-
 .../arch/arm/mach-aspeed/include/mach/platform.h   |   17 +-
 .../arch/arm/mach-aspeed/include/mach/uncompress.h |    6 +-
 .../arch/arm/mach-aspeed/include/mach/vmalloc.h    |    4 +-
 .../arch/arm/plat-aspeed/ast-scu.c                 |  372 ++---
 .../arch/arm/plat-aspeed/dev-eth.c                 |   35 +-
 .../arch/arm/plat-aspeed/dev-i2c.c                 |  385 +++--
 .../arch/arm/plat-aspeed/dev-spi.c                 |   27 +-
 .../arch/arm/plat-aspeed/dev-uart.c                |   50 +-
 .../arch/arm/plat-aspeed/irq.c                     |   28 +-
 .../linux-aspeed-2.6.28.9/drivers/hwmon/ast_adc.c  |  233 +--
 .../drivers/i2c/busses/i2c-ast.c                   |  689 +++++----
 .../linux-aspeed-2.6.28.9/drivers/i2c/i2c-core.c   |   15 +-
 .../linux-aspeed-2.6.28.9/drivers/i2c/i2c-dev.c    |  113 +-
 .../drivers/net/ftgmac100_26.c                     | 1211 ++++++++++++++--
 .../drivers/net/ftgmac100_26.h                     |   67 +-
 .../linux-aspeed-2.6.28.9/drivers/rtc/rtc-aspeed.c |   42 +-
 .../linux-aspeed-2.6.28.9/drivers/serial/8250.c    |   39 +-
 .../linux-aspeed-2.6.28.9/drivers/watchdog/Kconfig |    9 +-
 .../drivers/watchdog/ast_wdt.c                     |   27 +
 .../files/linux-aspeed-2.6.28.9/fs/compat_ioctl.c  |   51 +-
 .../linux-aspeed-2.6.28.9/include/linux/i2c-dev.h  |    1 +
 .../linux-aspeed-2.6.28.9/include/linux/i2c.h      |    6 +
 ...m25p80-Add-support-for-the-Winbond-W25Q64.patch |   29 +
 ...t-leak-packets-when-a-netns-is-going-down.patch |   56 +
 ...int-error-value-when-skb-allocation-fails.patch |   43 +
 .../recipes-kernel/linux/linux-aspeed_2.6.28.9.bb  |   17 +-
 34 files changed, 7064 insertions(+), 950 deletions(-)
 create mode 100644 arch/arm/configs/fbplatform1_defconfig
 create mode 100644 arch/arm/configs/yosemite_defconfig
 create mode 100644 meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0029-mtd-m25p80-Add-support-for-the-Winbond-W25Q64.patch
 create mode 100644 meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0030-net-Don-t-leak-packets-when-a-netns-is-going-down.patch
 create mode 100644 meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0031-IPv6-Print-error-value-when-skb-allocation-fails.patch

diff --git a/arch/arm/configs/wedge_defconfig b/arch/arm/configs/wedge_defconfig
index 23a9fe3..41fe288 100644
--- a/arch/arm/configs/wedge_defconfig
+++ b/arch/arm/configs/wedge_defconfig
@@ -174,6 +174,7 @@ CONFIG_IRMP=y
 # CONFIG_ARCH_AST2200 is not set
 # CONFIG_ARCH_AST2300 is not set
 CONFIG_ARCH_AST2400=y
+CONFIG_WEDGE=y
 # CONFIG_ARCH_AST2500 is not set
 
 #
diff --git a/arch/arm/configs/yosemite_defconfig b/arch/arm/configs/yosemite_defconfig
new file mode 100644
index 0000000..d32f18e
--- /dev/null
+++ b/arch/arm/configs/yosemite_defconfig
@@ -0,0 +1,1480 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28.9
+# Tue Feb  3 16:41:40 2015
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_BZIP2 is not set
+# CONFIG_KERNEL_LZMA is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=16
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_CLASSIC_RCU=y
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_ARCH_ASPEED=y
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_MSM is not set
+CONFIG_IRMP=y
+# CONFIG_PCEXT is not set
+# CONFIG_REMOTEFX is not set
+# CONFIG_ARCH_AST1100 is not set
+# CONFIG_ARCH_AST2100 is not set
+# CONFIG_ARCH_AST2200 is not set
+# CONFIG_ARCH_AST2300 is not set
+CONFIG_ARCH_AST2400=y
+CONFIG_YOSEMITE=y
+# CONFIG_ARCH_AST2500 is not set
+
+#
+# FLASH Chip Select
+#
+# CONFIG_AST_CS0_NOR is not set
+# CONFIG_AST_CS0_NAND is not set
+CONFIG_AST_CS0_SPI=y
+# CONFIG_AST_CS0_NONE is not set
+# CONFIG_AST_CS1_NOR is not set
+# CONFIG_AST_CS1_NAND is not set
+# CONFIG_AST_CS1_SPI is not set
+CONFIG_AST_CS1_NONE=y
+# CONFIG_AST_CS2_NOR is not set
+# CONFIG_AST_CS2_NAND is not set
+# CONFIG_AST_CS2_SPI is not set
+CONFIG_AST_CS2_NONE=y
+# CONFIG_AST_CS3_NOR is not set
+# CONFIG_AST_CS3_NAND is not set
+# CONFIG_AST_CS3_SPI is not set
+CONFIG_AST_CS3_NONE=y
+# CONFIG_AST_CS4_NOR is not set
+# CONFIG_AST_CS4_NAND is not set
+# CONFIG_AST_CS4_SPI is not set
+CONFIG_AST_CS4_NONE=y
+# CONFIG_ARCH_AST1070 is not set
+# CONFIG_AST_SCU_LOCK is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+CONFIG_PLAT_ASPEED=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+CONFIG_ARM_AMBA=y
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=100
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+CONFIG_FPE_NWFPE_XP=y
+# CONFIG_FPE_FASTFPE is not set
+CONFIG_VFP=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=y
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+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_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+CONFIG_VLAN_8021Q=m
+# CONFIG_VLAN_8021Q_GVRP is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=y
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_DATAFLASH=m
+CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y
+# CONFIG_MTD_DATAFLASH_OTP is not set
+CONFIG_MTD_M25P80=y
+CONFIG_M25PXX_USE_FAST_READ=y
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+CONFIG_BLK_DEV_NBD=y
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=16384
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_RD_BZIP2 is not set
+CONFIG_RD_LZMA=y
+CONFIG_RD_GZIP=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+CONFIG_SCSI_TGT=y
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+CONFIG_SCSI_ISCSI_ATTRS=m
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+CONFIG_BONDING=m
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NETDEV_1000=y
+CONFIG_ASPEEDMAC=y
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_SERIAL=y
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_AMBAKMI is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_N_HDLC is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALDRV is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=5
+CONFIG_SERIAL_8250_RUNTIME_UARTS=5
+# CONFIG_SERIAL_AST_DMA_UART is not set
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_AMBA_PL010 is not set
+# CONFIG_SERIAL_AMBA_PL011 is not set
+# CONFIG_SERIAL_AST is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_AST_MISC=y
+# CONFIG_AST_VIDEO is not set
+# CONFIG_ADC_CAT9883 is not set
+# CONFIG_AST_SPI_BIOS is not set
+CONFIG_AST_PECI=y
+# CONFIG_AST_KCS is not set
+# CONFIG_AST_GPIO is not set
+# CONFIG_HW_RANDOM is not set
+CONFIG_NVRAM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_AST=y
+CONFIG_AST_I2C_SLAVE_MODE=y
+# CONFIG_AST_I2C_SLAVE_EEPROM is not set
+CONFIG_AST_I2C_SLAVE_RDWR=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+CONFIG_AT24=m
+# CONFIG_SENSORS_EEPROM is not set
+CONFIG_SENSORS_PCF8574=m
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_AST=y
+CONFIG_SPI_FMC=y
+CONFIG_SPI_BITBANG=y
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_AT25=m
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM70 is not set
+CONFIG_SENSORS_LM75=m
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+CONFIG_SENSORS_MAX127=m
+# CONFIG_SENSORS_MAX1111 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+CONFIG_SENSORS_ADS7828=m
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+CONFIG_SENSORS_AST_ADC=y
+CONFIG_SENSORS_AST_PWM_FAN=y
+# CONFIG_SENSORS_FB_PANTHER_PLUS is not set
+CONFIG_PMBUS=m
+CONFIG_SENSORS_PMBUS=m
+CONFIG_SENSORS_ADM1275=m
+# CONFIG_SENSORS_LM25066 is not set
+# CONFIG_SENSORS_LTC2978 is not set
+# CONFIG_SENSORS_MAX16064 is not set
+# CONFIG_SENSORS_MAX34440 is not set
+# CONFIG_SENSORS_MAX8688 is not set
+CONFIG_SENSORS_PFE1100=m
+CONFIG_SENSORS_PFE3000=m
+# CONFIG_SENSORS_UCD9000 is not set
+# CONFIG_SENSORS_UCD9200 is not set
+# CONFIG_SENSORS_ZL6100 is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AST_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+
+#
+# AST USB Drivers
+#
+CONFIG_AST_USB_UHCI_HCD=y
+# CONFIG_AST_USB_UHCI_MULTIPORT_1 is not set
+# CONFIG_AST_USB_UHCI_MULTIPORT_2 is not set
+CONFIG_AST_USB_UHCI_MULTIPORT_4=y
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+
+#
+# see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# 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_USBAT 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_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+CONFIG_USB_GADGET_ASPEED_AST=y
+CONFIG_USB_ASPEED_AST=y
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+CONFIG_USB_CDC_COMPOSITE=m
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+# CONFIG_RTC_HCTOSYS is not set
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_RTC_DRV_PL030 is not set
+# CONFIG_RTC_DRV_PL031 is not set
+CONFIG_RTC_DRV_ASPEED=y
+# CONFIG_DMADEVICES is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=y
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS 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_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set
+# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
+# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
+# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+CONFIG_NLS_CODEPAGE_936=y
+CONFIG_NLS_CODEPAGE_950=y
+CONFIG_NLS_CODEPAGE_932=y
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_DEBUG_USER is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_NULL=y
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+
+
+# GUC USB Drivers
+#
+CONFIG_GUC_USB_UHCI_HCD=m
+# CONFIG_GUC_USB_UHCI_MULTIPORT_1 is not set
+# CONFIG_GUC_USB_UHCI_MULTIPORT_2 is not set
+CONFIG_GUC_USB_UHCI_MULTIPORT_4=y
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
diff --git a/arch/arm/include/asm/ioctls.h b/arch/arm/include/asm/ioctls.h
index a91d8a1..fd50ffe 100644
--- a/arch/arm/include/asm/ioctls.h
+++ b/arch/arm/include/asm/ioctls.h
@@ -65,6 +65,7 @@
 #define TIOCSERGETLSR   0x5459 /* Get line status register */
 #define TIOCSERGETMULTI 0x545A /* Get multiport config  */
 #define TIOCSERSETMULTI 0x545B /* Set multiport config */
+#define TIOCSERWAITTEMT 0x5499 /* Wait for empty */
 
 #define TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
 #define TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
diff --git a/arch/arm/mach-aspeed/Kconfig b/arch/arm/mach-aspeed/Kconfig
index a948ab8..6d548f8 100644
--- a/arch/arm/mach-aspeed/Kconfig
+++ b/arch/arm/mach-aspeed/Kconfig
@@ -203,6 +203,18 @@ endchoice
 config AST_SCU_LOCK
 	bool "AST SCU Protection Key"
 
+config WEDGE
+	bool "Facebook Wedge/6-Pack"
+
+config WEDGE100
+	bool "Facebook Wedge100"
+
+config YOSEMITE
+	bool "Facebook Yosemite"
+
+config FBPLATFORM1
+	bool "Facebook Platform1"
+
 # Support PCIE
 config PCIE
         bool "ASPEED PCIE support"
diff --git a/arch/arm/mach-aspeed/gpio.c b/arch/arm/mach-aspeed/gpio.c
index 3a633e9..e56ca35 100644
--- a/arch/arm/mach-aspeed/gpio.c
+++ b/arch/arm/mach-aspeed/gpio.c
@@ -232,7 +232,7 @@ static struct ast_gpio_bank ast_gpio_gp[] = {
 	AST_GPIO_BANK("GPIOR", IO_ADDRESS(AST_GPIO_BASE), 1, 0x080, 0x084, 0x118, 0x11c, 0x128, 0x12c, 0x130, 0x110),	
 	AST_GPIO_BANK("GPIOS", IO_ADDRESS(AST_GPIO_BASE), 2, 0x080, 0x084, 0x118, 0x11c, 0x128, 0x12c, 0x130, 0x110),
 #if defined(CONFIG_ARCH_AST2400)		
-	AST_GPIO_BANK("GPIOT", IO_ADDRESS(AST_GPIO_BASE), 4, 0x080, 0x084, 0x118, 0x11c, 0x128, 0x12c, 0x130, 0x110),	
+	AST_GPIO_BANK("GPIOT", IO_ADDRESS(AST_GPIO_BASE), 3, 0x080, 0x084, 0x118, 0x11c, 0x128, 0x12c, 0x130, 0x110),	
 	AST_GPIO_BANK("GPIOU", IO_ADDRESS(AST_GPIO_BASE), 0, 0x088, 0x08c, 0x148, 0x14c, 0x158, 0x15c, 0x160, 0x140),
 	AST_GPIO_BANK("GPIOV", IO_ADDRESS(AST_GPIO_BASE), 1, 0x088, 0x08c, 0x148, 0x14c, 0x158, 0x15c, 0x160, 0x140),
 	AST_GPIO_BANK("GPIOW", IO_ADDRESS(AST_GPIO_BASE), 2, 0x088, 0x08c, 0x148, 0x14c, 0x158, 0x15c, 0x160, 0x140),
diff --git a/arch/arm/mach-aspeed/include/mach/debug-macro.S b/arch/arm/mach-aspeed/include/mach/debug-macro.S
index ff3195a..33fc879 100644
--- a/arch/arm/mach-aspeed/include/mach/debug-macro.S
+++ b/arch/arm/mach-aspeed/include/mach/debug-macro.S
@@ -13,8 +13,8 @@
 	.macro	addruart, rx, tmp
 	mrc 	p15, 0, \rx, c1, c0
 	tst 	\rx, #1 								@ MMU enabled?
-	ldreq   \rx, =AST_UART3_BASE
-	ldrne	\rx, =IO_ADDRESS(AST_UART3_BASE)
+	ldreq   \rx, =AST_UART_BASE
+	ldrne	\rx, =IO_ADDRESS(AST_UART_BASE)
 	.endm
 	
 #define UART_SHIFT      2
diff --git a/arch/arm/mach-aspeed/include/mach/platform.h b/arch/arm/mach-aspeed/include/mach/platform.h
index 8951ffc..4d6c50c 100644
--- a/arch/arm/mach-aspeed/include/mach/platform.h
+++ b/arch/arm/mach-aspeed/include/mach/platform.h
@@ -62,5 +62,20 @@
  * Watchdog
  */
 #define AST_WDT_VA_BASE		(IO_ADDRESS(AST_WDT_BASE))
- 
+
+/*
+ * Console UART
+ */
+#ifdef CONFIG_WEDGE
+#define AST_UART_BASE AST_UART3_BASE
+#elif defined(CONFIG_WEDGE100)
+#define AST_UART_BASE AST_UART3_BASE
+#elif defined(CONFIG_YOSEMITE)
+#define AST_UART_BASE AST_UART0_BASE
+#elif defined(CONFIG_FBPLATFORM1)
+#define AST_UART_BASE AST_UART0_BASE
+#else
+#define AST_UART_BASE AST_UART0_BASE
+#endif
+
 #endif
diff --git a/arch/arm/mach-aspeed/include/mach/uncompress.h b/arch/arm/mach-aspeed/include/mach/uncompress.h
index 80e560d..3be04b0 100644
--- a/arch/arm/mach-aspeed/include/mach/uncompress.h
+++ b/arch/arm/mach-aspeed/include/mach/uncompress.h
@@ -12,8 +12,8 @@
 #include <mach/platform.h>
 #include <mach/aspeed_serial.h>
 
-#define UART_PUT_CHAR   (*(volatile unsigned char *)(AST_UART3_BASE + UART_THR))
-#define UART_GET_LSR   (*(volatile unsigned char *)(AST_UART3_BASE + UART_LSR))
+#define UART_PUT_CHAR   (*(volatile unsigned char *)(AST_UART_BASE + UART_THR))
+#define UART_GET_LSR   (*(volatile unsigned char *)(AST_UART_BASE + UART_LSR))
 
 static void putc(int c)
 {
@@ -21,7 +21,7 @@ static void putc(int c)
 	/* wait for space in the UART's transmitter */
 	while (!(UART_GET_LSR & UART_LSR_THRE))
 		barrier();
-	
+
 	/* send the character out. */
 	UART_PUT_CHAR = c;
 }
diff --git a/arch/arm/mach-aspeed/include/mach/vmalloc.h b/arch/arm/mach-aspeed/include/mach/vmalloc.h
index 51912ae..bc1b471 100644
--- a/arch/arm/mach-aspeed/include/mach/vmalloc.h
+++ b/arch/arm/mach-aspeed/include/mach/vmalloc.h
@@ -25,5 +25,5 @@
 #define VMALLOC_VMADDR(x) ((unsigned long)(x))
 #define VMALLOC_END       (PAGE_OFFSET + 0x20000000)
 #else
-#define VMALLOC_END                     0xf8000000UL
-#endif
\ No newline at end of file
+#define VMALLOC_END       0xf8000000UL
+#endif
diff --git a/arch/arm/plat-aspeed/ast-scu.c b/arch/arm/plat-aspeed/ast-scu.c
index 76722f4..101b141 100644
--- a/arch/arm/plat-aspeed/ast-scu.c
+++ b/arch/arm/plat-aspeed/ast-scu.c
@@ -1,20 +1,20 @@
 /********************************************************************************
-* File Name     : arch/arm/plat-aspeed/ast-scu.c 
+* File Name     : arch/arm/plat-aspeed/ast-scu.c
 * Author         : Ryan Chen
-* Description   : AST SCU 
-* 
+* Description   : AST SCU
+*
 * Copyright (C) 2012-2020  ASPEED Technology Inc.
-* 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 
-
-CLK24M 
+* 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
+
+CLK24M
  |
  |--> H-PLL -->HCLK
  |
@@ -27,9 +27,9 @@ CLK24M
  |--> USB2PHY -->UTMICLK
 
 
-*   History      : 
+*   History      :
 *    1. 2012/08/15 Ryan Chen Create
-* 
+*
 ********************************************************************************/
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -56,34 +56,34 @@ CLK24M
 
 static u32 ast_scu_base = IO_ADDRESS(AST_SCU_BASE);
 
-static inline u32 
+static inline u32
 ast_scu_read(u32 reg)
 {
 	u32 val;
-		
+
 	val = readl(ast_scu_base + reg);
-	
+
 	SCUDBUG("ast_scu_read : reg = 0x%08x, val = 0x%08x\n", reg, val);
-	
+
 	return val;
 }
 
 static inline void
-ast_scu_write(u32 val, u32 reg) 
+ast_scu_write(u32 val, u32 reg)
 {
 	SCUDBUG("ast_scu_write : reg = 0x%08x, val = 0x%08x\n", reg, val);
 #ifdef CONFIG_AST_SCU_LOCK
-	//unlock 
+	//unlock
 	writel(SCU_PROTECT_UNLOCK, ast_scu_base);
 	writel(val, ast_scu_base + reg);
 	//lock
-	writel(0xaa,ast_scu_base);	
+	writel(0xaa,ast_scu_base);
 #else
 	writel(val, ast_scu_base + reg);
 #endif
 }
 
-//SoC mapping Table 
+//SoC mapping Table
 struct soc_id {
 	const char	* name;
 	u32	rev_id;
@@ -180,9 +180,9 @@ ast_scu_init_video(u8 dynamic_en)
 		ast_scu_write((ast_scu_read(AST_SCU_CLK_SEL) & ~SCU_CLK_VIDEO_SLOW_MASK) | SCU_CLK_VIDEO_SLOW_EN | SCU_CLK_VIDEO_SLOW_SET(0), AST_SCU_CLK_SEL);
 	else
 		ast_scu_write((ast_scu_read(AST_SCU_CLK_SEL) & ~SCU_ECLK_SOURCE_MASK) | SCU_ECLK_SOURCE(2), AST_SCU_CLK_SEL);
-	
+
 	// Enable CLK
-	ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) & ~(SCU_ECLK_STOP_EN | SCU_VCLK_STOP_EN), AST_SCU_CLK_STOP);	
+	ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) & ~(SCU_ECLK_STOP_EN | SCU_VCLK_STOP_EN), AST_SCU_CLK_STOP);
 	mdelay(10);
 	ast_scu_write(ast_scu_read(AST_SCU_RESET) | SCU_RESET_VIDEO, AST_SCU_RESET);
 	udelay(100);
@@ -201,32 +201,32 @@ ast_scu_init_eth(u8 num)
 		ast_scu_write((ast_scu_read(AST_SCU_CLK_SEL) & ~SCU_CLK_MAC_MASK) | SCU_CLK_MAC_DIV(4), AST_SCU_CLK_SEL);
 
 	//Set MAC delay Timing
-	ast_scu_write(0x2255, AST_SCU_MAC_CLK);	
+	ast_scu_write(0x2255, AST_SCU_MAC_CLK);
 
 	switch(num) {
 		case 0:
-			ast_scu_write(ast_scu_read(AST_SCU_RESET) | SCU_RESET_MAC0, 
-							AST_SCU_RESET);		
+			ast_scu_write(ast_scu_read(AST_SCU_RESET) | SCU_RESET_MAC0,
+							AST_SCU_RESET);
 			udelay(100);
-			ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) & ~SCU_MAC0CLK_STOP_EN, 
-							AST_SCU_CLK_STOP);		
+			ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) & ~SCU_MAC0CLK_STOP_EN,
+							AST_SCU_CLK_STOP);
 			udelay(1000);
-			ast_scu_write(ast_scu_read(AST_SCU_RESET) & ~SCU_RESET_MAC0, 
-							AST_SCU_RESET);		
-			
+			ast_scu_write(ast_scu_read(AST_SCU_RESET) & ~SCU_RESET_MAC0,
+							AST_SCU_RESET);
+
 			break;
 		case 1:
-			ast_scu_write(ast_scu_read(AST_SCU_RESET) | SCU_RESET_MAC1, 
-							AST_SCU_RESET);			
+			ast_scu_write(ast_scu_read(AST_SCU_RESET) | SCU_RESET_MAC1,
+							AST_SCU_RESET);
 			udelay(100);
-			ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) & ~SCU_MAC1CLK_STOP_EN, 
-							AST_SCU_CLK_STOP);		
+			ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) & ~SCU_MAC1CLK_STOP_EN,
+							AST_SCU_CLK_STOP);
 			udelay(1000);
-			ast_scu_write(ast_scu_read(AST_SCU_RESET) & ~SCU_RESET_MAC1, 
-							AST_SCU_RESET);			
+			ast_scu_write(ast_scu_read(AST_SCU_RESET) & ~SCU_RESET_MAC1,
+							AST_SCU_RESET);
 			break;
-			
-	}		
+
+	}
 }
 
 
@@ -292,7 +292,7 @@ ast_scu_init_sdhci(void)
 {
 	//SDHCI Host's Clock Enable and Reset
 	ast_scu_write(ast_scu_read(AST_SCU_RESET) | SCU_RESET_SD, AST_SCU_RESET);
-	
+
 	ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) & ~SCU_SDCLK_STOP_EN, AST_SCU_CLK_STOP);
 	mdelay(10);
 
@@ -300,10 +300,10 @@ ast_scu_init_sdhci(void)
 	mdelay(10);
 
 	// SDCLK = H-PLL / 4
-	ast_scu_write((ast_scu_read(AST_SCU_CLK_SEL) & ~SCU_CLK_SD_MASK) | SCU_CLK_SD_DIV(1), 
+	ast_scu_write((ast_scu_read(AST_SCU_CLK_SEL) & ~SCU_CLK_SD_MASK) | SCU_CLK_SD_DIV(1),
 		AST_SCU_CLK_SEL);
 	mdelay(10);
-	
+
 	ast_scu_write(ast_scu_read(AST_SCU_RESET) & ~SCU_RESET_SD, AST_SCU_RESET);
 }
 
@@ -358,13 +358,13 @@ EXPORT_SYMBOL(ast_scu_init_jtag);
 extern void
 ast_scu_init_lpc(void)
 {
-	//Note .. It have been enable in U-boot..... 
+	//Note .. It have been enable in U-boot.....
 //	ast_scu_write(ast_scu_read(AST_SCU_RESET) | SCU_RESET_LPC, AST_SCU_RESET);
 
 	//enable LPC clock LHCLK = H-PLL/8
-	ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) | 
-					SCU_SET_LHCLK_DIV(3) | 
-					SCU_LHCLK_SOURCE_EN, 
+	ast_scu_write(ast_scu_read(AST_SCU_CLK_STOP) |
+					SCU_SET_LHCLK_DIV(3) |
+					SCU_LHCLK_SOURCE_EN,
 					AST_SCU_CLK_STOP);
 
 }
@@ -377,7 +377,7 @@ ast_scu_get_lpc_plus_enable(void)
 {
 	if(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & SCU_FUN_PIN_LPC_PLUS)
 		return 1;
-	else 
+	else
 		return 0;
 }
 
@@ -390,10 +390,10 @@ ast_scu_init_crt(void)
 #if defined(CONFIG_AST_DAC) || defined(CONFIG_AST_DVO)
 	ast_scu_write((ast_scu_read(AST_SCU_MISC1_CTRL) & ~(SCU_MISC_D2_PLL_DIS | SCU_MISC_DAC_MASK))
 				| SCU_MISC_DAC_SOURCE_CRT | SCU_MISC_DVO_SOURCE_CRT | SCU_MISC_2D_CRT_EN , AST_SCU_MISC1_CTRL);
-#elif defined(CONFIG_AST_DVO) 
+#elif defined(CONFIG_AST_DVO)
 	ast_scu_write((ast_scu_read(AST_SCU_MISC1_CTRL) & ~(SCU_MISC_D2_PLL_DIS)) |
 				SCU_MISC_DVO_SOURCE_CRT| SCU_MISC_2D_CRT_EN, AST_SCU_MISC1_CTRL);
-#else //default(CONFIG_AST_DAC) 
+#else //default(CONFIG_AST_DAC)
 	ast_scu_write((ast_scu_read(AST_SCU_MISC1_CTRL) & ~(SCU_MISC_D2_PLL_DIS | SCU_MISC_DAC_MASK))
 				| SCU_MISC_DAC_SOURCE_CRT | SCU_MISC_2D_CRT_EN, AST_SCU_MISC1_CTRL);
 #endif
@@ -401,7 +401,7 @@ ast_scu_init_crt(void)
 	ast_scu_write((ast_scu_read(AST_SCU_CLK_SEL) & ~SCU_CLK_VIDEO_DELAY_MASK) |
 						SCU_CLK_VIDEO_DELAY(5), AST_SCU_CLK_SEL);
 
-	/* Reset CRT */ 
+	/* Reset CRT */
 	ast_scu_write(ast_scu_read(AST_SCU_RESET) | SCU_RESET_CRT, AST_SCU_RESET);
 
 	//enable D2 CLK
@@ -409,7 +409,7 @@ ast_scu_init_crt(void)
 
 	udelay(10);
 	ast_scu_write(ast_scu_read(AST_SCU_RESET) & ~SCU_RESET_CRT, AST_SCU_RESET);
-	
+
 }
 
 EXPORT_SYMBOL(ast_scu_init_crt);
@@ -448,7 +448,7 @@ ast_get_h_pll_clk(void)
 
 	if(h_pll_set & SCU_H_PLL_OFF)
 		return 0;
-	
+
 	if(h_pll_set & SCU_H_PLL_PARAMETER) {
 		// Programming
 		clk = ast_get_clk_source();
@@ -470,21 +470,21 @@ ast_get_h_pll_clk(void)
 		speed = SCU_HW_STRAP_GET_H_PLL_CLK(ast_scu_read(AST_SCU_HW_STRAP1));
 		switch (speed) {
 			case 0:
-				clk = 384000000; 
+				clk = 384000000;
 				break;
 			case 1:
-				clk = 360000000; 
+				clk = 360000000;
 				break;
 			case 2:
-				clk = 336000000; 
+				clk = 336000000;
 				break;
 			case 3:
-				clk = 408000000; 
+				clk = 408000000;
 				break;
 			default:
-				BUG(); 
+				BUG();
 				break;
-		}		
+		}
 	}
 	SCUDBUG("h_pll = %d\n",clk);
 	return clk;
@@ -500,7 +500,7 @@ ast_get_m_pll_clk(void)
 
 	if(m_pll_set & SCU_M_PLL_OFF)
 		return 0;
-	
+
 	// Programming
 	clk = ast_get_clk_source();
 	if(m_pll_set & SCU_M_PLL_BYPASS_EN) {
@@ -542,10 +542,10 @@ ast_get_ahbclk(void)
 		case 3:
 			div = 4;
 		break;
-		
+
 	}
-	
-	SCUDBUG("HPLL=%d, Div=%d, AHB CLK=%d\n", hpll, div, hpll/div);	
+
+	SCUDBUG("HPLL=%d, Div=%d, AHB CLK=%d\n", hpll, div, hpll/div);
 	return (hpll/div);
 
 }
@@ -559,8 +559,8 @@ ast_get_pclk(void)
 	hpll = ast_get_h_pll_clk();
 	div = SCU_GET_PCLK_DIV(ast_scu_read(AST_SCU_CLK_SEL));
 	div = (div+1) << 1;
-	
-	SCUDBUG("HPLL=%d, Div=%d, PCLK=%d\n", hpll, div, hpll/div);	
+
+	SCUDBUG("HPLL=%d, Div=%d, PCLK=%d\n", hpll, div, hpll/div);
 	return (hpll/div);
 
 }
@@ -572,7 +572,7 @@ ast_get_lhclk(void)
 	unsigned int div, hpll;
 	u32 clk_sel = ast_scu_read(AST_SCU_CLK_SEL);
 //FPGA AST1070 is default 100/2 Mhz input
-//	return 50000000;	
+//	return 50000000;
 	hpll = ast_get_h_pll_clk();
 	if(SCU_LHCLK_SOURCE_EN & clk_sel) {
 		div = SCU_GET_LHCLK_DIV(clk_sel);
@@ -600,10 +600,10 @@ ast_get_lhclk(void)
 			break;
 			case 7:
 				div = 16;
-			break;			
+			break;
 		}
-		
-		SCUDBUG("HPLL=%d, Div=%d, LHCLK = %d\n", hpll, div, hpll/div);	
+
+		SCUDBUG("HPLL=%d, Div=%d, LHCLK = %d\n", hpll, div, hpll/div);
 		return (hpll/div);
 	} else {
 		SCUMSG("LPC CLK not enable \n");
@@ -704,7 +704,7 @@ ast_get_sd_clock_src(void)
 		sd_div = SCU_CLK_SD_GET_DIV(ast_scu_read(AST_SCU_CLK_SEL));
 		SCUDBUG("div %d, sdclk =%d \n",((sd_div + 1) * 2),clk/((sd_div + 1) * 2));
 		clk /= ((sd_div + 1) * 2);
-		
+
 #endif
 	return clk;
 }
@@ -717,7 +717,7 @@ ast_scu_show_system_info (void)
 	u32 h_pll, div;
 
 	h_pll = ast_get_h_pll_clk();
-	
+
 	div = SCU_HW_STRAP_GET_CPU_AHB_RATIO(ast_scu_read(AST_SCU_HW_STRAP1));
 	switch(div) {
 		case 0:
@@ -732,10 +732,10 @@ ast_scu_show_system_info (void)
 		case 3:
 			div = 4;
 		break;
-		
+
 	}
 
-	SCUMSG("CPU = %d MHz ,AHB = %d MHz (%d:1) \n", h_pll/1000000, h_pll/div/1000000,div); 
+	SCUMSG("CPU = %d MHz ,AHB = %d MHz (%d:1) \n", h_pll/1000000, h_pll/div/1000000,div);
 
 	return ;
 }
@@ -750,54 +750,68 @@ ast_scu_multi_func_uart(u8 uart)
 		case 1:
 			ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL2) |
 						SCU_FUN_PIN_UART1_RXD |
+#ifdef CONFIG_YOSEMITE
+						SCU_FUN_PIN_UART1_TXD,
+#else
 						SCU_FUN_PIN_UART1_TXD |
 						SCU_FUN_PIN_UART1_NRTS |
 						SCU_FUN_PIN_UART1_NDTR |
 						SCU_FUN_PIN_UART1_NRI |
 						SCU_FUN_PIN_UART1_NDSR |
 						SCU_FUN_PIN_UART1_NDCD |
-						SCU_FUN_PIN_UART1_NCTS, 
-				AST_SCU_FUN_PIN_CTRL2); 
-			break;		
+						SCU_FUN_PIN_UART1_NCTS,
+#endif
+				AST_SCU_FUN_PIN_CTRL2);
+			break;
 		case 2:
 			ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL2) |
 						SCU_FUN_PIN_UART2_RXD |
+#ifdef CONFIG_YOSEMITE
+						SCU_FUN_PIN_UART2_TXD,
+#else
 						SCU_FUN_PIN_UART2_TXD |
 						SCU_FUN_PIN_UART2_NRTS |
 						SCU_FUN_PIN_UART2_NDTR |
 						SCU_FUN_PIN_UART2_NRI |
 						SCU_FUN_PIN_UART2_NDSR |
 						SCU_FUN_PIN_UART2_NDCD |
-						SCU_FUN_PIN_UART2_NCTS, 
-				AST_SCU_FUN_PIN_CTRL2); 
-			break;		
+						SCU_FUN_PIN_UART2_NCTS,
+#endif
+				AST_SCU_FUN_PIN_CTRL2);
+			break;
 		case 3:
 			ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) |
 						SCU_FUN_PIN_UART3_RXD |
+#ifdef CONFIG_YOSEMITE
+						SCU_FUN_PIN_UART3_TXD,
+#else
 						SCU_FUN_PIN_UART3_TXD |
 						SCU_FUN_PIN_UART3_NRTS |
 						SCU_FUN_PIN_UART3_NDTR |
 						SCU_FUN_PIN_UART3_NRI |
 						SCU_FUN_PIN_UART3_NDSR |
 						SCU_FUN_PIN_UART3_NDCD |
-						SCU_FUN_PIN_UART3_NCTS, 
-				AST_SCU_FUN_PIN_CTRL1); 
+						SCU_FUN_PIN_UART3_NCTS,
+#endif
+				AST_SCU_FUN_PIN_CTRL1);
 			break;
 		case 4:
 			ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) |
 						SCU_FUN_PIN_UART4_RXD |
+#ifdef CONFIG_YOSEMITE
+						SCU_FUN_PIN_UART4_TXD,
+#else
 						SCU_FUN_PIN_UART4_TXD |
 						SCU_FUN_PIN_UART4_NRTS |
 						SCU_FUN_PIN_UART4_NDTR |
 						SCU_FUN_PIN_UART4_NRI |
 						SCU_FUN_PIN_UART4_NDSR |
 						SCU_FUN_PIN_UART4_NDCD |
-						SCU_FUN_PIN_UART4_NCTS, 
-				AST_SCU_FUN_PIN_CTRL1); 			
+						SCU_FUN_PIN_UART4_NCTS,
+#endif
+				AST_SCU_FUN_PIN_CTRL1);
 			break;
 	}
-
-
 }
 
 extern void
@@ -806,13 +820,13 @@ ast_scu_multi_func_video()
 #if defined(CONFIG_ARCH_2100) || defined(CONFIG_ARCH_2200)
 	ast_scu_write(ast_scu_read(AST_SCU_MULTI_FUNC_2) |
 				MULTI_FUNC_VIDEO_RGB18 |
-				MULTI_FUNC_VIDEO_SINGLE_EDGE, 
-		AST_SCU_MULTI_FUNC_2); 
+				MULTI_FUNC_VIDEO_SINGLE_EDGE,
+		AST_SCU_MULTI_FUNC_2);
 #elif defined(CONFIG_ARCH_1100) || defined(CONFIG_ARCH_2050)
 	ast_scu_write(ast_scu_read(AST_SCU_MULTI_FUNC_2) |
 				MULTI_FUNC_VIDEO_RGB18 |
-				MULTI_FUNC_VIDEO_SINGLE_EDGE, 
-		AST_SCU_MULTI_FUNC_2); 
+				MULTI_FUNC_VIDEO_SINGLE_EDGE,
+		AST_SCU_MULTI_FUNC_2);
 #else
 
 #endif
@@ -823,40 +837,40 @@ ast_scu_multi_func_eth(u8 num)
 {
 	switch(num) {
 		case 0:
-			if(ast_scu_read(AST_SCU_HW_STRAP1) && SCU_HW_STRAP_MAC0_RGMII) {
+			if(ast_scu_read(AST_SCU_HW_STRAP1) & SCU_HW_STRAP_MAC0_RGMII) {
 				SCUMSG("MAC0 : RGMII \n");
-				ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) | 
-							SCU_FUN_PIN_MAC0_PHY_LINK, 
-					AST_SCU_FUN_PIN_CTRL1); 
+				ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) |
+							SCU_FUN_PIN_MAC0_PHY_LINK,
+					AST_SCU_FUN_PIN_CTRL1);
 			} else {
-				SCUMSG("MAC0 : RMII/NCSI \n");			
+				SCUMSG("MAC0 : RMII/NCSI \n");
 				ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) &
-							~SCU_FUN_PIN_MAC0_PHY_LINK, 
-					AST_SCU_FUN_PIN_CTRL1); 
+							~SCU_FUN_PIN_MAC0_PHY_LINK,
+					AST_SCU_FUN_PIN_CTRL1);
 			}
 
-			ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) | 
+			ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) |
 						SCU_FUN_PIN_MAC0_MDIO |
-						SCU_FUN_PIN_MAC0_MDC, 
-				AST_SCU_FUN_PIN_CTRL3); 
-			
+						SCU_FUN_PIN_MAC0_MDC,
+				AST_SCU_FUN_PIN_CTRL3);
+
 			break;
 		case 1:
-			if(ast_scu_read(AST_SCU_HW_STRAP1) && SCU_HW_STRAP_MAC1_RGMII) {
+			if(ast_scu_read(AST_SCU_HW_STRAP1) & SCU_HW_STRAP_MAC1_RGMII) {
 				SCUMSG("MAC1 : RGMII \n");
-				ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) | 
-							SCU_FUN_PIN_MAC1_PHY_LINK, 
-					AST_SCU_FUN_PIN_CTRL1); 
+				ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) |
+							SCU_FUN_PIN_MAC1_PHY_LINK,
+					AST_SCU_FUN_PIN_CTRL1);
 			} else {
 				SCUMSG("MAC1 : RMII/NCSI \n");
-				ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) & 
-						~SCU_FUN_PIN_MAC1_PHY_LINK, 
-					AST_SCU_FUN_PIN_CTRL1); 
+				ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) &
+						~SCU_FUN_PIN_MAC1_PHY_LINK,
+					AST_SCU_FUN_PIN_CTRL1);
 			}
-			
-			ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | 
+
+			ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) |
 						SCU_FUC_PIN_MAC1_MDIO,
-				AST_SCU_FUN_PIN_CTRL5); 
+				AST_SCU_FUN_PIN_CTRL5);
 
 			break;
 	}
@@ -866,18 +880,18 @@ extern void
 ast_scu_multi_func_nand(void)
 {
 	//enable NAND flash multipin FLBUSY and FLWP
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL2) | 
-				SCU_FUN_PIN_NAND_FLBUSY | SCU_FUN_PIN_NAND_FLWP, 
-		AST_SCU_FUN_PIN_CTRL2); 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL2) |
+				SCU_FUN_PIN_NAND_FLBUSY | SCU_FUN_PIN_NAND_FLWP,
+		AST_SCU_FUN_PIN_CTRL2);
 
 }
 
 extern void
 ast_scu_multi_func_nor(void)
 {
-	//Address 
+	//Address
 	//ROMA2~17
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL8) | 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL8) |
 				SCU_FUN_PIN_ROMA2 | SCU_FUN_PIN_ROMA3 |
 				SCU_FUN_PIN_ROMA4 | SCU_FUN_PIN_ROMA5 |
 				SCU_FUN_PIN_ROMA6 | SCU_FUN_PIN_ROMA7 |
@@ -885,39 +899,39 @@ ast_scu_multi_func_nor(void)
 				SCU_FUN_PIN_ROMA10 | SCU_FUN_PIN_ROMA11 |
 				SCU_FUN_PIN_ROMA12 | SCU_FUN_PIN_ROMA13 |
 				SCU_FUN_PIN_ROMA14 | SCU_FUN_PIN_ROMA15 |
-				SCU_FUN_PIN_ROMA16 | SCU_FUN_PIN_ROMA17, 
+				SCU_FUN_PIN_ROMA16 | SCU_FUN_PIN_ROMA17,
 		AST_SCU_FUN_PIN_CTRL8);
 
 	//ROMA18~21
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL9) | 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL9) |
 				SCU_FUN_PIN_ROMA18 | SCU_FUN_PIN_ROMA19 |
-				SCU_FUN_PIN_ROMA20 | SCU_FUN_PIN_ROMA21, 
-		AST_SCU_FUN_PIN_CTRL9);	
-	
+				SCU_FUN_PIN_ROMA20 | SCU_FUN_PIN_ROMA21,
+		AST_SCU_FUN_PIN_CTRL9);
+
 	//ROMA22,23
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL4) | SCU_FUN_PIN_ROMA22 | SCU_FUN_PIN_ROMA23, 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL4) | SCU_FUN_PIN_ROMA22 | SCU_FUN_PIN_ROMA23,
 		AST_SCU_FUN_PIN_CTRL4);
-	
+
 	//ROMA24,25
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) | SCU_FUN_PIN_ROMA24 | SCU_FUN_PIN_ROMA25, 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) | SCU_FUN_PIN_ROMA24 | SCU_FUN_PIN_ROMA25,
 		AST_SCU_FUN_PIN_CTRL3);
 
 	//SCU94 [1] = 0
- 	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL6) & SCU_VIDEO_OUT_MASK, 
+ 	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL6) & SCU_VIDEO_OUT_MASK,
 		AST_SCU_FUN_PIN_CTRL6);
 
-	
+
 	//data
 	//ROMD 4~7 //ROMWE#, OE#
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL4) | 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL4) |
 			SCU_FUN_PIN_ROMOE | SCU_FUN_PIN_ROMWE |
 			SCU_FUN_PIN_ROMD4 | SCU_FUN_PIN_ROMD5 |
 			SCU_FUN_PIN_ROMD6 | SCU_FUN_PIN_ROMD7,
 			AST_SCU_FUN_PIN_CTRL4);
-	
+
 	//ROMD 8~15
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | 
-			SCU_FUC_PIN_ROM_16BIT, 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) |
+			SCU_FUC_PIN_ROM_16BIT,
 		AST_SCU_FUN_PIN_CTRL5);
 
 }
@@ -925,44 +939,44 @@ ast_scu_multi_func_nor(void)
 extern void
 ast_scu_multi_func_romcs(u8 num)
 {
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) | 
-			SCU_FUN_PIN_ROMCS(num), 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) |
+			SCU_FUN_PIN_ROMCS(num),
 		AST_SCU_FUN_PIN_CTRL3);
 }
 
 extern void
 ast_scu_multi_func_i2c(void)
 {
-	//TODO check ... //In AST2400 Due to share pin with SD , please not enable I2C 10 ~14 
+	//TODO check ... //In AST2400 Due to share pin with SD , please not enable I2C 10 ~14
 	// AST 2400 have 14 , AST 2300 9 ...
 #ifdef CONFIG_MMC_AST
-	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | 
-			SCU_FUC_PIN_I2C3 | 
-			SCU_FUC_PIN_I2C4 | 
-			SCU_FUC_PIN_I2C5 | 
-			SCU_FUC_PIN_I2C6 | 
-			SCU_FUC_PIN_I2C7 | 
-			SCU_FUC_PIN_I2C8 | 
-			SCU_FUC_PIN_I2C9, 
+	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) |
+			SCU_FUC_PIN_I2C3 |
+			SCU_FUC_PIN_I2C4 |
+			SCU_FUC_PIN_I2C5 |
+			SCU_FUC_PIN_I2C6 |
+			SCU_FUC_PIN_I2C7 |
+			SCU_FUC_PIN_I2C8 |
+			SCU_FUC_PIN_I2C9,
 		AST_SCU_FUN_PIN_CTRL5);
 #else
-	ast_scu_write((ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | 
-			SCU_FUC_PIN_I2C3 | 
-			SCU_FUC_PIN_I2C4 | 
-			SCU_FUC_PIN_I2C5 | 
-			SCU_FUC_PIN_I2C6 | 
-			SCU_FUC_PIN_I2C7 | 
-			SCU_FUC_PIN_I2C8 | 
-			SCU_FUC_PIN_I2C9 | 
-			SCU_FUC_PIN_I2C10 | 
-			SCU_FUC_PIN_I2C11 | 
-			SCU_FUC_PIN_I2C12 | 
-			SCU_FUC_PIN_I2C13 | 
+	ast_scu_write((ast_scu_read(AST_SCU_FUN_PIN_CTRL5) |
+			SCU_FUC_PIN_I2C3 |
+			SCU_FUC_PIN_I2C4 |
+			SCU_FUC_PIN_I2C5 |
+			SCU_FUC_PIN_I2C6 |
+			SCU_FUC_PIN_I2C7 |
+			SCU_FUC_PIN_I2C8 |
+			SCU_FUC_PIN_I2C9 |
+			SCU_FUC_PIN_I2C10 |
+			SCU_FUC_PIN_I2C11 |
+			SCU_FUC_PIN_I2C12 |
+			SCU_FUC_PIN_I2C13 |
 			SCU_FUC_PIN_I2C14) &
-			~(SCU_FUC_PIN_SD1 | SCU_FUC_PIN_SD2), 
+			~(SCU_FUC_PIN_SD1 | SCU_FUC_PIN_SD2),
 		AST_SCU_FUN_PIN_CTRL5);
 #endif
-}	
+}
 
 EXPORT_SYMBOL(ast_scu_multi_func_i2c);
 
@@ -972,7 +986,7 @@ ast_scu_multi_func_pwm_tacho(void)
 	//TODO check
 	u32 sts = ast_scu_read(AST_SCU_FUN_PIN_CTRL3) &~0xcfffff;
 	ast_scu_write(sts | 0xc000ff, AST_SCU_FUN_PIN_CTRL3);
-}	
+}
 
 EXPORT_SYMBOL(ast_scu_multi_func_pwm_tacho);
 
@@ -981,12 +995,12 @@ extern void
 ast_scu_multi_func_usb20_host_hub(u8 mode)
 {
 	if(mode)
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_USB20_HOST, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_USB20_HOST,
 					AST_SCU_FUN_PIN_CTRL5);
 	else
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_USB20_HOST, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_USB20_HOST,
 					AST_SCU_FUN_PIN_CTRL5);
-}	
+}
 
 EXPORT_SYMBOL(ast_scu_multi_func_usb20_host_hub);
 
@@ -995,12 +1009,12 @@ extern void
 ast_scu_multi_func_usb11_host_port4(u8 mode)
 {
 	if(mode)
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_USB11_PORT4, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_USB11_PORT4,
 					AST_SCU_FUN_PIN_CTRL5);
 	else
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_USB11_PORT4, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_USB11_PORT4,
 					AST_SCU_FUN_PIN_CTRL5);
-}	
+}
 
 EXPORT_SYMBOL(ast_scu_multi_func_usb11_host_port4);
 
@@ -1009,26 +1023,26 @@ extern void
 ast_scu_multi_func_usb11_host_port2(u8 mode)
 {
 	if(mode)
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_USB11_PORT2, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_USB11_PORT2,
 					AST_SCU_FUN_PIN_CTRL5);
 	else
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_USB11_PORT2, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_USB11_PORT2,
 					AST_SCU_FUN_PIN_CTRL5);
-}	
+}
 
 EXPORT_SYMBOL(ast_scu_multi_func_usb11_host_port2);
 
-//0 : 1: SD1 function 
+//0 : 1: SD1 function
 extern void
 ast_scu_multi_func_sdhc_slot1(u8 mode)
 {
 	if(mode)
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_SD1, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_SD1,
 					AST_SCU_FUN_PIN_CTRL5);
 	else
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_SD1, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_SD1,
 					AST_SCU_FUN_PIN_CTRL5);
-}	
+}
 
 EXPORT_SYMBOL(ast_scu_multi_func_sdhc_slot1);
 
@@ -1036,13 +1050,13 @@ extern void
 ast_scu_multi_func_sdhc_slot2(u8 mode)
 {
 	if(mode)
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_SD2, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) | SCU_FUC_PIN_SD2,
 					AST_SCU_FUN_PIN_CTRL5);
 	else
-		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_SD2, 
+		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL5) & ~SCU_FUC_PIN_SD2,
 					AST_SCU_FUN_PIN_CTRL5);
 
-}	
+}
 
 EXPORT_SYMBOL(ast_scu_multi_func_sdhc_slot2);
 
@@ -1053,11 +1067,11 @@ ast_scu_multi_func_crt(void)
 
 	//Digital vodeo input function pins : 00 disable, 10 24bits mode 888,
 	ast_scu_write((ast_scu_read(AST_SCU_FUN_PIN_CTRL5) &
-			~SCU_FUC_PIN_DIGI_V_OUT_MASK) | 
+			~SCU_FUC_PIN_DIGI_V_OUT_MASK) |
 			SCU_FUC_PIN_DIGI_V_OUT(VIDEO_24BITS),AST_SCU_FUN_PIN_CTRL5);
 
 	//VPI input
-#if 0	
+#if 0
 	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL2) |
 			SCU_FUN_PIN_VPIB9 | SCU_FUN_PIN_VPIB8 |
 			SCU_FUN_PIN_VPIB7 | SCU_FUN_PIN_VPIB6 |
@@ -1070,11 +1084,11 @@ ast_scu_multi_func_crt(void)
 
 	ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL3) |
 			SCU_FUN_PIN_VPIR9 | SCU_FUN_PIN_VPIR8 |
-			SCU_FUN_PIN_VPIR7 | SCU_FUN_PIN_VPIR6 |	
+			SCU_FUN_PIN_VPIR7 | SCU_FUN_PIN_VPIR6 |
 			SCU_FUN_PIN_VPIR5 | SCU_FUN_PIN_VPIR4 |
 			SCU_FUN_PIN_VPIR3 | SCU_FUN_PIN_VPIR2 |
 			SCU_FUN_PIN_VPIR1 | SCU_FUN_PIN_VPIR0 |
-			SCU_FUN_PIN_VPIG9 | SCU_FUN_PIN_VPIG8 |	
+			SCU_FUN_PIN_VPIG9 | SCU_FUN_PIN_VPIG8 |
 			SCU_FUN_PIN_VPIG7 | SCU_FUN_PIN_VPIG6 |
 			SCU_FUN_PIN_VPIG5 | SCU_FUN_PIN_VPIG4 |
 			SCU_FUN_PIN_VPIG3 | SCU_FUN_PIN_VPIG2 |
@@ -1097,9 +1111,9 @@ ast_scu_revision_id(void)
 		SCUMSG("UnKnow-SOC : %x \n",rev_id);
 	else
 		SCUMSG("SOC : %4s \n",soc_map_table[i].name);
-	
+
 	return rev_id;
-}	
+}
 
 EXPORT_SYMBOL(ast_scu_revision_id);
 
diff --git a/arch/arm/plat-aspeed/dev-eth.c b/arch/arm/plat-aspeed/dev-eth.c
index 5d33e33..b115c5a 100644
--- a/arch/arm/plat-aspeed/dev-eth.c
+++ b/arch/arm/plat-aspeed/dev-eth.c
@@ -7,11 +7,11 @@
 * 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
@@ -37,7 +37,7 @@
 #if defined(CONFIG_ASPEEDMAC) || defined(CONFIG_ASPEEDMAC_MODULE)
 #ifdef AST_MAC0_BASE
 static struct ftgmac100_eth_data ast_eth0_data = {
-	.dev_addr = { 0x00, 0x84, 0x14, 0xA0, 0xB0, 0x22},		
+	.dev_addr = { 0x00, 0x84, 0x14, 0xA0, 0xB0, 0x22},
 	.phy_id = 1,
 };
 
@@ -69,7 +69,7 @@ static struct platform_device ast_eth0_device = {
 #endif
 #ifdef AST_MAC1_BASE
 static struct ftgmac100_eth_data ast_eth1_data = {
-	.dev_addr = { 0x00, 0x84, 0x14, 0xA0, 0xB0, 0x23},		
+	.dev_addr = { 0x00, 0x84, 0x14, 0xA0, 0xB0, 0x23},
 	.phy_id = 1,
 };
 
@@ -131,11 +131,16 @@ void __init ast_add_device_gmac(void)
 	}
 
 	ast_eth0_data.DF_support = !isRevA0;
-	
+
+	// Wedge/6-Pack hardware attaches to MAC1;  there's nothing on
+	// MAC0.  Older drivers would drop interfaces without PHYs, but
+	// the latest open source drivers do not, so we drop the first
+	// MAC specs.
+#if !defined(CONFIG_WEDGE) && !defined(CONFIG_WEDGE100)
 	ast_scu_init_eth(0);
 	ast_scu_multi_func_eth(0);
-	
-	
+
+
 	/*
 	* D[15:11] in 0x1E6E2040 is NCSI scratch from U-Boot. D[15:14] = MAC1, D[13:12] = MAC2
 	* The meanings of the 2 bits are:
@@ -144,7 +149,7 @@ void __init ast_add_device_gmac(void)
 	* 10(2): ASPEED's MAC is connected to NC-SI PHY chip directly
 	* 11: Reserved
 	*/
-	
+
 	phy_mode = ast_scu_get_phy_config(0);
 	switch(phy_mode) {
 		case 0:
@@ -152,12 +157,12 @@ void __init ast_add_device_gmac(void)
 			ast_eth0_data.NCSI_support = 0;
 			break;
 		case 1:
-			ast_eth0_data.NCSI_support = 1;
+			ast_eth0_data.INTEL_NCSI_EVA_support = 1;
 			break;
 		case 2:
-			ast_eth0_data.INTEL_NCSI_EVA_support = 1;
+			ast_eth0_data.NCSI_support = 1;
 			break;
-			
+
 	}
 
 	phy_inter = ast_scu_get_phy_interface(0);
@@ -165,12 +170,13 @@ void __init ast_add_device_gmac(void)
 	// We assume the Clock Stop register does not disable the MAC1 or MAC2 clock
 	// unless Reset Control also holds the MAC in reset.
 
-	
+
 	platform_device_register(&ast_eth0_device);
+#endif
 
 #ifdef AST_MAC1_BASE
 	ast_scu_init_eth(1);
-	ast_scu_multi_func_eth(1);	
+	ast_scu_multi_func_eth(1);
 
 	ast_eth1_data.DF_support = !isRevA0;
 
@@ -186,7 +192,7 @@ void __init ast_add_device_gmac(void)
 		case 2:
 			ast_eth1_data.INTEL_NCSI_EVA_support = 1;
 			break;
-			
+
 	}
 	phy_inter = ast_scu_get_phy_interface(1);
 
@@ -198,4 +204,3 @@ void __init ast_add_device_gmac(void)
 #else
 void __init ast_add_device_gmac(void) {}
 #endif
-
diff --git a/arch/arm/plat-aspeed/dev-i2c.c b/arch/arm/plat-aspeed/dev-i2c.c
index 9905390..fffa480 100644
--- a/arch/arm/plat-aspeed/dev-i2c.c
+++ b/arch/arm/plat-aspeed/dev-i2c.c
@@ -7,11 +7,11 @@
 * 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
@@ -47,59 +47,59 @@
 #if defined (CONFIG_ARCH_AST2400)
 #define I2C_PAGE_SIZE 8
 static spinlock_t page_info_lock = SPIN_LOCK_UNLOCKED;
-static struct buf_page page_info[I2C_PAGE_SIZE] = 
-{  
+static struct buf_page page_info[I2C_PAGE_SIZE] =
+{
 	[0] = {
 		.flag = 0,
 		.page_no = 0,
 		.page_size = 256,
-		.page_addr_point = 0,	
+		.page_addr_point = 0,
 	},
 	[1] = {
 		.flag = 0,
-		.page_no = 1,			
+		.page_no = 1,
 		.page_size = 256,
-		.page_addr_point = 0,		
+		.page_addr_point = 0,
 	},
 	[2] = {
 		.flag = 0,
-		.page_no = 2,			
+		.page_no = 2,
 		.page_size = 256,
 		.page_addr_point = 0,
 	},
 	[3] = {
 		.flag = 0,
-		.page_no = 3,			
+		.page_no = 3,
 		.page_size = 256,
 		.page_addr_point = 0,
 	},
 	[4] = {
 		.flag = 0,
-		.page_no = 4,			
+		.page_no = 4,
 		.page_size = 256,
 		.page_addr_point = 0,
 	},
 	[5] = {
 		.flag = 0,
-		.page_no = 5,			
+		.page_no = 5,
 		.page_size = 256,
 		.page_addr_point = 0,
 	},
 	[6] = {
 		.flag = 0,
-		.page_no = 6,			
+		.page_no = 6,
 		.page_size = 256,
 		.page_addr_point = 0,
 	},
 	[7] = {
 		.flag = 0,
-		.page_no = 7,			
+		.page_no = 7,
 		.page_size = 256,
 		.page_addr_point = 0,
 	},
 };
 
-static void pool_buff_page_init(u32 buf_pool_addr) 
+static void pool_buff_page_init(u32 buf_pool_addr)
 {
 	u32 offset;
 	int i ,j;
@@ -108,7 +108,7 @@ static void pool_buff_page_init(u32 buf_pool_addr)
 		offset = 0;
 		for(j=0;j<i;j++)
 			offset += page_info[i].page_size;
-		
+
 		page_info[i].page_addr = buf_pool_addr + offset;
 //		I2CDBUG( "page[%d],addr :%x \n", i, page_info[i].page_addr);
 	}
@@ -130,7 +130,7 @@ static u8 request_pool_buff_page(struct buf_page **req_page)
 			break;
 		}
 	}
-	spin_unlock_irqrestore(&page_info_lock, flags);	
+	spin_unlock_irqrestore(&page_info_lock, flags);
 	return (i >= I2C_PAGE_SIZE);
 }
 
@@ -140,17 +140,17 @@ static void free_pool_buff_page(struct buf_page *req_page)
         spin_lock_irqsave(&page_info_lock, flags);
 
 	req_page->flag = 0;
-//	I2CDBUG( "free page addr %x \n", req_page->page_addr);	
+//	I2CDBUG( "free page addr %x \n", req_page->page_addr);
 	req_page = NULL;
-	spin_unlock_irqrestore(&page_info_lock, flags);	
+	spin_unlock_irqrestore(&page_info_lock, flags);
 }
 
 #elif defined (CONFIG_ARCH_AST2300)
 #define I2C_PAGE_SIZE 5
 
 static spinlock_t page_info_lock = SPIN_LOCK_UNLOCKED;
-static struct buf_page page_info[I2C_PAGE_SIZE] = 
-{  
+static struct buf_page page_info[I2C_PAGE_SIZE] =
+{
 	[0] = {
 		.flag = 0,
 		.page_size = 128,
@@ -173,7 +173,7 @@ static struct buf_page page_info[I2C_PAGE_SIZE] =
 	},
 };
 
-static void pool_buff_page_init(u32 buf_pool_addr) 
+static void pool_buff_page_init(u32 buf_pool_addr)
 {
 
 	u32 offset;
@@ -183,7 +183,7 @@ static void pool_buff_page_init(u32 buf_pool_addr)
 		offset = 0;
 		for(j=0;j<i;j++)
 			offset += page_info[i].page_size;
-		
+
 		page_info[i].page_addr = buf_pool_addr + offset;
 		page_info[i].page_addr_point = page_info[i].page_addr/4;
 //		printk("page[%d],addr :%x , point : %d\n", i, page_info[i].page_addr, page_info[i].page_addr_point);
@@ -201,11 +201,11 @@ static u8 request_pool_buff_page(struct buf_page **req_page)
 		if(page_info[i].flag ==0) {
 			page_info[i].flag = 1;
 			*req_page = &page_info[i];
-			spin_unlock_irqrestore(&page_info_lock, flags);	
+			spin_unlock_irqrestore(&page_info_lock, flags);
 			return 0;
 		}
 	}
-	spin_unlock_irqrestore(&page_info_lock, flags);	
+	spin_unlock_irqrestore(&page_info_lock, flags);
 	return 1;
 
 }
@@ -217,10 +217,10 @@ static void free_pool_buff_page(struct buf_page *req_page)
         spin_lock_irqsave(&page_info_lock, flags);
 	req_page->flag = 0;
 	req_page = NULL;
-	spin_unlock_irqrestore(&page_info_lock, flags);	
+	spin_unlock_irqrestore(&page_info_lock, flags);
 }
 
-#else 
+#else
 //DO nothing
 static void pool_buff_page_init(void) {}
 static u8 request_pool_buff_page(struct buf_page **req_page) {return 0;}
@@ -228,15 +228,15 @@ static void free_pool_buff_page(struct buf_page *req_page) {}
 #endif
 
 static struct ast_i2c_driver_data ast_i2c_data = {
-	.bus_clk = 100000,		//bus clock 100KHz	
+	.bus_clk = 100000,		//bus clock 100KHz
 	.master_dma = BUFF_MODE,
 	.slave_dma = BYTE_MODE,
 	.request_pool_buff_page = request_pool_buff_page,
 	.free_pool_buff_page = free_pool_buff_page,
-#ifdef CONFIG_AST_I2C_SLAVE_MODE	
+#ifdef CONFIG_AST_I2C_SLAVE_MODE
 	.slave_xfer = i2c_slave_xfer,
 	.slave_init = i2c_slave_init,
-#endif	
+#endif
 	.get_i2c_clock = ast_get_pclk,
 };
 
@@ -285,7 +285,7 @@ struct platform_device ast_i2c_dev2_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev2_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev2_resources),
@@ -310,7 +310,7 @@ struct platform_device ast_i2c_dev3_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev3_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev3_resources),
@@ -335,7 +335,7 @@ struct platform_device ast_i2c_dev4_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev4_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev4_resources),
@@ -360,7 +360,7 @@ struct platform_device ast_i2c_dev5_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev5_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev5_resources),
@@ -385,7 +385,7 @@ struct platform_device ast_i2c_dev6_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev6_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev6_resources),
@@ -410,7 +410,7 @@ struct platform_device ast_i2c_dev7_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev7_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev7_resources),
@@ -435,7 +435,7 @@ struct platform_device ast_i2c_dev8_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev8_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev8_resources),
@@ -460,7 +460,7 @@ struct platform_device ast_i2c_dev9_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev9_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev9_resources),
@@ -486,7 +486,7 @@ struct platform_device ast_i2c_dev10_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev10_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev10_resources),
@@ -511,7 +511,7 @@ struct platform_device ast_i2c_dev11_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev11_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev11_resources),
@@ -536,7 +536,7 @@ struct platform_device ast_i2c_dev12_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev12_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev12_resources),
@@ -561,7 +561,7 @@ struct platform_device ast_i2c_dev13_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev13_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev13_resources),
@@ -586,7 +586,7 @@ struct platform_device ast_i2c_dev14_device = {
 	.dev = {
 		.dma_mask = &ast_i2c_dma_mask,
 		.coherent_dma_mask = 0xffffffff,
-		.platform_data = &ast_i2c_data,		
+		.platform_data = &ast_i2c_data,
 	},
 	.resource = ast_i2c_dev14_resources,
 	.num_resources = ARRAY_SIZE(ast_i2c_dev14_resources),
@@ -594,12 +594,196 @@ struct platform_device ast_i2c_dev14_device = {
 #endif
 
 /*--------- I2C Board devices ------------*/
-//ASPEED AST2300 EVB I2C Device 
+//ASPEED AST2300 EVB I2C Device
 #if defined(CONFIG_ARCH_AST2300) || defined(CONFIG_ARCH_AST2400)
+
+#if defined(CONFIG_WEDGE100)
+
+static struct i2c_board_info __initdata wedge100_i2c_bus1[] = {
+  /* shared NIC, no kernel driver */
+};
+
+static struct i2c_board_info __initdata wedge100_i2c_bus2[] = {
+  /* TODO: one IR3581 and two IR3584 */
+};
+
+static struct i2c_board_info __initdata wedge100_i2c_bus3[] = {
+  /* TODO: one PWR1014A */
+};
+
+static struct i2c_board_info __initdata wedge100_i2c_bus4[] = {
+  {
+    I2C_BOARD_INFO("tmp75", 0x48),
+  },
+  {
+    I2C_BOARD_INFO("tmp75", 0x49),
+  },
+  {
+    I2C_BOARD_INFO("tmp75", 0x4a),
+  },
+  {
+    I2C_BOARD_INFO("tmp75", 0x4b),
+  },
+  {
+    I2C_BOARD_INFO("tmp75", 0x4c),
+  },
+};
+
+static struct i2c_board_info __initdata wedge100_i2c_bus5[] = {
+  /* Panther+ microserver */
+  {
+    I2C_BOARD_INFO("fb_panther_plus", 0x40),
+  },
+};
+
+static struct i2c_board_info __initdata wedge100_i2c_bus6[] = {
+  /* TODO: USB hub */
+};
+
+static struct i2c_board_info __initdata wedge100_i2c_bus7[] = {
+  {
+    I2C_BOARD_INFO("pcf8574", 0x2f),
+  },
+  {
+    I2C_BOARD_INFO("24c64", 0x51),
+  }
+};
+
+static struct i2c_board_info __initdata wedge100_i2c_bus8[] = {
+  /* BMC PHY EEPROM */
+  {
+    I2C_BOARD_INFO("24c02", 0x50),
+  },
+  // EEPROM on the pfe1100 power supplies
+  {
+    I2C_BOARD_INFO("24c64", 0x51),
+  },
+  {
+    I2C_BOARD_INFO("24c64", 0x52),
+  },
+  /* PSU driver */
+  {
+    I2C_BOARD_INFO("pfe1100", 0x59),
+  },
+  {
+    I2C_BOARD_INFO("pfe1100", 0x5a),
+  },
+};
+
+static struct i2c_board_info __initdata wedge100_i2c_bus9[] = {
+  {
+    I2C_BOARD_INFO("fancpld", 0x33),
+  },
+  {
+    I2C_BOARD_INFO("tmp75", 0x48),
+  },
+  {
+    I2C_BOARD_INFO("tmp75", 0x49),
+  },
+};
+
+/* i2c bus 10-12 on wedge100 are not connected as i2c bus */
+
+static struct i2c_board_info __initdata wedge100_i2c_bus13[] = {
+  {
+    I2C_BOARD_INFO("syscpld", 0x31),
+  },
+};
+
+/* i2c bus 14 on wedge100 are not connected as i2c bus */
+
+/* end of defined(CONFIG_WEDGE100) */
+
+#elif defined(CONFIG_YOSEMITE) || defined(CONFIG_FBPLATFORM1)
+
+//Under I2C Dev 1
+static struct i2c_board_info __initdata ast_i2c_board_info_1[] = {
+  // Slot#0 NIC sideband
+};
+
+//Under I2C Dev 2
+static struct i2c_board_info __initdata ast_i2c_board_info_2[] = {
+  // Slot#0 IPMB interface
+};
+
+//Under I2C Dev 3
+static struct i2c_board_info __initdata ast_i2c_board_info_3[] = {
+  // Slot#1 NIC sideband
+};
+
+
+//Under I2C Dev 4
+static struct i2c_board_info __initdata ast_i2c_board_info_4[] = {
+  // Slot#1 IPMB interface
+};
+
+//Under I2C Dev 5
+static struct i2c_board_info __initdata ast_i2c_board_info_5[] = {
+  // Slot#2 NIC sideband
+};
+
+//Under I2C Dev 6
+static struct i2c_board_info __initdata ast_i2c_board_info_6[] = {
+  // Slot#2 IPMB interface
+};
+
+//Under I2C Dev 7
+static struct i2c_board_info __initdata ast_i2c_board_info_7[] = {
+  // Slot#3 NIC sideband
+};
+
+//Under I2C Dev 8
+static struct i2c_board_info __initdata ast_i2c_board_info_8[] = {
+  // Slot#3 IPMB interface
+};
+
+//Under I2C Dev 9
+static struct i2c_board_info __initdata ast_i2c_board_info_9[] = {
+  // FRUID
+  {
+    I2C_BOARD_INFO("24c64", 0x51),
+  },
+};
+
+//Under I2C Dev 10
+static struct i2c_board_info __initdata ast_i2c_board_info_10[] = {
+  // Inlet and Outlet temp. sensors
+  {
+    I2C_BOARD_INFO("tmp75", 0x4e),
+  },
+  {
+    I2C_BOARD_INFO("tmp75", 0x4f),
+  },
+};
+
+//Under I2C Dev 11
+static struct i2c_board_info __initdata ast_i2c_board_info_11[] = {
+  // Hotswap Sensor
+  {
+    I2C_BOARD_INFO("adm1278", 0x40),
+  },
+};
+
+//Under I2C Dev 12
+static struct i2c_board_info __initdata ast_i2c_board_info_12[] = {
+  // Mezz Card LAN_SMB bus (PHY, Temp. Sensor)
+};
+
+//Under I2C Dev 13
+static struct i2c_board_info __initdata ast_i2c_board_info_13[] = {
+  // Mezz Card Mezz_SMB bus (FRUID, GPIO expander, QSFP+)
+};
+
+/* end of CONFIG_YOSEMITE */
+
+#else
+
+/* wedge */
+
 //Under I2C Dev 1
 static struct i2c_board_info __initdata ast_i2c_board_info_1[] = {
 	{
-		I2C_BOARD_INFO("cat9883", 0x4d),						
+		I2C_BOARD_INFO("cat9883", 0x4d),
 	}
 };
 
@@ -612,15 +796,6 @@ static struct i2c_board_info __initdata ast_i2c_board_info_2[] = {
 	{
 		I2C_BOARD_INFO("ncp4200", 0x60),
 	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x61),
-	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x62),
-	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x63),
-	},
 };
 
 
@@ -632,15 +807,6 @@ static struct i2c_board_info __initdata ast_i2c_board_info_3[] = {
 	{
 		I2C_BOARD_INFO("ncp4200", 0x60),
 	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x61),
-	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x62),
-	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x63),
-	},
 };
 
 
@@ -675,7 +841,7 @@ static struct i2c_board_info __initdata ast_i2c_board_info_5[] = {
 		I2C_BOARD_INFO("24c128", 0x51),
 	},
 };
-		
+
 //Under I2C Dev 7
 static struct i2c_board_info __initdata ast_i2c_board_info_7[] = {
 	// Wedge devices
@@ -688,15 +854,23 @@ static struct i2c_board_info __initdata ast_i2c_board_info_7[] = {
 	},
 	{
 		I2C_BOARD_INFO("24c64", 0x50),
-	}
+	},
 };
 
 
 //Under I2C Dev 8
 static struct i2c_board_info __initdata ast_i2c_board_info_8[] = {
 	{
+		// 6pack power supply
+		I2C_BOARD_INFO("pfe3000", 0x10),
+	},
+	{
 		// Eval board:
-		I2C_BOARD_INFO("lm75b", 0x4a),						
+		I2C_BOARD_INFO("lm75b", 0x4a),
+	},
+	{
+		// 6pack power supply EEPROM
+		I2C_BOARD_INFO("24c64", 0x50),
 	},
 	// EEPROMS on the pfe1100 power supplies
 	{
@@ -722,20 +896,12 @@ static struct i2c_board_info __initdata ast_i2c_board_info_9[] = {
 	{
 		I2C_BOARD_INFO("ncp4200", 0x60),
 	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x61),
-	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x62),
-	},
-	{
-		I2C_BOARD_INFO("ncp4200", 0x63),
-	},
 };
 
 //Under I2C Dev 12
 static struct i2c_board_info __initdata ast_i2c_board_info_12[] = {
 	{
+		// Early version of 6pack
 		I2C_BOARD_INFO("pfe3000", 0x10),
 	},
 };
@@ -747,6 +913,10 @@ static struct i2c_board_info __initdata ast_i2c_board_info_13[] = {
 	},
 };
 
+/* end of WEDGE case */
+#endif
+
+/* end of defined(CONFIG_ARCH_AST2300) || defined(CONFIG_ARCH_AST2400) */
 #endif
 
 /*-------------------------------------*/
@@ -755,7 +925,7 @@ void __init ast_add_device_i2c(void)
 	//I2C Multi-Pin
 	ast_scu_multi_func_i2c();
 
-	//SCU I2C Reset 
+	//SCU I2C Reset
 	ast_scu_init_i2c();
 
 	ast_i2c_data.reg_gr = ioremap(AST_I2C_BASE, 4*SZ_16);
@@ -777,8 +947,48 @@ void __init ast_add_device_i2c(void)
 		return;
 	}
 #endif
-	//TODO
-	pool_buff_page_init(ast_i2c_data.buf_pool); 
+
+	pool_buff_page_init(ast_i2c_data.buf_pool);
+
+#if defined(CONFIG_WEDGE100)
+
+  platform_device_register(&ast_i2c_dev1_device);
+  i2c_register_board_info(0, wedge100_i2c_bus1, ARRAY_SIZE(wedge100_i2c_bus1));
+
+  platform_device_register(&ast_i2c_dev2_device);
+  i2c_register_board_info(1, wedge100_i2c_bus2, ARRAY_SIZE(wedge100_i2c_bus2));
+
+  platform_device_register(&ast_i2c_dev3_device);
+  i2c_register_board_info(2, wedge100_i2c_bus3, ARRAY_SIZE(wedge100_i2c_bus3));
+
+  platform_device_register(&ast_i2c_dev4_device);
+  i2c_register_board_info(3, wedge100_i2c_bus4, ARRAY_SIZE(wedge100_i2c_bus4));
+
+  platform_device_register(&ast_i2c_dev5_device);
+  i2c_register_board_info(4, wedge100_i2c_bus5, ARRAY_SIZE(wedge100_i2c_bus5));
+
+  platform_device_register(&ast_i2c_dev6_device);
+  i2c_register_board_info(5, wedge100_i2c_bus6, ARRAY_SIZE(wedge100_i2c_bus6));
+
+  platform_device_register(&ast_i2c_dev7_device);
+  i2c_register_board_info(6, wedge100_i2c_bus7, ARRAY_SIZE(wedge100_i2c_bus7));
+
+  platform_device_register(&ast_i2c_dev8_device);
+  i2c_register_board_info(7, wedge100_i2c_bus8, ARRAY_SIZE(wedge100_i2c_bus8));
+
+  platform_device_register(&ast_i2c_dev9_device);
+  i2c_register_board_info(8, wedge100_i2c_bus9, ARRAY_SIZE(wedge100_i2c_bus9));
+
+  /* i2c bus 10 - 12 are not used as i2c on wedge100 */
+
+  platform_device_register(&ast_i2c_dev13_device);
+  i2c_register_board_info(12, wedge100_i2c_bus13, ARRAY_SIZE(wedge100_i2c_bus13));
+
+  /* i2c bug 14 is not used as i2c on wedge100 */
+
+  /* end of defined(CONFIG_WEDGE100) */
+#else
+
 	platform_device_register(&ast_i2c_dev1_device);
 	i2c_register_board_info(0, ast_i2c_board_info_1, ARRAY_SIZE(ast_i2c_board_info_1));
 	platform_device_register(&ast_i2c_dev2_device);
@@ -790,17 +1000,27 @@ void __init ast_add_device_i2c(void)
 	platform_device_register(&ast_i2c_dev5_device);
 	i2c_register_board_info(4, ast_i2c_board_info_5, ARRAY_SIZE(ast_i2c_board_info_5));
 	platform_device_register(&ast_i2c_dev6_device);
+#if defined(CONFIG_YOSEMITE)
+	i2c_register_board_info(5, ast_i2c_board_info_6, ARRAY_SIZE(ast_i2c_board_info_6));
+#endif
 	platform_device_register(&ast_i2c_dev7_device);
 	i2c_register_board_info(6, ast_i2c_board_info_7, ARRAY_SIZE(ast_i2c_board_info_7));
 	platform_device_register(&ast_i2c_dev8_device);
 	i2c_register_board_info(7, ast_i2c_board_info_8, ARRAY_SIZE(ast_i2c_board_info_8));
-	platform_device_register(&ast_i2c_dev9_device);	
+	platform_device_register(&ast_i2c_dev9_device);
 	i2c_register_board_info(8, ast_i2c_board_info_9, ARRAY_SIZE(ast_i2c_board_info_9));
 
 #if defined(CONFIG_ARCH_AST2400)
 	platform_device_register(&ast_i2c_dev10_device);
+
+#if defined(CONFIG_YOSEMITE)
+	i2c_register_board_info(9, ast_i2c_board_info_10, ARRAY_SIZE(ast_i2c_board_info_10));
+	platform_device_register(&ast_i2c_dev11_device);
+	i2c_register_board_info(10, ast_i2c_board_info_11, ARRAY_SIZE(ast_i2c_board_info_11));
+#endif
+
 #if defined(CONFIG_MMC_AST)
-	//Due to share pin with SD 
+	//Due to share pin with SD
 #else
 	/*
 	 * On Wedge, bus 13 is used as i2c bus.  Bus 12 is used on other
@@ -812,7 +1032,12 @@ void __init ast_add_device_i2c(void)
 	i2c_register_board_info(11, ast_i2c_board_info_12, ARRAY_SIZE(ast_i2c_board_info_12));
 	platform_device_register(&ast_i2c_dev13_device);
 	i2c_register_board_info(12, ast_i2c_board_info_13, ARRAY_SIZE(ast_i2c_board_info_13));
-#endif	
+#endif
+
+  /* end of defined(CONFIG_ARCH_AST2400) */
+#endif
+
+  /* end of else of defined(CONFIG_WEDGE100) */
 #endif
 }
 #else
diff --git a/arch/arm/plat-aspeed/dev-spi.c b/arch/arm/plat-aspeed/dev-spi.c
index e22c49e..0cb0189 100644
--- a/arch/arm/plat-aspeed/dev-spi.c
+++ b/arch/arm/plat-aspeed/dev-spi.c
@@ -344,8 +344,8 @@ static struct flash_platform_data wedge_spi_flash_data = {
 
 
 /* Device info for the flash on ast-spi */
-#ifdef CONFIG_ARCH_AST2400
-static struct mtd_partition ast_spi5_flash_partitions[] = {
+#ifdef CONFIG_WEDGE
+static struct mtd_partition wedge_spi5_flash_partitions[] = {
   {
     .name = "led-fpga",
     .offset = 0, /* From 0 */
@@ -355,8 +355,8 @@ static struct mtd_partition ast_spi5_flash_partitions[] = {
 
 static struct flash_platform_data wedge_spi5_flash_data = {
   .type = "at45db011d",
-  .nr_parts = ARRAY_SIZE(ast_spi5_flash_partitions),
-  .parts = ast_spi5_flash_partitions,
+  .nr_parts = ARRAY_SIZE(wedge_spi5_flash_partitions),
+  .parts = wedge_spi5_flash_partitions,
 };
 #endif
 
@@ -372,6 +372,7 @@ static struct spi_board_info ast_spi_devices[] = {
     }, 
 #endif
 #ifdef CONFIG_ARCH_AST2400
+#ifdef CONFIG_WEDGE
     {
         .modalias    = "mtd_dataflash",
         .platform_data  = &wedge_spi5_flash_data,
@@ -380,6 +381,15 @@ static struct spi_board_info ast_spi_devices[] = {
         .bus_num    = 5,
         .mode = SPI_MODE_0,
     },
+#elif defined CONFIG_WEDGE100
+    {
+        .modalias    = "spidev",
+        .chip_select    = 0,
+        .max_speed_hz    = 33 * 1000 * 1000,
+        .bus_num    = 5,
+        .mode = SPI_MODE_0,
+    },
+#endif
     {
         .modalias    = "m25p80",
         .platform_data  = &wedge_spi_flash_data,
@@ -389,13 +399,6 @@ static struct spi_board_info ast_spi_devices[] = {
         .mode = SPI_MODE_0,
     },
 #endif
-    {
-        .modalias    = "spidev",
-        .chip_select    = 0,
-        .max_speed_hz    = 30 * 1000 * 1000,
-        .bus_num    = 1,
-		.mode = SPI_MODE_0,
-    },
 };
 
 #if defined(AST_SPI1_BASE)
@@ -490,5 +493,3 @@ void __init ast_add_device_spi(void)
 #else
 void __init ast_add_device_spi(void) {}
 #endif
-
-
diff --git a/arch/arm/plat-aspeed/dev-uart.c b/arch/arm/plat-aspeed/dev-uart.c
index 0b7b614..e424a5a 100644
--- a/arch/arm/plat-aspeed/dev-uart.c
+++ b/arch/arm/plat-aspeed/dev-uart.c
@@ -6,11 +6,11 @@
 * 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
@@ -50,14 +50,14 @@ static struct plat_serial8250_port ast_uart_data[] = {
 		.irq		= IRQ_UART0,
 		.uartclk	= (24*1000000L),
 		.regshift	= 2,
-#if defined(CONFIG_COLDFIRE)		
+#if defined(CONFIG_COLDFIRE)
 		.iotype		= UPIO_MEM32,
 #else
 		.iotype		= UPIO_MEM,
-#endif		
+#endif
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
 	},
-#if defined(CONFIG_ARCH_AST1010)	
+#if defined(CONFIG_ARCH_AST1010)
 	{
 		.mapbase	= AST_UART1_BASE,
 		.irq		= IRQ_UART1,
@@ -65,7 +65,7 @@ static struct plat_serial8250_port ast_uart_data[] = {
 		.regshift	= 2,
 		.iotype		= UPIO_MEM32,
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-	},	
+	},
 	{
 		.mapbase	= AST_UART2_BASE,
 		.irq		= IRQ_UART2,
@@ -73,7 +73,7 @@ static struct plat_serial8250_port ast_uart_data[] = {
 		.regshift	= 2,
 		.iotype 	= UPIO_MEM32,
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-	},	
+	},
 #else
 //BMC UART 1 ,2 default to LPC
 #ifdef CONFIG_ARCH_AST1070
@@ -85,7 +85,7 @@ static struct plat_serial8250_port ast_uart_data[] = {
 		.regshift	= 2,
 		.iotype		= UPIO_MEM,
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-	},	
+	},
 #endif
 #ifdef AST_UART2_BASE
 	{
@@ -95,7 +95,7 @@ static struct plat_serial8250_port ast_uart_data[] = {
 		.regshift	= 2,
 		.iotype		= UPIO_MEM,
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-	},	
+	},
 #endif
 #endif
 #ifdef AST_UART1_BASE
@@ -109,6 +109,19 @@ static struct plat_serial8250_port ast_uart_data[] = {
 		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
 	},
 #endif
+#if defined(CONFIG_YOSEMITE) //Without this, tty offset might change for others
+#ifdef AST_UART2_BASE
+	{
+		.mapbase	= AST_UART2_BASE,
+		.membase	= (char*)(IO_ADDRESS(AST_UART2_BASE)),
+		.irq		= IRQ_UART2,
+		.uartclk	= (24*1000000L),
+		.regshift	= 2,
+		.iotype		= UPIO_MEM,
+		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+	},
+#endif
+#endif
 #ifdef AST_UART3_BASE
 	{
 		.mapbase	= AST_UART3_BASE,
@@ -117,7 +130,7 @@ static struct plat_serial8250_port ast_uart_data[] = {
 		.regshift	= 2,
 		.iotype		= UPIO_MEM,
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-	},	
+	},
 #endif
 #ifdef AST_UART4_BASE
 	{
@@ -127,9 +140,9 @@ static struct plat_serial8250_port ast_uart_data[] = {
 		.regshift	= 2,
 		.iotype 	= UPIO_MEM,
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-	},	
+	},
+#endif
 #endif
-#endif	
 	{ },
 };
 
@@ -144,11 +157,16 @@ struct platform_device ast_uart_device = {
 void __init ast_add_device_uart(void)
 {
 #if defined(CONFIG_ARCH_AST1010)
+#elif defined(CONFIG_YOSEMITE)
+	ast_scu_multi_func_uart(1);
+	ast_scu_multi_func_uart(2);
+	ast_scu_multi_func_uart(3);
+	ast_scu_multi_func_uart(4);
 #else
-	ast_scu_multi_func_uart(1);		
-	ast_scu_multi_func_uart(3);		
-	ast_scu_multi_func_uart(4);	
-#endif	
+	ast_scu_multi_func_uart(1);
+	ast_scu_multi_func_uart(3);
+	ast_scu_multi_func_uart(4);
+#endif
 	platform_device_register(&ast_uart_device);
 }
 #else
diff --git a/arch/arm/plat-aspeed/irq.c b/arch/arm/plat-aspeed/irq.c
index b118359..f6100fa 100644
--- a/arch/arm/plat-aspeed/irq.c
+++ b/arch/arm/plat-aspeed/irq.c
@@ -48,13 +48,14 @@ static void ast_mask_irq(unsigned int irq)
 	if((irq >= IRQ_TIMER0) && (irq <= IRQ_TIMER2))
 		timer = 1;
 #endif
-	
-	if (irq > 32) {
+
+  // for irq0-irq31 use LOW register; for irq32-irq63 use HIGH register set.
+	if (irq >= 32) {
 		i=1;
 		irq = irq - 32;
 	} else
 		i=0;
-	
+
 	regVal = readl(AST_INTR_DIS(i));
 	regVal |= (1 << irq);
 	writel(regVal, AST_INTR_DIS(i));
@@ -63,8 +64,8 @@ static void ast_mask_irq(unsigned int irq)
 	 * clear the interrupt
 	 */
 	if(timer)
-		IRQ_EDGE_CLEAR(i,irq);	
-	
+		IRQ_EDGE_CLEAR(i,irq);
+
 }
 
 static void ast_unmask_irq(unsigned int irq)
@@ -72,12 +73,13 @@ static void ast_unmask_irq(unsigned int irq)
 	int i;
 	u32 regVal;
 
-	if (irq > 32) {
+  // for irq0-irq31 use LOW register; for irq32-irq63 use HIGH register set.
+	if (irq >= 32) {
 		i=1;
 		irq = irq - 32;
 	} else
 		i=0;
-	
+
 	regVal = readl(AST_INTR_EN(i));
 	regVal |= (1 << irq);
 	writel(regVal, AST_INTR_EN(i));
@@ -88,8 +90,8 @@ static struct irq_chip ast_irq_chip = {
 	.ack	= ast_mask_irq,
 	.mask	= ast_mask_irq,
 	.unmask = ast_unmask_irq,
-}; 
- 
+};
+
 void __init ast_init_irq(void)
 {
 	unsigned int i;
@@ -107,8 +109,8 @@ void __init ast_init_irq(void)
 	writel(0xFFFFFFFF, AST_INTR_EDGE_CLR(1));
 #endif
 
-	//TOTAL IRQ NUM = 
-	for (i = 0; i < AST_VIC_NUM; i++) 
+	//TOTAL IRQ NUM =
+	for (i = 0; i < AST_VIC_NUM; i++)
 	{
 		if(i<32) {
 			if((i >= IRQ_TIMER0) && (i <= IRQ_TIMER2)) //Timer0/1/2
@@ -125,9 +127,9 @@ void __init ast_init_irq(void)
 				IRQ_SET_HIGH_LEVEL(1,i-32);
 				IRQ_SET_LEVEL_TRIGGER(1,i-32);
 			}
-#endif			
+#endif
 		}
-			
+
 		set_irq_chip(i, &ast_irq_chip);
 		set_irq_handler(i, handle_level_irq);
 		set_irq_flags(i, IRQF_VALID);
diff --git a/drivers/hwmon/ast_adc.c b/drivers/hwmon/ast_adc.c
index 3f95dc6..8f5aa54 100644
--- a/drivers/hwmon/ast_adc.c
+++ b/drivers/hwmon/ast_adc.c
@@ -13,10 +13,10 @@
  *    2012.11.26: Initial version [Ryan Chen]
  */
 
-/* attr ADC sysfs 0~max adc channel 
+/* attr ADC sysfs 0~max adc channel
 *	 0 - show/store enable
 *	 3 - show value
-*	 1 - show/store alarm_en set enable 
+*	 1 - show/store alarm_en set enable
 *	 2 - show alarm   get statuse
 *	 4 - show/store upper
 *	 5 - show/store lower  */
@@ -44,13 +44,33 @@
 
 #define REST_DESIGN		5
 
+
+#ifdef CONFIG_YOSEMITE
+enum {
+  ADC_P5V = 0,
+  ADC_P12V,
+  ADC_P3V3_STBY,
+  ADC_P12V_SLOT0,
+  ADC_P12V_SLOT1,
+  ADC_P12V_SLOT2,
+  ADC_P12V_SLOT3,
+  ADC_P3V3,
+};
+
+enum {
+  REST_DESIGN_P3V3 = 6,
+  REST_DESIGN_P5V = 7,
+  REST_DESIGN_P12V = 8,
+};
+#endif // CONFIG_YOSEMITE
+
 struct adc_vcc_ref_data {
 	int v2;
 	int r1;
-	int r2;	
+	int r2;
 };
 
-static struct adc_vcc_ref_data adc_vcc_ref[6] = {
+static struct adc_vcc_ref_data adc_vcc_ref[9] = {
 	[0] = {
 		.v2 = 0,
 		.r1 = 5600,
@@ -81,6 +101,24 @@ static struct adc_vcc_ref_data adc_vcc_ref[6] = {
 		.r1 = 1000,
 		.r2 = 1000,
 	},
+  // P3V3
+	[6] = {
+		.v2 = 0,
+		.r1 = 5110,
+		.r2 = 8250,
+	},
+  // P5V
+	[7] = {
+		.v2 = 0,
+		.r1 = 5110,
+		.r2 = 3480,
+	},
+  // P12V
+	[8] = {
+		.v2 = 0,
+		.r1 = 5110,
+		.r2 = 1020,
+	},
 };
 
 /* Divisors for voltage sense;  right now adc5 & adc6 divide by 2 */
@@ -93,7 +131,7 @@ static int adc_divisor[] = { 1, 1, 1, 1,
 struct ast_adc_data {
 	struct device			*hwmon_dev;
 	void __iomem			*reg_base;			/* virtual */
-	int 					irq;				//ADC IRQ number 
+	int 					irq;				//ADC IRQ number
 	int						compen_value;		//Compensating value
 };
 
@@ -123,14 +161,14 @@ static void ast_adc_ctrl_init(void)
 	ast_adc_write(ast_adc, AST_ADC_CTRL_COMPEN | AST_ADC_CTRL_NORMAL | AST_ADC_CTRL_EN, AST_ADC_CTRL);
 
 	//Set wait a sensing cycle t (s) = 1000 * 12 * (1/PCLK) * 2 * (ADC0c[31:17] + 1) * (ADC0c[9:0] +1)
-	//ex : pclk = 48Mhz , ADC0c[31:17] = 0,  ADC0c[9:0] = 0x40 : 64,  ADC0c[31:17] = 0x3e7 : 999 
+	//ex : pclk = 48Mhz , ADC0c[31:17] = 0,  ADC0c[9:0] = 0x40 : 64,  ADC0c[31:17] = 0x3e7 : 999
 	// --> 0.0325s	= 12 * 2 * (0x3e7 + 1) *(64+1) / 48000000
-	// --> 0.0005s	= 12 * 2 * (0x3e7 + 1) / 48000000	
-	
+	// --> 0.0005s	= 12 * 2 * (0x3e7 + 1) / 48000000
+
 	pclk = ast_get_pclk();
 
 #if defined(CONFIG_ARCH_AST2300)
-	ast_adc_write(ast_adc, 0x3e7, AST_ADC_CLK); 
+	ast_adc_write(ast_adc, 0x3e7, AST_ADC_CLK);
 
 	ast_adc_write(ast_adc, AST_ADC_CTRL_CH12_EN | AST_ADC_CTRL_COMPEN_CLR| ast_adc_read(ast_adc, AST_ADC_CTRL), AST_ADC_CTRL);
 
@@ -141,16 +179,16 @@ static void ast_adc_ctrl_init(void)
 		ast_adc->compen_value = 0x200 - (ast_adc_read(ast_adc, AST_ADC_CH12_13) & AST_ADC_L_CH_MASK);
 	else
 		ast_adc->compen_value = 0 - (ast_adc_read(ast_adc, AST_ADC_CH12_13) & AST_ADC_L_CH_MASK);
-	
-	printk("compensating value %d \n",ast_adc->compen_value);
-	
+
+	// printk("compensating value %d \n",ast_adc->compen_value);
+
 #elif defined(CONFIG_ARCH_AST2400)
 
 	//For AST2400 A0 workaround  ... ADC0c = 1 ;
 //	ast_adc_write(ast_adc, 1, AST_ADC_CLK);
 //	ast_adc_write(ast_adc, (0x3e7<< 17) | 0x40, AST_ADC_CLK);
 	ast_adc_write(ast_adc, 0x40, AST_ADC_CLK);
-	
+
 	ast_adc_write(ast_adc, AST_ADC_CTRL_CH0_EN | AST_ADC_CTRL_COMPEN | AST_ADC_CTRL_NORMAL | AST_ADC_CTRL_EN, AST_ADC_CTRL);
 
 	ast_adc_read(ast_adc, AST_ADC_CTRL);
@@ -159,15 +197,15 @@ static void ast_adc_ctrl_init(void)
 
 	//compensating value = 0x200 - ADC10[9:0]
 	ast_adc->compen_value = 0x200 - (ast_adc_read(ast_adc, AST_ADC_CH0_1) & AST_ADC_L_CH_MASK);
-	printk("compensating value %d \n",ast_adc->compen_value);
+	// printk("compensating value %d \n",ast_adc->compen_value);
 
 #elif defined(CONFIG_ARCH_AST2500)
-//	TODO ... 
-//	scu read trim 
+//	TODO ...
+//	scu read trim
 //	write trim 0xc4 [3:0]
-	
+
 	ast_adc_write(ast_adc, 0x40, AST_ADC_CLK);
-	
+
 	ast_adc_write(ast_adc, AST_ADC_CTRL_NORMAL | AST_ADC_CTRL_EN, AST_ADC_CTRL);
 
     while(!ast_adc_read(ast_adc, AST_ADC_CTRL) & 0x100);
@@ -175,17 +213,17 @@ static void ast_adc_ctrl_init(void)
 	ast_adc_write(ast_adc, AST_ADC_CTRL_COMPEN  | AST_ADC_CTRL_NORMAL | AST_ADC_CTRL_EN, AST_ADC_CTRL);
 
 	while(ast_adc_read(ast_adc, AST_ADC_CTRL) & AST_ADC_CTRL_COMPEN);
-	
+
 	//compensating value = 0x200 - ADC10[9:0]
 	ast_adc->compen_value = 0x200 - ((ast_adc_read(ast_adc, AST_ADC_TRIM) >> 16) & 0x3ff);
-	printk("compensating value %d \n",ast_adc->compen_value);
-	
+	// printk("compensating value %d \n",ast_adc->compen_value);
+
 #else
 #err "No define for ADC "
 #endif
 
 	ast_adc_write(ast_adc, AST_ADC_CTRL_NORMAL | AST_ADC_CTRL_EN, AST_ADC_CTRL);
-	
+
 }
 
 static u16
@@ -203,9 +241,9 @@ ast_get_adc_hyster_lower(struct ast_adc_data *ast_adc, u8 adc_ch)
 static void
 ast_set_adc_hyster_lower(struct ast_adc_data *ast_adc, u8 adc_ch, u16 value)
 {
-	ast_adc_write(ast_adc, 
+	ast_adc_write(ast_adc,
 			(ast_adc_read(ast_adc, AST_ADC_HYSTER0 + (adc_ch *4)) & ~AST_ADC_L_BOUND) |
-			value, 
+			value,
 			AST_ADC_HYSTER0 + (adc_ch *4));
 
 }
@@ -224,9 +262,9 @@ ast_get_adc_hyster_upper(struct ast_adc_data *ast_adc, u8 adc_ch)
 static void
 ast_set_adc_hyster_upper(struct ast_adc_data *ast_adc, u8 adc_ch, u32 value)
 {
-	ast_adc_write(ast_adc, 
+	ast_adc_write(ast_adc,
 			(ast_adc_read(ast_adc, AST_ADC_HYSTER0 + (adc_ch *4)) & ~AST_ADC_H_BOUND) |
-			(value << 16), 
+			(value << 16),
 			AST_ADC_HYSTER0 + (adc_ch *4));
 
 }
@@ -244,7 +282,7 @@ ast_get_adc_hyster_en(struct ast_adc_data *ast_adc, u8 adc_ch)
 static void
 ast_set_adc_hyster_en(struct ast_adc_data *ast_adc, u8 adc_ch, u8 enable)
 {
-	//tacho source 
+	//tacho source
 	if(enable == 1)
 		ast_adc_write(ast_adc,
 			ast_adc_read(ast_adc, AST_ADC_HYSTER0 + (adc_ch *4)) | AST_ADC_HYSTER_EN,
@@ -270,9 +308,9 @@ ast_get_adc_lower(struct ast_adc_data *ast_adc, u8 adc_ch)
 static void
 ast_set_adc_lower(struct ast_adc_data *ast_adc, u8 adc_ch, u16 value)
 {
-	ast_adc_write(ast_adc, 
+	ast_adc_write(ast_adc,
 			(ast_adc_read(ast_adc, AST_ADC_BOUND0 + (adc_ch *4)) & ~AST_ADC_L_BOUND) |
-			value, 
+			value,
 			AST_ADC_BOUND0 + (adc_ch *4));
 
 }
@@ -293,9 +331,9 @@ ast_get_adc_upper(struct ast_adc_data *ast_adc, u8 adc_ch)
 static void
 ast_set_adc_upper(struct ast_adc_data *ast_adc, u8 adc_ch, u32 value)
 {
-	ast_adc_write(ast_adc, 
+	ast_adc_write(ast_adc,
 			(ast_adc_read(ast_adc, AST_ADC_BOUND0 + (adc_ch *4)) & ~AST_ADC_H_BOUND) |
-			(value << 16), 
+			(value << 16),
 			AST_ADC_BOUND0 + (adc_ch *4));
 
 }
@@ -304,7 +342,7 @@ ast_set_adc_upper(struct ast_adc_data *ast_adc, u8 adc_ch, u32 value)
 static u8
 ast_get_adc_alarm(struct ast_adc_data *ast_adc, u8 adc_ch)
 {
-	//adc ch source 
+	//adc ch source
 	if(ast_adc_read(ast_adc, AST_ADC_IER) & (0x1 << adc_ch))
 		return 1;
 	else
@@ -322,61 +360,61 @@ ast_get_adc_value(struct ast_adc_data *ast_adc, u8 adc_ch)
 			break;
 		case 1:
 			tmp = (ast_adc_read(ast_adc, AST_ADC_CH0_1) & AST_ADC_H_CH_MASK) >> 16;
-			break;	
+			break;
 		case 2:
 			tmp = ast_adc_read(ast_adc, AST_ADC_CH2_3) & AST_ADC_L_CH_MASK;
 			break;
 		case 3:
 			tmp = (ast_adc_read(ast_adc, AST_ADC_CH2_3) & AST_ADC_H_CH_MASK) >> 16;
-			break;	
+			break;
 		case 4:
 			tmp = ast_adc_read(ast_adc, AST_ADC_CH4_5) & AST_ADC_L_CH_MASK;
 			break;
 		case 5:
 			tmp = (ast_adc_read(ast_adc, AST_ADC_CH4_5) & AST_ADC_H_CH_MASK) >> 16;
-			break;	
+			break;
 		case 6:
 			tmp = ast_adc_read(ast_adc, AST_ADC_CH6_7) & AST_ADC_L_CH_MASK;
 			break;
 		case 7:
 			tmp = (ast_adc_read(ast_adc, AST_ADC_CH6_7) & AST_ADC_H_CH_MASK) >> 16;
-			break;	
+			break;
 		case 8:
 			tmp = ast_adc_read(ast_adc, AST_ADC_CH8_9) & AST_ADC_L_CH_MASK;
 			break;
 		case 9:
 			tmp = (ast_adc_read(ast_adc, AST_ADC_CH8_9) & AST_ADC_H_CH_MASK) >> 16;
-			break;	
+			break;
 		case 10:
 			tmp = ast_adc_read(ast_adc, AST_ADC_CH10_11) & AST_ADC_L_CH_MASK;
 			break;
 		case 11:
 			tmp = (ast_adc_read(ast_adc, AST_ADC_CH10_11) & AST_ADC_H_CH_MASK) >> 16;
-			break;	
+			break;
 		case 12:
 			tmp = ast_adc_read(ast_adc, AST_ADC_CH12_13) & AST_ADC_L_CH_MASK;
 			break;
 		case 13:
 			tmp = (ast_adc_read(ast_adc, AST_ADC_CH12_13) & AST_ADC_H_CH_MASK) >> 16;
-			break;	
+			break;
 		case 14:
 			tmp = ast_adc_read(ast_adc, AST_ADC_CH14_15) & AST_ADC_L_CH_MASK;
 			break;
 		case 15:
 			tmp = (ast_adc_read(ast_adc, AST_ADC_CH14_15) & AST_ADC_H_CH_MASK) >> 16;
-			break;	
+			break;
 
 	}
 
 	tmp += ast_adc->compen_value;
 
 //	printk("voltage = %d \n",tmp);
-	
+
 	return tmp;
 
 }
 
-static u8 
+static u8
 ast_get_adc_en(struct ast_adc_data *ast_adc, u8 adc_ch)
 {
     u8 tmp=0;
@@ -390,7 +428,7 @@ ast_get_adc_en(struct ast_adc_data *ast_adc, u8 adc_ch)
 
 }
 
-static void 
+static void
 ast_set_adc_en(struct ast_adc_data *ast_adc, u8 adc_ch, u8 enable)
 {
 	if(enable)
@@ -401,7 +439,7 @@ ast_set_adc_en(struct ast_adc_data *ast_adc, u8 adc_ch, u8 enable)
 
 
 /* NAME sysfs */
-static ssize_t 
+static ssize_t
 show_name(struct device *dev, struct device_attribute *devattr,
                          char *buf)
 {
@@ -416,38 +454,63 @@ static const struct attribute_group name_attribute_groups = {
 	.attrs = name_attributes,
 };
 
-/* attr ADC sysfs 0~max adc channel 
+/* attr ADC sysfs 0~max adc channel
 *	 0 - show/store channel enable
-*	 1 - show value 
+*	 1 - show value
 *	 2 - show alarm   get statuse
 *	 3 - show/store upper
-*	 4 - show/store lower 
-*	 5 - show/store hystersis enable  
-*	 6 - show/store hystersis upper  
-*	 7 - show/store hystersis low  
+*	 4 - show/store lower
+*	 5 - show/store hystersis enable
+*	 6 - show/store hystersis upper
+*	 7 - show/store hystersis low
 */
 
-static u32 
+static u32
 ast_get_voltage(int idx) {
+  u8 rest_design = REST_DESIGN;
   u16 tmp;
   u32 voltage, tmp1, tmp2, tmp3;
   tmp = ast_get_adc_value(ast_adc, idx);
+
+#ifdef CONFIG_YOSEMITE
+  switch (idx) {
+  case ADC_P3V3:
+  case ADC_P3V3_STBY:
+    rest_design = REST_DESIGN_P3V3;
+    break;
+  case ADC_P5V:
+    rest_design = REST_DESIGN_P5V;
+    break;
+  case ADC_P12V:
+  case ADC_P12V_SLOT0:
+  case ADC_P12V_SLOT1:
+  case ADC_P12V_SLOT2:
+  case ADC_P12V_SLOT3:
+    rest_design = REST_DESIGN_P12V;
+    break;
+  default:
+    rest_design = REST_DESIGN;
+  }
+#endif // CONFIG_YOSEMITE
+
   // Voltage Sense Method
-  tmp1 = (adc_vcc_ref[REST_DESIGN].r1 + adc_vcc_ref[REST_DESIGN].r2) * tmp * 25 * 10;
-  tmp2 = adc_vcc_ref[REST_DESIGN].r2 * 1024 ;
-  tmp3 = (adc_vcc_ref[REST_DESIGN].r1 * adc_vcc_ref[REST_DESIGN].v2) / adc_vcc_ref[REST_DESIGN].r2;
+  tmp1 = (adc_vcc_ref[rest_design].r1 + adc_vcc_ref[rest_design].r2) * tmp * 25 * 10;
+  tmp2 = adc_vcc_ref[rest_design].r2 * 1024 ;
+  tmp3 = (adc_vcc_ref[rest_design].r1 * adc_vcc_ref[rest_design].v2) / adc_vcc_ref[rest_design].r2;
   // printk("tmp3 = %d \n",tmp3);
   voltage = (tmp1/tmp2) - tmp3;
 
+#ifndef CONFIG_YOSEMITE
   // Higher voltage inputs require a divisor
 
   if (adc_divisor[idx])
 	voltage /= adc_divisor[idx];
+#endif //CONFIG_YOSEMITE
 
   return voltage;
 }
 
-static ssize_t 
+static ssize_t
 ast_show_adc(struct device *dev, struct device_attribute *attr, char *sysfsbuf)
 {
 	struct sensor_device_attribute_2 *sensor_attr = to_sensor_dev_attr_2(attr);
@@ -455,7 +518,7 @@ ast_show_adc(struct device *dev, struct device_attribute *attr, char *sysfsbuf)
 
 	//sensor_attr->index : pwm_ch#
 	//sensor_attr->nr : attr#
-	switch(sensor_attr->nr) 
+	switch(sensor_attr->nr)
 	{
 		case 0: //channel enable, disable
 			return sprintf(sysfsbuf, "%d : %s\n", ast_get_adc_en(ast_adc,sensor_attr->index),ast_get_adc_en(ast_adc,sensor_attr->index) ? "Enable":"Disable");
@@ -466,23 +529,23 @@ ast_show_adc(struct device *dev, struct device_attribute *attr, char *sysfsbuf)
 			break;
 		case 2: //alarm
 			return sprintf(sysfsbuf, "%d \n", ast_get_adc_alarm(ast_adc,sensor_attr->index));
-			break;			
+			break;
 		case 3: //upper
 			return sprintf(sysfsbuf, "%d \n", ast_get_adc_upper(ast_adc,sensor_attr->index));
-			break;			
+			break;
 		case 4: //lower
 			return sprintf(sysfsbuf, "%d \n", ast_get_adc_lower(ast_adc,sensor_attr->index));
-			break;			
-		case 5: //hystersis enable 
+			break;
+		case 5: //hystersis enable
 			return sprintf(sysfsbuf, "%d : %s\n", ast_get_adc_hyster_en(ast_adc,sensor_attr->index),ast_get_adc_hyster_en(ast_adc,sensor_attr->index) ? "Enable":"Disable");
-			break;			
+			break;
 		case 6: //hystersis upper
 			return sprintf(sysfsbuf, "%d \n", ast_get_adc_hyster_upper(ast_adc,sensor_attr->index));
-			break;			
+			break;
 		case 7: //hystersis lower
 			return sprintf(sysfsbuf, "%d \n", ast_get_adc_hyster_lower(ast_adc,sensor_attr->index));
-			break;			
-		case 8: 
+			break;
+		case 8:
 			voltage = ast_get_voltage(sensor_attr->index);
 			return sprintf(sysfsbuf, "%d\n",voltage * 10);
 
@@ -492,7 +555,7 @@ ast_show_adc(struct device *dev, struct device_attribute *attr, char *sysfsbuf)
 	}
 }
 
-static ssize_t 
+static ssize_t
 ast_store_adc(struct device *dev, struct device_attribute *attr, const char *sysfsbuf, size_t count)
 {
 	u32 input_val;
@@ -503,16 +566,16 @@ ast_store_adc(struct device *dev, struct device_attribute *attr, const char *sys
 
 	//sensor_attr->index : pwm_ch#
 	//sensor_attr->nr : attr#
-	switch(sensor_attr->nr) 
+	switch(sensor_attr->nr)
 	{
 		case 0: //enable, disable
 			ast_set_adc_en(ast_adc, sensor_attr->index, input_val);
 			break;
 		case 1: //value
-			
+
 			break;
 		case 2: //alarm
-			break;			
+			break;
 		case 3:
 			ast_set_adc_upper(ast_adc, sensor_attr->index, input_val);
 			break;
@@ -521,14 +584,14 @@ ast_store_adc(struct device *dev, struct device_attribute *attr, const char *sys
 			break;
 		case 5: //hystersis
 			ast_set_adc_hyster_en(ast_adc, sensor_attr->index, input_val);
-			break;			
+			break;
 		case 6:
 			ast_set_adc_hyster_upper(ast_adc, sensor_attr->index, input_val);
 			break;
 		case 7:
 			ast_set_adc_hyster_lower(ast_adc, sensor_attr->index, input_val);
 			break;
-			
+
 		default:
 			return -EINVAL;
 			break;
@@ -537,15 +600,15 @@ ast_store_adc(struct device *dev, struct device_attribute *attr, const char *sys
 	return count;
 }
 
-/* attr ADC sysfs 0~max adc channel 
+/* attr ADC sysfs 0~max adc channel
 *	 0 - show/store channel enable
-*	 1 - show value 
+*	 1 - show value
 *	 2 - show alarm   get statuse
 *	 3 - show/store upper
-*	 4 - show/store lower 
-*	 5 - show/store hystersis enable  
-*	 6 - show/store hystersis upper  
-*	 7 - show/store hystersis low  
+*	 4 - show/store lower
+*	 5 - show/store hystersis enable
+*	 6 - show/store hystersis upper
+*	 7 - show/store hystersis low
 *	 8 - show value as 1000s, expected by lm-sensors
 */
 
@@ -624,18 +687,18 @@ static const struct attribute_group adc_attribute_groups[] = {
 	{ .attrs = adc7_attributes },
 	{ .attrs = adc8_attributes },
 	{ .attrs = adc9_attributes },
-	{ .attrs = adc10_attributes },	
+	{ .attrs = adc10_attributes },
 	{ .attrs = adc11_attributes },
 #if defined(CONFIG_ARCH_AST2400) || defined(CONFIG_ARCH_AST2500)
 	{ .attrs = adc12_attributes },
 	{ .attrs = adc13_attributes },
 	{ .attrs = adc14_attributes },
 	{ .attrs = adc15_attributes },
-#endif	
+#endif
 };
 
 
-static int 
+static int
 ast_adc_probe(struct platform_device *pdev)
 {
 	struct resource *res;
@@ -695,7 +758,7 @@ ast_adc_probe(struct platform_device *pdev)
 	}
 
 	ast_adc_ctrl_init();
-	
+
 	printk(KERN_INFO "ast_adc: driver successfully loaded.\n");
 
 	return 0;
@@ -714,7 +777,7 @@ out:
 	return ret;
 }
 
-static int 
+static int
 ast_adc_remove(struct platform_device *pdev)
 {
 	int i=0;
@@ -739,14 +802,14 @@ ast_adc_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int 
+static int
 ast_adc_suspend(struct platform_device *pdev, pm_message_t state)
 {
 	printk("ast_adc_suspend : TODO \n");
 	return 0;
 }
 
-static int 
+static int
 ast_adc_resume(struct platform_device *pdev)
 {
 	ast_adc_ctrl_init();
@@ -769,13 +832,13 @@ static struct platform_driver ast_adc_driver = {
     },
 };
 
-static int __init 
+static int __init
 ast_adc_init(void)
 {
 	return platform_driver_register(&ast_adc_driver);
 }
 
-static void __exit 
+static void __exit
 ast_adc_exit(void)
 {
 	platform_driver_unregister(&ast_adc_driver);
diff --git a/drivers/i2c/busses/i2c-ast.c b/drivers/i2c/busses/i2c-ast.c
index 7a083de..9bb3154 100644
--- a/drivers/i2c/busses/i2c-ast.c
+++ b/drivers/i2c/busses/i2c-ast.c
@@ -40,63 +40,68 @@
 #include <plat/ast_i2c.h>
 #endif
 
-//AST2400 buffer mode issue , force I2C slave write use byte mode , read use buffer mode 
+//AST2400 buffer mode issue , force I2C slave write use byte mode , read use buffer mode
 /* Use platform_data instead of module parameters */
 /* Fast Mode = 400 kHz, Standard = 100 kHz */
 //static int clock = 100; /* Default: 100 kHz */
 
 
 /***************************************************************************/
+
+#ifdef CONFIG_AST_I2C_SLAVE_RDWR
+#define I2C_S_BUF_SIZE 		64
+#define I2C_S_RX_BUF_NUM 		4
+#define BUFF_FULL		0xff00
+#define BUFF_ONGOING	1
+#endif
+
+#define AST_LOCKUP_DETECTED (0x1 << 15)
+
 struct ast_i2c_dev {
 	struct ast_i2c_driver_data *ast_i2c_data;
 	struct device		*dev;
-	void __iomem		*reg_base;			/* virtual */	
-	int 				irq;				//I2C IRQ number 
-	u32					bus_id;				//for i2c dev# IRQ number check 
-	u32					state;				//I2C xfer mode state matchine 
+	void __iomem		*reg_base;			/* virtual */
+	int 				irq;				//I2C IRQ number
+	u32					bus_id;				//for i2c dev# IRQ number check
+	u32					state;				//I2C xfer mode state matchine
 	struct i2c_adapter	adap;
-	struct buf_page		*req_page;	
+	struct buf_page		*req_page;
 //dma or buff mode needed
 	unsigned char		*dma_buf;
 	dma_addr_t			dma_addr;
-	
-//master	
+
+//master
 	int					xfer_last;			//cur xfer is last msgs for stop msgs
 	struct i2c_msg 		*master_msgs;		//cur xfer msgs
-	int					master_xfer_len;			//cur xfer len 
+	int					master_xfer_len;			//cur xfer len
 	int					master_xfer_cnt;			//total xfer count
 	u32					master_xfer_mode;			//cur xfer mode ... 0 : no_op , master: 1 byte , 2 : buffer , 3: dma , slave : xxxx
 	struct completion	cmd_complete;
 	int					cmd_err;
 	u8 					blk_r_flag; 		//for smbus block read
-	void 				(*do_master_xfer)(struct ast_i2c_dev *i2c_dev);	
-//Slave structure	
+	void 				(*do_master_xfer)(struct ast_i2c_dev *i2c_dev);
+  spinlock_t  master_lock;
+//Slave structure
 	u8					slave_operation;
 	u8					slave_event;
 	struct i2c_msg		*slave_msgs; 		//cur slave xfer msgs
-	int 				slave_xfer_len;			
-	int 				slave_xfer_cnt;		
-	u32					slave_xfer_mode;			//cur xfer mode ... 0 : no_op , master: 1 byte , 2 : buffer , 3: dma , slave : xxxx		
+	int 				slave_xfer_len;
+	int 				slave_xfer_cnt;
+	u32					slave_xfer_mode;			//cur xfer mode ... 0 : no_op , master: 1 byte , 2 : buffer , 3: dma , slave : xxxx
 	void				(*do_slave_xfer)(struct ast_i2c_dev *i2c_dev);
-};
-
 #ifdef CONFIG_AST_I2C_SLAVE_RDWR
-#define I2C_S_BUF_SIZE 		64
-#define I2C_S_RX_BUF_NUM 		4
-#define BUFF_FULL		0xff00
-#define BUFF_ONGOING	1	
-
-struct i2c_msg		slave_rx_msg[I2C_S_RX_BUF_NUM + 1];
-struct i2c_msg		slave_tx_msg;	
-static spinlock_t	slave_rx_lock = SPIN_LOCK_UNLOCKED;
+  struct i2c_msg		slave_rx_msg[I2C_S_RX_BUF_NUM + 1];
+  struct i2c_msg		slave_tx_msg;
+  spinlock_t	slave_rx_lock;
 #endif
+};
+
 
-static spinlock_t g_master_lock = SPIN_LOCK_UNLOCKED;
 
 static inline void
 ast_i2c_write(struct ast_i2c_dev *i2c_dev, u32 val, u32 reg)
 {
-//	dev_dbg(i2c_dev->dev, "ast_i2c_write : val: %x , reg : %x \n",val,reg);	
+//	dev_dbg(i2c_dev->dev, "ast_i2c_write : val: %x , reg : %x \n",val,reg);
 	writel(val, i2c_dev->reg_base+ reg);
 }
 
@@ -107,7 +112,7 @@ ast_i2c_read(struct ast_i2c_dev *i2c_dev, u32 reg)
 	u32 val = readl(i2c_dev->reg_base + reg);
 	printk("R : reg %x , val: %x \n",reg, val);
 	return val;
-#else	
+#else
 	return readl(i2c_dev->reg_base + reg);
 #endif
 }
@@ -152,7 +157,7 @@ static void ast_slave_issue_alert(struct ast_i2c_dev *i2c_dev, u8 enable)
 static void ast_slave_mode_enable(struct ast_i2c_dev *i2c_dev, struct i2c_msg *msgs)
 {
 	if(msgs->buf[0] == 1) {
-		ast_i2c_write(i2c_dev, msgs->addr, I2C_DEV_ADDR_REG);	
+		ast_i2c_write(i2c_dev, msgs->addr, I2C_DEV_ADDR_REG);
 		ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_FUN_CTRL_REG) | AST_I2CD_SLAVE_EN, I2C_FUN_CTRL_REG);
 	} else
 		ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_FUN_CTRL_REG) & ~AST_I2CD_SLAVE_EN, I2C_FUN_CTRL_REG);
@@ -162,12 +167,14 @@ static void ast_slave_mode_enable(struct ast_i2c_dev *i2c_dev, struct i2c_msg *m
 
 static void ast_i2c_dev_init(struct ast_i2c_dev *i2c_dev)
 {
-	//I2CG Reset 
+	//I2CG Reset
 	ast_i2c_write(i2c_dev, 0, I2C_FUN_CTRL_REG);
 
-#ifdef CONFIG_AST_I2C_SLAVE_EEPROM	
+#ifdef CONFIG_AST_I2C_SLAVE_EEPROM
 	i2c_dev->ast_i2c_data->slave_init(&(i2c_dev->slave_msgs));
 	ast_slave_mode_enable(i2c_dev, i2c_dev->slave_msgs);
+#else
+  i2c_dev->slave_msgs = i2c_dev->slave_rx_msg;
 #endif
 
 	//Enable Master Mode
@@ -177,20 +184,20 @@ static void ast_i2c_dev_init(struct ast_i2c_dev *i2c_dev)
 	/* Set AC Timing */
 #if defined(CONFIG_ARCH_AST2400)
 	if(i2c_dev->ast_i2c_data->bus_clk/1000 > 400) {
-		printk("high speed mode enable clk [%dkhz]\n",i2c_dev->ast_i2c_data->bus_clk/1000);		
+		printk("high speed mode enable clk [%dkhz]\n",i2c_dev->ast_i2c_data->bus_clk/1000);
 		ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev, I2C_FUN_CTRL_REG) |
 							AST_I2CD_M_HIGH_SPEED_EN |
 							AST_I2CD_M_SDA_DRIVE_1T_EN |
-							AST_I2CD_SDA_DRIVE_1T_EN 
+							AST_I2CD_SDA_DRIVE_1T_EN
 							, I2C_FUN_CTRL_REG);
-		
+
 		/* Set AC Timing */
 		ast_i2c_write(i2c_dev, 0x3, I2C_AC_TIMING_REG2);
-		ast_i2c_write(i2c_dev, select_i2c_clock(i2c_dev), I2C_AC_TIMING_REG1);		
+		ast_i2c_write(i2c_dev, select_i2c_clock(i2c_dev), I2C_AC_TIMING_REG1);
 	}else {
-		/* target apeed is xxKhz*/	
+		/* target apeed is xxKhz*/
 		ast_i2c_write(i2c_dev, select_i2c_clock(i2c_dev), I2C_AC_TIMING_REG1);
-		ast_i2c_write(i2c_dev, AST_NO_TIMEOUT_CTRL, I2C_AC_TIMING_REG2);	
+		ast_i2c_write(i2c_dev, AST_NO_TIMEOUT_CTRL, I2C_AC_TIMING_REG2);
 	}
 #else
 	/* target apeed is xxKhz*/
@@ -206,12 +213,12 @@ static void ast_i2c_dev_init(struct ast_i2c_dev *i2c_dev)
 
 	//TODO
 //	ast_i2c_write(i2c_dev, 0xAF, I2C_INTR_CTRL_REG);
-	//Enable Interrupt, STOP Interrupt has bug in AST2000 
-	
+	//Enable Interrupt, STOP Interrupt has bug in AST2000
+
 	/* Set interrupt generation of I2C controller */
 	ast_i2c_write(i2c_dev,
-				AST_I2CD_SDA_DL_TO_INTR_EN | 	
-				AST_I2CD_BUS_RECOVER_INTR_EN | 	
+				AST_I2CD_SDA_DL_TO_INTR_EN |
+				AST_I2CD_BUS_RECOVER_INTR_EN |
 				AST_I2CD_SMBUS_ALT_INTR_EN |
 //				AST_I2CD_SLAVE_MATCH_INTR_EN |
 				AST_I2CD_SCL_TO_INTR_EN |
@@ -230,16 +237,16 @@ static void ast_i2c_dev_init(struct ast_i2c_dev *i2c_dev)
 static void ast_i2c_slave_buff_init(struct ast_i2c_dev *i2c_dev)
 {
 	int i;
-	//Tx buf  1 
-	slave_tx_msg.len = I2C_S_BUF_SIZE;
-	slave_tx_msg.buf = kzalloc(I2C_S_BUF_SIZE, GFP_KERNEL);
+	//Tx buf  1
+	i2c_dev->slave_tx_msg.len = I2C_S_BUF_SIZE;
+	i2c_dev->slave_tx_msg.buf = kzalloc(I2C_S_BUF_SIZE, GFP_KERNEL);
 	//Rx buf 4
 	for(i=0; i<I2C_S_RX_BUF_NUM+1; i++) {
-		slave_rx_msg[i].addr = ~BUFF_ONGOING;
-		slave_rx_msg[i].flags = 0;	//mean empty buffer 
-		slave_rx_msg[i].len = I2C_S_BUF_SIZE;
-		slave_rx_msg[i].buf = kzalloc(I2C_S_BUF_SIZE, GFP_KERNEL);
-	}	
+		i2c_dev->slave_rx_msg[i].addr = ~BUFF_ONGOING;
+		i2c_dev->slave_rx_msg[i].flags = 0;	//mean empty buffer
+		i2c_dev->slave_rx_msg[i].len = I2C_S_BUF_SIZE;
+		i2c_dev->slave_rx_msg[i].buf = kzalloc(I2C_S_BUF_SIZE, GFP_KERNEL);
+	}
 }
 
 static void ast_i2c_slave_rdwr_xfer(struct ast_i2c_dev *i2c_dev)
@@ -247,13 +254,13 @@ static void ast_i2c_slave_rdwr_xfer(struct ast_i2c_dev *i2c_dev)
 	int i;
 	unsigned long flags;
 
-	spin_lock_irqsave(&slave_rx_lock, flags);
-	
+	spin_lock_irqsave(&i2c_dev->slave_rx_lock, flags);
+
 	switch(i2c_dev->slave_event) {
 		case I2C_SLAVE_EVENT_START_WRITE:
 			for(i=0; i<I2C_S_RX_BUF_NUM; i++) {
-				if((slave_rx_msg[i].flags == 0) && (slave_rx_msg[i].addr != BUFF_ONGOING)) {
-					slave_rx_msg[i].addr = BUFF_ONGOING;
+				if((i2c_dev->slave_rx_msg[i].flags == 0) && (i2c_dev->slave_rx_msg[i].addr != BUFF_ONGOING)) {
+					i2c_dev->slave_rx_msg[i].addr = BUFF_ONGOING;
 					break;
 				}
 			}
@@ -261,40 +268,40 @@ static void ast_i2c_slave_rdwr_xfer(struct ast_i2c_dev *i2c_dev)
 				printk("RX buffer full ........use tmp msgs buff \n");
 				//TODO...
 			}
-			printk("I2C_SLAVE_EVENT_START_WRITE ... %d \n", i);
+			//printk("I2C_SLAVE_EVENT_START_WRITE ... %d \n", i);
 
-			i2c_dev->slave_msgs = &slave_rx_msg[i];
+			i2c_dev->slave_msgs = &i2c_dev->slave_rx_msg[i];
 			break;
 		case I2C_SLAVE_EVENT_START_READ:
-			printk("I2C_SLAVE_EVENT_START_READ ERROR .. not imple \n");
-			i2c_dev->slave_msgs = &slave_tx_msg;
+			//printk("I2C_SLAVE_EVENT_START_READ ERROR .. not imple \n");
+			i2c_dev->slave_msgs = &i2c_dev->slave_tx_msg;
 			break;
 		case I2C_SLAVE_EVENT_WRITE:
-			printk("I2C_SLAVE_EVENT_WRITE next write ERROR ...\n");			
-			i2c_dev->slave_msgs = &slave_tx_msg;
+			//printk("I2C_SLAVE_EVENT_WRITE next write ERROR ...\n");
+			i2c_dev->slave_msgs = &i2c_dev->slave_tx_msg;
 			break;
 		case I2C_SLAVE_EVENT_READ:
-			printk("I2C_SLAVE_EVENT_READ ERROR ... \n");			
-			i2c_dev->slave_msgs = &slave_tx_msg;
+			printk("I2C_SLAVE_EVENT_READ ERROR ... \n");
+			i2c_dev->slave_msgs = &i2c_dev->slave_tx_msg;
 			break;
 		case I2C_SLAVE_EVENT_NACK:
-			printk("I2C_SLAVE_EVENT_NACK ERROR ... \n");			
-			i2c_dev->slave_msgs = &slave_tx_msg;
+			//printk("I2C_SLAVE_EVENT_NACK ERROR ... \n");
+			i2c_dev->slave_msgs = &i2c_dev->slave_tx_msg;
 			break;
 		case I2C_SLAVE_EVENT_STOP:
-			printk("I2C_SLAVE_EVENT_STOP \n");			
+			//printk("I2C_SLAVE_EVENT_STOP \n");
 			for(i=0; i<I2C_S_RX_BUF_NUM; i++) {
-				if(slave_rx_msg[i].addr == BUFF_ONGOING) {
-					slave_rx_msg[i].flags = BUFF_FULL;
-					slave_rx_msg[i].addr = 0;
+				if(i2c_dev->slave_rx_msg[i].addr == BUFF_ONGOING) {
+					i2c_dev->slave_rx_msg[i].flags = BUFF_FULL;
+					i2c_dev->slave_rx_msg[i].addr = 0;
 					break;
 				}
 			}
-			
-			i2c_dev->slave_msgs = &slave_tx_msg;
+
+			i2c_dev->slave_msgs = &i2c_dev->slave_tx_msg;
 			break;
 	}
-	spin_unlock_irqrestore(&slave_rx_lock, flags);
+	spin_unlock_irqrestore(&i2c_dev->slave_rx_lock, flags);
 
 }
 
@@ -308,29 +315,29 @@ static int ast_i2c_slave_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs)
 		case 0:
 //			printk("slave read \n");
 			//cur_msg = get_free_msg;
-			spin_lock_irqsave(&slave_rx_lock, flags);
+			spin_lock_irqsave(&i2c_dev->slave_rx_lock, flags);
 
 			for(i=0; i<I2C_S_RX_BUF_NUM; i++) {
-				if((slave_rx_msg[i].addr == 0) && (slave_rx_msg[i].flags == BUFF_FULL)) {
-					memcpy(msgs->buf, slave_rx_msg[i].buf, slave_rx_msg[i].len);
-					msgs->len = slave_rx_msg[i].len;
-					slave_rx_msg[i].flags = 0;
-					slave_rx_msg[i].len = 0;
+				if((i2c_dev->slave_rx_msg[i].addr == 0) && (i2c_dev->slave_rx_msg[i].flags == BUFF_FULL)) {
+					memcpy(msgs->buf, i2c_dev->slave_rx_msg[i].buf, i2c_dev->slave_rx_msg[i].len);
+					msgs->len = i2c_dev->slave_rx_msg[i].len;
+					i2c_dev->slave_rx_msg[i].flags = 0;
+					i2c_dev->slave_rx_msg[i].len = 0;
 					break;
 				}
 			}
-			spin_unlock_irqrestore(&slave_rx_lock, flags);
-			
+			spin_unlock_irqrestore(&i2c_dev->slave_rx_lock, flags);
+
 			if(i == I2C_S_RX_BUF_NUM) {
-				printk("No buffer ........ \n");
+				//printk("No buffer ........ \n");
 				msgs->len = 0;
 				ret = -1;
 			}
 			break;
 		case I2C_M_RD:	//slave write
 //			printk("slave write \n");
-			memcpy(msgs->buf, slave_tx_msg.buf, I2C_S_BUF_SIZE);
-			break;		
+			memcpy(msgs->buf, i2c_dev->slave_tx_msg.buf, I2C_S_BUF_SIZE);
+			break;
 		case I2C_S_EN:
 			if((msgs->addr < 0x1) || (msgs->addr > 0xff)) {
 				ret = -1;
@@ -352,7 +359,7 @@ static int ast_i2c_slave_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs)
 		default:
 			printk("slave xfer error \n");
 			break;
-		
+
 	}
 	return ret;
 }
@@ -360,16 +367,16 @@ static int ast_i2c_slave_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs)
 
 #endif
 
-static u8 
+static u8
 ast_i2c_bus_error_recover(struct ast_i2c_dev *i2c_dev)
 {
 	u32 sts;
-	int r;		
+	int r;
 	u32 i = 0;
-	
+
 	//Check 0x14's SDA and SCL status
 	sts = ast_i2c_read(i2c_dev,I2C_CMD_REG);
-	
+
 	if ((sts & AST_I2CD_SDA_LINE_STS) && (sts & AST_I2CD_SCL_LINE_STS)) {
 		//Means bus is idle.
 		dev_dbg(i2c_dev->dev, "I2C bus (%d) is idle. I2C slave doesn't exist?!\n", i2c_dev->bus_id);
@@ -377,11 +384,11 @@ ast_i2c_bus_error_recover(struct ast_i2c_dev *i2c_dev)
 	}
 
 	dev_dbg(i2c_dev->dev, "ERROR!! I2C(%d) bus hanged, try to recovery it!\n", i2c_dev->bus_id);
-	
-	
+
+
 	if ((sts & AST_I2CD_SDA_LINE_STS) && !(sts & AST_I2CD_SCL_LINE_STS)) {
 		//if SDA == 1 and SCL == 0, it means the master is locking the bus.
-		//Send a stop command to unlock the bus.		
+		//Send a stop command to unlock the bus.
 		dev_dbg(i2c_dev->dev, "I2C's master is locking the bus, try to stop it.\n");
 //
 		init_completion(&i2c_dev->cmd_complete);
@@ -397,12 +404,12 @@ ast_i2c_bus_error_recover(struct ast_i2c_dev *i2c_dev)
 			dev_dbg(i2c_dev->dev, "recovery error \n");
 			return -1;
 		}
-			
+
 		if (r == 0) {
 			 dev_dbg(i2c_dev->dev, "recovery timed out\n");
 			 return -1;
 		} else {
-			dev_dbg(i2c_dev->dev, "Recovery successfully\n");		
+			dev_dbg(i2c_dev->dev, "Recovery successfully\n");
 			return 0;
 		}
 
@@ -415,11 +422,11 @@ ast_i2c_bus_error_recover(struct ast_i2c_dev *i2c_dev)
 		for (i = 0; i < 10; i++) {
 			ast_i2c_dev_init(i2c_dev);
 			//Do the recovery command BIT11
-			init_completion(&i2c_dev->cmd_complete);			
+			init_completion(&i2c_dev->cmd_complete);
 			ast_i2c_write(i2c_dev, AST_I2CD_BUS_RECOVER_CMD_EN, I2C_CMD_REG);
-			
+
 			r = wait_for_completion_interruptible_timeout(&i2c_dev->cmd_complete,
-														   i2c_dev->adap.timeout*HZ);			
+														   i2c_dev->adap.timeout*HZ);
 			if (i2c_dev->cmd_err != 0 &&
 			   i2c_dev->cmd_err != AST_I2CD_INTR_STS_NORMAL_STOP) {
 				dev_dbg(i2c_dev->dev, "ERROR!! Failed to do recovery command(0x%08x)\n", i2c_dev->cmd_err);
@@ -438,31 +445,56 @@ ast_i2c_bus_error_recover(struct ast_i2c_dev *i2c_dev)
 		dev_dbg(i2c_dev->dev, "Don't know how to handle this case?!\n");
 		return -1;
 	}
-	dev_dbg(i2c_dev->dev, "Recovery successfully\n");
+  dev_dbg(i2c_dev->dev, "Recovery successfully\n");
 	return 0;
 }
 
-static void ast_master_alert_recv(struct ast_i2c_dev *i2c_dev)	
+static void ast_master_alert_recv(struct ast_i2c_dev *i2c_dev)
 {
 	printk("ast_master_alert_recv bus id %d, Disable Alt, Please Imple \n",i2c_dev->bus_id);
 }
 
 static int ast_i2c_wait_bus_not_busy(struct ast_i2c_dev *i2c_dev)
 {
-	int timeout = 32; //TODO number
+	int timeout = 10; //TODO number
+  volatile u8 mode = 0;
 //	printk("ast_i2c_wait_bus_not_busy \n");
+
+  // Wait for slave transfer to finish
+  mode = i2c_dev->slave_operation;
+  while (mode == 1) {
+    if (timeout <= 0) {
+      break;
+    }
+    mode = i2c_dev->slave_operation;
+    timeout--;
+    msleep(1);
+  }
+
+  if (timeout <= 0) {
+    return -EAGAIN;
+  }
+
+  // Wait for Bus to go IDLE
+  timeout = 10;
 	while (ast_i2c_read(i2c_dev,I2C_CMD_REG) & AST_I2CD_BUS_BUSY_STS) {
-		ast_i2c_bus_error_recover(i2c_dev);
-		if(timeout<=0)
+		if(timeout<=0) {
 			break;
+    }
+
 		timeout--;
-		msleep(2);
+		msleep(1);
 	}
 
-	return timeout <= 0 ? EAGAIN : 0;
+  if (timeout <=0) {
+    ast_i2c_bus_error_recover(i2c_dev);
+    return 0;
+  }
+
+  return 0;
 }
 
-static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)	
+static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)
 {
 	u32 cmd = 0;
 	int i;
@@ -470,49 +502,49 @@ static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)
 	i2c_dev->master_xfer_mode = DMA_XFER;
 	i2c_dev->slave_xfer_mode = DMA_XFER;
 
-	if(i2c_dev->slave_operation == 1) { 
+	if(i2c_dev->slave_operation == 1) {
 		if(i2c_dev->slave_msgs->flags & I2C_M_RD) {
 			//DMA tx mode
 			if(i2c_dev->slave_msgs->len > AST_I2C_DMA_SIZE)
 				i2c_dev->slave_xfer_len = AST_I2C_DMA_SIZE;
-			else 
+			else
 				i2c_dev->slave_xfer_len = i2c_dev->slave_msgs->len;
-			
+
 			dev_dbg(i2c_dev->dev, "(<--) slave tx DMA \n");
 			for(i=0; i<i2c_dev->slave_xfer_len; i++)
 				i2c_dev->dma_buf[i] = i2c_dev->slave_msgs->buf[i2c_dev->slave_xfer_cnt + i];
-			
+
 			ast_i2c_write(i2c_dev, i2c_dev->dma_addr, I2C_DMA_BASE_REG);
 			ast_i2c_write(i2c_dev, (i2c_dev->slave_xfer_len-1), I2C_DMA_LEN_REG);
-			ast_i2c_write(i2c_dev, AST_I2CD_TX_DMA_ENABLE | AST_I2CD_S_TX_CMD,I2C_CMD_REG);	
+			ast_i2c_write(i2c_dev, AST_I2CD_TX_DMA_ENABLE | AST_I2CD_S_TX_CMD,I2C_CMD_REG);
 		} else {
 			//DMA prepare rx
 			dev_dbg(i2c_dev->dev, "(-->) slave rx DMA \n");
 			ast_i2c_write(i2c_dev, i2c_dev->dma_addr, I2C_DMA_BASE_REG);
 			ast_i2c_write(i2c_dev, (AST_I2C_DMA_SIZE-1), I2C_DMA_LEN_REG);
-			ast_i2c_write(i2c_dev, AST_I2CD_RX_DMA_ENABLE, I2C_CMD_REG);		
+			ast_i2c_write(i2c_dev, AST_I2CD_RX_DMA_ENABLE, I2C_CMD_REG);
 		}
 	} else {
 		dev_dbg(i2c_dev->dev,"M cnt %d, xf len %d \n",i2c_dev->master_xfer_cnt, i2c_dev->master_msgs->len);
 		if(i2c_dev->master_xfer_cnt == -1) {
-			//send start 
+			//send start
 			dev_dbg(i2c_dev->dev, " %sing %d byte%s %s 0x%02x\n",
 							i2c_dev->master_msgs->flags & I2C_M_RD ? "read" : "write",
 							i2c_dev->master_msgs->len, i2c_dev->master_msgs->len > 1 ? "s" : "",
 							i2c_dev->master_msgs->flags & I2C_M_RD ? "from" : "to", i2c_dev->master_msgs->addr);
 
 			if(i2c_dev->master_msgs->flags & I2C_M_RD) {
-				//workaround .. HW can;t send start read addr with buff mode 
+				//workaround .. HW can;t send start read addr with buff mode
 				cmd = AST_I2CD_M_START_CMD | AST_I2CD_M_TX_CMD;
 				ast_i2c_write(i2c_dev, (i2c_dev->master_msgs->addr <<1) |0x1, I2C_BYTE_BUF_REG);
 
 //				tx_buf[0] = (i2c_dev->master_msgs->addr <<1); //+1
 				i2c_dev->master_xfer_len = 1;
 				ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-									AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);	
+									AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 			} else {
 				//tx
-				cmd = AST_I2CD_M_START_CMD | AST_I2CD_M_TX_CMD | AST_I2CD_TX_DMA_ENABLE;		
+				cmd = AST_I2CD_M_START_CMD | AST_I2CD_M_TX_CMD | AST_I2CD_TX_DMA_ENABLE;
 
 				i2c_dev->dma_buf[0] = (i2c_dev->master_msgs->addr <<1);	//+1
 				//next data write
@@ -520,44 +552,44 @@ static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)
 					i2c_dev->master_xfer_len = AST_I2C_DMA_SIZE;
 				else
 					i2c_dev->master_xfer_len = i2c_dev->master_msgs->len + 1;
-				
+
 				for(i = 1; i < i2c_dev->master_xfer_len; i++)
 					i2c_dev->dma_buf[i] = i2c_dev->master_msgs->buf[i2c_dev->master_xfer_cnt+i];
-				
+
 				if (i2c_dev->xfer_last == 1) {
 					dev_dbg(i2c_dev->dev, "last stop \n");
 					cmd |= AST_I2CD_M_STOP_CMD;
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) &
-										~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);				
-					
+										~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
+
 				} else {
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
+										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 				}
 				ast_i2c_write(i2c_dev, i2c_dev->dma_addr, I2C_DMA_BASE_REG);
 				ast_i2c_write(i2c_dev, (i2c_dev->master_xfer_len-1), I2C_DMA_LEN_REG);
-				
+
 			}
-			ast_i2c_write(i2c_dev, cmd, I2C_CMD_REG);			
+			ast_i2c_write(i2c_dev, cmd, I2C_CMD_REG);
 			dev_dbg(i2c_dev->dev, "txfer size %d , cmd = %x \n",i2c_dev->master_xfer_len, cmd);
 
 		} else if (i2c_dev->master_xfer_cnt < i2c_dev->master_msgs->len){
-			//Next send 
+			//Next send
 			if(i2c_dev->master_msgs->flags & I2C_M_RD) {
 				//Rx data
 				cmd = AST_I2CD_M_RX_CMD | AST_I2CD_RX_DMA_ENABLE;
-															
+
 				if((i2c_dev->master_msgs->len - i2c_dev->master_xfer_cnt) > AST_I2C_DMA_SIZE) {
 					i2c_dev->master_xfer_len = AST_I2C_DMA_SIZE;
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
 										AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
-					
+
 				} else {
 					i2c_dev->master_xfer_len = i2c_dev->master_msgs->len - i2c_dev->master_xfer_cnt;
 					if((i2c_dev->master_msgs->flags & I2C_M_RECV_LEN) && (i2c_dev->blk_r_flag == 0)) {
 						dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN \n");
 						ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-											AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);						
+											AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
 					} else {
 #ifdef CONFIG_AST1010
 						//Workaround for ast1010 can't send NACK
@@ -568,7 +600,7 @@ static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)
 							i2c_dev->master_xfer_mode = BYTE_XFER;
 							ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) &
 												~AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
-							
+
 						} else if (i2c_dev->master_xfer_len > 1) {
 							i2c_dev->master_xfer_len -=1;
 							ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
@@ -578,8 +610,8 @@ static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)
 						}
 #else
 						if(i2c_dev->xfer_last == 1) {
-							dev_dbg(i2c_dev->dev, "last stop \n");							
-							cmd |= AST_I2CD_M_STOP_CMD; 
+							dev_dbg(i2c_dev->dev, "last stop \n");
+							cmd |= AST_I2CD_M_STOP_CMD;
 							ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) &
 											~AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
 						} else {
@@ -588,9 +620,9 @@ static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)
 						}
 						//TODO check....
 						cmd |= AST_I2CD_M_S_RX_CMD_LAST;
-#endif						
+#endif
 					}
-					
+
 				}
 				ast_i2c_write(i2c_dev, i2c_dev->dma_addr, I2C_DMA_BASE_REG);
 				ast_i2c_write(i2c_dev, i2c_dev->master_xfer_len-1, I2C_DMA_LEN_REG);
@@ -603,23 +635,23 @@ static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)
 				if((i2c_dev->master_msgs->len - i2c_dev->master_xfer_cnt) > AST_I2C_DMA_SIZE) {
 					i2c_dev->master_xfer_len = AST_I2C_DMA_SIZE;
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
-				
+										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
+
 				} else {
 					i2c_dev->master_xfer_len = i2c_dev->master_msgs->len - i2c_dev->master_xfer_cnt;
 					if(i2c_dev->xfer_last == 1) {
 						dev_dbg(i2c_dev->dev, "last stop \n");
 						cmd |= AST_I2CD_M_STOP_CMD;
 						ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) &
-											~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);				
-						
+											~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
+
 					} else {
 						ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-											AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
+											AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 					}
 				}
 
-				for(i = 0; i < i2c_dev->master_xfer_len; i++) 
+				for(i = 0; i < i2c_dev->master_xfer_len; i++)
 					i2c_dev->dma_buf[i] = i2c_dev->master_msgs->buf[i2c_dev->master_xfer_cnt + i];
 
 				ast_i2c_write(i2c_dev, i2c_dev->dma_addr, I2C_DMA_BASE_REG);
@@ -627,33 +659,33 @@ static void ast_i2c_do_dma_xfer(struct ast_i2c_dev *i2c_dev)
 				ast_i2c_write(i2c_dev, cmd , I2C_CMD_REG);
 				dev_dbg(i2c_dev->dev, "txfer size %d , cmd = %x \n",i2c_dev->master_xfer_len, cmd);
 
-			}		
+			}
 		}else {
-			//should send next msg 
+			//should send next msg
 			 if(i2c_dev->master_xfer_cnt != i2c_dev->master_msgs->len)
 					 printk("complete rx ... bus=%d addr=0x%x (%d vs. %d) ERROR\n",
 					 i2c_dev->bus_id, i2c_dev->master_msgs->addr,
 					 i2c_dev->master_xfer_cnt, i2c_dev->master_msgs->len);
-			
+
 			 dev_dbg(i2c_dev->dev, "ast_i2c_do_byte_xfer complete \n");
 			 i2c_dev->cmd_err = 0;
-			 complete(&i2c_dev->cmd_complete);		
+			 complete(&i2c_dev->cmd_complete);
 		}
-	
+
 	}
 
-	
+
 }
 
-static void ast_i2c_do_pool_xfer(struct ast_i2c_dev *i2c_dev)	
+static void ast_i2c_do_pool_xfer(struct ast_i2c_dev *i2c_dev)
 {
 	u32 cmd = 0;
 	int i;
 	u32 *tx_buf;
 
 	i2c_dev->master_xfer_mode = BUFF_XFER;
-	i2c_dev->slave_xfer_mode = BUFF_XFER; 	
-	
+	i2c_dev->slave_xfer_mode = BUFF_XFER;
+
 #if defined(CONFIG_ARCH_AST2400)
 	ast_i2c_write(i2c_dev,
 					(ast_i2c_read(i2c_dev, I2C_FUN_CTRL_REG) &
@@ -665,15 +697,15 @@ static void ast_i2c_do_pool_xfer(struct ast_i2c_dev *i2c_dev)
 	tx_buf = (u32 *) i2c_dev->req_page->page_addr;
 
 
-	if(i2c_dev->slave_operation == 1) { 
+	if(i2c_dev->slave_operation == 1) {
 		if(i2c_dev->slave_msgs->flags & I2C_M_RD) {
 			dev_dbg(i2c_dev->dev, "(<--) slave tx buf \n");
-	
+
 			if(i2c_dev->slave_msgs->len > i2c_dev->req_page->page_size)
 				i2c_dev->slave_xfer_len = i2c_dev->req_page->page_size;
 			else
 				i2c_dev->slave_xfer_len = i2c_dev->slave_msgs->len;
-			
+
 			for(i = 0; i< i2c_dev->slave_xfer_len; i++) {
 				if(i%4 == 0)
 					tx_buf[i/4] = 0;
@@ -681,80 +713,80 @@ static void ast_i2c_do_pool_xfer(struct ast_i2c_dev *i2c_dev)
 				dev_dbg(i2c_dev->dev, "[%x] ",tx_buf[i/4]);
 			}
 			dev_dbg(i2c_dev->dev, "\n");
-		
-			ast_i2c_write(i2c_dev, AST_I2CD_TX_DATA_BUF_END_SET((i2c_dev->slave_xfer_len-1)) | 
-						AST_I2CD_BUF_BASE_ADDR_SET((i2c_dev->req_page->page_addr_point)), 
+
+			ast_i2c_write(i2c_dev, AST_I2CD_TX_DATA_BUF_END_SET((i2c_dev->slave_xfer_len-1)) |
+						AST_I2CD_BUF_BASE_ADDR_SET((i2c_dev->req_page->page_addr_point)),
 						I2C_BUF_CTRL_REG);
-		
+
 			ast_i2c_write(i2c_dev, AST_I2CD_TX_BUFF_ENABLE | AST_I2CD_S_TX_CMD, I2C_CMD_REG);
 		} else {
 			//prepare for new rx
 			dev_dbg(i2c_dev->dev, "(-->) slave prepare rx buf \n");
-			ast_i2c_write(i2c_dev, 
+			ast_i2c_write(i2c_dev,
 						AST_I2CD_RX_BUF_END_ADDR_SET((i2c_dev->req_page->page_size-1)) |
 						AST_I2CD_BUF_BASE_ADDR_SET((i2c_dev->req_page->page_addr_point)),
 						I2C_BUF_CTRL_REG);
 
-			ast_i2c_write(i2c_dev, AST_I2CD_RX_BUFF_ENABLE, I2C_CMD_REG);			
-			
+			ast_i2c_write(i2c_dev, AST_I2CD_RX_BUFF_ENABLE, I2C_CMD_REG);
+
 		}
 	} else {
 		dev_dbg(i2c_dev->dev,"M cnt %d, xf len %d \n",i2c_dev->master_xfer_cnt, i2c_dev->master_msgs->len);
 		if(i2c_dev->master_xfer_cnt == -1) {
-			//send start 
+			//send start
 			dev_dbg(i2c_dev->dev, " %sing %d byte%s %s 0x%02x\n",
 							i2c_dev->master_msgs->flags & I2C_M_RD ? "read" : "write",
 							i2c_dev->master_msgs->len, i2c_dev->master_msgs->len > 1 ? "s" : "",
 							i2c_dev->master_msgs->flags & I2C_M_RD ? "from" : "to", i2c_dev->master_msgs->addr);
 
 			if(i2c_dev->master_msgs->flags & I2C_M_RD) {
-//workaround .. HW can;t send start read addr with buff mode 
+//workaround .. HW can;t send start read addr with buff mode
 				cmd = AST_I2CD_M_START_CMD | AST_I2CD_M_TX_CMD;
 				ast_i2c_write(i2c_dev, (i2c_dev->master_msgs->addr <<1) |0x1, I2C_BYTE_BUF_REG);
 
 //				tx_buf[0] = (i2c_dev->master_msgs->addr <<1); //+1
 				i2c_dev->master_xfer_len = 1;
 				ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-									AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
+									AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 			} else {
-				cmd = AST_I2CD_M_START_CMD | AST_I2CD_M_TX_CMD | AST_I2CD_TX_BUFF_ENABLE;			
+				cmd = AST_I2CD_M_START_CMD | AST_I2CD_M_TX_CMD | AST_I2CD_TX_BUFF_ENABLE;
 				tx_buf[0] = (i2c_dev->master_msgs->addr <<1);	//+1
 				//next data write
 				if((i2c_dev->master_msgs->len + 1) > i2c_dev->req_page->page_size)
 					i2c_dev->master_xfer_len = i2c_dev->req_page->page_size;
 				else
 					i2c_dev->master_xfer_len = i2c_dev->master_msgs->len + 1;
-				
+
 				for(i = 1; i < i2c_dev->master_xfer_len; i++) {
 					if(i%4 == 0)
 						tx_buf[i/4] = 0;
 					tx_buf[i/4] |= (i2c_dev->master_msgs->buf[i2c_dev->master_xfer_cnt + i] << ((i%4)*8)) ;
 				}
-				
+
 				if (i2c_dev->xfer_last == 1) {
 					dev_dbg(i2c_dev->dev, "last stop \n");
 					cmd |= AST_I2CD_M_STOP_CMD;
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) &
-										~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);				
-					
+										~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
+
 				} else {
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
+										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 				}
-				ast_i2c_write(i2c_dev, 
+				ast_i2c_write(i2c_dev,
 							AST_I2CD_TX_DATA_BUF_END_SET((i2c_dev->master_xfer_len - 1)) |
 							AST_I2CD_BUF_BASE_ADDR_SET(i2c_dev->req_page->page_addr_point),
 							I2C_BUF_CTRL_REG);
 			}
-			ast_i2c_write(i2c_dev, cmd, I2C_CMD_REG);			
+			ast_i2c_write(i2c_dev, cmd, I2C_CMD_REG);
 			dev_dbg(i2c_dev->dev, "txfer size %d , cmd = %x \n",i2c_dev->master_xfer_len, cmd);
 
 		} else if (i2c_dev->master_xfer_cnt < i2c_dev->master_msgs->len){
-			//Next send 
+			//Next send
 			if(i2c_dev->master_msgs->flags & I2C_M_RD) {
 				//Rx data
 				cmd = AST_I2CD_M_RX_CMD | AST_I2CD_RX_BUFF_ENABLE;
-															
+
 				if((i2c_dev->master_msgs->len - i2c_dev->master_xfer_cnt) > i2c_dev->req_page->page_size) {
 					i2c_dev->master_xfer_len = i2c_dev->req_page->page_size;
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
@@ -764,11 +796,11 @@ static void ast_i2c_do_pool_xfer(struct ast_i2c_dev *i2c_dev)
 					if((i2c_dev->master_msgs->flags & I2C_M_RECV_LEN) && (i2c_dev->blk_r_flag == 0)) {
 						dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN \n");
 						ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-											AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);						
+											AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
 					} else {
 						if(i2c_dev->xfer_last == 1) {
-							dev_dbg(i2c_dev->dev, "last stop \n");							
-							cmd |= AST_I2CD_M_STOP_CMD; 
+							dev_dbg(i2c_dev->dev, "last stop \n");
+							cmd |= AST_I2CD_M_STOP_CMD;
 							ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) &
 											~AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
 						} else {
@@ -791,46 +823,46 @@ static void ast_i2c_do_pool_xfer(struct ast_i2c_dev *i2c_dev)
 				if((i2c_dev->master_msgs->len - i2c_dev->master_xfer_cnt) > i2c_dev->req_page->page_size) {
 					i2c_dev->master_xfer_len = i2c_dev->req_page->page_size;
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
-				
+										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
+
 				} else {
 					i2c_dev->master_xfer_len = i2c_dev->master_msgs->len - i2c_dev->master_xfer_cnt;
 					if(i2c_dev->xfer_last == 1) {
 						dev_dbg(i2c_dev->dev, "last stop \n");
 						cmd |= AST_I2CD_M_STOP_CMD;
 						ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) &
-											~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);				
-						
+											~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
+
 					} else {
 						ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-											AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
+											AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 					}
 				}
-				
+
 				for(i = 0; i < i2c_dev->master_xfer_len; i++) {
 					if(i%4 == 0)
 						tx_buf[i/4] = 0;
 					tx_buf[i/4] |= (i2c_dev->master_msgs->buf[i2c_dev->master_xfer_cnt + i] << ((i%4)*8)) ;
 				}
-//				printk("count %x \n",ast_i2c_read(i2c_dev,I2C_CMD_REG));				
-				ast_i2c_write(i2c_dev, 
+//				printk("count %x \n",ast_i2c_read(i2c_dev,I2C_CMD_REG));
+				ast_i2c_write(i2c_dev,
 							AST_I2CD_TX_DATA_BUF_END_SET((i2c_dev->master_xfer_len - 1)) |
 							AST_I2CD_BUF_BASE_ADDR_SET(i2c_dev->req_page->page_addr_point),
 							I2C_BUF_CTRL_REG);
-		
+
 				ast_i2c_write(i2c_dev, cmd , I2C_CMD_REG);
 				dev_dbg(i2c_dev->dev, "txfer size %d , cmd = %x \n",i2c_dev->master_xfer_len, cmd);
 			}
 		} else {
-			//should send next msg 
+			//should send next msg
 			if(i2c_dev->master_xfer_cnt != i2c_dev->master_msgs->len)
 				printk("complete rx ... bus=%d addr=0x%x (%d vs. %d) ERROR\n",
 				i2c_dev->bus_id, i2c_dev->master_msgs->addr,
 				i2c_dev->master_xfer_cnt, i2c_dev->master_msgs->len);
-			
+
 			dev_dbg(i2c_dev->dev, "ast_i2c_do_byte_xfer complete \n");
 			i2c_dev->cmd_err = 0;
-			complete(&i2c_dev->cmd_complete);										
+			complete(&i2c_dev->cmd_complete);
 		}
 
 	}
@@ -843,16 +875,16 @@ static void ast_i2c_do_byte_xfer(struct ast_i2c_dev *i2c_dev)
 	i2c_dev->master_xfer_mode = BYTE_XFER;
 	i2c_dev->master_xfer_len = 1;
 
-	i2c_dev->slave_xfer_mode = BYTE_XFER;	
+	i2c_dev->slave_xfer_mode = BYTE_XFER;
 	i2c_dev->slave_xfer_len = 1;
-	
-	if(i2c_dev->slave_operation == 1) { 
+
+	if(i2c_dev->slave_operation == 1) {
 		dev_dbg(i2c_dev->dev,"S cnt %d, xf len %d \n",i2c_dev->slave_xfer_cnt, i2c_dev->slave_msgs->len);
 		if(i2c_dev->slave_msgs->flags & I2C_M_RD) {
 			//READ <-- TX
 			dev_dbg(i2c_dev->dev, "(<--) slave(tx) buf %d [%x]\n", i2c_dev->slave_xfer_cnt, i2c_dev->slave_msgs->buf[i2c_dev->slave_xfer_cnt]);
 			ast_i2c_write(i2c_dev, i2c_dev->slave_msgs->buf[i2c_dev->slave_xfer_cnt], I2C_BYTE_BUF_REG);
-			ast_i2c_write(i2c_dev, AST_I2CD_S_TX_CMD, I2C_CMD_REG); 
+			ast_i2c_write(i2c_dev, AST_I2CD_S_TX_CMD, I2C_CMD_REG);
 		} else {
 			// Write -->Rx
 			//no need to handle in byte mode
@@ -862,21 +894,21 @@ static void ast_i2c_do_byte_xfer(struct ast_i2c_dev *i2c_dev)
 	} else {
 		dev_dbg(i2c_dev->dev,"M cnt %d, xf len %d \n",i2c_dev->master_xfer_cnt, i2c_dev->master_msgs->len);
 		if(i2c_dev->master_xfer_cnt == -1) {
-			//first start 
+			//first start
 			dev_dbg(i2c_dev->dev, " %sing %d byte%s %s 0x%02x\n",
 							i2c_dev->master_msgs->flags & I2C_M_RD ? "read" : "write",
 							i2c_dev->master_msgs->len, i2c_dev->master_msgs->len > 1 ? "s" : "",
 							i2c_dev->master_msgs->flags & I2C_M_RD ? "from" : "to", i2c_dev->master_msgs->addr);
-			
-		
-			if(i2c_dev->master_msgs->flags & I2C_M_RD) 
+
+
+			if(i2c_dev->master_msgs->flags & I2C_M_RD)
 				ast_i2c_write(i2c_dev, (i2c_dev->master_msgs->addr <<1) |0x1, I2C_BYTE_BUF_REG);
 			else
 				ast_i2c_write(i2c_dev, (i2c_dev->master_msgs->addr <<1), I2C_BYTE_BUF_REG);
 
 			ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-								AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
-			
+								AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
+
 			ast_i2c_write(i2c_dev, AST_I2CD_M_TX_CMD | AST_I2CD_M_START_CMD, I2C_CMD_REG);
 
 
@@ -888,7 +920,7 @@ static void ast_i2c_do_byte_xfer(struct ast_i2c_dev *i2c_dev)
 				if((i2c_dev->master_msgs->flags & I2C_M_RECV_LEN) && (i2c_dev->master_xfer_cnt == 0)) {
 					dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN \n");
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-										AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);			
+										AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
 
 				} else if((i2c_dev->xfer_last == 1) && (i2c_dev->master_xfer_cnt + 1 == i2c_dev->master_msgs->len)) {
 					cmd |= AST_I2CD_M_S_RX_CMD_LAST | AST_I2CD_M_STOP_CMD;
@@ -897,11 +929,11 @@ static void ast_i2c_do_byte_xfer(struct ast_i2c_dev *i2c_dev)
 										~AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
 				} else {
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-										AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);			
+										AST_I2CD_RX_DOWN_INTR_EN, I2C_INTR_CTRL_REG);
 				}
 
 				dev_dbg(i2c_dev->dev, "(<--) rx byte, cmd = %x \n",cmd);
-				
+
 				ast_i2c_write(i2c_dev, cmd, I2C_CMD_REG);
 
 
@@ -911,29 +943,29 @@ static void ast_i2c_do_byte_xfer(struct ast_i2c_dev *i2c_dev)
 				ast_i2c_write(i2c_dev, *(xfer_buf + i2c_dev->master_xfer_cnt), I2C_BYTE_BUF_REG);
 				if((i2c_dev->xfer_last == 1) && (i2c_dev->master_xfer_cnt + 1 == i2c_dev->master_msgs->len)) {
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) &
-										~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);				
+										~AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 					ast_i2c_write(i2c_dev, AST_I2CD_M_TX_CMD | AST_I2CD_M_STOP_CMD, I2C_CMD_REG);
 				} else {
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
-										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);			
+										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 					ast_i2c_write(i2c_dev, AST_I2CD_M_TX_CMD, I2C_CMD_REG);
 				}
 			}
-					
+
 		} else {
-			//should send next msg 
+			//should send next msg
 			if(i2c_dev->master_xfer_cnt != i2c_dev->master_msgs->len)
 				printk("CNT ERROR bus=%d addr=0x%x (%d vs. %d)\n",
 				       i2c_dev->bus_id, i2c_dev->master_msgs->addr,
 				       i2c_dev->master_xfer_cnt, i2c_dev->master_msgs->len);
-			
+
 			dev_dbg(i2c_dev->dev, "ast_i2c_do_byte_xfer complete \n");
 			i2c_dev->cmd_err = 0;
-			complete(&i2c_dev->cmd_complete);		
-			
+			complete(&i2c_dev->cmd_complete);
+
 		}
 	}
-		
+
 }
 
 static void ast_i2c_slave_xfer_done(struct ast_i2c_dev *i2c_dev)
@@ -941,8 +973,8 @@ static void ast_i2c_slave_xfer_done(struct ast_i2c_dev *i2c_dev)
 	u32 xfer_len;
 	int i;
 	u8 *rx_buf;
-	
-	dev_dbg(i2c_dev->dev, "ast_i2c_slave_xfer_done [%d]\n",i2c_dev->slave_xfer_mode);	
+
+	dev_dbg(i2c_dev->dev, "ast_i2c_slave_xfer_done [%d]\n",i2c_dev->slave_xfer_mode);
 
 	if (i2c_dev->slave_msgs->flags & I2C_M_RD) {
 		//tx done , only check tx count ...
@@ -979,16 +1011,16 @@ static void ast_i2c_slave_xfer_done(struct ast_i2c_dev *i2c_dev)
 			xfer_len = AST_I2CD_RX_BUF_ADDR_GET(ast_i2c_read(i2c_dev, I2C_BUF_CTRL_REG));
 			if(xfer_len == 0)
 				xfer_len = AST_I2C_PAGE_SIZE;
-	
+
 			dev_dbg(i2c_dev->dev,"rx buff done len %d \n",xfer_len);
-			
+
 			rx_buf = (u8 *)i2c_dev->req_page->page_addr;
-	
+
 			for(i=0;i<xfer_len;i++) {
 				i2c_dev->slave_msgs->buf[i2c_dev->slave_xfer_cnt+i] = rx_buf[i];
 				dev_dbg(i2c_dev->dev,"%d, [%x] \n",i2c_dev->slave_xfer_cnt+i ,i2c_dev->slave_msgs->buf[i2c_dev->slave_xfer_cnt+i]);
 			}
-		
+
 		} else {
 			//RX DMA DOWN
 			xfer_len = ast_i2c_read(i2c_dev, I2C_DMA_LEN_REG);
@@ -996,15 +1028,15 @@ static void ast_i2c_slave_xfer_done(struct ast_i2c_dev *i2c_dev)
 				xfer_len = i2c_dev->slave_xfer_len;
 			else
 				xfer_len = i2c_dev->slave_xfer_len - xfer_len - 1;
-			
+
 			dev_dbg(i2c_dev->dev, " rx dma done len %d \n", xfer_len);
-			
+
 			for(i=0;i<xfer_len;i++) {
 				i2c_dev->slave_msgs->buf[i2c_dev->slave_xfer_cnt+i] = i2c_dev->dma_buf[i];
 				dev_dbg(i2c_dev->dev,"%d, [%x] \n",i2c_dev->slave_xfer_cnt+i ,i2c_dev->slave_msgs->buf[i2c_dev->slave_xfer_cnt+i]);
 			}
 		}
-	
+
 	}
 
 	if(xfer_len !=i2c_dev->slave_xfer_len) {
@@ -1012,7 +1044,7 @@ static void ast_i2c_slave_xfer_done(struct ast_i2c_dev *i2c_dev)
 		printk(" **slave xfer error ====\n");
 		//should goto stop....
 	} else
-		i2c_dev->slave_xfer_cnt += i2c_dev->slave_xfer_len; 
+		i2c_dev->slave_xfer_cnt += i2c_dev->slave_xfer_len;
 
 
 	if((i2c_dev->slave_event == I2C_SLAVE_EVENT_NACK) || (i2c_dev->slave_event == I2C_SLAVE_EVENT_STOP)) {
@@ -1020,33 +1052,33 @@ static void ast_i2c_slave_xfer_done(struct ast_i2c_dev *i2c_dev)
 			ast_i2c_slave_rdwr_xfer(i2c_dev);
 #else
 			i2c_dev->ast_i2c_data->slave_xfer(i2c_dev->slave_event, &(i2c_dev->slave_msgs));
-#endif				
+#endif
 		i2c_dev->slave_xfer_cnt = 0;
 	} else {
 		if(i2c_dev->slave_xfer_cnt == i2c_dev->slave_msgs->len)	{
-			dev_dbg(i2c_dev->dev,"slave next msgs \n"); 	
+			dev_dbg(i2c_dev->dev,"slave next msgs \n");
 #ifdef CONFIG_AST_I2C_SLAVE_RDWR
 			ast_i2c_slave_rdwr_xfer(i2c_dev);
 #else
 			i2c_dev->ast_i2c_data->slave_xfer(i2c_dev->slave_event, &(i2c_dev->slave_msgs));
-#endif			
+#endif
 
 			i2c_dev->slave_xfer_cnt = 0;
-		} 
+		}
 		i2c_dev->do_slave_xfer(i2c_dev);
 	}
 
 
 	if(AST_I2CD_IDLE == i2c_dev->state) {
-		dev_dbg(i2c_dev->dev,"** Slave go IDLE **\n");		
+		dev_dbg(i2c_dev->dev,"** Slave go IDLE **\n");
 		i2c_dev->slave_operation = 0;
-	
+
 		if(i2c_dev->slave_xfer_mode == BUFF_XFER) {
 			i2c_dev->ast_i2c_data->free_pool_buff_page(i2c_dev->req_page);
-		} 
-		
-	} 
-	
+		}
+
+	}
+
 }
 
 //TX/Rx Done
@@ -1057,7 +1089,7 @@ static void ast_i2c_master_xfer_done(struct ast_i2c_dev *i2c_dev)
 	u8 *pool_buf;
 	unsigned long flags;
 
-	spin_lock_irqsave(&g_master_lock, flags);
+	spin_lock_irqsave(&i2c_dev->master_lock, flags);
 
 	/*
 	 * This function shall be involked during interrupt handling.
@@ -1068,8 +1100,8 @@ static void ast_i2c_master_xfer_done(struct ast_i2c_dev *i2c_dev)
 		goto unlock_out;
 	}
 
-	dev_dbg(i2c_dev->dev, "ast_i2c_master_xfer_done mode[%d]\n",i2c_dev->master_xfer_mode);	
-		
+	dev_dbg(i2c_dev->dev, "ast_i2c_master_xfer_done mode[%d]\n",i2c_dev->master_xfer_mode);
+
 	if (i2c_dev->master_msgs->flags & I2C_M_RD) {
 		if(i2c_dev->master_xfer_cnt == -1) {
 			xfer_len = 1;
@@ -1077,16 +1109,16 @@ static void ast_i2c_master_xfer_done(struct ast_i2c_dev *i2c_dev)
 		}
 		if(i2c_dev->master_xfer_mode == BYTE_XFER) {
 			if ((i2c_dev->master_msgs->flags & I2C_M_RECV_LEN) && (i2c_dev->blk_r_flag == 0)) {
-				i2c_dev->master_msgs->len += (ast_i2c_read(i2c_dev,I2C_BYTE_BUF_REG) & AST_I2CD_RX_BYTE_BUFFER) >> 8; 
+				i2c_dev->master_msgs->len += (ast_i2c_read(i2c_dev,I2C_BYTE_BUF_REG) & AST_I2CD_RX_BYTE_BUFFER) >> 8;
 				i2c_dev->blk_r_flag = 1;
-				dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN %d \n", i2c_dev->master_msgs->len -1);			
+				dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN %d \n", i2c_dev->master_msgs->len -1);
 			}
 			xfer_len = 1;
 			i2c_dev->master_msgs->buf[i2c_dev->master_xfer_cnt] = (ast_i2c_read(i2c_dev,I2C_BYTE_BUF_REG) & AST_I2CD_RX_BYTE_BUFFER) >> 8;
 		} else if (i2c_dev->master_xfer_mode == BUFF_XFER) {
 			pool_buf = (u8 *)i2c_dev->req_page->page_addr;
 			xfer_len = AST_I2CD_RX_BUF_ADDR_GET(ast_i2c_read(i2c_dev, I2C_BUF_CTRL_REG));
-			
+
 			if(xfer_len == 0)
 				xfer_len = AST_I2C_PAGE_SIZE;
 
@@ -1098,7 +1130,7 @@ static void ast_i2c_master_xfer_done(struct ast_i2c_dev *i2c_dev)
 			if ((i2c_dev->master_msgs->flags & I2C_M_RECV_LEN) && (i2c_dev->blk_r_flag == 0)) {
 				i2c_dev->master_msgs->len += pool_buf[0];
 				i2c_dev->blk_r_flag = 1;
-				dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN %d \n", i2c_dev->master_msgs->len -1);			
+				dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN %d \n", i2c_dev->master_msgs->len -1);
 			}
 		} else {
 			//DMA Mode
@@ -1114,13 +1146,13 @@ static void ast_i2c_master_xfer_done(struct ast_i2c_dev *i2c_dev)
 				dev_dbg(i2c_dev->dev, "buf[%x] \n", i2c_dev->dma_buf[i]);
 				dev_dbg(i2c_dev->dev, "buf[%x] \n", i2c_dev->dma_buf[i+1]);
 			}
-	
+
 			if ((i2c_dev->master_msgs->flags & I2C_M_RECV_LEN) && (i2c_dev->blk_r_flag == 0)) {
 					i2c_dev->master_msgs->len += i2c_dev->dma_buf[0];
 					i2c_dev->blk_r_flag = 1;
-					dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN %d \n", i2c_dev->master_msgs->len -1);			
+					dev_dbg(i2c_dev->dev, "I2C_M_RECV_LEN %d \n", i2c_dev->master_msgs->len -1);
 			}
-			
+
 		}
 
 	}else {
@@ -1153,28 +1185,28 @@ next_xfer:
 		i2c_dev->cmd_err = 1;
 		goto done_out;
 	} else
-		i2c_dev->master_xfer_cnt += i2c_dev->master_xfer_len; 
+		i2c_dev->master_xfer_cnt += i2c_dev->master_xfer_len;
 
 	if(i2c_dev->master_xfer_cnt != i2c_dev->master_msgs->len) {
 		dev_dbg(i2c_dev->dev,"do next cnt \n");
 		i2c_dev->do_master_xfer(i2c_dev);
 	} else {
-#if 0	
-		int i;		
+#if 0
+		int i;
 		printk(" ===== \n");
 		for(i=0;i<i2c_dev->master_msgs->len;i++)
 			printk("rx buf i,[%x]\n",i,i2c_dev->master_msgs->buf[i]);
-		printk(" ===== \n");	
-#endif		
+		printk(" ===== \n");
+#endif
 		i2c_dev->cmd_err = 0;
 
 done_out:
 		dev_dbg(i2c_dev->dev,"msgs complete \n");
-		complete(&i2c_dev->cmd_complete);					
+		complete(&i2c_dev->cmd_complete);
 	}
 
 unlock_out:
-	spin_unlock_irqrestore(&g_master_lock, flags);
+	spin_unlock_irqrestore(&i2c_dev->master_lock, flags);
 }
 
 static void ast_i2c_slave_addr_match(struct ast_i2c_dev *i2c_dev)
@@ -1187,7 +1219,7 @@ static void ast_i2c_slave_addr_match(struct ast_i2c_dev *i2c_dev)
 	i2c_dev->slave_msgs->buf[0] = match;
 	dev_dbg(i2c_dev->dev, "S Start Addr match [%x] \n",match);
 
-	
+
 	if(match & 1) {
 		i2c_dev->slave_event = I2C_SLAVE_EVENT_START_READ;
 	} else {
@@ -1201,7 +1233,7 @@ static void ast_i2c_slave_addr_match(struct ast_i2c_dev *i2c_dev)
 #else
 	i2c_dev->ast_i2c_data->slave_xfer(i2c_dev->slave_event, &(i2c_dev->slave_msgs));
 	i2c_dev->slave_xfer_cnt = 0;
-#endif			
+#endif
 
 	//request
 	if(i2c_dev->ast_i2c_data->slave_dma == BYTE_MODE)
@@ -1211,7 +1243,7 @@ static void ast_i2c_slave_addr_match(struct ast_i2c_dev *i2c_dev)
 	else {
 		if(i2c_dev->ast_i2c_data->request_pool_buff_page(&(i2c_dev->req_page)) == 0)
 			i2c_dev->do_slave_xfer = ast_i2c_do_pool_xfer;
-		else								
+		else
 			i2c_dev->do_slave_xfer = ast_i2c_do_byte_xfer;
 	}
 
@@ -1221,7 +1253,7 @@ static void ast_i2c_slave_addr_match(struct ast_i2c_dev *i2c_dev)
 
 static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 {
-	u32 sts;	
+	u32 sts;
 
 	struct ast_i2c_dev *i2c_dev = dev_id;
 	u32 isr_sts = readl(i2c_dev->ast_i2c_data->reg_gr);
@@ -1231,7 +1263,7 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 
 	i2c_dev->state = (ast_i2c_read(i2c_dev,I2C_CMD_REG) >> 19) & 0xf;
 	sts = ast_i2c_read(i2c_dev,I2C_INTR_STS_REG);
-//	printk("ISR : %x , sts [%x]\n",sts , xfer_sts);	
+//	printk("ISR : %x , sts [%x]\n",sts , xfer_sts);
 //	dev_dbg(i2c_dev->dev,"ISR : %x , sts [%x]\n",sts , xfer_sts);
 
 //	dev_dbg(i2c_dev->dev,"sts machine %x, slave_op %d \n", xfer_sts,i2c_dev->slave_operation);
@@ -1244,9 +1276,9 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 					I2C_INTR_CTRL_REG);
 		ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_SMBUS_ALT, I2C_INTR_STS_REG);
 		ast_master_alert_recv(i2c_dev);
-		sts &= ~AST_I2CD_SMBUS_ALT_INTR_EN; 
+		sts &= ~AST_I2CD_SMBUS_ALT_INTR_EN;
 	}
-	
+
 	if(AST_I2CD_INTR_STS_ABNORMAL & sts) {
 		i2c_dev->cmd_err |= AST_I2CD_INTR_STS_ABNORMAL;
 		// Turn off interrupts for further abnormal
@@ -1257,6 +1289,8 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 			I2C_INTR_CTRL_REG);
 		complete(&i2c_dev->cmd_complete);
 		sts &= ~AST_I2CD_INTR_STS_ABNORMAL;
+    // Need to clear the interrupt
+    ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_ABNORMAL, I2C_INTR_STS_REG);
 	}
 
 	switch(sts) {
@@ -1265,7 +1299,7 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 				i2c_dev->slave_event = I2C_SLAVE_EVENT_READ;
 				ast_i2c_slave_xfer_done(i2c_dev);
 				dev_dbg(i2c_dev->dev, "S clear isr: AST_I2CD_INTR_STS_TX_ACK = %x\n",sts);
-				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_ACK, I2C_INTR_STS_REG);		   
+				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_ACK, I2C_INTR_STS_REG);
 			} else {
 				dev_dbg(i2c_dev->dev, "M clear isr: AST_I2CD_INTR_STS_TX_ACK = %x\n",sts);
 				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_ACK, I2C_INTR_STS_REG);
@@ -1280,9 +1314,17 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 					ast_i2c_write(i2c_dev, ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
 										AST_I2CD_TX_ACK_INTR_EN, I2C_INTR_CTRL_REG);
 					ast_i2c_master_xfer_done(i2c_dev);
-					
+
 				} else {
-					printk("TODO ...\n");
+					printk("ast_i2c:  TX_ACK | NORMAL_STOP;  xfer_last %d\n", i2c_dev->xfer_last);
+					ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_ACK | AST_I2CD_INTR_STS_NORMAL_STOP, I2C_INTR_STS_REG);
+					uint32_t new_val = ast_i2c_read(i2c_dev,I2C_INTR_CTRL_REG) |
+						        	AST_I2CD_NORMAL_STOP_INTR_EN | 
+								AST_I2CD_TX_ACK_INTR_EN;
+					ast_i2c_write(i2c_dev, new_val, I2C_INTR_CTRL_REG);
+					//take care
+					i2c_dev->cmd_err |= AST_LOCKUP_DETECTED;
+					complete(&i2c_dev->cmd_complete);
 				}
 			break;
 
@@ -1291,8 +1333,8 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 				i2c_dev->slave_event = I2C_SLAVE_EVENT_NACK;
 				ast_i2c_slave_xfer_done(i2c_dev);
 				dev_dbg(i2c_dev->dev, "S clear isr: AST_I2CD_INTR_STS_TX_NAK = %x\n",sts);
-				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_NAK, I2C_INTR_STS_REG); 
-				
+				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_NAK, I2C_INTR_STS_REG);
+
 			} else {
 				dev_dbg(i2c_dev->dev, "M clear isr: AST_I2CD_INTR_STS_TX_NAK = %x\n",sts);
 				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_NAK, I2C_INTR_STS_REG);
@@ -1310,7 +1352,7 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 		case AST_I2CD_INTR_STS_TX_NAK | AST_I2CD_INTR_STS_NORMAL_STOP:
 			if(i2c_dev->slave_operation == 1) {
 				printk("SLAVE TODO .... \n");
-				
+
 			} else {
 				dev_dbg(i2c_dev->dev, "M clear isr: AST_I2CD_INTR_STS_TX_NAK| AST_I2CD_INTR_STS_NORMAL_STOP = %x\n",sts);
 				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_NAK | AST_I2CD_INTR_STS_NORMAL_STOP, I2C_INTR_STS_REG);
@@ -1320,47 +1362,47 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 			}
 			break;
 
-		//Issue : Workaround for I2C slave mode 
+		//Issue : Workaround for I2C slave mode
 		case AST_I2CD_INTR_STS_TX_NAK | AST_I2CD_INTR_STS_SLAVE_MATCH:
 			if(i2c_dev->slave_operation == 1) {
 				i2c_dev->slave_event = I2C_SLAVE_EVENT_NACK;
 				ast_i2c_slave_xfer_done(i2c_dev);
 				ast_i2c_slave_addr_match(i2c_dev);
-				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_NAK | AST_I2CD_INTR_STS_SLAVE_MATCH , I2C_INTR_STS_REG); 
+				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_TX_NAK | AST_I2CD_INTR_STS_SLAVE_MATCH , I2C_INTR_STS_REG);
 			} else {
 				printk("ERROR !!!!\n");
 			}
 			break;
 		case AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_SLAVE_MATCH:
 			ast_i2c_slave_addr_match(i2c_dev);
-			dev_dbg(i2c_dev->dev, "S clear isr: AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_SLAVE_MATCH = %x\n",sts);	
+			dev_dbg(i2c_dev->dev, "S clear isr: AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_SLAVE_MATCH = %x\n",sts);
 			ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_SLAVE_MATCH, I2C_INTR_STS_REG);
 			break;
-			
+
 		case AST_I2CD_INTR_STS_RX_DOWN:
 			if(i2c_dev->slave_operation == 1) {
 				i2c_dev->slave_event = I2C_SLAVE_EVENT_WRITE;
 				ast_i2c_slave_xfer_done(i2c_dev);
 				dev_dbg(i2c_dev->dev, "S clear isr: AST_I2CD_INTR_STS_RX_DOWN = %x\n",sts);
-				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_RX_DOWN, I2C_INTR_STS_REG);					
+				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_RX_DOWN, I2C_INTR_STS_REG);
 			} else {
 				dev_dbg(i2c_dev->dev, "M clear isr: AST_I2CD_INTR_STS_RX_DOWN = %x\n",sts);
 				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_RX_DOWN, I2C_INTR_STS_REG);
 				ast_i2c_master_xfer_done(i2c_dev);
-				
+
 			}
 			break;
-			
+
 		case AST_I2CD_INTR_STS_NORMAL_STOP:
 			if(i2c_dev->slave_operation == 1) {
 				i2c_dev->slave_event = I2C_SLAVE_EVENT_STOP;
 				ast_i2c_slave_xfer_done(i2c_dev);
 				dev_dbg(i2c_dev->dev, "S clear isr: AST_I2CD_INTR_STS_NORMAL_STOP = %x\n",sts);
-				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_NORMAL_STOP, I2C_INTR_STS_REG);					
+				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_NORMAL_STOP, I2C_INTR_STS_REG);
 				dev_dbg(i2c_dev->dev, "state [%x] \n",i2c_dev->state);
-			} else {							
+			} else {
 				dev_dbg(i2c_dev->dev, "M clear isr: AST_I2CD_INTR_STS_NORMAL_STOP = %x\n",sts);
-				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_NORMAL_STOP, I2C_INTR_STS_REG);			
+				ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_NORMAL_STOP, I2C_INTR_STS_REG);
 				i2c_dev->cmd_err |= AST_I2CD_INTR_STS_NORMAL_STOP;
 				complete(&i2c_dev->cmd_complete);
 			}
@@ -1380,24 +1422,24 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 			dev_dbg(i2c_dev->dev, "M clear isr: AST_I2CD_INTR_STS_ARBIT_LOSS = %x\n",sts);
 			ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_ARBIT_LOSS, I2C_INTR_STS_REG);
 			i2c_dev->cmd_err |= AST_I2CD_INTR_STS_ARBIT_LOSS;
-			complete(&i2c_dev->cmd_complete);					
+			complete(&i2c_dev->cmd_complete);
 			break;
 		case AST_I2CD_INTR_STS_SCL_TO:
 			i2c_dev->cmd_err |= AST_I2CD_INTR_STS_SCL_TO;
-			complete(&i2c_dev->cmd_complete);					
-			
+			complete(&i2c_dev->cmd_complete);
+
 			break;
  		case AST_I2CD_INTR_STS_GCALL_ADDR:
 			i2c_dev->cmd_err |= AST_I2CD_INTR_STS_GCALL_ADDR;
-			complete(&i2c_dev->cmd_complete);					
+			complete(&i2c_dev->cmd_complete);
 
 			break;
 		case AST_I2CD_INTR_STS_SMBUS_DEF_ADDR:
 			break;
 		case AST_I2CD_INTR_STS_SMBUS_DEV_ALT:
-			
+
 			break;
-			
+
 		case AST_I2CD_INTR_STS_SMBUS_ARP_ADDR:
 			break;
 		case AST_I2CD_INTR_STS_SDA_DL_TO:
@@ -1405,25 +1447,50 @@ static irqreturn_t i2c_ast_handler(int this_irq, void *dev_id)
 		case AST_I2CD_INTR_STS_BUS_RECOVER:
 			dev_dbg(i2c_dev->dev, "M clear isr: AST_I2CD_INTR_STS_BUS_RECOVER= %x\n",sts);
 			ast_i2c_write(i2c_dev, AST_I2CD_INTR_STS_BUS_RECOVER, I2C_INTR_STS_REG);
-			complete(&i2c_dev->cmd_complete);				
+			complete(&i2c_dev->cmd_complete);
 			break;
 		default:
-			if(sts)
-				printk("GR %x : No one care : %x, bus_id %d\n",i2c_dev->ast_i2c_data->reg_gr, sts, i2c_dev->bus_id);
-			return IRQ_NONE;
+      //TODO: Clearing this interrupt for now, but needs to cleanup this ISR function
+			ast_i2c_write(i2c_dev, sts, I2C_INTR_STS_REG);
+
+      // Handle Arbitration Loss
+      if (sts & AST_I2CD_INTR_STS_ARBIT_LOSS) {
+        i2c_dev->cmd_err |= AST_I2CD_INTR_STS_ARBIT_LOSS;
+        complete(&i2c_dev->cmd_complete);
+        sts &= (~AST_I2CD_INTR_STS_ARBIT_LOSS);
+      }
+
+      // Handle the write transaction ACK
+      if (sts & AST_I2CD_INTR_STS_TX_ACK) {
+        ast_i2c_master_xfer_done(i2c_dev);
+        complete(&i2c_dev->cmd_complete);
+        sts &= (~AST_I2CD_INTR_STS_TX_ACK);
+      }
+
+      // Handle the Slave address match
+      if (sts & AST_I2CD_INTR_STS_SLAVE_MATCH) {
+        ast_i2c_slave_addr_match(i2c_dev);
+        sts &= (~AST_I2CD_INTR_STS_SLAVE_MATCH);
+      }
+
+      // TODO: Debug print for any unhandled condition
+			if(sts) {
+				printk("GR %x : Status : %x, bus_id %d\n",i2c_dev->ast_i2c_data->reg_gr, sts, i2c_dev->bus_id);
+      }
+
+			return IRQ_HANDLED;
 	}
 
 	return IRQ_HANDLED;
-
 }
 
 static int ast_i2c_do_msgs_xfer(struct ast_i2c_dev *i2c_dev, struct i2c_msg *msgs, int num)
 {
 	int i;
-	int ret = 1;	
+	int ret = 1;
 	unsigned long flags;
 
-	spin_lock_irqsave(&g_master_lock, flags);
+	spin_lock_irqsave(&i2c_dev->master_lock, flags);
 
 	//request
 	if(i2c_dev->ast_i2c_data->master_dma == BYTE_MODE)
@@ -1433,7 +1500,7 @@ static int ast_i2c_do_msgs_xfer(struct ast_i2c_dev *i2c_dev, struct i2c_msg *msg
 	else {
 		if(i2c_dev->ast_i2c_data->request_pool_buff_page(&(i2c_dev->req_page)) == 0)
 			i2c_dev->do_master_xfer = ast_i2c_do_pool_xfer;
-		else								
+		else
 			i2c_dev->do_master_xfer = ast_i2c_do_byte_xfer;
 	}
 
@@ -1458,12 +1525,12 @@ static int ast_i2c_do_msgs_xfer(struct ast_i2c_dev *i2c_dev, struct i2c_msg *msg
 
 		i2c_dev->do_master_xfer(i2c_dev);
 
-		spin_unlock_irqrestore(&g_master_lock, flags);
+		spin_unlock_irqrestore(&i2c_dev->master_lock, flags);
 
 		ret = wait_for_completion_interruptible_timeout(&i2c_dev->cmd_complete,
 													   i2c_dev->adap.timeout*HZ);
-	
-		spin_lock_irqsave(&g_master_lock, flags);
+
+		spin_lock_irqsave(&i2c_dev->master_lock, flags);
 		i2c_dev->master_msgs = NULL;
 
 		if (ret == 0) {
@@ -1471,25 +1538,30 @@ static int ast_i2c_do_msgs_xfer(struct ast_i2c_dev *i2c_dev, struct i2c_msg *msg
 			i2c_dev->state = (ast_i2c_read(i2c_dev,I2C_CMD_REG) >> 19) & 0xf;
 //			printk("sts [%x], isr sts [%x] \n",i2c_dev->state, ast_i2c_read(i2c_dev,I2C_INTR_STS_REG));
 			ret = -ETIMEDOUT;
-			spin_unlock_irqrestore(&g_master_lock, flags);
+			spin_unlock_irqrestore(&i2c_dev->master_lock, flags);
 			goto stop;
 		}
-		
+
 		if(i2c_dev->cmd_err != 0 &&
 		   i2c_dev->cmd_err != AST_I2CD_INTR_STS_NORMAL_STOP) {
+			if (i2c_dev->cmd_err & AST_LOCKUP_DETECTED) {
+				printk("ast-i2c:  error got unexpected STOP\n");
+				// reset the bus
+				ast_i2c_bus_error_recover(i2c_dev);
+			}
 			ret = -EAGAIN;
-			spin_unlock_irqrestore(&g_master_lock, flags);
+			spin_unlock_irqrestore(&i2c_dev->master_lock, flags);
 			goto stop;
 		}
 	}
 
-	spin_unlock_irqrestore(&g_master_lock, flags);
+	spin_unlock_irqrestore(&i2c_dev->master_lock, flags);
 
 	if(i2c_dev->cmd_err == 0 ||
 	   i2c_dev->cmd_err == AST_I2CD_INTR_STS_NORMAL_STOP) {
 		ret = num;
 		goto out;
-		
+
 	}
 stop:
 	init_completion(&i2c_dev->cmd_complete);
@@ -1503,8 +1575,8 @@ out:
 	//Free ..
 	if(i2c_dev->master_xfer_mode == BUFF_XFER) {
 		i2c_dev->ast_i2c_data->free_pool_buff_page(i2c_dev->req_page);
-		
-	} 
+
+	}
 	dev_dbg(i2c_dev->dev, "end xfer ret = %d, xfer mode[%d]\n",ret, i2c_dev->master_xfer_mode);
 	return ret;
 
@@ -1521,7 +1593,7 @@ static int ast_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 	/*
 	 * Wait for the bus to become free.
 	 */
-	
+
 	ret = ast_i2c_wait_bus_not_busy(i2c_dev);
 	if (ret) {
 		dev_err(&i2c_dev->adap.dev, "i2c_ast: timeout waiting for bus free\n");
@@ -1536,7 +1608,7 @@ static int ast_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 		dev_dbg(&adap->dev, "Retrying transmission [%d]\n",i);
 		udelay(100);
 	}
-		
+
 	ret = -EREMOTEIO;
 out:
 
@@ -1550,9 +1622,9 @@ static u32 ast_i2c_functionality(struct i2c_adapter *adap)
 
 static const struct i2c_algorithm i2c_ast_algorithm = {
 	.master_xfer	= ast_i2c_xfer,
-#ifdef CONFIG_AST_I2C_SLAVE_RDWR		
+#ifdef CONFIG_AST_I2C_SLAVE_RDWR
 	.slave_xfer		= ast_i2c_slave_xfer,
-#endif	
+#endif
 	.functionality	= ast_i2c_functionality,
 };
 
@@ -1572,23 +1644,23 @@ static int ast_i2c_probe(struct platform_device *pdev)
 
 	i2c_dev->ast_i2c_data = pdev->dev.platform_data;
 	if(i2c_dev->ast_i2c_data->master_dma == BUFF_MODE) {
-		dev_dbg(&pdev->dev, "use buffer pool mode 256\n");	
-		
+		dev_dbg(&pdev->dev, "use buffer pool mode 256\n");
+
 	} else if ((i2c_dev->ast_i2c_data->master_dma == DMA_MODE) || (i2c_dev->ast_i2c_data->slave_dma == DMA_MODE)) {
-		dev_dbg(&pdev->dev, "use dma mode \n");	
+		dev_dbg(&pdev->dev, "use dma mode \n");
 		if (!i2c_dev->dma_buf) {
 			i2c_dev->dma_buf = dma_alloc_coherent(NULL, AST_I2C_DMA_SIZE, &i2c_dev->dma_addr, GFP_KERNEL);
 			if (!i2c_dev->dma_buf) {
 				printk("unable to allocate tx Buffer memory\n");
 				ret = -ENOMEM;
-				goto err_no_dma;	
+				goto err_no_dma;
 			}
 			if(i2c_dev->dma_addr%4 !=0) {
 				printk("not 4 byte boundary \n");
 				ret = -ENOMEM;
-				goto err_no_dma;	
-			}				
-//			printk("dma_buf = [0x%x] dma_addr = [0x%x], please check 4byte boundary \n",i2c_dev->dma_buf,i2c_dev->dma_addr);	
+				goto err_no_dma;
+			}
+//			printk("dma_buf = [0x%x] dma_addr = [0x%x], please check 4byte boundary \n",i2c_dev->dma_buf,i2c_dev->dma_addr);
 			memset (i2c_dev->dma_buf, 0, AST_I2C_DMA_SIZE);
 		}
 
@@ -1596,7 +1668,7 @@ static int ast_i2c_probe(struct platform_device *pdev)
 		//master_mode 0: use byte mode
 		dev_dbg(&pdev->dev, "use default byte mode \n");
 	}
-		
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (NULL == res) {
 		dev_err(&pdev->dev, "cannot get IORESOURCE_MEM\n");
@@ -1628,11 +1700,11 @@ static int ast_i2c_probe(struct platform_device *pdev)
 	if(i2c_dev->irq == IRQ_C0_I2C) {
 		i2c_dev->bus_id = pdev->id - NUM_BUS;
 		dev_dbg(&pdev->dev, "C0 :: pdev->id %d , i2c_dev->bus_id = %d, i2c_dev->irq =%d\n",pdev->id, i2c_dev->bus_id,i2c_dev->irq);
-#if (CONFIG_AST1070_NR >= 2)		
+#if (CONFIG_AST1070_NR >= 2)
 	} else if(i2c_dev->irq == IRQ_C1_I2C) {
 		i2c_dev->bus_id = pdev->id - (NUM_BUS + 8);
-		dev_dbg(&pdev->dev, "C1 :: pdev->id %d , i2c_dev->bus_id = %d, i2c_dev->irq =%d\n",pdev->id, i2c_dev->bus_id,i2c_dev->irq);			
-#endif		
+		dev_dbg(&pdev->dev, "C1 :: pdev->id %d , i2c_dev->bus_id = %d, i2c_dev->irq =%d\n",pdev->id, i2c_dev->bus_id,i2c_dev->irq);
+#endif
 	} else {
 		i2c_dev->bus_id = pdev->id;
 		dev_dbg(&pdev->dev, "AST pdev->id %d , i2c_dev->bus_id = %d, i2c_dev->irq =%d\n",pdev->id, i2c_dev->bus_id,i2c_dev->irq);
@@ -1644,13 +1716,13 @@ static int ast_i2c_probe(struct platform_device *pdev)
  	/* Initialize the I2C adapter */
 	i2c_dev->adap.owner   = THIS_MODULE;
 //TODO
-	i2c_dev->adap.retries = 0;	
+	i2c_dev->adap.retries = 0;
 
-//	i2c_dev->adap.retries = 3;	
+//	i2c_dev->adap.retries = 3;
 
-	i2c_dev->adap.timeout = 5; 
+	i2c_dev->adap.timeout = 5;
 
-	i2c_dev->master_xfer_mode = BYTE_XFER;	
+	i2c_dev->master_xfer_mode = BYTE_XFER;
 
 	/*
 	 * If "pdev->id" is negative we consider it as zero.
@@ -1662,7 +1734,7 @@ static int ast_i2c_probe(struct platform_device *pdev)
 		 i2c_dev->adap.nr);
 
 	i2c_dev->slave_operation = 0;
-	i2c_dev->blk_r_flag = 0; 
+	i2c_dev->blk_r_flag = 0;
 	i2c_dev->adap.algo = &i2c_ast_algorithm;
 
 	ast_i2c_dev_init(i2c_dev);
@@ -1674,8 +1746,11 @@ static int ast_i2c_probe(struct platform_device *pdev)
 		goto ereqirq;
 	}
 
+  spin_lock_init(&i2c_dev->master_lock);
+
 #ifdef CONFIG_AST_I2C_SLAVE_RDWR
 	ast_i2c_slave_buff_init(i2c_dev);
+  spin_lock_init(&i2c_dev->slave_rx_lock);
 #endif
 
 	i2c_dev->adap.algo_data = i2c_dev;
@@ -1718,7 +1793,7 @@ static int ast_i2c_remove(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, NULL);
 	i2c_del_adapter(&i2c_dev->adap);
-	
+
 	free_irq(i2c_dev->irq, i2c_dev);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1742,7 +1817,7 @@ static int ast_i2c_resume(struct platform_device *pdev)
 {
 	//TODO
 //	struct ast_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
-	//Should reset i2c ??? 
+	//Should reset i2c ???
 	return 0;
 }
 #else
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index c8e3cf6..06d9042 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1064,7 +1064,7 @@ int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num)
 EXPORT_SYMBOL(i2c_transfer);
 
 #ifdef CONFIG_AST_I2C_SLAVE_RDWR
-int i2c_slave_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs)
+int i2c_slave_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 {
 	unsigned long orig_jiffies;
 	int ret, try;
@@ -1075,9 +1075,18 @@ int i2c_slave_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs)
 			"len=%d\n", (msgs->flags & I2C_S_RD)
 			? 'R' : 'W', msgs->addr, msgs->len);
 #endif
-		i2c_lock_adapter(adap);
+    if (in_atomic() || irqs_disabled()) {
+      ret = mutex_trylock(&adap->bus_lock);
+      if (!ret)
+        /* I2C activity is ongoing. */
+        return -EAGAIN;
+    } else {
+      mutex_lock_nested(&adap->bus_lock, adap->level);
+    }
+
 		ret = adap->algo->slave_xfer(adap, msgs);
-		i2c_unlock_adapter(adap);
+
+    mutex_unlock(&adap->bus_lock);
 
 		return ret;
 	} else {
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 07f393d..82f2c7c 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -38,7 +38,7 @@
 #include <asm/uaccess.h>
 
 #ifdef CONFIG_AST_I2C_SLAVE_RDWR
-#include <asm/arch/ast_i2c.h>
+#include <plat/ast_i2c.h>
 #endif
 
 static struct i2c_driver i2cdev_driver;
@@ -310,6 +310,113 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client,
 	return res;
 }
 
+static noinline int i2cdev_ioctl_slave_rdrw(struct i2c_client *client,
+    unsigned long arg)
+{
+  struct i2c_rdwr_ioctl_data rdwr_arg;
+  struct i2c_msg *rdwr_pa;
+  u8 __user **data_ptrs;
+  int i, res;
+
+  if (copy_from_user(&rdwr_arg,
+         (struct i2c_rdwr_ioctl_data __user *)arg,
+         sizeof(rdwr_arg)))
+    return -EFAULT;
+
+  /* Put an arbitrary limit on the number of messages that can
+   * be sent at once */
+  if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
+    return -EINVAL;
+
+  rdwr_pa = (struct i2c_msg *)
+    kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg),
+    GFP_KERNEL);
+  if (!rdwr_pa)
+    return -ENOMEM;
+
+  if (copy_from_user(rdwr_pa, rdwr_arg.msgs,
+         rdwr_arg.nmsgs * sizeof(struct i2c_msg))) {
+    kfree(rdwr_pa);
+    return -EFAULT;
+  }
+
+  data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL);
+  if (data_ptrs == NULL) {
+    kfree(rdwr_pa);
+    return -ENOMEM;
+  }
+
+  res = 0;
+  for (i = 0; i < rdwr_arg.nmsgs; i++) {
+    /* Limit the size of the message to a sane amount;
+     * and don't let length change either. */
+    if (rdwr_pa[i].len > 8192) {
+      res = -EINVAL;
+      break;
+    }
+    data_ptrs[i] = (u8 __user *)rdwr_pa[i].buf;
+    rdwr_pa[i].buf = kmalloc(rdwr_pa[i].len, GFP_KERNEL);
+    if (rdwr_pa[i].buf == NULL) {
+      res = -ENOMEM;
+      break;
+    }
+    if (copy_from_user(rdwr_pa[i].buf, data_ptrs[i],
+           rdwr_pa[i].len)) {
+        ++i; /* Needs to be kfreed too */
+        res = -EFAULT;
+      break;
+    }
+
+    /* From Linux 3.5: */
+    /*
+     * If the message length is received from the slave (similar
+     * to SMBus block read), we must ensure that the buffer will
+     * be large enough to cope with a message length of
+     * I2C_SMBUS_BLOCK_MAX as this is the maximum underlying bus
+     * drivers allow. The first byte in the buffer must be
+     * pre-filled with the number of extra bytes, which must be
+     * at least one to hold the message length, but can be
+     * greater (for example to account for a checksum byte at
+     * the end of the message.)
+     */
+         if (rdwr_pa[i].flags & I2C_M_RECV_LEN) {
+           if (!(rdwr_pa[i].flags & I2C_M_RD) ||
+         rdwr_pa[i].buf[0] < 1 ||
+         rdwr_pa[i].len < rdwr_pa[i].buf[0] +
+              I2C_SMBUS_BLOCK_MAX) {
+             res = -EINVAL;
+             break;
+           }
+
+           rdwr_pa[i].len = rdwr_pa[i].buf[0];
+         }
+
+  }
+  if (res < 0) {
+    int j;
+    for (j = 0; j < i; ++j)
+      kfree(rdwr_pa[j].buf);
+    kfree(data_ptrs);
+    kfree(rdwr_pa);
+    return res;
+  }
+
+  res = i2c_slave_transfer(client->adapter, rdwr_pa, rdwr_arg.nmsgs);
+  while (i-- > 0) {
+    if (res >= 0 ) {
+      if (copy_to_user(data_ptrs[i], rdwr_pa[i].buf,
+           rdwr_pa[i].len))
+        res = -EFAULT;
+
+      rdwr_arg.msgs[i].len = rdwr_pa[i].len;
+    }
+    kfree(rdwr_pa[i].buf);
+  }
+  kfree(data_ptrs);
+  kfree(rdwr_pa);
+  return res;
+}
+
 static noinline int i2cdev_ioctl_smbus(struct i2c_client *client,
 		unsigned long arg)
 {
@@ -448,8 +555,8 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
 #ifdef CONFIG_AST_I2C_SLAVE_RDWR
 	case I2C_SLAVE_RDWR:
-		return i2cdev_ioctl_slave_rdrw(client->adapter, (struct i2c_msg __user *)arg);
-#endif		
+		return i2cdev_ioctl_slave_rdrw(client, arg);
+#endif
 
 	case I2C_SMBUS:
 		return i2cdev_ioctl_smbus(client, arg);
diff --git a/drivers/net/ftgmac100_26.c b/drivers/net/ftgmac100_26.c
index fdc77fc..3a5d796 100644
--- a/drivers/net/ftgmac100_26.c
+++ b/drivers/net/ftgmac100_26.c
@@ -1,16 +1,16 @@
 /********************************************************************************
 * File Name     : ftgmac100_26.c
-* 
+*
 * Copyright (C) 2012-2020  ASPEED Technology Inc.
-* 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 
+* 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
 ********************************************************************************/
 //-----------------------------------------------------------------------------
 //  "ASPEED MAC Driver, (Linux Kernel 2.6.15.7) 10/02/07 - by ASPEED\n"
@@ -76,7 +76,7 @@
 //AST2300 SDK 0.14
 //19.09/13/2010 - by river@aspeed
 //   Support Realtek RTL8201EL 10/100M PHY
-//AST2400 
+//AST2400
 //20.06/25/2013 - by CC@aspeed
 //   Support BCM54612E 10/100/1000M PHY
 //-----------------------------------------------------------------------------
@@ -120,7 +120,12 @@
 #err "Not define include for GMAC"
 #endif
 
+#ifdef CONFIG_WEDGE100
+#define PHY_DEFAULT_ADDR 0x18
+#else
+/* wedge */
 #define PHY_DEFAULT_ADDR 0x1F
+#endif
 
 /*------------------------------------------------------------------------
  .
@@ -172,7 +177,6 @@ static int ftgmac100_wait_to_send_packet(struct sk_buff * skb, struct net_device
 
 static volatile int trans_busy = 0;
 
-
 void ftgmac100_phy_rw_waiting(unsigned int ioaddr)
 {
 	unsigned int tmp;
@@ -255,6 +259,7 @@ static void getMacHwConfig( struct net_device* dev, struct AstMacHwConfig* out )
 
 //	out->macId   = dev->dev_id;
 //..	getMacAndPhy(dev, out);
+	out->phyAddr = PHY_DEFAULT_ADDR;
 	out->miiPhyId = 0;
 
 	// We assume the Clock Stop register does not disable the MAC1 or MAC2 clock
@@ -272,7 +277,7 @@ no_phy_access:
 			out->phyAddr = 1;
 		}
 #if 0
-		if (out->miiPhyId == 0x0362) { 
+		if (out->miiPhyId == 0x0362) {
 			out->phyAddr = 1;
 		}
 #endif
@@ -297,6 +302,902 @@ no_phy_access:
 	return;
 }
 
+// --------------------------------------------------------------------
+//  NCSI function
+// --------------------------------------------------------------------
+void NCSI_Struct_Initialize(struct net_device *dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long i;
+
+  for (i = 0; i < 6; i++) {
+    lp->NCSI_Request.DA[i] = 0xFF;
+    lp->NCSI_Respond.DA[i] = 0xFF;
+    lp->NCSI_Respond.SA[i] = 0xFF;
+    lp->NCSI_Request.SA[i] = dev->dev_addr[i];
+  }
+  lp->NCSI_Request.EtherType = 0xF888;
+  lp->NCSI_Request.MC_ID = 0;
+  lp->NCSI_Request.Header_Revision = 0x01;
+  lp->NCSI_Request.Reserved_1 = 0;
+  lp->NCSI_Request.Reserved_2 = 0;
+  lp->NCSI_Request.Reserved_3 = 0;
+  lp->NCSI_Respond.EtherType = 0xF888;
+  lp->NCSI_Respond.MC_ID = 0;
+  lp->NCSI_Respond.Header_Revision = 0x01;
+  lp->NCSI_Respond.Reserved_1 = 0;
+  lp->NCSI_Respond.Reserved_2 = 0;
+  lp->NCSI_Respond.Reserved_3 = 0;
+
+  lp->InstanceID = 0;
+  lp->Payload_Checksum = 0;
+  for (i = 0; i < 4; i++) {
+    lp->Payload_Pad[i] = 0;
+  }
+  for (i = 0; i < 64; i++) {
+    lp->Payload_Data[i] = 0;
+  }
+}
+
+void Calculate_Checksum(struct net_device * dev, unsigned char *buffer_base, int Length)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned int i, CheckSum = 0;
+  unsigned int Data, Data1;
+
+  for (i = 0; i < ((Length - 14) / 2); i++) {
+    Data = buffer_base[i * 2];
+    Data1 = buffer_base[i * 2 + 1];
+    CheckSum += ((Data << 8) + Data1);
+  }
+  lp->Payload_Checksum = (~(CheckSum) + 1); //2's complement
+//Inverse for insert into buffer
+  Data = (lp->Payload_Checksum & 0xFF000000) >> 24;
+  Data1 = (lp->Payload_Checksum & 0x000000FF) << 24;
+  lp->Payload_Checksum = (lp->Payload_Checksum & 0x00FFFF00) + Data + Data1;
+  Data = (lp->Payload_Checksum & 0x00FF0000) >> 8;
+  Data1 = (lp->Payload_Checksum & 0x0000FF00) << 8;
+  lp->Payload_Checksum = (lp->Payload_Checksum & 0xFF0000FF) + Data + Data1;
+}
+
+void copy_data (struct net_device * dev, struct sk_buff * skb, int Length)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+
+  memcpy ((unsigned char *)(skb->data + 30), &lp->Payload_Data, Length);
+  Calculate_Checksum(dev, skb->data + 14, 30 + Length);
+  memcpy ((unsigned char *)(skb->data + 30 + Length), &lp->Payload_Checksum, 4);
+}
+
+void NCSI_Rx (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long status, length, i = 0;
+  volatile RX_DESC *cur_desc;
+
+ncsi_rx:
+  i = 0;
+  cur_desc = &lp->rx_descs[lp->rx_idx];
+  do {
+    status = cur_desc->RXPKT_RDY;
+    i++;
+  } while (!(((status & RX_OWNBY_SOFTWARE) != 0) || (i >= NCSI_LOOP)));
+
+  if (i < NCSI_LOOP) {
+    if (cur_desc->LRS) {
+      length = cur_desc->VDBC;
+      unsigned char *tbuf = (unsigned char *)phys_to_virt(cur_desc->RXBUF_BADR);
+      if (length <= 128 && tbuf[12] == 0x88 && tbuf[13] == 0xF8) {
+        memcpy (&lp->NCSI_Respond, (unsigned char *)phys_to_virt(cur_desc->RXBUF_BADR), length);
+      } else {
+          printk("NCSI_RX: Skip len: %d, proto: %x:%x\n", length, tbuf[12], tbuf[13]);
+          lp->rx_descs[lp->rx_idx].RXPKT_RDY = RX_OWNBY_FTGMAC100;
+          lp->rx_idx = (lp->rx_idx+1)%RXDES_NUM;
+          goto ncsi_rx;
+      }
+
+    }
+    lp->rx_descs[lp->rx_idx].RXPKT_RDY = RX_OWNBY_FTGMAC100;
+    lp->rx_idx = (lp->rx_idx+1)%RXDES_NUM;
+  } else {
+    printk("NCSI_Rx: Failed\n");
+  }
+}
+
+void DeSelect_Package (struct net_device * dev, int Package_ID)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = DESELECT_PACKAGE;
+  Combined_Channel_ID = (Package_ID << 5) + 0x1F; //Internal Channel ID = 0x1F, 0x1F means all channel
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (DESELECT_PACKAGE | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+int Select_Package (struct net_device * dev, int Package_ID)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID, Found = 0;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = SELECT_PACKAGE;
+  Combined_Channel_ID = (Package_ID << 5) + 0x1F; //Internal Channel ID = 0x1F
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (4 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  lp->NCSI_Request.Payload_Length = 4;
+  memset ((void *)lp->Payload_Data, 0, 4);
+  lp->Payload_Data[3] = 1; //Arbitration Disable
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len = 30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (SELECT_PACKAGE | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    Found = 0;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+    Found = 1;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+
+    return Found;
+}
+
+
+void DeSelect_Active_Package (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = DESELECT_PACKAGE;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + 0x1F; //Internal Channel ID = 0x1F, 0x1F means all channel
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (DESELECT_PACKAGE | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+
+int Select_Active_Package (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID, Found = 0;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = SELECT_PACKAGE;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + 0x1F; //Internal Channel ID = 0x1F
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (4 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  lp->NCSI_Request.Payload_Length = 4;
+  memset ((void *)lp->Payload_Data, 0, 4);
+  lp->Payload_Data[3] = 1; //Arbitration Disable
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len = 30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (SELECT_PACKAGE | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+    Found = 0;
+  }
+  else {
+    lp->Retry = 0;
+    Found = 1;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+
+    return Found;
+}
+
+int Clear_Initial_State (struct net_device * dev, int Channel_ID)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID, Found = 0;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = CLEAR_INITIAL_STATE;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + Channel_ID; //Internal Channel ID = 0
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (CLEAR_INITIAL_STATE | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+    Found = 0;
+  }
+  else {
+    lp->Retry = 0;
+    Found = 1;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+
+    return Found;
+}
+
+void Get_Version_ID (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = GET_VERSION_ID;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (GET_VERSION_ID | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Get_Capabilities (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = GET_CAPABILITIES;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (GET_CAPABILITIES | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+    lp->NCSI_Cap.Capabilities_Flags = lp->NCSI_Respond.Payload_Data[0];
+    lp->NCSI_Cap.Broadcast_Packet_Filter_Capabilities = lp->NCSI_Respond.Payload_Data[1];
+    lp->NCSI_Cap.Multicast_Packet_Filter_Capabilities = lp->NCSI_Respond.Payload_Data[2];
+    lp->NCSI_Cap.Buffering_Capabilities = lp->NCSI_Respond.Payload_Data[3];
+    lp->NCSI_Cap.AEN_Control_Support = lp->NCSI_Respond.Payload_Data[4];
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Enable_AEN (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = AEN_ENABLE;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (8 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  lp->NCSI_Request.Payload_Length = 8;
+  lp->Payload_Data[3] = 0; //MC ID
+  lp->Payload_Data[7] = 1; //Link Status Change AEN
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (AEN_ENABLE | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Get_MAC_Address (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID, i;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = 0x50;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (8 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  lp->NCSI_Request.Payload_Length = 8;
+  lp->Payload_Data[0] = 0x00;
+  lp->Payload_Data[1] = 0x00;
+  lp->Payload_Data[2] = 0x81;
+  lp->Payload_Data[3] = 0x19;
+
+  lp->Payload_Data[4] = 0x00;
+  lp->Payload_Data[5] = 0x00;
+  lp->Payload_Data[6] = 0x1B;
+  lp->Payload_Data[7] = 0x00;
+
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (0x50 | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+
+  // Update MAC Address
+printk("NCSI: MAC  ");
+for (i = 0; i < 6; i++)
+  printk("%02X:", lp->NCSI_Respond.Payload_Data[12+i]);
+printk("\n");
+  memcpy(lp->NCSI_Request.SA, &lp->NCSI_Respond.Payload_Data[12], 6);
+  memcpy(dev->dev_addr, &lp->NCSI_Respond.Payload_Data[12], 6);
+
+	/* Update the MAC address */
+	ast_gmac_set_mac(lp, dev->dev_addr);
+}
+
+void Set_MAC_Affinity (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID, i;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = 0x50;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (60 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+
+  lp->NCSI_Request.Payload_Length = 60;
+  memset(lp->Payload_Data, 0x00, 60);
+  lp->Payload_Data[0] = 0x00;
+  lp->Payload_Data[1] = 0x00;
+  lp->Payload_Data[2] = 0x81;
+  lp->Payload_Data[3] = 0x19;
+
+  lp->Payload_Data[4] = 0x00;
+  lp->Payload_Data[5] = 0x01;
+  lp->Payload_Data[6] = 0x07;
+  lp->Payload_Data[7] = 0x00;
+
+  for (i = 0; i < 6; i++) {
+    lp->Payload_Data[8+i] = lp->NCSI_Request.SA[i];
+  }
+
+  lp->Payload_Data[14] = 0x09;
+
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (0x50 | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Enable_Set_MAC_Address (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID, i;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = SET_MAC_ADDRESS;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (8 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  lp->NCSI_Request.Payload_Length = 8;
+  for (i = 0; i < 6; i++) {
+    lp->Payload_Data[i] = lp->NCSI_Request.SA[i];
+  }
+  lp->Payload_Data[6] = 1; //MAC Address Num = 1 --> address filter 1, fixed in sample code
+  lp->Payload_Data[7] = UNICAST + 0 + ENABLE_MAC_ADDRESS_FILTER; //AT + Reserved + E
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (SET_MAC_ADDRESS | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Enable_Broadcast_Filter (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = ENABLE_BROADCAST_FILTERING;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (4 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  lp->NCSI_Request.Payload_Length = 4;
+  memset ((void *)lp->Payload_Data, 0, 4);
+        lp->Payload_Data[3] = 0x1; //ARP, DHCP, NetBIOS
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (ENABLE_BROADCAST_FILTERING | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Disable_VLAN (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = DISABLE_VLAN;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (DISABLE_VLAN | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Get_Parameters (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = GET_PARAMETERS;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (GET_PARAMETERS | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+//    printk ("Retry: Command = %x, Response_Code = %x, Resonpd.Command = %x, IID = %x, lp->InstanceID = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code, lp->NCSI_Respond.Command, lp->NCSI_Respond.IID, lp->InstanceID);
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+    lp->NCSI_Cap.Capabilities_Flags = lp->NCSI_Respond.Payload_Data[0];
+    lp->NCSI_Cap.Broadcast_Packet_Filter_Capabilities = lp->NCSI_Respond.Payload_Data[1];
+    lp->NCSI_Cap.Multicast_Packet_Filter_Capabilities = lp->NCSI_Respond.Payload_Data[2];
+    lp->NCSI_Cap.Buffering_Capabilities = lp->NCSI_Respond.Payload_Data[3];
+    lp->NCSI_Cap.AEN_Control_Support = lp->NCSI_Respond.Payload_Data[4];
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Enable_Network_TX (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = ENABLE_CHANNEL_NETWORK_TX;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (ENABLE_CHANNEL_NETWORK_TX | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Disable_Network_TX (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = DISABLE_CHANNEL_NETWORK_TX;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + (lp->NCSI_Request.Payload_Length % 4) + 8;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (DISABLE_CHANNEL_NETWORK_TX | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Enable_Channel (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = ENABLE_CHANNEL;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (ENABLE_CHANNEL | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+void Disable_Channel (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = DISABLE_CHANNEL;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (4 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  lp->NCSI_Request.Payload_Length = 4;
+  memset ((void *)lp->Payload_Data, 0, 4);
+        lp->Payload_Data[3] = 0x1; //ALD
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (DISABLE_CHANNEL | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
+
+int Get_Link_Status (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = GET_LINK_STATUS;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = 0;
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (GET_LINK_STATUS | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+    if (lp->NCSI_Respond.Payload_Data[3] & 0x40) {
+      return (lp->NCSI_Respond.Payload_Data[3] & 0x01); //Link Up or Not
+    }
+    else {
+      return 0; //Auto Negotiate did not finish
+    }
+}
+
+void Set_Link (struct net_device * dev)
+{
+  struct ftgmac100_priv *lp = (struct ftgmac100_priv *)dev->priv;
+  unsigned long Combined_Channel_ID;
+  struct sk_buff * skb;
+
+    do {
+  skb = dev_alloc_skb (TX_BUF_SIZE + 16);
+  memset(skb->data, 0, TX_BUF_SIZE + 16);
+//TX
+  lp->InstanceID++;
+  lp->NCSI_Request.IID = lp->InstanceID;
+  lp->NCSI_Request.Command = SET_LINK;
+  Combined_Channel_ID = (lp->NCSI_Cap.Package_ID << 5) + lp->NCSI_Cap.Channel_ID;
+  lp->NCSI_Request.Channel_ID = Combined_Channel_ID;
+  lp->NCSI_Request.Payload_Length = (8 << 8);
+  memcpy ((unsigned char *)skb->data, &lp->NCSI_Request, 30);
+  lp->NCSI_Request.Payload_Length = 8;
+  memset ((void *)lp->Payload_Data, 0, 8);
+  lp->Payload_Data[2] = 0x02; //full duplex
+  lp->Payload_Data[3] = 0x04; //100M, auto-disable
+  copy_data (dev, skb, lp->NCSI_Request.Payload_Length);
+  skb->len =  30 + lp->NCSI_Request.Payload_Length + 4;
+  ftgmac100_wait_to_send_packet (skb, dev);
+//RX
+  NCSI_Rx(dev);
+  if (((lp->NCSI_Respond.IID != lp->InstanceID) || (lp->NCSI_Respond.Command != (SET_LINK | 0x80)) || (lp->NCSI_Respond.Response_Code != COMMAND_COMPLETED)) && (lp->Retry != RETRY_COUNT)) {
+    printk ("Retry: Command = %x, Response_Code = %x\n", lp->NCSI_Request.Command, lp->NCSI_Respond.Response_Code);
+    printk ("IID: %x:%x, Command: %x:%x\n", lp->InstanceID, lp->NCSI_Respond.IID, lp->NCSI_Request.Command, lp->NCSI_Respond.Command);
+    lp->Retry++;
+    lp->InstanceID--;
+  }
+  else {
+    lp->Retry = 0;
+  }
+    } while ((lp->Retry != 0) && (lp->Retry <= RETRY_COUNT));
+    lp->Retry = 0;
+}
 
 static void ftgmac100_reset( struct net_device* dev )
 {
@@ -308,64 +1209,71 @@ static void ftgmac100_reset( struct net_device* dev )
 	PRINTK("%s:ftgmac100_reset, phyAddr=0x%x, miiPhyId=0x%04x_%04x\n",
 	       dev->name, ids->phyAddr, (ids->miiPhyId >> 16), (ids->miiPhyId & 0xffff));
 
-	if (ids->miiPhyId < 1)
-	    return;	// Cannot access MAC registers
-
-	// Check the link speed and duplex.
-	// They are not valid until auto-neg is resolved, which is reg.1 bit[5],
-	// or the link is up, which is reg.1 bit[2].
-
-	if (ids->phyAddr < 0xff)
-	    tmp = ftgmac100_read_phy_register(dev->base_addr, ids->phyAddr, 0x1);
-	else tmp = 0;
-
-	if (0==(tmp & (1u<<5 | 1u<<2)) || ids->phyAddr >= 0xff) {
-	    // No PHY chip, or link has not negotiated.
-	    speed  = PHY_SPEED_100M;
-	    duplex = 1;
-	    netif_carrier_off(dev);
-	}
-	else if (((ids->miiPhyId & PHYID_VENDOR_MODEL_MASK) == PHYID_RTL8201EL)) {
-	    tmp    = ftgmac100_read_phy_register(dev->base_addr, priv->ids.phyAddr, 0x00);
-	    duplex = (tmp & 0x0100) ? 1 : 0;
-	    speed  = (tmp & 0x2000) ? PHY_SPEED_100M : PHY_SPEED_10M;
-	}
-	else if (((ids->miiPhyId & PHYID_VENDOR_MASK) == PHYID_VENDOR_MARVELL) || 
-		 ((ids->miiPhyId & PHYID_VENDOR_MODEL_MASK) == PHYID_RTL8211)) {
-	    // Use reg.17_0.bit[15:13] for {speed[1:0], duplex}.
-	    tmp    = ftgmac100_read_phy_register(dev->base_addr, ids->phyAddr, 0x11);
-	    duplex = (tmp & PHY_DUPLEX_mask)>>13;
-	    speed  = (tmp & PHY_SPEED_mask)>>14;
-	    netif_carrier_on(dev);
-	}
-	else if (priv->ids.miiPhyId == PHYID_BCM54612E
-		 || priv->ids.miiPhyId == PHYID_BCM54616S) { 
-       // Get link status
-        // First Switch shadow register selector
-        ftgmac100_write_phy_register(dev->base_addr, priv->ids.phyAddr, 0x1C, 0x2000);
-        tmp    = ftgmac100_read_phy_register(dev->base_addr, priv->ids.phyAddr, 0x1C);
-        if ( (tmp & 0x0080) == 0x0080 )
-            duplex = 0;
-        else
-            duplex = 1;
-        
-        switch(tmp & 0x0018) {
-            case 0x0000:
-                speed = PHY_SPEED_1G; break;
-            case 0x0008:    
-                speed = PHY_SPEED_100M; break;
-            case 0x0010:    
-                speed = PHY_SPEED_10M; break;
-            default:
-                speed = PHY_SPEED_100M;
-        } 
+  if ((priv->NCSI_support == 1) || (priv->INTEL_NCSI_EVA_support == 1)) {
+    ids->miiPhyId = 0xFFFF;
+    // NCSI mode always is 100M and full duplex
+    duplex = 1;
+    speed  = PHY_SPEED_100M;
+  } else {
+    if (ids->miiPhyId < 1)
+        return;	// Cannot access MAC registers
+
+    // Check the link speed and duplex.
+    // They are not valid until auto-neg is resolved, which is reg.1 bit[5],
+    // or the link is up, which is reg.1 bit[2].
+
+    if (ids->phyAddr < 0xff)
+        tmp = ftgmac100_read_phy_register(dev->base_addr, ids->phyAddr, 0x1);
+    else tmp = 0;
+
+    if (0==(tmp & (1u<<5 | 1u<<2)) || ids->phyAddr >= 0xff) {
+        // No PHY chip, or link has not negotiated.
+        speed  = PHY_SPEED_100M;
+        duplex = 1;
+        netif_carrier_off(dev);
     }
-	else {
-	    // Assume Broadcom BCM5221.  Use reg.18 bits [1:0] for {100Mb/s, fdx}.
-	    tmp    = ftgmac100_read_phy_register(dev->base_addr, ids->phyAddr, 0x18);
-	    duplex = (tmp & 0x0001);
-	    speed  = (tmp & 0x0002) ? PHY_SPEED_100M : PHY_SPEED_10M;
-	}
+    else if (((ids->miiPhyId & PHYID_VENDOR_MODEL_MASK) == PHYID_RTL8201EL)) {
+        tmp    = ftgmac100_read_phy_register(dev->base_addr, priv->ids.phyAddr, 0x00);
+        duplex = (tmp & 0x0100) ? 1 : 0;
+        speed  = (tmp & 0x2000) ? PHY_SPEED_100M : PHY_SPEED_10M;
+    }
+    else if (((ids->miiPhyId & PHYID_VENDOR_MASK) == PHYID_VENDOR_MARVELL) ||
+       ((ids->miiPhyId & PHYID_VENDOR_MODEL_MASK) == PHYID_RTL8211)) {
+        // Use reg.17_0.bit[15:13] for {speed[1:0], duplex}.
+        tmp    = ftgmac100_read_phy_register(dev->base_addr, ids->phyAddr, 0x11);
+        duplex = (tmp & PHY_DUPLEX_mask)>>13;
+        speed  = (tmp & PHY_SPEED_mask)>>14;
+        netif_carrier_on(dev);
+    }
+    else if (priv->ids.miiPhyId == PHYID_BCM54612E
+       || priv->ids.miiPhyId == PHYID_BCM54616S) {
+         // Get link status
+          // First Switch shadow register selector
+          ftgmac100_write_phy_register(dev->base_addr, priv->ids.phyAddr, 0x1C, 0x2000);
+          tmp    = ftgmac100_read_phy_register(dev->base_addr, priv->ids.phyAddr, 0x1C);
+          if ( (tmp & 0x0080) == 0x0080 )
+              duplex = 0;
+          else
+              duplex = 1;
+
+          switch(tmp & 0x0018) {
+              case 0x0000:
+                  speed = PHY_SPEED_1G; break;
+              case 0x0008:
+                  speed = PHY_SPEED_100M; break;
+              case 0x0010:
+                  speed = PHY_SPEED_10M; break;
+              default:
+                  speed = PHY_SPEED_100M;
+          }
+      }
+    else {
+        // Assume Broadcom BCM5221.  Use reg.18 bits [1:0] for {100Mb/s, fdx}.
+        tmp    = ftgmac100_read_phy_register(dev->base_addr, ids->phyAddr, 0x18);
+        duplex = (tmp & 0x0001);
+        speed  = (tmp & 0x0002) ? PHY_SPEED_100M : PHY_SPEED_10M;
+    }
+  }// NCSI_Check
 
 	if (speed == PHY_SPEED_1G) {
 	    // Set SPEED_100_bit too, for consistency.
@@ -385,9 +1293,9 @@ static void ftgmac100_reset( struct net_device* dev )
 	}
 	if (duplex)
 	    priv->maccr_val |= FULLDUP_bit;
-    else 
+    else
 		priv->maccr_val &= ~FULLDUP_bit;
-		
+
 	outl( SW_RST_bit, dev->base_addr + MACCR_REG );
 
 #ifdef not_complete_yet
@@ -419,6 +1327,7 @@ static void ftgmac100_enable( struct net_device *dev )
 	unsigned int rfifo_rsize;	//Richard
 	unsigned int tfifo_rsize;	//Richard
 	unsigned int rxbuf_size;
+  unsigned long Package_Found = 0, Channel_Found = 0, Re_Send = 0, Link_Status;
 
 	rxbuf_size = RX_BUF_SIZE & 0x3fff;
 	outl( rxbuf_size , dev->base_addr + RBSR_REG); //for NC Body
@@ -475,7 +1384,7 @@ static void ftgmac100_enable( struct net_device *dev )
 
 	/// enable trans/recv,...
 	outl(priv->maccr_val, dev->base_addr + MACCR_REG );
-#if 0	
+
 //NCSI Start
 //DeSelect Package/ Select Package
 	if ((priv->NCSI_support == 1) || (priv->INTEL_NCSI_EVA_support == 1)) {
@@ -491,16 +1400,18 @@ static void ftgmac100_enable( struct net_device *dev )
 		}
 		if (Package_Found != 0) {
 //Initiali State
-			for (i = 0; i < 2; i++) { //Suppose 2 channels in current version, You could modify it to 0x1F to support 31 channels
-				Channel_Found = Clear_Initial_State(dev, i);
+			for (i = 0; i < 1; i++) { //Suppose 2 channels in current version, You could modify it to 0x1F to support 31 channels
+				//Channel_Found = Clear_Initial_State(dev, i);
+        Channel_Found = 1;
 				if (Channel_Found == 1) {
 					priv->NCSI_Cap.Channel_ID = i;
 					printk ("Found NCSI Network Controller at (%d, %d)\n", priv->NCSI_Cap.Package_ID, priv->NCSI_Cap.Channel_ID);
+          Get_MAC_Address(dev);
+          Set_MAC_Affinity(dev);
+				  Clear_Initial_State(dev, i);
 //Get Version and Capabilities
 					Get_Version_ID(dev);
 					Get_Capabilities(dev);
-//Configuration
-					Select_Active_Package(dev);
 //Set MAC Address
 					Enable_Set_MAC_Address(dev);
 //Enable Broadcast Filter
@@ -508,16 +1419,18 @@ static void ftgmac100_enable( struct net_device *dev )
 //Disable VLAN
 					Disable_VLAN(dev);
 //Enable AEN
-					Enable_AEN(dev);
+					//Enable_AEN(dev);
 //Get Parameters
 					Get_Parameters(dev);
-//Enable TX	
+//Enable TX
 					Enable_Network_TX(dev);
 //Enable Channel
 					Enable_Channel(dev);
 //Get Link Status
 Re_Get_Link_Status:
-					Link_Status = Get_Link_Status(dev);
+          //TODO: Workaround for CX4 Link status issue
+					//Link_Status = Get_Link_Status(dev);
+          Link_Status = LINK_UP;
 					if (Link_Status == LINK_UP) {
 						printk ("Using NCSI Network Controller (%d, %d)\n", priv->NCSI_Cap.Package_ID, priv->NCSI_Cap.Channel_ID);
 						netif_carrier_on(dev);
@@ -528,7 +1441,7 @@ Re_Get_Link_Status:
 						netif_carrier_off(dev);
 						goto Re_Get_Link_Status;
 					}
-//Disable TX	
+//Disable TX
 					Disable_Network_TX(dev);
 //Disable Channel
 //					Disable_Channel(dev);
@@ -537,9 +1450,19 @@ Re_Get_Link_Status:
 				}
 			}
 		}
+    // Enable Interrupts
+		outl(
+			AHB_ERR_bit			|
+			TPKT_LOST_bit			|
+			TPKT2E_bit			|
+			RXBUF_UNAVA_bit		|
+			RPKT2B_bit
+        	,dev->base_addr + IER_REG
+       	 	);
+
+    return;
 	}
 	/* now, enable interrupts */
-#endif
 	if (((priv->ids.miiPhyId & PHYID_VENDOR_MASK) == PHYID_VENDOR_MARVELL) ||
 	    ((priv->ids.miiPhyId & PHYID_VENDOR_MODEL_MASK) == PHYID_RTL8211)) {
 		outl(
@@ -564,7 +1487,7 @@ Re_Get_Link_Status:
        	 	);
 	}
 	else if (priv->ids.miiPhyId == PHYID_BCM54612E
-		 || priv->ids.miiPhyId == PHYID_BCM54616S) { 
+		 || priv->ids.miiPhyId == PHYID_BCM54616S) {
         outl(
 // no link PHY link status pin            PHYSTS_CHG_bit      |
             AHB_ERR_bit         |
@@ -583,7 +1506,7 @@ Re_Get_Link_Status:
 			RXBUF_UNAVA_bit 	|
 			RPKT2B_bit
 			,dev->base_addr + IER_REG
-			);    
+			);
     }
 }
 
@@ -619,7 +1542,7 @@ static void aspeed_mac_timer(unsigned long data)
 	    speed  = (tmp & PHY_SPEED_mask)>>14;
 	}
 	else if (priv->ids.miiPhyId == PHYID_BCM54612E
-		 || priv->ids.miiPhyId == PHYID_BCM54616S) { 
+		 || priv->ids.miiPhyId == PHYID_BCM54616S) {
 	    // Get link status
 	    // First Switch shadow register selector
 	    ftgmac100_write_phy_register(dev->base_addr, priv->ids.phyAddr, 0x1C, 0x2000);
@@ -628,23 +1551,23 @@ static void aspeed_mac_timer(unsigned long data)
 	        duplex = 0;
 	    else
 	        duplex = 1;
-	                               
+
 	    switch(tmp & 0x0018) {
 	        case 0x0000:
-	            speed = PHY_SPEED_1G; 
-	    
+	            speed = PHY_SPEED_1G;
+
 	            break;
-	        case 0x0008:    
-	            speed = PHY_SPEED_100M; 
-	                   
+	        case 0x0008:
+	            speed = PHY_SPEED_100M;
+
 	            break;
-	        case 0x0010:    
-	            speed = PHY_SPEED_10M; 
-	                                       
+	        case 0x0010:
+	            speed = PHY_SPEED_10M;
+
 	            break;
 	        default:
 	            speed = PHY_SPEED_100M;
-	    } 
+	    }
 	}
 	else {
 	    duplex = 1;  speed = PHY_SPEED_100M;
@@ -730,27 +1653,26 @@ static int ftgmac100_wait_to_send_packet( struct sk_buff * skb, struct net_devic
 	PRINTK3("%s:ftgmac100_wait_to_send_packet, skb=%x\n", dev->name, skb);
 	cur_desc = &priv->tx_descs[priv->tx_idx];
 
-#ifdef not_complete_yet	
-	if (cur_desc->TXDMA_OWN != TX_OWNBY_SOFTWARE)		/// no empty transmit descriptor 
+#ifdef not_complete_yet
+	if (cur_desc->TXDMA_OWN != TX_OWNBY_SOFTWARE)		/// no empty transmit descriptor
 	{
 		DO_PRINT("no empty transmit descriptor\n");
 		DO_PRINT("jiffies = %d\n", jiffies);
 		priv->stats.tx_dropped++;
-		netif_stop_queue(dev);		/// waiting to do: 
+		netif_stop_queue(dev);		/// waiting to do:
 		spin_unlock_irqrestore(&priv->tx_lock, flags);
 
 		return 1;
    	}
 #endif /* end_of_not */
 
-	if (cur_desc->TXDMA_OWN != TX_OWNBY_SOFTWARE)		/// no empty transmit descriptor 
+	if (cur_desc->TXDMA_OWN != TX_OWNBY_SOFTWARE)		/// no empty transmit descriptor
 	{
 		DO_PRINT("no empty TX descriptor:0x%x:0x%x\n",
 				(unsigned int)cur_desc,((unsigned int *)cur_desc)[0]);
 		priv->stats.tx_dropped++;
-		netif_stop_queue(dev);		/// waiting to do: 
+		netif_stop_queue(dev);		/// waiting to do:
 		spin_unlock_irqrestore(&priv->tx_lock, flags);
-
 		return 1;
    	}
 	priv->tx_skbuff[priv->tx_idx] = skb;
@@ -803,18 +1725,18 @@ static int ftgmac100_ringbuf_alloc(struct ftgmac100_priv *priv)
 	int i;
 	struct sk_buff *skb;
 
-    priv->rx_descs = dma_alloc_coherent(priv->dev, 
-								sizeof(RX_DESC)*RXDES_NUM, 
+    priv->rx_descs = dma_alloc_coherent(priv->dev,
+								sizeof(RX_DESC)*RXDES_NUM,
 								&priv->rx_descs_dma, GFP_KERNEL);
 
 	if(!priv->rx_descs)
 		return -ENOMEM;
-	
+
 	memset(priv->rx_descs, 0, sizeof(RX_DESC)*RXDES_NUM);
 	priv->rx_descs[RXDES_NUM-1].EDORR = 1;
 
 	for (i=0; i<RXDES_NUM; i++) {
-		dma_addr_t mapping;	
+		dma_addr_t mapping;
 		skb = dev_alloc_skb(RX_BUF_SIZE + NET_IP_ALIGN);
 		skb_reserve(skb, NET_IP_ALIGN);
 
@@ -829,8 +1751,8 @@ static int ftgmac100_ringbuf_alloc(struct ftgmac100_priv *priv)
 		priv->rx_descs[i].VIR_RXBUF_BADR = skb->data;
 	}
 
-	priv->tx_descs = dma_alloc_coherent(priv->dev, 
-						sizeof(TX_DESC)*TXDES_NUM, 
+	priv->tx_descs = dma_alloc_coherent(priv->dev,
+						sizeof(TX_DESC)*TXDES_NUM,
 						&priv->tx_descs_dma ,GFP_KERNEL);
 
 	if(!priv->tx_descs)
@@ -838,7 +1760,7 @@ static int ftgmac100_ringbuf_alloc(struct ftgmac100_priv *priv)
 
 	memset((void*)priv->tx_descs, 0, sizeof(TX_DESC)*TXDES_NUM);
 	priv->tx_descs[TXDES_NUM-1].EDOTR = 1;			// is last descriptor
-	
+
 }
 
 #if FTMAC100_DEBUG > 2
@@ -918,20 +1840,14 @@ static void ftgmac100_phy_configure(struct net_device* dev)
 			}
 			break;
 		case PHYID_VENDOR_BROADCOM:
-			switch (priv->ids.miiPhyId) {
-				case PHYID_BCM54612E:
-				case PHYID_BCM54616S:
-					ftgmac100_write_phy_register(ioaddr, priv->ids.phyAddr, 0x1C, 0x8C00); // Disable GTXCLK Clock Delay Enable
-					ftgmac100_write_phy_register(ioaddr, priv->ids.phyAddr, 0x18, 0xF0E7); // Disable RGMII RXD to RXC Skew
-					break;			
-				case PHYID_BCM5221A4:
-				default:
-					tmp = ftgmac100_read_phy_register(ioaddr, priv->ids.phyAddr, 0x1b);
-					tmp |= 0x0004;
-					ftgmac100_write_phy_register(ioaddr, priv->ids.phyAddr, 0x1b, (u16) tmp);
-					break;
-				}
-			break;			
+			tmp = ftgmac100_read_phy_register(ioaddr, priv->ids.phyAddr, 0x1b);
+			tmp |= 0x0004;
+			ftgmac100_write_phy_register(ioaddr, priv->ids.phyAddr, 0x1b, (u16) tmp);
+			break;
+		case PHYID_VENDOR_BCM5461X:
+			ftgmac100_write_phy_register(ioaddr, priv->ids.phyAddr, 0x1C, 0x8C00); // Disable GTXCLK Clock Delay Enable
+			ftgmac100_write_phy_register(ioaddr, priv->ids.phyAddr, 0x18, 0xF0E7); // Disable RGMII RXD to RXC Skew
+			break;
 		}
 }
 
@@ -960,26 +1876,26 @@ static void ftgmac100_timeout (struct net_device *dev)
 }
 
 
-static void ftgmac100_free_tx (struct net_device *dev) 
+static void ftgmac100_free_tx (struct net_device *dev)
 {
  struct ftgmac100_priv *priv = (struct ftgmac100_priv *)dev->priv;
- int entry = priv->old_tx % TXDES_NUM; 
+ int entry = priv->old_tx % TXDES_NUM;
  unsigned long flags = 0;
- 
+
  spin_lock_irqsave(&priv->tx_lock,flags);
- 
+
  /* Free used tx skbuffs */
 
   while ((priv->tx_descs[entry].TXDMA_OWN == TX_OWNBY_SOFTWARE) && (priv->tx_skbuff[entry] != NULL)) {
   struct sk_buff *skb;
-  
+
   skb = priv->tx_skbuff[entry];
          dev_kfree_skb_any (skb);
   priv->tx_skbuff[entry] = 0;
   entry = (entry + 1) % TXDES_NUM;
   priv->tx_free++;
  }
- 
+
  spin_unlock_irqrestore(&priv->tx_lock, flags);
  priv->old_tx = entry;
  if ((netif_queue_stopped(dev)) && (priv->tx_free > 0)) {
@@ -1295,7 +2211,7 @@ static irqreturn_t ftgmac100_interrupt(int irq, void * dev_id,  struct pt_regs *
 		    DO_PRINT("PHYSTS_CHG \n");
 		    // Is this interrupt for changes of the PHYLINK pin?
 		    // Note: PHYLINK is optional; not all boards connect it.
-		    if (((priv->ids.miiPhyId & PHYID_VENDOR_MASK) == PHYID_VENDOR_MARVELL) || 
+		    if (((priv->ids.miiPhyId & PHYID_VENDOR_MASK) == PHYID_VENDOR_MARVELL) ||
 		    	((priv->ids.miiPhyId & PHYID_VENDOR_MODEL_MASK) == PHYID_RTL8211))
 		    {
 			tmp = ftgmac100_read_phy_register(ioaddr, priv->ids.phyAddr, 0x13);
@@ -1312,7 +2228,7 @@ static irqreturn_t ftgmac100_interrupt(int irq, void * dev_id,  struct pt_regs *
 			tmp &= 0x000e;
 		    }
 		    else if (priv->ids.miiPhyId == PHYID_BCM54612E
-			     || priv->ids.miiPhyId == PHYID_BCM54616S) { 
+			     || priv->ids.miiPhyId == PHYID_BCM54616S) {
                 tmp = ftgmac100_read_phy_register(ioaddr, priv->ids.phyAddr, 0x1A);
                 PRINTK("%s: PHY interrupt status, read_phy_reg(0x1A) = 0x%04x\n",
                     dev->name, tmp);
@@ -1403,10 +2319,10 @@ static irqreturn_t ftgmac100_interrupt(int irq, void * dev_id,  struct pt_regs *
  . Get the current statistics.
  . This may be called with the card open or closed.
  .-------------------------------------------------------------*/
-static struct net_device_stats* ftgmac100_query_statistics(struct net_device *dev) 
+static struct net_device_stats* ftgmac100_query_statistics(struct net_device *dev)
 {
 	struct ftgmac100_priv *priv = (struct ftgmac100_priv *)dev->priv;
-	
+
 	return &priv->stats;
 }
 
@@ -1416,7 +2332,7 @@ static struct net_device_stats* ftgmac100_query_statistics(struct net_device *de
 // 	Finds the CRC32 of a set of bytes.
 //	Again, from Peter Cammaert's code.
 // --------------------------------------------------------------------
-static int crc32( char * s, int length ) 
+static int crc32( char * s, int length )
 {
 	/* indices */
 	int perByte;
@@ -1446,7 +2362,7 @@ static int crc32( char * s, int length )
  .    packets before they take up memory.
 */
 
-static void ftgmac100_setmulticast( struct net_device *dev, int count, struct dev_mc_list * addrs ) 
+static void ftgmac100_setmulticast( struct net_device *dev, int count, struct dev_mc_list * addrs )
 {
 	struct dev_mc_list	* cur_addr;
 	int crc_val;
@@ -1455,12 +2371,12 @@ static void ftgmac100_setmulticast( struct net_device *dev, int count, struct de
 	struct AstMacHwConfig* ids = &priv->ids;
 	unsigned long Combined_Channel_ID, i;
 	struct sk_buff * skb;
-	cur_addr = addrs;	
+	cur_addr = addrs;
 
 //TX
-#if 0
+#if 1
 	if (priv->NCSI_support == 1) {
-		skb = dev_alloc_skb (TX_BUF_SIZE + 16);		
+		skb = dev_alloc_skb (TX_BUF_SIZE + 16);
 		priv->InstanceID++;
 		priv->NCSI_Request.IID = priv->InstanceID;
 		priv->NCSI_Request.Command = SET_MAC_ADDRESS;
@@ -1597,7 +2513,7 @@ static int ast_gmac_stop(struct net_device *dev)
 	priv->rx_descs = NULL; priv->rx_descs_dma = 0;
 	priv->tx_descs = NULL; priv->tx_descs_dma = 0;
 	priv->tx_buf   = NULL; priv->tx_buf_dma   = 0;
-	
+
 
 	return 0;
 }
@@ -1651,10 +2567,10 @@ static int ftgmac100_open(struct net_device *netdev)
 	ftgmac100_reset(netdev);
 	ftgmac100_enable(netdev);
 
-	if (((priv->ids.miiPhyId & PHYID_VENDOR_MASK) == PHYID_VENDOR_BROADCOM) || 
+	if (((priv->ids.miiPhyId & PHYID_VENDOR_MASK) == PHYID_VENDOR_BROADCOM) ||
 	    ((priv->ids.miiPhyId & PHYID_VENDOR_MODEL_MASK) == PHYID_RTL8201EL) ||
         (priv->ids.miiPhyId == PHYID_BCM54612E) ||
-	(priv->ids.miiPhyId == PHYID_BCM54616S)) { 
+	(priv->ids.miiPhyId == PHYID_BCM54616S)) {
 
         init_timer(&priv->timer);
 	    priv->timer.data = (unsigned long)netdev;
@@ -1702,7 +2618,7 @@ static int __init ast_gmac_probe(struct platform_device *pdev)
 
 
 //	SET_ETHTOOL_OPS(netdev, &ftgmac100_ethtool_ops);
-	
+
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
 	netdev->netdev_ops 			= &ftgmac100_netdev_ops;
 #else
@@ -1715,13 +2631,12 @@ static int __init ast_gmac_probe(struct platform_device *pdev)
 	netdev->hard_start_xmit 	= ftgmac100_wait_to_send_packet;
 	netdev->tx_timeout 			= ftgmac100_timeout;
 	netdev->get_stats 			= ftgmac100_query_statistics;
-//#ifdef	HAVE_MULTICAST
-#if 0
+#ifdef	HAVE_MULTICAST
 	netdev->set_multicast_list 	= &ftgmac100_set_multicast_list;
 #endif
 
 #endif
-	
+
 
 #ifdef CONFIG_AST_NPAI
 //	netdev->features = NETIF_F_GRO;
@@ -1734,12 +2649,12 @@ static int __init ast_gmac_probe(struct platform_device *pdev)
 	priv = netdev_priv(netdev);
 	priv->netdev = netdev;
 	priv->dev = &pdev->dev;
-	
+
 
 	priv->ids.macId = pdev->id;
-	
+
 	priv->NCSI_support = ast_eth_data->NCSI_support;
-	priv->INTEL_NCSI_EVA_support= ast_eth_data->INTEL_NCSI_EVA_support;	
+	priv->INTEL_NCSI_EVA_support= ast_eth_data->INTEL_NCSI_EVA_support;
 	spin_lock_init(&priv->tx_lock);
 
 #if 0
@@ -1833,7 +2748,7 @@ err_ioremap:
 err_req_mem:
 //	netif_napi_del(&priv->napi);
 	platform_set_drvdata(pdev, NULL);
-err_netdev:	
+err_netdev:
 	free_netdev(netdev);
 err_alloc_etherdev:
 	return err;
diff --git a/drivers/net/ftgmac100_26.h b/drivers/net/ftgmac100_26.h
index 0d47024..2493111 100644
--- a/drivers/net/ftgmac100_26.h
+++ b/drivers/net/ftgmac100_26.h
@@ -1,16 +1,16 @@
 /********************************************************************************
 * File Name     : ftgmac100_26.h
-* 
+*
 * Copyright (C) 2012-2020  ASPEED Technology Inc.
-* 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 
+* 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
 ********************************************************************************/
 // --------------------------------------------------------------------
 
@@ -78,7 +78,7 @@
 
 
 // --------------------------------------------------------------------
-//	APTC_REG 
+//	APTC_REG
 // --------------------------------------------------------------------
 
 
@@ -99,18 +99,18 @@ typedef struct
 #define PHY_READ_bit			(1UL<<26)
 #define PHY_WRITE_bit			(1UL<<27)
 // --------------------------------------------------------------------
-//		PHYCR_REG 
+//		PHYCR_REG
 // --------------------------------------------------------------------
 #define PHY_AUTO_OK_bit			(1UL<<5)
 // --------------------------------------------------------------------
-//		PHY INT_STAT_REG 
+//		PHY INT_STAT_REG
 // --------------------------------------------------------------------
 #define PHY_SPEED_CHG_bit		(1UL<<14)
 #define PHY_DUPLEX_CHG_bit		(1UL<<13)
 #define PHY_LINK_CHG_bit		(1UL<<10)
 #define PHY_AUTO_COMP_bit		(1UL<<11)
 // --------------------------------------------------------------------
-//		PHY SPE_STAT_REG 
+//		PHY SPE_STAT_REG
 // --------------------------------------------------------------------
 #define PHY_RESOLVED_bit		(1UL<<11)
 #define PHY_SPEED_mask			0xC000
@@ -269,7 +269,7 @@ typedef struct {
     unsigned short  Reserved_5;
     unsigned short  Response_Code;
     unsigned short  Reason_Code;
-    unsigned char   Payload_Data[64];
+    unsigned char   Payload_Data[128];
 }  NCSI_Response_Packet;
 
 //Standard Response Code
@@ -365,30 +365,30 @@ typedef struct
 	u32 FRS:1;
 	u32 EDORR:1;
 	u32 RXPKT_RDY:1;		// 1 ==> owned by FTMAC100, 0 ==> owned by software
-	
+
 	// RXDES1
 	u32 VLAN_TAGC:16;
 	u32 Reserved4:4;
 	u32 PROTL_TYPE:2;
 	u32 LLC_PKT:1;
 	u32 DF:1;
-	u32 VLAN_AVA:1;	
+	u32 VLAN_AVA:1;
 	u32 TCPCS_FAIL:1;
 	u32 UDPCS_FAIL:1;
 	u32 IPCS_FAIL:1;
 	u32 Reserved5:4;
-	
+
 	// RXDES2
 	u32 Reserved6:32;
-	
+
 	// RXDES3
 	u32 RXBUF_BADR;
-				
+
 	u32 VIR_RXBUF_BADR;			// not defined, the virtual address of receive buffer is placed here
-	
-	u32 RESERVED; 
-	u32 RESERVED1; 
-	u32 RESERVED2;	
+
+	u32 RESERVED;
+	u32 RESERVED1;
+	u32 RESERVED2;
 }RX_DESC;
 
 
@@ -405,7 +405,7 @@ typedef struct
 	u32 FTS:1;
 	u32 EDOTR:1;
 	u32 TXDMA_OWN:1;
-	
+
 	// TXDES1
 	u32 VLAN_TAGC:16;
 	u32 INS_VLAN:1;
@@ -416,8 +416,8 @@ typedef struct
 	u32 LLC_PKT:1;
 	u32 Reserved6:7;
 	u32 TX2FIC:1;
-	u32 TXIC:1;	
-	
+	u32 TXIC:1;
+
 	// TXDES2
 	u32 Reserved7:32;
 
@@ -427,8 +427,8 @@ typedef struct
 	u32 VIR_TXBUF_BADR;			// Reserve, the virtual address of transmit buffer is placed here
 
 	u32 RESERVED;
-	u32 RESERVED1; 
-	u32 RESERVED2; 
+	u32 RESERVED1;
+	u32 RESERVED2;
 
 }TX_DESC;
 
@@ -450,7 +450,7 @@ typedef struct
 // --------------------------------------------------------------------
 
 
-//#define RXDES_NUM			64//64 // we defined 32 descriptor for OTG issue 
+//#define RXDES_NUM			64//64 // we defined 32 descriptor for OTG issue
 #define RXDES_NUM			32
 
 #define RX_BUF_SIZE			1536
@@ -464,6 +464,7 @@ typedef struct
 #define PHYID_REVISION_MASK             0x0000000f
 #define PHYID_VENDOR_MARVELL            0x01410c00
 #define PHYID_VENDOR_BROADCOM           0x00406000
+#define PHYID_VENDOR_BCM5461X           0x03625c00
 #define PHYID_VENDOR_REALTEK            0x001cc800
 
 #define PHYID_BCM5221A4                 0x004061e4
@@ -521,7 +522,7 @@ struct ftgmac100_priv {
 	int		tx_idx;
 	int		old_tx;
 	struct sk_buff *tx_skbuff[TXDES_NUM];
-	
+
 	int     maccr_val;
         struct timer_list    timer;
 	u32		GigaBit_MAHT0;
@@ -533,7 +534,7 @@ struct ftgmac100_priv {
 	NCSI_Capability NCSI_Cap;
 	unsigned int 	InstanceID;
 	unsigned int 	Retry;
-	unsigned char	Payload_Data[16];
+	unsigned char	Payload_Data[64];
 	unsigned char	Payload_Pad[4];
 	unsigned long	Payload_Checksum;
 	int		tx_free;
@@ -575,7 +576,7 @@ struct ftgmac100_priv {
 #define    STOP_DONE    (1 << 4)
 
 
- 
+
 #endif  /* _SMC_91111_H_ */
 
 
diff --git a/drivers/rtc/rtc-aspeed.c b/drivers/rtc/rtc-aspeed.c
index 477032e..de9e995 100644
--- a/drivers/rtc/rtc-aspeed.c
+++ b/drivers/rtc/rtc-aspeed.c
@@ -7,11 +7,11 @@
 * 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
@@ -67,8 +67,16 @@ ast_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
 {
 	struct ast_rtc *ast_rtc = dev_get_drvdata(dev);
 	pr_debug("cmd = 0x%08x, arg = 0x%08lx\n", cmd, arg);
-	
+
 	switch (cmd) {
+    case RTC_SET_TIME:
+    case RTC_RD_TIME:
+    case RTC_ALM_READ:
+    case RTC_ALM_SET:
+      {
+        // use rtc-dev.c fallback
+        return -ENOIOCTLCMD;
+      }
 		case RTC_AIE_ON:	/* alarm on */
 			{
 				rtc_write(ast_rtc->base, rtc_read(ast_rtc->base, RTC_CONTROL) | ENABLE_ALL_ALARM, RTC_CONTROL);
@@ -105,7 +113,7 @@ ast_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
 		default:
 				return -ENOTTY;
 	}
-		
+
 	return 0;
 }
 
@@ -122,7 +130,7 @@ ast_rtc_get_time(struct device *dev, struct rtc_time *rtc_tm)
 
 		reg_time = rtc_read(ast_rtc->base, RTC_CNTR_STS_1);
 		reg_date = rtc_read(ast_rtc->base, RTC_CNTR_STS_2);
-		
+
 		spin_unlock_irqrestore(&ast_rtc->lock, flags);
 
 		rtc_tm->tm_year = GET_CENT_VAL(reg_date)*1000 | GET_YEAR_VAL(reg_date);
@@ -132,7 +140,7 @@ ast_rtc_get_time(struct device *dev, struct rtc_time *rtc_tm)
 		rtc_tm->tm_hour = GET_HOUR_VAL(reg_time);
 		rtc_tm->tm_min = GET_MIN_VAL(reg_time);
 		rtc_tm->tm_sec = GET_SEC_VAL(reg_time);
-		
+
         pr_debug("read time %02x.%02x.%02x %02x/%02x/%02x\n",
                  rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday,
                  rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec);
@@ -155,7 +163,7 @@ ast_rtc_set_time(struct device *dev, struct rtc_time *tm)
 
 	/* set hours */
 	reg_time = SET_DAY_VAL(tm->tm_mday) | SET_HOUR_VAL(tm->tm_hour) | SET_MIN_VAL(tm->tm_min) | SET_SEC_VAL(tm->tm_sec);
-	
+
 	/* set century */
 	/* set mon */
 	reg_date = SET_CENT_VAL(tm->tm_year / 1000) |  SET_YEAR_VAL(tm->tm_year % 1000) | SET_MON_VAL(tm->tm_mon);
@@ -166,10 +174,10 @@ ast_rtc_set_time(struct device *dev, struct rtc_time *tm)
 	rtc_write(ast_rtc->base, reg_date, RTC_CNTR_STS_2);
 
 	rtc_write(ast_rtc->base, rtc_read(ast_rtc->base, RTC_CONTROL) &~RTC_LOCK , RTC_CONTROL);
-	
+
 	spin_unlock_irqrestore(&ast_rtc->lock, flags);
 
-	return 0;	
+	return 0;
 }
 static int
 ast_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
@@ -183,7 +191,7 @@ ast_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 	alarm_reg = rtc_read(ast_rtc->base, RTC_ALARM);
 	spin_unlock_irqrestore(&ast_rtc->lock, flags);
 
-//DAY	
+//DAY
 	alm_tm->tm_mday = GET_DAY_VAL(alarm_reg);
 
 //HR
@@ -221,7 +229,7 @@ ast_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
     if (tm->tm_mday <= 31 && tm->tm_mday >= 1) {
 			reg_alarm |= SET_DAY_VAL(tm->tm_mday);
     }
-    
+
 //HR
     /* set ten hours */
     if (tm->tm_hour <= 23 && tm->tm_hour >= 0) {
@@ -245,8 +253,8 @@ ast_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 	spin_lock_irqsave(&ast_rtc->lock, flags);
 
 	rtc_write(ast_rtc->base, reg_alarm, RTC_ALARM);
-	
-	if(alarm->enabled)	
+
+	if(alarm->enabled)
 		rtc_write(ast_rtc->base, reg_alarm, RTC_CONTROL);
 	else
 		rtc_write(ast_rtc->base, reg_alarm, RTC_CONTROL);
@@ -366,14 +374,14 @@ static int __init ast_rtc_probe(struct platform_device *pdev)
 			ret = -EBUSY;
 			goto free_rtc;
 	}
-	
+
 	ast_rtc->base = ioremap(res->start, resource_size(res));
 	if (!ast_rtc->base) {
 			dev_err(&pdev->dev, "cannot map SocleDev registers\n");
 			ret = -ENOMEM;
 			goto release_mem;
 	}
-	
+
 	pr_debug("base = 0x%p, irq = %d\n", ast_rtc->base, ast_rtc->irq);
 
 	rtc_dev = rtc_device_register(pdev->name, &pdev->dev, &ast_rtcops, THIS_MODULE);
@@ -381,7 +389,7 @@ static int __init ast_rtc_probe(struct platform_device *pdev)
 			ret = PTR_ERR(rtc_dev);
 			goto unmap;
 	}
-	
+
 	ast_rtc->res = res;
 	ast_rtc->rtc_dev = rtc_dev;
 	spin_lock_init(&ast_rtc->lock);
@@ -406,7 +414,7 @@ static int __init ast_rtc_probe(struct platform_device *pdev)
 		printk("no need to enable RTC \n");
 
 	spin_unlock_irq(&ast_rtc->lock);
-	
+
 	/* register ISR */
 	ret = request_irq(ast_rtc->irq, ast_rtc_interrupt, IRQF_DISABLED, dev_name(&rtc_dev->dev), ast_rtc);
 	if (ret) {
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index a181ccf..f16da59 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -38,6 +38,7 @@
 #include <linux/serial_8250.h>
 #include <linux/nmi.h>
 #include <linux/mutex.h>
+#include <linux/gpio.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -59,6 +60,8 @@ static unsigned int nr_uarts = CONFIG_SERIAL_8250_RUNTIME_UARTS;
 
 static struct uart_driver serial8250_reg;
 
+DECLARE_WAIT_QUEUE_HEAD(thre_wait);
+
 static int serial_index(struct uart_port *port)
 {
 	return (serial8250_reg.minor - 64) + port->line;
@@ -1225,7 +1228,10 @@ static void autoconfig_irq(struct uart_8250_port *up)
 
 static inline void __stop_tx(struct uart_8250_port *p)
 {
-	if (p->ier & UART_IER_THRI) {
+  int status = serial_in(p, UART_LSR);
+  // only turn off THRE interrupt if THRE is *currently* asserted
+  // (we still want to catch it a final time after the FIFO empties)
+	if ((p->ier & UART_IER_THRI) && (status & UART_LSR_THRE)) {
 		p->ier &= ~UART_IER_THRI;
 		serial_out(p, UART_IER, p->ier);
 	}
@@ -1527,6 +1533,7 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
 
 	DEBUG_INTR("end.\n");
 
+  wake_up(&thre_wait);
 	return IRQ_RETVAL(handled);
 }
 
@@ -2526,6 +2533,35 @@ serial8250_type(struct uart_port *port)
 	return uart_config[type].name;
 }
 
+static int serial8250_ioctl(struct uart_port *port, unsigned int cmd, unsigned long arg) {
+	struct uart_8250_port *up = (struct uart_8250_port *)port;
+  unsigned long flags;
+  int ret = -ENOIOCTLCMD;
+  // kernel-space RS485 drain-and-switch hack
+  if (cmd == TIOCSERWAITTEMT) {
+    // wait for kernel buffers and UART FIFO to both empty
+	  struct circ_buf *xmit = &up->port.info->xmit;
+    wait_event_interruptible(
+       thre_wait,
+       uart_circ_empty(xmit) &&
+       (serial_in(up, UART_LSR) & UART_LSR_THRE));
+    // spin until TEMT (transmit shift register empty)
+	  spin_lock_irqsave(&up->port.lock, flags);
+	  wait_for_xmitr(up, BOTH_EMPTY);
+    if (arg != 0) {
+      // turn off RS485 DE pin
+      gpio_set_value(arg, 0);
+    }
+    // grab any phantom char seen on RX when transceiver switches
+		(void) serial_inp(up, UART_RX);
+    // enable read
+		up->port.ignore_status_mask &= ~UART_LSR_DR;
+	  spin_unlock_irqrestore(&up->port.lock, flags);
+    return 0;
+  }
+  return ret;
+}
+
 static struct uart_ops serial8250_pops = {
 	.tx_empty	= serial8250_tx_empty,
 	.set_mctrl	= serial8250_set_mctrl,
@@ -2544,6 +2580,7 @@ static struct uart_ops serial8250_pops = {
 	.request_port	= serial8250_request_port,
 	.config_port	= serial8250_config_port,
 	.verify_port	= serial8250_verify_port,
+  .ioctl = serial8250_ioctl,
 #ifdef CONFIG_CONSOLE_POLL
 	.poll_get_char = serial8250_get_poll_char,
 	.poll_put_char = serial8250_put_poll_char,
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 5702145..0b01ba8 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -235,10 +235,17 @@ config ORION5X_WATCHDOG
 
 config AST_WATCHDOG
 	tristate "ASPEED GUC watchdog"
-	depends on WATCHDOG 
+	depends on WATCHDOG
 	help
 	  Watchdog timer for ASPEED chips.
 
+config AST_WATCHDOG_REARM_DUAL_BOOT
+  bool "Rearm dual boot watchdog"
+  default n
+	depends on AST_WATCHDOG
+	help
+	  Rearm dual boot watchdog or not during boot
+
 # ARM26 Architecture
 
 # AVR32 Architecture
diff --git a/drivers/watchdog/ast_wdt.c b/drivers/watchdog/ast_wdt.c
index 9e7e84f..e599a55 100644
--- a/drivers/watchdog/ast_wdt.c
+++ b/drivers/watchdog/ast_wdt.c
@@ -68,6 +68,7 @@ typedef unsigned char bool_T;
 
 #else
 #define WDT_BASE_VA		(IO_ADDRESS(AST_WDT_BASE))
+#define WDT2_BASE_VA		(IO_ADDRESS(AST_WDT_BASE + 20))
 #endif
 
 #define WDT_CntSts              (WDT_BASE_VA+0x00)
@@ -78,6 +79,14 @@ typedef unsigned char bool_T;
 #define WDT_Clr                 (WDT_BASE_VA+0x14)
 #define WDT_RstWd               (WDT_BASE_VA+0x18)
 
+#define WDT2_CntSts             (WDT2_BASE_VA+0x00)
+#define WDT2_Reload             (WDT2_BASE_VA+0x04)
+#define WDT2_Restart            (WDT2_BASE_VA+0x08)
+#define WDT2_Ctrl               (WDT2_BASE_VA+0x0C)
+#define WDT2_TimeOut            (WDT2_BASE_VA+0x10)
+#define WDT2_Clr                (WDT2_BASE_VA+0x14)
+#define WDT2_RstWd              (WDT2_BASE_VA+0x18)
+
 #define WDT_CTRL_B_SECOND_BOOT  (0x1 << 7)
 #define WDT_CTRL_B_RESET_SOC (0x00 << 5) /* yes, 0x00 */
 #define WDT_CTRL_B_RESET_FULL (0x01 << 5)
@@ -101,6 +110,11 @@ typedef unsigned char bool_T;
 #define WDT_TIMO 30			/* Default heartbeat = 30 seconds */
 
 #define WDT_INITIAL_TIMO (8*60) /* Initial timeout, 8m */
+/*
+ * Dual boot watchdog is 5s shorter so that dual boot watchdog
+ * will kick in first.
+ */
+#define WDT_DUAL_BOOT_TIMO (WDT_INITIAL_TIMO - 5)
 #define WDT_TIMO2TICKS(t) (TICKS_PER_uSEC * 1000000 * (t))
 
 static int heartbeat = WDT_TIMO;
@@ -233,6 +247,14 @@ bool_T wdt_is_enabled(void)
 	return reg & WDT_CTRL_B_ENABLE;
 }
 
+#ifdef CONFIG_AST_WATCHDOG_REARM_DUAL_BOOT
+void wdt_dual_boot_restart(unsigned int timeo)
+{
+	AST_WRITE_REG(WDT2_Reload, WDT_TIMO2TICKS(timeo));
+	AST_WRITE_REG(WDT2_Restart, 0x4755);	/* reload! */
+	printk(KERN_INFO "Re-arm the dual boot watchdog for %u seconds\n", timeo);
+}
+#endif
 
 void wdt_restart_new(unsigned int nPeriod, int sourceClk, bool_T bResetOut,
 		     bool_T bIntrSys, bool_T bClrAfter, bool_T bResetARMOnly)
@@ -542,6 +564,11 @@ static int ast_wdt_probe(struct platform_device *pdev)
       return ret;
    }
 
+#ifdef CONFIG_AST_WATCHDOG_REARM_DUAL_BOOT
+   /* re-arm dual boot watchdog */
+   wdt_dual_boot_restart(WDT_DUAL_BOOT_TIMO);
+#endif
+
    /* interrupt the system while WDT timeout */
    wdt_restart_new(WDT_TIMO2TICKS(WDT_INITIAL_TIMO), WDT_CLK_SRC_EXT,
 		   /* No Ext, No intr, Self clear, Full chip reset */
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 61cb48f..5dc69ab 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
  * Copyright (C) 1998  Eddie C. Dost  (ecd@skynet.be)
- * Copyright (C) 2001,2002  Andi Kleen, SuSE Labs 
+ * Copyright (C) 2001,2002  Andi Kleen, SuSE Labs
  * Copyright (C) 2003       Pavel Machek (pavel@suse.cz)
  *
  * These routines maintain argument size conversion between 32bit and 64bit
@@ -125,7 +125,7 @@ static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
 	mm_segment_t old_fs = get_fs();
 	int err;
 	unsigned long val;
-	
+
 	set_fs (KERNEL_DS);
 	err = sys_ioctl(fd, cmd, (unsigned long)&val);
 	set_fs (old_fs);
@@ -133,14 +133,14 @@ static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
 		return -EFAULT;
 	return err;
 }
- 
+
 static int rw_long(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	mm_segment_t old_fs = get_fs();
 	u32 __user *argptr = compat_ptr(arg);
 	int err;
 	unsigned long val;
-	
+
 	if(get_user(val, argptr))
 		return -EFAULT;
 	set_fs (KERNEL_DS);
@@ -365,17 +365,17 @@ static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg)
 			if (copy_in_user(ifr, ifr32, sizeof(struct ifreq32)))
 				return -EFAULT;
 			ifr++;
-			ifr32++; 
+			ifr32++;
 		}
 	}
 	if (copy_to_user(uifc, &ifc, sizeof(struct ifconf)))
 		return -EFAULT;
 
-	err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)uifc);	
+	err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)uifc);
 	if (err)
 		return err;
 
-	if (copy_from_user(&ifc, uifc, sizeof(struct ifconf))) 
+	if (copy_from_user(&ifc, uifc, sizeof(struct ifconf)))
 		return -EFAULT;
 
 	ifr = ifc.ifc_req;
@@ -411,7 +411,7 @@ static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 	struct ifreq32 __user *ifr32;
 	u32 data;
 	void __user *datap;
-	
+
 	ifr = compat_alloc_user_space(sizeof(*ifr));
 	ifr32 = compat_ptr(arg);
 
@@ -507,7 +507,7 @@ static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg)
 	struct ifmap32 __user *uifmap32;
 	mm_segment_t old_fs;
 	int err;
-	
+
 	uifr32 = compat_ptr(arg);
 	uifmap32 = &uifr32->ifr_ifru.ifru_map;
 	switch (cmd) {
@@ -610,7 +610,7 @@ static int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 	char devname[16];
 	u32 rtdev;
 	mm_segment_t old_fs = get_fs();
-	
+
 	struct socket *mysock = sockfd_lookup(fd, &ret);
 
 	if (mysock && mysock->sk && mysock->sk->sk_family == AF_INET6) { /* ipv6 */
@@ -624,7 +624,7 @@ static int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 		ret |= __get_user (r6.rtmsg_info, &(ur6->rtmsg_info));
 		ret |= __get_user (r6.rtmsg_flags, &(ur6->rtmsg_flags));
 		ret |= __get_user (r6.rtmsg_ifindex, &(ur6->rtmsg_ifindex));
-		
+
 		r = (void *) &r6;
 	} else { /* ipv4 */
 		struct rtentry32 __user *ur4 = compat_ptr(arg);
@@ -1046,14 +1046,14 @@ static int vt_check(struct file *file)
 	struct tty_struct *tty;
 	struct inode *inode = file->f_path.dentry->d_inode;
 	struct vc_data *vc;
-	
+
 	if (file->f_op->unlocked_ioctl != tty_ioctl)
 		return -EINVAL;
-	                
+
 	tty = (struct tty_struct *)file->private_data;
 	if (tty_paranoia_check(tty, inode, "tty_ioctl"))
 		return -EINVAL;
-	                                                
+
 	if (tty->ops->ioctl != vt_ioctl)
 		return -EINVAL;
 
@@ -1067,7 +1067,7 @@ static int vt_check(struct file *file)
 	 */
 	if (current->signal->tty == tty || capable(CAP_SYS_TTY_CONFIG))
 		return 1;
-	return 0;                                                    
+	return 0;
 }
 
 struct consolefontdesc32 {
@@ -1085,7 +1085,7 @@ static int do_fontx_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
 
 	perm = vt_check(file);
 	if (perm < 0) return perm;
-	
+
 	switch (cmd) {
 	case PIO_FONTX:
 		if (!perm)
@@ -1130,16 +1130,16 @@ struct console_font_op32 {
 	compat_uint_t charcount;
 	compat_caddr_t data;    /* font data with height fixed to 32 */
 };
-                                        
+
 static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file)
 {
 	struct console_font_op op;
 	struct console_font_op32 __user *fontop = compat_ptr(arg);
 	int perm = vt_check(file), i;
 	struct vc_data *vc;
-	
+
 	if (perm < 0) return perm;
-	
+
 	if (copy_from_user(&op, fontop, sizeof(struct console_font_op32)))
 		return -EFAULT;
 	if (!perm && op.op != KD_FONT_OP_GET)
@@ -1303,7 +1303,7 @@ static int do_atmif_sioc(unsigned int fd, unsigned int cmd, unsigned long arg)
 	u32 data;
 	void __user *datap;
 	int err;
-        
+
 	sioc = compat_alloc_user_space(sizeof(*sioc));
 	sioc32 = compat_ptr(arg);
 
@@ -1328,7 +1328,7 @@ static int do_atm_ioctl(unsigned int fd, unsigned int cmd32, unsigned long arg)
 {
         int i;
         unsigned int cmd = 0;
-        
+
 	switch (cmd32) {
 	case SONET_GETSTAT:
 	case SONET_GETSTATZ:
@@ -1349,11 +1349,11 @@ static int do_atm_ioctl(unsigned int fd, unsigned int cmd32, unsigned long arg)
 	}
 	if (i == NR_ATM_IOCTL)
 	        return -EINVAL;
-        
+
         switch (cmd) {
 	case ATM_GETNAMES:
 		return do_atm_iobuf(fd, cmd, arg);
-	    
+
 	case ATM_GETLINKRATE:
         case ATM_GETTYPE:
         case ATM_GETESI:
@@ -1444,7 +1444,7 @@ static int mtd_rw_oob(unsigned int fd, unsigned int cmd, unsigned long arg)
 	}
 
 	return err;
-}	
+}
 
 #ifdef CONFIG_BLOCK
 struct raw32_config_request
@@ -1798,7 +1798,7 @@ static int rtc_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
 		val32 = kval;
 		return put_user(val32, (unsigned int __user *)arg);
 	case RTC_IRQP_SET32:
-		return sys_ioctl(fd, RTC_IRQP_SET, arg); 
+		return sys_ioctl(fd, RTC_IRQP_SET, arg);
 	case RTC_EPOCH_SET32:
 		return sys_ioctl(fd, RTC_EPOCH_SET, arg);
 	default:
@@ -2678,6 +2678,7 @@ COMPATIBLE_IOCTL(USBDEVFS_IOCTL32)
 /* i2c */
 HANDLE_IOCTL(I2C_FUNCS, w_long)
 HANDLE_IOCTL(I2C_RDWR, do_i2c_rdwr_ioctl)
+HANDLE_IOCTL(I2C_SLAVE_RDWR, do_i2c_rdwr_ioctl)
 HANDLE_IOCTL(I2C_SMBUS, do_i2c_smbus_ioctl)
 /* bridge */
 HANDLE_IOCTL(SIOCSIFBR, old_bridge_ioctl)
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h
index 311315b..ed9b48d 100644
--- a/include/linux/i2c-dev.h
+++ b/include/linux/i2c-dev.h
@@ -46,6 +46,7 @@
 #define I2C_FUNCS	0x0705	/* Get the adapter functionality mask */
 
 #define I2C_RDWR	0x0707	/* Combined R/W transfer (one STOP only) */
+#define I2C_SLAVE_RDWR	0x0709	/* Slave Read Write */
 
 #define I2C_PEC		0x0708	/* != 0 to use PEC with SMBus */
 #define I2C_SMBUS	0x0720	/* SMBus transfer */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 59167e2..f037cde 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -62,6 +62,9 @@ extern int i2c_master_recv(struct i2c_client *client, char *buf, int count);
 extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 			int num);
 
+extern int i2c_slave_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+      int num);
+
 /* This is the very generalized SMBus access routine. You probably do not
    want to use this, though; one of the functions below may be much easier,
    and probably just as fast.
@@ -333,6 +336,7 @@ struct i2c_algorithm {
 	   processed, or a negative value on error */
 	int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
 			   int num);
+	int (*slave_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs);
 	int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
 			   unsigned short flags, char read_write,
 			   u8 command, int size, union i2c_smbus_data *data);
@@ -516,6 +520,8 @@ struct i2c_msg {
 	__u16 flags;
 #define I2C_M_TEN		0x0010	/* this is a ten bit chip address */
 #define I2C_M_RD		0x0001	/* read data, from slave to master */
+#define I2C_S_EN    0x0002  /* Slave Enable */
+#define I2C_S_ALT    0x0004  /* Slave Alert */
 #define I2C_M_NOSTART		0x4000	/* if I2C_FUNC_PROTOCOL_MANGLING */
 #define I2C_M_REV_DIR_ADDR	0x2000	/* if I2C_FUNC_PROTOCOL_MANGLING */
 #define I2C_M_IGNORE_NAK	0x1000	/* if I2C_FUNC_PROTOCOL_MANGLING */
diff --git a/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0029-mtd-m25p80-Add-support-for-the-Winbond-W25Q64.patch b/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0029-mtd-m25p80-Add-support-for-the-Winbond-W25Q64.patch
new file mode 100644
index 0000000..52aef04
--- /dev/null
+++ b/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0029-mtd-m25p80-Add-support-for-the-Winbond-W25Q64.patch
@@ -0,0 +1,29 @@
+From d2ac467a108400ff1ae682a423c7d41265e62d47 Mon Sep 17 00:00:00 2001
+From: Thierry Reding <thierry.reding@avionic-design.de>
+Date: Mon, 30 Aug 2010 13:00:48 +0200
+Subject: [PATCH] mtd: m25p80: Add support for the Winbond W25Q64
+
+This patch adds support for the Winbond W25Q64 serial flash.
+
+Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
+Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
+Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
+---
+ drivers/mtd/devices/m25p80.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
+index 1f0f703..b6fd7c2 100644
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -716,6 +716,7 @@ static const struct spi_device_id m25p_ids[] = {
+ 	{ "w25x32", INFO(0xef3016, 0, 64 * 1024,  64, SECT_4K) },
+ 	{ "w25q32", INFO(0xef4016, 0, 64 * 1024,  64, SECT_4K) },
+ 	{ "w25x64", INFO(0xef3017, 0, 64 * 1024, 128, SECT_4K) },
++	{ "w25q64", INFO(0xef4017, 0, 64 * 1024, 128, SECT_4K) },
+ 
+ 	/* Catalyst / On Semiconductor -- non-JEDEC */
+ 	{ "cat25c11", CAT25_INFO(  16, 8, 16, 1) },
+-- 
+1.8.5.6
+
diff --git a/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0030-net-Don-t-leak-packets-when-a-netns-is-going-down.patch b/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0030-net-Don-t-leak-packets-when-a-netns-is-going-down.patch
new file mode 100644
index 0000000..ad04217
--- /dev/null
+++ b/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0030-net-Don-t-leak-packets-when-a-netns-is-going-down.patch
@@ -0,0 +1,56 @@
+From 0a36b345ab99d6b3c96999e7e3b79bd243cf9bf7 Mon Sep 17 00:00:00 2001
+From: "Eric W. Biederman" <ebiederm@xmission.com>
+Date: Wed, 5 Nov 2008 16:00:24 -0800
+Subject: [PATCH] net: Don't leak packets when a netns is going down
+
+I have been tracking for a while a case where when the
+network namespace exits the cleanup gets stck in an
+endless precessess of:
+
+unregister_netdevice: waiting for lo to become free. Usage count = 3
+unregister_netdevice: waiting for lo to become free. Usage count = 3
+unregister_netdevice: waiting for lo to become free. Usage count = 3
+unregister_netdevice: waiting for lo to become free. Usage count = 3
+unregister_netdevice: waiting for lo to become free. Usage count = 3
+unregister_netdevice: waiting for lo to become free. Usage count = 3
+unregister_netdevice: waiting for lo to become free. Usage count = 3
+
+It turns out that if you listen on a multicast address an unsubscribe
+packet is sent when the network device goes down.   If you shutdown
+the network namespace without carefully cleaning up this can trigger
+the unsubscribe packet to be sent over the loopback interface while
+the network namespace is going down.
+
+All of which is fine except when we drop the packet and forget to
+free it leaking the skb and the dst entry attached to.  As it
+turns out the dst entry hold a reference to the idev which holds
+the dev and keeps everything from being cleaned up.  Yuck!
+
+By fixing my earlier thinko and add the needed kfree_skb and everything
+cleans up beautifully.
+
+Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ net/core/dev.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/net/core/dev.c b/net/core/dev.c
+index 811507c..a0c60607 100644
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -2253,8 +2253,10 @@ int netif_receive_skb(struct sk_buff *skb)
+ 	rcu_read_lock();
+ 
+ 	/* Don't receive packets in an exiting network namespace */
+-	if (!net_alive(dev_net(skb->dev)))
++	if (!net_alive(dev_net(skb->dev))) {
++		kfree_skb(skb);
+ 		goto out;
++	}
+ 
+ #ifdef CONFIG_NET_CLS_ACT
+ 	if (skb->tc_verd & TC_NCLS) {
+-- 
+1.8.1
+
diff --git a/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0031-IPv6-Print-error-value-when-skb-allocation-fails.patch b/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0031-IPv6-Print-error-value-when-skb-allocation-fails.patch
new file mode 100644
index 0000000..b638996
--- /dev/null
+++ b/meta-aspeed/recipes-kernel/linux/files/patch-2.6.28.9/0031-IPv6-Print-error-value-when-skb-allocation-fails.patch
@@ -0,0 +1,43 @@
+From 5777cee30776da63ecbe2b6d4929e01d82c7d72e Mon Sep 17 00:00:00 2001
+From: Brian Haley <brian.haley@hp.com>
+Date: Tue, 2 Jun 2009 00:20:26 -0700
+Subject: [PATCH] IPv6: Print error value when skb allocation fails
+
+Print-out the error value when sock_alloc_send_skb() fails in
+the IPv6 neighbor discovery code - can be useful for debugging.
+
+Signed-off-by: Brian Haley <brian.haley@hp.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ net/ipv6/ndisc.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
+index d0f54d1..45529b1 100644
+--- a/net/ipv6/ndisc.c
++++ b/net/ipv6/ndisc.c
+@@ -483,8 +483,8 @@ static void __ndisc_send(struct net_device *dev,
+ 				  1, &err);
+ 	if (!skb) {
+ 		ND_PRINTK0(KERN_ERR
+-			   "ICMPv6 ND: %s() failed to allocate an skb.\n",
+-			   __func__);
++			   "ICMPv6 ND: %s() failed to allocate an skb, err=%d.\n",
++			   __func__, err);
+ 		dst_release(dst);
+ 		return;
+ 	}
+@@ -1533,8 +1533,8 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
+ 				   1, &err);
+ 	if (buff == NULL) {
+ 		ND_PRINTK0(KERN_ERR
+-			   "ICMPv6 Redirect: %s() failed to allocate an skb.\n",
+-			   __func__);
++			   "ICMPv6 Redirect: %s() failed to allocate an skb, err=%d.\n",
++			   __func__, err);
+ 		dst_release(dst);
+ 		return;
+ 	}
+-- 
+1.8.1
+
OpenPOWER on IntegriCloud