vpac270.c 18 KB

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