vpac270.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. /*
  2. * Hardware definitions for Voipac PXA270
  3. *
  4. * Copyright (C) 2010
  5. * Marek Vasut <marek.vasut@gmail.com>
  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. */
  12. #include <linux/platform_device.h>
  13. #include <linux/delay.h>
  14. #include <linux/irq.h>
  15. #include <linux/gpio_keys.h>
  16. #include <linux/input.h>
  17. #include <linux/gpio.h>
  18. #include <linux/usb/gpio_vbus.h>
  19. #include <linux/mtd/mtd.h>
  20. #include <linux/mtd/partitions.h>
  21. #include <linux/mtd/physmap.h>
  22. #include <linux/mtd/onenand.h>
  23. #include <linux/dm9000.h>
  24. #include <linux/ucb1400.h>
  25. #include <linux/ata_platform.h>
  26. #include <linux/regulator/max1586.h>
  27. #include <linux/i2c/pxa-i2c.h>
  28. #include <asm/mach-types.h>
  29. #include <asm/mach/arch.h>
  30. #include <mach/pxa27x.h>
  31. #include <mach/audio.h>
  32. #include <mach/vpac270.h>
  33. #include <mach/mmc.h>
  34. #include <mach/pxafb.h>
  35. #include <mach/ohci.h>
  36. #include <mach/pxa27x-udc.h>
  37. #include <mach/udc.h>
  38. #include <mach/pata_pxa.h>
  39. #include "generic.h"
  40. #include "devices.h"
  41. /******************************************************************************
  42. * Pin configuration
  43. ******************************************************************************/
  44. static unsigned long vpac270_pin_config[] __initdata = {
  45. /* MMC */
  46. GPIO32_MMC_CLK,
  47. GPIO92_MMC_DAT_0,
  48. GPIO109_MMC_DAT_1,
  49. GPIO110_MMC_DAT_2,
  50. GPIO111_MMC_DAT_3,
  51. GPIO112_MMC_CMD,
  52. GPIO53_GPIO, /* SD detect */
  53. GPIO52_GPIO, /* SD r/o switch */
  54. /* GPIO KEYS */
  55. GPIO1_GPIO, /* USER BTN */
  56. /* LEDs */
  57. GPIO15_GPIO, /* orange led */
  58. /* FFUART */
  59. GPIO34_FFUART_RXD,
  60. GPIO39_FFUART_TXD,
  61. GPIO27_FFUART_RTS,
  62. GPIO100_FFUART_CTS,
  63. GPIO33_FFUART_DSR,
  64. GPIO40_FFUART_DTR,
  65. GPIO10_FFUART_DCD,
  66. GPIO38_FFUART_RI,
  67. /* LCD */
  68. GPIO58_LCD_LDD_0,
  69. GPIO59_LCD_LDD_1,
  70. GPIO60_LCD_LDD_2,
  71. GPIO61_LCD_LDD_3,
  72. GPIO62_LCD_LDD_4,
  73. GPIO63_LCD_LDD_5,
  74. GPIO64_LCD_LDD_6,
  75. GPIO65_LCD_LDD_7,
  76. GPIO66_LCD_LDD_8,
  77. GPIO67_LCD_LDD_9,
  78. GPIO68_LCD_LDD_10,
  79. GPIO69_LCD_LDD_11,
  80. GPIO70_LCD_LDD_12,
  81. GPIO71_LCD_LDD_13,
  82. GPIO72_LCD_LDD_14,
  83. GPIO73_LCD_LDD_15,
  84. GPIO86_LCD_LDD_16,
  85. GPIO87_LCD_LDD_17,
  86. GPIO74_LCD_FCLK,
  87. GPIO75_LCD_LCLK,
  88. GPIO76_LCD_PCLK,
  89. GPIO77_LCD_BIAS,
  90. /* PCMCIA */
  91. GPIO48_nPOE,
  92. GPIO49_nPWE,
  93. GPIO50_nPIOR,
  94. GPIO51_nPIOW,
  95. GPIO85_nPCE_1,
  96. GPIO54_nPCE_2,
  97. GPIO55_nPREG,
  98. GPIO57_nIOIS16,
  99. GPIO56_nPWAIT,
  100. GPIO104_PSKTSEL,
  101. GPIO84_GPIO, /* PCMCIA CD */
  102. GPIO35_GPIO, /* PCMCIA RDY */
  103. GPIO107_GPIO, /* PCMCIA PPEN */
  104. GPIO11_GPIO, /* PCMCIA RESET */
  105. GPIO17_GPIO, /* CF CD */
  106. GPIO12_GPIO, /* CF RDY */
  107. GPIO16_GPIO, /* CF RESET */
  108. /* UHC */
  109. GPIO88_USBH1_PWR,
  110. GPIO89_USBH1_PEN,
  111. GPIO119_USBH2_PWR,
  112. GPIO120_USBH2_PEN,
  113. /* UDC */
  114. GPIO41_GPIO,
  115. /* Ethernet */
  116. GPIO114_GPIO, /* IRQ */
  117. /* AC97 */
  118. GPIO28_AC97_BITCLK,
  119. GPIO29_AC97_SDATA_IN_0,
  120. GPIO30_AC97_SDATA_OUT,
  121. GPIO31_AC97_SYNC,
  122. GPIO95_AC97_nRESET,
  123. GPIO98_AC97_SYSCLK,
  124. GPIO113_GPIO, /* TS IRQ */
  125. /* I2C */
  126. GPIO117_I2C_SCL,
  127. GPIO118_I2C_SDA,
  128. /* IDE */
  129. GPIO36_GPIO, /* IDE IRQ */
  130. GPIO80_DREQ_1,
  131. };
  132. /******************************************************************************
  133. * NOR Flash
  134. ******************************************************************************/
  135. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  136. static struct mtd_partition vpac270_nor_partitions[] = {
  137. {
  138. .name = "Flash",
  139. .offset = 0x00000000,
  140. .size = MTDPART_SIZ_FULL,
  141. }
  142. };
  143. static struct physmap_flash_data vpac270_flash_data[] = {
  144. {
  145. .width = 2, /* bankwidth in bytes */
  146. .parts = vpac270_nor_partitions,
  147. .nr_parts = ARRAY_SIZE(vpac270_nor_partitions)
  148. }
  149. };
  150. static struct resource vpac270_flash_resource = {
  151. .start = PXA_CS0_PHYS,
  152. .end = PXA_CS0_PHYS + SZ_64M - 1,
  153. .flags = IORESOURCE_MEM,
  154. };
  155. static struct platform_device vpac270_flash = {
  156. .name = "physmap-flash",
  157. .id = 0,
  158. .resource = &vpac270_flash_resource,
  159. .num_resources = 1,
  160. .dev = {
  161. .platform_data = vpac270_flash_data,
  162. },
  163. };
  164. static void __init vpac270_nor_init(void)
  165. {
  166. platform_device_register(&vpac270_flash);
  167. }
  168. #else
  169. static inline void vpac270_nor_init(void) {}
  170. #endif
  171. /******************************************************************************
  172. * OneNAND Flash
  173. ******************************************************************************/
  174. #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE)
  175. static struct mtd_partition vpac270_onenand_partitions[] = {
  176. {
  177. .name = "Flash",
  178. .offset = 0x00000000,
  179. .size = MTDPART_SIZ_FULL,
  180. }
  181. };
  182. static struct onenand_platform_data vpac270_onenand_info = {
  183. .parts = vpac270_onenand_partitions,
  184. .nr_parts = ARRAY_SIZE(vpac270_onenand_partitions),
  185. };
  186. static struct resource vpac270_onenand_resources[] = {
  187. [0] = {
  188. .start = PXA_CS0_PHYS,
  189. .end = PXA_CS0_PHYS + SZ_1M,
  190. .flags = IORESOURCE_MEM,
  191. },
  192. };
  193. static struct platform_device vpac270_onenand = {
  194. .name = "onenand-flash",
  195. .id = -1,
  196. .resource = vpac270_onenand_resources,
  197. .num_resources = ARRAY_SIZE(vpac270_onenand_resources),
  198. .dev = {
  199. .platform_data = &vpac270_onenand_info,
  200. },
  201. };
  202. static void __init vpac270_onenand_init(void)
  203. {
  204. platform_device_register(&vpac270_onenand);
  205. }
  206. #else
  207. static void __init vpac270_onenand_init(void) {}
  208. #endif
  209. /******************************************************************************
  210. * SD/MMC card controller
  211. ******************************************************************************/
  212. #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
  213. static struct pxamci_platform_data vpac270_mci_platform_data = {
  214. .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
  215. .gpio_power = -1,
  216. .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N,
  217. .gpio_card_ro = GPIO52_VPAC270_SD_READONLY,
  218. .detect_delay_ms = 200,
  219. };
  220. static void __init vpac270_mmc_init(void)
  221. {
  222. pxa_set_mci_info(&vpac270_mci_platform_data);
  223. }
  224. #else
  225. static inline void vpac270_mmc_init(void) {}
  226. #endif
  227. /******************************************************************************
  228. * GPIO keys
  229. ******************************************************************************/
  230. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  231. static struct gpio_keys_button vpac270_pxa_buttons[] = {
  232. {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"},
  233. };
  234. static struct gpio_keys_platform_data vpac270_pxa_keys_data = {
  235. .buttons = vpac270_pxa_buttons,
  236. .nbuttons = ARRAY_SIZE(vpac270_pxa_buttons),
  237. };
  238. static struct platform_device vpac270_pxa_keys = {
  239. .name = "gpio-keys",
  240. .id = -1,
  241. .dev = {
  242. .platform_data = &vpac270_pxa_keys_data,
  243. },
  244. };
  245. static void __init vpac270_keys_init(void)
  246. {
  247. platform_device_register(&vpac270_pxa_keys);
  248. }
  249. #else
  250. static inline void vpac270_keys_init(void) {}
  251. #endif
  252. /******************************************************************************
  253. * LED
  254. ******************************************************************************/
  255. #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
  256. struct gpio_led vpac270_gpio_leds[] = {
  257. {
  258. .name = "vpac270:orange:user",
  259. .default_trigger = "none",
  260. .gpio = GPIO15_VPAC270_LED_ORANGE,
  261. .active_low = 1,
  262. }
  263. };
  264. static struct gpio_led_platform_data vpac270_gpio_led_info = {
  265. .leds = vpac270_gpio_leds,
  266. .num_leds = ARRAY_SIZE(vpac270_gpio_leds),
  267. };
  268. static struct platform_device vpac270_leds = {
  269. .name = "leds-gpio",
  270. .id = -1,
  271. .dev = {
  272. .platform_data = &vpac270_gpio_led_info,
  273. }
  274. };
  275. static void __init vpac270_leds_init(void)
  276. {
  277. platform_device_register(&vpac270_leds);
  278. }
  279. #else
  280. static inline void vpac270_leds_init(void) {}
  281. #endif
  282. /******************************************************************************
  283. * USB Host
  284. ******************************************************************************/
  285. #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
  286. static int vpac270_ohci_init(struct device *dev)
  287. {
  288. UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
  289. return 0;
  290. }
  291. static struct pxaohci_platform_data vpac270_ohci_info = {
  292. .port_mode = PMM_PERPORT_MODE,
  293. .flags = ENABLE_PORT1 | ENABLE_PORT2 |
  294. POWER_CONTROL_LOW | POWER_SENSE_LOW,
  295. .init = vpac270_ohci_init,
  296. };
  297. static void __init vpac270_uhc_init(void)
  298. {
  299. pxa_set_ohci_info(&vpac270_ohci_info);
  300. }
  301. #else
  302. static inline void vpac270_uhc_init(void) {}
  303. #endif
  304. /******************************************************************************
  305. * USB Gadget
  306. ******************************************************************************/
  307. #if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
  308. static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
  309. .gpio_vbus = GPIO41_VPAC270_UDC_DETECT,
  310. .gpio_pullup = -1,
  311. };
  312. static struct platform_device vpac270_gpio_vbus = {
  313. .name = "gpio-vbus",
  314. .id = -1,
  315. .dev = {
  316. .platform_data = &vpac270_gpio_vbus_info,
  317. },
  318. };
  319. static void vpac270_udc_command(int cmd)
  320. {
  321. if (cmd == PXA2XX_UDC_CMD_CONNECT)
  322. UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE;
  323. else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
  324. UP2OCR = UP2OCR_HXOE;
  325. }
  326. static struct pxa2xx_udc_mach_info vpac270_udc_info __initdata = {
  327. .udc_command = vpac270_udc_command,
  328. .gpio_pullup = -1,
  329. };
  330. static void __init vpac270_udc_init(void)
  331. {
  332. pxa_set_udc_info(&vpac270_udc_info);
  333. platform_device_register(&vpac270_gpio_vbus);
  334. }
  335. #else
  336. static inline void vpac270_udc_init(void) {}
  337. #endif
  338. /******************************************************************************
  339. * Ethernet
  340. ******************************************************************************/
  341. #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
  342. static struct resource vpac270_dm9000_resources[] = {
  343. [0] = {
  344. .start = PXA_CS2_PHYS + 0x300,
  345. .end = PXA_CS2_PHYS + 0x303,
  346. .flags = IORESOURCE_MEM,
  347. },
  348. [1] = {
  349. .start = PXA_CS2_PHYS + 0x304,
  350. .end = PXA_CS2_PHYS + 0x343,
  351. .flags = IORESOURCE_MEM,
  352. },
  353. [2] = {
  354. .start = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
  355. .end = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
  356. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  357. },
  358. };
  359. static struct dm9000_plat_data vpac270_dm9000_platdata = {
  360. .flags = DM9000_PLATF_32BITONLY,
  361. };
  362. static struct platform_device vpac270_dm9000_device = {
  363. .name = "dm9000",
  364. .id = -1,
  365. .num_resources = ARRAY_SIZE(vpac270_dm9000_resources),
  366. .resource = vpac270_dm9000_resources,
  367. .dev = {
  368. .platform_data = &vpac270_dm9000_platdata,
  369. }
  370. };
  371. static void __init vpac270_eth_init(void)
  372. {
  373. platform_device_register(&vpac270_dm9000_device);
  374. }
  375. #else
  376. static inline void vpac270_eth_init(void) {}
  377. #endif
  378. /******************************************************************************
  379. * Audio and Touchscreen
  380. ******************************************************************************/
  381. #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \
  382. defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
  383. static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
  384. .reset_gpio = 95,
  385. };
  386. static struct ucb1400_pdata vpac270_ucb1400_pdata = {
  387. .irq = PXA_GPIO_TO_IRQ(GPIO113_VPAC270_TS_IRQ),
  388. };
  389. static struct platform_device vpac270_ucb1400_device = {
  390. .name = "ucb1400_core",
  391. .id = -1,
  392. .dev = {
  393. .platform_data = &vpac270_ucb1400_pdata,
  394. },
  395. };
  396. static void __init vpac270_ts_init(void)
  397. {
  398. pxa_set_ac97_info(&vpac270_ac97_pdata);
  399. platform_device_register(&vpac270_ucb1400_device);
  400. }
  401. #else
  402. static inline void vpac270_ts_init(void) {}
  403. #endif
  404. /******************************************************************************
  405. * RTC
  406. ******************************************************************************/
  407. #if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
  408. static struct i2c_board_info __initdata vpac270_i2c_devs[] = {
  409. {
  410. I2C_BOARD_INFO("ds1339", 0x68),
  411. },
  412. };
  413. static void __init vpac270_rtc_init(void)
  414. {
  415. i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs));
  416. }
  417. #else
  418. static inline void vpac270_rtc_init(void) {}
  419. #endif
  420. /******************************************************************************
  421. * Framebuffer
  422. ******************************************************************************/
  423. #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
  424. static struct pxafb_mode_info vpac270_lcd_modes[] = {
  425. {
  426. .pixclock = 57692,
  427. .xres = 640,
  428. .yres = 480,
  429. .bpp = 32,
  430. .depth = 18,
  431. .left_margin = 144,
  432. .right_margin = 32,
  433. .upper_margin = 13,
  434. .lower_margin = 30,
  435. .hsync_len = 32,
  436. .vsync_len = 2,
  437. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  438. }, { /* CRT 640x480 */
  439. .pixclock = 35000,
  440. .xres = 640,
  441. .yres = 480,
  442. .bpp = 16,
  443. .depth = 16,
  444. .left_margin = 96,
  445. .right_margin = 48,
  446. .upper_margin = 33,
  447. .lower_margin = 10,
  448. .hsync_len = 48,
  449. .vsync_len = 1,
  450. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  451. }, { /* CRT 800x600 H=30kHz V=48HZ */
  452. .pixclock = 25000,
  453. .xres = 800,
  454. .yres = 600,
  455. .bpp = 16,
  456. .depth = 16,
  457. .left_margin = 50,
  458. .right_margin = 1,
  459. .upper_margin = 21,
  460. .lower_margin = 12,
  461. .hsync_len = 8,
  462. .vsync_len = 1,
  463. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  464. }, { /* CRT 1024x768 H=40kHz V=50Hz */
  465. .pixclock = 15000,
  466. .xres = 1024,
  467. .yres = 768,
  468. .bpp = 16,
  469. .depth = 16,
  470. .left_margin = 220,
  471. .right_margin = 8,
  472. .upper_margin = 33,
  473. .lower_margin = 2,
  474. .hsync_len = 48,
  475. .vsync_len = 1,
  476. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  477. }
  478. };
  479. static struct pxafb_mach_info vpac270_lcd_screen = {
  480. .modes = vpac270_lcd_modes,
  481. .num_modes = ARRAY_SIZE(vpac270_lcd_modes),
  482. .lcd_conn = LCD_COLOR_TFT_18BPP,
  483. };
  484. static void vpac270_lcd_power(int on, struct fb_var_screeninfo *info)
  485. {
  486. gpio_set_value(GPIO81_VPAC270_BKL_ON, on);
  487. }
  488. static void __init vpac270_lcd_init(void)
  489. {
  490. int ret;
  491. ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON");
  492. if (ret) {
  493. pr_err("Requesting BKL-ON GPIO failed!\n");
  494. goto err;
  495. }
  496. ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1);
  497. if (ret) {
  498. pr_err("Setting BKL-ON GPIO direction failed!\n");
  499. goto err2;
  500. }
  501. vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power;
  502. pxa_set_fb_info(NULL, &vpac270_lcd_screen);
  503. return;
  504. err2:
  505. gpio_free(GPIO81_VPAC270_BKL_ON);
  506. err:
  507. return;
  508. }
  509. #else
  510. static inline void vpac270_lcd_init(void) {}
  511. #endif
  512. /******************************************************************************
  513. * PATA IDE
  514. ******************************************************************************/
  515. #if defined(CONFIG_PATA_PXA) || defined(CONFIG_PATA_PXA_MODULE)
  516. static struct pata_pxa_pdata vpac270_pata_pdata = {
  517. .reg_shift = 1,
  518. .dma_dreq = 1,
  519. .irq_flags = IRQF_TRIGGER_RISING,
  520. };
  521. static struct resource vpac270_ide_resources[] = {
  522. [0] = { /* I/O Base address */
  523. .start = PXA_CS3_PHYS + 0x120,
  524. .end = PXA_CS3_PHYS + 0x13f,
  525. .flags = IORESOURCE_MEM
  526. },
  527. [1] = { /* CTL Base address */
  528. .start = PXA_CS3_PHYS + 0x15c,
  529. .end = PXA_CS3_PHYS + 0x15f,
  530. .flags = IORESOURCE_MEM
  531. },
  532. [2] = { /* DMA Base address */
  533. .start = PXA_CS3_PHYS + 0x20,
  534. .end = PXA_CS3_PHYS + 0x2f,
  535. .flags = IORESOURCE_DMA
  536. },
  537. [3] = { /* IDE IRQ pin */
  538. .start = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
  539. .end = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
  540. .flags = IORESOURCE_IRQ
  541. }
  542. };
  543. static struct platform_device vpac270_ide_device = {
  544. .name = "pata_pxa",
  545. .num_resources = ARRAY_SIZE(vpac270_ide_resources),
  546. .resource = vpac270_ide_resources,
  547. .dev = {
  548. .platform_data = &vpac270_pata_pdata,
  549. .coherent_dma_mask = 0xffffffff,
  550. }
  551. };
  552. static void __init vpac270_ide_init(void)
  553. {
  554. platform_device_register(&vpac270_ide_device);
  555. }
  556. #else
  557. static inline void vpac270_ide_init(void) {}
  558. #endif
  559. /******************************************************************************
  560. * Core power regulator
  561. ******************************************************************************/
  562. #if defined(CONFIG_REGULATOR_MAX1586) || \
  563. defined(CONFIG_REGULATOR_MAX1586_MODULE)
  564. static struct regulator_consumer_supply vpac270_max1587a_consumers[] = {
  565. {
  566. .supply = "vcc_core",
  567. }
  568. };
  569. static struct regulator_init_data vpac270_max1587a_v3_info = {
  570. .constraints = {
  571. .name = "vcc_core range",
  572. .min_uV = 900000,
  573. .max_uV = 1705000,
  574. .always_on = 1,
  575. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  576. },
  577. .consumer_supplies = vpac270_max1587a_consumers,
  578. .num_consumer_supplies = ARRAY_SIZE(vpac270_max1587a_consumers),
  579. };
  580. static struct max1586_subdev_data vpac270_max1587a_subdevs[] = {
  581. {
  582. .name = "vcc_core",
  583. .id = MAX1586_V3,
  584. .platform_data = &vpac270_max1587a_v3_info,
  585. }
  586. };
  587. static struct max1586_platform_data vpac270_max1587a_info = {
  588. .subdevs = vpac270_max1587a_subdevs,
  589. .num_subdevs = ARRAY_SIZE(vpac270_max1587a_subdevs),
  590. .v3_gain = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
  591. };
  592. static struct i2c_board_info __initdata vpac270_pi2c_board_info[] = {
  593. {
  594. I2C_BOARD_INFO("max1586", 0x14),
  595. .platform_data = &vpac270_max1587a_info,
  596. },
  597. };
  598. static void __init vpac270_pmic_init(void)
  599. {
  600. i2c_register_board_info(1, ARRAY_AND_SIZE(vpac270_pi2c_board_info));
  601. }
  602. #else
  603. static inline void vpac270_pmic_init(void) {}
  604. #endif
  605. /******************************************************************************
  606. * Machine init
  607. ******************************************************************************/
  608. static void __init vpac270_init(void)
  609. {
  610. pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config));
  611. pxa_set_ffuart_info(NULL);
  612. pxa_set_btuart_info(NULL);
  613. pxa_set_stuart_info(NULL);
  614. pxa_set_i2c_info(NULL);
  615. pxa27x_set_i2c_power_info(NULL);
  616. vpac270_pmic_init();
  617. vpac270_lcd_init();
  618. vpac270_mmc_init();
  619. vpac270_nor_init();
  620. vpac270_onenand_init();
  621. vpac270_leds_init();
  622. vpac270_keys_init();
  623. vpac270_uhc_init();
  624. vpac270_udc_init();
  625. vpac270_eth_init();
  626. vpac270_ts_init();
  627. vpac270_rtc_init();
  628. vpac270_ide_init();
  629. }
  630. MACHINE_START(VPAC270, "Voipac PXA270")
  631. .atag_offset = 0x100,
  632. .map_io = pxa27x_map_io,
  633. .nr_irqs = PXA_NR_IRQS,
  634. .init_irq = pxa27x_init_irq,
  635. .handle_irq = pxa27x_handle_irq,
  636. .timer = &pxa_timer,
  637. .init_machine = vpac270_init,
  638. .restart = pxa_restart,
  639. MACHINE_END