cm-x300.c 14 KB

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