aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2008-10-05 05:25:44 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-07 07:05:05 -0400
commitda591937ba8c3a98ced845247859693a27543863 (patch)
tree93ae125daa920e2f844f10f2392484caff2e6d6e /arch/arm
parent7d76e3f171216757a2ea630d76442084f88a0b4c (diff)
[ARM] 5280/1: pxa: prepare cm-x2xx.c and cm-x2xx-pci.[ch] for addition of CM-X255
- Change CM-X255 and CM-X270 common function prefix from cmx270 to cmx2xx - Split cmx2xx_init to common and CM-X270-specific parts - Use dynamic assignement for DM9000 resources and led GPIOs. Signed-off-by: Russ Dill <russ.dill@gmail.com> Signed-off-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-pxa/cm-x2xx-pci.c50
-rw-r--r--arch/arm/mach-pxa/cm-x2xx-pci.h18
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c171
-rw-r--r--arch/arm/mach-pxa/include/mach/memory.h4
4 files changed, 126 insertions, 117 deletions
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c
index 2d5bcea1e520..b6e93ecbf9da 100644
--- a/arch/arm/mach-pxa/cm-x2xx-pci.c
+++ b/arch/arm/mach-pxa/cm-x2xx-pci.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-pxa/cm-x270-pci.c 2 * linux/arch/arm/mach-pxa/cm-x2xx-pci.c
3 * 3 *
4 * PCI bios-type initialisation for PCI machines 4 * PCI bios-type initialisation for PCI machines
5 * 5 *
@@ -28,7 +28,7 @@
28#include <asm/hardware/it8152.h> 28#include <asm/hardware/it8152.h>
29 29
30unsigned long it8152_base_address; 30unsigned long it8152_base_address;
31static int cmx270_it8152_irq_gpio; 31static int cmx2xx_it8152_irq_gpio;
32 32
33/* 33/*
34 * Only first 64MB of memory can be accessed via PCI. 34 * Only first 64MB of memory can be accessed via PCI.
@@ -36,13 +36,13 @@ static int cmx270_it8152_irq_gpio;
36 * This is really ugly and we need a better way of specifying 36 * This is really ugly and we need a better way of specifying
37 * DMA-capable regions of memory. 37 * DMA-capable regions of memory.
38 */ 38 */
39void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size, 39void __init cmx2xx_pci_adjust_zones(int node, unsigned long *zone_size,
40 unsigned long *zhole_size) 40 unsigned long *zhole_size)
41{ 41{
42 unsigned int sz = SZ_64M >> PAGE_SHIFT; 42 unsigned int sz = SZ_64M >> PAGE_SHIFT;
43 43
44 if (machine_is_armcore()) { 44 if (machine_is_armcore()) {
45 pr_info("Adjusting zones for CM-X270\n"); 45 pr_info("Adjusting zones for CM-X2XX\n");
46 46
47 /* 47 /*
48 * Only adjust if > 64M on current system 48 * Only adjust if > 64M on current system
@@ -57,29 +57,29 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size,
57 } 57 }
58} 58}
59 59
60static void cmx270_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 60static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
61{ 61{
62 /* clear our parent irq */ 62 /* clear our parent irq */
63 GEDR(cmx270_it8152_irq_gpio) = GPIO_bit(cmx270_it8152_irq_gpio); 63 GEDR(cmx2xx_it8152_irq_gpio) = GPIO_bit(cmx2xx_it8152_irq_gpio);
64 64
65 it8152_irq_demux(irq, desc); 65 it8152_irq_demux(irq, desc);
66} 66}
67 67
68void __cmx270_pci_init_irq(int irq_gpio) 68void __cmx2xx_pci_init_irq(int irq_gpio)
69{ 69{
70 it8152_init_irq(); 70 it8152_init_irq();
71 71
72 cmx270_it8152_irq_gpio = irq_gpio; 72 cmx2xx_it8152_irq_gpio = irq_gpio;
73 73
74 set_irq_type(gpio_to_irq(irq_gpio), IRQ_TYPE_EDGE_RISING); 74 set_irq_type(gpio_to_irq(irq_gpio), IRQ_TYPE_EDGE_RISING);
75 75
76 set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx270_it8152_irq_demux); 76 set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx2xx_it8152_irq_demux);
77} 77}
78 78
79#ifdef CONFIG_PM 79#ifdef CONFIG_PM
80static unsigned long sleep_save_ite[10]; 80static unsigned long sleep_save_ite[10];
81 81
82void __cmx270_pci_suspend(void) 82void __cmx2xx_pci_suspend(void)
83{ 83{
84 /* save ITE state */ 84 /* save ITE state */
85 sleep_save_ite[0] = __raw_readl(IT8152_INTC_PDCNIMR); 85 sleep_save_ite[0] = __raw_readl(IT8152_INTC_PDCNIMR);
@@ -91,7 +91,7 @@ void __cmx270_pci_suspend(void)
91 __raw_writel((0), IT8152_INTC_LPCNIRR); 91 __raw_writel((0), IT8152_INTC_LPCNIRR);
92} 92}
93 93
94void __cmx270_pci_resume(void) 94void __cmx2xx_pci_resume(void)
95{ 95{
96 /* restore IT8152 state */ 96 /* restore IT8152 state */
97 __raw_writel((sleep_save_ite[0]), IT8152_INTC_PDCNIMR); 97 __raw_writel((sleep_save_ite[0]), IT8152_INTC_PDCNIMR);
@@ -99,12 +99,12 @@ void __cmx270_pci_resume(void)
99 __raw_writel((sleep_save_ite[2]), IT8152_INTC_LPNIAR); 99 __raw_writel((sleep_save_ite[2]), IT8152_INTC_LPNIAR);
100} 100}
101#else 101#else
102void cmx270_pci_suspend(void) {} 102void cmx2xx_pci_suspend(void) {}
103void cmx270_pci_resume(void) {} 103void cmx2xx_pci_resume(void) {}
104#endif 104#endif
105 105
106/* PCI IRQ mapping*/ 106/* PCI IRQ mapping*/
107static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 107static int __init cmx2xx_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
108{ 108{
109 int irq; 109 int irq;
110 110
@@ -116,14 +116,14 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
116 116
117 /* 117 /*
118 Here comes the ugly part. The routing is baseboard specific, 118 Here comes the ugly part. The routing is baseboard specific,
119 but defining a platform for each possible base of CM-X270 is 119 but defining a platform for each possible base of CM-X2XX is
120 unrealistic. Here we keep mapping for ATXBase and SB-X270. 120 unrealistic. Here we keep mapping for ATXBase and SB-X2XX.
121 */ 121 */
122 /* ATXBASE PCI slot */ 122 /* ATXBASE PCI slot */
123 if (slot == 7) 123 if (slot == 7)
124 return IT8152_PCI_INTA; 124 return IT8152_PCI_INTA;
125 125
126 /* ATXBase/SB-x270 CardBus */ 126 /* ATXBase/SB-X2XX CardBus */
127 if (slot == 8 || slot == 0) 127 if (slot == 8 || slot == 0)
128 return IT8152_PCI_INTB; 128 return IT8152_PCI_INTB;
129 129
@@ -144,9 +144,9 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
144 return(0); 144 return(0);
145} 145}
146 146
147static void cmx270_pci_preinit(void) 147static void cmx2xx_pci_preinit(void)
148{ 148{
149 pr_info("Initializing CM-X270 PCI subsystem\n"); 149 pr_info("Initializing CM-X2XX PCI subsystem\n");
150 150
151 __raw_writel(0x800, IT8152_PCI_CFG_ADDR); 151 __raw_writel(0x800, IT8152_PCI_CFG_ADDR);
152 if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) { 152 if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) {
@@ -200,21 +200,21 @@ static void cmx270_pci_preinit(void)
200 } 200 }
201} 201}
202 202
203static struct hw_pci cmx270_pci __initdata = { 203static struct hw_pci cmx2xx_pci __initdata = {
204 .swizzle = pci_std_swizzle, 204 .swizzle = pci_std_swizzle,
205 .map_irq = cmx270_pci_map_irq, 205 .map_irq = cmx2xx_pci_map_irq,
206 .nr_controllers = 1, 206 .nr_controllers = 1,
207 .setup = it8152_pci_setup, 207 .setup = it8152_pci_setup,
208 .scan = it8152_pci_scan_bus, 208 .scan = it8152_pci_scan_bus,
209 .preinit = cmx270_pci_preinit, 209 .preinit = cmx2xx_pci_preinit,
210}; 210};
211 211
212static int __init cmx270_init_pci(void) 212static int __init cmx2xx_init_pci(void)
213{ 213{
214 if (machine_is_armcore()) 214 if (machine_is_armcore())
215 pci_common_init(&cmx270_pci); 215 pci_common_init(&cmx2xx_pci);
216 216
217 return 0; 217 return 0;
218} 218}
219 219
220subsys_initcall(cmx270_init_pci); 220subsys_initcall(cmx2xx_init_pci);
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.h b/arch/arm/mach-pxa/cm-x2xx-pci.h
index 48f532f4cb51..e24aad2e3ad7 100644
--- a/arch/arm/mach-pxa/cm-x2xx-pci.h
+++ b/arch/arm/mach-pxa/cm-x2xx-pci.h
@@ -1,13 +1,13 @@
1extern void __cmx270_pci_init_irq(int irq_gpio); 1extern void __cmx2xx_pci_init_irq(int irq_gpio);
2extern void __cmx270_pci_suspend(void); 2extern void __cmx2xx_pci_suspend(void);
3extern void __cmx270_pci_resume(void); 3extern void __cmx2xx_pci_resume(void);
4 4
5#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
6#define cmx270_pci_init_irq(x) __cmx270_pci_init_irq(x) 6#define cmx2xx_pci_init_irq(x) __cmx2xx_pci_init_irq(x)
7#define cmx270_pci_suspend(x) __cmx270_pci_suspend(x) 7#define cmx2xx_pci_suspend(x) __cmx2xx_pci_suspend(x)
8#define cmx270_pci_resume(x) __cmx270_pci_resume(x) 8#define cmx2xx_pci_resume(x) __cmx2xx_pci_resume(x)
9#else 9#else
10#define cmx270_pci_init_irq(x) do {} while (0) 10#define cmx2xx_pci_init_irq(x) do {} while (0)
11#define cmx270_pci_suspend(x) do {} while (0) 11#define cmx2xx_pci_suspend(x) do {} while (0)
12#define cmx270_pci_resume(x) do {} while (0) 12#define cmx2xx_pci_resume(x) do {} while (0)
13#endif 13#endif
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index 598837798425..cc79005b1794 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-pxa/cm-x270.c 2 * linux/arch/arm/mach-pxa/cm-x2xx.c
3 * 3 *
4 * Copyright (C) 2007, 2008 CompuLab, Ltd. 4 * Copyright (C) 2007, 2008 CompuLab, Ltd.
5 * Mike Rapoport <mike@compulab.co.il> 5 * Mike Rapoport <mike@compulab.co.il>
@@ -38,20 +38,23 @@
38#include "cm-x2xx-pci.h" 38#include "cm-x2xx-pci.h"
39 39
40/* virtual addresses for statically mapped regions */ 40/* virtual addresses for statically mapped regions */
41#define CMX270_VIRT_BASE (0xe8000000) 41#define CMX2XX_VIRT_BASE (0xe8000000)
42#define CMX270_IT8152_VIRT (CMX270_VIRT_BASE) 42#define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE)
43 43
44#define RTC_PHYS_BASE (PXA_CS1_PHYS + (5 << 22)) 44#define RTC_PHYS_BASE (PXA_CS1_PHYS + (5 << 22))
45#define DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22)) 45#define CMX270_DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22))
46
47/* leds */
48#define CMX270_GPIO_RED (93)
49#define CMX270_GPIO_GREEN (94)
46 50
47/* GPIO IRQ usage */ 51/* GPIO IRQ usage */
48#define GPIO10_ETHIRQ (10) 52#define GPIO10_ETHIRQ (10)
49#define GPIO22_IT8152_IRQ (22) 53#define CMX270_GPIO_IT8152_IRQ (22)
50#define GPIO83_MMC_IRQ (83) 54#define GPIO83_MMC_IRQ (83)
51#define GPIO95_GFXIRQ (95) 55#define GPIO95_GFXIRQ (95)
52 56
53#define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ) 57#define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ)
54#define CMX270_IT8152_IRQ IRQ_GPIO(GPIO22_IT8152_IRQ)
55#define CMX270_MMC_IRQ IRQ_GPIO(GPIO83_MMC_IRQ) 58#define CMX270_MMC_IRQ IRQ_GPIO(GPIO83_MMC_IRQ)
56#define CMX270_GFXIRQ IRQ_GPIO(GPIO95_GFXIRQ) 59#define CMX270_GFXIRQ IRQ_GPIO(GPIO95_GFXIRQ)
57 60
@@ -160,13 +163,13 @@ static unsigned long cmx270_pin_config[] = {
160#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 163#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
161static struct resource cmx270_dm9000_resource[] = { 164static struct resource cmx270_dm9000_resource[] = {
162 [0] = { 165 [0] = {
163 .start = DM9000_PHYS_BASE, 166 .start = CMX270_DM9000_PHYS_BASE,
164 .end = DM9000_PHYS_BASE + 4, 167 .end = CMX270_DM9000_PHYS_BASE + 3,
165 .flags = IORESOURCE_MEM, 168 .flags = IORESOURCE_MEM,
166 }, 169 },
167 [1] = { 170 [1] = {
168 .start = DM9000_PHYS_BASE + 8, 171 .start = CMX270_DM9000_PHYS_BASE + 8,
169 .end = DM9000_PHYS_BASE + 8 + 500, 172 .end = CMX270_DM9000_PHYS_BASE + 8 + 500,
170 .flags = IORESOURCE_MEM, 173 .flags = IORESOURCE_MEM,
171 }, 174 },
172 [2] = { 175 [2] = {
@@ -180,37 +183,37 @@ static struct dm9000_plat_data cmx270_dm9000_platdata = {
180 .flags = DM9000_PLATF_32BITONLY, 183 .flags = DM9000_PLATF_32BITONLY,
181}; 184};
182 185
183static struct platform_device cmx270_dm9000_device = { 186static struct platform_device cmx2xx_dm9000_device = {
184 .name = "dm9000", 187 .name = "dm9000",
185 .id = 0, 188 .id = 0,
186 .num_resources = ARRAY_SIZE(cmx270_dm9000_resource), 189 .num_resources = ARRAY_SIZE(cmx270_dm9000_resource),
187 .resource = cmx270_dm9000_resource,
188 .dev = { 190 .dev = {
189 .platform_data = &cmx270_dm9000_platdata, 191 .platform_data = &cmx270_dm9000_platdata,
190 } 192 }
191}; 193};
192 194
193static void __init cmx270_init_dm9000(void) 195static void __init cmx2xx_init_dm9000(void)
194{ 196{
195 platform_device_register(&cmx270_dm9000_device); 197 cmx2xx_dm9000_device.resource = cmx270_dm9000_resource,
198 platform_device_register(&cmx2xx_dm9000_device);
196} 199}
197#else 200#else
198static inline void cmx270_init_dm9000(void) {} 201static inline void cmx2xx_init_dm9000(void) {}
199#endif 202#endif
200 203
201/* UCB1400 touchscreen controller */ 204/* UCB1400 touchscreen controller */
202#if defined(CONFIG_TOUCHSCREEN_UCB1400) || defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE) 205#if defined(CONFIG_TOUCHSCREEN_UCB1400) || defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
203static struct platform_device cmx270_ts_device = { 206static struct platform_device cmx2xx_ts_device = {
204 .name = "ucb1400_ts", 207 .name = "ucb1400_ts",
205 .id = -1, 208 .id = -1,
206}; 209};
207 210
208static void __init cmx270_init_touchscreen(void) 211static void __init cmx2xx_init_touchscreen(void)
209{ 212{
210 platform_device_register(&cmx270_ts_device); 213 platform_device_register(&cmx2xx_ts_device);
211} 214}
212#else 215#else
213static inline void cmx270_init_touchscreen(void) {} 216static inline void cmx2xx_init_touchscreen(void) {}
214#endif 217#endif
215 218
216/* V3020 RTC */ 219/* V3020 RTC */
@@ -242,45 +245,45 @@ static void __init cmx270_init_rtc(void)
242 platform_device_register(&cmx270_rtc_device); 245 platform_device_register(&cmx270_rtc_device);
243} 246}
244#else 247#else
245static inline void cmx270_init_rtc(void) {} 248static inline void cmx2xx_init_rtc(void) {}
246#endif 249#endif
247 250
248/* CM-X270 LEDs */ 251/* CM-X270 LEDs */
249#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 252#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
250static struct gpio_led cmx270_leds[] = { 253static struct gpio_led cmx2xx_leds[] = {
251 [0] = { 254 [0] = {
252 .name = "cm-x270:red", 255 .name = "cm-x2xx:red",
253 .default_trigger = "nand-disk", 256 .default_trigger = "nand-disk",
254 .gpio = 93,
255 .active_low = 1, 257 .active_low = 1,
256 }, 258 },
257 [1] = { 259 [1] = {
258 .name = "cm-x270:green", 260 .name = "cm-x2xx:green",
259 .default_trigger = "heartbeat", 261 .default_trigger = "heartbeat",
260 .gpio = 94,
261 .active_low = 1, 262 .active_low = 1,
262 }, 263 },
263}; 264};
264 265
265static struct gpio_led_platform_data cmx270_gpio_led_pdata = { 266static struct gpio_led_platform_data cmx2xx_gpio_led_pdata = {
266 .num_leds = ARRAY_SIZE(cmx270_leds), 267 .num_leds = ARRAY_SIZE(cmx2xx_leds),
267 .leds = cmx270_leds, 268 .leds = cmx2xx_leds,
268}; 269};
269 270
270static struct platform_device cmx270_led_device = { 271static struct platform_device cmx2xx_led_device = {
271 .name = "leds-gpio", 272 .name = "leds-gpio",
272 .id = -1, 273 .id = -1,
273 .dev = { 274 .dev = {
274 .platform_data = &cmx270_gpio_led_pdata, 275 .platform_data = &cmx2xx_gpio_led_pdata,
275 }, 276 },
276}; 277};
277 278
278static void __init cmx270_init_leds(void) 279static void __init cmx2xx_init_leds(void)
279{ 280{
280 platform_device_register(&cmx270_led_device); 281 cmx2xx_leds[0].gpio = CMX270_GPIO_RED;
282 cmx2xx_leds[1].gpio = CMX270_GPIO_GREEN;
283 platform_device_register(&cmx2xx_led_device);
281} 284}
282#else 285#else
283static inline void cmx270_init_leds(void) {} 286static inline void cmx2xx_init_leds(void) {}
284#endif 287#endif
285 288
286/* 2700G graphics */ 289/* 2700G graphics */
@@ -543,32 +546,32 @@ static struct pxafb_mach_info generic_stn_640x480 = {
543 .cmap_static = 0, 546 .cmap_static = 0,
544}; 547};
545 548
546static struct pxafb_mach_info *cmx270_display = &generic_crt_640x480; 549static struct pxafb_mach_info *cmx2xx_display = &generic_crt_640x480;
547 550
548static int __init cmx270_set_display(char *str) 551static int __init cmx2xx_set_display(char *str)
549{ 552{
550 int disp_type = simple_strtol(str, NULL, 0); 553 int disp_type = simple_strtol(str, NULL, 0);
551 switch (disp_type) { 554 switch (disp_type) {
552 case MTYPE_STN320x240: 555 case MTYPE_STN320x240:
553 cmx270_display = &generic_stn_320x240; 556 cmx2xx_display = &generic_stn_320x240;
554 break; 557 break;
555 case MTYPE_TFT640x480: 558 case MTYPE_TFT640x480:
556 cmx270_display = &generic_tft_640x480; 559 cmx2xx_display = &generic_tft_640x480;
557 break; 560 break;
558 case MTYPE_CRT640x480: 561 case MTYPE_CRT640x480:
559 cmx270_display = &generic_crt_640x480; 562 cmx2xx_display = &generic_crt_640x480;
560 break; 563 break;
561 case MTYPE_CRT800x600: 564 case MTYPE_CRT800x600:
562 cmx270_display = &generic_crt_800x600; 565 cmx2xx_display = &generic_crt_800x600;
563 break; 566 break;
564 case MTYPE_TFT320x240: 567 case MTYPE_TFT320x240:
565 cmx270_display = &generic_tft_320x240; 568 cmx2xx_display = &generic_tft_320x240;
566 break; 569 break;
567 case MTYPE_STN640x480: 570 case MTYPE_STN640x480:
568 cmx270_display = &generic_stn_640x480; 571 cmx2xx_display = &generic_stn_640x480;
569 break; 572 break;
570 default: /* fallback to CRT 640x480 */ 573 default: /* fallback to CRT 640x480 */
571 cmx270_display = &generic_crt_640x480; 574 cmx2xx_display = &generic_crt_640x480;
572 break; 575 break;
573 } 576 }
574 return 1; 577 return 1;
@@ -577,18 +580,18 @@ static int __init cmx270_set_display(char *str)
577/* 580/*
578 This should be done really early to get proper configuration for 581 This should be done really early to get proper configuration for
579 frame buffer. 582 frame buffer.
580 Indeed, pxafb parameters can be used istead, but CM-X270 bootloader 583 Indeed, pxafb parameters can be used istead, but CM-X2XX bootloader
581 has limitied line length for kernel command line, and also it will 584 has limitied line length for kernel command line, and also it will
582 break compatibitlty with proprietary releases already in field. 585 break compatibitlty with proprietary releases already in field.
583*/ 586*/
584__setup("monitor=", cmx270_set_display); 587__setup("monitor=", cmx2xx_set_display);
585 588
586static void __init cmx270_init_display(void) 589static void __init cmx2xx_init_display(void)
587{ 590{
588 set_pxa_fb_info(cmx270_display); 591 set_pxa_fb_info(cmx2xx_display);
589} 592}
590#else 593#else
591static inline void cmx270_init_display(void) {} 594static inline void cmx2xx_init_display(void) {}
592#endif 595#endif
593 596
594/* PXA27x OHCI controller setup */ 597/* PXA27x OHCI controller setup */
@@ -679,9 +682,9 @@ static inline void cmx270_init_mmc(void) {}
679#ifdef CONFIG_PM 682#ifdef CONFIG_PM
680static unsigned long sleep_save_msc[10]; 683static unsigned long sleep_save_msc[10];
681 684
682static int cmx270_suspend(struct sys_device *dev, pm_message_t state) 685static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state)
683{ 686{
684 cmx270_pci_suspend(); 687 cmx2xx_pci_suspend();
685 688
686 /* save MSC registers */ 689 /* save MSC registers */
687 sleep_save_msc[0] = MSC0; 690 sleep_save_msc[0] = MSC0;
@@ -703,9 +706,9 @@ static int cmx270_suspend(struct sys_device *dev, pm_message_t state)
703 return 0; 706 return 0;
704} 707}
705 708
706static int cmx270_resume(struct sys_device *dev) 709static int cmx2xx_resume(struct sys_device *dev)
707{ 710{
708 cmx270_pci_resume(); 711 cmx2xx_pci_resume();
709 712
710 /* restore MSC registers */ 713 /* restore MSC registers */
711 MSC0 = sleep_save_msc[0]; 714 MSC0 = sleep_save_msc[0];
@@ -715,92 +718,98 @@ static int cmx270_resume(struct sys_device *dev)
715 return 0; 718 return 0;
716} 719}
717 720
718static struct sysdev_class cmx270_pm_sysclass = { 721static struct sysdev_class cmx2xx_pm_sysclass = {
719 .name = "pm", 722 .name = "pm",
720 .resume = cmx270_resume, 723 .resume = cmx2xx_resume,
721 .suspend = cmx270_suspend, 724 .suspend = cmx2xx_suspend,
722}; 725};
723 726
724static struct sys_device cmx270_pm_device = { 727static struct sys_device cmx2xx_pm_device = {
725 .cls = &cmx270_pm_sysclass, 728 .cls = &cmx2xx_pm_sysclass,
726}; 729};
727 730
728static int __init cmx270_pm_init(void) 731static int __init cmx2xx_pm_init(void)
729{ 732{
730 int error; 733 int error;
731 error = sysdev_class_register(&cmx270_pm_sysclass); 734 error = sysdev_class_register(&cmx2xx_pm_sysclass);
732 if (error == 0) 735 if (error == 0)
733 error = sysdev_register(&cmx270_pm_device); 736 error = sysdev_register(&cmx2xx_pm_device);
734 return error; 737 return error;
735} 738}
736#else 739#else
737static int __init cmx270_pm_init(void) { return 0; } 740static int __init cmx2xx_pm_init(void) { return 0; }
738#endif 741#endif
739 742
740#if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE) 743#if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE)
741static void __init cmx270_init_ac97(void) 744static void __init cmx2xx_init_ac97(void)
742{ 745{
743 pxa_set_ac97_info(NULL); 746 pxa_set_ac97_info(NULL);
744} 747}
745#else 748#else
746static inline void cmx270_init_ac97(void) {} 749static inline void cmx2xx_init_ac97(void) {}
747#endif 750#endif
748 751
749static void __init cmx270_init(void) 752static void __init cmx270_init(void)
750{ 753{
751 cmx270_pm_init();
752
753 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config)); 754 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config));
754 755
755 cmx270_init_dm9000();
756 cmx270_init_rtc(); 756 cmx270_init_rtc();
757 cmx270_init_display();
758 cmx270_init_mmc(); 757 cmx270_init_mmc();
759 cmx270_init_ohci(); 758 cmx270_init_ohci();
760 cmx270_init_ac97();
761 cmx270_init_touchscreen();
762 cmx270_init_leds();
763 cmx270_init_2700G(); 759 cmx270_init_2700G();
764} 760}
765 761
766static void __init cmx270_init_irq(void) 762static void __init cmx2xx_init(void)
763{
764 cmx2xx_pm_init();
765
766 cmx270_init();
767
768 cmx2xx_init_dm9000();
769 cmx2xx_init_display();
770 cmx2xx_init_ac97();
771 cmx2xx_init_touchscreen();
772 cmx2xx_init_leds();
773}
774
775static void __init cmx2xx_init_irq(void)
767{ 776{
768 pxa27x_init_irq(); 777 pxa27x_init_irq();
769 778
770 cmx270_pci_init_irq(GPIO22_IT8152_IRQ); 779 cmx2xx_pci_init_irq(CMX270_GPIO_IT8152_IRQ);
771} 780}
772 781
773#ifdef CONFIG_PCI 782#ifdef CONFIG_PCI
774/* Map PCI companion statically */ 783/* Map PCI companion statically */
775static struct map_desc cmx270_io_desc[] __initdata = { 784static struct map_desc cmx2xx_io_desc[] __initdata = {
776 [0] = { /* PCI bridge */ 785 [0] = { /* PCI bridge */
777 .virtual = CMX270_IT8152_VIRT, 786 .virtual = CMX2XX_IT8152_VIRT,
778 .pfn = __phys_to_pfn(PXA_CS4_PHYS), 787 .pfn = __phys_to_pfn(PXA_CS4_PHYS),
779 .length = SZ_64M, 788 .length = SZ_64M,
780 .type = MT_DEVICE 789 .type = MT_DEVICE
781 }, 790 },
782}; 791};
783 792
784static void __init cmx270_map_io(void) 793static void __init cmx2xx_map_io(void)
785{ 794{
786 pxa_map_io(); 795 pxa_map_io();
787 iotable_init(cmx270_io_desc, ARRAY_SIZE(cmx270_io_desc)); 796 iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc));
788 797
789 it8152_base_address = CMX270_IT8152_VIRT; 798 it8152_base_address = CMX2XX_IT8152_VIRT;
790} 799}
791#else 800#else
792static void __init cmx270_map_io(void) 801static void __init cmx2xx_map_io(void)
793{ 802{
794 pxa_map_io(); 803 pxa_map_io();
795} 804}
796#endif 805#endif
797 806
798MACHINE_START(ARMCORE, "Compulab CM-x270") 807MACHINE_START(ARMCORE, "Compulab CM-X2XX")
799 .boot_params = 0xa0000100, 808 .boot_params = 0xa0000100,
800 .phys_io = 0x40000000, 809 .phys_io = 0x40000000,
801 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 810 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
802 .map_io = cmx270_map_io, 811 .map_io = cmx2xx_map_io,
803 .init_irq = cmx270_init_irq, 812 .init_irq = cmx2xx_init_irq,
804 .timer = &pxa_timer, 813 .timer = &pxa_timer,
805 .init_machine = cmx270_init, 814 .init_machine = cmx2xx_init,
806MACHINE_END 815MACHINE_END
diff --git a/arch/arm/mach-pxa/include/mach/memory.h b/arch/arm/mach-pxa/include/mach/memory.h
index 552eb7fa6579..59aef89808d6 100644
--- a/arch/arm/mach-pxa/include/mach/memory.h
+++ b/arch/arm/mach-pxa/include/mach/memory.h
@@ -40,11 +40,11 @@
40#define NODE_MEM_SIZE_BITS 26 40#define NODE_MEM_SIZE_BITS 26
41 41
42#if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI) 42#if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
43void cmx270_pci_adjust_zones(int node, unsigned long *size, 43void cmx2xx_pci_adjust_zones(int node, unsigned long *size,
44 unsigned long *holes); 44 unsigned long *holes);
45 45
46#define arch_adjust_zones(node, size, holes) \ 46#define arch_adjust_zones(node, size, holes) \
47 cmx270_pci_adjust_zones(node, size, holes) 47 cmx2xx_pci_adjust_zones(node, size, holes)
48 48
49#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1) 49#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1)
50#endif 50#endif