aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/compulab-pxa270-2.6.16/linux-2.6.16.patch
blob: c8b9fcbc1a6dae9a438cb2b51bc475a9c293118a (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
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
 Makefile                                 |    7 
 arch/arm/Kconfig                         |   10 
 arch/arm/common/dmabounce.c              |   23 -
 arch/arm/configs/cm_x270_defconfig       | 1312 ++++++++++++++++++++++++++++++
 arch/arm/kernel/bios32.c                 |   36 +
 arch/arm/kernel/vmlinux.lds.S            |    4 
 arch/arm/mach-pxa/Kconfig                |   16 
 arch/arm/mach-pxa/Makefile               |    9 
 arch/arm/mach-pxa/cm-x270-pci.c          |  152 +++
 arch/arm/mach-pxa/cm-x270.c              |  975 ++++++++++++++++++++++
 arch/arm/mach-pxa/it8152.c               |  248 ++++++
 arch/arm/mach-pxa/leds-cm-x270.c         |  134 +++
 arch/arm/mach-pxa/leds.c                 |    2 
 arch/arm/mach-pxa/leds.h                 |    1 
 arch/arm/mach-pxa/pxa27x.c               |    6 
 drivers/block/Kconfig                    |    5 
 drivers/block/Makefile                   |    1 
 drivers/block/cl_flash/CL_Logic.h        |  245 ++++++
 drivers/block/cl_flash/Kconfig           |   11 
 drivers/block/cl_flash/Makefile          |   12 
 drivers/block/cl_flash/cl_blkdev.c       |  731 +++++++++++++++++
 drivers/block/cl_flash/cl_blkdev.h       |   43 +
 drivers/block/cl_flash/cl_common.c       |   52 +
 drivers/block/cl_flash/cl_nanddev_x270.c |  233 +++++
 drivers/block/cl_flash/cl_nordev.c       |  594 ++++++++++++++
 drivers/char/Kconfig                     |    6 
 drivers/char/Makefile                    |    1 
 drivers/char/emv3020.c                   |  365 ++++++++
 drivers/ide/Kconfig                      |    7 
 drivers/ide/arm/Makefile                 |    1 
 drivers/ide/arm/cm-x270-ide.c            |  135 +++
 drivers/mfd/Kconfig                      |   10 
 drivers/mfd/Makefile                     |    7 
 drivers/mfd/mcp-ac97.c                   |  151 +++
 drivers/mfd/mcp-core.c                   |    1 
 drivers/mfd/mcp.h                        |    9 
 drivers/mfd/ucb1x00-core.c               |  127 ++-
 drivers/mfd/ucb1x00-ts.c                 |   44 +
 drivers/mfd/ucb1x00.h                    |    4 
 drivers/mtd/nand/Kconfig                 |    4 
 drivers/mtd/nand/Makefile                |    1 
 drivers/mtd/nand/cmx270-nand.c           |  281 ++++++
 drivers/net/Kconfig                      |    8 
 drivers/net/dm9000.c                     |   11 
 drivers/pcmcia/Makefile                  |    2 
 drivers/pcmcia/pxa2xx_cm_x270.c          |  198 +++++
 drivers/serial/pxa.c                     |   55 +
 drivers/video/Kconfig                    |   10 
 drivers/video/Makefile                   |    1 
 drivers/video/mbx/Makefile               |    7 
 drivers/video/mbx/mbxfb.c                |  659 +++++++++++++++
 drivers/video/mbx/mbxsysfs.c             |  129 +++
 drivers/video/mbx/reg_bits.h             |  489 +++++++++++
 drivers/video/mbx/regs.h                 |  192 ++++
 drivers/video/pxafb.c                    |  104 ++
 include/asm-arm/arch-pxa/cm-x270.h       |   72 ++
 include/asm-arm/arch-pxa/hardware.h      |   11 
 include/asm-arm/arch-pxa/irqs.h          |   24 +
 include/asm-arm/arch-pxa/marathonfb.h    |   28 +
 include/asm-arm/arch-pxa/memory.h        |   13 
 include/asm-arm/arch-pxa/pxafbsetup.h    |   39 +
 include/asm-arm/hardware/it8152.h        |  104 ++
 include/linux/pci_ids.h                  |    1 
 sound/pci/ac97/ac97_codec.c              |    2 
 sound/pci/ac97/ac97_patch.c              |   30 +
 sound/pci/ac97/ac97_patch.h              |    1 
 66 files changed, 8115 insertions(+), 91 deletions(-)

diff --git a/Makefile b/Makefile
index cb57905..dd02f27 100644
--- a/Makefile
+++ b/Makefile
@@ -172,8 +172,11 @@ # Alternatively CROSS_COMPILE can be set
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 
-ARCH		?= $(SUBARCH)
-CROSS_COMPILE	?=
+#ARCH		?= $(SUBARCH)
+#CROSS_COMPILE	?=
+
+ARCH		= arm
+CROSS_COMPILE	= arm-linux-
 
 # Architecture as present in compile.h
 UTS_MACHINE := $(ARCH)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 32ba00b..2de9ceb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -331,7 +331,7 @@ config ISA_DMA_API
 	bool
 
 config PCI
-	bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB
+	bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || MACH_ARMCORE
 	help
 	  Find out whether you have a PCI motherboard. PCI is the name of a
 	  bus system, i.e. the way the CPU talks to the other stuff inside
@@ -349,6 +349,12 @@ config PCI_HOST_VIA82C505
 	depends on PCI && ARCH_SHARK
 	default y
 
+config PCI_HOST_ITE8152
+	bool
+	depends on PCI && MACH_ARMCORE
+	default y
+	select DMABOUNCE
+
 source "drivers/pci/Kconfig"
 
 source "drivers/pcmcia/Kconfig"
@@ -484,7 +490,7 @@ config LEDS
 		   ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
 		   ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
 		   ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
-		   ARCH_AT91RM9200
+		   ARCH_AT91RM9200 || MACH_ARMCORE
 	help
 	  If you say Y here, the LEDs on your machine will be used
 	  to provide useful information about your current system status.
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index ad6c89a..dc2bbd0 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -235,7 +235,7 @@ map_single(struct device *dev, void *ptr
 		/*
 		 * Figure out if we need to bounce from the DMA mask.
 		 */
-		needs_bounce = (dma_addr | (dma_addr + size - 1)) & ~mask;
+		needs_bounce = ((dma_addr | (dma_addr + size - 1)) - PHYS_OFFSET) & ~mask;
 	}
 
 	if (device_info && (needs_bounce || dma_needs_bounce(dev, dma_addr, size))) {
@@ -275,6 +275,7 @@ unmap_single(struct device *dev, dma_add
 {
 	struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
 	struct safe_buffer *buf = NULL;
+	unsigned long flags;
 
 	/*
 	 * Trying to unmap an invalid mapping
@@ -284,6 +285,8 @@ unmap_single(struct device *dev, dma_add
 		return;
 	}
 
+	local_irq_save(flags);
+
 	if (device_info)
 		buf = find_safe_buffer(device_info, dma_addr);
 
@@ -316,8 +319,11 @@ unmap_single(struct device *dev, dma_add
 			ptr = (unsigned long)buf->ptr;
 			dmac_clean_range(ptr, ptr + size);
 		}
+		local_irq_restore(flags);
 		free_safe_buffer(device_info, buf);
 	}
+	else
+		local_irq_restore(flags);
 }
 
 static inline void
@@ -424,18 +430,12 @@ void
 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
 			enum dma_data_direction dir)
 {
-	unsigned long flags;
-
 	dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
 		__func__, (void *) dma_addr, size, dir);
 
 	BUG_ON(dir == DMA_NONE);
 
-	local_irq_save(flags);
-
 	unmap_single(dev, dma_addr, size, dir);
-
-	local_irq_restore(flags);
 }
 
 int
@@ -471,7 +471,6 @@ void
 dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
 		enum dma_data_direction dir)
 {
-	unsigned long flags;
 	int i;
 
 	dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
@@ -479,16 +478,12 @@ dma_unmap_sg(struct device *dev, struct 
 
 	BUG_ON(dir == DMA_NONE);
 
-	local_irq_save(flags);
-
 	for (i = 0; i < nents; i++, sg++) {
 		dma_addr_t dma_addr = sg->dma_address;
 		unsigned int length = sg->length;
 
 		unmap_single(dev, dma_addr, length, dir);
 	}
-
-	local_irq_restore(flags);
 }
 
 void
@@ -632,7 +627,7 @@ #endif
 	list_add(&device_info->node, &dmabounce_devs);
 
 	printk(KERN_INFO "dmabounce: registered device %s on %s bus\n",
-		dev->bus_id, dev->bus->name);
+	       dev->bus_id, dev->bus ? dev->bus->name : "no");
 
 	return 0;
 
@@ -677,7 +672,7 @@ #endif
 	kfree(device_info);
 
 	printk(KERN_INFO "dmabounce: device %s on %s bus unregistered\n",
-		dev->bus_id, dev->bus->name);
+	       dev->bus_id, dev->bus ? dev->bus->name : "no");
 }
 
 
diff --git a/arch/arm/configs/cm_x270_defconfig b/arch/arm/configs/cm_x270_defconfig
new file mode 100644
index 0000000..f87d617
--- /dev/null
+++ b/arch/arm/configs/cm_x270_defconfig
@@ -0,0 +1,1312 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.16
+# Tue Sep 26 10:07:36 2006
+#
+CONFIG_ARM=y
+CONFIG_MMU=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_MTD_XIP=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION="-cm-x270"
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_UID16=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# System Type
+#
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_L7200 is not set
+CONFIG_ARCH_PXA=y
+# 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_OMAP is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_AT91RM9200 is not set
+
+#
+# Intel PXA2xx Implementations
+#
+# CONFIG_ARCH_LUBBOCK is not set
+# CONFIG_MACH_MAINSTONE is not set
+CONFIG_MACH_ARMCORE=y
+# CONFIG_ARCH_PXA_IDP is not set
+# CONFIG_PXA_SHARPSL is not set
+CONFIG_ARMCORE_REV12=y
+# CONFIG_ARMCORE_REV11 is not set
+CONFIG_PXA27x=y
+CONFIG_IWMMXT=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_XSCALE_PMU=y
+CONFIG_DMABOUNCE=y
+
+#
+# Bus support
+#
+CONFIG_PCI=y
+CONFIG_PCI_HOST_ITE8152=y
+# CONFIG_PCI_LEGACY_PROC is not set
+# CONFIG_PCI_DEBUG is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_LOAD_CIS is not set
+CONFIG_PCMCIA_IOCTL=y
+CONFIG_CARDBUS=y
+
+#
+# PC-card bridges
+#
+CONFIG_YENTA=m
+CONFIG_YENTA_O2=y
+CONFIG_YENTA_RICOH=y
+CONFIG_YENTA_TI=y
+CONFIG_YENTA_ENE_TUNE=y
+CONFIG_YENTA_TOSHIBA=y
+# CONFIG_PD6729 is not set
+# CONFIG_I82092 is not set
+CONFIG_PCMCIA_PXA2XX=m
+CONFIG_PCCARD_NONSTATIC=m
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE 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_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+CONFIG_LEDS_CPU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_LEGACY=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# 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_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_TUNNEL is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+# CONFIG_IPV6 is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q 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_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+# CONFIG_IEEE80211_CRYPT_TKIP is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=12000
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_ARMCORE_FLASH=y
+# CONFIG_ARMCORE_NOR is not set
+CONFIG_ARMCORE_NAND=y
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=m
+CONFIG_BLK_DEV_IDE=m
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=m
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+CONFIG_BLK_DEV_IDESCSI=m
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=m
+# CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDE_CM_X270=m
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# 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 is not set
+# 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
+
+#
+# SCSI Transport Attributes
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+# CONFIG_PCMCIA_AHA152X is not set
+# CONFIG_PCMCIA_FDOMAIN is not set
+# CONFIG_PCMCIA_NINJA_SCSI is not set
+# CONFIG_PCMCIA_QLOGIC is not set
+# CONFIG_PCMCIA_SYM53C500 is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_SMC91X is not set
+CONFIG_DM9000=y
+CONFIG_DM9000_NOEPROM=y
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_DGRS is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_PCMCIA_WAVELAN is not set
+# CONFIG_PCMCIA_NETWAVE is not set
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+# CONFIG_IPW2100 is not set
+# CONFIG_IPW2200 is not set
+# CONFIG_HERMES is not set
+# CONFIG_ATMEL is not set
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+# CONFIG_AIRO_CS is not set
+# CONFIG_PCMCIA_WL3501 is not set
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+# CONFIG_PRISM54 is not set
+# CONFIG_HOSTAP is not set
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+CONFIG_NET_PCMCIA=y
+# CONFIG_PCMCIA_3C589 is not set
+# CONFIG_PCMCIA_3C574 is not set
+# CONFIG_PCMCIA_FMVJ18X is not set
+CONFIG_PCMCIA_PCNET=m
+# CONFIG_PCMCIA_NMCLAN is not set
+# CONFIG_PCMCIA_SMC91C92 is not set
+# CONFIG_PCMCIA_XIRC2PS is not set
+# CONFIG_PCMCIA_AXNET is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# 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_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK 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 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+# CONFIG_SERIAL_8250_CONSOLE is not set
+# CONFIG_SERIAL_8250_CS is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_EMV3020_RTC=y
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+CONFIG_UCB1400=m
+CONFIG_UCB1400_TS=m
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON_OLD is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+CONFIG_FB_PXA=y
+# CONFIG_FB_PXA_PARAMETERS is not set
+CONFIG_FB_MBX=m
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+# CONFIG_SND_AD1889 is not set
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_ATIIXP_MODEM is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_EMU10K1X is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_FM801 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_YMFPCI is not set
+
+#
+# ALSA ARM devices
+#
+CONFIG_SND_PXA2XX_PCM=m
+CONFIG_SND_PXA2XX_AC97=m
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# PCMCIA devices
+#
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# 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_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_ITMTOUCH is not set
+# CONFIG_USB_EGALAX is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# 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_USB_ZD1201 is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_PXA=m
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# 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 is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# 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_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=y
+# CONFIG_SMB_NLS_DEFAULT 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
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+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 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# 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 is not set
+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 is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=17
+# CONFIG_DETECT_SOFTLOCKUP is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_DEBUG_USER=y
+# CONFIG_DEBUG_WAITQ is not set
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+CONFIG_CRYPTO_AES=m
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index c4923fa..4ff2a62 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -280,6 +280,34 @@ static void __devinit pci_fixup_cy82c693
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, pci_fixup_cy82c693);
 
+static void __init pci_fixup_it8152(struct pci_dev *dev) 
+{
+	int i;
+	if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST) {
+		for (i = 0; i < PCI_NUM_RESOURCES; i++) {
+			dev->resource[i].start = 0;
+			dev->resource[i].end   = 0;
+			dev->resource[i].flags = 0;
+		}
+	}
+	if (dev->class == 0x68000) {
+		for (i = 0; i < PCI_NUM_RESOURCES; i++) {
+			dev->resource[i].start = 0;
+			dev->resource[i].end   = 0;
+			dev->resource[i].flags = 0;
+		}
+	}
+	if (dev->class == 0x80103) {
+		for (i = 0; i < PCI_NUM_RESOURCES; i++) {
+			dev->resource[i].start = 0;
+			dev->resource[i].end   = 0;
+			dev->resource[i].flags = 0;
+		}
+	}
+}	
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_IT8152, pci_fixup_it8152);
+
+
 void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
 {
 	if (debug_pci)
@@ -293,9 +321,11 @@ void __devinit pcibios_update_irq(struct
  */
 static inline int pdev_bad_for_parity(struct pci_dev *dev)
 {
-	return (dev->vendor == PCI_VENDOR_ID_INTERG &&
-		(dev->device == PCI_DEVICE_ID_INTERG_2000 ||
-		 dev->device == PCI_DEVICE_ID_INTERG_2010));
+	return ((dev->vendor == PCI_VENDOR_ID_INTERG &&
+		 (dev->device == PCI_DEVICE_ID_INTERG_2000 ||
+		  dev->device == PCI_DEVICE_ID_INTERG_2010)) ||
+		(dev->vendor == PCI_VENDOR_ID_ITE &&
+		 dev->device == PCI_DEVICE_ID_ITE_IT8152));
 }
 
 /*
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 2b254e8..310ccf5 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -175,5 +175,5 @@ #endif
  * If you have to comment these two assert statements out, your
  * binutils is too old (for other reasons as well)
  */
-ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
-ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")
+/* ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support") */
+/* ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined") */
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index c1d77f5..0a62a62 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -15,6 +15,11 @@ config MACH_MAINSTONE
 	select PXA27x
 	select IWMMXT
 
+config MACH_ARMCORE
+	bool "CompuLab CM-X270 modules"
+	select PXA27x
+	select IWMMXT
+
 config ARCH_PXA_IDP
 	bool "Accelent Xscale IDP"
 	select PXA25x
@@ -50,6 +55,17 @@ endchoice
 
 endif
 
+if MACH_ARMCORE
+choice
+	prompt "Select CM-X270 revision"
+	config ARMCORE_REV12
+	bool "CM-X270 revision 1.2"
+	config ARMCORE_REV11
+	bool "CM-X270 revision 1.1"
+endchoice
+
+endif
+
 endmenu
 
 config MACH_POODLE
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 32526a0..d78d061 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -16,12 +16,14 @@ obj-$(CONFIG_PXA_SHARP_Cxx00)	+= spitz.o
 obj-$(CONFIG_MACH_AKITA)	+= akita-ioexp.o
 obj-$(CONFIG_MACH_POODLE)	+= poodle.o
 obj-$(CONFIG_MACH_TOSA)         += tosa.o
+obj-$(CONFIG_MACH_ARMCORE) += cm-x270.o
 
 # Support for blinky lights
 led-y := leds.o
 led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o
 led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o
 led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o
+led-$(CONFIG_MACH_ARMCORE) += leds-cm-x270.o
 
 obj-$(CONFIG_LEDS) += $(led-y)
 
@@ -32,3 +34,10 @@ obj-$(CONFIG_PXA_SSP) += ssp.o
 ifeq ($(CONFIG_PXA27x),y)
 obj-$(CONFIG_PM) += standby.o
 endif
+
+# PCI support on CM-X270
+obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
+
+ifeq ($(CONFIG_PCI),y)
+obj-$(CONFIG_MACH_ARMCORE) += cm-x270-pci.o
+endif
diff --git a/arch/arm/mach-pxa/cm-x270-pci.c b/arch/arm/mach-pxa/cm-x270-pci.c
new file mode 100644
index 0000000..73243d3
--- /dev/null
+++ b/arch/arm/mach-pxa/cm-x270-pci.c
@@ -0,0 +1,152 @@
+/*
+ * arch/arm/kernel/cm-x270-pci.c
+ *
+ * PCI bios-type initialisation for PCI machines
+ *
+ * Bits taken from various places.
+ *
+ * Copyright (C) 2006 Compulab, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+
+#include <asm/irq.h>
+#include <asm/mach/pci.h>
+#include <asm/arch/cm-x270.h>
+#include <asm/mach-types.h>
+
+#include <asm/hardware/it8152.h>
+
+unsigned long armcore_pcibios_min_mem = 0x10000000;
+unsigned long armcore_pcibios_min_io = CMX270_IT8152_VIRT + 0x03e00000 + 0x120000;
+unsigned long it8152_base_address = CMX270_IT8152_VIRT;
+
+/* these symbols needed for CardBus driver (yenta_socket) */
+EXPORT_SYMBOL(armcore_pcibios_min_io);
+EXPORT_SYMBOL(armcore_pcibios_min_mem);
+
+static u8 __init cmx270_pci_swizzle(struct pci_dev *dev, u8 *pin)
+{
+	return PCI_SLOT(dev->devfn);
+}
+
+/* Platform specific IRQ mapping */
+static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+	if((dev->vendor==0x1283) && (dev->device==0x8152) &&
+	   ((dev->class >> 8)==0x801)) return(CDMA_INT);
+	if((dev->vendor==0x1283) && (dev->device==0x0801) &&
+	   ((dev->class >> 8)==0x401)) return(AUDIO_INT);
+	if((dev->vendor==0x1283) && (dev->device==0x8152) &&
+	   ((dev->class >> 8)==0xc03)) return(USB_INT);
+
+	/* ATXBASE PCI slot */
+	if ( slot == 7 )
+		return(PCI_INTA);
+
+	/* ATXBASE/SB-X270 CardBus */
+	if ( (slot == 8) || (slot == 0) )
+		return(PCI_INTB);
+
+	/* ATXBASE ETH */
+	if ( slot == 9 )
+		return(PCI_INTA);
+
+	/* ARMCore onboard ETH */
+	if ( slot == 15 )
+		return(PCI_INTC);
+
+	/* ARMBase ETH */
+	if ( slot == 16 )
+		return(PCI_INTA);
+
+	/* PC104+ interrupt routing */
+	if ( (slot == 17) || (slot == 19) )
+		return(PCI_INTA);
+	if ( (slot == 18) || (slot == 20) )
+		return(PCI_INTB);
+   
+	return(0);
+}
+
+extern int it8152_pci_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus * it8152_pci_scan_bus(int nr, struct pci_sys_data *sys);
+
+static struct pci_bus* __init cmx270_pci_scan_bus(int nr, struct pci_sys_data *sys)
+{
+	IT8152_PCI_CFG_ADDR	= 0x800;
+	if(IT8152_PCI_CFG_DATA == 0x81521283) {
+		printk("PCI Bridge found.\n");
+
+		IT8152_GPIO_GPLR=0x20;
+
+/***********	CardBus Controller on ATXBASE configuration	********/		
+		IT8152_PCI_CFG_ADDR	= 0x4000;
+		if(IT8152_PCI_CFG_DATA == 0xAC51104C) {
+			unsigned int temp;
+			printk("CardBus Bridge found.\n");
+
+			// Configure socket 0
+			IT8152_PCI_CFG_ADDR	= 0x408C;
+			IT8152_PCI_CFG_DATA = 0x1022;
+
+			IT8152_PCI_CFG_ADDR	= 0x4080;
+			IT8152_PCI_CFG_DATA = 0x3844d060;
+
+			IT8152_PCI_CFG_ADDR	= 0x4090;
+			temp = IT8152_PCI_CFG_DATA;
+			temp = temp & 0xFFFF;
+			temp = temp | (0x60440000);
+			IT8152_PCI_CFG_ADDR	= 0x4090;
+			IT8152_PCI_CFG_DATA = temp;
+
+			IT8152_PCI_CFG_ADDR	= 0x4018;
+			IT8152_PCI_CFG_DATA = 0xb0000000;
+
+			// Configure socket 1
+			IT8152_PCI_CFG_ADDR	= 0x418C;
+			IT8152_PCI_CFG_DATA = 0x1022;
+
+			IT8152_PCI_CFG_ADDR	= 0x4180;
+			IT8152_PCI_CFG_DATA = 0x3844d060;
+
+			IT8152_PCI_CFG_ADDR	= 0x4190;
+			temp = IT8152_PCI_CFG_DATA;
+			temp = temp & 0xFFFF;
+			temp = temp | (0x60440000);
+			IT8152_PCI_CFG_ADDR	= 0x4190;
+			IT8152_PCI_CFG_DATA = temp;
+
+			IT8152_PCI_CFG_ADDR	= 0x4118;
+			IT8152_PCI_CFG_DATA = 0xb0000000;  
+ 		}
+/***********	End of CardBus controller configuration	**************/
+	}
+	return it8152_pci_scan_bus(nr, sys);
+}
+
+static struct hw_pci cmx270_pci __initdata = {
+	.swizzle		= cmx270_pci_swizzle,
+	.map_irq		= cmx270_pci_map_irq,
+	.nr_controllers		= 1,
+	.setup			= it8152_pci_setup,
+	.scan			= cmx270_pci_scan_bus,
+};
+
+static int __init cmx270_init_pci(void)
+{
+	if (machine_is_armcore()) {
+		pci_common_init(&cmx270_pci);
+	}
+	return 0;
+}
+
+subsys_initcall(cmx270_init_pci);
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
new file mode 100644
index 0000000..b006a8f
--- /dev/null
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -0,0 +1,975 @@
+/*
+ * linux/arch/arm/mach-pxa/cm-x270.c
+ *
+ * Copyright (C) 2006 CompuLab, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/pm.h>
+#include <linux/fb.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+#include <linux/dm9000.h>
+#include <linux/serial_8250.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/delay.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/irq.h>
+#include <asm/arch/pxafb.h>
+#include <asm/arch/marathonfb.h>
+#include <asm/arch/ohci.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/pxafbsetup.h>
+#include <asm/arch/bitfield.h>
+#include <asm/arch/cm-x270.h>
+
+#include <asm/hardware/it8152.h>
+
+#include "generic.h"
+
+#define RTC_PHYS_BASE		(PXA_CS1_PHYS + (5 << 22))
+#define DM9000_PHYS_BASE	(PXA_CS1_PHYS + (6 << 22))
+
+static struct resource cmx270_dm9k_resource[] = {
+	[0] = {
+		.start = DM9000_PHYS_BASE,
+		.end   = DM9000_PHYS_BASE + 4,
+		.flags = IORESOURCE_MEM,
+	},
+	[1] = {
+		.start = DM9000_PHYS_BASE + 8,
+		.end   = DM9000_PHYS_BASE + 8 + 500,
+		.flags = IORESOURCE_MEM,
+	},
+	[2] = {
+		.start = CMX270_ETHIRQ,
+		.end   = CMX270_ETHIRQ,
+		.flags = IORESOURCE_IRQ,
+	}
+};
+
+/* for the moment we limit ourselves to 32bit IO until some
+ * better IO routines can be written and tested
+ */
+static struct dm9000_plat_data cmx270_dm9k_platdata = {
+	.flags		= DM9000_PLATF_32BITONLY,
+};
+
+/* Ethernet device */
+static struct platform_device cmx270_device_dm9k = {
+	.name		= "dm9000",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(cmx270_dm9k_resource),
+	.resource	= cmx270_dm9k_resource,
+	.dev		= {
+		.platform_data = &cmx270_dm9k_platdata,
+	}
+};
+
+/* audio device */
+static struct platform_device cmx270_audio_device = {
+	.name		= "pxa2xx-ac97",
+	.id		= -1,
+};
+
+/* touchscreen controller */
+static struct platform_device cmx270_ts_device = {
+	.name		= "ucb1x00",
+	.id		= -1,
+};
+
+/* RTC */
+static struct resource cmx270_v3020_resource[] = {
+	[0] = {
+		.start = RTC_PHYS_BASE,
+		.end   = RTC_PHYS_BASE + 4,
+		.flags = IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device cmx270_rtc_device = {
+	.name		= "emv3020-rtc",
+	.num_resources	= ARRAY_SIZE(cmx270_v3020_resource),
+	.resource	= cmx270_v3020_resource,
+	.id		= -1,
+};
+
+/* UART on the ITE8152 chip */
+#ifdef CONFIG_PCI
+static struct plat_serial8250_port ite_uart_port[] = {
+	{
+		.irq		= IRQ_ITESER,		/* interrupt number */
+		.uartclk	= 115200 * 16,	/* UART clock rate */
+		.iotype		= UPIO_MEM,		/* UPIO_* */
+		.flags		= UPF_BOOT_AUTOCONF,
+	},
+	{}
+};
+
+static struct platform_device iteuart_device = {
+	.name		= "serial8250",
+	.id		= PLAT8250_DEV_PLATFORM,
+	.dev			= {
+		.platform_data	= ite_uart_port,
+	},
+};
+#endif
+
+/* 2700G graphics */
+static u64 fb_dma_mask = ~(u64)0;
+
+static struct resource cmx270_2700G_resource[] = {
+	/* frame buffer memory including ODFB and External SDRAM */
+	[0] = {
+		.start = MARATHON_PHYS,
+		.end   = MARATHON_PHYS + 0x02000000,
+		.flags = IORESOURCE_MEM,
+	},
+	/* Marathon registers */
+	[1] = {
+		.start = MARATHON_PHYS + 0x03fe0000,
+		.end   = MARATHON_PHYS + 0x03ffffff,
+		.flags = IORESOURCE_MEM,
+	},
+};
+
+static unsigned long save_lcd_regs[10];
+
+#define LB_TROTTLE_OFF (PXA_CS1_PHYS | (1 << 25))
+#define LB_TROTTLE_MAX (PXA_CS1_PHYS | (1 << 25) | (1 << 22))
+static int cmx270_marathon_probe(struct fb_info *fb)
+{
+	volatile unsigned long *cpld;
+	
+	cpld = (volatile unsigned long*)ioremap(LB_TROTTLE_OFF, 4);
+	
+	if ( !cpld ) {
+		return -ENODEV;
+	}
+	*cpld = 0;
+	iounmap((void*)cpld);
+	
+
+	/* save PXA-270 pin settings before enabling 2700G */
+	save_lcd_regs[0] = GPDR1;
+	save_lcd_regs[1] = GPDR2;
+	save_lcd_regs[2] = GAFR1_U;
+	save_lcd_regs[3] = GAFR2_L;
+	save_lcd_regs[4] = GAFR2_U;
+
+	/* Disable PXA-270 on-chip controller driving pins */
+	GPDR1 &= ~(0xfc000000);
+	GPDR2 &= ~(0x00c03fff);
+	GAFR1_U &= ~(0xfff00000);
+	GAFR2_L &= ~(0x0fffffff);
+	GAFR2_U &= ~(0x0000f000);
+	return 0;
+}
+
+static int cmx270_marathon_remove(struct fb_info *fb)
+{
+	volatile unsigned long *cpld;
+	
+	cpld = (volatile unsigned long*)ioremap(LB_TROTTLE_MAX, 4);
+	
+	if ( !cpld ) {
+		return -ENODEV;
+	}
+	*cpld = 0;
+	iounmap((void*)cpld);
+
+	GPDR1 =   save_lcd_regs[0];
+	GPDR2 =   save_lcd_regs[1];
+	GAFR1_U = save_lcd_regs[2];
+	GAFR2_L = save_lcd_regs[3];
+	GAFR2_U = save_lcd_regs[4];
+	return 0;
+}
+
+static struct mbxfb_platform_data cmx270_2700G_data = {
+	.xres = {
+		.min = 240,
+		.max = 1200,
+		.defval = 640,
+	},
+	.yres = { 
+		.min = 240,
+		.max = 1200,
+		.defval = 480,
+	},
+	.bpp = {
+		.min = 16,
+		.max = 32,
+		.defval = 16,
+	},
+	.memsize = 8*1024*1024,
+	.probe = cmx270_marathon_probe,
+	.remove = cmx270_marathon_remove,
+};
+
+static struct platform_device cmx270_2700G = {
+	.name		= "mbx-fb",
+	.dev		= {
+ 		.platform_data	= &cmx270_2700G_data,
+		.dma_mask	= &fb_dma_mask,
+		.coherent_dma_mask = 0xffffffff,
+	},
+	.num_resources	= ARRAY_SIZE(cmx270_2700G_resource),
+	.resource	= cmx270_2700G_resource,
+	.id		= -1,
+};
+
+/* platform devices */
+static struct platform_device *platform_devices[] __initdata = {
+	&cmx270_device_dm9k,
+	&cmx270_audio_device,
+	&cmx270_ts_device,
+	&cmx270_rtc_device,
+	&cmx270_2700G,
+#ifdef CONFIG_PCI
+	&iteuart_device,
+#endif
+};
+
+#ifdef CONFIG_PCI
+/*
+ * Install handler for IT8152 IRQ.  Yes, yes... we are way down the IRQ
+ * cascade which is not good for IRQ latency, but the hardware has been
+ * designed that way...
+ */
+static inline void cmx270_irq(int irq, struct pt_regs *regs)
+{
+	struct irqdesc *desc;
+	desc = irq_desc + irq;
+	desc->handle(irq, desc, regs);
+}
+
+static void cmx270_irq_demux(unsigned int irq, struct irqdesc *desc,
+			     struct pt_regs *regs)
+{
+	unsigned long pdcnimr, ldcnimr;
+ 	int pdcnirr, ldcnir;
+
+	/* clear our parent irq */
+	GEDR(GPIO_IT8152_IRQ) = GPIO_bit(GPIO_IT8152_IRQ);
+
+	/* read pending IRQs in the chip registers and clear them */
+	pdcnirr = IT8152_INTC_PDCNIRR;
+	ldcnir = IT8152_INTC_LDCNIRR;
+	IT8152_INTC_PDCNIRR = ~pdcnirr;
+	IT8152_INTC_LDCNIRR = ~ldcnir;
+
+	/* mask ITE irqs */
+	pdcnimr = IT8152_INTC_PDCNIMR;
+	ldcnimr = IT8152_INTC_LDCNIMR;
+	IT8152_INTC_PDCNIMR = 0xffff;
+	IT8152_INTC_LDCNIMR = 0xffff;
+ 
+	pdcnirr &= (PCISERR_BIT | H2PTADR_BIT | H2PMAR_BIT |
+		    PCI_INTD_BIT | PCI_INTC_BIT | PCI_INTB_BIT | PCI_INTA_BIT |
+		    USB_INT_BIT | CDMA_INT_BIT);
+		
+	ldcnir &= ITESER_BIT;
+
+	IT8152_INTC_PDCNIRR = ~pdcnirr;
+	IT8152_INTC_LDCNIRR = ~ldcnir;
+
+	/* are there interrupts pending ? */
+	if( (pdcnirr | ldcnir) ) {
+		if (pdcnirr) {
+			if( pdcnirr & PCISERR_BIT )
+				cmx270_irq(PCISERR, regs);
+			if( pdcnirr & H2PTADR_BIT )
+				cmx270_irq(H2PTADR, regs);
+			if( pdcnirr & H2PMAR_BIT )
+				cmx270_irq(H2PMAR, regs);
+			if( pdcnirr & PCI_INTA_BIT )
+				cmx270_irq(PCI_INTA, regs);
+			if( pdcnirr & PCI_INTB_BIT )
+				cmx270_irq(PCI_INTB, regs);
+			if( pdcnirr & PCI_INTC_BIT )
+				cmx270_irq(PCI_INTC, regs);
+			if( pdcnirr & PCI_INTD_BIT )
+				cmx270_irq(PCI_INTD, regs);
+			if( pdcnirr & USB_INT_BIT )
+				cmx270_irq(USB_INT, regs);
+			if( pdcnirr & CDMA_INT_BIT )
+				cmx270_irq(CDMA_INT, regs);
+		}
+		if(ldcnir) {
+			if( ldcnir & ITESER_BIT )
+				cmx270_irq(IRQ_ITESER, regs);
+		}
+	}
+
+	/* re-enable ITE interrupts */
+	IT8152_INTC_PDCNIMR = pdcnimr;
+	IT8152_INTC_LDCNIMR = ldcnimr;
+}
+#else
+unsigned long it8152_base_address = CMX270_IT8152_VIRT;
+#endif
+
+#define CMX270_FLASH_VIRT (CMX270_IDE104_VIRT + PXA_CS_SIZE - (8<<20))
+/* Map PCI companion and IDE/General Purpose CS statically */
+static struct map_desc cmx270_io_desc[] __initdata = {
+	[0] = { /* IDE/general purpose space */
+		.virtual	= CMX270_IDE104_VIRT,
+		.pfn		= __phys_to_pfn(CMX270_IDE104_PHYS),
+		.length		= PXA_CS_SIZE - (8<<20),
+		.type		= MT_DEVICE
+	},
+	[1] = { /* NOR flash */
+		.virtual	= CMX270_FLASH_VIRT,
+		.pfn		= __phys_to_pfn(PXA_CS0_PHYS),
+		.length		= (8<<20), /* up to 8 MByte flash */
+		.type		= MT_DEVICE
+	},
+	[2] = { /* PCI bridge */
+		.virtual	= CMX270_IT8152_VIRT,
+		.pfn		= __phys_to_pfn(CMX270_IT8152_PHYS),
+		.length		= PXA_CS_SIZE,
+		.type		= MT_DEVICE
+	},
+};
+
+/*********************** Display definitions ****************************/
+static int mtype=MTYPE_CRT640x480;
+static int mbpp=-1;
+
+struct cmx270_display_info {
+	struct pxafb_mach_info fb_info;
+	char *display_name;
+};
+
+static struct __initdata cmx270_display_info cmx270_displays[] = {
+	[ MTYPE_STN320x240 ] = {
+		.fb_info = {
+			.pixclock	= 76923,
+			.bpp		= 8,
+			.xres		= 320,
+			.yres		= 240,
+			.hsync_len	= 3,
+			.vsync_len	= 2,
+			.left_margin	= 3,
+			.upper_margin	= 0,
+			.right_margin	= 3,
+			.lower_margin	= 0,
+			.sync		= (FB_SYNC_HOR_HIGH_ACT |
+					   FB_SYNC_VERT_HIGH_ACT),
+			.lccr0		= 0,
+			.lccr3		= (LCCR3_PixClkDiv(0x03) |
+					   LCCR3_Acb(0xff) |
+					   LCCR3_PCP),
+			.cmap_greyscale  = 0,
+			.cmap_inverse	 = 0,
+			.cmap_static	 = 0,
+		},
+		.display_name	 = "STN 320x240",
+	},
+	[ MTYPE_TFT640x480 ] = {
+		.fb_info = {
+			.pixclock	= 38461,
+			.bpp		= 8,
+			.xres		= 640,
+			.yres		= 480,
+			.hsync_len	= 60,
+			.vsync_len	= 2,
+			.left_margin	= 70,
+			.upper_margin	= 10,
+			.right_margin	= 70,
+			.lower_margin	= 5,
+			.sync		= 0,
+			.lccr0		= (LCCR0_PAS),
+			.lccr3		= (LCCR3_PixClkDiv(0x01) |
+					   LCCR3_Acb(0xff) |
+					   LCCR3_PCP),
+			.cmap_greyscale  	= 0,
+			.cmap_inverse	 	= 0,
+			.cmap_static	 	= 0,
+		},
+		.display_name		= "TFT 640x480",
+	},
+	[ MTYPE_CRT640x480 ] = {
+		.fb_info = {
+			.pixclock	= 38461,
+			.bpp		= 8,
+			.xres		= 640,
+			.yres		= 480,
+			.hsync_len	= 63,
+			.vsync_len	= 2,
+			.left_margin	= 81,
+			.upper_margin	= 33,
+			.right_margin	= 16,
+			.lower_margin	= 10,
+			.sync		= (FB_SYNC_HOR_HIGH_ACT |
+					   FB_SYNC_VERT_HIGH_ACT),
+			.lccr0		= (LCCR0_PAS),
+			.lccr3		= (LCCR3_PixClkDiv(0x01) |
+					   LCCR3_Acb(0xff)),
+			.cmap_greyscale  = 0,
+			.cmap_inverse	 = 0,
+			.cmap_static	 = 0,
+		},
+		.display_name	 = "CRT 640x480",
+	},
+	[ MTYPE_CRT800x600 ] = {
+		.fb_info = {
+			.pixclock	= 28846,
+			.bpp		= 8,
+			.xres		= 800,
+			.yres	  	= 600,
+			.hsync_len	= 63,
+			.vsync_len	= 2,
+			.left_margin	= 26,
+			.upper_margin	= 21,
+			.right_margin	= 26,
+			.lower_margin	= 11,
+			.sync		= (FB_SYNC_HOR_HIGH_ACT |
+					   FB_SYNC_VERT_HIGH_ACT),
+			.lccr0		= (LCCR0_PAS),
+			.lccr3		= (LCCR3_PixClkDiv(0x02) |
+					   LCCR3_Acb(0xff)),
+			.cmap_greyscale = 0,
+			.cmap_inverse	= 0,
+			.cmap_static	= 0,
+		},
+		.display_name	= "CRT 800x600",
+	},
+	[ MTYPE_CRT1024x768 ] = {
+		.fb_info = {
+			.pixclock = 0,
+			.xres = 0,
+			.yres = 0,
+		},
+		.display_name	= "CRT 1024x768",
+	},
+	[ MTYPE_USER_DEFINED ] = {
+		.fb_info = {
+			.pixclock	= LCD_PIXCLOCK,
+			.bpp		= LCD_BPP,
+			.xres		= LCD_XRES,
+			.yres		= LCD_YRES,
+			.hsync_len	= LCD_HORIZONTAL_SYNC_PULSE_WIDTH,
+			.vsync_len	= LCD_VERTICAL_SYNC_PULSE_WIDTH,
+			.left_margin	= LCD_BEGIN_OF_LINE_WAIT_COUNT,
+			.upper_margin	= LCD_BEGIN_FRAME_WAIT_COUNT,
+			.right_margin	= LCD_END_OF_LINE_WAIT_COUNT,
+			.lower_margin	= LCD_END_OF_FRAME_WAIT_COUNT,
+			.sync		= LCD_SYNC,
+			.lccr0		= LCD_LCCR0,
+			.lccr3		= LCD_LCCR3,
+			.cmap_greyscale = CMAP_GREYSCALE,
+			.cmap_inverse	= CMAP_INVERSE,
+			.cmap_static  	= CMAP_STATIC,
+		},
+		.display_name	= LCD_NAME,
+	},
+	[ MTYPE_TFT320x240 ] = {
+		.fb_info = {
+			.pixclock	= 134615,
+			.bpp		= 16,
+			.xres		= 320,
+			.yres		= 240,
+			.hsync_len	= 63,
+			.vsync_len	= 7,
+			.left_margin	= 75,
+			.upper_margin	= 0,
+			.right_margin	= 15,
+			.lower_margin	= 15,
+			.sync		= 0,
+			.lccr0		= (LCCR0_PAS),
+			.lccr3		= (LCCR3_PixClkDiv(0x06) |
+					   LCCR3_Acb(0xff) |
+					   LCCR3_PCP),
+			.cmap_greyscale  = 0,
+			.cmap_inverse	 = 0,
+			.cmap_static	 = 0,
+		},
+		.display_name	= "TFT 320x240",
+	},
+	[ MTYPE_STN640x480 ] = {
+		.fb_info = {
+			.pixclock	= 57692,
+			.bpp		= 8,
+			.xres		= 640,
+			.yres		= 480,
+			.hsync_len	= 4,
+			.vsync_len	= 2,
+			.left_margin	= 10,
+			.upper_margin	= 5,
+			.right_margin	= 10,
+			.lower_margin	= 5,
+			.sync		= (FB_SYNC_HOR_HIGH_ACT |
+					   FB_SYNC_VERT_HIGH_ACT),
+			.lccr0		= 0,
+			.lccr3		= (LCCR3_PixClkDiv(0x02) |
+					   LCCR3_Acb(0xff)),
+			.cmap_greyscale  = 0,
+			.cmap_inverse	 = 0,
+			.cmap_static	 = 0,
+		},
+		.display_name	= "STN 640x480",
+	},
+};
+
+static int __init monitor_params(char *str)
+{
+	mtype = simple_strtol(str, NULL, 0);
+	return 1;
+}
+
+__setup("monitor=", monitor_params);
+
+static int __init fb_bpp(char *str)
+{
+	mbpp = simple_strtol(str, NULL, 0);
+	return 1;
+}
+
+__setup("bpp=", fb_bpp);
+
+/* PXA27x OHCI controller setup */
+static int cmx270_ohci_init(struct device *dev)
+{
+	/* Set the Power Control Polarity Low */
+	UHCHR = (UHCHR | UHCHR_PCPL) &
+		~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE);
+
+	return 0;
+}
+
+static struct pxaohci_platform_data cmx270_ohci_platform_data = {
+	.port_mode	= PMM_PERPORT_MODE,
+	.init		= cmx270_ohci_init,
+};
+
+
+static int cmx270_mci_init(struct device *dev, irqreturn_t (*mstone_detect_int)(int, void *, struct pt_regs *), void *data)
+{
+	int err;
+
+	/*
+	 * setup GPIO for PXA27x MMC controller
+	 */
+	pxa_gpio_mode(GPIO32_MMCCLK_MD);
+	pxa_gpio_mode(GPIO112_MMCCMD_MD);
+	pxa_gpio_mode(GPIO92_MMCDAT0_MD);
+	pxa_gpio_mode(GPIO109_MMCDAT1_MD);
+	pxa_gpio_mode(GPIO110_MMCDAT2_MD);
+	pxa_gpio_mode(GPIO111_MMCDAT3_MD);
+
+	/* SB-X270 uses GPIO105 as SD power enable */
+	pxa_gpio_mode(105 | GPIO_OUT);
+
+	/* card detect IRQ on GPIO 83 */
+	pxa_gpio_mode(IRQ_TO_GPIO(CMX270_MMC_IRQ));
+	set_irq_type(CMX270_MMC_IRQ, IRQT_FALLING);
+
+	err = request_irq(CMX270_MMC_IRQ, mstone_detect_int, SA_INTERRUPT,
+			     "MMC card detect", data);
+	if (err) {
+		printk(KERN_ERR "cmx270_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+static void cmx270_mci_setpower(struct device *dev, unsigned int vdd)
+{
+	struct pxamci_platform_data* p_d = dev->platform_data;
+
+	if (( 1 << vdd) & p_d->ocr_mask) {
+		printk(KERN_DEBUG "%s: on\n", __FUNCTION__);
+		GPCR(105) = GPIO_bit(105);
+	} else {
+		GPSR(105) = GPIO_bit(105);
+		printk(KERN_DEBUG "%s: off\n", __FUNCTION__);
+	}
+}
+
+static void cmx270_mci_exit(struct device *dev, void *data)
+{
+	free_irq(CMX270_MMC_IRQ, data);
+}
+
+static struct pxamci_platform_data cmx270_mci_platform_data = {
+	.ocr_mask	= MMC_VDD_32_33|MMC_VDD_33_34,
+	.init 		= cmx270_mci_init,
+	.setpower 	= cmx270_mci_setpower,
+	.exit		= cmx270_mci_exit,
+};
+
+
+#ifdef CONFIG_PM
+/* timeout for RTC wakeup */
+unsigned int cmx270_suspend_timeout;
+
+static ssize_t timeout_show(struct subsystem * subsys, char * buf)
+{
+	char * s = buf;
+
+	s += sprintf(s,"%d seconds\n", cmx270_suspend_timeout);
+	return (s - buf);
+}
+
+static ssize_t timeout_store(struct subsystem * subsys, const char * buf, size_t n)
+{
+	char *endp = 0;
+	int timeout;
+
+	timeout = simple_strtoul(buf, &endp, 10);
+	if ( *endp && *endp != '\n')
+		return -EINVAL;
+
+	cmx270_suspend_timeout = timeout;
+	return n;
+}
+
+static struct subsys_attribute timeout_attr = {
+	.attr	= {
+		.name = __stringify(timeout),
+		.mode = 0644,
+	},
+	.show	= timeout_show,
+	.store	= timeout_store,
+};
+
+static struct attribute * g[] = {
+	&timeout_attr.attr,
+	NULL,
+};
+
+static struct attribute_group attr_group = {
+	.attrs = g,
+};
+
+extern struct subsystem power_subsys;
+static unsigned long sleep_save_ite[10];
+static unsigned long sleep_save_msc[10];
+
+static int cmx270_suspend(struct sys_device *dev, pm_message_t state)
+{
+#ifdef CONFIG_PCI
+	/* save ITE state */
+	sleep_save_ite[0] = IT8152_INTC_PDCNIMR;
+	sleep_save_ite[1] = IT8152_INTC_LPCNIMR;
+	sleep_save_ite[2] = IT8152_INTC_LPNIAR;
+
+	/* Clear ITE IRQ's */
+	IT8152_INTC_PDCNIRR = 0;
+	IT8152_INTC_LPCNIRR = 0;
+#endif
+
+	/* save MSC registers */
+	sleep_save_msc[0] = MSC0;
+	sleep_save_msc[1] = MSC1;
+	sleep_save_msc[2] = MSC2;
+
+	/* setup power saving mode registers */
+	PCFR = 0x0;
+	PSLR = 0xff400000;
+	PMCR  = 0x00000005;
+	PWER  = 0x80000000;
+	PFER  = 0x00000000;
+	PRER  = 0x00000000;
+	PGSR0 = 0xC0018800;
+	PGSR1 = 0x004F0002;
+	PGSR2 = 0x6021C000;
+	PGSR3 = 0x00020000;
+
+	if ( cmx270_suspend_timeout ) {
+		RTAR = RCNR + cmx270_suspend_timeout;
+		cmx270_suspend_timeout = 0;
+	}
+
+	return 0;
+}
+
+static int cmx270_resume(struct sys_device *dev)
+{
+#ifdef CONFIG_PCI
+	/* restore IT8152 state */
+	IT8152_INTC_PDCNIMR = sleep_save_ite[0];
+	IT8152_INTC_LPCNIMR = sleep_save_ite[1];
+	IT8152_INTC_LPNIAR = sleep_save_ite[2];
+#endif
+
+	/* restore MSC registers */
+	MSC0 = sleep_save_msc[0];
+	MSC1 = sleep_save_msc[1];
+	MSC2 = sleep_save_msc[2];
+
+	return 0;
+}
+
+static struct sysdev_class cmx270_pm_sysclass = {
+	set_kset_name("pm"),
+	.resume = cmx270_resume,
+	.suspend = cmx270_suspend,
+};
+
+static struct sys_device cmx270_pm_device = {
+	.cls = &cmx270_pm_sysclass,
+};
+
+static int __init cmx270_pm_init(void)
+{
+	int error;
+	error = sysdev_class_register(&cmx270_pm_sysclass);
+	if (error == 0)
+		error = sysdev_register(&cmx270_pm_device);
+
+	error = sysfs_create_group(&power_subsys.kset.kobj,&attr_group);
+	return error;
+}
+#else
+static int __init cmx270_pm_init(void) { return 0; }
+#endif
+
+/* SA1111 compatibiliy 8 bit read register needed for proper function
+   of ITE8152 UART */
+#define MEMC_SA1111	__REG(0x48000064)  
+
+static void __init cmx270_init(void)
+{
+	/* set display timings for VGA 640x480 by default */
+	struct cmx270_display_info *tfbi = &cmx270_displays[2];
+
+	MEMC_SA1111 = 0x3c;
+
+	cmx270_pm_init();
+	
+	if ( mtype >= 0 && mtype < ARRAY_SIZE(cmx270_displays) )
+		tfbi = &cmx270_displays[mtype];
+
+	/* use default instead of unsupported displays */
+	if ( tfbi->fb_info.pixclock == 0 &&
+	     tfbi->fb_info.xres == 0 &&
+	     tfbi->fb_info.yres == 0 ) {
+		printk(KERN_WARNING "CM-X270 does not support %s display\n", cmx270_displays[mtype].display_name);
+		tfbi = &cmx270_displays[2];
+	}
+	     
+	/* setup color depth */
+	if( mtype == MTYPE_USER_DEFINED ) {
+		mbpp = tfbi->fb_info.bpp;
+	}
+	if( mbpp > 0 ) {
+		if( (mbpp!=1) && (mbpp!=2) && (mbpp!=4) &&
+		    (mbpp!=8) && (mbpp!=16)) {
+			printk(KERN_WARNING "Illegal BPP value "
+			       "supplied, leaving default\n");
+			mbpp = 8;
+		}
+	} 
+	else mbpp = 8;
+	tfbi->fb_info.bpp = mbpp;
+	     
+	printk(KERN_INFO "Running a %s display with %d bits per pixel\n",
+	       tfbi->display_name, tfbi->fb_info.bpp);
+	set_pxa_fb_info(&tfbi->fb_info);
+	     
+#ifdef CONFIG_PCI
+	/* setup ITE8152 UART base addresses */
+	ite_uart_port[0].membase = (void *)&IT8152_UART_BASE;
+	ite_uart_port[0].mapbase = IT8152_UART_BASE;
+#endif
+
+	/* register CM-X270 platform devices */
+	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+
+	/* set MCI and OHCI platform parameters */
+	pxa_set_mci_info(&cmx270_mci_platform_data);
+	pxa_set_ohci_info(&cmx270_ohci_platform_data);
+
+	/* This enables the STUART */
+	pxa_gpio_mode(GPIO46_STRXD_MD);
+	pxa_gpio_mode(GPIO47_STTXD_MD);
+
+	/* This enables the BTUART  */ 
+	pxa_gpio_mode(GPIO42_BTRXD_MD);
+	pxa_gpio_mode(GPIO43_BTTXD_MD);
+	pxa_gpio_mode(GPIO44_BTCTS_MD);
+	pxa_gpio_mode(GPIO45_BTRTS_MD);
+}
+
+int machine_is_cmx270l(void)
+{
+	int is_l = 0;
+	volatile unsigned char *flash =
+		(volatile unsigned char *)(CMX270_FLASH_VIRT + 0x3ffe8UL);
+	char rev[10];
+	int i;
+
+	memset(rev, 0, 10);
+	for ( i = 0; i < 8; i++ )
+		rev[i] = flash[i];
+	if ( (rev[6] - '0') > 1 )
+		is_l = 1;
+
+	printk(KERN_DEBUG "%s: revision read: %s, is_l = %d\n",
+	       __FUNCTION__, rev, is_l);
+
+	return is_l;
+}
+
+#ifdef CONFIG_PCI
+static void cmx270_mask_irq(unsigned int irq)
+{
+	switch(irq) {
+		case IT8152_IRQ(0):
+			IT8152_INTC_PDCNIMR |= PCISERR_BIT;
+			break;
+		case IT8152_IRQ(1):
+			IT8152_INTC_PDCNIMR |= H2PTADR_BIT;
+			break;
+		case IT8152_IRQ(2):
+			IT8152_INTC_PDCNIMR |= H2PMAR_BIT;
+			break;
+		case IT8152_IRQ(3):
+			IT8152_INTC_PDCNIMR |= PCI_INTA_BIT;
+			break;
+		case IT8152_IRQ(4):
+			IT8152_INTC_PDCNIMR |= PCI_INTB_BIT;
+			break;
+		case IT8152_IRQ(5):
+			IT8152_INTC_PDCNIMR |= PCI_INTC_BIT;
+			break;
+		case IT8152_IRQ(6):
+			IT8152_INTC_PDCNIMR |= PCI_INTD_BIT;
+			break;
+		case IT8152_IRQ(7):
+			IT8152_INTC_PDCNIMR |= USB_INT_BIT;
+			break;
+		case IT8152_IRQ(9):
+			IT8152_INTC_PDCNIMR |= CDMA_INT_BIT;
+			break;
+		case IT8152_IRQ(10):
+			IT8152_INTC_LDCNIMR |= ITESER_BIT;
+			break;
+	}
+}
+
+static void cmx270_unmask_irq(unsigned int irq)
+{
+	switch(irq) {
+		case IT8152_IRQ(0):
+			IT8152_INTC_PDCNIMR &= (~PCISERR_BIT);
+			break;
+		case IT8152_IRQ(1):
+			IT8152_INTC_PDCNIMR &= (~H2PTADR_BIT);
+			break;
+		case IT8152_IRQ(2):
+			IT8152_INTC_PDCNIMR &= (~H2PMAR_BIT);
+			break;
+		case IT8152_IRQ(3):
+			IT8152_INTC_PDCNIMR &= (~PCI_INTA_BIT);
+			break;
+		case IT8152_IRQ(4):
+			IT8152_INTC_PDCNIMR &= (~PCI_INTB_BIT);
+			break;
+		case IT8152_IRQ(5):
+			IT8152_INTC_PDCNIMR &= (~PCI_INTC_BIT);
+			break;
+		case IT8152_IRQ(6):
+			IT8152_INTC_PDCNIMR &= (~PCI_INTD_BIT);
+			break;
+		case IT8152_IRQ(7):
+			IT8152_INTC_PDCNIMR &= (~USB_INT_BIT);
+			break;
+		case IT8152_IRQ(9):
+			IT8152_INTC_PDCNIMR &= (~CDMA_INT_BIT);
+			break;
+		case IT8152_IRQ(10):
+			IT8152_INTC_LDCNIMR &= (~ITESER_BIT);
+			break;
+	}
+}
+
+static struct irqchip cmx270_irq_chip = {
+	.ack		= cmx270_mask_irq,
+	.mask		= cmx270_mask_irq,
+	.unmask		= cmx270_unmask_irq,
+};
+#endif
+
+static void __init cmx270_init_irq(void)
+{
+	int irq;
+
+	pxa_init_irq();
+
+	/* LED and NAND GPIOs should not be probed for IRQ */
+	irq_desc[IRQ_GPIO(11)].probe_ok = 0;
+	irq_desc[IRQ_GPIO(89)].probe_ok = 0;
+	irq_desc[IRQ_GPIO(93)].probe_ok = 0;
+	irq_desc[IRQ_GPIO(94)].probe_ok = 0;
+
+	IT8152_INTC_PDCNIMR = 0xffff;
+
+#ifdef CONFIG_PCI
+	/* Disable and clear IRQ's for ITE8152 */
+	IT8152_INTC_PDCNIMR = 0xffff;
+	IT8152_INTC_PDCNIRR = 0;
+	IT8152_INTC_LPCNIMR = 0xffff;
+	IT8152_INTC_LPCNIRR = 0;
+	IT8152_INTC_LDCNIMR = 0xffff;
+	IT8152_INTC_LDCNIRR = 0;
+
+	/* Set IT8152 serial port IRQ as active high*/
+	IT8152_INTC_LDNIAR |= ITESER_BIT;
+
+	for(irq = IT8152_IRQ(0); irq <= IT8152_IRQ_MAX; irq++) {
+		set_irq_chip(irq, &cmx270_irq_chip);
+		set_irq_handler(irq, do_level_IRQ);
+		set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+	}
+
+	/* INTC signal from IT8152 is connected to GPIO0 */
+	pxa_gpio_mode(IRQ_GPIO_IT8152_IRQ);
+	set_irq_chained_handler(IRQ_GPIO_IT8152_IRQ, cmx270_irq_demux);
+	set_irq_type(IRQ_GPIO_IT8152_IRQ, IRQT_RISING);
+#endif
+
+	/* Setup interrupt for dm9000 */
+	pxa_gpio_mode(IRQ_TO_GPIO(CMX270_ETHIRQ));
+	set_irq_type(CMX270_ETHIRQ, IRQT_RISING);
+
+	/* Setup interrupt for 2700G */
+	pxa_gpio_mode(IRQ_TO_GPIO(CMX270_GFXIRQ));
+	set_irq_type(CMX270_GFXIRQ, IRQT_FALLING);
+}
+
+static void __init cmx270_map_io(void)
+{
+	pxa_map_io();
+	iotable_init(cmx270_io_desc, ARRAY_SIZE(cmx270_io_desc));
+}
+
+
+MACHINE_START(ARMCORE, "Compulab CM-x270")
+	.boot_params	= 0xa0000100,
+	.phys_io	= 0x40000000,
+	.io_pg_offst	= (io_p2v(0x40000000) >> 18) & 0xfffc,
+	.map_io		= cmx270_map_io,
+	.init_irq	= cmx270_init_irq,
+	.timer		= &pxa_timer,
+	.init_machine	= cmx270_init,
+MACHINE_END
diff --git a/arch/arm/mach-pxa/it8152.c b/arch/arm/mach-pxa/it8152.c
new file mode 100644
index 0000000..91bb49c
--- /dev/null
+++ b/arch/arm/mach-pxa/it8152.c
@@ -0,0 +1,248 @@
+/*
+ * arch/arm/common/it8152.c: PCI functions for IT8152
+ *
+ * Compulab Ltd, 2002-2006
+ *
+ * The DMA bouncing is taken from arch/arm/mach-ixp4xx/common-pci.c
+ * (see this file for respective copyrights)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/ptrace.h>
+#include <linux/interrupt.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <asm/mach/map.h>
+
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+#include <asm/mach/pci.h>
+#include <asm/hardware/it8152.h>
+
+#define MAX_SLOTS		21
+
+static unsigned long
+it8152_pci_dev_base_address(struct pci_bus *bus, unsigned int devfn)
+{
+	unsigned long addr = 0;
+
+	if (bus->number == 0) {
+			if (devfn < PCI_DEVFN(MAX_SLOTS, 0))
+				addr = (devfn << 8);
+	} else
+		addr = (bus->number << 16) | (devfn << 8);
+
+	return addr;
+}
+
+static int
+it8152_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where,
+		    int size, u32 *value)
+{
+	unsigned long addr = it8152_pci_dev_base_address(bus, devfn);
+	u32 v;
+	int shift;
+
+#ifdef CONFIG_MACH_ARMCORE
+	if(devfn!=0) IT8152_GPIO_GPLR=0x00;
+#endif	
+	shift = (where & 3);
+
+	IT8152_PCI_CFG_ADDR = (addr + where);
+	v = (IT8152_PCI_CFG_DATA  >> (8 * (shift)));	
+
+	*value = v;
+
+#ifdef CONFIG_MACH_ARMCORE
+	if(devfn!=0) IT8152_GPIO_GPLR=0x20;
+#endif	
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+
+static int
+it8152_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where,
+		     int size, u32 value)
+{
+	unsigned long addr = it8152_pci_dev_base_address(bus, devfn);
+	u32 v, vtemp, mask=0;
+	int shift;
+
+#ifdef CONFIG_MACH_ARMCORE
+	if(devfn!=0) IT8152_GPIO_GPLR=0x00;
+#endif
+
+	if(size==1) mask=0xff;
+	if(size==2) mask=0xffff;
+
+	shift = (where & 3);
+
+	IT8152_PCI_CFG_ADDR = addr + where;
+	vtemp = IT8152_PCI_CFG_DATA;
+
+	if(mask) vtemp &= ~(mask << (8 * shift));
+	else vtemp = 0;
+
+	v = (value << (8 * shift));
+	IT8152_PCI_CFG_ADDR = addr + where;
+	IT8152_PCI_CFG_DATA  = (v | vtemp);
+
+#ifdef CONFIG_MACH_ARMCORE
+	if(devfn!=0) IT8152_GPIO_GPLR=0x20;
+#endif
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static struct pci_ops it8152_ops = {
+	.read = it8152_pci_read_config,
+	.write = it8152_pci_write_config,
+};
+
+static struct resource it8152_io = {
+	.name	= "IT8152 PCI I/O region",
+	.flags	= IORESOURCE_IO,
+};
+
+static struct resource it8152_mem1 = {
+	.name	= "First IT8152 PCI memory region",
+	.start	= 0x10000000,
+	.end	= 0x13e00000,
+	.flags	= IORESOURCE_MEM,
+};
+
+/*
+ * The following functions are needed for DMA bouncing.
+ * ITE8152 chip can addrees up to 64MByte, so all the devices
+ * connected to ITE8152 (PCI and USB) should have limited DMA window
+ */
+
+/*
+ * Setup DMA mask to 64MB on devices connected to ITE8152. Ignore all
+ * other devices.
+ */
+static int it8152_pci_platform_notify(struct device *dev)
+{
+	if ( dev->bus == &pci_bus_type ) {
+		if ( dev->dma_mask )
+			*dev->dma_mask =  SZ_64M - 1;
+		dev->coherent_dma_mask = SZ_64M - 1;
+		dmabounce_register_dev(dev, 2048, 4096);
+	}
+	return 0;
+}
+
+static int it8152_pci_platform_notify_remove(struct device *dev)
+{
+	if ( dev->bus == &pci_bus_type ) {
+		dmabounce_unregister_dev(dev);
+	}
+	return 0;
+}
+
+int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
+{
+	dev_dbg(dev, "%s: dma_addr %08x, size %08x\n",
+		__FUNCTION__, dma_addr, size);
+	return (dev->bus == &pci_bus_type ) && 
+		((dma_addr + size - PHYS_OFFSET) >= SZ_64M);
+}
+
+/*
+ * Only first 64MB of memory can be accessed via PCI.
+ * We use GFP_DMA to allocate safe buffers to do map/unmap.
+ * This is really ugly and we need a better way of specifying
+ * DMA-capable regions of memory.
+ */
+void __init it8152_adjust_zones(int node, unsigned long *zone_size,
+	unsigned long *zhole_size)
+{
+	unsigned int sz = SZ_64M >> PAGE_SHIFT;
+
+	/*
+	 * Only adjust if > 64M on current system
+	 */
+	if (node || (zone_size[0] <= sz))
+		return;
+
+	zone_size[1] = zone_size[0] - sz;
+	zone_size[0] = sz;
+	zhole_size[1] = zhole_size[0];
+	zhole_size[0] = 0;
+}
+
+/*
+ * We override these so we properly do dmabounce otherwise drivers
+ * are able to set the dma_mask to 0xffffffff and we can no longer
+ * trap bounces. :(
+ *
+ * We just return true on everyhing except for < 64MB in which case 
+ * we will fail miseralby and die since we can't handle that case.
+ */
+int
+pci_set_dma_mask(struct pci_dev *dev, u64 mask)
+{
+	if (mask >= SZ_64M - 1 )
+		return 0;
+
+	return -EIO;
+}
+    
+int
+pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
+{
+	if (mask >= SZ_64M - 1 )
+		return 0;
+
+	return -EIO;
+}
+
+EXPORT_SYMBOL(pci_set_dma_mask);
+EXPORT_SYMBOL(pci_set_consistent_dma_mask);
+
+
+int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
+{
+	it8152_io.start = IT8152_IO_BASE + 0x12000;
+ 	it8152_io.end	= IT8152_IO_BASE + 0x100000;
+
+	if (request_resource(&ioport_resource, &it8152_io)) {
+		printk(KERN_ERR "PCI: unable to allocate IO region\n");
+		return -EBUSY;
+	}
+	if (request_resource(&iomem_resource, &it8152_mem1)) {
+		printk(KERN_ERR "PCI: unable to allocate memory region\n");
+		return -EBUSY;
+	}
+
+	sys->resource[0] = &it8152_io;
+	sys->resource[1] = &it8152_mem1;
+
+	if (platform_notify || platform_notify_remove) {
+		printk(KERN_ERR "PCI: Can't use platform_notify\n");
+		return -EBUSY;
+	}
+
+	platform_notify = it8152_pci_platform_notify;
+	platform_notify_remove = it8152_pci_platform_notify_remove;
+
+	return 1;  
+}
+			  
+
+struct pci_bus * __init it8152_pci_scan_bus(int nr, struct pci_sys_data *sys)
+{
+	return pci_scan_bus(nr, &it8152_ops, sys);
+}
+
diff --git a/arch/arm/mach-pxa/leds-cm-x270.c b/arch/arm/mach-pxa/leds-cm-x270.c
new file mode 100644
index 0000000..5402b69
--- /dev/null
+++ b/arch/arm/mach-pxa/leds-cm-x270.c
@@ -0,0 +1,134 @@
+/*
+ * linux/arch/arm/mach-pxa/leds-cm-x270.c
+ *
+ * Compulab Ltd., 2003
+ *
+ * Original (leds-footbridge.c) by Russell King
+ * 
+ * Macros for actual LED manipulation should be in machine specific
+ * files in this 'mach' directory.
+ */
+
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/leds.h>
+#include <asm/system.h>
+
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/cm-x270.h>
+
+#include "leds.h"
+
+#define LED_STATE_ENABLED	1
+#define LED_STATE_CLAIMED	2
+
+#define RED_LED_ON			1
+#define GREEN_LED_ON		2
+
+static unsigned int led_state;
+static unsigned int hw_led_state;
+
+void armcore_leds_event(led_event_t evt)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+
+	switch (evt) {
+	case led_start:
+		hw_led_state = GREEN_LED_ON | RED_LED_ON;
+		led_state = LED_STATE_ENABLED;
+		break;
+
+	case led_stop:
+		led_state &= ~LED_STATE_ENABLED;
+		break;
+
+	case led_claim:
+		led_state |= LED_STATE_CLAIMED;
+		hw_led_state = GREEN_LED_ON | RED_LED_ON;
+		break;
+
+	case led_release:
+		led_state &= ~LED_STATE_CLAIMED;
+		hw_led_state = GREEN_LED_ON | RED_LED_ON;
+		break;
+
+#ifdef CONFIG_LEDS_TIMER
+	case led_timer:
+		if (!(led_state & LED_STATE_CLAIMED))
+			hw_led_state ^= GREEN_LED_ON;
+		break;
+#endif
+
+#ifdef CONFIG_LEDS_CPU
+	case led_idle_start:
+		if (!(led_state & LED_STATE_CLAIMED))
+			hw_led_state &= ~RED_LED_ON;
+		break;
+
+	case led_idle_end:
+		if (!(led_state & LED_STATE_CLAIMED))
+			hw_led_state |= RED_LED_ON;
+		break;
+#endif
+
+	case led_halted:
+		break;
+
+	case led_green_on:
+		if (led_state & LED_STATE_CLAIMED)
+			hw_led_state &= ~GREEN_LED_ON;
+		break;
+
+	case led_green_off:
+		if (led_state & LED_STATE_CLAIMED)
+			hw_led_state |= GREEN_LED_ON;
+		break;
+
+	case led_amber_on:
+		break;
+
+	case led_amber_off:
+		break;
+
+	case led_red_on:
+		if (led_state & LED_STATE_CLAIMED)
+			hw_led_state &= ~RED_LED_ON;
+		break;
+
+	case led_red_off:
+		if (led_state & LED_STATE_CLAIMED)
+			hw_led_state |= RED_LED_ON;
+		break;
+
+	default:
+		break;
+	}
+
+	if  (led_state & LED_STATE_ENABLED) 
+	{
+		if(hw_led_state & RED_LED_ON)  {
+			CMX270_RED_ON();
+//			printk("Red on\n");
+		}
+		else {
+//			printk("Red off\n");
+			CMX270_RED_OFF();
+		}
+		if(hw_led_state & GREEN_LED_ON)  {
+//			printk("Green on\n");
+			CMX270_GREEN_ON();
+		}
+		else {
+//			printk("Green off\n");
+			CMX270_GREEN_OFF();
+		}
+	}
+
+	local_irq_restore(flags);
+}
diff --git a/arch/arm/mach-pxa/leds.c b/arch/arm/mach-pxa/leds.c
index bbe4d5f..a27d027 100644
--- a/arch/arm/mach-pxa/leds.c
+++ b/arch/arm/mach-pxa/leds.c
@@ -24,6 +24,8 @@ pxa_leds_init(void)
 		leds_event = mainstone_leds_event;
 	if (machine_is_pxa_idp())
 		leds_event = idp_leds_event;
+	if (machine_is_armcore())	  
+		leds_event = armcore_leds_event;
 
 	leds_event(led_start);
 	return 0;
diff --git a/arch/arm/mach-pxa/leds.h b/arch/arm/mach-pxa/leds.h
index d98f6e9..0dcc346 100644
--- a/arch/arm/mach-pxa/leds.h
+++ b/arch/arm/mach-pxa/leds.h
@@ -10,3 +10,4 @@
 extern void idp_leds_event(led_event_t evt);
 extern void lubbock_leds_event(led_event_t evt);
 extern void mainstone_leds_event(led_event_t evt);
+extern void armcore_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 3baa708..823c32d 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -140,10 +140,12 @@ void pxa_cpu_pm_enter(suspend_state_t st
 	extern void pxa_cpu_suspend(unsigned int);
 	extern void pxa_cpu_resume(void);
 
+#ifndef CONFIG_MACH_ARMCORE
 	if (state == PM_SUSPEND_STANDBY)
 		CKEN = CKEN22_MEMC | CKEN9_OSTIMER | CKEN16_LCD |CKEN0_PWM0;
 	else
 		CKEN = CKEN22_MEMC | CKEN9_OSTIMER;
+#endif
 
 	/* ensure voltage-change sequencer not initiated, which hangs */
 	PCFR &= ~PCFR_FVC;
@@ -158,7 +160,11 @@ void pxa_cpu_pm_enter(suspend_state_t st
 	case PM_SUSPEND_MEM:
 		/* set resume return address */
 		PSPR = virt_to_phys(pxa_cpu_resume);
+#ifdef CONFIG_MACH_ARMCORE
+		pxa_cpu_suspend(PWRMODE_DEEPSLEEP);
+#else
 		pxa_cpu_suspend(PWRMODE_SLEEP);
+#endif
 		break;
 	}
 }
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 8b13316..8ffaad0 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -453,4 +453,9 @@ config ATA_OVER_ETH
 	This driver provides Support for ATA over Ethernet block
 	devices like the Coraid EtherDrive (R) Storage Blade.
 
+config ARMCORE_FLASH
+	tristate "ARMCORE flash drivers"
+	depends on MACH_ARMCORE
+	source "drivers/block/cl_flash/Kconfig"
+
 endmenu
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 3ec1f8d..ebeb4c6 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -31,3 +31,4 @@ obj-$(CONFIG_VIODASD)		+= viodasd.o
 obj-$(CONFIG_BLK_DEV_SX8)	+= sx8.o
 obj-$(CONFIG_BLK_DEV_UB)	+= ub.o
 
+obj-$(CONFIG_ARMCORE_FLASH) 	+= cl_flash/
diff --git a/drivers/block/cl_flash/CL_Logic.h b/drivers/block/cl_flash/CL_Logic.h
new file mode 100644
index 0000000..fe3e8d7
--- /dev/null
+++ b/drivers/block/cl_flash/CL_Logic.h
@@ -0,0 +1,245 @@
+/*	Module: CL_Logic.h
+	Author: Vova Lifliand
+	Description: Controls Nand flash management logic
+	Notes:
+*/
+
+#ifndef __CL_LOGIC__ 
+#define __CL_LOGIC__
+/*#define CL_NAND_BIG_DELAYS*/
+#if defined(FLASH_PLATFORM_LINUX) || defined(FLASH_PLATFORM_ARMonitor)
+/* Structure packaging */ 
+ #define PACKAGE __attribute__ ((packed,aligned(1)))
+ #define CL_ST static
+#else 
+ #define PACKAGE
+ #define CL_ST 
+#endif 
+ #define FAR
+ #define far 
+/* NOR Flash management constants */
+#define CL_NOR_FLASH_PAGE_SIZE            512      /*  bytes  */
+
+#ifdef FLASH_PLATFORM_DOS
+  #define cl_error_log(x,...){} 
+#endif			/*  MS-DOS  */
+/*  Nand Flash management constants  */
+
+/*  Page size must not be changed because this value is also used for
+    page size of Nand flash  */
+/*#define CL_FLASH_PAGE_SIZE            512      //  bytes  */
+#define CL_FLASH_MAXIMUM_PAGE_SIZE      2048/*  bytes  */
+#define CL_FLASH_MINIMAL_SECTOR_SIZE    512 /* Sectors can't be less than 512 bytes */
+/*#define CL_FLASH_SPARE_AREA_SIZE        16       //  bytes  */
+/*#define CL_FLASH_MAXIMUM_SPARE_AREA_SIZE  128         bytes  - twice the needed for biggest
+    							flash today 2004/05   */
+#define CL_FLASH_MAXIMUM_SPARE_AREA_SIZE  128 /*Stingy with space...*/
+							
+/*  Maximum blocks number in flash - adjust according to maximum flash size  */
+#define CL_MAX_BLKS_NUMBER              8192     /*  good for 128MB flash  */
+												/* Good up to 512 MB flash, if 64kb is the smallest block */
+/*  Number of pages in Nand flash block  */
+/* #define CL_FLASH_PAGES_PER_NAND_BLK     32 */
+/*  Maximum Number of pages in Nand flash block  */
+#define CL_FLASH_MAXIMUM_PAGES_PER_NAND_BLK 128 /* 32 */ /* Can't be more than 255
+							to fit in unsigned char arrays*/
+/*  Number of pages to make free  */
+#define CL_FLASH_FREE_PAGE_PER_BLK      1
+/*  Usable pages per 16 KB Nand flash block  */
+/*#define CL_FLASH_USE_PAGE_PER_BLK       (CL_FLASH_PAGES_PER_NAND_BLK - CL_FLASH_FREE_PAGE_PER_BLK)*/
+#define CL_FLASH_USE_PAGE_PER_BLK       (flogic->nand->pages_per_block - CL_FLASH_FREE_PAGE_PER_BLK)
+/*  Number of logical to physical page translation tables stored in memory
+    Each table size is ~40 bytes  */
+#define CL_LTF_PAGE_TBLS                30
+/*  Always leave a number of blocks unused - just for sure  */
+#define CL_EXTRA_SPARE_BLKS             10
+/*  Define maximum number of different blocks with cached pages  */
+#define CL_MAX_CACHED_BLKS              4
+/*  Number of erases per one launching of anti wearing procedure  */
+#define CL_ERASE_PER_ANTI_WEARING       1000
+
+
+#define CLBYTEPTR      unsigned char far*
+
+
+/*  Flash mapping and accessing interface  */
+typedef struct PACKAGE cl_nand_map_if_t
+{
+    /*  Destroy function must free all allocated resources (such as virtual memory)  */
+    void (*init) (void);
+    void (*destroy) (void);
+    /*  Chip select operation. When on = 1: chip select, on = 0: disable chip select  */
+    /* need_auto_operation - Whe the ON is false, the pin is expected to pulse in accordance
+       with bus transactions. This function exists on x86, but not on ARM */
+    void (*chip_select) (int on, int need_auto_operation);
+    /*  Reading from flash (HW read access, not actual data reading)  */
+    unsigned char (*readb) (unsigned char offset);
+    /*  Writing to flash (HW write access, not actual data writing)  */
+    void (*writeb) (unsigned char offset, unsigned char data);
+    /*  Reads block from flash: reads data from address 0 while incrementing data pointer  */
+    void (*blockread) (CLBYTEPTR data, int count);
+    /*  Writes block to flash: writes data to address 0 while incrementing data pointer  */
+    void (*blockwrite) ( CLBYTEPTR data, int count);
+    /*  Turns on/off activity indication leds  */
+    void (*activity_leds) (short operation, short reclaim);
+    /*  Performs specified delay (parameter in microsecond units)  */
+    int (*sleep) (unsigned long microseconds);
+	/* Wait for completion using R/B line */
+	/* Use microseconds, if R/B line not implemented */
+    int (*rbwait) (unsigned long  microseconds);
+} cl_nand_map_if;
+
+
+/*  Internal flash logic structure  */
+typedef struct cl_logic_t  far*cl_logic;
+
+
+/*  Parameter retrive enum  */
+typedef enum
+{
+    CL_FLASH_TOTAL_SIZE,        /*  Total size of the flash in bytes  */
+    CL_FLASH_HEADS_NUM,         /*  Number of heads  */
+    CL_FLASH_SECTOR_SIZE = 512,       /*  Sector size (in bytes)  =512 - is legacy for ARMonitor only*/
+    CL_FLASH_SECTORS_NUM,       /*  Number of sectors per tracks */
+    CL_FLASH_CYLINDERS_NUM,     /*  Number of cylinders  */
+    CL_FLASH_PAGE_SIZE,         /*  Size of the page without spare area */
+    CL_FLASH_READ_PAGE_CNT,     /*  Read page operations count  */
+    CL_FLASH_WRITE_PAGE_CNT,    /*  Write page operations count  */
+    CL_FLASH_RECLAIM_CNT,       /*  Reclaim block count  */
+    CL_FLASH_BURSTS_NUM,        /*  Bursts of length 'var' numbers  */
+    CL_FLASH_ERASE_CNT,         /*  Erase cnt of block specified by 'var'  */
+    CL_FLASH_BAD_BLOCK_CNT,
+} PACKAGE cl_logic_param;
+
+/*  Direct access type enum  */
+typedef enum 
+{
+    CL_FLASH_READ_PAGE,
+    CL_FLASH_READ_SPARE_AREA,
+    CL_FLASH_READ_BLK_SPARES,   /*  All spare areas of specified block  */
+    CL_FLASH_WRITE_PAGE,
+    CL_FLASH_WRITE_SPARE_AREA,
+    CL_FLASH_ERASE_BLOCK        /*  Data ignored  */
+} PACKAGE cl_nand_direct_access_type;
+
+/* memory access type enum */
+typedef enum //Memory areas usage is dscribed in separate document.
+{
+	CL_FLOGIC = 0,
+	CL_NAND,
+	CL_CACHE,
+	CL_CACHE_ORDERED_ARRAY,
+	CL_SP_AREA, 
+	CL_SP_AREA_2, 
+	CL_SP_AREA_3,
+	CL_PAGE, 
+	CL_CACHE_REF
+} PACKAGE  cl_memory_region_name;
+
+#define NUMBER_OF_MEMORY_REGIONS 9
+
+
+typedef enum 
+{
+	CL_FIRST_ALLOCATION_STAGE,
+	CL_SECOND_ALLOCATION_STAGE
+}PACKAGE cl_memory_allocation_stages;
+
+typedef struct cl_memory_pointer_type
+{
+	void far* pMemory;
+	char IN_USE;
+} PACKAGE cl_memory_pointer;
+
+void far* cl_memory_request (cl_memory_region_name mem_name);
+
+void cl_memory_return (cl_memory_region_name mem_name);
+
+/*  Creates flash logic object and attaches it to specified HW nand flash.
+    cache_size is max. number of pages, the cache can hold.
+    The flash is formatted prior initialization if format != 0.
+    When formatting reseved blocks and bad are not erased.  */
+cl_logic cl_logic_create (cl_nand_map_if* nand_if, long cache_size, int format, unsigned short sector_size);
+
+/*  Removes flash logic object and frees all allocated resources.  */
+void cl_logic_free (cl_logic flogic);
+
+/*  Parameters retrival function.  */
+long cl_logic_get_param (cl_logic flogic, cl_logic_param prm, long var);
+
+/*  Read page command.  */
+int cl_logic_read_page (cl_logic flogic,  long fs_sectn,
+                          CLBYTEPTR sector_data);
+
+/*  Write page command.  */
+int cl_logic_write_page (cl_logic flogic,  long fs_pagen,
+                            CLBYTEPTR page_data);
+
+/*  Flushes too old cache. If force_one_flush is TRUE, at least one
+    cached block is flushed.  */
+void cl_logic_on_idle (cl_logic flogic, int force_one_flush);
+
+/*  Flushes all cached data to disk.  */
+void cl_logic_sync (cl_logic flogic);
+
+/*  Direct accessing commands  */
+int cl_logic_direct_access (cl_logic flogic, cl_nand_direct_access_type type,
+                            unsigned short block, unsigned char page, CLBYTEPTR data);
+
+
+/*  NOR Flash Disk Driver  */
+
+/*  The header describes block information  */
+typedef struct
+{
+    unsigned short Signature;       /*  0x1998 for initialized blocks  */
+    unsigned short State;
+    unsigned short EraseCounter;
+    unsigned short PageIndex[128];
+    unsigned short Unused[10];
+    unsigned short BlockReserved;	/*	0xFFFF - usable block, 0 - reserved block  */
+} PACKAGE cl_nor_block_header;
+
+/*  Abstract class for flash access  */
+typedef struct
+{
+    /*  Constructor  */
+    void (*Constructor)(void);
+    /*  Destructor  */
+    void (*Destructor)(void);
+    /*  Define flash access functions  */
+    /*  Returns usable size  */
+    unsigned long (*GetSize)(void);
+    /*  Remaps or unmaps MMS windows, allocated by flash  */
+    void (*EnableFlashMap)(int EnableFlag);
+    /*  Returns number of usable pages, 512 bytes each.  */
+    /*  Doesn't include first page that is used for header - signature, state . . .  */
+    int (*GetPagesPerBlock)(void);
+    /*  Header  */
+    int (*ReadHeader)(unsigned short BlockN, cl_nor_block_header* Header);
+    /*  The PageNum == 0 is first data page and not the header. Max. value of PageNum  */
+    /*  is GetBlockSize() / BytesPerPage - 1 (min. is 0)  */
+    int (*ReadPage)(unsigned short BlockN, unsigned char PageNum, CLBYTEPTR DestBuff);
+    int (*SetBlockState) (unsigned short BlockN, unsigned short Signature,
+			  unsigned short State, unsigned short Reserved);
+    /*  Sets logical page index to zero - invalidates page. PageN is like in WritePage  */
+    int (*InvalidatePage)(unsigned short BlockN, unsigned char PageN);
+    /*  BlockN and PageN - destination location, where PageN doesn't include header  */
+    /*  information (PageN = 0 means first logical page and it's seconds physical page).  */
+    /*  PageIndex is physical page number for further identification (by ReadHeader)  */
+    int (*WritePage)(unsigned short BlockN, unsigned char PageN,
+                      const CLBYTEPTR PageData, unsigned short PageIndex);
+    int (*EraseBlock)(unsigned short BlockN);
+} PACKAGE cl_nor_flash_access;
+
+/*  Define flash access functions  */
+int cl_nor_init_flash (void);
+int cl_nor_free_mem (void);
+int cl_nor_format_flash (int (*ProgressCallback)(int Percentage));
+int cl_nor_write_page (int PageIndex, CLBYTEPTR Data);
+int cl_nor_read_page (int PageIndex, CLBYTEPTR Data);
+int cl_nor_get_disk_param (unsigned long* TotalPage, unsigned long* BytesPerPage,
+			   unsigned long* Cylinders, unsigned long* PagesPerTrk,
+			   unsigned long* Heads);
+#endif      /*  __CL_LOGIC__  */
+
diff --git a/drivers/block/cl_flash/Kconfig b/drivers/block/cl_flash/Kconfig
new file mode 100644
index 0000000..60aa80d
--- /dev/null
+++ b/drivers/block/cl_flash/Kconfig
@@ -0,0 +1,11 @@
+#
+# Block device driver configuration
+#
+
+config ARMCORE_NOR
+	bool "CompuLab NOR flash driver"
+	depends on ARMCORE_FLASH
+config ARMCORE_NAND
+	bool "CompuLab NAND flash driver"
+	depends on ARMCORE_FLASH
+
diff --git a/drivers/block/cl_flash/Makefile b/drivers/block/cl_flash/Makefile
new file mode 100644
index 0000000..538cb2c
--- /dev/null
+++ b/drivers/block/cl_flash/Makefile
@@ -0,0 +1,12 @@
+#
+# Makefile for Compulab flash disk driver
+#
+
+EXTRA_CFLAGS += -DTARGET_ARM_CORE -DFLASH_PLATFORM_LINUX
+
+obj-$(CONFIG_ARMCORE_FLASH)	+= fdrv.o
+
+fdrv-y				+=  cl_nordev.o cl_blkdev.o CL_FlashDrv
+
+
+fdrv-$(CONFIG_MACH_ARMCORE)	+= cl_nanddev_x270.o
diff --git a/drivers/block/cl_flash/cl_blkdev.c b/drivers/block/cl_flash/cl_blkdev.c
new file mode 100644
index 0000000..adb030d
--- /dev/null
+++ b/drivers/block/cl_flash/cl_blkdev.c
@@ -0,0 +1,731 @@
+/*
+ * Flash Disk Driver for Linux.
+ * Generic block device and genric disk implementation
+ *
+ * Copyright Compulab 2003-2006 (c).
+ */
+
+#include <linux/timer.h>
+#include <linux/hdreg.h>
+#include <linux/devfs_fs_kernel.h>
+#include <linux/blkdev.h>
+#include <linux/blkpg.h>
+#include <linux/ioctl.h>
+
+#include "CL_Logic.h"
+#include "cl_blkdev.h"
+
+/*  I/O Controls  */
+#define CL_FLASH_IOC_MAGIC          'f'
+#define CL_FLASH_IO_GET_PARAM        _IOWR (CL_FLASH_IOC_MAGIC, 1, char[12])
+#define CL_FLASH_IO_DIRECT_ACCESS    _IOWR (CL_FLASH_IOC_MAGIC, 2, char[524])
+
+#define FLUSH_INTERVAL	100
+
+struct cl_blkdev;
+
+struct flash_blkdev_ops {
+	/* timer for periodic flushes of NAND flash */
+	void (*flush_proc)(void* dev);
+
+	/* HW specific ioctl */
+	int (*flash_hw_ioctl)(struct cl_blkdev *dev, struct inode *inode,
+			      struct file *file, unsigned int cmd,
+			      unsigned long arg);
+
+	/* HW specific request handling */
+	int (*do_flash_hw_request)(struct cl_blkdev *dev, struct request *q);
+	/* HW specific cleanups */
+	int (*flash_hw_release)(struct cl_blkdev *dev, struct inode *inode,
+				struct file *file);
+};
+
+struct cl_blkdev_priv {
+	/* thread is dead indication */
+	struct completion thread_dead;	
+	/* flag to notify the thread that we are done */
+	int exiting;
+	/* thread wait queue head for requests */
+	wait_queue_head_t thread_wq;
+	/* block device request queue */
+	struct request_queue *rq;
+	/* request queue lock */
+	spinlock_t queue_lock;
+};
+
+struct cl_blkdev {
+	struct cl_blkdev_priv *blkdev_priv;
+	struct gendisk	*flash_disk;
+	struct flash_blkdev_ops *ops;
+	struct semaphore sem;
+	char name[32];
+		
+	int major;
+	void *hw_private; /* Low level hook */
+
+#ifdef CONFIG_PROC_FS
+	/* proc entry */
+	struct proc_dir_entry	*pde;
+#endif
+};
+
+#define FLASH_SECTOR	512
+
+/* declarations of cl_mem_set etc */
+#include "cl_common.c"
+
+
+/***************************************************************/
+/* Flash software write protect setup			       */
+/***************************************************************/
+unsigned long wpstart=0, wpend=0;
+
+static int __init wpstart_det(char *str) /*30-May-04, interrupts */
+{
+	wpstart = simple_strtol(str, NULL, 0);
+	return 1;
+}
+
+static int __init wpend_det(char *str) /*30-May-04, interrupts */
+{
+	wpend = simple_strtol(str, NULL, 0);
+	return 1;
+}
+
+__setup("wpstart=", wpstart_det); 
+__setup("wpend=", wpend_det); 
+
+
+/***************************************************************/
+/* generic block device interface			       */
+/***************************************************************/
+/* cl_blkdev_open: open a device */
+static int cl_blkdev_open(struct inode *inode, struct file *file)
+{
+	return 0;
+}
+
+static int cl_blkdev_check_media_change(struct gendisk* dev)
+{
+	return 0;	    /*	Disk not changed  */
+}
+
+static int cl_blkdev_revalidate(struct gendisk* dev)
+{
+	return 0;
+}
+
+/* cl_blkdev_release: release the device */
+static int cl_blkdev_release(struct inode *inode, struct file *file)
+{
+	struct cl_blkdev *dev;
+	dev = inode->i_bdev->bd_disk->private_data;
+	
+	down (&dev->sem);
+	dev->ops->flash_hw_release(dev, inode, file);
+	up (&dev->sem);
+
+	return 0;
+}
+
+/* 
+   cl_blkdev_ioctl: handle device ioctl's 
+   common ioctls (if any) for NAND and NOR flash are handled here
+   then HW specific ioctl handler is invoked
+ */
+static int cl_blkdev_ioctl(struct inode *inode, 
+			   struct file *file, u_int cmd, u_long arg)
+{
+	struct cl_blkdev *dev;
+
+	if ((!inode) || !(inode->i_rdev))
+		return -EINVAL;
+
+	dev = inode->i_bdev->bd_disk->private_data;
+	return dev->ops->flash_hw_ioctl(dev, inode, file, cmd, arg);
+}
+
+static struct block_device_operations flash_fops =
+{
+	.owner			= THIS_MODULE,
+	.open			= cl_blkdev_open,
+	.release		= cl_blkdev_release,
+	.ioctl			= cl_blkdev_ioctl,
+	.media_changed 		= cl_blkdev_check_media_change,
+	.revalidate_disk	= cl_blkdev_revalidate
+};
+
+static int cl_nand_request (struct cl_blkdev *_dev, struct request * req);
+
+/* wake up the flashdiskd thread to handle the request */
+static void do_cl_blkdev_request(struct request_queue *rq)
+{
+	struct cl_blkdev *dev = rq->queuedata;
+	wake_up(&dev->blkdev_priv->thread_wq);
+}
+
+void cl_blkdev_suspend(struct cl_blkdev* dev)
+{
+	dev->ops->flush_proc(dev);
+}
+
+/***************************************************************/
+/* flashdiskd thread is handling all transfer requests         */
+/***************************************************************/
+static int cl_flashdisk_thread(void *arg)
+{
+	struct cl_blkdev *dev = (struct cl_blkdev*)arg;
+	struct request_queue *rq = dev->blkdev_priv->rq;
+	unsigned long flush_period = msecs_to_jiffies(FLUSH_INTERVAL);
+	unsigned long last_flush_jiffies = jiffies;
+
+	current->flags |= PF_MEMALLOC/*  | PF_NOFREEZE */;
+	daemonize("%sd", "flashdisk");
+
+	while (!dev->blkdev_priv->exiting) {
+		struct request *req;
+		int res = 0;
+		DECLARE_WAITQUEUE(wait, current);
+
+		try_to_freeze();
+
+		spin_lock_irq(rq->queue_lock);
+		req = elv_next_request(rq);
+
+		if (!req) {
+			add_wait_queue(&dev->blkdev_priv->thread_wq, &wait);
+			set_current_state(TASK_INTERRUPTIBLE);
+
+			spin_unlock_irq(rq->queue_lock);
+
+			schedule();
+			remove_wait_queue(&dev->blkdev_priv->thread_wq, &wait);
+
+			continue;
+		}
+
+		dev = req->rq_disk->private_data;
+		spin_unlock_irq(rq->queue_lock);
+
+		down(&dev->sem);
+		res = dev->ops->do_flash_hw_request(dev, req);
+
+		if ( jiffies - last_flush_jiffies > flush_period ) {
+			if ( dev->ops->flush_proc )
+				dev->ops->flush_proc(dev);
+			last_flush_jiffies = jiffies;
+		}
+		up(&dev->sem);
+
+		spin_lock_irq(rq->queue_lock);
+		end_request(req, res);
+		spin_unlock_irq(rq->queue_lock);
+	}
+	complete_and_exit(&dev->blkdev_priv->thread_dead, 0);
+}
+
+/***************************************************************/
+/* block device initialization routines                        */
+/***************************************************************/
+
+/*
+  cl_blkdev_init: 
+	- initialize and register generic block device, 
+	- initialize timers for peroidic flushes
+	- initialize thread syncronization data
+	- start request processing thread
+
+  dev	- preallocated device that should be initialized
+  ops	- HW specific implementation of block device ioctl, do_request etc
+  name	- device name
+*/
+int cl_blkdev_init(struct cl_blkdev *dev, 
+		   struct flash_blkdev_ops *ops, const char *name)
+{
+	int ret;
+
+	/* allocate the thread synchronization structure */
+	dev->blkdev_priv = kmalloc(sizeof(*dev->blkdev_priv), GFP_KERNEL);
+	if (!dev->blkdev_priv)
+		return -ENOMEM;
+	memset(dev->blkdev_priv, 0, sizeof(*dev->blkdev_priv));
+
+	dev->ops = ops;
+	dev->major = 0;
+	strcpy(dev->name, name);
+
+	/* register block device */
+	if ((dev->major = register_blkdev(dev->major, dev->name)) <= 0) {
+		printk("flash: Unable to get major number.\n");
+		return -ENODEV;
+	}
+	else 
+		printk("Major number received: %d\n", dev->major);
+
+	/* initialize data for 'flashdiskd' thread */
+	spin_lock_init(&dev->blkdev_priv->queue_lock);
+	init_completion(&dev->blkdev_priv->thread_dead);
+	init_waitqueue_head(&dev->blkdev_priv->thread_wq);
+	init_MUTEX(&dev->sem);
+
+	/* initialize block device request queue */
+	dev->blkdev_priv->rq = blk_init_queue(do_cl_blkdev_request, 
+					      &dev->blkdev_priv->queue_lock);
+	if(!dev->blkdev_priv->rq) {
+		printk ("Could not initialize queue.\n");
+		unregister_blkdev(dev->major, dev->name);
+		kfree(dev->blkdev_priv);
+		return -ENOMEM;
+	}
+	dev->blkdev_priv->rq->queuedata = dev;
+	blk_queue_hardsect_size(dev->blkdev_priv->rq, FLASH_SECTOR);
+
+	/* start thread */
+	ret = kernel_thread(cl_flashdisk_thread, dev, CLONE_KERNEL);
+	if (ret < 0) {
+		blk_cleanup_queue(dev->blkdev_priv->rq);
+		unregister_blkdev(dev->major, dev->name);
+		kfree(dev->blkdev_priv);
+		printk(KERN_ERR "%s: kernel_thread returned %d\n", __FUNCTION__, ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+/*
+  cl_blkdev_register_disk:
+	- allocate generic dik object
+	- setup the disk (major, minors, name, ops)
+	- register the disk
+
+  dev	- block device enclosing the disk
+  name	- disk name
+  size	- size of the disk in sectors
+*/
+int cl_blkdev_register_disk(struct cl_blkdev *dev, 
+			    const char* name, sector_t size)
+{
+	/* allocate disk data structure */
+	dev->flash_disk = alloc_disk(16);
+	if (! dev->flash_disk) 
+		return -ENOMEM;
+	
+	/* initialize disk parameters */
+	dev->flash_disk->major = dev->major;
+	dev->flash_disk->first_minor = 0;
+	dev->flash_disk->fops = &flash_fops;
+	dev->flash_disk->private_data = dev;
+	dev->flash_disk->queue = dev->blkdev_priv->rq;
+
+	/* set /dev node names */
+	strcpy(dev->flash_disk->disk_name, name);
+	strcpy(dev->flash_disk->devfs_name, name);
+	set_capacity(dev->flash_disk, size);
+
+	/*  Insert this disk into linked list of disks  */
+	add_disk(dev->flash_disk);
+
+	return 0;
+}
+
+/*
+  cl_blkdev_unregister: unregister flash disk and associated block device
+*/
+void cl_blkdev_unregister(struct cl_blkdev *dev)
+{
+	dev->blkdev_priv->exiting = 1;
+	wake_up(&dev->blkdev_priv->thread_wq);
+	wait_for_completion(&dev->blkdev_priv->thread_dead);
+
+	del_gendisk(dev->flash_disk);
+	put_disk(dev->flash_disk);
+	blk_cleanup_queue(dev->blkdev_priv->rq);
+
+	unregister_blkdev(dev->major, dev->name);
+}
+
+/***************************************************************/
+/* NAND flash specific                                         */
+/***************************************************************/
+int format = 0;
+MODULE_PARM(format, "i");
+
+#define CACHE_SIZE 128
+
+/* This buffer is used for cach allocation, when cash size is bigger
+   than 128kb. 300 KB is the approximate amount needed for cache of 128
+   pages, 2kb each. */
+#define BUFFER_SIZE (300 * 1024)
+#define MAXIMUM_ALLOCATABLE_MEMORY (128 * 1024)
+char tmp_buff[BUFFER_SIZE];
+
+/* 
+   cl_nand_mem_alloc: allocates memory for driver cache 
+*/
+void* cl_nand_mem_alloc (unsigned long size)
+{
+	static int buf_not_used = 1;
+	if ((size > MAXIMUM_ALLOCATABLE_MEMORY) && 
+	    (size < BUFFER_SIZE) && buf_not_used) {
+		buf_not_used = 0;
+		return (void*)tmp_buff;
+	}
+	return kmalloc (size, GFP_KERNEL);
+}
+
+/* 
+   cl_nand_mem_free: frees memory allocated for driver cache 
+*/
+void cl_nand_mem_free (void* ptr)
+{
+	kfree (ptr);
+}
+
+/* 
+   cl_nand_flush_proc: flushes driver caches to the device
+*/
+static void cl_nand_flush_proc (void* _dev)
+{
+	struct cl_blkdev *blkdev = (struct cl_blkdev*)_dev;
+	struct cl_nand_dev *dev = (struct cl_nand_dev*)blkdev->hw_private;
+
+	dev->logic_sync(dev->logic);
+	cl_trace_log ("Data synced\n");
+	dev->last_end_write_cmd = 0;
+}
+
+/* 
+   cl_nand_request: handles an incoming IO request 
+*/
+static int cl_nand_request (struct cl_blkdev *_dev, struct request * req)
+{
+	struct cl_blkdev *blkdev = (struct cl_blkdev*)_dev;
+	struct cl_nand_dev *dev = (struct cl_nand_dev*)blkdev->hw_private;
+
+	u_int block, count;
+	int code=1, i;
+
+	block = req->sector;
+	count = req->current_nr_sectors;
+
+	switch (rq_data_dir(req)) {
+		case 0:	/* READ */
+			for (i = 0, code = 1;  i < count;  i++)
+				if (!dev->logic_read_page(
+					    dev->logic, block + i,
+					    (char*)req->buffer + i * 512)) {
+					cl_trace_log ("Reading failed.\n");
+					code = 0;    /*	failure */
+					break;
+				}
+			break;
+		case 1:	/* WRITE */
+			for (i = 0, code = 1;  i < count;  i++) {
+				if(wpend) {
+					if (((block + i) >= wpstart) || 
+					    ((block + i) <= wpend)) {
+						code=0; 
+						break;
+					}
+				}
+				if (!dev->logic_write_page(
+					    dev->logic, block + i,
+					    (char*)req->buffer + i * 512)) {
+					cl_trace_log ("Writing failed.\n");
+					code = 0;    /*	failure */
+					break;
+				}
+			}
+			dev->last_end_write_cmd = jiffies;
+			break;
+		default:
+			printk("do_flash_request: unknown request\n");
+			break;
+	}
+
+	return code;
+}
+
+/* 
+   cl_nand_ioctl: handles device ioctl's 
+*/
+static int cl_nand_ioctl(struct cl_blkdev *_dev, struct inode *inode,
+			 struct file *file,unsigned int cmd,unsigned long arg)
+{
+	struct cl_nand_dev *dev = (struct cl_nand_dev*)_dev->hw_private;
+
+	cl_trace_log ("flash_ioctl called.\n");
+	printk("fdrv.o ioctl\n");
+	if ((!inode) || !(inode->i_rdev))
+		return -EINVAL;
+
+	switch (cmd) {
+		case HDIO_GETGEO:
+		{
+			struct hd_geometry *geometry = (struct hd_geometry*)arg;
+			if (!geometry)
+				return -EINVAL; /* Bad arguments to ioctl */
+			put_user(dev->logic_get_param(dev->logic,
+						      CL_FLASH_CYLINDERS_NUM, 
+						      0),
+				 &geometry->cylinders);
+			put_user(dev->logic_get_param(dev->logic,
+						      CL_FLASH_HEADS_NUM, 0),
+				 &geometry->heads);
+			put_user(dev->logic_get_param(dev->logic,
+						      CL_FLASH_SECTORS_NUM, 0),
+				 &geometry->sectors);
+			put_user(0, &geometry->start);
+			return 0;
+		}
+		case BLKGETSIZE:
+			if (!arg)
+				return -EINVAL;
+			return put_user(dev->logic_get_param(
+						dev->logic,
+						CL_FLASH_TOTAL_SIZE, 0) / 512,
+					(long *) arg);
+		case HDIO_SET_DMA:
+			/*	We don't use DMA for flash. 
+				This has no meaning  */
+			if (!capable (CAP_SYS_ADMIN))
+				return -EACCES;
+			return 0;
+		case HDIO_GET_DMA:
+			return put_user( 0, (long *) arg);	/*  No DMA  */
+		case HDIO_GET_MULTCOUNT:
+			/*  We don't have a limitation of number of 
+			    sectors in op.  */
+			return put_user (128, (long *) arg);
+		case BLKRRPART:
+		case BLKFLSBUF:
+		case BLKROSET:
+		case BLKROGET:
+		case BLKRASET:
+		case BLKRAGET:
+		case BLKPG:
+		case CL_FLASH_IO_GET_PARAM:
+		{
+			int err;
+			long* prm = (long*)arg;
+			err = access_ok(VERIFY_READ, prm,
+					sizeof(long) * 2) ? 0 : -EFAULT;
+			if (err)
+				return err;
+			err = access_ok(VERIFY_WRITE, prm,
+					sizeof (long)) ? 0 : -EFAULT;
+			if (err)
+				return err;
+			prm[0] = dev->logic_get_param(dev->logic, 
+						      prm[0], prm[1]);
+			return 0;
+		}
+
+		case CL_FLASH_IO_DIRECT_ACCESS:
+		{
+			int err;
+			printk("====> CL_FLASH_IO_DIRECT_ACCESS\n");
+			long* prm = (long*)arg;
+			err = access_ok(VERIFY_READ, prm,
+					sizeof(long) * 3) ? 0 : -EFAULT;
+			if(err) return err;
+			err = access_ok(VERIFY_WRITE, prm,
+					CL_FLASH_SECTOR_SIZE) ? 0 : -EFAULT;
+			if(err) return err;
+			return dev->logic_direct_access(
+				dev->logic,
+				(cl_nand_direct_access_type)prm[0],
+				(unsigned short)prm[1],
+				(unsigned short)prm[2],
+				(unsigned char*)(prm + 3));
+		}
+		
+		default:
+			return -EINVAL;
+	}
+}
+
+/* 
+   cl_nand_release: releases the device 
+*/
+static int cl_nand_release (struct cl_blkdev *_dev,
+			    struct inode *inode, struct file *file)
+{
+	struct cl_nand_dev *dev = (struct cl_nand_dev*)_dev->hw_private;
+
+	dev->logic_sync(dev->logic);
+	cl_trace_log ("Data synced after RELEASE command\n");
+	dev->last_end_write_cmd = 0;
+
+	return 0;
+}
+
+static struct flash_blkdev_ops nand_blkdev_ops = {
+	.flush_proc = cl_nand_flush_proc,
+	.flash_hw_ioctl = cl_nand_ioctl,
+	.do_flash_hw_request = cl_nand_request,
+	.flash_hw_release = cl_nand_release
+};
+
+#ifdef CONFIG_PROC_FS
+/***************************************************************/
+/* proc entry /proc/flashdisk implementation                   */
+/***************************************************************/
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+
+static void cl_nand_proc_show(struct seq_file *s, struct cl_blkdev *_dev)
+{
+	struct cl_nand_dev *dev = _dev->hw_private;
+
+	unsigned long heads, sects, tot_size, cylinders;
+	unsigned short sector_size, page_size;
+	long read_page_cnt, write_page_cnt, reclaim_cnt;
+
+	tot_size = dev->logic_get_param(dev->logic, CL_FLASH_TOTAL_SIZE, 0);
+	heads = dev->logic_get_param(dev->logic, CL_FLASH_HEADS_NUM, 0);
+	sects = dev->logic_get_param(dev->logic, CL_FLASH_SECTOR_SIZE, 0);
+	cylinders = dev->logic_get_param(dev->logic, CL_FLASH_CYLINDERS_NUM, 0);
+	sector_size = dev->logic_get_param(dev->logic, CL_FLASH_SECTOR_SIZE, 0);
+	page_size = dev->logic_get_param(dev->logic, CL_FLASH_PAGE_SIZE, 0);
+	read_page_cnt = dev->logic_get_param(dev->logic,
+					     CL_FLASH_READ_PAGE_CNT, 0);
+	write_page_cnt = dev->logic_get_param(dev->logic,
+					      CL_FLASH_WRITE_PAGE_CNT, 0);
+	reclaim_cnt = dev->logic_get_param(dev->logic, CL_FLASH_RECLAIM_CNT, 0);
+
+
+	seq_printf(s, "NAND flash disk:\n");
+	seq_printf(s, "\ttotal size: %lu Mbytes (%lu bytes)\n",
+		   (tot_size >> 20), tot_size);
+	seq_printf(s, "\theads: %lu \tcylinders: %lu\tsectors: %lu\n", heads,
+		   cylinders, sects);
+	seq_printf(s, "\tsector: %d\tpage: %d\n", sector_size, page_size);
+	seq_printf(s, "Stats:\n");
+	seq_printf(s, "\tread: %ld\twritten: %ld\treclaimed: %ld\n",
+		   read_page_cnt, write_page_cnt, reclaim_cnt);
+}
+
+static int cl_blkdev_proc_show(struct seq_file *s, void *unused)
+{
+	struct cl_blkdev *dev = s->private;
+
+	seq_printf(s, "CompuLab flash disks:\n");
+	cl_nand_proc_show(s, dev);
+
+	return 0;
+}
+
+static int cl_blkdev_proc_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, cl_blkdev_proc_show, PDE(inode)->data);
+}
+
+static struct file_operations proc_ops = {
+	.open		= cl_blkdev_proc_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+		   
+static const char proc_filename[] = "flashdisk";
+
+static void cl_blkdev_proc_create_file(struct cl_blkdev *dev)
+{
+	struct proc_dir_entry *pde;
+	pde = create_proc_entry(proc_filename, 0666, NULL);
+	if (pde == NULL)
+		return;
+
+	pde->proc_fops = &proc_ops;
+	pde->data = dev;
+	dev->pde = pde;
+}
+
+static void cl_blkdev_remove_proc_file(struct cl_blkdev *dev)
+{
+	if (dev->pde)
+		remove_proc_entry(proc_filename, NULL);
+}
+
+#else 
+
+#define cl_blkdev_create_proc_file(x) do {} while(0)
+#define cl_blkdev_remove_proc_file(x) do {} while(0)
+
+#endif
+
+/*******************************************************************/
+/* NAND device initialization and cleanup                          */
+/*******************************************************************/
+/* 
+   cl_nand_flash_init:
+	- initialize the CL_Logic
+	- register the block device and gendisk
+
+   dev	- preallocated cl_nand_dev object 
+   cl_nand_linux - HW interface
+*/
+int cl_nand_flash_init(struct cl_nand_dev *dev, cl_nand_map_if *cl_nand_linux)
+{
+	const char *name = "nand";
+	int ret = 0;
+	printk ("Nand Flash disk driver, CompuLab");
+
+	if( wpend ) 
+		printk("NAND Write Protection activated from %ld to %ld.\n",
+		       wpstart, wpend);
+
+	if (format)
+		printk ("Formatting Nand flash . . .\n");
+	dev->logic = dev->logic_create(cl_nand_linux, CACHE_SIZE, format, FLASH_SECTOR);
+	if (!dev->logic) {
+		printk ("Flash logic couldn't be created.\n");
+		return -1;
+	}
+
+	dev->blkdev = kmalloc(sizeof(*dev->blkdev), GFP_KERNEL);
+	if ( !dev->blkdev ) {
+		return -ENOMEM;
+	}
+	
+	dev->blkdev->hw_private = dev;
+	if ( (ret = cl_blkdev_init(dev->blkdev, &nand_blkdev_ops, name)) ) {
+		printk(KERN_ERR "%s: cl_blkdev initialization failed: %d\n", 
+		       __FUNCTION__, ret);
+		dev->logic_free(dev->logic);
+		return ret;
+	}
+
+	ret = cl_blkdev_register_disk(dev->blkdev, name,
+				      dev->logic_get_param(dev->logic,
+							   CL_FLASH_TOTAL_SIZE, 
+							   0) / 512);
+	if ( ret ) {
+		printk(KERN_ERR "%s: NAND disk registration failed: %d\n", 
+		       __FUNCTION__, ret);
+		cl_blkdev_unregister(dev->blkdev);
+		dev->logic_free(dev->logic);
+		return ret;
+	}
+
+	cl_blkdev_proc_create_file(dev->blkdev);
+
+	return 0;
+}
+
+/* 
+   cl_nand_flash_cleanup: performs cleanup when driver is no longer used
+*/
+void cl_nand_flash_cleanup(struct cl_nand_dev * dev)
+{
+	cl_blkdev_unregister(dev->blkdev);
+	if ( dev->logic )
+		dev->logic_free(dev->logic);
+
+	cl_blkdev_remove_proc_file(dev->blkdev);
+	
+	if ( dev->blkdev )
+		kfree(dev->blkdev);
+}
diff --git a/drivers/block/cl_flash/cl_blkdev.h b/drivers/block/cl_flash/cl_blkdev.h
new file mode 100644
index 0000000..bca1944
--- /dev/null
+++ b/drivers/block/cl_flash/cl_blkdev.h
@@ -0,0 +1,43 @@
+#ifndef __CL_BLKDEV_H__
+#define __CL_BLKDEV_H__
+
+struct cl_blkdev;
+
+struct cl_nand_dev {
+	struct cl_blkdev *blkdev; 
+	cl_logic logic;
+	unsigned long last_end_write_cmd;
+
+	/* CL logic access layer */
+	cl_logic (*logic_create)(cl_nand_map_if*, long,
+				 int, unsigned short);
+	void (*logic_free)(cl_logic);
+	long (*logic_get_param)(cl_logic, cl_logic_param, long);
+	int  (*logic_read_page)(cl_logic, long, CLBYTEPTR);
+	int  (*logic_write_page)(cl_logic, long, CLBYTEPTR);
+	void (*logic_on_idle)(cl_logic, int);
+	void (*logic_sync)(cl_logic);
+	int  (*logic_direct_access)(cl_logic,cl_nand_direct_access_type,
+				    unsigned short, unsigned char, CLBYTEPTR);
+};
+
+extern int cl_nand_flash_init(struct cl_nand_dev *dev, cl_nand_map_if *cl_nand_linux);
+extern void cl_nand_flash_cleanup(struct cl_nand_dev * dev);
+
+#define INIT_NAND_DEV(dev) \
+	do {								\
+		dev->logic = 0;						\
+		dev->blkdev = 0;					\
+		dev->last_end_write_cmd = 0;				\
+		dev->logic_create = cl_logic_create;			\
+		dev->logic_free = cl_logic_free;			\
+		dev->logic_get_param = cl_logic_get_param;		\
+		dev->logic_read_page = cl_logic_read_page;		\
+		dev->logic_write_page = cl_logic_write_page;		\
+		dev->logic_on_idle = cl_logic_on_idle;			\
+		dev->logic_sync = cl_logic_sync;			\
+		dev->logic_direct_access = cl_logic_direct_access;	\
+	} while(0)
+
+
+#endif /*  __CL_BLKDEV_H__ */
diff --git a/drivers/block/cl_flash/cl_common.c b/drivers/block/cl_flash/cl_common.c
new file mode 100644
index 0000000..a0d2a9c
--- /dev/null
+++ b/drivers/block/cl_flash/cl_common.c
@@ -0,0 +1,52 @@
+void cl_zero_mem (void* ptr, long size)
+{
+	memset (ptr, 0, size);
+}
+
+void cl_ff_mem (void* ptr, long size)
+{
+	memset (ptr, 0xff, size);
+}
+void cl_mem_copy (void* dest,  void* src, long size)
+{
+	memcpy (dest, src, size);
+}
+
+int cl_mem_compare (void* mem1, void* mem2, long size)
+{
+	return memcmp (mem1, mem2, size);
+}
+
+unsigned long cl_get_jiffies (void)
+{
+	return jiffies;
+}
+
+unsigned long cl_nand_get_max_cache_time (void)
+{
+	return HZ * 30;       /*  30 seconds in cache maximum  */
+}
+
+void cl_trace_log ( char* format, ...)
+{
+#ifdef DO_CL_TRACE_LOG
+	char full_msg[300];
+	va_list marker;
+
+	va_start(marker, format);
+	vsprintf(full_msg, format, marker);
+	printk(full_msg);
+	va_end(marker);
+#endif
+}
+
+void cl_error_log ( char* format, ...)
+{
+	char full_msg[300];
+	va_list marker;
+
+	va_start(marker, format);
+	vsprintf(full_msg, format, marker);
+	printk(full_msg);
+	va_end(marker);
+}
diff --git a/drivers/block/cl_flash/cl_nanddev_x270.c b/drivers/block/cl_flash/cl_nanddev_x270.c
new file mode 100644
index 0000000..71f05f8
--- /dev/null
+++ b/drivers/block/cl_flash/cl_nanddev_x270.c
@@ -0,0 +1,233 @@
+/*
+ * drivers/block/cl_flash/cl_nandded_x270.c
+ *
+ * Flash Disk Driver for CM-X270 platform.
+ * Low level device interface implementation
+ *
+ * Copyright Compulab 2003-2006 (c).
+ */
+
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/cm-x270.h>
+
+#include "CL_Logic.h"
+#include "cl_blkdev.h"
+
+/*  The following macro enables flash activity indication by LEDs  */
+#undef USE_LEDS
+
+#define NAND_RB			(GPLR2 & (1<<25))
+
+#define NandCLE		(1<<0)
+#define NandALE		(1<<1)
+
+/*
+ * Values specific to the ARMCore
+ */
+volatile unsigned long * FLASH_DATA;
+volatile unsigned long * FLASH_DATA_ALE;
+volatile unsigned long * FLASH_DATA_CLE;
+
+/* asm-arm/arch-pxa/hardware.h defines UNCACHED_ADDR */
+volatile unsigned char * UNC = (volatile unsigned char *)UNCACHED_ADDR;
+
+/*******************************************************************/
+/* CM-X270 NAND HW access layer                                    */
+/*******************************************************************/
+static inline void nand_cs_on(void)
+{
+	GPCR0 = 1<<11;
+	while( (GPLR0 & (1<<11)) );
+}
+
+static inline void nand_cs_off(void)
+{
+	unsigned char dummy;
+	asm volatile ("mcr p15, 0, r0, c7, c10, 4":::"r0");
+	dummy=*UNC;
+
+	GPSR0 = 1<<11;
+	while( !(GPLR0 & (1<<11)) );
+}
+
+static void FlashInitial(void)
+{
+}
+
+static void FlashChipSelect (int on, int need_auto_operation)
+{
+	static int cs_state = -1;
+
+	if (need_auto_operation)
+		on = 1;
+
+	if (cs_state == on)
+		return;
+	
+	cs_state = on;
+
+	if (on) {
+		nand_cs_on();
+	}
+	else {
+		nand_cs_off();
+	}
+}
+
+static unsigned char FlashReadByte (unsigned char offset)
+{
+	return (unsigned char)(*FLASH_DATA >> 16);
+}
+
+static void FlashWriteByte (unsigned char offset, unsigned char data)
+{
+    if(offset & NandALE) *FLASH_DATA_ALE = (data << 16);
+    else if(offset & NandCLE) *FLASH_DATA_CLE = (data << 16);
+    else *FLASH_DATA = (data << 16);
+}
+
+static void FlashBlockRead (unsigned char* data, int count)
+{
+    while (count--)	
+        *data++ = (unsigned char)(*FLASH_DATA >> 16);
+}
+
+static void FlashBlockWrite ( unsigned char* data, int count)
+{
+    while (count--)	
+        *FLASH_DATA = (*data++ << 16);
+}
+
+/*  Orange LED used by Linux kernel activity  */
+static void FlashCoreLeds (short operation, short reclaim)
+{
+#ifdef USE_LEDS
+
+#endif
+}
+
+static void do_nothing (void)
+{
+}
+
+int nand_delay(unsigned long microseconds) 
+{
+	if ( microseconds < 1000 ) {
+		udelay(microseconds);
+		return 0;
+	}
+	udelay(1000);
+	udelay(1000);
+	udelay(1000);
+	return 0;
+}
+
+/* Wait on Ready/Busy signal */
+static int RBWait(unsigned long microseconds)
+{
+	unsigned char dummy;
+	int i=0;
+
+	/* ensure there's no outstanding bus transaction */
+	asm volatile ("mcr p15, 0, r0, c7, c10, 4":::"r0");
+	dummy=*UNC;
+
+	/* protect from big delays in R/B GPIO falling edge (or no R/B
+	   falling edge activity) */
+	while((NAND_RB == 1) && (i < 3000)){
+		udelay(1);
+		i++;
+	};
+
+	if ( i > 0 )
+		printk(KERN_DEBUG "%s: No immediate R/B activity\n", __FILE__);
+
+	if (i == 3000){
+		printk(KERN_DEBUG "%s: No R/B activity for 3 ms\n", __FILE__);
+		return (0);
+	}
+
+	i=0;
+
+	/* protect from big delays in R/B GPIO rising edge */
+	while((NAND_RB == 0) && (i < 3000)){
+		udelay(1);
+		i++;
+	};
+
+	if (i == 3000){
+		printk(KERN_DEBUG "%s: R/B timed out\n", __FILE__);
+		return (0);
+	}
+
+	/* ensure there's no outstanding bus transaction */
+	asm volatile ("mcr p15, 0, r0, c7, c10, 4":::"r0");
+	dummy=*UNC;
+
+	return(1);
+}
+
+static cl_nand_map_if cl_nand_linux = {
+        .init = FlashInitial,
+        .destroy = do_nothing,
+        .chip_select = FlashChipSelect,
+        .readb = FlashReadByte,
+        .writeb = FlashWriteByte,
+        .blockread = FlashBlockRead,
+        .blockwrite = FlashBlockWrite,
+        .activity_leds = FlashCoreLeds,
+        .sleep = nand_delay,
+        .rbwait = RBWait
+};
+
+static struct cl_nand_dev nand_dev;
+
+/* 
+   nand_flash_init:
+	- perform board specific initialization
+	- initialize NAND device data structure
+	- initialize block device layer
+*/
+static int nand_flash_init (void)
+{
+	struct cl_nand_dev *dev = &nand_dev;
+
+	FLASH_DATA = (volatile unsigned long*)ioremap(PXA_CS1_PHYS, 12);
+	if (FLASH_DATA == NULL) {
+		printk("Bad NAND flash window at %X (already in use)\n", 0x04000000);
+		return -1;
+	}
+	FLASH_DATA_CLE = FLASH_DATA + 1;
+	FLASH_DATA_ALE = FLASH_DATA + 2;
+
+	INIT_NAND_DEV(dev);
+	return cl_nand_flash_init(dev, &cl_nand_linux);
+}
+
+#ifdef CONFIG_ARMCORE_NAND
+int cl_nand_init_module(void)
+{
+	return nand_flash_init();
+}
+
+void cl_nand_cleanup_module(void)
+{
+	struct cl_nand_dev *dev = &nand_dev;
+	cl_nand_flash_cleanup(dev);
+}
+#else
+int cl_nand_init_module(void)
+{
+	return 0;
+}
+
+void cl_nand_cleanup_module(void)
+{
+}
+#endif
diff --git a/drivers/block/cl_flash/cl_nordev.c b/drivers/block/cl_flash/cl_nordev.c
new file mode 100644
index 0000000..85ae58a
--- /dev/null
+++ b/drivers/block/cl_flash/cl_nordev.c
@@ -0,0 +1,594 @@
+/*  
+    Flash Disk Driver Interface for Linux 2.4.x
+    Written by Vova Lifliand
+*/
+
+/*  Includes  */
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/fs.h>
+#include <linux/kernel.h>
+#include <linux/timer.h>
+#include <linux/genhd.h>
+#include <linux/hdreg.h>
+#include <linux/ioport.h>
+#include <linux/init.h>
+#include <linux/devfs_fs_kernel.h>
+#include <linux/delay.h>
+
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+/*  Macros for correct linux/blk.h inclusion  */
+
+#define DEVICE_NAME	    	"nor"
+
+static int major = 0;	    
+
+#define FLASH_SECTOR	512
+
+#include <linux/blkdev.h>
+#include <linux/blkpg.h>
+
+extern void cl_error_log ( char* format, ...);
+extern void cl_trace_log ( char* format, ...);
+extern void cl_mem_copy (void* dest,  void* src, long size);
+
+
+/*  Undefine for custom LEDs usage  */
+#undef USE_LEDS
+
+/*  CrFlash driver interface  */
+#ifndef FLASH_PLATFORM_LINUX
+#define FLASH_PLATFORM_LINUX
+#endif
+#include "CL_Logic.h"
+
+typedef  unsigned long ULONG;
+
+/*  Forward functions declaration  */
+static int flash_open (struct inode *inode,struct file *file);
+static void do_flash_request (request_queue_t * q);
+static int flash_ioctl (struct inode *inode,struct file *file,unsigned int cmd,unsigned long arg);
+static int flash_release (struct inode *inode, struct file *file);
+
+static DECLARE_MUTEX (nor_flash_sem);
+static int nor_flash_sem_catched = 0;
+
+
+volatile unsigned short * NorFlashMem;
+
+static int flash_check_media_change (struct gendisk* dev)
+{
+/*    printk ("flash_check_media_change called.\r\n");*/
+    return 0;	    /*	Disk not changed  */
+}
+
+static int flash_revalidate (struct gendisk* dev)
+{
+/*    printk ("flash_revalidate called.\r\n");*/
+    return 0;
+}
+
+static struct block_device_operations flash_fops =
+{
+	.owner 			= THIS_MODULE,
+	.open			= flash_open,
+	.release		= flash_release,
+	.ioctl			= flash_ioctl,
+	.media_changed 		= flash_check_media_change,
+	.revalidate_disk	= flash_revalidate
+};
+
+static struct gendisk *flash_gendisk;
+static spinlock_t flash_lock;
+static struct request_queue *flash_queue;
+
+
+#ifdef CONFIG_ARMCORE_NOR
+/* nor_flash_init: register the block device number and set up pointer tables */
+int __init nor_flash_init (void)
+{
+    ULONG trash1, trash2, trash3, trash4, TotalSect;
+
+    /*  Request memory for NOR Flash  */
+    NorFlashMem = (volatile unsigned short*)ioremap (0x00000000, 0x800000);
+    if (NorFlashMem == NULL) {
+        printk("Bad NOR flash window at %X (already in use)\n", 0x00000000);
+        return -1;
+    }
+
+    /*  Do flash initialization  */
+    if (!cl_nor_init_flash()) {
+	    printk("NOR: Flash initialization failed\n");
+	    iounmap((void __iomem *)NorFlashMem);
+	    return -1;
+    }
+
+	spin_lock_init(&flash_lock);
+	flash_queue = blk_init_queue(do_flash_request, &flash_lock);
+	if(flash_queue == NULL)
+    {
+        printk ("Could not initialize queue.\r\n");
+	iounmap((void __iomem *)NorFlashMem);
+        return -1;
+    }
+	blk_queue_hardsect_size(flash_queue, FLASH_SECTOR);
+
+    if ((major=register_blkdev (0, DEVICE_NAME)) <= 0)
+    {
+		printk("flash: Unable to get major number \n");
+		iounmap((void __iomem *)NorFlashMem);
+		return -1;
+    }  else printk("Major number received: %d\n", major);
+
+    /*  Insert this disk into linked list of disks  */
+
+    flash_gendisk = alloc_disk(16);
+    if (! flash_gendisk) return -ENOMEM;
+    flash_gendisk->major = major;
+	flash_gendisk->first_minor = 0;
+	flash_gendisk->fops = &flash_fops;
+	flash_gendisk->private_data=NULL;
+	flash_gendisk->queue = flash_queue;
+	strcpy(flash_gendisk->disk_name, "nor");
+    cl_nor_get_disk_param( &TotalSect, &trash1, &trash2, &trash3, &trash4);
+	set_capacity(flash_gendisk, TotalSect);
+    add_disk(flash_gendisk);
+
+    /*  Starting flush timer: the cl_timer_proc will be executed on each timer interrupt  */
+
+    return 0;
+}
+#else
+int __init nor_flash_init (void)
+{
+	return 0;
+}
+#endif
+
+/* flash_open: open a device */
+static int flash_open (struct inode *inode, struct file *file)
+{
+    
+	return 0;
+    
+}
+
+/* do_flash_request: handle an incoming request */
+static void do_flash_request (request_queue_t * q)
+{
+    u_int block, count;
+    int code=1, i;
+	struct request* req=NULL;
+
+    while ((code == 1) && ((req = elv_next_request(q)) != NULL)) 
+    {
+	    block = req->sector;
+	    // printk ("req->nr_sectors = %d.\r\n", req->nr_sectors);
+	    // printk ("req->current_nr_sectors = %d.\r\n", req->current_nr_sectors);
+	    count = req->current_nr_sectors;
+
+	    nor_flash_sem_catched++;
+	    down (&nor_flash_sem);    
+	    
+	    switch (rq_data_dir(req)) {
+		case 0:	// READ
+		    for (i = 0, code = 1;  i < count;  i++) 
+				// printk ("Reading sector %d (of %d).\r\n", block + i, count);
+    			if (!cl_nor_read_page ( block + i,
+					(void *)((char*)req->buffer + i * 512))) {
+				//			printk ("Reading failed.\r\n");
+					    code = 0;    /*	failure  */
+			    		break;
+				}
+				// printk ("Reading completed successfully.\r\n");
+		    break;
+		case 1:	// WRITE
+		    for (i = 0, code = 1;  i < count;  i++) {
+				// printk ("Writing sector %d.\r\n", block + i);
+				if (!cl_nor_write_page ( block + i,
+	 				(void *)((char*)req->buffer + i * 512))) {
+				//			printk ("Writing failed.\r\n");
+			    		code = 0;    /*	failure  */
+					    break;
+				}
+				// printk ("Writing completed successfully.\r\n");
+		    }	
+		    break;
+		default:
+		    printk("do_flash_request: unknown request\n");
+		    break;
+	    }
+	    up (&nor_flash_sem);
+	    nor_flash_sem_catched--;
+		end_request (req, code);	/* wrap up, 0 = fail, 1 = success */
+	}
+}
+
+/* flash_ioctl: handle device ioctl's */
+static int flash_ioctl (struct inode *inode, struct file *file, u_int cmd, u_long arg)
+{
+    ULONG trash1, trash2, trash3, trash4, TotalSect;
+    
+    // printk ("flash_ioctl called.\r\n");
+
+    if ((!inode) || !(inode->i_rdev))
+	return -EINVAL;
+
+    cl_nor_get_disk_param( &TotalSect, &trash1, &trash2, &trash3, &trash4);
+    // printk ("flash_ioctl in switch.\r\n");
+    switch (cmd)
+    {
+	case HDIO_GETGEO:
+	{
+	    struct hd_geometry *geometry = (struct hd_geometry*)arg;
+	    if (!geometry)
+		return -EINVAL;	    /*	Bad arguments to ioctl  */
+	    put_user(TotalSect / 32 , &geometry->cylinders);
+	    put_user(1, &geometry->heads);
+	    put_user(32, &geometry->sectors);
+	    put_user(2, &geometry->start);
+	}
+	case BLKGETSIZE:
+	    if (!arg)
+		return -EINVAL;
+	    return put_user (TotalSect, (long *) arg);
+	case HDIO_SET_DMA:	    /*	We don't use DMA for flash. This has no meaning  */
+	    if (!capable (CAP_SYS_ADMIN))
+		return -EACCES;
+	    return 0;
+	case HDIO_GET_DMA:
+	    return put_user( 0, (long *) arg);	/*  No DMA  */
+	case HDIO_GET_MULTCOUNT:	/*  We don't have a limitation of number of sectors in op.  */
+	    return put_user (128, (long *) arg);
+	case BLKFLSBUF:
+	case BLKROSET:
+	case BLKROGET:
+	case BLKRASET:
+	case BLKRAGET:
+	case BLKPG:
+    
+	default:
+	    return -EINVAL;
+    }
+}
+
+/* flash_release: release the device */
+static int flash_release (struct inode *inode, struct file *file)
+{
+    
+    return 0;
+}
+
+#ifdef CONFIG_ARMCORE_NOR
+static void flash_done (void)
+{
+	del_gendisk(flash_gendisk);
+	put_disk(flash_gendisk);    
+    blk_cleanup_queue(flash_queue);
+
+    /*	Free memory allocated by flash module  */
+    cl_nor_free_mem ();
+
+    unregister_blkdev (major, DEVICE_NAME);
+}
+#else
+static void flash_done (void)
+{
+}
+#endif
+
+extern int cl_nand_init_module(void);
+extern void cl_nand_cleanup_module(void);
+
+int flash_init_module(void)
+{
+    int error;
+
+    error = cl_nand_init_module();
+    if (error) return error;
+
+    error = nor_flash_init();
+    if (error) return error;
+
+    return 0;
+}
+
+void flash_cleanup_module(void)
+{
+    flash_done();
+    cl_nand_cleanup_module();
+}
+
+module_init (flash_init_module);
+module_exit (flash_cleanup_module);	
+
+//-------------------- CMNLIN.C ---------
+
+#define TRUE 1
+#define FALSE 0
+
+#define FL_CLKS_PER_SEC		    182
+
+#define NAND_HEAP_SIZE	    64000	    /*	bytes  */
+#define NOR_HEAP_SIZE	    50000	    /*	bytes  */
+
+/*  NOR Flash constants  */
+#define NorFlashBlockSize             0x10000L	/*  64 KB  */
+#define NorFlashDiskPagesPerBlock   127
+
+#define NOR_DRIVE_STARTING_BLOCK	28
+
+/*  NOR Flash Functions Support  */
+
+/*  Constructor / destructor  */
+static void Nor_Create(void);
+/*  Basic operations  */
+static void Nor_EnableFlashMap(int EnableFlag);
+static unsigned long Nor_GetSize(void);
+static int Nor_GetPagesPerBlock(void);
+static int Nor_ReadHeader (unsigned short BlockN, cl_nor_block_header* Header);
+static int Nor_ReadPage (unsigned short BlockN, unsigned char PageNum, CLBYTEPTR DestBuff);
+static int Nor_SetBlockState(unsigned short BlockN, unsigned short Signature,
+			     unsigned short State, unsigned short Reserved);
+static int Nor_InvalidatePage(unsigned short BlockN, unsigned char PageN);
+static int Nor_WritePage(unsigned short BlockN, unsigned char PageN,
+                           CLBYTEPTR PageData, unsigned short PageIndex);
+static int Nor_EraseBlock(unsigned short BlockN);
+
+extern volatile unsigned short * NorFlashMem;
+unsigned char Nor_IntelFlash;
+
+void Nor_EmptyFunc(void){};
+
+cl_nor_flash_access NorFlashAccess =
+	{
+		Nor_Create,
+		Nor_EmptyFunc, /*NULL,*/		/*  Destructor not needed  */
+		Nor_GetSize,
+		Nor_EnableFlashMap,
+		Nor_GetPagesPerBlock,
+		Nor_ReadHeader,
+		Nor_ReadPage,
+		Nor_SetBlockState,
+		Nor_InvalidatePage,
+		Nor_WritePage,
+		Nor_EraseBlock,
+	};
+
+/*  Driver see NOR Flash Blocks as linear, while there are BIOS holes  */
+static int Nor_GetPhysBlockIndex (int BlockN)
+{
+    return (BlockN + NOR_DRIVE_STARTING_BLOCK);
+}
+
+static void NorWrWord(unsigned long index, unsigned short data)
+{
+    *(NorFlashMem+index)=data;
+}
+extern void NorWrWord(unsigned long index, unsigned short data);
+
+static unsigned short NorRdWord(unsigned long index)
+{
+    return *(NorFlashMem+index);
+}
+
+static unsigned char Nor_OutAMDCommand(unsigned short command)
+{
+    NorWrWord(0x555, 0xAAAA);        
+    NorWrWord(0x2AA, 0x5555);        
+    NorWrWord(0x555, command);        
+    return TRUE;
+}
+
+
+static void Nor_Create(void)
+{
+    /*	Nothing should be done here - all services are provided by BIOS  */
+}
+
+static unsigned long Nor_GetSize(void)
+{
+    unsigned long NorFlashSize = 0x100000;
+    unsigned short n;
+/*    unsigned long i; */
+    
+    /*  Determine flash type  */
+    NorWrWord(0, 0xFFFF);
+    NorWrWord(0, 0x9090);
+    if(NorRdWord(0) == 0x89)
+        Nor_IntelFlash = TRUE;
+    else Nor_IntelFlash = FALSE;
+    NorWrWord(0, 0xFFFF);
+
+    /*  Query flash size  */
+    /*  1. Do reset command  */
+    NorWrWord(0, 0xF0F0);        /*  was 0f0f  */
+    NorWrWord(0, 0xFFFF);        /*  Will also reset intel flash  */
+    /*  2. Enter CFI mode  */
+    NorWrWord(0x55, 0x9898);
+    /*  3. Read flash size  */
+/*  READ WHOLE CFI  for (i=10; i<0x3D; i++){
+        n = NorRdWord(i);
+        printk("CFI n=%x\n", n);} */
+    n = NorRdWord(0x27);
+    /*  4. Do reset again - exit CFI mode  */
+    NorWrWord(0, 0xF0F0);        /*  was 0f0f  */
+    NorWrWord(0, 0xFFFF);        /*  Will also reset intel flash  */
+    /*  Exclude BIOS area  */
+    if((n>0x17) | (n<0x14)) n=0x14; // if detection is unsuccessfull (no CFI) default to 1MB
+    NorFlashSize = (1 << n);        /*  2 ^ n  */
+
+    cl_error_log("NOR Flash (%s) size: %d MB total\n",(Nor_IntelFlash ? "Intel" : "AMD"),NorFlashSize / (1024 * 1024));
+                  
+    if(NorFlashSize == (1024 * 1024)) {
+		cl_error_log("1Mb flash not supported!\n");
+		return 0;
+	}
+    
+    return     NorFlashSize -= NOR_DRIVE_STARTING_BLOCK * 64L * 1024L; /*exclude BIOS and jump areas, spareblocks etc.*/
+}
+
+/*  Remaps or unmaps MMS windows, allocated by flash  */
+static void Nor_EnableFlashMap (int EnableFlag)
+{
+    /*	Just to prevent warning  */
+    int x = EnableFlag;
+    EnableFlag = x;
+    /*	Nothing should be done here - all services are provided by BIOS  */
+}
+
+static int Nor_GetPagesPerBlock(void)
+{
+    return NorFlashDiskPagesPerBlock;
+}
+
+static int Nor_ReadHeader (unsigned short BlockN, cl_nor_block_header* Header)
+{
+
+    cl_mem_copy (Header,
+                 (char*)(NorFlashMem + (0x8000 * Nor_GetPhysBlockIndex(BlockN))),
+                 (sizeof (cl_nor_block_header) + 1) & 0xFFFE);
+    return 1;
+}
+
+static int Nor_ReadPage (unsigned short BlockN, unsigned char PageNum, CLBYTEPTR DestBuff)
+{
+    cl_mem_copy (DestBuff,
+                 (char*)(NorFlashMem + (0x8000 * Nor_GetPhysBlockIndex(BlockN)) +
+                               ((PageNum + 1) * (CL_NOR_FLASH_PAGE_SIZE / 2))),
+                 CL_NOR_FLASH_PAGE_SIZE);
+    return 1;
+}
+
+static int Nor_EraseBlock(unsigned short BlockN)
+{
+    unsigned long addr;
+    unsigned short dummy;
+    
+    addr=(Nor_GetPhysBlockIndex(BlockN)*NorFlashBlockSize)/2;
+    if(Nor_IntelFlash)
+    {           /*  Erase block sequence from Intel flash  */
+        NorWrWord(addr, 0xFFFF);
+        NorWrWord(addr, 0x7070);
+        NorWrWord(addr, 0x2020);
+        NorWrWord(addr, 0xD0D0);
+        NorWrWord(addr, 0xD0D0);
+        while(!(NorRdWord(addr) & 128))
+            ;
+        NorWrWord(0, 0xFFFF);
+        return TRUE;
+    }
+    else
+    {
+        /*  Do "erase block" commands sequence  */
+        if(!Nor_OutAMDCommand(0xF0F0))  return FALSE;
+        dummy = NorRdWord(addr);      /*  read and discard  */
+        if(!Nor_OutAMDCommand(0x8080)) return FALSE;
+        NorWrWord(0x555, 0xAAAA);        
+        NorWrWord(0x2AA, 0x5555);        
+        NorWrWord(addr, 0x3030);        
+
+        /*  Waiting block is erased - no timeout here  */
+        while(TRUE)
+        {
+            /*  Stall processor execution for about 20 microseconds <--- it is much less  */
+            for(dummy = 0;  dummy < 20;  dummy++)
+                ;
+            /*  Check if ready  */
+            if(NorRdWord(addr) == 0xFFFF)
+                return TRUE;
+        }
+    }
+}
+
+static int Nor_SetWord (unsigned long ofs, unsigned short word)
+{
+    unsigned short timeout = 0xFFF;
+    unsigned long addr;
+    addr = ((Nor_GetPhysBlockIndex (ofs >> 15))<<15)+(ofs&0x7FFF);// 15 because address is given for word argument
+    /*  The address should be word aligned since accessing by word and not by byte  */
+
+    if(Nor_IntelFlash)
+    {       /*  Write sequence from Intel flash  */
+        NorWrWord(addr, 0x4040);
+        NorWrWord(addr, word);
+        while(timeout--)
+			udelay(1);
+            if(NorRdWord(addr) & 128)
+            {
+                unsigned char res = !(NorRdWord(addr) & 16);
+                NorWrWord(addr, 0x5050);
+                NorWrWord(addr, 0xFFFF);
+                return res;
+            }
+        NorWrWord(0, 0x5050);
+    }
+    else
+    {       /*  Write sequence from AMD flash  */
+        /*  Output command is a necessary sequence to write word  */
+        if(!Nor_OutAMDCommand(0xA0A0))
+            return FALSE;
+
+        /*  Write data  */
+        NorWrWord(addr, word);
+        /*  Wait data written  */
+        while(timeout--)   {
+			udelay(1);
+            if(NorRdWord(addr) == word)
+                return TRUE;
+		}
+    }
+    /*  Failure  */
+    cl_error_log("ERROR: SetWord timeout.");
+
+    return FALSE;
+}
+
+static int Nor_SetBlockState(unsigned short BlockN, unsigned short Signature,
+                              unsigned short State, unsigned short Reserved)
+{
+    return Nor_SetWord ((BlockN * NorFlashBlockSize + 0)/2, Signature) &&
+           Nor_SetWord ((BlockN * NorFlashBlockSize + 2)/2, State) &&
+           Nor_SetWord ((BlockN * NorFlashBlockSize + 26 + 127 * 2)/2, Reserved);
+}
+
+static int Nor_InvalidatePage (unsigned short BlockN, unsigned char PageN)
+{
+    return Nor_SetWord ((BlockN * NorFlashBlockSize + 6 + 2 * PageN)/2, 0);
+}
+
+static int Nor_WritePage (unsigned short BlockN, unsigned char PageN,
+                            CLBYTEPTR PageData, unsigned short PageIndex)
+{
+    int words_left, dest_addr;
+    unsigned short* ptr;
+
+    /*  Write index to first page - header information  */
+    if(!Nor_SetWord((BlockN * NorFlashBlockSize + 6 + 2 * PageN)/2, PageIndex))
+    {
+        cl_error_log("A");
+        return FALSE;       /*  Couldn't write page index  */
+    }
+
+    /*  Write page data  */
+    words_left = (512 >> 1);     /*  Write by word  */
+    dest_addr = BlockN * NorFlashBlockSize + (PageN + 1) * 512;
+    ptr = (unsigned short*)PageData;
+    while(words_left--)
+    {
+        if(!Nor_SetWord(dest_addr/2, *ptr++))
+        {
+            cl_error_log("B");
+            return FALSE;           /*  Page data writing failure  */
+        }
+        dest_addr += 2;     /*  Write by word (2 bytes each write command)  */
+    }
+
+    return TRUE;
+}
+
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 05ba410..a820db0 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -1020,5 +1020,11 @@ config TELCLOCK
 	  sysfs directory, /sys/devices/platform/telco_clock, with a number of
 	  files for controlling the behavior of this hardware.
 
+
+config EMV3020_RTC
+      tristate "EM-V3020 RTC"
+      ---help---
+        Support for EM Microelectronics V3020 RTC
+
 endmenu
 
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 503dd90..625bfd9 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -49,6 +49,7 @@ obj-$(CONFIG_VIOCONS) += viocons.o
 obj-$(CONFIG_VIOTAPE)		+= viotape.o
 obj-$(CONFIG_HVCS)		+= hvcs.o
 obj-$(CONFIG_SGI_MBCS)		+= mbcs.o
+obj-$(CONFIG_EMV3020_RTC)       += emv3020.o
 
 obj-$(CONFIG_PRINTER) += lp.o
 obj-$(CONFIG_TIPAR) += tipar.o
diff --git a/drivers/char/emv3020.c b/drivers/char/emv3020.c
new file mode 100644
index 0000000..df7f1a4
--- /dev/null
+++ b/drivers/char/emv3020.c
@@ -0,0 +1,365 @@
+/*
+ * emv3020.c
+ *
+ * Driver for EMV3020 RTC
+ *
+ * Copyright (C) 2006 Compulab Ltd.
+ *
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/rtc.h>
+#include <linux/bcd.h>
+#include <linux/clk.h>
+
+#include <asm/hardware.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/rtc.h>
+
+#include <asm/hardware.h>
+#include <asm/delay.h>
+
+#define EMV3020_VA_RTC		emv3020_rtc_base
+
+static struct resource *emv3020_rtc_mem;
+static void __iomem *emv3020_rtc_base;
+
+#define DEBUG 0
+#if DEBUG
+static unsigned int rtc_debug = DEBUG;
+#else
+#define rtc_debug 0     /* gcc will remove all the debug code for us */
+#endif
+
+static void emv3020_set_reg(unsigned char address, unsigned char data)
+{
+	int i;
+
+	for ( i = 0; i < 4; i++ )
+		writel((address << (16-i)), EMV3020_VA_RTC);
+
+	if ( address < 0xe)
+		for ( i = 0; i < 8; i++)
+			writel((data << (16-i)), EMV3020_VA_RTC);
+}
+
+static unsigned char emv3020_get_reg(unsigned char address)
+{
+	unsigned int data=0;
+	int i, tmp;
+
+	for ( i = 0; i < 4; i++ )
+		writel((address << (16-i)), EMV3020_VA_RTC);
+
+	for ( i = 0; i < 8; i++ ) {
+		tmp = readl(EMV3020_VA_RTC);
+		data |= ((tmp & 0x10000) >> (16 - i));
+	}
+
+	return data;
+}
+
+static int emv3020_detect(struct device *dev) 
+{
+	int i;
+	int temp;
+
+	for ( i=0; i<8; i++)
+		temp = readl(EMV3020_VA_RTC);
+
+	emv3020_set_reg(0x2, 0x33);
+
+	if ( emv3020_get_reg(0x2) == 0x33 ) {
+		emv3020_set_reg(0x0, 0x0);	
+		return 0;
+	}
+
+	return -ENODEV;
+}
+ 
+static int emv3020_rtc_gettime(struct rtc_time *dt)
+{
+	int ret=0;
+
+	emv3020_set_reg(0x0F, 0);
+
+	dt->tm_sec  = emv3020_get_reg(0x02);
+	dt->tm_min  = emv3020_get_reg(0x03);
+	dt->tm_hour = emv3020_get_reg(0x04);
+	dt->tm_mday = emv3020_get_reg(0x05);
+	dt->tm_mon  = emv3020_get_reg(0x06);
+	dt->tm_wday = emv3020_get_reg(0x08);
+	dt->tm_year = emv3020_get_reg(0x07);
+
+	BCD_TO_BIN(dt->tm_sec);
+	BCD_TO_BIN(dt->tm_min);
+	BCD_TO_BIN(dt->tm_hour);
+	BCD_TO_BIN(dt->tm_mday);
+	BCD_TO_BIN(dt->tm_mon);
+	BCD_TO_BIN(dt->tm_wday);
+	BCD_TO_BIN(dt->tm_year);
+	dt->tm_year += 100;
+
+	if(rtc_debug)printk("\n%s : Read RTC values\n",__FUNCTION__);
+	if(rtc_debug)printk("tm_hour: %i\n",dt->tm_hour);
+	if(rtc_debug)printk("tm_min : %i\n",dt->tm_min);
+	if(rtc_debug)printk("tm_sec : %i\n",dt->tm_sec);
+	if(rtc_debug)printk("tm_year: %i\n",dt->tm_year);
+	if(rtc_debug)printk("tm_mon : %i\n",dt->tm_mon);
+	if(rtc_debug)printk("tm_mday: %i\n",dt->tm_mday);
+	if(rtc_debug)printk("tm_wday: %i\n",dt->tm_wday);
+
+	return ret;
+}
+
+static int emv3020_rtc_settime(struct rtc_time *dt)
+{
+	if(rtc_debug)printk("\n%s : Setting RTC values\n",__FUNCTION__);
+	if(rtc_debug)printk("tm_sec : %i\n",dt->tm_sec);
+	if(rtc_debug)printk("tm_min : %i\n",dt->tm_min);
+	if(rtc_debug)printk("tm_hour: %i\n",dt->tm_hour);
+	if(rtc_debug)printk("tm_mday: %i\n",dt->tm_mday);
+	if(rtc_debug)printk("tm_wday: %i\n",dt->tm_wday);
+	if(rtc_debug)printk("tm_year: %i\n",dt->tm_year);
+
+	dt->tm_year %= 100;
+	BIN_TO_BCD(dt->tm_sec);
+	BIN_TO_BCD(dt->tm_min);
+	BIN_TO_BCD(dt->tm_hour);
+	BIN_TO_BCD(dt->tm_mday);
+	BIN_TO_BCD(dt->tm_mon);
+	BIN_TO_BCD(dt->tm_wday);
+	BIN_TO_BCD(dt->tm_year);
+
+	emv3020_set_reg(0x02, dt->tm_sec);
+	emv3020_set_reg(0x03, dt->tm_min);
+	emv3020_set_reg(0x04, dt->tm_hour);
+	emv3020_set_reg(0x05, dt->tm_mday);
+	emv3020_set_reg(0x06, dt->tm_mon);
+	emv3020_set_reg(0x08, dt->tm_wday);
+	emv3020_set_reg(0x07, dt->tm_year);
+
+	emv3020_set_reg(0x0E, 0);
+
+	return 0;
+}
+
+static int emv3020_rtc_open(void)
+{
+	return 0;
+}
+
+static void emv3020_rtc_release(void)
+{
+}
+
+static int emv3020_rtc_ioctl(unsigned int cmd, unsigned long arg)
+{
+	struct rtc_time wtime;
+	int status = 0;
+
+	switch (cmd) {
+		default:
+		case RTC_UIE_ON:
+		case RTC_UIE_OFF:
+		case RTC_PIE_ON:
+		case RTC_PIE_OFF:
+		case RTC_AIE_ON:
+		case RTC_AIE_OFF:
+		case RTC_ALM_SET: 
+		case RTC_ALM_READ:
+		case RTC_IRQP_READ:
+		case RTC_IRQP_SET:
+		case RTC_EPOCH_READ:
+		case RTC_EPOCH_SET:
+		case RTC_WKALM_SET:
+		case RTC_WKALM_RD:
+			status = -EINVAL;
+			break;
+
+		case RTC_RD_TIME:
+			emv3020_rtc_gettime(&wtime);
+			if( copy_to_user((void *)arg, &wtime,
+					 sizeof (struct rtc_time)))
+				status = -EFAULT;
+			break;
+
+		case RTC_SET_TIME:
+			if (!capable(CAP_SYS_TIME)) {
+				status = -EACCES;
+				break;
+			}
+
+			if (copy_from_user(&wtime, (struct rtc_time *)arg,
+					   sizeof(struct rtc_time)) ) {
+				status = -EFAULT;
+				break;
+			}
+
+			emv3020_rtc_settime(&wtime);
+			break;
+	}
+
+	return status;
+}
+
+static char *emv3020_mon2str(unsigned int mon)
+{
+        char *mon2str[12] = {
+          "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+          "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+        };
+        if( mon > 11) return "error";
+        else return mon2str[ mon];
+}
+
+static int emv3020_rtc_proc( char *buf)
+{
+	char *p = buf;
+	struct rtc_time dt;
+
+	emv3020_rtc_gettime(&dt);
+
+	p += sprintf(p, "\nEMV3020 (Real Time Clock)\n");
+	p += sprintf(p, "Date/Time           : %02d-%s-%04d %02d:%02d:%02d\n",
+		     dt.tm_mday,
+		     emv3020_mon2str(dt.tm_mon),
+		     dt.tm_year+1900,
+		     dt.tm_hour,
+		     dt.tm_min,
+		     dt.tm_sec);
+	return  p - buf;
+}
+
+static struct rtc_ops emv3020_rtcops = {
+	.owner		= THIS_MODULE,
+	.open		= emv3020_rtc_open,
+	.release	= emv3020_rtc_release,
+	.ioctl		= emv3020_rtc_ioctl,
+	.read_time	= emv3020_rtc_gettime,
+	.set_time	= emv3020_rtc_settime,
+	.read_alarm	= 0,
+	.set_alarm	= 0,
+	.proc	        = emv3020_rtc_proc,
+};
+
+static int emv3020_rtc_remove(struct device *dev)
+{
+	unregister_rtc(&emv3020_rtcops);
+
+	if (emv3020_rtc_mem != NULL) {
+		pr_debug("emv3020_rtc: releasing emv3020_rtc_mem\n");
+		iounmap(emv3020_rtc_base);
+		release_resource(emv3020_rtc_mem);
+	}
+
+	return 0;
+}
+
+static int emv3020_rtc_probe(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct resource *res;
+	int ret;
+
+	pr_debug("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev);
+
+	/* get the memory region */
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (res == NULL) {
+		dev_err(dev, "failed to get memory region resource\n");
+		return -ENOENT;
+	}
+
+	emv3020_rtc_mem = request_mem_region(res->start, 
+					     res->end - res->start + 1,
+					     pdev->name);
+
+	if (emv3020_rtc_mem == NULL) {
+		dev_err(dev, "failed to reserve memory region\n");
+		ret = -ENOENT;
+		goto exit_err;
+	}
+
+	emv3020_rtc_base = ioremap(res->start, res->end - res->start + 1);
+	if (emv3020_rtc_base == NULL) {
+		dev_err(dev, "failed ioremap()\n");
+		ret = -EINVAL;
+		goto exit_err;
+	}
+
+	emv3020_rtc_mem = res;
+	pr_debug("emv3020_rtc_base=%p\n", emv3020_rtc_base);
+
+	/* check to see if everything is setup correctly */
+	if ( (ret = emv3020_detect(dev)) != 0 ) {
+		iounmap(emv3020_rtc_base);
+		release_resource(emv3020_rtc_mem);
+		goto exit_err;
+	}
+
+	/* register RTC and exit */
+	register_rtc(&emv3020_rtcops);
+
+	return 0;
+
+ exit_err:
+	dev_err(dev, "error %d during initialisation\n", ret);
+
+	return ret;
+}
+
+#ifdef CONFIG_PM
+/* EMV3020 RTC Power management control */
+static int emv3020_rtc_suspend(struct device *dev, pm_message_t state)
+{
+	return 0;
+}
+
+static int emv3020_rtc_resume(struct device *dev)
+{
+	return 0;
+}
+#else
+#define emv3020_rtc_suspend NULL
+#define emv3020_rtc_resume  NULL
+#endif
+
+static struct device_driver emv3020_rtcdrv = {
+	.name		= "emv3020-rtc",
+	.bus		= &platform_bus_type,
+	.probe		= emv3020_rtc_probe,
+	.remove		= emv3020_rtc_remove,
+	.suspend	= emv3020_rtc_suspend,
+	.resume		= emv3020_rtc_resume,
+};
+
+static __init int emv3020_init(void)
+{
+	return driver_register(&emv3020_rtcdrv);
+}
+
+static __exit void emv3020_exit(void)
+{
+	driver_unregister(&emv3020_rtcdrv);
+}
+
+module_init(emv3020_init);
+module_exit(emv3020_exit);
+
+
+MODULE_AUTHOR ("Compulab Ltd.");
+MODULE_LICENSE ("GPL");
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index d633081..5e7f6ee 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -850,6 +850,13 @@ config BLK_DEV_IDE_BAST
 	  Say Y here if you want to support the onboard IDE channels on the
 	  Simtec BAST or the Thorcom VR1000
 
+config BLK_DEV_IDE_CM_X270
+	tristate "CompuLab CM-X270 IDE support"
+	depends on ARM && (MACH_ARMCORE)
+	help
+	  Say Y here if you want to support the onboard IDE channels on the
+	  CompuLab CM-X270 module
+
 config BLK_DEV_GAYLE
 	bool "Amiga Gayle IDE interface support"
 	depends on AMIGA
diff --git a/drivers/ide/arm/Makefile b/drivers/ide/arm/Makefile
index 6a78f07..e5cadb7 100644
--- a/drivers/ide/arm/Makefile
+++ b/drivers/ide/arm/Makefile
@@ -2,5 +2,6 @@
 obj-$(CONFIG_BLK_DEV_IDE_ICSIDE)	+= icside.o
 obj-$(CONFIG_BLK_DEV_IDE_RAPIDE)	+= rapide.o
 obj-$(CONFIG_BLK_DEV_IDE_BAST)		+= bast-ide.o
+obj-$(CONFIG_BLK_DEV_IDE_CM_X270)	+= cm-x270-ide.o
 
 EXTRA_CFLAGS	:= -Idrivers/ide
diff --git a/drivers/ide/arm/cm-x270-ide.c b/drivers/ide/arm/cm-x270-ide.c
new file mode 100644
index 0000000..d0e9b8a
--- /dev/null
+++ b/drivers/ide/arm/cm-x270-ide.c
@@ -0,0 +1,135 @@
+/* linux/drivers/ide/arm/cm-x270-ide.c
+ *
+ * Copyright (c) 2006 CompuLab, Ltd
+ *  Mike Rapoport <mike@compulab.co.il>
+ *
+ * Based on linux/drivers/ide/arm/bast-ide.c
+ * Copyright (c) 2003-2004 Simtec Electronics
+ *  Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/ide.h>
+#include <linux/init.h>
+
+#include <asm/mach-types.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/cm-x270.h>
+
+#define CMX270_SB270_IDECS0_VIRT (CMX270_IDE104_VIRT + (1<<24) + (1<<25))
+#define CMX270_SB270_IDECS1_VIRT (CMX270_IDE104_VIRT + (1<<25))
+#define CMX270_ATX_IDECS0_VIRT (CMX270_IDE104_VIRT + (1<<25))
+#define CMX270_ATX_IDECS1_VIRT (CMX270_IDE104_VIRT + (1<<25) + (1<<22))
+
+/* list of registered interfaces */
+static ide_hwif_t *ifs[1];
+
+static int __init
+cmx270_ide_register(unsigned int base, unsigned int aux, int irq,
+		 ide_hwif_t **hwif)
+{
+	hw_regs_t hw;
+
+	memset(&hw, 0, sizeof(hw));
+
+	if(!base || !aux) return -EINVAL;
+
+	printk(KERN_DEBUG "%s: base = %08x, aux = %08x\n", __FUNCTION__,
+	       base, aux);
+
+        /* Different mappings for local bus IDE and PCMCIA IDE */
+	if(base == CMX270_SB270_IDECS0_VIRT) {
+		hw.io_ports[IDE_DATA_OFFSET] = base + 0;
+		hw.io_ports[IDE_ERROR_OFFSET] = base + (0x1<<3);
+		hw.io_ports[IDE_NSECTOR_OFFSET]= base + (0x2<<3);
+		hw.io_ports[IDE_SECTOR_OFFSET]= base + (0x3<<3);
+		hw.io_ports[IDE_LCYL_OFFSET]= base + (0x4<<3);
+		hw.io_ports[IDE_HCYL_OFFSET]= base + (0x5<<3);
+		hw.io_ports[IDE_SELECT_OFFSET]=	base + (0x6<<3);
+		hw.io_ports[IDE_STATUS_OFFSET]=	base + (0x7<<3);
+		hw.io_ports[IDE_CONTROL_OFFSET] = aux+(0x6<<3);
+	}
+	else if (base == CMX270_ATX_IDECS0_VIRT) { /* atx base */
+		hw.io_ports[IDE_DATA_OFFSET] = base + 0;
+		hw.io_ports[IDE_ERROR_OFFSET] =	base + 8;
+		hw.io_ports[IDE_NSECTOR_OFFSET]= base + 2;
+		hw.io_ports[IDE_SECTOR_OFFSET]= base + 10;
+		hw.io_ports[IDE_LCYL_OFFSET]= base + 4;
+		hw.io_ports[IDE_HCYL_OFFSET]= base + 12;
+		hw.io_ports[IDE_SELECT_OFFSET]= base + 6; //6;
+		hw.io_ports[IDE_STATUS_OFFSET]= base + 14;
+		hw.io_ports[IDE_CONTROL_OFFSET] = (aux+0x6);
+	} else {
+		printk(KERN_DEBUG "%s: registering wrong IDE i/f\n", __FUNCTION__);
+		hw.io_ports[IDE_DATA_OFFSET] = base + 8;
+		hw.io_ports[IDE_ERROR_OFFSET] = base + 13;
+		hw.io_ports[IDE_NSECTOR_OFFSET] = base + 2;
+		hw.io_ports[IDE_SECTOR_OFFSET] = base + 3;
+		hw.io_ports[IDE_LCYL_OFFSET] = base + 4;
+		hw.io_ports[IDE_HCYL_OFFSET] = base + 5;
+		hw.io_ports[IDE_SELECT_OFFSET] = base + 6;
+		hw.io_ports[IDE_STATUS_OFFSET] = base + 7;
+		hw.io_ports[IDE_CONTROL_OFFSET] = aux;
+	}
+	
+	hw.irq = irq;
+
+	return ide_register_hw(&hw, hwif);
+}
+
+static int __init cmx270_ide_init(void)
+{
+	int retval = 0;
+
+	if (!(machine_is_armcore()))
+		goto out;
+
+	printk("CM-X270: initializing IDE interface\n");
+
+	MSC1 = 0x7ffc7ff4;
+
+	/* Interrupts on rising edge: lines are inverted before they get to
+           the PXA */
+	pxa_gpio_mode(IRQ_TO_GPIO(CMX270_IDE_IRQ));
+
+	/* try SB-X270 */
+	set_irq_type(CMX270_IDE_IRQ, IRQT_RISING);
+	retval = cmx270_ide_register(CMX270_SB270_IDECS0_VIRT,
+				 CMX270_SB270_IDECS1_VIRT,
+				 CMX270_IDE_IRQ, &ifs[0]);
+	if (retval >= 0) {
+		printk(KERN_DEBUG "%s: found IDE interface on SB-X270\n",
+		       __FUNCTION__);
+		goto out;
+	}
+
+	/* SB-X270 detection failed, try ATX */
+	set_irq_type(CMX270_IDE_IRQ, IRQT_FALLING);
+	retval = cmx270_ide_register(CMX270_ATX_IDECS0_VIRT,
+				 CMX270_ATX_IDECS1_VIRT,
+				 CMX270_IDE_IRQ, &ifs[0]);
+
+	if ( retval >= 0 ) {
+		printk(KERN_DEBUG "%s: found IDE interface on ATX\n",
+		       __FUNCTION__);
+		goto out;
+	}
+
+  out:
+	return retval;
+}
+
+module_init(cmx270_ide_init);
+
+MODULE_AUTHOR("CompuLab");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("CompuLab CM-X270 IDE driver");
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 550f297..ed5bb70 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -23,3 +23,13 @@ config MCP_UCB1200_TS
 	depends on MCP_UCB1200 && INPUT
 
 endmenu
+
+config UCB1400
+	tristate
+
+config UCB1400_TS
+	tristate "UCB1400 Touchscreen support"
+	depends on ARCH_LUBBOCK || MACH_MAINSTONE || MACH_ARMCORE
+	select UCB1400
+	select SND_AC97_BUS
+
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index adb29b5..24429d1 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -10,3 +10,10 @@ obj-$(CONFIG_MCP_UCB1200_TS)	+= ucb1x00-
 ifeq ($(CONFIG_SA1100_ASSABET),y)
 obj-$(CONFIG_MCP_UCB1200)	+= ucb1x00-assabet.o
 endif
+
+ucb1400-core-y			:= ucb1x00-core.o mcp-ac97.o
+obj-$(CONFIG_UCB1400_TS)	+= ucb1400-core.o ucb1x00-ts.o
+
+ucb1400-core-$(CONFIG_UCB1400)	:= ucb1x00-core.o mcp-ac97.o
+obj-$(CONFIG_UCB1400_TS)	+= ucb1400-core.o ucb1x00-ts.o
+
diff --git a/drivers/mfd/mcp-ac97.c b/drivers/mfd/mcp-ac97.c
new file mode 100644
index 0000000..223f8c2
--- /dev/null
+++ b/drivers/mfd/mcp-ac97.c
@@ -0,0 +1,151 @@
+/*
+ * linux/drivers/misc/mcp-ac97.c
+ *
+ * Author:	Nicolas Pitre
+ * Created:	Jan 14, 2005
+ * Copyright:	(C) MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This module provides the minimum replacement for mcp-core.c allowing for
+ * the UCB1400 chip to be driven by the ucb1x00 driver over an AC97 link.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/device.h>
+
+#include <sound/driver.h>
+#include <sound/core.h>
+#include <sound/ac97_codec.h>
+
+#include "mcp.h"
+
+/* ucb1x00 SIB register to ucb1400 AC-link register mapping */
+
+static const unsigned char regmap[] = {
+	0x5a,	/* UCB_IO_DATA */
+	0X5C,	/* UCB_IO_DIR */
+	0X5E,	/* UCB_IE_RIS */
+	0x60,	/* UCB_IE_FAL */
+	0x62,	/* UCB_IE_STATUS */
+	0,	/* UCB_TC_A */
+	0,	/* UCB_TC_B */
+	0,	/* UCB_AC_A */
+	0,	/* UCB_AC_B */
+	0x64,	/* UCB_TS_CR */
+	0x66,	/* UCB_ADC_CR */
+	0x68,	/* UCB_ADC_DATA */
+	0x7e,	/* UCB_ID */
+	0,	/* UCB_MODE */
+};
+
+unsigned int mcp_reg_read(struct mcp *mcp, unsigned int reg)
+{
+	ac97_t *ac97 = to_ac97_t(mcp->dev);
+	if (reg < ARRAY_SIZE(regmap)) {
+		reg = regmap[reg];
+		if (reg)
+			return ac97->bus->ops->read(ac97, reg);
+	}
+	return -1;
+}
+EXPORT_SYMBOL(mcp_reg_read);
+
+void mcp_reg_write(struct mcp *mcp, unsigned int reg, unsigned int val)
+{
+	ac97_t *ac97 = to_ac97_t(mcp->dev);
+	if (reg < ARRAY_SIZE(regmap)) {
+		reg = regmap[reg];
+		if (reg)
+			ac97->bus->ops->write(ac97, reg, val);
+	}
+}
+EXPORT_SYMBOL(mcp_reg_write);
+
+void mcp_enable(struct mcp *mcp)
+{
+}
+EXPORT_SYMBOL(mcp_enable);
+
+void mcp_disable(struct mcp *mcp)
+{
+}
+EXPORT_SYMBOL(mcp_disable);
+
+#define to_mcp_driver(d)	container_of(d, struct mcp_driver, drv)
+
+static int mcp_probe(struct device *dev)
+{
+	struct mcp_driver *drv = to_mcp_driver(dev->driver);
+	struct mcp *mcp;
+	int ret;
+
+	ret = -ENOMEM;
+	mcp = kmalloc(sizeof(*mcp), GFP_KERNEL);
+	if (mcp) {
+		memset(mcp, 0, sizeof(*mcp));
+		mcp->owner = THIS_MODULE;
+		mcp->dev = dev;
+		ret = drv->probe(mcp);
+		if (ret)
+			kfree(mcp);
+	}
+	if (!ret)
+		dev_set_drvdata(dev, mcp);
+	return ret;
+}
+
+static int mcp_remove(struct device *dev)
+{
+	struct mcp_driver *drv = to_mcp_driver(dev->driver);
+	struct mcp *mcp = dev_get_drvdata(dev);
+
+	drv->remove(mcp);
+	dev_set_drvdata(dev, NULL);
+	kfree(mcp);
+	return 0;
+}
+
+static int mcp_suspend(struct device *dev, pm_message_t state)
+{
+	struct mcp_driver *drv = to_mcp_driver(dev->driver);
+	struct mcp *mcp = dev_get_drvdata(dev);
+	int ret = 0;
+
+	if (drv->suspend)
+		ret = drv->suspend(mcp, state);
+	return ret;
+}
+
+static int mcp_resume(struct device *dev)
+{
+	struct mcp_driver *drv = to_mcp_driver(dev->driver);
+	struct mcp *mcp = dev_get_drvdata(dev);
+	int ret = 0;
+
+	if (drv->resume)
+		ret = drv->resume(mcp);
+	return ret;
+}
+
+int mcp_driver_register(struct mcp_driver *mcpdrv)
+{
+	mcpdrv->drv.owner = THIS_MODULE;
+	mcpdrv->drv.bus = &ac97_bus_type;
+	mcpdrv->drv.probe = mcp_probe;
+	mcpdrv->drv.remove = mcp_remove;
+	mcpdrv->drv.suspend = mcp_suspend;
+	mcpdrv->drv.resume = mcp_resume;
+	return driver_register(&mcpdrv->drv);
+}
+
+void mcp_driver_unregister(struct mcp_driver *mcpdrv)
+{
+	driver_unregister(&mcpdrv->drv);
+}
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/mcp-core.c b/drivers/mfd/mcp-core.c
index 75f401d..2a7c176 100644
--- a/drivers/mfd/mcp-core.c
+++ b/drivers/mfd/mcp-core.c
@@ -208,6 +208,7 @@ struct mcp *mcp_host_alloc(struct device
 		mcp->attached_device.bus = &mcp_bus_type;
 		mcp->attached_device.dma_mask = parent->dma_mask;
 		mcp->attached_device.release = mcp_release;
+		mcp->dev = &mcp->attached_device;
 	}
 	return mcp;
 }
diff --git a/drivers/mfd/mcp.h b/drivers/mfd/mcp.h
index c093a93..2897d8c 100644
--- a/drivers/mfd/mcp.h
+++ b/drivers/mfd/mcp.h
@@ -19,11 +19,12 @@ struct mcp {
 	int		use_count;
 	unsigned int	sclk_rate;
 	unsigned int	rw_timeout;
-	dma_device_t	dma_audio_rd;
-	dma_device_t	dma_audio_wr;
-	dma_device_t	dma_telco_rd;
-	dma_device_t	dma_telco_wr;
+/* 	dma_device_t	dma_audio_rd; */
+/* 	dma_device_t	dma_audio_wr; */
+/* 	dma_device_t	dma_telco_rd; */
+/* 	dma_device_t	dma_telco_wr; */
 	struct device	attached_device;
+	struct device	*dev;
 };
 
 struct mcp_ops {
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index aff83f9..f9a532b 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -23,6 +23,7 @@ #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/kthread.h>
 #include <linux/device.h>
 #include <linux/mutex.h>
 
@@ -31,6 +32,12 @@ #include <asm/hardware.h>
 
 #include "ucb1x00.h"
 
+#if defined(CONFIG_UCB1400) || defined(CONFIG_UCB1400_MODULE)
+#define UCB_IS_1400(id)  ((id) == UCB_ID_1400)
+#else
+#define UCB_IS_1400(id)  (0)
+#endif
+
 static DEFINE_MUTEX(ucb1x00_mutex);
 static LIST_HEAD(ucb1x00_drivers);
 static LIST_HEAD(ucb1x00_devices);
@@ -58,9 +65,9 @@ void ucb1x00_io_set_dir(struct ucb1x00 *
 	spin_lock_irqsave(&ucb->io_lock, flags);
 	ucb->io_dir |= out;
 	ucb->io_dir &= ~in;
+	spin_unlock_irqrestore(&ucb->io_lock, flags);
 
 	ucb1x00_reg_write(ucb, UCB_IO_DIR, ucb->io_dir);
-	spin_unlock_irqrestore(&ucb->io_lock, flags);
 }
 
 /**
@@ -86,9 +93,9 @@ void ucb1x00_io_write(struct ucb1x00 *uc
 	spin_lock_irqsave(&ucb->io_lock, flags);
 	ucb->io_out |= set;
 	ucb->io_out &= ~clear;
+	spin_unlock_irqrestore(&ucb->io_lock, flags);
 
 	ucb1x00_reg_write(ucb, UCB_IO_DATA, ucb->io_out);
-	spin_unlock_irqrestore(&ucb->io_lock, flags);
 }
 
 /**
@@ -178,7 +185,7 @@ unsigned int ucb1x00_adc_read(struct ucb
 		schedule_timeout(1);
 	}
 
-	return UCB_ADC_DAT(val);
+	return UCB_IS_1400(ucb->id) ? (val & 0x3ff) : ((val & 0x7fe0) >> 5);
 }
 
 /**
@@ -223,6 +230,47 @@ static irqreturn_t ucb1x00_irq(int irqnr
 	return IRQ_HANDLED;
 }
 
+/*
+ * A restriction with interrupts exists when using the ucb1400, as
+ * the codec read/write routines may sleep while waiting for codec
+ * access completion and uses semaphores for access control to the
+ * AC97 bus.  A complete codec read cycle could take  anywhere from
+ * 60 to 100uSec so we *definitely* don't want to spin inside the
+ * interrupt handler waiting for codec access.  So, we handle the
+ * interrupt by scheduling a RT kernel thread to run in process
+ * context instead of interrupt context.
+ */
+static int ucb1x00_thread(void *_ucb)
+{
+	struct task_struct *tsk = current;
+	struct ucb1x00 *ucb = _ucb;
+
+	tsk->policy = SCHED_FIFO;
+	tsk->rt_priority = 1;
+	
+	while (!kthread_should_stop()) {
+		wait_for_completion_interruptible(&ucb->irq_wait);
+		if (try_to_freeze())
+			continue;
+		ucb1x00_irq(ucb->irq, ucb, NULL);
+		enable_irq(ucb->irq);
+	}
+
+	ucb->irq_task = NULL;
+	return 0;
+}
+
+static irqreturn_t ucb1x00_threaded_irq(int irqnr, void *devid, struct pt_regs *regs)
+{
+	struct ucb1x00 *ucb = devid;
+	if (irqnr == ucb->irq) {
+		disable_irq(ucb->irq);
+		complete(&ucb->irq_wait);
+		return IRQ_HANDLED;
+	}
+	return IRQ_NONE;
+}
+
 /**
  *	ucb1x00_hook_irq - hook a UCB1x00 interrupt
  *	@ucb:   UCB1x00 structure describing chip
@@ -276,18 +324,22 @@ void ucb1x00_enable_irq(struct ucb1x00 *
 
 	if (idx < 16) {
 		spin_lock_irqsave(&ucb->lock, flags);
-
-		ucb1x00_enable(ucb);
-		if (edges & UCB_RISING) {
+		if (edges & UCB_RISING)
 			ucb->irq_ris_enbl |= 1 << idx;
-			ucb1x00_reg_write(ucb, UCB_IE_RIS, ucb->irq_ris_enbl);
-		}
-		if (edges & UCB_FALLING) {
+		if (edges & UCB_FALLING)
 			ucb->irq_fal_enbl |= 1 << idx;
-			ucb1x00_reg_write(ucb, UCB_IE_FAL, ucb->irq_fal_enbl);
-		}
-		ucb1x00_disable(ucb);
 		spin_unlock_irqrestore(&ucb->lock, flags);
+
+		ucb1x00_enable(ucb);
+
+		/* This prevents spurious interrupts on the UCB1400 */
+		ucb1x00_reg_write(ucb, UCB_IE_CLEAR, 1 << idx);
+		ucb1x00_reg_write(ucb, UCB_IE_CLEAR, 0);
+
+		ucb1x00_reg_write(ucb, UCB_IE_RIS, ucb->irq_ris_enbl);
+		ucb1x00_reg_write(ucb, UCB_IE_FAL, ucb->irq_fal_enbl);
+
+		ucb1x00_disable(ucb);
 	}
 }
 
@@ -305,18 +357,16 @@ void ucb1x00_disable_irq(struct ucb1x00 
 
 	if (idx < 16) {
 		spin_lock_irqsave(&ucb->lock, flags);
-
-		ucb1x00_enable(ucb);
-		if (edges & UCB_RISING) {
+		if (edges & UCB_RISING)
 			ucb->irq_ris_enbl &= ~(1 << idx);
-			ucb1x00_reg_write(ucb, UCB_IE_RIS, ucb->irq_ris_enbl);
-		}
-		if (edges & UCB_FALLING) {
+		if (edges & UCB_FALLING)
 			ucb->irq_fal_enbl &= ~(1 << idx);
-			ucb1x00_reg_write(ucb, UCB_IE_FAL, ucb->irq_fal_enbl);
-		}
-		ucb1x00_disable(ucb);
 		spin_unlock_irqrestore(&ucb->lock, flags);
+
+		ucb1x00_enable(ucb);
+		ucb1x00_reg_write(ucb, UCB_IE_RIS, ucb->irq_ris_enbl);
+		ucb1x00_reg_write(ucb, UCB_IE_FAL, ucb->irq_fal_enbl);
+		ucb1x00_disable(ucb);
 	}
 }
 
@@ -349,16 +399,17 @@ int ucb1x00_free_irq(struct ucb1x00 *ucb
 		ucb->irq_ris_enbl &= ~(1 << idx);
 		ucb->irq_fal_enbl &= ~(1 << idx);
 
-		ucb1x00_enable(ucb);
-		ucb1x00_reg_write(ucb, UCB_IE_RIS, ucb->irq_ris_enbl);
-		ucb1x00_reg_write(ucb, UCB_IE_FAL, ucb->irq_fal_enbl);
-		ucb1x00_disable(ucb);
-
 		irq->fn = NULL;
 		irq->devid = NULL;
 		ret = 0;
 	}
 	spin_unlock_irq(&ucb->lock);
+
+	ucb1x00_enable(ucb);
+	ucb1x00_reg_write(ucb, UCB_IE_RIS, ucb->irq_ris_enbl);
+	ucb1x00_reg_write(ucb, UCB_IE_FAL, ucb->irq_fal_enbl);
+	ucb1x00_disable(ucb);
+
 	return ret;
 
 bad:
@@ -478,7 +529,7 @@ static int ucb1x00_probe(struct mcp *mcp
 	mcp_enable(mcp);
 	id = mcp_reg_read(mcp, UCB_ID);
 
-	if (id != UCB_ID_1200 && id != UCB_ID_1300) {
+	if (id != UCB_ID_1200 && id != UCB_ID_1300 && !UCB_IS_1400(id)) {
 		printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id);
 		goto err_disable;
 	}
@@ -491,12 +542,13 @@ static int ucb1x00_probe(struct mcp *mcp
 	memset(ucb, 0, sizeof(struct ucb1x00));
 
 	ucb->cdev.class = &ucb1x00_class;
-	ucb->cdev.dev = &mcp->attached_device;
+	ucb->cdev.dev = mcp->dev;
 	strlcpy(ucb->cdev.class_id, "ucb1x00", sizeof(ucb->cdev.class_id));
 
 	spin_lock_init(&ucb->lock);
 	spin_lock_init(&ucb->io_lock);
 	sema_init(&ucb->adc_sem, 1);
+	init_completion(&ucb->irq_wait);
 
 	ucb->id  = id;
 	ucb->mcp = mcp;
@@ -507,13 +559,22 @@ static int ucb1x00_probe(struct mcp *mcp
 		goto err_free;
 	}
 
-	ret = request_irq(ucb->irq, ucb1x00_irq, SA_TRIGGER_RISING,
-			  "UCB1x00", ucb);
+	ret = request_irq(ucb->irq,
+			  UCB_IS_1400(id) ? ucb1x00_threaded_irq : ucb1x00_irq,
+			  SA_TRIGGER_RISING, "UCB1x00", ucb);
 	if (ret) {
 		printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n",
 			ucb->irq, ret);
 		goto err_free;
 	}
+	if (UCB_IS_1400(id)) {
+		ucb->irq_task = kthread_run(ucb1x00_thread, ucb, "kUCB1x00d");
+		if (IS_ERR(ucb->irq_task)) {
+			ret = PTR_ERR(ucb->irq_task);
+			ucb->irq_task = NULL;
+			goto err_irq;
+		}
+	}
 
 	mcp_set_drvdata(mcp, ucb);
 
@@ -531,6 +592,8 @@ static int ucb1x00_probe(struct mcp *mcp
 	goto out;
 
  err_irq:
+	if (UCB_IS_1400(id) && ucb->irq_task)
+		kthread_stop(ucb->irq_task);
 	free_irq(ucb->irq, ucb);
  err_free:
 	kfree(ucb);
@@ -553,6 +616,10 @@ static void ucb1x00_remove(struct mcp *m
 	}
 	mutex_unlock(&ucb1x00_mutex);
 
+	if (UCB_IS_1400(ucb->id) && ucb->irq_task) {
+		complete(&ucb->irq_wait);
+		kthread_stop(ucb->irq_task);
+	}
 	free_irq(ucb->irq, ucb);
 	class_device_unregister(&ucb->cdev);
 }
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c
index 79fd062..e68132d 100644
--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -35,7 +35,15 @@ #include <linux/kthread.h>
 
 #include <asm/dma.h>
 #include <asm/semaphore.h>
+
+/* FIXME: proper machine detection should be implemented */
+#ifdef CONFIG_SA1100_COLLIE
 #include <asm/arch/collie.h>
+#else
+#define machine_is_collie() (0)
+#define COLLIE_TC35143_GPIO_TBL_CHK (0)
+#endif
+
 #include <asm/mach-types.h>
 
 #include "ucb1x00.h"
@@ -45,7 +53,7 @@ struct ucb1x00_ts {
 	struct input_dev	*idev;
 	struct ucb1x00		*ucb;
 
-	wait_queue_head_t	irq_wait;
+	struct completion	irq_wait;
 	struct task_struct	*rtask;
 	u16			x_res;
 	u16			y_res;
@@ -98,7 +106,8 @@ static inline unsigned int ucb1x00_ts_re
 		udelay(55);
 
 		return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_AD2, ts->adcsync);
-	} else {
+	} 
+	else {
 		ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
 				  UCB_TS_CR_TSMX_POW | UCB_TS_CR_TSPX_POW |
 				  UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_GND |
@@ -205,7 +214,6 @@ static int ucb1x00_thread(void *_ts)
 {
 	struct ucb1x00_ts *ts = _ts;
 	struct task_struct *tsk = current;
-	DECLARE_WAITQUEUE(wait, tsk);
 	int valid;
 
 	/*
@@ -217,10 +225,8 @@ static int ucb1x00_thread(void *_ts)
 
 	valid = 0;
 
-	add_wait_queue(&ts->irq_wait, &wait);
 	while (!kthread_should_stop()) {
 		unsigned int x, y, p;
-		signed long timeout;
 
 		ts->restart = 0;
 
@@ -242,8 +248,6 @@ static int ucb1x00_thread(void *_ts)
 
 
 		if (ucb1x00_ts_pen_down(ts)) {
-			set_task_state(tsk, TASK_INTERRUPTIBLE);
-
 			ucb1x00_enable_irq(ts->ucb, UCB_IRQ_TSPX, machine_is_collie() ? UCB_RISING : UCB_FALLING);
 			ucb1x00_disable(ts->ucb);
 
@@ -256,7 +260,15 @@ static int ucb1x00_thread(void *_ts)
 				valid = 0;
 			}
 
-			timeout = MAX_SCHEDULE_TIMEOUT;
+			/*
+			 * Since ucb1x00_enable_irq() might sleep due
+			 * to the way the UCB1400 regs are accessed, we
+			 * can't use set_task_state() before that call,
+			 * and not changing state before enabling the
+			 * interrupt is racy. A completion handler avoids
+			 * the issue.
+			 */
+			wait_for_completion_interruptible(&ts->irq_wait);
 		} else {
 			ucb1x00_disable(ts->ucb);
 
@@ -271,16 +283,12 @@ static int ucb1x00_thread(void *_ts)
 			}
 
 			set_task_state(tsk, TASK_INTERRUPTIBLE);
-			timeout = HZ / 100;
+			schedule_timeout(HZ/100);
 		}
 
 		try_to_freeze();
-
-		schedule_timeout(timeout);
 	}
 
-	remove_wait_queue(&ts->irq_wait, &wait);
-
 	ts->rtask = NULL;
 	return 0;
 }
@@ -293,7 +301,7 @@ static void ucb1x00_ts_irq(int idx, void
 {
 	struct ucb1x00_ts *ts = id;
 	ucb1x00_disable_irq(ts->ucb, UCB_IRQ_TSPX, UCB_FALLING);
-	wake_up(&ts->irq_wait);
+	complete(&ts->irq_wait);
 }
 
 static int ucb1x00_ts_open(struct input_dev *idev)
@@ -303,7 +311,7 @@ static int ucb1x00_ts_open(struct input_
 
 	BUG_ON(ts->rtask);
 
-	init_waitqueue_head(&ts->irq_wait);
+	init_completion(&ts->irq_wait);
 	ret = ucb1x00_hook_irq(ts->ucb, UCB_IRQ_TSPX, ucb1x00_ts_irq, ts);
 	if (ret < 0)
 		goto out;
@@ -337,8 +345,10 @@ static void ucb1x00_ts_close(struct inpu
 {
 	struct ucb1x00_ts *ts = idev->private;
 
-	if (ts->rtask)
+	if (ts->rtask) {
+		complete(&ts->irq_wait);
 		kthread_stop(ts->rtask);
+	}
 
 	ucb1x00_enable(ts->ucb);
 	ucb1x00_free_irq(ts->ucb, UCB_IRQ_TSPX, ts);
@@ -358,7 +368,7 @@ static int ucb1x00_ts_resume(struct ucb1
 		 * after sleep.
 		 */
 		ts->restart = 1;
-		wake_up(&ts->irq_wait);
+		complete(&ts->irq_wait);
 	}
 	return 0;
 }
diff --git a/drivers/mfd/ucb1x00.h b/drivers/mfd/ucb1x00.h
index 9c9a647..ff04dc9 100644
--- a/drivers/mfd/ucb1x00.h
+++ b/drivers/mfd/ucb1x00.h
@@ -94,6 +94,7 @@ #define UCB_ADC_DAT(x)		(((x) & 0x7fe0) 
 #define UCB_ID		0x0c
 #define UCB_ID_1200		0x1004
 #define UCB_ID_1300		0x1005
+#define UCB_ID_1400		0x4304
 
 #define UCB_MODE	0x0d
 #define UCB_MODE_DYN_VFLAG_ENA	(1 << 12)
@@ -110,6 +111,8 @@ struct ucb1x00 {
 	spinlock_t		lock;
 	struct mcp		*mcp;
 	unsigned int		irq;
+	struct task_struct	*irq_task;
+	struct completion	irq_wait;
 	struct semaphore	adc_sem;
 	spinlock_t		io_lock;
 	u16			id;
@@ -122,6 +125,7 @@ struct ucb1x00 {
 	struct class_device	cdev;
 	struct list_head	node;
 	struct list_head	devs;
+
 };
 
 struct ucb1x00_driver;
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 1fc4c13..c238ede 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -182,6 +182,10 @@ config MTD_NAND_DISKONCHIP_BBTWRITE
  config MTD_NAND_SHARPSL
  	bool "Support for NAND Flash on Sharp SL Series (C7xx + others)"
  	depends on MTD_NAND && ARCH_PXA
+
+ config MTD_NAND_CM_X270
+ 	tristate "Support for NAND Flash on CompuLab CM-X270"
+ 	depends on MTD_NAND && ARCH_PXA
  
  config MTD_NAND_NANDSIM
  	bool "Support for NAND Flash Simulator"
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 4174202..9a9e0c9 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_MTD_NAND_DISKONCHIP)	+= dis
 obj-$(CONFIG_MTD_NAND_H1900)		+= h1910.o
 obj-$(CONFIG_MTD_NAND_RTC_FROM4)	+= rtc_from4.o
 obj-$(CONFIG_MTD_NAND_SHARPSL)		+= sharpsl.o
+obj-$(CONFIG_MTD_NAND_CM_X270)		+= cmx270-nand.o
 obj-$(CONFIG_MTD_NAND_NANDSIM)		+= nandsim.o
 
 nand-objs = nand_base.o nand_bbt.o
diff --git a/drivers/mtd/nand/cmx270-nand.c b/drivers/mtd/nand/cmx270-nand.c
new file mode 100644
index 0000000..32b6288
--- /dev/null
+++ b/drivers/mtd/nand/cmx270-nand.c
@@ -0,0 +1,281 @@
+/*
+ *  drivers/mtd/nand/cmx270-nand.c
+ *
+ *  Copyright (C) 2005 Compulab, Ltd. (mike@compulab.co.il)
+ *
+ *  Derived from drivers/mtd/nand/h1910.c
+ *       Copyright (C) 2002 Marius Gr�ger (mag@sysgo.de)
+ *       Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de)
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Overview:
+ *   This is a device driver for the NAND flash device found on the
+ *   CM-X270 board.
+ */
+
+#include <linux/config.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/pxa-regs.h>
+
+#define GPIO_NAND_CS	(11)
+#define GPIO_NAND_RB	(89)
+
+#define DRAIN_WB() \
+	do { \
+		unsigned char dummy; \
+		asm volatile ("mcr p15, 0, r0, c7, c10, 4":::"r0"); \
+		dummy=*((volatile unsigned char*)UNCACHED_ADDR); \
+	} while(0);
+
+/*
+ * MTD structure for CM-X270 board
+ */
+static struct mtd_info *cmx270_nand_mtd = NULL;
+
+/*
+ * Module stuff
+ */
+
+#ifdef CONFIG_MTD_PARTITIONS
+/*
+ * Define static partitions for flash device
+ */
+static struct mtd_partition partition_info[] = {
+	[0] = {
+		.name = "cmx270-0",
+		.offset = 0,
+		.size = MTDPART_SIZ_FULL
+	}
+};
+#define NUM_PARTITIONS ARRAY_SIZE(partition_info)
+
+#endif
+
+
+static 	u_char cmx270_read_byte(struct mtd_info *mtd)
+{
+	struct nand_chip *this = mtd->priv;
+	return (readl(this->IO_ADDR_R) >> 16);
+}
+
+static void cmx270_write_byte(struct mtd_info *mtd, u_char byte)
+{
+	struct nand_chip *this = mtd->priv;
+	writel((byte << 16), this->IO_ADDR_W);
+}
+
+static void cmx270_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
+{
+	int i;
+	struct nand_chip *this = mtd->priv;
+
+	for (i=0; i<len; i++) {
+		writel((*buf++ << 16), this->IO_ADDR_W);
+	}
+}
+
+static void cmx270_read_buf(struct mtd_info *mtd, u_char *buf, int len)
+{
+	int i;
+	struct nand_chip *this = mtd->priv;
+
+	for (i=0; i<len; i++) {
+		*buf++ = readl(this->IO_ADDR_R) >> 16;
+	}
+}
+
+static int cmx270_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
+{
+	int i;
+	struct nand_chip *this = mtd->priv;
+
+	for (i=0; i<len; i++) {
+		if ( buf[i] != (u_char)(readl(this->IO_ADDR_R) >> 16) )
+			return -EFAULT;
+	}
+
+	return 0;
+}
+
+static inline void nand_cs_on(void)
+{
+	GPCR(GPIO_NAND_CS) = GPIO_bit(GPIO_NAND_CS);
+}
+
+static void nand_cs_off(void)
+{
+	DRAIN_WB();
+
+	GPSR(GPIO_NAND_CS) = GPIO_bit(GPIO_NAND_CS);
+}
+
+/*
+ *	hardware specific access to control-lines
+ */
+static void cmx270_hwcontrol(struct mtd_info *mtd, int cmd)
+{
+	struct nand_chip* this = (struct nand_chip *) (mtd->priv);
+	unsigned int nandaddr = (unsigned int)this->IO_ADDR_R;
+
+	DRAIN_WB();
+
+	switch(cmd) {
+
+	case NAND_CTL_SETCLE:
+		nandaddr |= (1 << 2);
+		this->IO_ADDR_R = (void __iomem*)nandaddr;
+		this->IO_ADDR_W = (void __iomem*)nandaddr;
+		break;
+	case NAND_CTL_CLRCLE:
+		nandaddr &= ~(1 << 2);
+		this->IO_ADDR_R = (void __iomem*)nandaddr;
+		this->IO_ADDR_W = (void __iomem*)nandaddr;
+		break;
+
+	case NAND_CTL_SETALE:
+		nandaddr |= (1 << 3);
+		this->IO_ADDR_R = (void __iomem*)nandaddr;
+		this->IO_ADDR_W = (void __iomem*)nandaddr;
+		break;
+	case NAND_CTL_CLRALE:
+		nandaddr &= ~(1 << 3);
+		this->IO_ADDR_R = (void __iomem*)nandaddr;
+		this->IO_ADDR_W = (void __iomem*)nandaddr;
+		break;
+
+	case NAND_CTL_SETNCE:
+		nand_cs_on();
+		break;
+	case NAND_CTL_CLRNCE:
+		nand_cs_off();
+		break;
+	}
+
+	DRAIN_WB();
+}
+
+/*
+ *	read device ready pin
+ */
+static int cmx270_device_ready(struct mtd_info *mtd)
+{
+	DRAIN_WB();
+	return ( GPLR(GPIO_NAND_RB) & GPIO_bit(GPIO_NAND_RB) );
+}
+
+/*
+ * Main initialization routine
+ */
+static int __init cmx270_init (void)
+{
+	struct nand_chip *this;
+	const char *part_type = 0;
+	int mtd_parts_nb = 0;
+	struct mtd_partition *mtd_parts = 0;
+	static unsigned int nandaddr = 0;
+
+
+	/* Allocate memory for MTD device structure and private data */
+	cmx270_nand_mtd = kmalloc(sizeof(struct mtd_info) +
+				    sizeof(struct nand_chip),
+				    GFP_KERNEL);
+	if (!cmx270_nand_mtd) {
+		printk("Unable to allocate CM-X270 NAND MTD device structure.\n");
+		return -ENOMEM;
+	}
+
+	nandaddr = (volatile unsigned int)ioremap(PXA_CS1_PHYS, 100);
+
+	/* Get pointer to private data */
+	this = (struct nand_chip *) (&cmx270_nand_mtd[1]);
+
+	/* Initialize structures */
+	memset((char *) cmx270_nand_mtd, 0, sizeof(struct mtd_info));
+	memset((char *) this, 0, sizeof(struct nand_chip));
+
+	/* Link the private data with the MTD structure */
+	cmx270_nand_mtd->priv = this;
+
+	/* insert callbacks */
+	this->IO_ADDR_R = (void __iomem *)nandaddr;
+	this->IO_ADDR_W = (void __iomem *)nandaddr;
+	this->hwcontrol = cmx270_hwcontrol;
+/* 	this->dev_ready = cmx270_device_ready;	/\* unknown whether that was correct or not so we will just do it like this *\/ */
+
+	/* 15 us command delay time */
+	this->chip_delay = 50;
+	this->eccmode = NAND_ECC_SOFT;
+
+	/* read/write functions */
+	this->read_byte = cmx270_read_byte;
+	this->write_byte = cmx270_write_byte;
+	this->read_buf = cmx270_read_buf;
+	this->write_buf = cmx270_write_buf;
+	this->verify_buf = cmx270_verify_buf;
+
+	/* Scan to find existence of the device */
+	if (nand_scan (cmx270_nand_mtd, 1)) {
+		printk(KERN_NOTICE "No NAND device - returning -ENXIO\n");
+		iounmap((void*)nandaddr);
+		kfree (cmx270_nand_mtd);
+		return -ENXIO;
+	}
+
+#ifdef CONFIG_MTD_CMDLINE_PARTS
+	mtd_parts_nb = parse_cmdline_partitions(cmx270_nand_mtd, &mtd_parts,
+						"cmx270");
+	if (mtd_parts_nb > 0)
+	  part_type = "command line";
+	else
+	  mtd_parts_nb = 0;
+#endif
+	if (mtd_parts_nb == 0)
+	{
+		mtd_parts = partition_info;
+		mtd_parts_nb = NUM_PARTITIONS;
+		part_type = "static";
+	}
+
+	/* Register the partitions */
+	printk(KERN_NOTICE "Using %s partition definition\n", part_type);
+	add_mtd_partitions(cmx270_nand_mtd, mtd_parts, mtd_parts_nb);
+
+	/* Return happy */
+	return 0;
+}
+module_init(cmx270_init);
+
+/*
+ * Clean up routine
+ */
+static void __exit cmx270_cleanup (void)
+{
+	struct nand_chip *this;
+
+	this = (struct nand_chip *) (&cmx270_nand_mtd[1]);
+	iounmap(this->IO_ADDR_R);
+
+	/* Release resources, unregister device */
+	nand_release (cmx270_nand_mtd);
+
+	/* Free the MTD device structure */
+	kfree (cmx270_nand_mtd);
+}
+module_exit(cmx270_cleanup);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mike Rapoport <mike at compulab dot co dot il>");
+MODULE_DESCRIPTION("NAND flash driver for Compulab CM-X270 Core");
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index aa633fa..505f92b 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -865,6 +865,14 @@ config DM9000
 	  <file:Documentation/networking/net-modules.txt>.  The module will be
 	  called dm9000.
 
+config DM9000_NOEPROM
+	bool "DM9000 without EEPROM attached"
+	depends on DM9000
+	---help---
+	  Select this option if you have DM9000 chipset without EEPROM
+	  containing the MAC address. In this case MAC address should
+	  be set either by the bootloader or using ifconfig
+
 config NET_VENDOR_RACAL
 	bool "Racal-Interlan (Micom) NI cards"
 	depends on NET_ETHERNET && ISA
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 24996da..7e45756 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -561,8 +561,14 @@ #endif
 		((u16 *) db->srom)[i] = read_srom_word(db, i);
 
 	/* Set Node Address */
+#ifndef CONFIG_DM9000_NOEPROM
 	for (i = 0; i < 6; i++)
 		ndev->dev_addr[i] = db->srom[i];
+#else
+	/* The Node Address was set by bootloader */
+	for (i=0; i<6; i++)
+		ndev->dev_addr[i] = ior(db, 0x10+i);
+#endif
 
 	if (!is_valid_ether_addr(ndev->dev_addr))
 		printk("%s: Invalid ethernet MAC address.  Please "
@@ -1098,6 +1104,10 @@ dm9000_phy_read(struct net_device *dev, 
 	/* The read data keeps on REG_0D & REG_0E */
 	ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);
 
+/* 	if ( reg == MII_BMSR ) { */
+/* 		printk(KERN_WARNING "===> %s: ret = %x\n", __FUNCTION__, ret); */
+/* 	} */
+
 	/* restore the previous address */
 	writeb(reg_save, db->io_addr);
 
@@ -1163,7 +1173,6 @@ dm9000_drv_resume(struct platform_device
 		if (netif_running(ndev)) {
 			dm9000_reset(db);
 			dm9000_init_dm9000(ndev);
-
 			netif_device_attach(ndev);
 		}
 	}
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index bcecf51..b6a4173 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -68,4 +68,4 @@ sa1100_cs-$(CONFIG_SA1100_SIMPAD)		+= sa
 pxa2xx_cs-$(CONFIG_ARCH_LUBBOCK)		+= pxa2xx_lubbock.o sa1111_generic.o
 pxa2xx_cs-$(CONFIG_MACH_MAINSTONE)		+= pxa2xx_mainstone.o
 pxa2xx_cs-$(CONFIG_PXA_SHARPSL)			+= pxa2xx_sharpsl.o
-
+pxa2xx_cs-$(CONFIG_MACH_ARMCORE)		+= pxa2xx_cm_x270.o
diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c
new file mode 100644
index 0000000..eb4df11
--- /dev/null
+++ b/drivers/pcmcia/pxa2xx_cm_x270.c
@@ -0,0 +1,198 @@
+/*
+ * linux/drivers/pcmcia/pxa/pxa_armcore.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Compulab Ltd., 2003
+ * 
+ */
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/platform_device.h>
+
+#include <pcmcia/ss.h>
+#include <asm/delay.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/cm-x270.h>
+
+#include "soc_common.h"
+
+
+static struct pcmcia_irqs irqs[] = {
+	{ 0, PCMCIA_S0_CD_VALID, "PCMCIA0 CD" },
+	{ 1, PCMCIA_S1_CD_VALID, "PCMCIA1 CD" },
+};
+
+
+static int 
+cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
+{
+	int return_val=0;
+	
+	GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
+		GPIO_bit(GPIO49_nPWE) |
+		GPIO_bit(GPIO50_nPIOR) |
+		GPIO_bit(GPIO51_nPIOW) |
+		GPIO_bit(GPIO85_nPCE_1) |
+		GPIO_bit(GPIO54_nPCE_2);
+
+	pxa_gpio_mode(GPIO48_nPOE_MD);
+	pxa_gpio_mode(GPIO49_nPWE_MD);
+	pxa_gpio_mode(GPIO50_nPIOR_MD);
+	pxa_gpio_mode(GPIO51_nPIOW_MD);
+	pxa_gpio_mode(GPIO85_nPCE_1_MD);
+	pxa_gpio_mode(GPIO54_nPCE_2_MD);
+	//pxa_gpio_mode(GPIO79_pSKTSEL_MD); /* REVISIT: s/b dependent on num sockets (on ATX base not routed)*/
+	pxa_gpio_mode(GPIO55_nPREG_MD);
+	pxa_gpio_mode(GPIO56_nPWAIT_MD);
+	pxa_gpio_mode(GPIO57_nIOIS16_MD);
+
+	// Reset signal 
+	GPDR(GPIO53_nPCE_2) |= GPIO_bit(GPIO53_nPCE_2);
+	GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
+	
+	GPDR(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID));
+	GPDR(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID));
+	
+	set_irq_type(PCMCIA_S0_CD_VALID, IRQT_BOTHEDGE);
+	set_irq_type(PCMCIA_S1_CD_VALID, IRQT_BOTHEDGE);
+
+	//irq's for slots:
+	GPDR(IRQ_TO_GPIO(PCMCIA_S0_RDYINT)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S0_RDYINT));
+	GPDR(IRQ_TO_GPIO(PCMCIA_S1_RDYINT)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S1_RDYINT));
+
+	set_irq_type(PCMCIA_S0_RDYINT, IRQT_FALLING);
+	set_irq_type(PCMCIA_S1_RDYINT, IRQT_FALLING);
+	
+	skt->irq = (skt->nr == 0) ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT;
+	return_val = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+
+	return return_val;
+}
+
+
+static void cmx270_pcmcia_shutdown(struct soc_pcmcia_socket *skt)
+{
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+
+	set_irq_type(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID), IRQT_NOEDGE);
+	set_irq_type(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID), IRQT_NOEDGE);
+
+	set_irq_type(IRQ_TO_GPIO(PCMCIA_S0_RDYINT), IRQT_NOEDGE);
+	set_irq_type(IRQ_TO_GPIO(PCMCIA_S1_RDYINT), IRQT_NOEDGE);
+}
+
+
+static void cmx270_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+				    struct pcmcia_state *state)
+{
+
+	state->detect = (PCC_DETECT(skt->nr) == 0) ? 1 : 0;  
+	state->ready  = (PCC_READY(skt->nr) == 0) ? 0 : 1;
+	state->bvd1   = 1;
+	state->bvd2   = 1;
+	state->vs_3v  = 0;
+	state->vs_Xv  = 0;
+	state->wrprot = 0;  /* not available */
+
+}
+
+
+static int
+cmx270_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
+				       const socket_state_t *state)
+{
+
+	GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
+	pxa_gpio_mode(GPIO49_nPWE | GPIO_OUT);
+	//pxa_gpio_mode(GPIO79_pSKTSEL_MD | GPIO_OUT); /* For 2-socket mode */
+
+	switch(skt->nr){
+	    case 0:
+			if(state->flags & SS_RESET) {
+				//GPCR(GPIO79_pSKTSEL) = GPIO_bit(GPIO79_pSKTSEL); /* For 2-socket mode */
+				//udelay(1);
+				GPCR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
+				GPSR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
+				udelay(10);
+				GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
+				GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
+			}
+		    break;
+		case 1:
+			if(state->flags & SS_RESET) {
+				//GPCR(GPIO79_pSKTSEL) = GPIO_bit(GPIO79_pSKTSEL); /* For 2-socket mode */
+				//udelay(1);
+				GPCR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
+				GPSR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
+				udelay(10);
+				GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
+				GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
+			}
+		    break;
+	}  
+
+	pxa_gpio_mode(GPIO49_nPWE_MD);
+	//pxa_gpio_mode(GPIO79_pSKTSEL_MD); /* For 2-socket mode */
+
+
+	return 0;
+}
+
+static void cmx270_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
+{
+}
+
+static void cmx270_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
+{
+}
+
+
+static struct pcmcia_low_level cmx270_pcmcia_ops = {
+	.owner			= THIS_MODULE,
+	.hw_init		= cmx270_pcmcia_hw_init,
+	.hw_shutdown		= cmx270_pcmcia_shutdown,
+	.socket_state		= cmx270_pcmcia_socket_state,
+	.configure_socket	= cmx270_pcmcia_configure_socket,
+	.socket_init		= cmx270_pcmcia_socket_init,
+	.socket_suspend		= cmx270_pcmcia_socket_suspend,
+	.nr			= 2,
+};
+
+static struct platform_device *cmx270_pcmcia_device;
+
+static int __init cmx270_pcmcia_init(void)
+{
+	int ret;
+
+	cmx270_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
+
+	if (!cmx270_pcmcia_device)
+		return -ENOMEM;
+
+	cmx270_pcmcia_device->dev.platform_data = &cmx270_pcmcia_ops;
+
+	printk ("Registering cm-x270 PCMCIA interface.\n");
+	ret = platform_device_add(cmx270_pcmcia_device);
+
+	if (ret)
+		platform_device_put(cmx270_pcmcia_device);
+
+	return ret;
+}
+
+static void __exit cmx270_pcmcia_exit(void)
+{
+	platform_device_unregister(cmx270_pcmcia_device);
+}
+
+module_init(cmx270_pcmcia_init);
+module_exit(cmx270_pcmcia_exit);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index 10535f0..7f7fd02 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -49,6 +49,21 @@ #include <asm/hardware.h>
 #include <asm/irq.h>
 #include <asm/arch/pxa-regs.h>
 
+#define SERIAL_SA1100_MAJOR	204
+#define MINOR_START		5
+
+#ifdef CONFIG_MACH_ARMCORE
+extern int machine_is_cmx270l(void);
+#define SWITCH_CONSOLE()	\
+	do {	\
+		if ( machine_is_cmx270l() ) { \
+			serial_pxa_switch_ports(&serial_pxa_ports[0], \
+						&serial_pxa_ports[1]); \
+		} \
+	} while (0)
+#else
+#define SWITCH_CONSOLE()	do {} while (0)
+#endif
 
 struct uart_pxa_port {
 	struct uart_port        port;
@@ -584,6 +599,23 @@ serial_pxa_type(struct uart_port *port)
 	return up->name;
 }
 
+static void
+serial_pxa_switch_ports(struct uart_pxa_port* port1,
+			struct uart_pxa_port* port2)
+{
+	int tmp_line;
+	static struct uart_pxa_port tmp_port;
+	
+	tmp_line = port1->port.line;
+	port1->port.line = port2->port.line;
+	port2->port.line = tmp_line;
+
+	memcpy(&tmp_port, port1, sizeof(struct uart_pxa_port));
+	memcpy(port1, port2, sizeof(struct uart_pxa_port));
+	memcpy(port2, &tmp_port, sizeof(struct uart_pxa_port));
+}
+
+
 #ifdef CONFIG_SERIAL_PXA_CONSOLE
 
 static struct uart_pxa_port serial_pxa_ports[];
@@ -683,7 +715,7 @@ serial_pxa_console_setup(struct console 
 }
 
 static struct console serial_pxa_console = {
-	.name		= "ttyS",
+	.name		= "ttySA",
 	.write		= serial_pxa_console_write,
 	.device		= uart_console_device,
 	.setup		= serial_pxa_console_setup,
@@ -695,6 +727,8 @@ static struct console serial_pxa_console
 static int __init
 serial_pxa_console_init(void)
 {
+	SWITCH_CONSOLE();
+
 	register_console(&serial_pxa_console);
 	return 0;
 }
@@ -788,11 +822,16 @@ static struct uart_pxa_port serial_pxa_p
 
 static struct uart_driver serial_pxa_reg = {
 	.owner		= THIS_MODULE,
-	.driver_name	= "PXA serial",
-	.devfs_name	= "tts/",
-	.dev_name	= "ttyS",
-	.major		= TTY_MAJOR,
-	.minor		= 64,
+/* 	.driver_name	= "PXA serial", */
+/* 	.devfs_name	= "tts/", */
+/* 	.dev_name	= "ttyS", */
+/* 	.major		= TTY_MAJOR, */
+/* 	.minor		= 64, */
+	.driver_name		= "ttySA",
+	.dev_name		= "ttySA",
+	.devfs_name		= "ttySA",
+	.major			= SERIAL_SA1100_MAJOR,
+	.minor			= MINOR_START,
 	.nr		= ARRAY_SIZE(serial_pxa_ports),
 	.cons		= PXA_CONSOLE,
 };
@@ -852,6 +891,10 @@ int __init serial_pxa_init(void)
 {
 	int ret;
 
+#ifndef CONFIG_SERIAL_PXA_CONSOLE
+	SWITCH_CONSOLE();
+#endif
+
 	ret = uart_register_driver(&serial_pxa_reg);
 	if (ret != 0)
 		return ret;
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index f5079c7..e49580a 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1387,6 +1387,16 @@ config FB_PXA_PARAMETERS
 
 	  <file:Documentation/fb/pxafb.txt> describes the available parameters.
 
+config FB_MBX
+	tristate "2700G LCD framebuffer support"
+	depends on FB && ARCH_PXA
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	---help---
+
+	  If unsure, say N.
+
 config FB_W100
 	tristate "W100 frame buffer support"
 	depends on FB && PXA_SHARPSL
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index aa434e7..c6fe5e4 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -94,6 +94,7 @@ obj-$(CONFIG_FB_TX3912)		  += tx3912fb.o
 obj-$(CONFIG_FB_S1D13XXX)	  += s1d13xxxfb.o
 obj-$(CONFIG_FB_IMX)              += imxfb.o
 obj-$(CONFIG_FB_S3C2410)	  += s3c2410fb.o
+obj-$(CONFIG_FB_MBX)		  += mbx/
 
 # Platform or fallback drivers go here
 obj-$(CONFIG_FB_VESA)             += vesafb.o
diff --git a/drivers/video/mbx/Makefile b/drivers/video/mbx/Makefile
new file mode 100644
index 0000000..ef6b729
--- /dev/null
+++ b/drivers/video/mbx/Makefile
@@ -0,0 +1,7 @@
+# Makefile for the Linux video drivers.
+# 5 Aug 1999, James Simmons, <mailto:jsimmons@users.sf.net>
+# Rewritten to use lists instead of if-statements.
+
+# Each configuration option enables a list of files.
+
+obj-$(CONFIG_FB_MBX)	+= mbxfb.o
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
new file mode 100644
index 0000000..93dcfa5
--- /dev/null
+++ b/drivers/video/mbx/mbxfb.c
@@ -0,0 +1,659 @@
+/*
+ *  linux/drivers/video/mbx/mbxfb.c
+ *
+ *  Copyright (C) 2006 Compulab, Ltd.
+ *
+ *   Based on pxafb.c
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file COPYING in the main directory of this archive for
+ * more details.
+ *
+ *   Intel 2700G (Marathon) Graphics Accelerator Frame Buffer Driver
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/interrupt.h>
+#include <linux/slab.h>
+#include <linux/fb.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/cpufreq.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/uaccess.h>
+#include <asm/div64.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/bitfield.h>
+#include <asm/arch/marathonfb.h>
+
+static unsigned long virt_base_2700;
+#include "regs.h"
+#include "reg_bits.h"
+
+#define MIN_XRES	16
+#define MIN_YRES	16
+#define MAX_XRES	2048
+#define MAX_YRES	2048
+
+/* FIXME: take care of different chip reivsions with different sizes
+   of ODFB */
+#define MEMORY_OFFSET	0x60000
+
+struct mbxfb_info {
+		struct device *dev;
+		
+		struct resource *fb_res;
+		struct resource *fb_req;
+
+		struct resource *reg_res;
+		struct resource *reg_req;
+
+		void __iomem *fb_virt_addr;
+		unsigned long fb_phys_addr;
+
+		void __iomem *reg_virt_addr;
+		unsigned long reg_phys_addr;
+
+		int (*platform_probe)(struct fb_info *fb);
+		int (*platform_remove)(struct fb_info *fb);
+};
+
+static struct fb_var_screeninfo mbxfb_default __initdata = {
+	.xres =		640,
+	.yres =		480,
+	.xres_virtual =	640,
+	.yres_virtual =	480,
+	.bits_per_pixel = 16,
+	.red =		{ 11, 5, 0 },
+      	.green =	{ 5, 6, 0 },
+      	.blue =		{ 0, 5, 0 },
+      	.activate =	FB_ACTIVATE_TEST,
+      	.height =	-1,
+      	.width =	-1,
+      	.pixclock =	40000,
+      	.left_margin =	48,
+      	.right_margin =	16,
+      	.upper_margin =	33,
+      	.lower_margin =	10,
+      	.hsync_len =	96,
+      	.vsync_len =	2,
+      	.vmode =	FB_VMODE_NONINTERLACED,
+	.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+};
+
+static struct fb_fix_screeninfo mbxfb_fix __initdata = {
+	.id =		"MBX",
+	.type =		FB_TYPE_PACKED_PIXELS,
+	.visual =	FB_VISUAL_TRUECOLOR,
+	.xpanstep =	0,
+	.ypanstep =	0,
+	.ywrapstep =	0,
+	.accel =	FB_ACCEL_NONE,
+};
+
+struct pixclock_div {
+	u8 m;
+	u8 n;
+	u8 p;
+};
+
+static unsigned int mbxfb_get_pixclock(unsigned int pixclock_ps, struct pixclock_div *div)
+{
+	u8  m, n, p;
+	unsigned int err = 0;
+	unsigned int min_err = ~0x0;
+	unsigned int clk;
+	unsigned int best_clk = 0;
+	unsigned int ref_clk = 13000; /* FIXME: take from platform data */
+	unsigned int pixclock;
+
+	/* convert pixclock to KHz */
+	pixclock = PICOS2KHZ(pixclock_ps);
+
+	for ( m = 1; m < 64; m++ ) {
+		for ( n = 1; n < 8; n++ ) {
+			for ( p = 0; p < 8; p++ ) {
+				clk = (ref_clk * m) / (n * (1 << p));
+				err = (clk > pixclock) ? (clk - pixclock) : 
+					(pixclock - clk);
+				if ( err < min_err ) {
+					min_err = err;
+					best_clk = clk;
+					div->m = m;
+					div->n = n;
+					div->p = p;
+				}
+			}
+		}
+	}
+	return KHZ2PICOS(best_clk);
+}
+
+static int
+mbxfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+		   u_int trans, struct fb_info *info)
+{
+	uint val, ret = 1;
+
+	if ( regno < 255 ) {
+		val = (red & 0xff) << 16;
+		val |= (green & 0xff) << 8;
+		val |= (blue & 0xff) << 0;
+		GPLUT = Gplut_Lutadr(regno) | Gplut_Lutdata(val);
+		udelay(1000);
+		ret = 0;
+	}
+	return ret;
+}
+
+static int mbxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
+{
+	struct pixclock_div div;
+	
+	var->pixclock = mbxfb_get_pixclock(var->pixclock, &div);
+
+	if (var->xres < MIN_XRES)
+		var->xres = MIN_XRES;
+	if (var->yres < MIN_YRES)
+		var->yres = MIN_YRES;
+	if (var->xres > MAX_XRES)
+		var->xres = MAX_XRES;
+	if (var->yres > MAX_YRES)
+		var->yres = MAX_YRES;
+	var->xres_virtual =
+		max(var->xres_virtual, var->xres);
+	var->yres_virtual =
+		max(var->yres_virtual, var->yres);
+
+	switch (var->bits_per_pixel) {
+	/* FIXME: implement 8 bits-per-pixel */
+	case 8:
+		var->bits_per_pixel = 16;
+	case 16:
+		var->green.length = (var->green.length == 5) ? 5 : 6;
+		var->red.length = 5;
+		var->blue.length = 5;
+		var->transp.length = 6 - var->green.length;
+		var->blue.offset = 0;
+		var->green.offset = 5;
+		var->red.offset = 5 + var->green.length;
+		var->transp.offset =  (5 + var->red.offset) & 15;
+		break;
+	case 24:	/* RGB 888   */
+	case 32:	/* RGBA 8888 */
+		var->red.offset = 16;
+		var->red.length = 8;
+		var->green.offset = 8;
+		var->green.length = 8;
+		var->blue.offset = 0;
+		var->blue.length = 8;
+		var->transp.length = var->bits_per_pixel - 24;
+		var->transp.offset = (var->transp.length) ? 24 : 0;
+		break;
+	}
+	var->red.msb_right = 0;
+	var->green.msb_right = 0;
+	var->blue.msb_right = 0;
+	var->transp.msb_right = 0;
+
+	return 0;
+}
+
+static int mbxfb_set_par(struct fb_info *info)
+{
+	struct fb_var_screeninfo *var = &info->var;
+	struct pixclock_div div;
+	ushort hbps, ht, hfps, has;
+	ushort vbps, vt, vfps, vas;
+
+	info->fix.line_length = var->xres_virtual * var->bits_per_pixel / 8;
+	
+	/* setup color mode */
+	GSCTRL &= ~(FMsk(GSCTRL_GPIXFMT));
+	/* FIXME: add *WORKING* support for 8-bits per color */
+	if ( info->var.bits_per_pixel == 8 ) {
+		GSCTRL |= GSCTRL_GPIXFMT_INDEXED;
+		GSCTRL |= GSCTRL_LUT_EN;
+		GSCTRL &= ~GSCTRL_GAMMA_EN;
+		info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
+		fb_alloc_cmap(&info->cmap, 1<<info->var.bits_per_pixel, 0);
+	}
+	else {
+		fb_dealloc_cmap(&info->cmap);
+		GSCTRL &= ~GSCTRL_LUT_EN;
+		info->fix.visual = FB_VISUAL_TRUECOLOR;
+		switch ( info->var.bits_per_pixel ) {
+			case 16:
+				if ( info->var.green.length == 5 )
+					GSCTRL |= GSCTRL_GPIXFMT_ARGB1555;
+				else
+					GSCTRL |= GSCTRL_GPIXFMT_RGB565;
+				break;
+			case 24:
+				GSCTRL |= GSCTRL_GPIXFMT_RGB888;
+				break;
+			case 32:
+				GSCTRL |= GSCTRL_GPIXFMT_ARGB8888;
+				break;
+		}
+	}
+
+	/* setup resolution */
+	GSCTRL &= ~(FMsk(GSCTRL_GSWIDTH) | FMsk(GSCTRL_GSHEIGHT));
+	GSCTRL |= Gsctrl_Width(info->var.xres - 1) |
+		Gsctrl_Height(info->var.yres - 1);
+	
+	GSADR &= ~(FMsk(GSADR_SRCSTRIDE)); udelay(1000);
+	GSADR |=  Gsadr_Srcstride(info->var.xres * info->var.bits_per_pixel / (8 * 16) - 1); udelay(1000);
+
+	/* setup timings */
+	var->pixclock = mbxfb_get_pixclock(info->var.pixclock, &div);
+
+	DISPPLL = Disp_Pll_M(div.m) | Disp_Pll_N(div.n) | Disp_Pll_P(div.p) | DISP_PLL_EN;
+	
+	hbps = var->hsync_len;
+	has = hbps + var->left_margin;
+	hfps = has + var->xres;
+	ht = hfps + var->right_margin;
+
+	vbps = var->vsync_len;
+	vas = vbps + var->upper_margin;
+	vfps = vas + var->yres;
+	vt = vfps + var->lower_margin;
+
+	DHT01 = Dht01_Hbps(hbps) | Dht01_Ht(ht);
+ 	DHT02 = Dht02_Hlbs(has) | Dht02_Has(has);
+	DHT03 = Dht03_Hfps(hfps) | Dht03_Hrbs(hfps);
+	DHDET = Dhdet_Hdes(has) | Dhdet_Hdef(hfps);
+	
+	DVT01 = Dvt01_Vbps(vbps) | Dvt01_Vt(vt);
+	DVT02 = Dvt02_Vtbs(vas) | Dvt02_Vas(vas);
+	DVT03 = Dvt03_Vfps(vfps) | Dvt03_Vbbs(vfps);
+	DVDET = Dvdet_Vdes(vas) | Dvdet_Vdef(vfps);
+	DVECTRL = Dvectrl_Vevent(vfps) | Dvectrl_Vfetch(vbps);
+	DSCTRL |= DSCTRL_SYNCGEN_EN;
+
+	return 0;
+}
+
+static char *blank_mode[] = {
+	"FB_BLANK_UNBLANK",
+	"FB_BLANK_NORMAL",
+	"FB_BLANK_VSYNC_SUSPEND",
+	"FB_BLANK_HSYNC_SUSPEND",
+	"FB_BLANK_POWERDOWN",
+};
+
+static int mbxfb_blank(int blank, struct fb_info *info)
+{
+	switch (blank) {
+	case FB_BLANK_POWERDOWN:
+	case FB_BLANK_VSYNC_SUSPEND:
+	case FB_BLANK_HSYNC_SUSPEND:
+	case FB_BLANK_NORMAL:
+		DSCTRL &= ~DSCTRL_SYNCGEN_EN; udelay(1000);
+		PIXCLK &= ~PIXCLK_EN; udelay(1000);
+		VOVRCLK &= ~VOVRCLK_EN; udelay(1000);
+		break;
+	case FB_BLANK_UNBLANK:
+		DSCTRL |= DSCTRL_SYNCGEN_EN; udelay(1000);
+		PIXCLK |= PIXCLK_EN; udelay(1000);
+		break;
+	}
+	return 0;
+}
+
+static struct fb_ops mbxfb_ops = {
+	.owner		= THIS_MODULE,
+	.fb_check_var	= mbxfb_check_var,
+	.fb_set_par	= mbxfb_set_par,
+	.fb_setcolreg	= mbxfb_setcolreg,
+	.fb_fillrect	= cfb_fillrect,
+	.fb_copyarea	= cfb_copyarea,
+	.fb_imageblit	= cfb_imageblit,
+	.fb_blank	= mbxfb_blank,
+};
+
+/*
+   Enable external SDRAM controller. Assume that all clocks are active
+   by now. 
+*/
+static void setup_memc(struct fb_info *fbi)
+{
+	unsigned long tmp;
+
+	/* FIXME: use platfrom specific parameters */
+	/* setup SDRAM controller */
+	LMCFG = LMCFG_LMC_DS | LMCFG_LMC_TS | LMCFG_LMD_TS | LMCFG_LMA_TS;
+	udelay(1000);
+	LMPWR = LMPWR_MC_PWR_ACT;
+	udelay(1000);
+	/* setup SDRAM timings */
+	LMTIM = Lmtim_Tras(7) | Lmtim_Trp(3) | Lmtim_Trcd(3) | Lmtim_Trc(9) |
+		Lmtim_Tdpl(2);
+	udelay(1000);
+	/* setup SDRAM refresh rate */
+	LMREFRESH = 0xc2b;
+	udelay(1000);
+	/* setup SDRAM type parameters */
+	LMTYPE = LMTYPE_CASLAT_3 | LMTYPE_BKSZ_2 | LMTYPE_ROWSZ_11 | 
+		LMTYPE_COLSZ_8;
+	udelay(1000);
+	/* enable memory controller */
+	LMPWR = LMPWR_MC_PWR_ACT;
+	udelay(1000);
+
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+	tmp = *(unsigned long*)(virt_base_2700 + MEMORY_OFFSET);
+}
+
+static void enable_clocks(struct fb_info* fbi)
+{
+	/* enable clocks */
+	SYSCLKSRC = SYSCLKSRC_PLL_2; udelay(1000);
+	PIXCLKSRC = PIXCLKSRC_PLL_1; udelay(1000);
+	CLKSLEEP = 0x00000000; udelay(1000);
+	COREPLL = Core_Pll_M(0x17) | Core_Pll_N(0x3) | Core_Pll_P(0x0) | CORE_PLL_EN; udelay(1000);
+	DISPPLL = Disp_Pll_M(0x1b) | Disp_Pll_N(0x7) | Disp_Pll_P(0x1) | DISP_PLL_EN;
+
+	VOVRCLK = 0x00000000; udelay(1000);
+	PIXCLK = PIXCLK_EN; udelay(1000);
+	MEMCLK = MEMCLK_EN; udelay(1000);
+	M24CLK = 0x00000006; udelay(1000);
+	MBXCLK = 0x00000006; udelay(1000);
+	SDCLK = SDCLK_EN; udelay(1000);
+	PIXCLKDIV = 0x00000001; udelay(1000);
+}
+
+static void setup_graphics(struct fb_info* fbi)
+{
+	unsigned long gsctrl;
+
+	gsctrl = GSCTRL_GAMMA_EN | Gsctrl_Width(fbi->var.xres-1) |
+		Gsctrl_Height(fbi->var.yres-1);
+	switch ( fbi->var.bits_per_pixel ) {
+		case 16:
+			if ( fbi->var.green.length == 5 )
+				gsctrl |= GSCTRL_GPIXFMT_ARGB1555;
+			else
+				gsctrl |= GSCTRL_GPIXFMT_RGB565;
+			break;
+		case 24: gsctrl |= GSCTRL_GPIXFMT_RGB888; break;
+		case 32: gsctrl |= GSCTRL_GPIXFMT_ARGB8888; break;
+	}
+
+	GSCTRL = gsctrl; udelay(1000);
+	GBBASE = 0x00000000; udelay(1000);
+	GDRCTRL = 0x00ffffff; udelay(1000);
+	GSCADR = GSCADR_STR_EN | Gscadr_Gbase_Adr(0x6000); udelay(1000);
+	GPLUT = 0x00000000; udelay(1000);
+}
+
+static void setup_display(struct fb_info* fbi)
+{
+	unsigned long dsctrl = 0;
+ 
+	dsctrl = DSCTRL_BLNK_POL;
+	if ( fbi->var.sync & FB_SYNC_HOR_HIGH_ACT )
+		dsctrl |= DSCTRL_HS_POL;
+	if ( fbi->var.sync & FB_SYNC_VERT_HIGH_ACT )
+		dsctrl |= DSCTRL_VS_POL;
+	DSCTRL = dsctrl; udelay(1000);
+	DMCTRL = 0xd0303010; udelay(1000);
+	DSCTRL |= DSCTRL_SYNCGEN_EN;
+}
+
+static void enable_controller(struct fb_info* fbi)
+{
+	SYSRST = SYSRST_RST;
+	udelay(1000);
+
+	enable_clocks(fbi);
+	setup_memc(fbi);	
+	setup_graphics(fbi);
+	setup_display(fbi);
+}
+
+
+#ifdef CONFIG_PM
+/*
+ * Power management hooks.  Note that we won't be called from IRQ context,
+ * unlike the blank functions above, so we may sleep.
+ */
+static int mbxfb_suspend(struct platform_device *dev, pm_message_t state)
+{
+	/* make frame buffer memory enter self-refresh mode */
+	LMPWR = LMPWR_MC_PWR_SRM;
+	while ( LMPWRSTAT != LMPWRSTAT_MC_PWR_SRM );
+
+	/* reset the device, since it's initial state is 'mostly sleeping' */
+	SYSRST = SYSRST_RST;
+	return 0;
+}
+
+static int mbxfb_resume(struct platform_device *dev)
+{
+	struct fb_info *fbi = (struct fb_info*)platform_get_drvdata(dev);
+
+	enable_clocks(fbi);
+/* 	setup_graphics(fbi); */
+/* 	setup_display(fbi); */
+
+	DSCTRL |= DSCTRL_SYNCGEN_EN;
+	return 0;
+}
+#else
+#define mbxfb_suspend	NULL
+#define mbxfb_resume	NULL
+#endif
+
+#include "mbxsysfs.c"
+
+#define res_size(_r) (((_r)->end - (_r)->start) + 1)
+
+static int mbxfb_probe(struct platform_device *dev)
+{
+	int ret;
+	struct fb_info *fbi;
+	struct mbxfb_info *mfbi;
+	struct mbxfb_platform_data *pdata;
+
+	dev_dbg(dev, "mbxfb_probe\n");
+
+	fbi = framebuffer_alloc(sizeof(struct mbxfb_info), &dev->dev);
+	if ( fbi == NULL ) {
+		dev_err(&dev->dev, "framebuffer_alloc failed\n");
+		return -ENOMEM;
+	}
+
+	mfbi = fbi->par;
+	pdata = dev->dev.platform_data;
+	if ( pdata->probe )
+		mfbi->platform_probe = pdata->probe;
+	if ( pdata->remove )
+		mfbi->platform_remove = pdata->remove;
+
+	mfbi->fb_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	mfbi->reg_res = platform_get_resource(dev, IORESOURCE_MEM, 1);
+
+	if ( !mfbi->fb_res || !mfbi->reg_res ) {
+		dev_err(&dev->dev, "no resources found\n");
+		ret = -ENODEV;
+		goto err1;
+	}
+
+	mfbi->fb_req = request_mem_region(mfbi->fb_res->start,
+					  res_size(mfbi->fb_res),
+					  dev->name);
+	if ( mfbi->fb_req == NULL ) {
+		dev_err(&dev->dev, "failed to claim framebuffer memory\n");
+		ret = -EINVAL;
+		goto err1;
+	}
+	mfbi->fb_phys_addr = mfbi->fb_res->start;
+
+	mfbi->reg_req = request_mem_region(mfbi->reg_res->start,
+					  res_size(mfbi->reg_res),
+					   dev->name);
+	if ( mfbi->reg_req == NULL ) {
+		dev_err(&dev->dev, "failed to claim Marathon registers\n");
+		ret = -EINVAL;
+		goto err2;
+	}
+	mfbi->reg_phys_addr = mfbi->reg_res->start;
+
+	mfbi->reg_virt_addr = ioremap_nocache(mfbi->reg_phys_addr,
+					      res_size(mfbi->reg_req));
+	if ( !mfbi->reg_virt_addr ) {
+		dev_err(&dev->dev, "failed to ioremap Marathon registers\n");
+		ret = -EINVAL;
+		goto err3;
+	}
+	virt_base_2700 = mfbi->reg_virt_addr;
+
+	mfbi->fb_virt_addr = ioremap_nocache(mfbi->fb_phys_addr,
+					     res_size(mfbi->fb_req));
+	if ( !mfbi->reg_virt_addr ) {
+		dev_err(&dev->dev, "failed to ioremap frame buffer\n");
+		ret = -EINVAL;
+		goto err4;
+	}
+
+	fbi->screen_base = (char __iomem *)(mfbi->fb_virt_addr + 0x60000); /* FIXME: */
+	fbi->screen_size = 8*1024*1024; /* 8 Megs */ /* FIXME: get from platform */
+	fbi->fbops = &mbxfb_ops;
+
+	fbi->var = mbxfb_default;
+	fbi->fix = mbxfb_fix;
+	fbi->fix.smem_start = mfbi->fb_phys_addr + 0x60000;
+	fbi->fix.smem_len = 8*1024*1024;
+	fbi->fix.line_length = 640*2;
+
+	ret = fb_alloc_cmap(&fbi->cmap, 256, 0);
+	if (ret < 0) {
+		dev_err(&dev->dev, "fb_alloc_cmap failed\n");
+		ret = -EINVAL;
+		goto err5;
+	}
+
+	ret = register_framebuffer(fbi);
+	if (ret < 0) {
+		dev_err(&dev->dev, "register_framebuffer failed\n");
+		ret = -EINVAL;
+		goto err6;
+	}
+
+	platform_set_drvdata(dev, fbi);
+
+	printk(KERN_INFO "fb%d: mbx frame buffer device\n", fbi->node);
+
+	if ( mfbi->platform_probe )
+		mfbi->platform_probe(fbi);
+
+	enable_controller(fbi);
+
+	mbxfb_sysfs_register(fbi);
+
+	return 0;
+
+  err6:
+	fb_dealloc_cmap(&fbi->cmap);
+  err5:
+	iounmap(mfbi->fb_virt_addr);
+  err4:
+	iounmap(mfbi->reg_virt_addr);
+  err3:
+	release_mem_region(mfbi->reg_res->start,
+			   res_size(mfbi->reg_res));
+  err2:
+	release_mem_region(mfbi->fb_res->start,
+			   res_size(mfbi->fb_res));
+  err1:
+	framebuffer_release(fbi);
+
+	return ret;
+}
+
+static int mbxfb_remove(struct platform_device *dev)
+{
+	struct fb_info *fbi = (struct fb_info*)platform_get_drvdata(dev);
+
+	SYSRST = SYSRST_RST;
+	udelay(1000);
+
+	if (fbi) {
+		struct mbxfb_info *mfbi = fbi->par;
+
+		unregister_framebuffer(fbi);
+		if ( mfbi ) {
+			if ( mfbi->platform_remove )
+				mfbi->platform_remove(fbi);
+
+			if ( mfbi->fb_virt_addr )
+				iounmap(mfbi->fb_virt_addr);
+			if ( mfbi->reg_virt_addr )
+				iounmap(mfbi->reg_virt_addr);
+			if ( mfbi->reg_req ) 
+				release_mem_region(mfbi->reg_req->start,
+						   res_size(mfbi->reg_req));
+			if ( mfbi->fb_req ) 
+				release_mem_region(mfbi->fb_req->start,
+						   res_size(mfbi->fb_req));
+		}
+		framebuffer_release(fbi);
+	}
+
+	return 0;
+}
+
+static struct platform_driver mbxfb_driver = {
+	.probe		= mbxfb_probe,
+	.remove		= mbxfb_remove,
+
+#ifdef CONFIG_PM
+	.suspend	= mbxfb_suspend,
+	.resume		= mbxfb_resume,
+#endif
+	.driver		= {
+		.name	= "mbx-fb",
+	},
+};
+
+int __devinit mbxfb_init(void)
+{
+	return platform_driver_register(&mbxfb_driver);
+}
+
+static void __exit mbxfb_exit(void)
+{
+	platform_driver_unregister(&mbxfb_driver);
+}
+
+module_init(mbxfb_init);
+module_exit(mbxfb_exit);
+
+MODULE_DESCRIPTION("loadable framebuffer driver for Marathon device");
+MODULE_AUTHOR("Mike Rapoport, Compulab");
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/mbx/mbxsysfs.c b/drivers/video/mbx/mbxsysfs.c
new file mode 100644
index 0000000..4b9571a
--- /dev/null
+++ b/drivers/video/mbx/mbxsysfs.c
@@ -0,0 +1,129 @@
+static ssize_t sysconf_show(struct class_device * subsys, char * buf)
+{
+	char * s = buf;
+
+	s += sprintf(s, "SYSCFG = %08lx\n", SYSCFG);
+	s += sprintf(s, "PFBASE = %08lx\n", PFBASE);
+	s += sprintf(s, "PFCEIL = %08lx\n", PFCEIL);
+	s += sprintf(s, "POLLFLAG = %08lx\n", POLLFLAG);
+	s += sprintf(s, "SYSRST = %08lx\n", SYSRST);
+	return (s - buf);
+}
+
+static ssize_t sysconf_store(struct class_device * subsys, const char * buf, size_t n)
+{
+	return n;
+}
+
+static ssize_t gsctl_show(struct class_device * subsys, char * buf)
+{
+	char * s = buf;
+
+	s += sprintf(s, "GSCTRL = %08lx\n", GSCTRL);
+	s += sprintf(s, "VSCTRL = %08lx\n", VSCTRL);
+	s += sprintf(s, "GBBASE = %08lx\n", GBBASE);
+	s += sprintf(s, "VBBASE = %08lx\n", VBBASE);
+	s += sprintf(s, "GDRCTRL = %08lx\n", GDRCTRL);
+	s += sprintf(s, "VCMSK = %08lx\n", VCMSK);
+	s += sprintf(s, "GSCADR = %08lx\n", GSCADR);
+	s += sprintf(s, "VSCADR = %08lx\n", VSCADR);
+	s += sprintf(s, "VUBASE = %08lx\n", VUBASE);
+	s += sprintf(s, "VVBASE = %08lx\n", VVBASE);
+	s += sprintf(s, "GSADR = %08lx\n", GSADR);
+	s += sprintf(s, "VSADR = %08lx\n", VSADR);
+	s += sprintf(s, "HCCTRL = %08lx\n", HCCTRL);
+	s += sprintf(s, "HCSIZE = %08lx\n", HCSIZE);
+	s += sprintf(s, "HCPOS = %08lx\n", HCPOS);
+	s += sprintf(s, "HCBADR = %08lx\n", HCBADR);
+	s += sprintf(s, "HCCKMSK = %08lx\n", HCCKMSK);
+	s += sprintf(s, "GPLUT = %08lx\n", GPLUT);
+	return (s - buf);
+}
+
+static ssize_t gsctl_store(struct class_device * subsys, const char * buf, size_t n)
+{
+	return n;
+}
+
+static ssize_t display_show(struct class_device * subsys, char * buf)
+{
+	char * s = buf;
+
+	s += sprintf(s, "DSCTRL = %08lx\n", DSCTRL);
+	s += sprintf(s, "DHT01 = %08lx\n", DHT01);
+	s += sprintf(s, "DHT02 = %08lx\n", DHT02);
+	s += sprintf(s, "DHT03 = %08lx\n", DHT03);
+	s += sprintf(s, "DVT01 = %08lx\n", DVT01);
+	s += sprintf(s, "DVT02 = %08lx\n", DVT02);
+	s += sprintf(s, "DVT03 = %08lx\n", DVT03);
+	s += sprintf(s, "DBCOL = %08lx\n", DBCOL);
+	s += sprintf(s, "BGCOLOR = %08lx\n", BGCOLOR);
+	s += sprintf(s, "DINTRS = %08lx\n", DINTRS);
+	s += sprintf(s, "DINTRE = %08lx\n", DINTRE);
+	s += sprintf(s, "DINTRCNT = %08lx\n", DINTRCNT);
+	s += sprintf(s, "DSIG = %08lx\n", DSIG);
+	s += sprintf(s, "DMCTRL = %08lx\n", DMCTRL);
+	s += sprintf(s, "CLIPCTRL = %08lx\n", CLIPCTRL);
+	s += sprintf(s, "SPOCTRL = %08lx\n", SPOCTRL);
+	s += sprintf(s, "SVCTRL = %08lx\n", SVCTRL);
+	s += sprintf(s, "DLSTS = %08lx\n", DLSTS);
+	s += sprintf(s, "DLLCTRL = %08lx\n", DLLCTRL);
+	s += sprintf(s, "DVLNUM = %08lx\n", DVLNUM);
+	s += sprintf(s, "DUCTRL = %08lx\n", DUCTRL);
+	s += sprintf(s, "DVECTRL = %08lx\n", DVECTRL);
+	s += sprintf(s, "DHDET = %08lx\n", DHDET);
+	s += sprintf(s, "DVDET = %08lx\n", DVDET);
+	s += sprintf(s, "DODMSK = %08lx\n", DODMSK);
+	s += sprintf(s, "CSC01 = %08lx\n", CSC01);
+	s += sprintf(s, "CSC02 = %08lx\n", CSC02);
+	s += sprintf(s, "CSC03 = %08lx\n", CSC03);
+	s += sprintf(s, "CSC04 = %08lx\n", CSC04);
+	s += sprintf(s, "CSC05 = %08lx\n", CSC05);
+	return (s - buf);
+}
+
+static ssize_t display_store(struct class_device * subsys, const char * buf, size_t n)
+{
+	return n;
+}
+
+static ssize_t clock_show(struct class_device * subsys, char * buf)
+{
+	char * s = buf;
+
+	s += sprintf(s, "SYSCLKSRC = %08lx\n", SYSCLKSRC);
+	s += sprintf(s, "PIXCLKSRC = %08lx\n", PIXCLKSRC);
+	s += sprintf(s, "CLKSLEEP = %08lx\n", CLKSLEEP);
+	s += sprintf(s, "COREPLL = %08lx\n", COREPLL);
+	s += sprintf(s, "DISPPLL = %08lx\n", DISPPLL);
+	s += sprintf(s, "PLLSTAT = %08lx\n", PLLSTAT);
+	s += sprintf(s, "VOVRCLK = %08lx\n", VOVRCLK);
+	s += sprintf(s, "PIXCLK = %08lx\n", PIXCLK);
+	s += sprintf(s, "MEMCLK = %08lx\n", MEMCLK);
+	s += sprintf(s, "M24CLK = %08lx\n", M24CLK);
+	s += sprintf(s, "MBXCLK = %08lx\n", MBXCLK);
+	s += sprintf(s, "SDCLK = %08lx\n", SDCLK);
+	s += sprintf(s, "PIXCLKDIV = %08lx\n", PIXCLKDIV);
+	return (s - buf);
+}
+
+static ssize_t clock_store(struct class_device * subsys, const char * buf, size_t n)
+{
+	return n;
+}
+
+static struct class_device_attribute mbx_class_attrs[] = {
+	__ATTR(sysconf,0644,sysconf_show,sysconf_store),
+	__ATTR(gsctl,0644,gsctl_show,gsctl_store),
+	__ATTR(display,0644,display_show,display_store),
+	__ATTR(clock,0644,clock_show,clock_store),
+};
+
+
+static void mbxfb_sysfs_register(struct fb_info *fbi)
+{
+	int i;
+	for (i = 0; i < ARRAY_SIZE(mbx_class_attrs); i++)
+		class_device_create_file(fbi->class_device,
+					 &mbx_class_attrs[i]);
+}
diff --git a/drivers/video/mbx/reg_bits.h b/drivers/video/mbx/reg_bits.h
new file mode 100644
index 0000000..be152f6
--- /dev/null
+++ b/drivers/video/mbx/reg_bits.h
@@ -0,0 +1,489 @@
+#ifndef __REG_BITS_2700G_
+#define __REG_BITS_2700G_
+
+/* /\* System Configuration Registers (0x03FE_0000  0x03FE_0010) *\/ */
+/* #define SYSCFG		__REG_2700G(0x03FE0000) */
+/* #define PFBASE		__REG_2700G(0x03FE0004) */
+/* #define PFCEIL		__REG_2700G(0x03FE0008) */
+/* #define POLLFLAG	__REG_2700G(0x03FE000C) */
+
+#define SYSRST_RST	(1 << 0)
+
+/* /\* Interrupt Control Registers (0x03FE_0014  0x03FE_002F) *\/ */
+/* #define NINTPW		__REG_2700G(0x03FE0014) */
+/* #define MINTENABLE	__REG_2700G(0x03FE0018) */
+/* #define MINTSTAT	__REG_2700G(0x03FE001C) */
+/* #define SINTENABLE	__REG_2700G(0x03FE0020) */
+/* #define SINTSTAT	__REG_2700G(0x03FE0024) */
+/* #define SINTCLR		__REG_2700G(0x03FE0028) */
+
+/* SYSCLKSRC - SYSCLK Source Control Register */
+#define SYSCLKSRC_SEL	Fld(2,0)
+#define SYSCLKSRC_REF	((0x0) << FShft(SYSCLKSRC_SEL))
+#define SYSCLKSRC_PLL_1	((0x1) << FShft(SYSCLKSRC_SEL))
+#define SYSCLKSRC_PLL_2	((0x2) << FShft(SYSCLKSRC_SEL))
+
+/* PIXCLKSRC - PIXCLK Source Control Register */
+#define PIXCLKSRC_SEL	Fld(2,0)
+#define PIXCLKSRC_REF	((0x0) << FShft(PIXCLKSRC_SEL))
+#define PIXCLKSRC_PLL_1	((0x1) << FShft(PIXCLKSRC_SEL))
+#define PIXCLKSRC_PLL_2	((0x2) << FShft(PIXCLKSRC_SEL))
+
+/* Clock Disable Register */
+#define CLKSLEEP_SLP	(1 << 0)
+
+/* Core PLL Control Register */
+#define CORE_PLL_M	Fld(6,7)
+#define Core_Pll_M(x)	((x) << FShft(CORE_PLL_M))
+#define CORE_PLL_N	Fld(3,4)
+#define Core_Pll_N(x)	((x) << FShft(CORE_PLL_N))
+#define CORE_PLL_P	Fld(3,1)
+#define Core_Pll_P(x)	((x) << FShft(CORE_PLL_P))
+#define CORE_PLL_EN	(1 << 0)
+
+/* Display PLL Control Register */
+#define DISP_PLL_M	Fld(6,7)
+#define Disp_Pll_M(x)	((x) << FShft(DISP_PLL_M))
+#define DISP_PLL_N	Fld(3,4)
+#define Disp_Pll_N(x)	((x) << FShft(DISP_PLL_N))
+#define DISP_PLL_P	Fld(3,1)
+#define Disp_Pll_P(x)	((x) << FShft(DISP_PLL_P))
+#define DISP_PLL_EN	(1 << 0)
+
+/* PLL status register */
+#define PLLSTAT_CORE_PLL_LOST_L	(1 << 3)
+#define PLLSTAT_CORE_PLL_LSTS	(1 << 2)
+#define PLLSTAT_DISP_PLL_LOST_L	(1 << 1)
+#define PLLSTAT_DISP_PLL_LSTS	(1 << 0)
+
+/* Video and scale clock control register */
+#define VOVRCLK_EN	(1 << 0)
+
+/* Pixel clock control register */
+#define PIXCLK_EN	(1 << 0)
+
+/* Memory clock control register */
+#define MEMCLK_EN	(1 << 0)
+
+/* MBX clock control register */
+#define MBXCLK_DIV	Fld(2,2)
+#define MBXCLK_DIV_1	((0x0) << FShft(MBXCLK_DIV))
+#define MBXCLK_DIV_2	((0x1) << FShft(MBXCLK_DIV))
+#define MBXCLK_DIV_3	((0x2) << FShft(MBXCLK_DIV))
+#define MBXCLK_DIV_4	((0x3) << FShft(MBXCLK_DIV))
+#define MBXCLK_EN	Fld(2,0)
+#define MBXCLK_EN_NONE	((0x0) << FShft(MBXCLK_EN))
+#define MBXCLK_EN_2D	((0x1) << FShft(MBXCLK_EN))
+#define MBXCLK_EN_BOTH	((0x2) << FShft(MBXCLK_EN))
+
+/* M24 clock control register */
+#define M24CLK_DIV	Fld(2,1)
+#define M24CLK_DIV_1	((0x0) << FShft(M24CLK_DIV))
+#define M24CLK_DIV_2	((0x1) << FShft(M24CLK_DIV))
+#define M24CLK_DIV_3	((0x2) << FShft(M24CLK_DIV))
+#define M24CLK_DIV_4	((0x3) << FShft(M24CLK_DIV))
+#define M24CLK_EN	(1 << 0)
+
+/* SDRAM clock control register */
+#define SDCLK_EN	(1 << 0)
+
+/* PixClk Divisor Register */
+#define PIXCLKDIV_PD	Fld(9,0)
+#define Pixclkdiv_Pd(x)	((x) << FShft(PIXCLKDIV_PD))
+
+/* LCD Config control register */ 
+#define LCDCFG_IN_FMT	Fld(3,28)
+#define Lcdcfg_In_Fmt(x)	((x) << FShft(LCDCFG_IN_FMT))
+#define LCDCFG_LCD1DEN_POL	(1 << 27)
+#define LCDCFG_LCD1FCLK_POL	(1 << 26)
+#define LCDCFG_LCD1LCLK_POL	(1 << 25)
+#define LCDCFG_LCD1D_POL	(1 << 24)
+#define LCDCFG_LCD2DEN_POL	(1 << 23)
+#define LCDCFG_LCD2FCLK_POL	(1 << 22)
+#define LCDCFG_LCD2LCLK_POL	(1 << 21)
+#define LCDCFG_LCD2D_POL	(1 << 20)
+#define LCDCFG_LCD1_TS		(1 << 19)
+#define LCDCFG_LCD1D_DS		(1 << 18)
+#define LCDCFG_LCD1C_DS		(1 << 17)
+#define LCDCFG_LCD1_IS_IN	(1 << 16)
+#define LCDCFG_LCD2_TS		(1 << 3)
+#define LCDCFG_LCD2D_DS		(1 << 2)
+#define LCDCFG_LCD2C_DS		(1 << 1)
+#define LCDCFG_LCD2_IS_IN	(1 << 0)
+
+/* On-Die Frame Buffer Power Control Register */
+#define ODFBPWR_SLOW	(1 << 2)
+#define ODFBPWR_MODE	Fld(2,0)
+#define ODFBPWR_MODE_ACT	((0x0) << FShft(ODFBPWR_MODE))
+#define ODFBPWR_MODE_ACT_LP	((0x1) << FShft(ODFBPWR_MODE))
+#define ODFBPWR_MODE_SLEEP	((0x2) << FShft(ODFBPWR_MODE))
+#define ODFBPWR_MODE_SHUTD	((0x3) << FShft(ODFBPWR_MODE))
+
+/* On-Die Frame Buffer Power State Status Register */
+#define ODFBSTAT_ACT	(1 << 2)
+#define ODFBSTAT_SLP	(1 << 1)
+#define ODFBSTAT_SDN	(1 << 0)
+
+/* /\* GPIO Registers (0x03FE_006C  0x03FE_007F) *\/ */
+/* #define GPIOCGF		__REG_2700G(0x03FE006C) */
+/* #define GPIOHI		__REG_2700G(0x03FE0070) */
+/* #define GPIOLO		__REG_2700G(0x03FE0074) */
+/* #define GPIOSTAT	__REG_2700G(0x03FE0078) */
+
+/* /\* Pulse Width Modulator (PWM) Registers (0x03FE_0200  0x03FE_02FF) *\/ */
+/* #define PWMRST		__REG_2700G(0x03FE0200) */
+/* #define PWMCFG		__REG_2700G(0x03FE0204) */
+/* #define PWM0DIV		__REG_2700G(0x03FE0210) */
+/* #define PWM0DUTY	__REG_2700G(0x03FE0214) */
+/* #define PWM0PER		__REG_2700G(0x03FE0218) */
+/* #define PWM1DIV		__REG_2700G(0x03FE0220) */
+/* #define PWM1DUTY	__REG_2700G(0x03FE0224) */
+/* #define PWM1PER		__REG_2700G(0x03FE0228) */
+
+
+/* LMRST - Local Memory (SDRAM) Reset */
+#define LMRST_MC_RST	(1 << 0)
+
+/* LMCFG - Local Memory (SDRAM) Configuration Register */
+#define LMCFG_LMC_DS	(1 << 5)
+#define LMCFG_LMD_DS	(1 << 4)
+#define LMCFG_LMA_DS	(1 << 3)
+#define LMCFG_LMC_TS	(1 << 2)
+#define LMCFG_LMD_TS	(1 << 1)
+#define LMCFG_LMA_TS	(1 << 0)
+
+/* LMPWR - Local Memory (SDRAM) Power Control Register */
+#define LMPWR_MC_PWR_CNT	Fld(2,0)
+#define LMPWR_MC_PWR_ACT	((0x0) << FShft(LMPWR_MC_PWR_CNT)) /* Active */
+#define LMPWR_MC_PWR_SRM	((0x1) << FShft(LMPWR_MC_PWR_CNT)) /* Self-refresh */
+#define LMPWR_MC_PWR_DPD	((0x3) << FShft(LMPWR_MC_PWR_CNT)) /* deep power down */
+
+/* LMPWRSTAT - Local Memory (SDRAM) Power Status Register */
+#define LMPWRSTAT_MC_PWR_CNT	Fld(2,0)
+#define LMPWRSTAT_MC_PWR_ACT	((0x0) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* Active */
+#define LMPWRSTAT_MC_PWR_SRM	((0x1) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* Self-refresh */
+#define LMPWRSTAT_MC_PWR_DPD	((0x3) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* deep power down */
+
+/* LMTYPE - Local Memory (SDRAM) Type Register */
+#define LMTYPE_CASLAT	Fld(3,10)
+#define LMTYPE_CASLAT_1	((0x1) << FShft(LMTYPE_CASLAT))
+#define LMTYPE_CASLAT_2	((0x2) << FShft(LMTYPE_CASLAT))
+#define LMTYPE_CASLAT_3	((0x3) << FShft(LMTYPE_CASLAT))
+#define LMTYPE_BKSZ	Fld(2,8)
+#define LMTYPE_BKSZ_1	((0x1) << FShft(LMTYPE_BKSZ))
+#define LMTYPE_BKSZ_2	((0x2) << FShft(LMTYPE_BKSZ))
+#define LMTYPE_ROWSZ	Fld(4,4)
+#define LMTYPE_ROWSZ_11	((0xb) << FShft(LMTYPE_ROWSZ))
+#define LMTYPE_ROWSZ_12	((0xc) << FShft(LMTYPE_ROWSZ))
+#define LMTYPE_ROWSZ_13	((0xd) << FShft(LMTYPE_ROWSZ))
+#define LMTYPE_COLSZ	Fld(4,0)
+#define LMTYPE_COLSZ_7	((0x7) << FShft(LMTYPE_COLSZ))
+#define LMTYPE_COLSZ_8	((0x8) << FShft(LMTYPE_COLSZ))
+#define LMTYPE_COLSZ_9	((0x9) << FShft(LMTYPE_COLSZ))
+#define LMTYPE_COLSZ_10	((0xa) << FShft(LMTYPE_COLSZ))
+#define LMTYPE_COLSZ_11	((0xb) << FShft(LMTYPE_COLSZ))
+#define LMTYPE_COLSZ_12	((0xc) << FShft(LMTYPE_COLSZ))
+
+/* LMTIM - Local Memory (SDRAM) Timing Register */
+#define LMTIM_TRAS	Fld(4,16)
+#define Lmtim_Tras(x)	((x) << FShft(LMTIM_TRAS))
+#define LMTIM_TRP	Fld(4,12)
+#define Lmtim_Trp(x)	((x) << FShft(LMTIM_TRP))
+#define LMTIM_TRCD	Fld(4,8)
+#define Lmtim_Trcd(x)	((x) << FShft(LMTIM_TRCD))
+#define LMTIM_TRC	Fld(4,4)
+#define Lmtim_Trc(x)	((x) << FShft(LMTIM_TRC))
+#define LMTIM_TDPL	Fld(4,0)
+#define Lmtim_Tdpl(x)	((x) << FShft(LMTIM_TDPL))
+
+/* LMREFRESH - Local Memory (SDRAM) tREF Control Register */
+#define LMREFRESH_TREF	Fld(2,0)
+#define Lmrefresh_Tref(x)	((x) << FShft(LMREFRESH_TREF))
+
+/* #define LMCEMR	__REG_2700G(0x03FE1010) */
+/* #define LMPROTMIN	__REG_2700G(0x03FE1020) */
+/* #define LMPROTMAX	__REG_2700G(0x03FE1024) */
+/* #define LMPROTCFG	__REG_2700G(0x03FE1028) */
+/* #define LMPROTERR	__REG_2700G(0x03FE102C) */
+
+/* GSCTRL - Graphics surface control register */
+#define GSCTRL_LUT_EN	(1 << 31)
+#define GSCTRL_GPIXFMT	Fld(4,27)
+#define GSCTRL_GPIXFMT_INDEXED	((0x0) << FShft(GSCTRL_GPIXFMT))
+#define GSCTRL_GPIXFMT_ARGB4444	((0x4) << FShft(GSCTRL_GPIXFMT))
+#define GSCTRL_GPIXFMT_ARGB1555	((0x5) << FShft(GSCTRL_GPIXFMT))
+#define GSCTRL_GPIXFMT_RGB888	((0x6) << FShft(GSCTRL_GPIXFMT))
+#define GSCTRL_GPIXFMT_RGB565	((0x7) << FShft(GSCTRL_GPIXFMT))
+#define GSCTRL_GPIXFMT_ARGB8888	((0x8) << FShft(GSCTRL_GPIXFMT))
+#define GSCTRL_GAMMA_EN	(1 << 26)
+
+#define GSCTRL_GSWIDTH Fld(11,11)
+#define Gsctrl_Width(Pixel)	/* Display Width [1..2048 pix.]  */ \
+                        (((Pixel) - 1) << FShft(GSCTRL_GSWIDTH))
+
+#define GSCTRL_GSHEIGHT Fld(11,0)
+#define Gsctrl_Height(Pixel)	/* Display Height [1..2048 pix.]  */ \
+                        (((Pixel) - 1) << FShft(GSCTRL_GSHEIGHT))
+
+/* GBBASE fileds */
+#define GBBASE_GLALPHA Fld(8,24)
+#define Gbbase_Glalpha(x)	((x) << FShft(GBBASE_GLALPHA))
+
+#define GBBASE_COLKEY Fld(24,0)
+#define Gbbase_Colkey(x)	((x) << FShft(GBBASE_COLKEY))
+
+/* GDRCTRL fields */
+#define GDRCTRL_PIXDBL	(1 << 31)
+#define GDRCTRL_PIXHLV	(1 << 30)
+#define GDRCTRL_LNDBL	(1 << 29)
+#define GDRCTRL_LNHLV	(1 << 28)
+#define GDRCTRL_COLKEYM	Fld(24,0)
+#define Gdrctrl_Colkeym(x)	((x) << FShft(GDRCTRL_COLKEYM))
+
+/* GSCADR graphics stream control address register fields */
+#define GSCADR_STR_EN	(1 << 31)
+#define GSCADR_COLKEY_EN	(1 << 30)
+#define GSCADR_COLKEYSCR	(1 << 29)
+#define GSCADR_BLEND_M	Fld(2,27)
+#define GSCADR_BLEND_NONE	((0x0) << FShft(GSCADR_BLEND_M))
+#define GSCADR_BLEND_INV	((0x1) << FShft(GSCADR_BLEND_M))
+#define GSCADR_BLEND_GLOB	((0x2) << FShft(GSCADR_BLEND_M))
+#define GSCADR_BLEND_PIX	((0x3) << FShft(GSCADR_BLEND_M))
+#define GSCADR_BLEND_POS	Fld(2,24)
+#define GSCADR_BLEND_GFX	((0x0) << FShft(GSCADR_BLEND_POS))
+#define GSCADR_BLEND_VID	((0x1) << FShft(GSCADR_BLEND_POS))
+#define GSCADR_BLEND_CUR	((0x2) << FShft(GSCADR_BLEND_POS))
+#define GSCADR_GBASE_ADR	Fld(23,0)
+#define Gscadr_Gbase_Adr(x)	((x) << FShft(GSCADR_GBASE_ADR))
+
+/* GSADR graphics stride address register fields */
+#define GSADR_SRCSTRIDE	Fld(10,22)
+#define Gsadr_Srcstride(x)	((x) << FShft(GSADR_SRCSTRIDE))
+#define GSADR_XSTART	Fld(11,11)
+#define Gsadr_Xstart(x)		((x) << FShft(GSADR_XSTART))
+#define GSADR_YSTART	Fld(11,0)
+#define Gsadr_Ystart(y)		((y) << FShft(GSADR_YSTART))
+
+/* GPLUT graphics palette register fields */
+#define GPLUT_LUTADR	Fld(8,24)
+#define Gplut_Lutadr(x)	((x) << FShft(GPLUT_LUTADR))
+#define GPLUT_LUTDATA	Fld(24,0)
+#define Gplut_Lutdata(x)	((x) << FShft(GPLUT_LUTDATA))
+
+/* #define VSCTRL		__REG_2700G(0x03FE2004) */
+/* #define VBBASE		__REG_2700G(0x03FE2024) */
+/* #define VCMSK		__REG_2700G(0x03FE2044) */
+/* #define VSCADR		__REG_2700G(0x03FE2064) */
+/* #define VUBASE		__REG_2700G(0x03FE2084) */
+/* #define VVBASE		__REG_2700G(0x03FE20A4) */
+/* #define VSADR		__REG_2700G(0x03FE20C4) */
+
+
+/* HCCTRL - Hardware Cursor Register fields */
+#define HCCTRL_CUR_EN	(1 << 31)
+#define HCCTRL_COLKEY_EN	(1 << 29)
+#define HCCTRL_COLKEYSRC	(1 << 28)
+#define HCCTRL_BLEND_M	Fld(2,26)
+#define HCCTRL_BLEND_NONE	((0x0) << FShft(HCCTRL_BLEND_M))
+#define HCCTRL_BLEND_INV	((0x1) << FShft(HCCTRL_BLEND_M))
+#define HCCTRL_BLEND_GLOB	((0x2) << FShft(HCCTRL_BLEND_M))
+#define HCCTRL_BLEND_PIX	((0x3) << FShft(HCCTRL_BLEND_M))
+#define HCCTRL_CPIXFMT	Fld(3,23)
+#define HCCTRL_CPIXFMT_RGB332	((0x3) << FShft(HCCTRL_CPIXFMT))
+#define HCCTRL_CPIXFMT_ARGB4444	((0x4) << FShft(HCCTRL_CPIXFMT))
+#define HCCTRL_CPIXFMT_ARGB1555	((0x5) << FShft(HCCTRL_CPIXFMT))
+#define HCCTRL_CBASE_ADR	Fld(23,0)
+#define Hcctrl_Cbase_Adr(x)	((x) << FShft(HCCTRL_CBASE_ADR))
+
+/* HCSIZE Hardware Cursor Size Register fields */
+#define HCSIZE_BLEND_POS	Fld(2,29)
+#define HCSIZE_BLEND_GFX	((0x0) << FShft(HCSIZE_BLEND_POS))
+#define HCSIZE_BLEND_VID	((0x1) << FShft(HCSIZE_BLEND_POS))
+#define HCSIZE_BLEND_CUR	((0x2) << FShft(HCSIZE_BLEND_POS))
+#define HCSIZE_CWIDTH	Fld(3,16)
+#define Hcsize_Cwidth(x)	((x) << FShft(HCSIZE_CWIDTH))
+#define HCSIZE_CHEIGHT	Fld(3,0)
+#define Hcsize_Cheight(x)	((x) << FShft(HCSIZE_CHEIGHT))
+
+/* HCPOS Hardware Cursor Position Register fields */
+#define HCPOS_SWITCHSRC	(1 << 30)
+#define HCPOS_CURBLINK	Fld(6,24)
+#define Hcpos_Curblink(x)	((x) << FShft(HCPOS_CURBLINK))
+#define HCPOS_XSTART	Fld(12,12)
+#define Hcpos_Xstart(x)	((x) << FShft(HCPOS_XSTART))
+#define HCPOS_YSTART	Fld(12,0)
+#define Hcpos_Ystart(y)	((y) << FShft(HCPOS_YSTART))
+
+/* HCBADR Hardware Cursor Blend Address Register */
+#define HCBADR_GLALPHA	Fld(8,24)
+#define Hcbadr_Glalpha(x)	((x) << FShft(HCBADR_GLALPHA))
+#define HCBADR_COLKEY	Fld(24,0)
+#define Hcbadr_Colkey(x)	((x) << FShft(HCBADR_COLKEY))
+
+/* HCCKMSK - Hardware Cursor Color Key Mask Register */
+#define HCCKMSK_COLKEY_M	Fld(24,0)
+#define Hcckmsk_Colkey_M(x)	((x) << FShft(HCCKMSK_COLKEY_M))
+
+/* DSCTRL - Display sync control register */
+#define DSCTRL_SYNCGEN_EN	(1 << 31)
+#define DSCTRL_DPL_RST		(1 << 29)
+#define DSCTRL_PWRDN_M		(1 << 28)
+#define DSCTRL_UPDSYNCCNT	(1 << 26)
+#define DSCTRL_UPDINTCNT	(1 << 25)
+#define DSCTRL_UPDCNT		(1 << 24)
+#define DSCTRL_UPDWAIT	Fld(4,16)
+#define Dsctrl_Updwait(x)	((x) << FShft(DSCTRL_UPDWAIT))
+#define DSCTRL_CLKPOL		(1 << 11)
+#define DSCTRL_CSYNC_EN		(1 << 10)
+#define DSCTRL_VS_SLAVE		(1 << 7)
+#define DSCTRL_HS_SLAVE		(1 << 6)
+#define DSCTRL_BLNK_POL		(1 << 5)
+#define DSCTRL_BLNK_DIS		(1 << 4)
+#define DSCTRL_VS_POL		(1 << 3)
+#define DSCTRL_VS_DIS		(1 << 2)
+#define DSCTRL_HS_POL		(1 << 1)
+#define DSCTRL_HS_DIS		(1 << 0)
+
+/* DHT01 - Display horizontal timing register 01 */
+#define DHT01_HBPS	Fld(12,16)
+#define Dht01_Hbps(x)	((x) << FShft(DHT01_HBPS))
+#define DHT01_HT	Fld(12,0)
+#define Dht01_Ht(x)	((x) << FShft(DHT01_HT))
+
+/* DHT02 - Display horizontal timing register 02 */
+#define DHT02_HAS	Fld(12,16)
+#define Dht02_Has(x)	((x) << FShft(DHT02_HAS))
+#define DHT02_HLBS	Fld(12,0)
+#define Dht02_Hlbs(x)	((x) << FShft(DHT02_HLBS))
+
+/* DHT03 - Display horizontal timing register 03 */
+#define DHT03_HFPS	Fld(12,16)
+#define Dht03_Hfps(x)	((x) << FShft(DHT03_HFPS))
+#define DHT03_HRBS	Fld(12,0)
+#define Dht03_Hrbs(x)	((x) << FShft(DHT03_HRBS))
+
+/* DVT01 - Display vertical timing register 01 */
+#define DVT01_VBPS	Fld(12,16)
+#define Dvt01_Vbps(x)	((x) << FShft(DVT01_VBPS))
+#define DVT01_VT	Fld(12,0)
+#define Dvt01_Vt(x)	((x) << FShft(DVT01_VT))
+
+/* DVT02 - Display vertical timing register 02 */
+#define DVT02_VAS	Fld(12,16)
+#define Dvt02_Vas(x)	((x) << FShft(DVT02_VAS))
+#define DVT02_VTBS	Fld(12,0)
+#define Dvt02_Vtbs(x)	((x) << FShft(DVT02_VTBS))
+
+/* DVT03 - Display vertical timing register 03 */
+#define DVT03_VFPS	Fld(12,16)
+#define Dvt03_Vfps(x)	((x) << FShft(DVT03_VFPS))
+#define DVT03_VBBS	Fld(12,0)
+#define Dvt03_Vbbs(x)	((x) << FShft(DVT03_VBBS))
+
+/* DVECTRL - display vertical event control register */
+#define DVECTRL_VEVENT	Fld(12,16)
+#define Dvectrl_Vevent(x)	((x) << FShft(DVECTRL_VEVENT))
+#define DVECTRL_VFETCH	Fld(12,0)
+#define Dvectrl_Vfetch(x)	((x) << FShft(DVECTRL_VFETCH))
+
+/* DHDET - display horizontal DE timing register */
+#define DHDET_HDES	Fld(12,16)
+#define Dhdet_Hdes(x)	((x) << FShft(DHDET_HDES))
+#define DHDET_HDEF	Fld(12,0)
+#define Dhdet_Hdef(x)	((x) << FShft(DHDET_HDEF))
+
+/* DVDET - display vertical DE timing register */
+#define DVDET_VDES	Fld(12,16)
+#define Dvdet_Vdes(x)	((x) << FShft(DVDET_VDES))
+#define DVDET_VDEF	Fld(12,0)
+#define Dvdet_Vdef(x)	((x) << FShft(DVDET_VDEF))
+
+/* DODMSK - display output data mask register */
+#define DODMSK_MASK_LVL	(1 << 31)
+#define DODMSK_BLNK_LVL	(1 << 30)
+#define DODMSK_MASK_B	Fld(8,16)
+#define Dodmsk_Mask_B(x)	((x) << FShft(DODMSK_MASK_B))
+#define DODMSK_MASK_G	Fld(8,8)
+#define Dodmsk_Mask_G(x)	((x) << FShft(DODMSK_MASK_G))
+#define DODMSK_MASK_R	Fld(8,0)
+#define Dodmsk_Mask_R(x)	((x) << FShft(DODMSK_MASK_R))
+
+/* DBCOL - display border color control register */
+#define DBCOL_BORDCOL	Fld(24,0)
+#define Dbcol_Bordcol(x)	((x) << FShft(DBCOL_BORDCOL))	
+
+/* DVLNUM - display vertical line number register */
+#define DVLNUM_VLINE	Fld(12,0)
+#define Dvlnum_Vline(x)	((x) << FShft(DVLNUM_VLINE))
+
+/* DMCTRL - Display Memory Control Register */
+#define DMCTRL_MEM_REF	Fld(2,30)
+#define DMCTRL_MEM_REF_ACT	((0x0) << FShft(DMCTRL_MEM_REF))
+#define DMCTRL_MEM_REF_HB	((0x1) << FShft(DMCTRL_MEM_REF))
+#define DMCTRL_MEM_REF_VB	((0x2) << FShft(DMCTRL_MEM_REF))
+#define DMCTRL_MEM_REF_BOTH	((0x3) << FShft(DMCTRL_MEM_REF))
+#define DMCTRL_UV_THRHLD	Fld(6,24)
+#define Dmctrl_Uv_Thrhld(x)	((x) << FShft(DMCTRL_UV_THRHLD))
+#define DMCTRL_V_THRHLD		Fld(7,16)
+#define Dmctrl_V_Thrhld(x)	((x) << FShft(DMCTRL_V_THRHLD))
+#define DMCTRL_D_THRHLD		Fld(7,8)
+#define Dmctrl_D_Thrhld(x)	((x) << FShft(DMCTRL_D_THRHLD))
+#define DMCTRL_BURSTLEN	Fld(6,0)
+#define Dmctrl_Burstlen(x)	((x) << FShft(DMCTRL_BURSTLEN))
+
+
+/* DLSTS - display load status register */
+#define DLSTS_RLD_ADONE	(1 << 23)
+/* #define DLSTS_RLD_ADOUT	Fld(23,0) */
+
+/* DLLCTRL - display list load control register */
+#define DLLCTRL_RLD_ADRLN	Fld(8,24)
+#define Dllctrl_Rld_Adrln(x)	((x) << FShft(DLLCTRL_RLD_ADRLN))
+
+/* #define DSIG		__REG_2700G(0x03FE2184) */
+/* #define DINTRS		__REG_2700G(0x03FE2178) */
+/* #define DINTRE		__REG_2700G(0x03FE217C) */
+/* #define DINTRCNT	__REG_2700G(0x03FE2180) */
+/* #define DUCTRL		__REG_2700G(0x03FE230C) */
+
+/* BGCOLOR - background color control register */
+/* #define BGCOLOR		__REG_2700G(0x03FE2174) */
+
+/* #define CLIPCTRL	__REG_2700G(0x03FE218C) */
+/* SPOCTRL - Scale Pitch/Order Control Register */
+#define SPOCTRL_H_SC_BP		(1 << 31)
+#define SPOCTRL_V_SC_BP		(1 << 30)
+#define SPOCTRL_HV_SC_OR	(1 << 29)
+#define SPOCTRL_VS_UR_C		(1 << 27)
+#define SPOCTRL_VORDER	Fld(2,16)
+#define SPOCTRL_VORDER_1TAP	((0x0) << FShft(SPOCTRL_VORDER))
+#define SPOCTRL_VORDER_2TAP	((0x1) << FShft(SPOCTRL_VORDER))
+#define SPOCTRL_VORDER_4TAP	((0x3) << FShft(SPOCTRL_VORDER))
+#define SPOCTRL_VPITCH	Fld(16,0)
+#define Spoctrl_Vpitch(x)	((x) << FShft(SPOCTRL_VPITCH))
+
+/* #define SVCTRL		__REG_2700G(0x03FE2194) */
+
+/* /\* 0x03FE_2198 *\/ */
+/* /\* 0x03FE_21A8 VSCOEFF[0:4] Video Scalar Vertical Coefficient [0:4] 4.14.5 *\/ */
+
+/* #define SHCTRL		__REG_2700G(0x03FE21B0) */
+
+/* /\* 0x03FE_21B4 *\/ */
+/* /\* 0x03FE_21D4 HSCOEFF[0:8] Video Scalar Horizontal Coefficient [0:8] 4.14.7 *\/ */
+
+/* #define SSSIZE		__REG_2700G(0x03FE21D8) */
+
+/* /\* 0x03FE_2200 *\/ */
+/* /\* 0x03FE_2240 VIDGAM[0:16] Video Gamma LUT Index [0:16] 4.15.2 *\/ */
+
+/* /\* 0x03FE_2250 *\/ */
+/* /\* 0x03FE_2290 GFXGAM[0:16] Graphics Gamma LUT Index [0:16] 4.15.3 *\/ */
+
+/* #define CSC01		__REG_2700G(0x03FE2330) */
+/* #define CSC02		__REG_2700G(0x03FE2334) */
+/* #define CSC03		__REG_2700G(0x03FE2338) */
+/* #define CSC04		__REG_2700G(0x03FE233C) */
+/* #define CSC05		__REG_2700G(0x03FE2340) */
+
+#endif /* __REG_BITS_2700G_ */
diff --git a/drivers/video/mbx/regs.h b/drivers/video/mbx/regs.h
new file mode 100644
index 0000000..edf0f14
--- /dev/null
+++ b/drivers/video/mbx/regs.h
@@ -0,0 +1,192 @@
+#ifndef __REGS_2700G_
+#define __REGS_2700G_
+
+/* extern unsigned long virt_base_2700; */
+#define __REG_2700G(x)	(*(volatile unsigned long*)((x)+virt_base_2700))
+
+/* System Configuration Registers (0x0000_0000  0x0000_0010) */
+#define SYSCFG		__REG_2700G(0x00000000)
+#define PFBASE		__REG_2700G(0x00000004)
+#define PFCEIL		__REG_2700G(0x00000008)
+#define POLLFLAG	__REG_2700G(0x0000000c)
+#define SYSRST		__REG_2700G(0x00000010)
+
+/* Interrupt Control Registers (0x0000_0014  0x0000_002F) */
+#define NINTPW		__REG_2700G(0x00000014)
+#define MINTENABLE	__REG_2700G(0x00000018)
+#define MINTSTAT	__REG_2700G(0x0000001c)
+#define SINTENABLE	__REG_2700G(0x00000020)
+#define SINTSTAT	__REG_2700G(0x00000024)
+#define SINTCLR		__REG_2700G(0x00000028)
+
+/* Clock Control Registers (0x0000_002C  0x0000_005F) */
+#define SYSCLKSRC	__REG_2700G(0x0000002c)
+#define PIXCLKSRC	__REG_2700G(0x00000030)
+#define CLKSLEEP	__REG_2700G(0x00000034)
+#define COREPLL		__REG_2700G(0x00000038)
+#define DISPPLL		__REG_2700G(0x0000003c)
+#define PLLSTAT		__REG_2700G(0x00000040)
+#define VOVRCLK		__REG_2700G(0x00000044)
+#define PIXCLK		__REG_2700G(0x00000048)
+#define MEMCLK		__REG_2700G(0x0000004c)
+#define M24CLK		__REG_2700G(0x00000054)
+#define MBXCLK		__REG_2700G(0x00000054)
+#define SDCLK		__REG_2700G(0x00000058)
+#define PIXCLKDIV	__REG_2700G(0x0000005c)
+
+/* LCD Port Control Register (0x0000_0060  0x0000_006F) */
+#define LCD_CONFIG	__REG_2700G(0x00000060)
+
+/* On-Die Frame Buffer Registers (0x0000_0064  0x0000_006B) */
+#define ODFBPWR		__REG_2700G(0x00000064)
+#define ODFBSTAT	__REG_2700G(0x00000068)
+
+/* GPIO Registers (0x0000_006C  0x0000_007F) */
+#define GPIOCGF		__REG_2700G(0x0000006c)
+#define GPIOHI		__REG_2700G(0x00000070)
+#define GPIOLO		__REG_2700G(0x00000074)
+#define GPIOSTAT	__REG_2700G(0x00000078)
+
+/* Pulse Width Modulator (PWM) Registers (0x0000_0200  0x0000_02FF) */
+#define PWMRST		__REG_2700G(0x00000200)
+#define PWMCFG		__REG_2700G(0x00000204)
+#define PWM0DIV		__REG_2700G(0x00000210)
+#define PWM0DUTY	__REG_2700G(0x00000214)
+#define PWM0PER		__REG_2700G(0x00000218)
+#define PWM1DIV		__REG_2700G(0x00000220)
+#define PWM1DUTY	__REG_2700G(0x00000224)
+#define PWM1PER		__REG_2700G(0x00000228)
+
+/* Identification (ID) Registers (0x0000_0300  0x0000_0FFF) */
+#define ID		__REG_2700G(0x00000FF0)
+
+/* Local Memory (SDRAM) Interface Registers (0x0000_1000  0x0000_1FFF) */
+#define LMRST		__REG_2700G(0x00001000)
+#define LMCFG		__REG_2700G(0x00001004)
+#define LMPWR		__REG_2700G(0x00001008)
+#define LMPWRSTAT	__REG_2700G(0x0000100c)
+#define LMCEMR		__REG_2700G(0x00001010)
+#define LMTYPE		__REG_2700G(0x00001014)
+#define LMTIM		__REG_2700G(0x00001018)
+#define LMREFRESH	__REG_2700G(0x0000101c)
+#define LMPROTMIN	__REG_2700G(0x00001020)
+#define LMPROTMAX	__REG_2700G(0x00001024)
+#define LMPROTCFG	__REG_2700G(0x00001028)
+#define LMPROTERR	__REG_2700G(0x0000102c)
+
+/* Plane Controller Registers (0x0000_2000  0x0000_2FFF) */
+#define GSCTRL		__REG_2700G(0x00002000)
+#define VSCTRL		__REG_2700G(0x00002004)
+#define GBBASE		__REG_2700G(0x00002020)
+#define VBBASE		__REG_2700G(0x00002024)
+#define GDRCTRL		__REG_2700G(0x00002040)
+#define VCMSK		__REG_2700G(0x00002044)
+#define GSCADR		__REG_2700G(0x00002060)
+#define VSCADR		__REG_2700G(0x00002064)
+#define VUBASE		__REG_2700G(0x00002084)
+#define VVBASE		__REG_2700G(0x000020a4)
+#define GSADR		__REG_2700G(0x000020c0)
+#define VSADR		__REG_2700G(0x000020c4)
+#define HCCTRL		__REG_2700G(0x00002100)
+#define HCSIZE		__REG_2700G(0x00002110)
+#define HCPOS		__REG_2700G(0x00002120)
+#define HCBADR		__REG_2700G(0x00002130)
+#define HCCKMSK		__REG_2700G(0x00002140)
+#define GPLUT		__REG_2700G(0x00002150)
+#define DSCTRL		__REG_2700G(0x00002154)
+#define DHT01		__REG_2700G(0x00002158)
+#define DHT02		__REG_2700G(0x0000215c)
+#define DHT03		__REG_2700G(0x00002160)
+#define DVT01		__REG_2700G(0x00002164)
+#define DVT02		__REG_2700G(0x00002168)
+#define DVT03		__REG_2700G(0x0000216c)
+#define DBCOL		__REG_2700G(0x00002170)
+#define BGCOLOR		__REG_2700G(0x00002174)
+#define DINTRS		__REG_2700G(0x00002178)
+#define DINTRE		__REG_2700G(0x0000217c)
+#define DINTRCNT	__REG_2700G(0x00002180)
+#define DSIG		__REG_2700G(0x00002184)
+#define DMCTRL		__REG_2700G(0x00002188)
+#define CLIPCTRL	__REG_2700G(0x0000218c)
+#define SPOCTRL		__REG_2700G(0x00002190)
+#define SVCTRL		__REG_2700G(0x00002194)
+
+/* 0x0000_2198 */
+/* 0x0000_21A8 VSCOEFF[0:4] Video Scalar Vertical Coefficient [0:4] 4.14.5 */
+#define VSCOEFF0	__REG_2700G(0x00002198)
+#define VSCOEFF1	__REG_2700G(0x0000219c)
+#define VSCOEFF2	__REG_2700G(0x000021a0)
+#define VSCOEFF3	__REG_2700G(0x000021a4)
+#define VSCOEFF4	__REG_2700G(0x000021a8)
+
+#define SHCTRL		__REG_2700G(0x000021b0)
+
+/* 0x0000_21B4 */
+/* 0x0000_21D4 HSCOEFF[0:8] Video Scalar Horizontal Coefficient [0:8] 4.14.7 */
+#define HSCOEFF0	__REG_2700G(0x000021b4)
+#define HSCOEFF1	__REG_2700G(0x000021b8)
+#define HSCOEFF2	__REG_2700G(0x000021bc)
+#define HSCOEFF3	__REG_2700G(0x000021b0)
+#define HSCOEFF4	__REG_2700G(0x000021c4)
+#define HSCOEFF5	__REG_2700G(0x000021c8)
+#define HSCOEFF6	__REG_2700G(0x000021cc)
+#define HSCOEFF7	__REG_2700G(0x000021d0)
+#define HSCOEFF8	__REG_2700G(0x000021d4)
+
+#define SSSIZE		__REG_2700G(0x000021D8)
+
+/* 0x0000_2200 */
+/* 0x0000_2240 VIDGAM[0:16] Video Gamma LUT Index [0:16] 4.15.2 */
+#define VIDGAM0		__REG_2700G(0x00002200)
+#define VIDGAM1		__REG_2700G(0x00002204)
+#define VIDGAM2		__REG_2700G(0x00002208)
+#define VIDGAM3		__REG_2700G(0x0000220c)
+#define VIDGAM4		__REG_2700G(0x00002210)
+#define VIDGAM5		__REG_2700G(0x00002214)
+#define VIDGAM6		__REG_2700G(0x00002218)
+#define VIDGAM7		__REG_2700G(0x0000221c)
+#define VIDGAM8		__REG_2700G(0x00002220)
+#define VIDGAM9		__REG_2700G(0x00002224)
+#define VIDGAM10	__REG_2700G(0x00002228)
+#define VIDGAM11	__REG_2700G(0x0000222c)
+#define VIDGAM12	__REG_2700G(0x00002230)
+#define VIDGAM13	__REG_2700G(0x00002234)
+#define VIDGAM14	__REG_2700G(0x00002238)
+#define VIDGAM15	__REG_2700G(0x0000223c)
+#define VIDGAM16	__REG_2700G(0x00002240)
+
+/* 0x0000_2250 */
+/* 0x0000_2290 GFXGAM[0:16] Graphics Gamma LUT Index [0:16] 4.15.3 */
+#define GFXGAM0		__REG_2700G(0x00002250)
+#define GFXGAM1		__REG_2700G(0x00002254)
+#define GFXGAM2		__REG_2700G(0x00002258)
+#define GFXGAM3		__REG_2700G(0x0000225c)
+#define GFXGAM4		__REG_2700G(0x00002260)
+#define GFXGAM5		__REG_2700G(0x00002264)
+#define GFXGAM6		__REG_2700G(0x00002268)
+#define GFXGAM7		__REG_2700G(0x0000226c)
+#define GFXGAM8		__REG_2700G(0x00002270)
+#define GFXGAM9		__REG_2700G(0x00002274)
+#define GFXGAM10	__REG_2700G(0x00002278)
+#define GFXGAM11	__REG_2700G(0x0000227c)
+#define GFXGAM12	__REG_2700G(0x00002280)
+#define GFXGAM13	__REG_2700G(0x00002284)
+#define GFXGAM14	__REG_2700G(0x00002288)
+#define GFXGAM15	__REG_2700G(0x0000228c)
+#define GFXGAM16	__REG_2700G(0x00002290)
+
+#define DLSTS		__REG_2700G(0x00002300)
+#define DLLCTRL		__REG_2700G(0x00002304)
+#define DVLNUM		__REG_2700G(0x00002308)
+#define DUCTRL		__REG_2700G(0x0000230c)
+#define DVECTRL		__REG_2700G(0x00002310)
+#define DHDET		__REG_2700G(0x00002314)
+#define DVDET		__REG_2700G(0x00002318)
+#define DODMSK		__REG_2700G(0x0000231c)
+#define CSC01		__REG_2700G(0x00002330)
+#define CSC02		__REG_2700G(0x00002334)
+#define CSC03		__REG_2700G(0x00002338)
+#define CSC04		__REG_2700G(0x0000233c)
+#define CSC05		__REG_2700G(0x00002340)
+
+#endif /* __REGS_2700G_ */
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 53ad61f..76675f6 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -48,6 +48,11 @@ #include <asm/arch/pxa-regs.h>
 #include <asm/arch/bitfield.h>
 #include <asm/arch/pxafb.h>
 
+#ifdef CONFIG_PXA27x
+#define LCCR4		__REG(0x44000010)  /* LCD Controller Control Register 3 */
+#endif
+
+
 /*
  * Complain if VAR is out of range.
  */
@@ -113,9 +118,15 @@ pxafb_setpalettereg(u_int regno, u_int r
 		if (fbi->fb.var.grayscale) {
 			val = ((blue >> 8) & 0x00ff);
 		} else {
+#ifdef CONFIG_ARMCORE_REV11
+			val  = (((red & 0xff)   <<  16) & 0xfc0000);
+			val |= (((green & 0xff) <<  8)  & 0xfc00);
+			val |= (((blue  & 0xff) <<  0)  & 0x00fc);
+#else
 			val  = ((red   >>  0) & 0xf800);
 			val |= ((green >>  5) & 0x07e0);
 			val |= ((blue  >> 11) & 0x001f);
+#endif
 		}
 		fbi->palette_cpu[regno] = val;
 		ret = 0;
@@ -426,6 +437,8 @@ static struct fb_ops pxafb_ops = {
  * We take account of the PPCR clock setting.
  * From PXA Developer's Manual:
  *
+ * If PCDDIV = 0 then:
+ *
  *   PixelClock =      LCLK
  *                -------------
  *                2 ( PCD + 1 )
@@ -434,6 +447,17 @@ static struct fb_ops pxafb_ops = {
  *         ------------- - 1
  *         2(PixelClock)
  *
+ *
+ * If PCDDIV = 1 then:
+ *
+ *   PixelClock =      LCLK
+ *                -------------
+ *                 ( PCD + 1 )
+ *
+ *   PCD =      LCLK
+ *         ------------- - 1
+ *           PixelClock
+ *
  * Where:
  *   LCLK = LCD/Memory Clock
  *   PCD = LCCR3[7:0]
@@ -448,22 +472,64 @@ static struct fb_ops pxafb_ops = {
  *    PCD = (lclk * 10^4 ) * ( pixclock * 10^-12 )
  *          -------------------------------------- - 1
  *                          2
+ * or
+ *    PCD = (lclk * 10^4 ) * ( pixclock * 10^-12 ) - 1
  *
  * Factoring the 10^4 and 10^-12 out gives 10^-8 == 1 / 100000000 as used below.
  */
-static inline unsigned int get_pcd(unsigned int pixclock)
+static inline unsigned int get_pcd(unsigned int pixclock, unsigned int *lccr4)
 {
-	unsigned long long pcd;
+	/* pcd1 is for PCDDIV=0 and pcd2 for PCDDIV=1 */
+	unsigned long long pcd1, pcd2;
+	unsigned long long clk1, clk2;
+	unsigned long long dif1, dif2;
+
+	*lccr4 = LCCR4;
 
 	/* FIXME: Need to take into account Double Pixel Clock mode
          * (DPC) bit? or perhaps set it based on the various clock
          * speeds */
 
-	pcd = (unsigned long long)get_lcdclk_frequency_10khz() * pixclock;
-	do_div(pcd, 100000000 * 2);
+	pcd1 = pcd2 = (unsigned long long)get_lcdclk_frequency_10khz() * pixclock;
+	do_div(pcd1, 100000000 * 2); /*	pcd1 /= 100000000 * 2; */
+	do_div(pcd2, 100000000); /* pcd2 /= 100000000; */
+
+/* 	clk1 = 100000000*(2 * (pcd1 + 1))/get_lcdclk_frequency_10khz(); */
+/* 	clk2 = 100000000*(pcd2 + 1)/get_lcdclk_frequency_10khz(); */
+
+	clk1 = 100000000*(2 * (pcd1 + 1));
+	clk2 = 100000000*(pcd2 + 1);
+	do_div(clk1, get_lcdclk_frequency_10khz());
+	do_div(clk2, get_lcdclk_frequency_10khz());
+
+	pr_debug("get_pcd: pcd1 = %lld, dotclock = %lld\n", pcd1, clk1);
+	pr_debug("get_pcd: pcd2 = %lld, dotclock = %lld\n", pcd2, clk2);
+
+	dif1 = pixclock - clk1;
+	if ( clk1 > pixclock ) 
+		dif1 *= -1;
+
+	dif2 = pixclock - clk2;
+	if ( clk2 > pixclock ) 
+		dif2 *= -1;
+
+	if ( dif1 > dif2 ) {
+		*lccr4 |= (1 << 31);
+		pr_debug(KERN_INFO "get_pcd: setting pixclock to high rate\n");
+		return (unsigned int)pcd2;
+	}
+	else {
+		*lccr4 &= ~(1 << 31);
+		pr_debug(KERN_INFO "get_pcd: setting pixclock to low rate\n");
+		return (unsigned int)pcd1;
+	}
+
 	/* no need for this, since we should subtract 1 anyway. they cancel */
 	/* pcd += 1; */ /* make up for integer math truncations */
-	return (unsigned int)pcd;
+/* 	return (unsigned int)pcd2; */
+
+	/* never get here */
+	return (unsigned int)0;
 }
 
 /*
@@ -505,7 +571,9 @@ static int pxafb_activate_var(struct fb_
 {
 	struct pxafb_lcd_reg new_regs;
 	u_long flags;
-	u_int lines_per_panel, pcd = get_pcd(var->pixclock);
+	u_int lines_per_panel;
+	u_int lccr4;
+	u_int pcd = get_pcd(var->pixclock, &lccr4);
 
 	pr_debug("pxafb: Configuring PXA LCD\n");
 
@@ -735,10 +803,18 @@ static void pxafb_setup_gpio(struct pxaf
 	pxa_gpio_mode(GPIO75_LCD_LCLK_MD);
 	pxa_gpio_mode(GPIO76_LCD_PCLK_MD);
 	pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD);
+
+#ifdef CONFIG_ARMCORE_REV11
+	pxa_gpio_mode(86 | GPIO_ALT_FN_2_OUT);
+	pxa_gpio_mode(87 | GPIO_ALT_FN_2_OUT);
+#endif
 }
 
 static void pxafb_enable_controller(struct pxafb_info *fbi)
 {
+	unsigned int lccr4;
+	unsigned int pcd = get_pcd(fbi->fb.var.pixclock, &lccr4);
+
 	pr_debug("pxafb: Enabling LCD controller\n");
 	pr_debug("fdadr0 0x%08x\n", (unsigned int) fbi->fdadr0);
 	pr_debug("fdadr1 0x%08x\n", (unsigned int) fbi->fdadr1);
@@ -751,7 +827,20 @@ static void pxafb_enable_controller(stru
 	pxa_set_cken(CKEN16_LCD, 1);
 
 	/* Sequence from 11.7.10 */
-	LCCR3 = fbi->reg_lccr3;
+#ifdef CONFIG_ARMCORE_REV12
+	LCCR4 = lccr4;
+#else
+	LCCR4 = 0 | (2 << 15) | lccr4;
+#endif
+
+	fbi->reg_lccr3 = (fbi->reg_lccr3 & ~0xff) | LCCR3_PixClkDiv(pcd);
+
+#ifdef CONFIG_ARMCORE_REV12
+	LCCR3 = (fbi->reg_lccr3);//& (~(7 << 24))) | (3 << 24);
+#else
+	LCCR3 = (fbi->reg_lccr3 | (3 << 30)) ;//& (~(7 << 24))) | (3 << 24);
+#endif
+
 	LCCR2 = fbi->reg_lccr2;
 	LCCR1 = fbi->reg_lccr1;
 	LCCR0 = fbi->reg_lccr0 & ~LCCR0_ENB;
@@ -1083,6 +1172,7 @@ static struct pxafb_info * __init pxafb_
 	addr = addr + sizeof(struct pxafb_info);
 	fbi->fb.pseudo_palette	= addr;
 
+	fbi->fb.var.pixclock		= inf->pixclock;
 	fbi->max_xres			= inf->xres;
 	fbi->fb.var.xres		= inf->xres;
 	fbi->fb.var.xres_virtual	= inf->xres;
diff --git a/include/asm-arm/arch-pxa/cm-x270.h b/include/asm-arm/arch-pxa/cm-x270.h
new file mode 100644
index 0000000..7099ae7
--- /dev/null
+++ b/include/asm-arm/arch-pxa/cm-x270.h
@@ -0,0 +1,72 @@
+/*
+ *  linux/include/asm/arch-pxa/armcore.h
+ *
+ *  Compulab Ltd., 2003 
+ *
+ *  ARMCore registers
+ */
+
+#include <linux/config.h>
+
+#define CMX270_CS1_PHYS		(PXA_CS1_PHYS)
+#define MARATHON_PHYS		(PXA_CS2_PHYS)
+#define CMX270_IDE104_PHYS	(PXA_CS3_PHYS)
+#define CMX270_IT8152_PHYS	(PXA_CS4_PHYS)
+
+#define PXA_CS_SIZE		(64*1024*1024)
+
+/* Virtual map */
+
+#define CMX270_VIRT_BASE		(0xe8000000)
+
+#define CMX270_IT8152_VIRT		(CMX270_VIRT_BASE)
+#define CMX270_IDE104_VIRT		(CMX270_IT8152_VIRT + PXA_CS_SIZE)
+
+
+/* GPIO related definitions */
+#define GPIO_IT8152_IRQ			(22)
+#define GPIO_RED_LED			(93)
+#define GPIO_GREEN_LED			(94)
+
+
+#define IRQ_GPIO_IT8152_IRQ	IRQ_GPIO(GPIO_IT8152_IRQ)
+#define PME_IRQ			IRQ_GPIO(0)
+#define CMX270_IDE_IRQ		IRQ_GPIO(100)
+#define CMX270_GPIRQ1		IRQ_GPIO(101)
+#define CMX270_TOUCHIRQ		IRQ_GPIO(96)
+#define CMX270_ETHIRQ		IRQ_GPIO(10)
+#define CMX270_GFXIRQ		IRQ_GPIO(95)
+#define CMX270_NANDIRQ		IRQ_GPIO(89)
+#define CMX270_MMC_IRQ		IRQ_GPIO(83)
+
+/* LED macros */
+#define CMX270_RED_ON()		 GPCR(GPIO_RED_LED) = GPIO_bit(GPIO_RED_LED)
+#define CMX270_RED_OFF()		 GPSR(GPIO_RED_LED) = GPIO_bit(GPIO_RED_LED)
+#define CMX270_GREEN_ON()		 GPCR(GPIO_GREEN_LED) = GPIO_bit(GPIO_GREEN_LED)
+#define CMX270_GREEN_OFF()		 GPSR(GPIO_GREEN_LED) = GPIO_bit(GPIO_GREEN_LED)
+
+/* PCMCIA related definitions */
+#define PCC_DETECT(x)	(GPLR(84 - (x)) & GPIO_bit(84 - (x)))
+#define PCC_READY(x)	(GPLR(82 - (x)) & GPIO_bit(81 - (x)))
+
+#define PCMCIA_S0_CD_VALID		IRQ_GPIO(84)
+#define PCMCIA_S0_CD_VALID_EDGE		GPIO_BOTH_EDGES
+
+#define PCMCIA_S1_CD_VALID		IRQ_GPIO(83)
+#define PCMCIA_S1_CD_VALID_EDGE		GPIO_BOTH_EDGES
+
+#define PCMCIA_S0_RDYINT		IRQ_GPIO(82)
+#define PCMCIA_S1_RDYINT		IRQ_GPIO(81)
+
+#define PCMCIA_RESET_GPIO		53
+
+
+
+
+
+
+
+
+
+ 
+
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index 3e70bd9..cb4fb2f 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -80,4 +80,15 @@ extern unsigned int get_lcdclk_frequency
 
 #endif
 
+#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
+#define      HAVE_ARCH_PCI_SET_DMA_MASK
+#ifndef __ASSEMBLY__
+extern unsigned long armcore_pcibios_min_io;
+extern unsigned long armcore_pcibios_min_mem;
+#endif
+#define PCIBIOS_MIN_IO      (armcore_pcibios_min_io)
+#define PCIBIOS_MIN_MEM     (armcore_pcibios_min_mem)
+#define pcibios_assign_all_busses()	1
+#endif
+
 #endif  /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index 05c4b70..f0259cd 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -176,7 +176,8 @@ #define NR_IRQS			(IRQ_S1_BVD1_STSCHG + 
 #elif defined(CONFIG_SHARP_LOCOMO)
 #define NR_IRQS			(IRQ_LOCOMO_SPI_TEND + 1)
 #elif defined(CONFIG_ARCH_LUBBOCK) || \
-      defined(CONFIG_MACH_MAINSTONE)
+      defined(CONFIG_MACH_MAINSTONE) || \
+      defined(CONFIG_MACH_ARMCORE)
 #define NR_IRQS			(IRQ_BOARD_END)
 #else
 #define NR_IRQS			(IRQ_BOARD_START)
@@ -217,3 +218,24 @@ #define IRQ_LOCOMO_KEY_BASE	(IRQ_BOARD_S
 #define IRQ_LOCOMO_GPIO_BASE	(IRQ_BOARD_START + 1)
 #define IRQ_LOCOMO_LT_BASE	(IRQ_BOARD_START + 2)
 #define IRQ_LOCOMO_SPI_BASE	(IRQ_BOARD_START + 3)
+
+/* ITE8152 irqs on CM-x2xx */
+#ifdef CONFIG_MACH_ARMCORE
+#define IT8152_IRQ(x)	(IRQ_BOARD_START + (x))
+#define PCISERR			IT8152_IRQ(0)
+#define H2PTADR			IT8152_IRQ(1)
+#define H2PMAR			IT8152_IRQ(2)
+#define PCI_INTA		IT8152_IRQ(3)
+#define PCI_INTB		IT8152_IRQ(4)
+#define PCI_INTC		IT8152_IRQ(5)
+#define PCI_INTD		IT8152_IRQ(6)
+#define USB_INT			IT8152_IRQ(7)
+#define AUDIO_INT		IT8152_IRQ(8)
+#define CDMA_INT		IT8152_IRQ(9)
+#define IRQ_ITESER		IT8152_IRQ(10)
+#define IT8152_IRQ_MAX		IT8152_IRQ(10)
+
+
+#undef NR_IRQS
+#define NR_IRQS IT8152_IRQ_MAX+1
+#endif
diff --git a/include/asm-arm/arch-pxa/marathonfb.h b/include/asm-arm/arch-pxa/marathonfb.h
new file mode 100644
index 0000000..97b69ef
--- /dev/null
+++ b/include/asm-arm/arch-pxa/marathonfb.h
@@ -0,0 +1,28 @@
+#ifndef __MARATHON_FB_H
+#define __MARATHON_FB_H
+
+struct mbxfb_val {
+	unsigned int	defval;
+	unsigned int	min;
+	unsigned int	max;
+};
+
+struct fb_info;
+
+struct mbxfb_platform_data {
+		/* Screen info */
+		struct mbxfb_val xres;
+		struct mbxfb_val yres;
+		struct mbxfb_val bpp;
+
+		/* Memory info */
+		unsigned long memsize; /* if 0 use ODFB? */
+		unsigned long timings1;
+		unsigned long timings2;
+		unsigned long timings3;
+
+		int (*probe)(struct fb_info *fb);
+		int (*remove)(struct fb_info *fb);
+};
+
+#endif /* __MARATHON_FB_H */
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h
index eaf6d43..98807e7 100644
--- a/include/asm-arm/arch-pxa/memory.h
+++ b/include/asm-arm/arch-pxa/memory.h
@@ -17,6 +17,19 @@ #define __ASM_ARCH_MEMORY_H
  */
 #define PHYS_OFFSET	UL(0xa0000000)
 
+
+#ifdef CONFIG_PCI_HOST_ITE8152
+#ifndef __ASSEMBLY__
+void it8152_adjust_zones(int node, unsigned long *size, unsigned long *holes);
+
+#define arch_adjust_zones(node, size, holes) \
+	it8152_adjust_zones(node, size, holes)
+
+#define ISA_DMA_THRESHOLD (SZ_64M - 1)
+#endif
+#endif
+
+
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
diff --git a/include/asm-arm/arch-pxa/pxafbsetup.h b/include/asm-arm/arch-pxa/pxafbsetup.h
new file mode 100644
index 0000000..8a7c8de
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pxafbsetup.h
@@ -0,0 +1,39 @@
+/*
+ Panel specific LCD controller setup
+ */
+
+#ifndef _PXAFBSETUP_H
+#define _PXAFBSETUP_H
+
+#define MTYPE_STN320x240	0
+#define MTYPE_TFT640x480	1
+#define MTYPE_CRT640x480	2
+#define MTYPE_CRT800x600	3
+#define MTYPE_CRT1024x768	4
+#define MTYPE_USER_DEFINED	5
+#define MTYPE_TFT320x240	6
+#define MTYPE_STN640x480	7
+
+#define	CMAP_GREYSCALE  	0
+#define CMAP_INVERSE		0
+#define CMAP_STATIC			0
+
+
+// Example for user defined display
+// Hitach SX19V-009
+#define LCD_PIXCLOCK			38461
+#define LCD_BPP				8
+#define LCD_XRES			640
+#define LCD_YRES			480
+#define LCD_HORIZONTAL_SYNC_PULSE_WIDTH 4
+#define LCD_VERTICAL_SYNC_PULSE_WIDTH	2
+#define LCD_BEGIN_OF_LINE_WAIT_COUNT	10
+#define LCD_BEGIN_FRAME_WAIT_COUNT	5
+#define LCD_END_OF_LINE_WAIT_COUNT	10
+#define LCD_END_OF_FRAME_WAIT_COUNT	5
+#define LCD_SYNC			(FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT)
+#define LCD_LCCR0			(LCCR0_LDM | LCCR0_IUM | LCCR0_QDM | LCCR0_BM  | LCCR0_OUM )
+#define LCD_LCCR3			(LCCR3_PixClkDiv(0x02) | LCCR3_Acb(0xff))
+#define LCD_NAME			"Hitachi SX19V-009-ZZA-1"
+
+#endif
diff --git a/include/asm-arm/hardware/it8152.h b/include/asm-arm/hardware/it8152.h
new file mode 100644
index 0000000..d28210d
--- /dev/null
+++ b/include/asm-arm/hardware/it8152.h
@@ -0,0 +1,104 @@
+/*
+ *  arch/arm/mach-pxa/it8152.h
+ *
+ *  Compulab Ltd., 2006
+ *
+ *  ITE 8152 companion chip definitions
+ */
+
+
+/* #define CMX270_IT8152_VIRT		(CMX270_VIRT_BASE) */
+
+
+extern unsigned long it8152_base_address;
+
+#define IT8152_IO_BASE			(it8152_base_address + 0x03e00000)
+#define IT8152_CFGREG_BASE		(it8152_base_address + 0x03f00000)
+
+/* #define IRQ_GPIO_IT8152_IRQ		IRQ_GPIO(GPIO_IT8152_IRQ) */
+
+#define IT8152_SHORT_IO(x)		(*((volatile unsigned short *)(IT8152_CFGREG_BASE+(x))))
+#define IT8152_LONG_IO(x)		(*((volatile unsigned long *)(IT8152_CFGREG_BASE+(x))))
+
+
+#define IT8152_PCI_MEMBASE		(*((volatile unsigned long *)(it8152_base_address)))
+/* #define IT8152_PCI_IOBASE		(*((volatile unsigned long *)(it8152_base_address + 0x3e00000))) */
+
+#define IT8152_PCI_IACK			(*((volatile unsigned long *)(it8152_base_address + 0x3f00808)))
+#define IT8152_PCI_CFG_ADDR		(*((volatile unsigned long *)(it8152_base_address + 0x3f00800)))
+#define IT8152_PCI_CFG_DATA		(*((volatile unsigned long *)(it8152_base_address + 0x3f00804)))
+
+#define IT_BUSNUM_SHF                   16
+#define IT_DEVNUM_SHF                   11
+#define IT_FUNCNUM_SHF                  8
+#define IT_REGNUM_SHF                   2
+
+/* Power management & PLL registers */
+#define IT8152_PMPLL_DSR		IT8152_LONG_IO(0x00)
+#define IT8152_PMPLL_DSSR		IT8152_LONG_IO(0x04)
+#define IT8152_PMPLL_PLLCR		IT8152_LONG_IO(0x20)
+#define IT8152_PMPLL_MFSR		IT8152_LONG_IO(0x24)
+
+/* Memory controller */
+#define IT8152_MC_REG_OFFSET		0x100
+
+#define IT8152_MC_SDCR			IT8152_LONG_IO(IT8152_MC_REG_OFFSET + 0x00)
+#define IT8152_MC_PCICR			IT8152_LONG_IO(IT8152_MC_REG_OFFSET + 0x04)
+
+/* Interrupt related definitions */
+#define IT8152_INTC_REG_OFFSET		0x300
+
+#define IT8152_INTC_LDCNIRR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x00)
+#define IT8152_INTC_LDPNIRR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x04)
+#define IT8152_INTC_LDCNIMR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x08)
+#define IT8152_INTC_LDPNIMR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x0C)
+#define IT8152_INTC_LDNITR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x10)
+#define IT8152_INTC_LDNIAR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x14)
+#define IT8152_INTC_LPCNIRR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x20)
+#define IT8152_INTC_LPPNIRR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x24)
+#define IT8152_INTC_LPCNIMR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x28)
+#define IT8152_INTC_LPPNIMR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x2C)
+#define IT8152_INTC_LPNITR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x30)
+#define IT8152_INTC_LPNIAR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x34)
+#define IT8152_INTC_PDCNIRR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x40)
+#define IT8152_INTC_PDPNIRR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x44)
+#define IT8152_INTC_PDCNIMR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x48)
+#define IT8152_INTC_PDPNIMR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x4C)
+#define IT8152_INTC_PDNITR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x50)
+#define IT8152_INTC_PDNIAR		IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x54)
+#define IT8152_INTC_INTC_TYPER	IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0xFC)
+
+#define IT8152_UART_BASE		IT8152_LONG_IO(0x200)
+
+#define IT8152_GPIO_REG_OFFSET		0x500
+
+#define IT8152_GPIO_GPLR		IT8152_LONG_IO(IT8152_GPIO_REG_OFFSET)
+#define IT8152_GPIO_GPCR12		IT8152_LONG_IO(IT8152_GPIO_REG_OFFSET + 0x04)
+#define IT8152_GPIO_GPCR34		IT8152_LONG_IO(IT8152_GPIO_REG_OFFSET + 0x08)
+
+
+/* Interrupt bit definitions */
+#define PCISERR_BIT		(1<<14)
+#define H2PTADR_BIT		(1<<13)
+#define H2PMAR_BIT		(1<<12)
+#define PCI_INTD_BIT	(1<<11)
+#define PCI_INTC_BIT	(1<<10)
+#define PCI_INTB_BIT	(1<<9)
+#define PCI_INTA_BIT	(1<<8)
+#define CDMA_INT_BIT	(1<<2)
+#define USB_INT_BIT		(1<<1)
+#define AUDIO_INT_BIT	(1<<0)
+
+/* IT8152 UART */
+#define ITESER_BIT		(1<<5)
+
+
+
+
+
+
+
+
+
+ 
+
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 751eea5..bc45d11 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1568,6 +1568,7 @@ #define PCI_DEVICE_ID_EFFICEON		0x0060
 #define PCI_VENDOR_ID_ROCKWELL		0x127A
 
 #define PCI_VENDOR_ID_ITE		0x1283
+#define PCI_DEVICE_ID_ITE_IT8152	0x8152
 #define PCI_DEVICE_ID_ITE_IT8172G	0x8172
 #define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
 #define PCI_DEVICE_ID_ITE_8211		0x8211
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 3020ca2..ba1dc8a 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -150,7 +150,7 @@ static const struct ac97_codec_id snd_ac
 { 0x4e534300, 0xffffffff, "LM4540,43,45,46,48",	NULL,		NULL }, // only guess --jk
 { 0x4e534331, 0xffffffff, "LM4549",		NULL,		NULL },
 { 0x4e534350, 0xffffffff, "LM4550",		NULL,		NULL },
-{ 0x50534304, 0xffffffff, "UCB1400",		NULL,		NULL },
+{ 0x50534304, 0xffffffff, "UCB1400",		patch_ucb1400,	NULL },
 { 0x53494c20, 0xffffffe0, "Si3036,8",		mpatch_si3036,	mpatch_si3036, AC97_MODEM_PATCH },
 { 0x54524102, 0xffffffff, "TR28022",		NULL,		NULL },
 { 0x54524106, 0xffffffff, "TR28026",		NULL,		NULL },
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index a444a78..0bb1d71 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -2823,3 +2823,33 @@ int mpatch_si3036(struct snd_ac97 * ac97
 	snd_ac97_write_cache(ac97, 0x68, 0);
 	return 0;
 }
+
+/* 
+ *  UCB1400 codec
+ */
+static const struct snd_kcontrol_new snd_ac97_controls_ucb1400[] = {
+AC97_SINGLE("Headphone driver", 0x6a, 6, 1, 0),
+AC97_SINGLE("DC filter", 0x6a, 4, 1, 0),
+AC97_SINGLE("Smart power mode", 0x6c, 4, 3, 0),
+};
+
+static int patch_ucb1400_specific(struct snd_ac97 * ac97)
+{
+	int idx, err;
+	for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_ucb1400); idx++)
+		if ((err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_ucb1400[idx], ac97))) < 0)
+			return err;
+	return 0;
+}
+
+static struct snd_ac97_build_ops patch_ucb1400_ops = {
+	.build_specific	= patch_ucb1400_specific,
+};
+
+int patch_ucb1400(struct snd_ac97 * ac97)
+{
+	ac97->build_ops = &patch_ucb1400_ops;
+	snd_ac97_write(ac97, 0x6a, 0x0050);
+	snd_ac97_write(ac97, 0x6c, 0x0030);
+	return 0;
+}
diff --git a/sound/pci/ac97/ac97_patch.h b/sound/pci/ac97/ac97_patch.h
index 5060cb6..068b674 100644
--- a/sound/pci/ac97/ac97_patch.h
+++ b/sound/pci/ac97/ac97_patch.h
@@ -58,4 +58,5 @@ int patch_cm9780(struct snd_ac97 * ac97)
 int patch_vt1616(struct snd_ac97 * ac97);
 int patch_vt1617a(struct snd_ac97 * ac97);
 int patch_it2646(struct snd_ac97 * ac97);
+int patch_ucb1400(struct snd_ac97 * ac97);
 int mpatch_si3036(struct snd_ac97 * ac97);