blob: cb16eb5bac8f688b396088ec864fd0227489d61c [file] [log] [blame]
Mike Rapoport3696a8a2007-09-23 15:59:26 +01001/*
Mike Rapoportda591932008-10-05 10:25:44 +01002 * linux/arch/arm/mach-pxa/cm-x2xx.c
Mike Rapoport3696a8a2007-09-23 15:59:26 +01003 *
Mike Rapoport4adc5fb62008-10-05 10:26:10 +01004 * Copyright (C) 2008 CompuLab, Ltd.
Mike Rapoport3696a8a2007-09-23 15:59:26 +01005 * Mike Rapoport <mike@compulab.co.il>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
Mike Rapoport3696a8a2007-09-23 15:59:26 +010012#include <linux/platform_device.h>
Mike Rapoport3696a8a2007-09-23 15:59:26 +010013#include <linux/sysdev.h>
Mike Rapoport2f01a972008-06-17 12:29:58 +010014#include <linux/irq.h>
15#include <linux/gpio.h>
Mike Rapoport3696a8a2007-09-23 15:59:26 +010016
17#include <linux/dm9000.h>
Mike Rapoport2f01a972008-06-17 12:29:58 +010018#include <linux/leds.h>
Mike Rapoport3696a8a2007-09-23 15:59:26 +010019
20#include <asm/mach/arch.h>
21#include <asm/mach-types.h>
22#include <asm/mach/map.h>
23
Russell Kinga09e64f2008-08-05 16:14:15 +010024#include <mach/pxa2xx-regs.h>
25#include <mach/mfp-pxa27x.h>
26#include <mach/pxa-regs.h>
27#include <mach/audio.h>
28#include <mach/pxafb.h>
Mike Rapoport3696a8a2007-09-23 15:59:26 +010029
30#include <asm/hardware/it8152.h>
31
32#include "generic.h"
Mike Rapoport7d76e3f2008-10-07 11:58:25 +010033#include "cm-x2xx-pci.h"
Mike Rapoport3696a8a2007-09-23 15:59:26 +010034
Mike Rapoport4adc5fb62008-10-05 10:26:10 +010035extern void cmx270_init(void);
36
Mike Rapoport2f01a972008-06-17 12:29:58 +010037/* virtual addresses for statically mapped regions */
Mike Rapoportda591932008-10-05 10:25:44 +010038#define CMX2XX_VIRT_BASE (0xe8000000)
39#define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE)
Mike Rapoport2f01a972008-06-17 12:29:58 +010040
Mike Rapoport4adc5fb62008-10-05 10:26:10 +010041/* physical address if local-bus attached devices */
Mike Rapoportda591932008-10-05 10:25:44 +010042#define CMX270_DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22))
43
44/* leds */
45#define CMX270_GPIO_RED (93)
46#define CMX270_GPIO_GREEN (94)
Mike Rapoport3696a8a2007-09-23 15:59:26 +010047
Mike Rapoport2f01a972008-06-17 12:29:58 +010048/* GPIO IRQ usage */
49#define GPIO10_ETHIRQ (10)
Mike Rapoportda591932008-10-05 10:25:44 +010050#define CMX270_GPIO_IT8152_IRQ (22)
Mike Rapoport2f01a972008-06-17 12:29:58 +010051
52#define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ)
Mike Rapoport2f01a972008-06-17 12:29:58 +010053
54#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
55static struct resource cmx270_dm9000_resource[] = {
Mike Rapoport3696a8a2007-09-23 15:59:26 +010056 [0] = {
Mike Rapoportda591932008-10-05 10:25:44 +010057 .start = CMX270_DM9000_PHYS_BASE,
58 .end = CMX270_DM9000_PHYS_BASE + 3,
Mike Rapoport3696a8a2007-09-23 15:59:26 +010059 .flags = IORESOURCE_MEM,
60 },
61 [1] = {
Mike Rapoportda591932008-10-05 10:25:44 +010062 .start = CMX270_DM9000_PHYS_BASE + 8,
63 .end = CMX270_DM9000_PHYS_BASE + 8 + 500,
Mike Rapoport3696a8a2007-09-23 15:59:26 +010064 .flags = IORESOURCE_MEM,
65 },
66 [2] = {
67 .start = CMX270_ETHIRQ,
68 .end = CMX270_ETHIRQ,
Mike Rapoport2f01a972008-06-17 12:29:58 +010069 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
Mike Rapoport3696a8a2007-09-23 15:59:26 +010070 }
71};
72
Mike Rapoport2f01a972008-06-17 12:29:58 +010073static struct dm9000_plat_data cmx270_dm9000_platdata = {
Mike Rapoport3696a8a2007-09-23 15:59:26 +010074 .flags = DM9000_PLATF_32BITONLY,
75};
76
Mike Rapoportda591932008-10-05 10:25:44 +010077static struct platform_device cmx2xx_dm9000_device = {
Mike Rapoport3696a8a2007-09-23 15:59:26 +010078 .name = "dm9000",
79 .id = 0,
Mike Rapoport2f01a972008-06-17 12:29:58 +010080 .num_resources = ARRAY_SIZE(cmx270_dm9000_resource),
Mike Rapoport3696a8a2007-09-23 15:59:26 +010081 .dev = {
Mike Rapoport2f01a972008-06-17 12:29:58 +010082 .platform_data = &cmx270_dm9000_platdata,
Mike Rapoport3696a8a2007-09-23 15:59:26 +010083 }
84};
85
Mike Rapoportda591932008-10-05 10:25:44 +010086static void __init cmx2xx_init_dm9000(void)
Mike Rapoport2f01a972008-06-17 12:29:58 +010087{
Mike Rapoportda591932008-10-05 10:25:44 +010088 cmx2xx_dm9000_device.resource = cmx270_dm9000_resource,
89 platform_device_register(&cmx2xx_dm9000_device);
Mike Rapoport2f01a972008-06-17 12:29:58 +010090}
91#else
Mike Rapoportda591932008-10-05 10:25:44 +010092static inline void cmx2xx_init_dm9000(void) {}
Mike Rapoport2f01a972008-06-17 12:29:58 +010093#endif
94
95/* UCB1400 touchscreen controller */
96#if defined(CONFIG_TOUCHSCREEN_UCB1400) || defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
Mike Rapoportda591932008-10-05 10:25:44 +010097static struct platform_device cmx2xx_ts_device = {
Mike Rapoport3696a8a2007-09-23 15:59:26 +010098 .name = "ucb1400_ts",
99 .id = -1,
100};
101
Mike Rapoportda591932008-10-05 10:25:44 +0100102static void __init cmx2xx_init_touchscreen(void)
Mike Rapoport2f01a972008-06-17 12:29:58 +0100103{
Mike Rapoportda591932008-10-05 10:25:44 +0100104 platform_device_register(&cmx2xx_ts_device);
Mike Rapoport2f01a972008-06-17 12:29:58 +0100105}
106#else
Mike Rapoportda591932008-10-05 10:25:44 +0100107static inline void cmx2xx_init_touchscreen(void) {}
Mike Rapoport2f01a972008-06-17 12:29:58 +0100108#endif
109
Mike Rapoport2f01a972008-06-17 12:29:58 +0100110/* CM-X270 LEDs */
111#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
Mike Rapoportda591932008-10-05 10:25:44 +0100112static struct gpio_led cmx2xx_leds[] = {
Mike Rapoport2f01a972008-06-17 12:29:58 +0100113 [0] = {
Mike Rapoportda591932008-10-05 10:25:44 +0100114 .name = "cm-x2xx:red",
Mike Rapoport2f01a972008-06-17 12:29:58 +0100115 .default_trigger = "nand-disk",
Mike Rapoport2f01a972008-06-17 12:29:58 +0100116 .active_low = 1,
117 },
118 [1] = {
Mike Rapoportda591932008-10-05 10:25:44 +0100119 .name = "cm-x2xx:green",
Mike Rapoport2f01a972008-06-17 12:29:58 +0100120 .default_trigger = "heartbeat",
Mike Rapoport2f01a972008-06-17 12:29:58 +0100121 .active_low = 1,
122 },
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100123};
124
Mike Rapoportda591932008-10-05 10:25:44 +0100125static struct gpio_led_platform_data cmx2xx_gpio_led_pdata = {
126 .num_leds = ARRAY_SIZE(cmx2xx_leds),
127 .leds = cmx2xx_leds,
Mike Rapoport2f01a972008-06-17 12:29:58 +0100128};
129
Mike Rapoportda591932008-10-05 10:25:44 +0100130static struct platform_device cmx2xx_led_device = {
Mike Rapoport2f01a972008-06-17 12:29:58 +0100131 .name = "leds-gpio",
132 .id = -1,
133 .dev = {
Mike Rapoportda591932008-10-05 10:25:44 +0100134 .platform_data = &cmx2xx_gpio_led_pdata,
Mike Rapoport2f01a972008-06-17 12:29:58 +0100135 },
136};
137
Mike Rapoportda591932008-10-05 10:25:44 +0100138static void __init cmx2xx_init_leds(void)
Mike Rapoport2f01a972008-06-17 12:29:58 +0100139{
Mike Rapoportda591932008-10-05 10:25:44 +0100140 cmx2xx_leds[0].gpio = CMX270_GPIO_RED;
141 cmx2xx_leds[1].gpio = CMX270_GPIO_GREEN;
142 platform_device_register(&cmx2xx_led_device);
Mike Rapoport2f01a972008-06-17 12:29:58 +0100143}
144#else
Mike Rapoportda591932008-10-05 10:25:44 +0100145static inline void cmx2xx_init_leds(void) {}
Mike Rapoport2f01a972008-06-17 12:29:58 +0100146#endif
147
Mike Rapoport2f01a972008-06-17 12:29:58 +0100148#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100149/*
150 Display definitions
151 keep these for backwards compatibility, although symbolic names (as
152 e.g. in lpd270.c) looks better
153*/
154#define MTYPE_STN320x240 0
155#define MTYPE_TFT640x480 1
156#define MTYPE_CRT640x480 2
157#define MTYPE_CRT800x600 3
158#define MTYPE_TFT320x240 6
159#define MTYPE_STN640x480 7
160
161static struct pxafb_mode_info generic_stn_320x240_mode = {
162 .pixclock = 76923,
163 .bpp = 8,
164 .xres = 320,
165 .yres = 240,
166 .hsync_len = 3,
167 .vsync_len = 2,
168 .left_margin = 3,
169 .upper_margin = 0,
170 .right_margin = 3,
171 .lower_margin = 0,
172 .sync = (FB_SYNC_HOR_HIGH_ACT |
173 FB_SYNC_VERT_HIGH_ACT),
174 .cmap_greyscale = 0,
175};
176
177static struct pxafb_mach_info generic_stn_320x240 = {
178 .modes = &generic_stn_320x240_mode,
179 .num_modes = 1,
180 .lccr0 = 0,
181 .lccr3 = (LCCR3_PixClkDiv(0x03) |
182 LCCR3_Acb(0xff) |
183 LCCR3_PCP),
184 .cmap_inverse = 0,
185 .cmap_static = 0,
186};
187
188static struct pxafb_mode_info generic_tft_640x480_mode = {
189 .pixclock = 38461,
190 .bpp = 8,
191 .xres = 640,
192 .yres = 480,
193 .hsync_len = 60,
194 .vsync_len = 2,
195 .left_margin = 70,
196 .upper_margin = 10,
197 .right_margin = 70,
198 .lower_margin = 5,
199 .sync = 0,
200 .cmap_greyscale = 0,
201};
202
203static struct pxafb_mach_info generic_tft_640x480 = {
204 .modes = &generic_tft_640x480_mode,
205 .num_modes = 1,
206 .lccr0 = (LCCR0_PAS),
207 .lccr3 = (LCCR3_PixClkDiv(0x01) |
208 LCCR3_Acb(0xff) |
209 LCCR3_PCP),
210 .cmap_inverse = 0,
211 .cmap_static = 0,
212};
213
214static struct pxafb_mode_info generic_crt_640x480_mode = {
215 .pixclock = 38461,
216 .bpp = 8,
217 .xres = 640,
218 .yres = 480,
219 .hsync_len = 63,
220 .vsync_len = 2,
221 .left_margin = 81,
222 .upper_margin = 33,
223 .right_margin = 16,
224 .lower_margin = 10,
225 .sync = (FB_SYNC_HOR_HIGH_ACT |
226 FB_SYNC_VERT_HIGH_ACT),
227 .cmap_greyscale = 0,
228};
229
230static struct pxafb_mach_info generic_crt_640x480 = {
231 .modes = &generic_crt_640x480_mode,
232 .num_modes = 1,
233 .lccr0 = (LCCR0_PAS),
234 .lccr3 = (LCCR3_PixClkDiv(0x01) |
235 LCCR3_Acb(0xff)),
236 .cmap_inverse = 0,
237 .cmap_static = 0,
238};
239
240static struct pxafb_mode_info generic_crt_800x600_mode = {
241 .pixclock = 28846,
242 .bpp = 8,
243 .xres = 800,
244 .yres = 600,
245 .hsync_len = 63,
246 .vsync_len = 2,
247 .left_margin = 26,
248 .upper_margin = 21,
249 .right_margin = 26,
250 .lower_margin = 11,
251 .sync = (FB_SYNC_HOR_HIGH_ACT |
252 FB_SYNC_VERT_HIGH_ACT),
253 .cmap_greyscale = 0,
254};
255
256static struct pxafb_mach_info generic_crt_800x600 = {
257 .modes = &generic_crt_800x600_mode,
258 .num_modes = 1,
259 .lccr0 = (LCCR0_PAS),
260 .lccr3 = (LCCR3_PixClkDiv(0x02) |
261 LCCR3_Acb(0xff)),
262 .cmap_inverse = 0,
263 .cmap_static = 0,
264};
265
266static struct pxafb_mode_info generic_tft_320x240_mode = {
267 .pixclock = 134615,
268 .bpp = 16,
269 .xres = 320,
270 .yres = 240,
271 .hsync_len = 63,
272 .vsync_len = 7,
273 .left_margin = 75,
274 .upper_margin = 0,
275 .right_margin = 15,
276 .lower_margin = 15,
277 .sync = 0,
278 .cmap_greyscale = 0,
279};
280
281static struct pxafb_mach_info generic_tft_320x240 = {
282 .modes = &generic_tft_320x240_mode,
283 .num_modes = 1,
284 .lccr0 = (LCCR0_PAS),
285 .lccr3 = (LCCR3_PixClkDiv(0x06) |
286 LCCR3_Acb(0xff) |
287 LCCR3_PCP),
288 .cmap_inverse = 0,
289 .cmap_static = 0,
290};
291
292static struct pxafb_mode_info generic_stn_640x480_mode = {
293 .pixclock = 57692,
294 .bpp = 8,
295 .xres = 640,
296 .yres = 480,
297 .hsync_len = 4,
298 .vsync_len = 2,
299 .left_margin = 10,
300 .upper_margin = 5,
301 .right_margin = 10,
302 .lower_margin = 5,
303 .sync = (FB_SYNC_HOR_HIGH_ACT |
304 FB_SYNC_VERT_HIGH_ACT),
305 .cmap_greyscale = 0,
306};
307
308static struct pxafb_mach_info generic_stn_640x480 = {
309 .modes = &generic_stn_640x480_mode,
310 .num_modes = 1,
311 .lccr0 = 0,
312 .lccr3 = (LCCR3_PixClkDiv(0x02) |
313 LCCR3_Acb(0xff)),
314 .cmap_inverse = 0,
315 .cmap_static = 0,
316};
317
Mike Rapoportda591932008-10-05 10:25:44 +0100318static struct pxafb_mach_info *cmx2xx_display = &generic_crt_640x480;
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100319
Mike Rapoportda591932008-10-05 10:25:44 +0100320static int __init cmx2xx_set_display(char *str)
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100321{
322 int disp_type = simple_strtol(str, NULL, 0);
323 switch (disp_type) {
324 case MTYPE_STN320x240:
Mike Rapoportda591932008-10-05 10:25:44 +0100325 cmx2xx_display = &generic_stn_320x240;
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100326 break;
327 case MTYPE_TFT640x480:
Mike Rapoportda591932008-10-05 10:25:44 +0100328 cmx2xx_display = &generic_tft_640x480;
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100329 break;
330 case MTYPE_CRT640x480:
Mike Rapoportda591932008-10-05 10:25:44 +0100331 cmx2xx_display = &generic_crt_640x480;
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100332 break;
333 case MTYPE_CRT800x600:
Mike Rapoportda591932008-10-05 10:25:44 +0100334 cmx2xx_display = &generic_crt_800x600;
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100335 break;
336 case MTYPE_TFT320x240:
Mike Rapoportda591932008-10-05 10:25:44 +0100337 cmx2xx_display = &generic_tft_320x240;
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100338 break;
339 case MTYPE_STN640x480:
Mike Rapoportda591932008-10-05 10:25:44 +0100340 cmx2xx_display = &generic_stn_640x480;
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100341 break;
342 default: /* fallback to CRT 640x480 */
Mike Rapoportda591932008-10-05 10:25:44 +0100343 cmx2xx_display = &generic_crt_640x480;
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100344 break;
345 }
346 return 1;
347}
348
349/*
350 This should be done really early to get proper configuration for
351 frame buffer.
Mike Rapoportda591932008-10-05 10:25:44 +0100352 Indeed, pxafb parameters can be used istead, but CM-X2XX bootloader
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100353 has limitied line length for kernel command line, and also it will
354 break compatibitlty with proprietary releases already in field.
355*/
Mike Rapoportda591932008-10-05 10:25:44 +0100356__setup("monitor=", cmx2xx_set_display);
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100357
Mike Rapoportda591932008-10-05 10:25:44 +0100358static void __init cmx2xx_init_display(void)
Mike Rapoport2f01a972008-06-17 12:29:58 +0100359{
Mike Rapoportda591932008-10-05 10:25:44 +0100360 set_pxa_fb_info(cmx2xx_display);
Mike Rapoport2f01a972008-06-17 12:29:58 +0100361}
362#else
Mike Rapoportda591932008-10-05 10:25:44 +0100363static inline void cmx2xx_init_display(void) {}
Mike Rapoport2f01a972008-06-17 12:29:58 +0100364#endif
365
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100366#ifdef CONFIG_PM
367static unsigned long sleep_save_msc[10];
368
Mike Rapoportda591932008-10-05 10:25:44 +0100369static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state)
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100370{
Mike Rapoportda591932008-10-05 10:25:44 +0100371 cmx2xx_pci_suspend();
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100372
373 /* save MSC registers */
374 sleep_save_msc[0] = MSC0;
375 sleep_save_msc[1] = MSC1;
376 sleep_save_msc[2] = MSC2;
377
378 /* setup power saving mode registers */
379 PCFR = 0x0;
380 PSLR = 0xff400000;
381 PMCR = 0x00000005;
382 PWER = 0x80000000;
383 PFER = 0x00000000;
384 PRER = 0x00000000;
385 PGSR0 = 0xC0018800;
386 PGSR1 = 0x004F0002;
387 PGSR2 = 0x6021C000;
388 PGSR3 = 0x00020000;
389
390 return 0;
391}
392
Mike Rapoportda591932008-10-05 10:25:44 +0100393static int cmx2xx_resume(struct sys_device *dev)
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100394{
Mike Rapoportda591932008-10-05 10:25:44 +0100395 cmx2xx_pci_resume();
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100396
397 /* restore MSC registers */
398 MSC0 = sleep_save_msc[0];
399 MSC1 = sleep_save_msc[1];
400 MSC2 = sleep_save_msc[2];
401
402 return 0;
403}
404
Mike Rapoportda591932008-10-05 10:25:44 +0100405static struct sysdev_class cmx2xx_pm_sysclass = {
Kay Sieversaf5ca3f2007-12-20 02:09:39 +0100406 .name = "pm",
Mike Rapoportda591932008-10-05 10:25:44 +0100407 .resume = cmx2xx_resume,
408 .suspend = cmx2xx_suspend,
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100409};
410
Mike Rapoportda591932008-10-05 10:25:44 +0100411static struct sys_device cmx2xx_pm_device = {
412 .cls = &cmx2xx_pm_sysclass,
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100413};
414
Mike Rapoportda591932008-10-05 10:25:44 +0100415static int __init cmx2xx_pm_init(void)
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100416{
417 int error;
Mike Rapoportda591932008-10-05 10:25:44 +0100418 error = sysdev_class_register(&cmx2xx_pm_sysclass);
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100419 if (error == 0)
Mike Rapoportda591932008-10-05 10:25:44 +0100420 error = sysdev_register(&cmx2xx_pm_device);
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100421 return error;
422}
423#else
Mike Rapoportda591932008-10-05 10:25:44 +0100424static int __init cmx2xx_pm_init(void) { return 0; }
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100425#endif
426
Mike Rapoport2f01a972008-06-17 12:29:58 +0100427#if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE)
Mike Rapoportda591932008-10-05 10:25:44 +0100428static void __init cmx2xx_init_ac97(void)
Mike Rapoport2f01a972008-06-17 12:29:58 +0100429{
430 pxa_set_ac97_info(NULL);
431}
432#else
Mike Rapoportda591932008-10-05 10:25:44 +0100433static inline void cmx2xx_init_ac97(void) {}
Mike Rapoport2f01a972008-06-17 12:29:58 +0100434#endif
435
Mike Rapoportda591932008-10-05 10:25:44 +0100436static void __init cmx2xx_init(void)
437{
438 cmx2xx_pm_init();
439
440 cmx270_init();
441
442 cmx2xx_init_dm9000();
443 cmx2xx_init_display();
444 cmx2xx_init_ac97();
445 cmx2xx_init_touchscreen();
446 cmx2xx_init_leds();
447}
448
449static void __init cmx2xx_init_irq(void)
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100450{
451 pxa27x_init_irq();
452
Mike Rapoportda591932008-10-05 10:25:44 +0100453 cmx2xx_pci_init_irq(CMX270_GPIO_IT8152_IRQ);
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100454}
455
Mike Rapoport2f01a972008-06-17 12:29:58 +0100456#ifdef CONFIG_PCI
457/* Map PCI companion statically */
Mike Rapoportda591932008-10-05 10:25:44 +0100458static struct map_desc cmx2xx_io_desc[] __initdata = {
Mike Rapoport2f01a972008-06-17 12:29:58 +0100459 [0] = { /* PCI bridge */
Mike Rapoportda591932008-10-05 10:25:44 +0100460 .virtual = CMX2XX_IT8152_VIRT,
Mike Rapoport2f01a972008-06-17 12:29:58 +0100461 .pfn = __phys_to_pfn(PXA_CS4_PHYS),
462 .length = SZ_64M,
463 .type = MT_DEVICE
464 },
465};
466
Mike Rapoportda591932008-10-05 10:25:44 +0100467static void __init cmx2xx_map_io(void)
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100468{
469 pxa_map_io();
Mike Rapoportda591932008-10-05 10:25:44 +0100470 iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc));
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100471
Mike Rapoportda591932008-10-05 10:25:44 +0100472 it8152_base_address = CMX2XX_IT8152_VIRT;
Mike Rapoport2f01a972008-06-17 12:29:58 +0100473}
474#else
Mike Rapoportda591932008-10-05 10:25:44 +0100475static void __init cmx2xx_map_io(void)
Mike Rapoport2f01a972008-06-17 12:29:58 +0100476{
477 pxa_map_io();
478}
479#endif
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100480
Mike Rapoportda591932008-10-05 10:25:44 +0100481MACHINE_START(ARMCORE, "Compulab CM-X2XX")
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100482 .boot_params = 0xa0000100,
483 .phys_io = 0x40000000,
484 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Mike Rapoportda591932008-10-05 10:25:44 +0100485 .map_io = cmx2xx_map_io,
486 .init_irq = cmx2xx_init_irq,
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100487 .timer = &pxa_timer,
Mike Rapoportda591932008-10-05 10:25:44 +0100488 .init_machine = cmx2xx_init,
Mike Rapoport3696a8a2007-09-23 15:59:26 +0100489MACHINE_END