vpac270.c 18 KB

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