Commit | Line | Data |
---|---|---|
cf75d8d2 MR |
1 | /* |
2 | * linux/arch/arm/mach-pxa/cm-x300.c | |
3 | * | |
4 | * Support for the CompuLab CM-X300 modules | |
5 | * | |
6 | * Copyright (C) 2008 CompuLab Ltd. | |
7 | * | |
8 | * Mike Rapoport <mike@compulab.co.il> | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License version 2 as | |
12 | * published by the Free Software Foundation. | |
13 | */ | |
14 | ||
15 | #include <linux/module.h> | |
16 | #include <linux/kernel.h> | |
17 | #include <linux/interrupt.h> | |
18 | #include <linux/init.h> | |
19 | #include <linux/platform_device.h> | |
20 | ||
21 | #include <linux/gpio.h> | |
22 | #include <linux/dm9000.h> | |
23 | #include <linux/leds.h> | |
1858ced3 | 24 | #include <linux/rtc-v3020.h> |
cf75d8d2 MR |
25 | |
26 | #include <linux/i2c.h> | |
27 | #include <linux/i2c/pca953x.h> | |
28 | ||
83e560ee IG |
29 | #include <linux/spi/spi.h> |
30 | #include <linux/spi/spi_gpio.h> | |
31 | #include <linux/spi/tdo24m.h> | |
32 | ||
cf75d8d2 MR |
33 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | |
b5a5c474 | 35 | #include <asm/setup.h> |
cf75d8d2 | 36 | |
51c62982 | 37 | #include <mach/pxa300.h> |
cf75d8d2 MR |
38 | #include <mach/pxafb.h> |
39 | #include <mach/mmc.h> | |
40 | #include <mach/ohci.h> | |
f0a83701 | 41 | #include <plat/i2c.h> |
82b95ecb | 42 | #include <plat/pxa3xx_nand.h> |
74e74def | 43 | #include <mach/audio.h> |
cf75d8d2 MR |
44 | |
45 | #include <asm/mach/map.h> | |
46 | ||
47 | #include "generic.h" | |
48 | ||
49 | #define CM_X300_ETH_PHYS 0x08000010 | |
50 | ||
0bff2fc3 MR |
51 | #define GPIO82_MMC_IRQ (82) |
52 | #define GPIO85_MMC_WP (85) | |
cf75d8d2 | 53 | |
0bff2fc3 | 54 | #define CM_X300_MMC_IRQ IRQ_GPIO(GPIO82_MMC_IRQ) |
cf75d8d2 | 55 | |
1858ced3 MR |
56 | #define GPIO95_RTC_CS (95) |
57 | #define GPIO96_RTC_WR (96) | |
58 | #define GPIO97_RTC_RD (97) | |
59 | #define GPIO98_RTC_IO (98) | |
60 | ||
cf75d8d2 MR |
61 | static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { |
62 | /* LCD */ | |
63 | GPIO54_LCD_LDD_0, | |
64 | GPIO55_LCD_LDD_1, | |
65 | GPIO56_LCD_LDD_2, | |
66 | GPIO57_LCD_LDD_3, | |
67 | GPIO58_LCD_LDD_4, | |
68 | GPIO59_LCD_LDD_5, | |
69 | GPIO60_LCD_LDD_6, | |
70 | GPIO61_LCD_LDD_7, | |
71 | GPIO62_LCD_LDD_8, | |
72 | GPIO63_LCD_LDD_9, | |
73 | GPIO64_LCD_LDD_10, | |
74 | GPIO65_LCD_LDD_11, | |
75 | GPIO66_LCD_LDD_12, | |
76 | GPIO67_LCD_LDD_13, | |
77 | GPIO68_LCD_LDD_14, | |
78 | GPIO69_LCD_LDD_15, | |
79 | GPIO72_LCD_FCLK, | |
80 | GPIO73_LCD_LCLK, | |
81 | GPIO74_LCD_PCLK, | |
82 | GPIO75_LCD_BIAS, | |
83 | ||
84 | /* BTUART */ | |
85 | GPIO111_UART2_RTS, | |
86 | GPIO112_UART2_RXD | MFP_LPM_EDGE_FALL, | |
87 | GPIO113_UART2_TXD, | |
88 | GPIO114_UART2_CTS | MFP_LPM_EDGE_BOTH, | |
89 | ||
90 | /* STUART */ | |
91 | GPIO109_UART3_TXD, | |
92 | GPIO110_UART3_RXD | MFP_LPM_EDGE_FALL, | |
93 | ||
94 | /* AC97 */ | |
95 | GPIO23_AC97_nACRESET, | |
96 | GPIO24_AC97_SYSCLK, | |
97 | GPIO29_AC97_BITCLK, | |
98 | GPIO25_AC97_SDATA_IN_0, | |
99 | GPIO27_AC97_SDATA_OUT, | |
100 | GPIO28_AC97_SYNC, | |
101 | ||
102 | /* Keypad */ | |
103 | GPIO115_KP_MKIN_0 | MFP_LPM_EDGE_BOTH, | |
104 | GPIO116_KP_MKIN_1 | MFP_LPM_EDGE_BOTH, | |
105 | GPIO117_KP_MKIN_2 | MFP_LPM_EDGE_BOTH, | |
106 | GPIO118_KP_MKIN_3 | MFP_LPM_EDGE_BOTH, | |
107 | GPIO119_KP_MKIN_4 | MFP_LPM_EDGE_BOTH, | |
108 | GPIO120_KP_MKIN_5 | MFP_LPM_EDGE_BOTH, | |
109 | GPIO2_2_KP_MKIN_6 | MFP_LPM_EDGE_BOTH, | |
110 | GPIO3_2_KP_MKIN_7 | MFP_LPM_EDGE_BOTH, | |
111 | GPIO121_KP_MKOUT_0, | |
112 | GPIO122_KP_MKOUT_1, | |
113 | GPIO123_KP_MKOUT_2, | |
114 | GPIO124_KP_MKOUT_3, | |
115 | GPIO125_KP_MKOUT_4, | |
116 | GPIO4_2_KP_MKOUT_5, | |
117 | ||
118 | /* MMC1 */ | |
119 | GPIO3_MMC1_DAT0, | |
120 | GPIO4_MMC1_DAT1 | MFP_LPM_EDGE_BOTH, | |
121 | GPIO5_MMC1_DAT2, | |
122 | GPIO6_MMC1_DAT3, | |
123 | GPIO7_MMC1_CLK, | |
124 | GPIO8_MMC1_CMD, /* CMD0 for slot 0 */ | |
125 | ||
126 | /* MMC2 */ | |
127 | GPIO9_MMC2_DAT0, | |
128 | GPIO10_MMC2_DAT1 | MFP_LPM_EDGE_BOTH, | |
129 | GPIO11_MMC2_DAT2, | |
130 | GPIO12_MMC2_DAT3, | |
131 | GPIO13_MMC2_CLK, | |
132 | GPIO14_MMC2_CMD, | |
133 | ||
134 | /* FFUART */ | |
135 | GPIO30_UART1_RXD | MFP_LPM_EDGE_FALL, | |
136 | GPIO31_UART1_TXD, | |
137 | GPIO32_UART1_CTS, | |
138 | GPIO37_UART1_RTS, | |
139 | GPIO33_UART1_DCD, | |
140 | GPIO34_UART1_DSR | MFP_LPM_EDGE_FALL, | |
141 | GPIO35_UART1_RI, | |
142 | GPIO36_UART1_DTR, | |
143 | ||
144 | /* GPIOs */ | |
cf75d8d2 MR |
145 | GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */ |
146 | GPIO85_GPIO, /* MMC WP */ | |
147 | GPIO99_GPIO, /* Ethernet IRQ */ | |
6f584cfa | 148 | |
1858ced3 MR |
149 | /* RTC GPIOs */ |
150 | GPIO95_GPIO, /* RTC CS */ | |
151 | GPIO96_GPIO, /* RTC WR */ | |
152 | GPIO97_GPIO, /* RTC RD */ | |
153 | GPIO98_GPIO, /* RTC IO */ | |
154 | ||
6f584cfa EM |
155 | /* Standard I2C */ |
156 | GPIO21_I2C_SCL, | |
157 | GPIO22_I2C_SDA, | |
cf75d8d2 MR |
158 | }; |
159 | ||
55052ea2 IG |
160 | static mfp_cfg_t cm_x300_rev_lt130_mfp_cfg[] __initdata = { |
161 | /* GPIOs */ | |
162 | GPIO79_GPIO, /* LED */ | |
163 | GPIO77_GPIO, /* WiFi reset */ | |
164 | GPIO78_GPIO, /* BT reset */ | |
165 | }; | |
166 | ||
167 | static mfp_cfg_t cm_x300_rev_ge130_mfp_cfg[] __initdata = { | |
168 | /* GPIOs */ | |
169 | GPIO76_GPIO, /* LED */ | |
170 | GPIO71_GPIO, /* WiFi reset */ | |
171 | GPIO70_GPIO, /* BT reset */ | |
172 | }; | |
173 | ||
cf75d8d2 MR |
174 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
175 | static struct resource dm9000_resources[] = { | |
176 | [0] = { | |
177 | .start = CM_X300_ETH_PHYS, | |
178 | .end = CM_X300_ETH_PHYS + 0x3, | |
179 | .flags = IORESOURCE_MEM, | |
180 | }, | |
181 | [1] = { | |
182 | .start = CM_X300_ETH_PHYS + 0x4, | |
183 | .end = CM_X300_ETH_PHYS + 0x4 + 500, | |
184 | .flags = IORESOURCE_MEM, | |
185 | }, | |
186 | [2] = { | |
187 | .start = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO99)), | |
188 | .end = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO99)), | |
189 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | |
190 | } | |
191 | }; | |
192 | ||
193 | static struct dm9000_plat_data cm_x300_dm9000_platdata = { | |
bff22c9b | 194 | .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM, |
cf75d8d2 MR |
195 | }; |
196 | ||
197 | static struct platform_device dm9000_device = { | |
198 | .name = "dm9000", | |
199 | .id = 0, | |
200 | .num_resources = ARRAY_SIZE(dm9000_resources), | |
201 | .resource = dm9000_resources, | |
202 | .dev = { | |
203 | .platform_data = &cm_x300_dm9000_platdata, | |
204 | } | |
205 | ||
206 | }; | |
207 | ||
208 | static void __init cm_x300_init_dm9000(void) | |
209 | { | |
210 | platform_device_register(&dm9000_device); | |
211 | } | |
212 | #else | |
213 | static inline void cm_x300_init_dm9000(void) {} | |
214 | #endif | |
215 | ||
83e560ee | 216 | /* LCD */ |
cf75d8d2 MR |
217 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
218 | static struct pxafb_mode_info cm_x300_lcd_modes[] = { | |
219 | [0] = { | |
83e560ee | 220 | .pixclock = 38250, |
cf75d8d2 MR |
221 | .bpp = 16, |
222 | .xres = 480, | |
223 | .yres = 640, | |
224 | .hsync_len = 8, | |
225 | .vsync_len = 2, | |
226 | .left_margin = 8, | |
83e560ee | 227 | .upper_margin = 2, |
cf75d8d2 MR |
228 | .right_margin = 24, |
229 | .lower_margin = 4, | |
230 | .cmap_greyscale = 0, | |
231 | }, | |
232 | [1] = { | |
233 | .pixclock = 153800, | |
234 | .bpp = 16, | |
235 | .xres = 240, | |
236 | .yres = 320, | |
237 | .hsync_len = 8, | |
238 | .vsync_len = 2, | |
239 | .left_margin = 8, | |
240 | .upper_margin = 2, | |
241 | .right_margin = 88, | |
242 | .lower_margin = 2, | |
243 | .cmap_greyscale = 0, | |
244 | }, | |
245 | }; | |
246 | ||
247 | static struct pxafb_mach_info cm_x300_lcd = { | |
248 | .modes = cm_x300_lcd_modes, | |
83e560ee | 249 | .num_modes = ARRAY_SIZE(cm_x300_lcd_modes), |
cf75d8d2 MR |
250 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
251 | }; | |
252 | ||
253 | static void __init cm_x300_init_lcd(void) | |
254 | { | |
255 | set_pxa_fb_info(&cm_x300_lcd); | |
256 | } | |
257 | #else | |
258 | static inline void cm_x300_init_lcd(void) {} | |
259 | #endif | |
260 | ||
83e560ee IG |
261 | #if defined(CONFIG_SPI_GPIO) || defined(CONFIG_SPI_GPIO_MODULE) |
262 | #define GPIO_LCD_BASE (144) | |
263 | #define GPIO_LCD_DIN (GPIO_LCD_BASE + 8) /* aux_gpio3_0 */ | |
264 | #define GPIO_LCD_DOUT (GPIO_LCD_BASE + 9) /* aux_gpio3_1 */ | |
265 | #define GPIO_LCD_SCL (GPIO_LCD_BASE + 10) /* aux_gpio3_2 */ | |
266 | #define GPIO_LCD_CS (GPIO_LCD_BASE + 11) /* aux_gpio3_3 */ | |
267 | #define LCD_SPI_BUS_NUM (1) | |
268 | ||
269 | static struct spi_gpio_platform_data cm_x300_spi_gpio_pdata = { | |
270 | .sck = GPIO_LCD_SCL, | |
271 | .mosi = GPIO_LCD_DIN, | |
272 | .miso = GPIO_LCD_DOUT, | |
273 | .num_chipselect = 1, | |
274 | }; | |
275 | ||
276 | static struct platform_device cm_x300_spi_gpio = { | |
277 | .name = "spi_gpio", | |
278 | .id = LCD_SPI_BUS_NUM, | |
279 | .dev = { | |
280 | .platform_data = &cm_x300_spi_gpio_pdata, | |
281 | }, | |
282 | }; | |
283 | ||
284 | static struct tdo24m_platform_data cm_x300_tdo24m_pdata = { | |
285 | .model = TDO35S, | |
286 | }; | |
287 | ||
288 | static struct spi_board_info cm_x300_spi_devices[] __initdata = { | |
289 | { | |
290 | .modalias = "tdo24m", | |
291 | .max_speed_hz = 1000000, | |
292 | .bus_num = LCD_SPI_BUS_NUM, | |
293 | .chip_select = 0, | |
294 | .controller_data = (void *) GPIO_LCD_CS, | |
295 | .platform_data = &cm_x300_tdo24m_pdata, | |
296 | }, | |
297 | }; | |
298 | ||
299 | static void __init cm_x300_init_spi(void) | |
300 | { | |
301 | spi_register_board_info(cm_x300_spi_devices, | |
302 | ARRAY_SIZE(cm_x300_spi_devices)); | |
303 | platform_device_register(&cm_x300_spi_gpio); | |
304 | } | |
305 | #else | |
306 | static inline void cm_x300_init_spi(void) {} | |
307 | #endif | |
308 | ||
74e74def IG |
309 | #if defined(CONFIG_SND_PXA2XX_LIB_AC97) |
310 | static void __init cm_x300_init_ac97(void) | |
311 | { | |
312 | pxa_set_ac97_info(NULL); | |
313 | } | |
314 | #else | |
315 | static inline void cm_x300_init_ac97(void) {} | |
316 | #endif | |
317 | ||
cf75d8d2 MR |
318 | #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) |
319 | static struct mtd_partition cm_x300_nand_partitions[] = { | |
320 | [0] = { | |
321 | .name = "OBM", | |
322 | .offset = 0, | |
323 | .size = SZ_256K, | |
324 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | |
325 | }, | |
326 | [1] = { | |
327 | .name = "U-Boot", | |
328 | .offset = MTDPART_OFS_APPEND, | |
329 | .size = SZ_256K, | |
330 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | |
331 | }, | |
332 | [2] = { | |
333 | .name = "Environment", | |
334 | .offset = MTDPART_OFS_APPEND, | |
335 | .size = SZ_256K, | |
336 | }, | |
337 | [3] = { | |
338 | .name = "reserved", | |
339 | .offset = MTDPART_OFS_APPEND, | |
340 | .size = SZ_256K + SZ_1M, | |
341 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | |
342 | }, | |
343 | [4] = { | |
344 | .name = "kernel", | |
345 | .offset = MTDPART_OFS_APPEND, | |
346 | .size = SZ_4M, | |
347 | }, | |
348 | [5] = { | |
349 | .name = "fs", | |
350 | .offset = MTDPART_OFS_APPEND, | |
351 | .size = MTDPART_SIZ_FULL, | |
352 | }, | |
353 | }; | |
354 | ||
355 | static struct pxa3xx_nand_platform_data cm_x300_nand_info = { | |
356 | .enable_arbiter = 1, | |
b3992b66 | 357 | .keep_config = 1, |
cf75d8d2 MR |
358 | .parts = cm_x300_nand_partitions, |
359 | .nr_parts = ARRAY_SIZE(cm_x300_nand_partitions), | |
360 | }; | |
361 | ||
362 | static void __init cm_x300_init_nand(void) | |
363 | { | |
364 | pxa3xx_set_nand_info(&cm_x300_nand_info); | |
365 | } | |
366 | #else | |
367 | static inline void cm_x300_init_nand(void) {} | |
368 | #endif | |
369 | ||
370 | #if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE) | |
0bff2fc3 MR |
371 | static struct pxamci_platform_data cm_x300_mci_platform_data = { |
372 | .detect_delay = 20, | |
373 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | |
374 | .gpio_card_detect = GPIO82_MMC_IRQ, | |
375 | .gpio_card_ro = GPIO85_MMC_WP, | |
376 | .gpio_power = -1, | |
377 | }; | |
378 | ||
379 | /* The second MMC slot of CM-X300 is hardwired to Libertas card and has | |
cf75d8d2 | 380 | no detection/ro pins */ |
0bff2fc3 MR |
381 | static int cm_x300_mci2_init(struct device *dev, |
382 | irq_handler_t cm_x300_detect_int, | |
383 | void *data) | |
cf75d8d2 MR |
384 | { |
385 | return 0; | |
386 | } | |
387 | ||
0bff2fc3 | 388 | static void cm_x300_mci2_exit(struct device *dev, void *data) |
cf75d8d2 MR |
389 | { |
390 | } | |
391 | ||
0bff2fc3 | 392 | static struct pxamci_platform_data cm_x300_mci2_platform_data = { |
7a648256 RJ |
393 | .detect_delay = 20, |
394 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | |
0bff2fc3 MR |
395 | .init = cm_x300_mci2_init, |
396 | .exit = cm_x300_mci2_exit, | |
7a648256 RJ |
397 | .gpio_card_detect = -1, |
398 | .gpio_card_ro = -1, | |
399 | .gpio_power = -1, | |
cf75d8d2 MR |
400 | }; |
401 | ||
cf75d8d2 MR |
402 | static void __init cm_x300_init_mmc(void) |
403 | { | |
404 | pxa_set_mci_info(&cm_x300_mci_platform_data); | |
405 | pxa3xx_set_mci2_info(&cm_x300_mci2_platform_data); | |
406 | } | |
407 | #else | |
408 | static inline void cm_x300_init_mmc(void) {} | |
409 | #endif | |
410 | ||
411 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | |
cf75d8d2 MR |
412 | static struct pxaohci_platform_data cm_x300_ohci_platform_data = { |
413 | .port_mode = PMM_PERPORT_MODE, | |
097b5334 | 414 | .flags = ENABLE_PORT1 | ENABLE_PORT2 | POWER_CONTROL_LOW, |
cf75d8d2 | 415 | }; |
097b5334 | 416 | |
cf75d8d2 MR |
417 | static void __init cm_x300_init_ohci(void) |
418 | { | |
419 | pxa_set_ohci_info(&cm_x300_ohci_platform_data); | |
420 | } | |
421 | #else | |
422 | static inline void cm_x300_init_ohci(void) {} | |
423 | #endif | |
424 | ||
425 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | |
426 | static struct gpio_led cm_x300_leds[] = { | |
427 | [0] = { | |
428 | .name = "cm-x300:green", | |
429 | .default_trigger = "heartbeat", | |
cf75d8d2 MR |
430 | .active_low = 1, |
431 | }, | |
432 | }; | |
433 | ||
434 | static struct gpio_led_platform_data cm_x300_gpio_led_pdata = { | |
435 | .num_leds = ARRAY_SIZE(cm_x300_leds), | |
436 | .leds = cm_x300_leds, | |
437 | }; | |
438 | ||
439 | static struct platform_device cm_x300_led_device = { | |
440 | .name = "leds-gpio", | |
441 | .id = -1, | |
442 | .dev = { | |
443 | .platform_data = &cm_x300_gpio_led_pdata, | |
444 | }, | |
445 | }; | |
446 | ||
447 | static void __init cm_x300_init_leds(void) | |
448 | { | |
55052ea2 IG |
449 | if (system_rev < 130) |
450 | cm_x300_leds[0].gpio = 79; | |
451 | else | |
452 | cm_x300_leds[0].gpio = 76; | |
453 | ||
cf75d8d2 MR |
454 | platform_device_register(&cm_x300_led_device); |
455 | } | |
456 | #else | |
457 | static inline void cm_x300_init_leds(void) {} | |
458 | #endif | |
459 | ||
460 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | |
461 | /* PCA9555 */ | |
462 | static struct pca953x_platform_data cm_x300_gpio_ext_pdata_0 = { | |
463 | .gpio_base = 128, | |
464 | }; | |
465 | ||
466 | static struct pca953x_platform_data cm_x300_gpio_ext_pdata_1 = { | |
467 | .gpio_base = 144, | |
468 | }; | |
469 | ||
470 | static struct i2c_board_info cm_x300_gpio_ext_info[] = { | |
471 | [0] = { | |
472 | I2C_BOARD_INFO("pca9555", 0x24), | |
473 | .platform_data = &cm_x300_gpio_ext_pdata_0, | |
474 | }, | |
475 | [1] = { | |
476 | I2C_BOARD_INFO("pca9555", 0x25), | |
477 | .platform_data = &cm_x300_gpio_ext_pdata_1, | |
478 | }, | |
479 | }; | |
480 | ||
481 | static void __init cm_x300_init_i2c(void) | |
482 | { | |
483 | pxa_set_i2c_info(NULL); | |
484 | i2c_register_board_info(0, cm_x300_gpio_ext_info, | |
485 | ARRAY_SIZE(cm_x300_gpio_ext_info)); | |
486 | } | |
487 | #else | |
488 | static inline void cm_x300_init_i2c(void) {} | |
489 | #endif | |
490 | ||
1858ced3 MR |
491 | #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) |
492 | struct v3020_platform_data cm_x300_v3020_pdata = { | |
493 | .use_gpio = 1, | |
494 | .gpio_cs = GPIO95_RTC_CS, | |
495 | .gpio_wr = GPIO96_RTC_WR, | |
496 | .gpio_rd = GPIO97_RTC_RD, | |
497 | .gpio_io = GPIO98_RTC_IO, | |
498 | }; | |
499 | ||
500 | static struct platform_device cm_x300_rtc_device = { | |
501 | .name = "v3020", | |
502 | .id = -1, | |
503 | .dev = { | |
504 | .platform_data = &cm_x300_v3020_pdata, | |
505 | } | |
506 | }; | |
507 | ||
508 | static void __init cm_x300_init_rtc(void) | |
509 | { | |
510 | platform_device_register(&cm_x300_rtc_device); | |
511 | } | |
512 | #else | |
513 | static inline void cm_x300_init_rtc(void) {} | |
514 | #endif | |
515 | ||
55052ea2 | 516 | static void __init cm_x300_init_mfp(void) |
cf75d8d2 MR |
517 | { |
518 | /* board-processor specific GPIO initialization */ | |
519 | pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_mfp_cfg)); | |
520 | ||
55052ea2 IG |
521 | if (system_rev < 130) |
522 | pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_rev_lt130_mfp_cfg)); | |
523 | else | |
524 | pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_rev_ge130_mfp_cfg)); | |
525 | } | |
526 | ||
527 | static void __init cm_x300_init(void) | |
528 | { | |
529 | cm_x300_init_mfp(); | |
530 | ||
cc155c6f RK |
531 | pxa_set_ffuart_info(NULL); |
532 | pxa_set_btuart_info(NULL); | |
533 | pxa_set_stuart_info(NULL); | |
534 | ||
cf75d8d2 MR |
535 | cm_x300_init_dm9000(); |
536 | cm_x300_init_lcd(); | |
537 | cm_x300_init_ohci(); | |
538 | cm_x300_init_mmc(); | |
539 | cm_x300_init_nand(); | |
540 | cm_x300_init_leds(); | |
541 | cm_x300_init_i2c(); | |
83e560ee | 542 | cm_x300_init_spi(); |
1858ced3 | 543 | cm_x300_init_rtc(); |
74e74def | 544 | cm_x300_init_ac97(); |
cf75d8d2 MR |
545 | } |
546 | ||
b5a5c474 MR |
547 | static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, |
548 | char **cmdline, struct meminfo *mi) | |
549 | { | |
550 | mi->nr_banks = 2; | |
551 | mi->bank[0].start = 0xa0000000; | |
552 | mi->bank[0].node = 0; | |
553 | mi->bank[0].size = (64*1024*1024); | |
554 | mi->bank[1].start = 0xc0000000; | |
555 | mi->bank[1].node = 0; | |
556 | mi->bank[1].size = (64*1024*1024); | |
557 | } | |
558 | ||
cf75d8d2 MR |
559 | MACHINE_START(CM_X300, "CM-X300 module") |
560 | .phys_io = 0x40000000, | |
561 | .boot_params = 0xa0000100, | |
562 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | |
563 | .map_io = pxa_map_io, | |
564 | .init_irq = pxa3xx_init_irq, | |
565 | .timer = &pxa_timer, | |
566 | .init_machine = cm_x300_init, | |
b5a5c474 | 567 | .fixup = cm_x300_fixup, |
cf75d8d2 | 568 | MACHINE_END |