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