-#define GPIO0 __REG(0x40e10124)
-#define GPIO1 __REG(0x40e10128)
-#define GPIO2 __REG(0x40e1012c)
-#define GPIO3 __REG(0x40e10130)
-#define GPIO4 __REG(0x40e10134)
-#define nXCVREN __REG(0x40e10138)
-
-#define DF_CLE_NOE __REG(0x40e10204)
-#define DF_ALE_WE1 __REG(0x40e10208)
-
-#define DF_SCLK_E __REG(0x40e10210)
-#define nBE0 __REG(0x40e10214)
-#define nBE1 __REG(0x40e10218)
-#define DF_ALE_WE2 __REG(0x40e1021c)
-#define DF_INT_RnB __REG(0x40e10220)
-#define DF_nCS0 __REG(0x40e10224)
-#define DF_nCS1 __REG(0x40e10228)
-#define DF_nWE __REG(0x40e1022c)
-#define DF_nRE __REG(0x40e10230)
-#define nLUA __REG(0x40e10234)
-#define nLLA __REG(0x40e10238)
-#define DF_ADDR0 __REG(0x40e1023c)
-#define DF_ADDR1 __REG(0x40e10240)
-#define DF_ADDR2 __REG(0x40e10244)
-#define DF_ADDR3 __REG(0x40e10248)
-#define DF_IO0 __REG(0x40e1024c)
-#define DF_IO8 __REG(0x40e10250)
-#define DF_IO1 __REG(0x40e10254)
-#define DF_IO9 __REG(0x40e10258)
-#define DF_IO2 __REG(0x40e1025c)
-#define DF_IO10 __REG(0x40e10260)
-#define DF_IO3 __REG(0x40e10264)
-#define DF_IO11 __REG(0x40e10268)
-#define DF_IO4 __REG(0x40e1026c)
-#define DF_IO12 __REG(0x40e10270)
-#define DF_IO5 __REG(0x40e10274)
-#define DF_IO13 __REG(0x40e10278)
-#define DF_IO6 __REG(0x40e1027c)
-#define DF_IO14 __REG(0x40e10280)
-#define DF_IO7 __REG(0x40e10284)
-#define DF_IO15 __REG(0x40e10288)
-
-#define GPIO5 __REG(0x40e1028c)
-#define GPIO6 __REG(0x40e10290)
-#define GPIO7 __REG(0x40e10294)
-#define GPIO8 __REG(0x40e10298)
-#define GPIO9 __REG(0x40e1029c)
-
-#define GPIO11 __REG(0x40e102a0)
-#define GPIO12 __REG(0x40e102a4)
-#define GPIO13 __REG(0x40e102a8)
-#define GPIO14 __REG(0x40e102ac)
-#define GPIO15 __REG(0x40e102b0)
-#define GPIO16 __REG(0x40e102b4)
-#define GPIO17 __REG(0x40e102b8)
-#define GPIO18 __REG(0x40e102bc)
-#define GPIO19 __REG(0x40e102c0)
-#define GPIO20 __REG(0x40e102c4)
-#define GPIO21 __REG(0x40e102c8)
-#define GPIO22 __REG(0x40e102cc)
-#define GPIO23 __REG(0x40e102d0)
-#define GPIO24 __REG(0x40e102d4)
-#define GPIO25 __REG(0x40e102d8)
-#define GPIO26 __REG(0x40e102dc)
-
-#define GPIO27 __REG(0x40e10400)
-#define GPIO28 __REG(0x40e10404)
-#define GPIO29 __REG(0x40e10408)
-#define GPIO30 __REG(0x40e1040c)
-#define GPIO31 __REG(0x40e10410)
-#define GPIO32 __REG(0x40e10414)
-#define GPIO33 __REG(0x40e10418)
-#define GPIO34 __REG(0x40e1041c)
-#define GPIO35 __REG(0x40e10420)
-#define GPIO36 __REG(0x40e10424)
-#define GPIO37 __REG(0x40e10428)
-#define GPIO38 __REG(0x40e1042c)
-#define GPIO39 __REG(0x40e10430)
-#define GPIO40 __REG(0x40e10434)
-#define GPIO41 __REG(0x40e10438)
-#define GPIO42 __REG(0x40e1043c)
-#define GPIO43 __REG(0x40e10440)
-#define GPIO44 __REG(0x40e10444)
-#define GPIO45 __REG(0x40e10448)
-#define GPIO46 __REG(0x40e1044c)
-#define GPIO47 __REG(0x40e10450)
-#define GPIO48 __REG(0x40e10454)
-
-#define GPIO10 __REG(0x40e10458)
-
-#define GPIO49 __REG(0x40e1045c)
-#define GPIO50 __REG(0x40e10460)
-#define GPIO51 __REG(0x40e10464)
-#define GPIO52 __REG(0x40e10468)
-#define GPIO53 __REG(0x40e1046c)
-#define GPIO54 __REG(0x40e10470)
-#define GPIO55 __REG(0x40e10474)
-#define GPIO56 __REG(0x40e10478)
-#define GPIO57 __REG(0x40e1047c)
-#define GPIO58 __REG(0x40e10480)
-#define GPIO59 __REG(0x40e10484)
-#define GPIO60 __REG(0x40e10488)
-#define GPIO61 __REG(0x40e1048c)
-#define GPIO62 __REG(0x40e10490)
-
-#define GPIO6_2 __REG(0x40e10494)
-#define GPIO7_2 __REG(0x40e10498)
-#define GPIO8_2 __REG(0x40e1049c)
-#define GPIO9_2 __REG(0x40e104a0)
-#define GPIO10_2 __REG(0x40e104a4)
-#define GPIO11_2 __REG(0x40e104a8)
-#define GPIO12_2 __REG(0x40e104ac)
-#define GPIO13_2 __REG(0x40e104b0)
-
-#define GPIO63 __REG(0x40e104b4)
-#define GPIO64 __REG(0x40e104b8)
-#define GPIO65 __REG(0x40e104bc)
-#define GPIO66 __REG(0x40e104c0)
-#define GPIO67 __REG(0x40e104c4)
-#define GPIO68 __REG(0x40e104c8)
-#define GPIO69 __REG(0x40e104cc)
-#define GPIO70 __REG(0x40e104d0)
-#define GPIO71 __REG(0x40e104d4)
-#define GPIO72 __REG(0x40e104d8)
-#define GPIO73 __REG(0x40e104dc)
-
-#define GPIO14_2 __REG(0x40e104e0)
-#define GPIO15_2 __REG(0x40e104e4)
-#define GPIO16_2 __REG(0x40e104e8)
-#define GPIO17_2 __REG(0x40e104ec)
-
-#define GPIO74 __REG(0x40e104f0)
-#define GPIO75 __REG(0x40e104f4)
-#define GPIO76 __REG(0x40e104f8)
-#define GPIO77 __REG(0x40e104fc)
-#define GPIO78 __REG(0x40e10500)
-#define GPIO79 __REG(0x40e10504)
-#define GPIO80 __REG(0x40e10508)
-#define GPIO81 __REG(0x40e1050c)
-#define GPIO82 __REG(0x40e10510)
-#define GPIO83 __REG(0x40e10514)
-#define GPIO84 __REG(0x40e10518)
-#define GPIO85 __REG(0x40e1051c)
-#define GPIO86 __REG(0x40e10520)
-#define GPIO87 __REG(0x40e10524)
-#define GPIO88 __REG(0x40e10528)
-#define GPIO89 __REG(0x40e1052c)
-#define GPIO90 __REG(0x40e10530)
-#define GPIO91 __REG(0x40e10534)
-#define GPIO92 __REG(0x40e10538)
-#define GPIO93 __REG(0x40e1053c)
-#define GPIO94 __REG(0x40e10540)
-#define GPIO95 __REG(0x40e10544)
-#define GPIO96 __REG(0x40e10548)
-#define GPIO97 __REG(0x40e1054c)
-#define GPIO98 __REG(0x40e10550)
-
-#define GPIO99 __REG(0x40e10600)
-#define GPIO100 __REG(0x40e10604)
-#define GPIO101 __REG(0x40e10608)
-#define GPIO102 __REG(0x40e1060c)
-#define GPIO103 __REG(0x40e10610)
-#define GPIO104 __REG(0x40e10614)
-#define GPIO105 __REG(0x40e10618)
-#define GPIO106 __REG(0x40e1061c)
-#define GPIO107 __REG(0x40e10620)
-#define GPIO108 __REG(0x40e10624)
-#define GPIO109 __REG(0x40e10628)
-#define GPIO110 __REG(0x40e1062c)
-#define GPIO111 __REG(0x40e10630)
-#define GPIO112 __REG(0x40e10634)
-
-#define GPIO113 __REG(0x40e10638)
-#define GPIO114 __REG(0x40e1063c)
-#define GPIO115 __REG(0x40e10640)
-#define GPIO116 __REG(0x40e10644)
-#define GPIO117 __REG(0x40e10648)
-#define GPIO118 __REG(0x40e1064c)
-#define GPIO119 __REG(0x40e10650)
-#define GPIO120 __REG(0x40e10654)
-#define GPIO121 __REG(0x40e10658)
-#define GPIO122 __REG(0x40e1065c)
-#define GPIO123 __REG(0x40e10660)
-#define GPIO124 __REG(0x40e10664)
-#define GPIO125 __REG(0x40e10668)
-#define GPIO126 __REG(0x40e1066c)
-#define GPIO127 __REG(0x40e10670)
-
-#define GPIO0_2 __REG(0x40e10674)
-#define GPIO1_2 __REG(0x40e10678)
-#define GPIO2_2 __REG(0x40e1067c)
-#define GPIO3_2 __REG(0x40e10680)
-#define GPIO4_2 __REG(0x40e10684)
-#define GPIO5_2 __REG(0x40e10688)
+/* PXA320 */
+#if defined(CONFIG_CPU_PXA320)
+#define DF_IO0 0x40e1024c
+#define DF_IO1 0x40e10254
+#define DF_IO2 0x40e1025c
+#define DF_IO3 0x40e10264
+#define DF_IO4 0x40e1026c
+#define DF_IO5 0x40e10274
+#define DF_IO6 0x40e1027c
+#define DF_IO7 0x40e10284
+#define DF_IO8 0x40e10250
+#define DF_IO9 0x40e10258
+#define DF_IO10 0x40e10260
+#define DF_IO11 0x40e10268
+#define DF_IO12 0x40e10270
+#define DF_IO13 0x40e10278
+#define DF_IO14 0x40e10280
+#define DF_IO15 0x40e10288
+#define DF_CLE_nOE 0x40e10204
+#define DF_ALE_nWE1 0x40e10208
+#define DF_ALE_nWE2 0x40e1021c
+#define DF_SCLK_E 0x40e10210
+#define DF_nCS0 0x40e10224
+#define DF_nCS1 0x40e10228
+#define nBE0 0x40e10214
+#define nBE1 0x40e10218
+#define nLUA 0x40e10234
+#define nLLA 0x40e10238
+#define DF_ADDR0 0x40e1023c
+#define DF_ADDR1 0x40e10240
+#define DF_ADDR2 0x40e10244
+#define DF_ADDR3 0x40e10248
+#define DF_INT_RnB 0x40e10220
+#define DF_nCS0 0x40e10224
+#define DF_nCS1 0x40e10228
+#define DF_nWE 0x40e1022c
+#define DF_nRE 0x40e10230
+
+#define nXCVREN 0x40e10138
+
+#define GPIO0 0x40e10124
+#define GPIO1 0x40e10128
+#define GPIO2 0x40e1012c
+#define GPIO3 0x40e10130
+#define GPIO4 0x40e10134
+#define GPIO5 0x40e1028c
+#define GPIO6 0x40e10290
+#define GPIO7 0x40e10294
+#define GPIO8 0x40e10298
+#define GPIO9 0x40e1029c
+#define GPIO10 0x40e10458
+#define GPIO11 0x40e102a0
+#define GPIO12 0x40e102a4
+#define GPIO13 0x40e102a8
+#define GPIO14 0x40e102ac
+#define GPIO15 0x40e102b0
+#define GPIO16 0x40e102b4
+#define GPIO17 0x40e102b8
+#define GPIO18 0x40e102bc
+#define GPIO19 0x40e102c0
+#define GPIO20 0x40e102c4
+#define GPIO21 0x40e102c8
+#define GPIO22 0x40e102cc
+#define GPIO23 0x40e102d0
+#define GPIO24 0x40e102d4
+#define GPIO25 0x40e102d8
+#define GPIO26 0x40e102dc
+
+#define GPIO27 0x40e10400
+#define GPIO28 0x40e10404
+#define GPIO29 0x40e10408
+#define GPIO30 0x40e1040c
+#define GPIO31 0x40e10410
+#define GPIO32 0x40e10414
+#define GPIO33 0x40e10418
+#define GPIO34 0x40e1041c
+#define GPIO35 0x40e10420
+#define GPIO36 0x40e10424
+#define GPIO37 0x40e10428
+#define GPIO38 0x40e1042c
+#define GPIO39 0x40e10430
+#define GPIO40 0x40e10434
+#define GPIO41 0x40e10438
+#define GPIO42 0x40e1043c
+#define GPIO43 0x40e10440
+#define GPIO44 0x40e10444
+#define GPIO45 0x40e10448
+#define GPIO46 0x40e1044c
+#define GPIO47 0x40e10450
+#define GPIO48 0x40e10454
+#define GPIO49 0x40e1045c
+#define GPIO50 0x40e10460
+#define GPIO51 0x40e10464
+#define GPIO52 0x40e10468
+#define GPIO53 0x40e1046c
+#define GPIO54 0x40e10470
+#define GPIO55 0x40e10474
+#define GPIO56 0x40e10478
+#define GPIO57 0x40e1047c
+#define GPIO58 0x40e10480
+#define GPIO59 0x40e10484
+#define GPIO60 0x40e10488
+#define GPIO61 0x40e1048c
+#define GPIO62 0x40e10490
+
+#define GPIO6_2 0x40e10494
+#define GPIO7_2 0x40e10498
+#define GPIO8_2 0x40e1049c
+#define GPIO9_2 0x40e104a0
+#define GPIO10_2 0x40e104a4
+#define GPIO11_2 0x40e104a8
+#define GPIO12_2 0x40e104ac
+#define GPIO13_2 0x40e104b0
+
+#define GPIO63 0x40e104b4
+#define GPIO64 0x40e104b8
+#define GPIO65 0x40e104bc
+#define GPIO66 0x40e104c0
+#define GPIO67 0x40e104c4
+#define GPIO68 0x40e104c8
+#define GPIO69 0x40e104cc
+#define GPIO70 0x40e104d0
+#define GPIO71 0x40e104d4
+#define GPIO72 0x40e104d8
+#define GPIO73 0x40e104dc
+
+#define GPIO14_2 0x40e104e0
+#define GPIO15_2 0x40e104e4
+#define GPIO16_2 0x40e104e8
+#define GPIO17_2 0x40e104ec
+
+#define GPIO74 0x40e104f0
+#define GPIO75 0x40e104f4
+#define GPIO76 0x40e104f8
+#define GPIO77 0x40e104fc
+#define GPIO78 0x40e10500
+#define GPIO79 0x40e10504
+#define GPIO80 0x40e10508
+#define GPIO81 0x40e1050c
+#define GPIO82 0x40e10510
+#define GPIO83 0x40e10514
+#define GPIO84 0x40e10518
+#define GPIO85 0x40e1051c
+#define GPIO86 0x40e10520
+#define GPIO87 0x40e10524
+#define GPIO88 0x40e10528
+#define GPIO89 0x40e1052c
+#define GPIO90 0x40e10530
+#define GPIO91 0x40e10534
+#define GPIO92 0x40e10538
+#define GPIO93 0x40e1053c
+#define GPIO94 0x40e10540
+#define GPIO95 0x40e10544
+#define GPIO96 0x40e10548
+#define GPIO97 0x40e1054c
+#define GPIO98 0x40e10550
+
+#define GPIO99 0x40e10600
+#define GPIO100 0x40e10604
+#define GPIO101 0x40e10608
+#define GPIO102 0x40e1060c
+#define GPIO103 0x40e10610
+#define GPIO104 0x40e10614
+#define GPIO105 0x40e10618
+#define GPIO106 0x40e1061c
+#define GPIO107 0x40e10620
+#define GPIO108 0x40e10624
+#define GPIO109 0x40e10628
+#define GPIO110 0x40e1062c
+#define GPIO111 0x40e10630
+#define GPIO112 0x40e10634
+
+#define GPIO113 0x40e10638
+#define GPIO114 0x40e1063c
+#define GPIO115 0x40e10640
+#define GPIO116 0x40e10644
+#define GPIO117 0x40e10648
+#define GPIO118 0x40e1064c
+#define GPIO119 0x40e10650
+#define GPIO120 0x40e10654
+#define GPIO121 0x40e10658
+#define GPIO122 0x40e1065c
+#define GPIO123 0x40e10660
+#define GPIO124 0x40e10664
+#define GPIO125 0x40e10668
+#define GPIO126 0x40e1066c
+#define GPIO127 0x40e10670
+
+#define GPIO0_2 0x40e10674
+#define GPIO1_2 0x40e10678
+#define GPIO2_2 0x40e1067c
+#define GPIO3_2 0x40e10680
+#define GPIO4_2 0x40e10684
+#define GPIO5_2 0x40e10688
+
+/* PXA300 and PXA310 */
+#elif defined(CONFIG_CPU_PXA300) || defined(CONFIG_CPU_PXA310)
+#define DF_IO0 0x40e10220
+#define DF_IO1 0x40e10228
+#define DF_IO2 0x40e10230
+#define DF_IO3 0x40e10238
+#define DF_IO4 0x40e10258
+#define DF_IO5 0x40e10260
+#define DF_IO7 0x40e10270
+#define DF_IO6 0x40e10268
+#define DF_IO8 0x40e10224
+#define DF_IO9 0x40e1022c
+#define DF_IO10 0x40e10234
+#define DF_IO11 0x40e1023c
+#define DF_IO12 0x40e1025c
+#define DF_IO13 0x40e10264
+#define DF_IO14 0x40e1026c
+#define DF_IO15 0x40e10274
+#define DF_CLE_NOE 0x40e10240
+#define DF_ALE_nWE 0x40e1020c
+#define DF_SCLK_E 0x40e10250
+#define nCS0 0x40e100c4
+#define nCS1 0x40e100c0
+#define nBE0 0x40e10204
+#define nBE1 0x40e10208
+#define nLUA 0x40e10244
+#define nLLA 0x40e10254
+#define DF_ADDR0 0x40e10210
+#define DF_ADDR1 0x40e10214
+#define DF_ADDR2 0x40e10218
+#define DF_ADDR3 0x40e1021c
+#define DF_INT_RnB 0x40e100c8
+#define DF_nCS0 0x40e10248
+#define DF_nCS1 0x40e10278
+#define DF_nWE 0x40e100cc
+#define DF_nRE 0x40e10200
+
+#define GPIO0 0x40e100b4
+#define GPIO1 0x40e100b8
+#define GPIO2 0x40e100bc
+#define GPIO3 0x40e1027c
+#define GPIO4 0x40e10280
+
+#define GPIO5 0x40e10284
+#define GPIO6 0x40e10288
+#define GPIO7 0x40e1028c
+#define GPIO8 0x40e10290
+#define GPIO9 0x40e10294
+#define GPIO10 0x40e10298
+#define GPIO11 0x40e1029c
+#define GPIO12 0x40e102a0
+#define GPIO13 0x40e102a4
+#define GPIO14 0x40e102a8
+#define GPIO15 0x40e102ac
+#define GPIO16 0x40e102b0
+#define GPIO17 0x40e102b4
+#define GPIO18 0x40e102b8
+#define GPIO19 0x40e102bc
+#define GPIO20 0x40e102c0
+#define GPIO21 0x40e102c4
+#define GPIO22 0x40e102c8
+#define GPIO23 0x40e102cc
+#define GPIO24 0x40e102d0
+#define GPIO25 0x40e102d4
+#define GPIO26 0x40e102d8
+
+#define GPIO27 0x40e10400
+#define GPIO28 0x40e10404
+#define GPIO29 0x40e10408
+#define ULPI_STP 0x40e1040c
+#define ULPI_NXT 0x40e10410
+#define ULPI_DIR 0x40e10414
+#define GPIO30 0x40e10418
+#define GPIO31 0x40e1041c
+#define GPIO32 0x40e10420
+#define GPIO33 0x40e10424
+#define GPIO34 0x40e10428
+#define GPIO35 0x40e1042c
+#define GPIO36 0x40e10430
+#define GPIO37 0x40e10434
+#define GPIO38 0x40e10438
+#define GPIO39 0x40e1043c
+#define GPIO40 0x40e10440
+#define GPIO41 0x40e10444
+#define GPIO42 0x40e10448
+#define GPIO43 0x40e1044c
+#define GPIO44 0x40e10450
+#define GPIO45 0x40e10454
+#define GPIO46 0x40e10458
+#define GPIO47 0x40e1045c
+#define GPIO48 0x40e10460
+
+#define GPIO49 0x40e10464
+#define GPIO50 0x40e10468
+#define GPIO51 0x40e1046c
+#define GPIO52 0x40e10470
+#define GPIO53 0x40e10474
+#define GPIO54 0x40e10478
+#define GPIO55 0x40e1047c
+#define GPIO56 0x40e10480
+#define GPIO57 0x40e10484
+#define GPIO58 0x40e10488
+#define GPIO59 0x40e1048c
+#define GPIO60 0x40e10490
+#define GPIO61 0x40e10494
+#define GPIO62 0x40e10498
+#define GPIO63 0x40e1049c
+#define GPIO64 0x40e104a0
+#define GPIO65 0x40e104a4
+#define GPIO66 0x40e104a8
+#define GPIO67 0x40e104ac
+#define GPIO68 0x40e104b0
+#define GPIO69 0x40e104b4
+#define GPIO70 0x40e104b8
+#define GPIO71 0x40e104bc
+#define GPIO72 0x40e104c0
+#define GPIO73 0x40e104c4
+#define GPIO74 0x40e104c8
+#define GPIO75 0x40e104cc
+#define GPIO76 0x40e104d0
+#define GPIO77 0x40e104d4
+#define GPIO78 0x40e104d8
+#define GPIO79 0x40e104dc
+#define GPIO80 0x40e104e0
+#define GPIO81 0x40e104e4
+#define GPIO82 0x40e104e8
+#define GPIO83 0x40e104ec
+#define GPIO84 0x40e104f0
+#define GPIO85 0x40e104f4
+#define GPIO86 0x40e104f8
+#define GPIO87 0x40e104fc
+#define GPIO88 0x40e10500
+#define GPIO89 0x40e10504
+#define GPIO90 0x40e10508
+#define GPIO91 0x40e1050c
+#define GPIO92 0x40e10510
+#define GPIO93 0x40e10514
+#define GPIO94 0x40e10518
+#define GPIO95 0x40e1051c
+#define GPIO96 0x40e10520
+#define GPIO97 0x40e10524
+#define GPIO98 0x40e10528
+
+#define GPIO99 0x40e10600
+#define GPIO100 0x40e10604
+#define GPIO101 0x40e10608
+#define GPIO102 0x40e1060c
+#define GPIO103 0x40e10610
+#define GPIO104 0x40e10614
+#define GPIO105 0x40e10618
+#define GPIO106 0x40e1061c
+#define GPIO107 0x40e10620
+#define GPIO108 0x40e10624
+#define GPIO109 0x40e10628
+#define GPIO110 0x40e1062c
+#define GPIO111 0x40e10630
+#define GPIO112 0x40e10634
+
+#define GPIO113 0x40e10638
+#define GPIO114 0x40e1063c
+#define GPIO115 0x40e10640
+#define GPIO116 0x40e10644
+#define GPIO117 0x40e10648
+#define GPIO118 0x40e1064c
+#define GPIO119 0x40e10650
+#define GPIO120 0x40e10654
+#define GPIO121 0x40e10658
+#define GPIO122 0x40e1065c
+#define GPIO123 0x40e10660
+#define GPIO124 0x40e10664
+#define GPIO125 0x40e10668
+#define GPIO126 0x40e1066c
+#define GPIO127 0x40e10670
+
+#define GPIO0_2 0x40e10674
+#define GPIO1_2 0x40e10678
+#define GPIO2_2 0x40e102dc
+#define GPIO3_2 0x40e102e0
+#define GPIO4_2 0x40e102e4
+#define GPIO5_2 0x40e102e8
+#define GPIO6_2 0x40e102ec
+
+#ifndef CONFIG_CPU_PXA300 /* PXA310 only */
+#define GPIO7_2 0x40e1052c
+#define GPIO8_2 0x40e10530
+#define GPIO9_2 0x40e10534
+#define GPIO10_2 0x40e10538
+#endif
+#endif