blob: 26a5ebc0006987c26923a81311f716ef63281dc6 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Marek543cd842010-03-09 04:04:12 +01002/*
3 * Hardware definitions for Voipac PXA270
4 *
5 * Copyright (C) 2010
6 * Marek Vasut <marek.vasut@gmail.com>
Marek543cd842010-03-09 04:04:12 +01007 */
8
9#include <linux/platform_device.h>
10#include <linux/delay.h>
11#include <linux/irq.h>
12#include <linux/gpio_keys.h>
13#include <linux/input.h>
Ulf Hansson40d727a2017-01-13 14:14:02 +010014#include <linux/leds.h>
Marek543cd842010-03-09 04:04:12 +010015#include <linux/gpio.h>
Linus Walleij32d15442018-12-02 09:43:22 +010016#include <linux/gpio/machine.h>
Marek Vasut3d98f882010-03-10 05:24:27 +010017#include <linux/usb/gpio_vbus.h>
Marek543cd842010-03-09 04:04:12 +010018#include <linux/mtd/mtd.h>
19#include <linux/mtd/partitions.h>
20#include <linux/mtd/physmap.h>
Marek Vasutbcc399b2010-05-01 06:54:36 +020021#include <linux/mtd/onenand.h>
Marek Vasut947fb572010-03-10 05:38:54 +010022#include <linux/dm9000.h>
Marek Vasut1a8fb702010-03-26 04:45:54 +010023#include <linux/ucb1400.h>
Marek Vasut052345a2010-04-26 21:46:07 +020024#include <linux/ata_platform.h>
Robert Jarzmika927ef82015-07-11 21:33:06 +020025#include <linux/regulator/machine.h>
Marek Vasut54e70bf2010-05-21 03:12:43 +020026#include <linux/regulator/max1586.h>
Wolfram Sangf15fc9b2017-11-13 18:27:39 +010027#include <linux/platform_data/i2c-pxa.h>
Marek543cd842010-03-09 04:04:12 +010028
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31
Arnd Bergmann4c25c5d2015-01-30 10:45:33 +010032#include "pxa27x.h"
Marek Vasut1a8fb702010-03-26 04:45:54 +010033#include <mach/audio.h>
Marek543cd842010-03-09 04:04:12 +010034#include <mach/vpac270.h>
Arnd Bergmann293b2da2012-08-24 15:16:48 +020035#include <linux/platform_data/mmc-pxamci.h>
36#include <linux/platform_data/video-pxafb.h>
37#include <linux/platform_data/usb-ohci-pxa27x.h>
Arnd Bergmann4c25c5d2015-01-30 10:45:33 +010038#include "pxa27x-udc.h"
39#include "udc.h"
Arnd Bergmann293b2da2012-08-24 15:16:48 +020040#include <linux/platform_data/ata-pxa.h>
Marek543cd842010-03-09 04:04:12 +010041
42#include "generic.h"
43#include "devices.h"
44
45/******************************************************************************
46 * Pin configuration
47 ******************************************************************************/
48static unsigned long vpac270_pin_config[] __initdata = {
49 /* MMC */
50 GPIO32_MMC_CLK,
51 GPIO92_MMC_DAT_0,
52 GPIO109_MMC_DAT_1,
53 GPIO110_MMC_DAT_2,
54 GPIO111_MMC_DAT_3,
55 GPIO112_MMC_CMD,
56 GPIO53_GPIO, /* SD detect */
57 GPIO52_GPIO, /* SD r/o switch */
58
59 /* GPIO KEYS */
60 GPIO1_GPIO, /* USER BTN */
61
62 /* LEDs */
63 GPIO15_GPIO, /* orange led */
64
65 /* FFUART */
66 GPIO34_FFUART_RXD,
67 GPIO39_FFUART_TXD,
68 GPIO27_FFUART_RTS,
69 GPIO100_FFUART_CTS,
70 GPIO33_FFUART_DSR,
71 GPIO40_FFUART_DTR,
72 GPIO10_FFUART_DCD,
73 GPIO38_FFUART_RI,
74
75 /* LCD */
76 GPIO58_LCD_LDD_0,
77 GPIO59_LCD_LDD_1,
78 GPIO60_LCD_LDD_2,
79 GPIO61_LCD_LDD_3,
80 GPIO62_LCD_LDD_4,
81 GPIO63_LCD_LDD_5,
82 GPIO64_LCD_LDD_6,
83 GPIO65_LCD_LDD_7,
84 GPIO66_LCD_LDD_8,
85 GPIO67_LCD_LDD_9,
86 GPIO68_LCD_LDD_10,
87 GPIO69_LCD_LDD_11,
88 GPIO70_LCD_LDD_12,
89 GPIO71_LCD_LDD_13,
90 GPIO72_LCD_LDD_14,
91 GPIO73_LCD_LDD_15,
92 GPIO86_LCD_LDD_16,
93 GPIO87_LCD_LDD_17,
94 GPIO74_LCD_FCLK,
95 GPIO75_LCD_LCLK,
96 GPIO76_LCD_PCLK,
97 GPIO77_LCD_BIAS,
Marek Vasutaddff0f2010-03-10 04:16:28 +010098
99 /* PCMCIA */
100 GPIO48_nPOE,
101 GPIO49_nPWE,
102 GPIO50_nPIOR,
103 GPIO51_nPIOW,
104 GPIO85_nPCE_1,
105 GPIO54_nPCE_2,
106 GPIO55_nPREG,
107 GPIO57_nIOIS16,
108 GPIO56_nPWAIT,
109 GPIO104_PSKTSEL,
110 GPIO84_GPIO, /* PCMCIA CD */
111 GPIO35_GPIO, /* PCMCIA RDY */
112 GPIO107_GPIO, /* PCMCIA PPEN */
113 GPIO11_GPIO, /* PCMCIA RESET */
114 GPIO17_GPIO, /* CF CD */
115 GPIO12_GPIO, /* CF RDY */
116 GPIO16_GPIO, /* CF RESET */
117
Marek Vasut3d98f882010-03-10 05:24:27 +0100118 /* UHC */
119 GPIO88_USBH1_PWR,
120 GPIO89_USBH1_PEN,
121 GPIO119_USBH2_PWR,
122 GPIO120_USBH2_PEN,
123
124 /* UDC */
125 GPIO41_GPIO,
Marek Vasut947fb572010-03-10 05:38:54 +0100126
127 /* Ethernet */
128 GPIO114_GPIO, /* IRQ */
Marek Vasut1a8fb702010-03-26 04:45:54 +0100129
130 /* AC97 */
131 GPIO28_AC97_BITCLK,
132 GPIO29_AC97_SDATA_IN_0,
133 GPIO30_AC97_SDATA_OUT,
134 GPIO31_AC97_SYNC,
135 GPIO95_AC97_nRESET,
136 GPIO98_AC97_SYSCLK,
137 GPIO113_GPIO, /* TS IRQ */
Marek Vasut83a4a102010-03-26 05:38:10 +0100138
139 /* I2C */
140 GPIO117_I2C_SCL,
141 GPIO118_I2C_SDA,
Marek Vasut052345a2010-04-26 21:46:07 +0200142
143 /* IDE */
144 GPIO36_GPIO, /* IDE IRQ */
145 GPIO80_DREQ_1,
Marek543cd842010-03-09 04:04:12 +0100146};
147
148/******************************************************************************
149 * NOR Flash
150 ******************************************************************************/
151#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Marek Vasutbcc399b2010-05-01 06:54:36 +0200152static struct mtd_partition vpac270_nor_partitions[] = {
Marek543cd842010-03-09 04:04:12 +0100153 {
154 .name = "Flash",
155 .offset = 0x00000000,
156 .size = MTDPART_SIZ_FULL,
157 }
158};
159
160static struct physmap_flash_data vpac270_flash_data[] = {
161 {
162 .width = 2, /* bankwidth in bytes */
Marek Vasutbcc399b2010-05-01 06:54:36 +0200163 .parts = vpac270_nor_partitions,
164 .nr_parts = ARRAY_SIZE(vpac270_nor_partitions)
Marek543cd842010-03-09 04:04:12 +0100165 }
166};
167
168static struct resource vpac270_flash_resource = {
169 .start = PXA_CS0_PHYS,
170 .end = PXA_CS0_PHYS + SZ_64M - 1,
171 .flags = IORESOURCE_MEM,
172};
173
174static struct platform_device vpac270_flash = {
175 .name = "physmap-flash",
176 .id = 0,
177 .resource = &vpac270_flash_resource,
178 .num_resources = 1,
179 .dev = {
180 .platform_data = vpac270_flash_data,
181 },
182};
183static void __init vpac270_nor_init(void)
184{
185 platform_device_register(&vpac270_flash);
186}
187#else
188static inline void vpac270_nor_init(void) {}
189#endif
190
191/******************************************************************************
Marek Vasutbcc399b2010-05-01 06:54:36 +0200192 * OneNAND Flash
193 ******************************************************************************/
194#if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE)
195static struct mtd_partition vpac270_onenand_partitions[] = {
196 {
197 .name = "Flash",
198 .offset = 0x00000000,
199 .size = MTDPART_SIZ_FULL,
200 }
201};
202
203static struct onenand_platform_data vpac270_onenand_info = {
204 .parts = vpac270_onenand_partitions,
205 .nr_parts = ARRAY_SIZE(vpac270_onenand_partitions),
206};
207
208static struct resource vpac270_onenand_resources[] = {
209 [0] = {
210 .start = PXA_CS0_PHYS,
211 .end = PXA_CS0_PHYS + SZ_1M,
212 .flags = IORESOURCE_MEM,
213 },
214};
215
216static struct platform_device vpac270_onenand = {
217 .name = "onenand-flash",
218 .id = -1,
219 .resource = vpac270_onenand_resources,
220 .num_resources = ARRAY_SIZE(vpac270_onenand_resources),
221 .dev = {
222 .platform_data = &vpac270_onenand_info,
223 },
224};
225
226static void __init vpac270_onenand_init(void)
227{
228 platform_device_register(&vpac270_onenand);
229}
230#else
231static void __init vpac270_onenand_init(void) {}
232#endif
233
234/******************************************************************************
Marek543cd842010-03-09 04:04:12 +0100235 * SD/MMC card controller
236 ******************************************************************************/
237#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
238static struct pxamci_platform_data vpac270_mci_platform_data = {
239 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
Eric Miaof97cab22010-04-14 07:00:42 +0800240 .detect_delay_ms = 200,
Marek543cd842010-03-09 04:04:12 +0100241};
242
Linus Walleij32d15442018-12-02 09:43:22 +0100243static struct gpiod_lookup_table vpac270_mci_gpio_table = {
244 .dev_id = "pxa2xx-mci.0",
245 .table = {
246 GPIO_LOOKUP("gpio-pxa", GPIO53_VPAC270_SD_DETECT_N,
247 "cd", GPIO_ACTIVE_LOW),
248 GPIO_LOOKUP("gpio-pxa", GPIO52_VPAC270_SD_READONLY,
249 "wp", GPIO_ACTIVE_LOW),
250 { },
251 },
252};
253
Marek543cd842010-03-09 04:04:12 +0100254static void __init vpac270_mmc_init(void)
255{
Linus Walleij32d15442018-12-02 09:43:22 +0100256 gpiod_add_lookup_table(&vpac270_mci_gpio_table);
Marek543cd842010-03-09 04:04:12 +0100257 pxa_set_mci_info(&vpac270_mci_platform_data);
258}
259#else
260static inline void vpac270_mmc_init(void) {}
261#endif
262
263/******************************************************************************
264 * GPIO keys
265 ******************************************************************************/
266#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
267static struct gpio_keys_button vpac270_pxa_buttons[] = {
268 {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"},
269};
270
271static struct gpio_keys_platform_data vpac270_pxa_keys_data = {
272 .buttons = vpac270_pxa_buttons,
273 .nbuttons = ARRAY_SIZE(vpac270_pxa_buttons),
274};
275
276static struct platform_device vpac270_pxa_keys = {
277 .name = "gpio-keys",
278 .id = -1,
279 .dev = {
280 .platform_data = &vpac270_pxa_keys_data,
281 },
282};
283
284static void __init vpac270_keys_init(void)
285{
286 platform_device_register(&vpac270_pxa_keys);
287}
288#else
289static inline void vpac270_keys_init(void) {}
290#endif
291
292/******************************************************************************
293 * LED
294 ******************************************************************************/
295#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
296struct gpio_led vpac270_gpio_leds[] = {
297{
298 .name = "vpac270:orange:user",
299 .default_trigger = "none",
300 .gpio = GPIO15_VPAC270_LED_ORANGE,
301 .active_low = 1,
302}
303};
304
305static struct gpio_led_platform_data vpac270_gpio_led_info = {
306 .leds = vpac270_gpio_leds,
307 .num_leds = ARRAY_SIZE(vpac270_gpio_leds),
308};
309
310static struct platform_device vpac270_leds = {
311 .name = "leds-gpio",
312 .id = -1,
313 .dev = {
314 .platform_data = &vpac270_gpio_led_info,
315 }
316};
317
318static void __init vpac270_leds_init(void)
319{
320 platform_device_register(&vpac270_leds);
321}
322#else
323static inline void vpac270_leds_init(void) {}
324#endif
325
326/******************************************************************************
Marek Vasut3d98f882010-03-10 05:24:27 +0100327 * USB Host
328 ******************************************************************************/
329#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
330static int vpac270_ohci_init(struct device *dev)
331{
332 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
333 return 0;
334}
335
336static struct pxaohci_platform_data vpac270_ohci_info = {
337 .port_mode = PMM_PERPORT_MODE,
338 .flags = ENABLE_PORT1 | ENABLE_PORT2 |
339 POWER_CONTROL_LOW | POWER_SENSE_LOW,
340 .init = vpac270_ohci_init,
341};
342
343static void __init vpac270_uhc_init(void)
344{
345 pxa_set_ohci_info(&vpac270_ohci_info);
346}
347#else
348static inline void vpac270_uhc_init(void) {}
349#endif
350
351/******************************************************************************
352 * USB Gadget
353 ******************************************************************************/
Haojian Zhuangc0a39152011-11-10 07:13:07 +0800354#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
Marek Vasut3d98f882010-03-10 05:24:27 +0100355static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
356 .gpio_vbus = GPIO41_VPAC270_UDC_DETECT,
357 .gpio_pullup = -1,
358};
359
360static struct platform_device vpac270_gpio_vbus = {
361 .name = "gpio-vbus",
362 .id = -1,
363 .dev = {
364 .platform_data = &vpac270_gpio_vbus_info,
365 },
366};
367
368static void vpac270_udc_command(int cmd)
369{
370 if (cmd == PXA2XX_UDC_CMD_CONNECT)
Marek Vasutfb25cb32010-05-02 06:10:25 +0200371 UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE;
Marek Vasut3d98f882010-03-10 05:24:27 +0100372 else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
Marek Vasutfb25cb32010-05-02 06:10:25 +0200373 UP2OCR = UP2OCR_HXOE;
Marek Vasut3d98f882010-03-10 05:24:27 +0100374}
375
376static struct pxa2xx_udc_mach_info vpac270_udc_info __initdata = {
377 .udc_command = vpac270_udc_command,
378 .gpio_pullup = -1,
379};
380
381static void __init vpac270_udc_init(void)
382{
383 pxa_set_udc_info(&vpac270_udc_info);
384 platform_device_register(&vpac270_gpio_vbus);
385}
386#else
387static inline void vpac270_udc_init(void) {}
388#endif
389
390/******************************************************************************
Marek Vasut947fb572010-03-10 05:38:54 +0100391 * Ethernet
392 ******************************************************************************/
393#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
394static struct resource vpac270_dm9000_resources[] = {
395 [0] = {
396 .start = PXA_CS2_PHYS + 0x300,
397 .end = PXA_CS2_PHYS + 0x303,
398 .flags = IORESOURCE_MEM,
399 },
400 [1] = {
401 .start = PXA_CS2_PHYS + 0x304,
402 .end = PXA_CS2_PHYS + 0x343,
403 .flags = IORESOURCE_MEM,
404 },
405 [2] = {
Haojian Zhuang6384fda2011-10-10 14:21:08 +0800406 .start = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
407 .end = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
Marek Vasut947fb572010-03-10 05:38:54 +0100408 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
409 },
410};
411
412static struct dm9000_plat_data vpac270_dm9000_platdata = {
413 .flags = DM9000_PLATF_32BITONLY,
414};
415
416static struct platform_device vpac270_dm9000_device = {
417 .name = "dm9000",
418 .id = -1,
419 .num_resources = ARRAY_SIZE(vpac270_dm9000_resources),
420 .resource = vpac270_dm9000_resources,
421 .dev = {
422 .platform_data = &vpac270_dm9000_platdata,
423 }
424};
425
426static void __init vpac270_eth_init(void)
427{
428 platform_device_register(&vpac270_dm9000_device);
429}
430#else
431static inline void vpac270_eth_init(void) {}
432#endif
433
434/******************************************************************************
Marek Vasut1a8fb702010-03-26 04:45:54 +0100435 * Audio and Touchscreen
436 ******************************************************************************/
437#if defined(CONFIG_TOUCHSCREEN_UCB1400) || \
438 defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
439static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
440 .reset_gpio = 95,
441};
442
443static struct ucb1400_pdata vpac270_ucb1400_pdata = {
Haojian Zhuang6384fda2011-10-10 14:21:08 +0800444 .irq = PXA_GPIO_TO_IRQ(GPIO113_VPAC270_TS_IRQ),
Marek Vasut1a8fb702010-03-26 04:45:54 +0100445};
446
447static struct platform_device vpac270_ucb1400_device = {
448 .name = "ucb1400_core",
449 .id = -1,
450 .dev = {
451 .platform_data = &vpac270_ucb1400_pdata,
452 },
453};
454
455static void __init vpac270_ts_init(void)
456{
457 pxa_set_ac97_info(&vpac270_ac97_pdata);
458 platform_device_register(&vpac270_ucb1400_device);
459}
460#else
461static inline void vpac270_ts_init(void) {}
462#endif
463
464/******************************************************************************
Marek Vasut83a4a102010-03-26 05:38:10 +0100465 * RTC
466 ******************************************************************************/
467#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
468static struct i2c_board_info __initdata vpac270_i2c_devs[] = {
469 {
470 I2C_BOARD_INFO("ds1339", 0x68),
471 },
472};
473
474static void __init vpac270_rtc_init(void)
475{
Marek Vasut83a4a102010-03-26 05:38:10 +0100476 i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs));
477}
478#else
479static inline void vpac270_rtc_init(void) {}
480#endif
481
482/******************************************************************************
Marek543cd842010-03-09 04:04:12 +0100483 * Framebuffer
484 ******************************************************************************/
485#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
486static struct pxafb_mode_info vpac270_lcd_modes[] = {
487{
488 .pixclock = 57692,
489 .xres = 640,
490 .yres = 480,
491 .bpp = 32,
492 .depth = 18,
493
494 .left_margin = 144,
495 .right_margin = 32,
496 .upper_margin = 13,
497 .lower_margin = 30,
498
499 .hsync_len = 32,
500 .vsync_len = 2,
501
502 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
Marek Vasut97dbc512010-05-21 03:12:46 +0200503}, { /* CRT 640x480 */
504 .pixclock = 35000,
505 .xres = 640,
506 .yres = 480,
507 .bpp = 16,
508 .depth = 16,
509
510 .left_margin = 96,
511 .right_margin = 48,
512 .upper_margin = 33,
513 .lower_margin = 10,
514
515 .hsync_len = 48,
516 .vsync_len = 1,
517
518 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
519}, { /* CRT 800x600 H=30kHz V=48HZ */
520 .pixclock = 25000,
521 .xres = 800,
522 .yres = 600,
523 .bpp = 16,
524 .depth = 16,
525
526 .left_margin = 50,
527 .right_margin = 1,
528 .upper_margin = 21,
529 .lower_margin = 12,
530
531 .hsync_len = 8,
532 .vsync_len = 1,
533
534 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
535}, { /* CRT 1024x768 H=40kHz V=50Hz */
536 .pixclock = 15000,
537 .xres = 1024,
538 .yres = 768,
539 .bpp = 16,
540 .depth = 16,
541
542 .left_margin = 220,
543 .right_margin = 8,
544 .upper_margin = 33,
545 .lower_margin = 2,
546
547 .hsync_len = 48,
548 .vsync_len = 1,
549
550 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
551}
Marek543cd842010-03-09 04:04:12 +0100552};
553
554static struct pxafb_mach_info vpac270_lcd_screen = {
555 .modes = vpac270_lcd_modes,
556 .num_modes = ARRAY_SIZE(vpac270_lcd_modes),
557 .lcd_conn = LCD_COLOR_TFT_18BPP,
558};
559
560static void vpac270_lcd_power(int on, struct fb_var_screeninfo *info)
561{
562 gpio_set_value(GPIO81_VPAC270_BKL_ON, on);
563}
564
565static void __init vpac270_lcd_init(void)
566{
567 int ret;
568
569 ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON");
570 if (ret) {
571 pr_err("Requesting BKL-ON GPIO failed!\n");
572 goto err;
573 }
574
575 ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1);
576 if (ret) {
577 pr_err("Setting BKL-ON GPIO direction failed!\n");
578 goto err2;
579 }
580
581 vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power;
Russell King - ARM Linux4321e1a2011-02-15 15:37:30 +0800582 pxa_set_fb_info(NULL, &vpac270_lcd_screen);
Marek543cd842010-03-09 04:04:12 +0100583 return;
584
585err2:
586 gpio_free(GPIO81_VPAC270_BKL_ON);
587err:
588 return;
589}
590#else
591static inline void vpac270_lcd_init(void) {}
592#endif
593
594/******************************************************************************
Marek Vasut052345a2010-04-26 21:46:07 +0200595 * PATA IDE
596 ******************************************************************************/
Marek Vasut9b2dbdc2010-05-21 03:12:45 +0200597#if defined(CONFIG_PATA_PXA) || defined(CONFIG_PATA_PXA_MODULE)
598static struct pata_pxa_pdata vpac270_pata_pdata = {
599 .reg_shift = 1,
600 .dma_dreq = 1,
Marek Vasut052345a2010-04-26 21:46:07 +0200601 .irq_flags = IRQF_TRIGGER_RISING,
602};
603
604static struct resource vpac270_ide_resources[] = {
605 [0] = { /* I/O Base address */
606 .start = PXA_CS3_PHYS + 0x120,
607 .end = PXA_CS3_PHYS + 0x13f,
608 .flags = IORESOURCE_MEM
609 },
610 [1] = { /* CTL Base address */
611 .start = PXA_CS3_PHYS + 0x15c,
612 .end = PXA_CS3_PHYS + 0x15f,
613 .flags = IORESOURCE_MEM
614 },
Marek Vasut9b2dbdc2010-05-21 03:12:45 +0200615 [2] = { /* DMA Base address */
616 .start = PXA_CS3_PHYS + 0x20,
617 .end = PXA_CS3_PHYS + 0x2f,
618 .flags = IORESOURCE_DMA
619 },
620 [3] = { /* IDE IRQ pin */
Haojian Zhuang4929f5a2011-10-10 16:03:51 +0800621 .start = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
622 .end = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
Marek Vasut052345a2010-04-26 21:46:07 +0200623 .flags = IORESOURCE_IRQ
624 }
625};
626
627static struct platform_device vpac270_ide_device = {
Marek Vasut9b2dbdc2010-05-21 03:12:45 +0200628 .name = "pata_pxa",
Marek Vasut052345a2010-04-26 21:46:07 +0200629 .num_resources = ARRAY_SIZE(vpac270_ide_resources),
630 .resource = vpac270_ide_resources,
631 .dev = {
632 .platform_data = &vpac270_pata_pdata,
Marek Vasut9b2dbdc2010-05-21 03:12:45 +0200633 .coherent_dma_mask = 0xffffffff,
Marek Vasut052345a2010-04-26 21:46:07 +0200634 }
635};
636
637static void __init vpac270_ide_init(void)
638{
639 platform_device_register(&vpac270_ide_device);
640}
641#else
642static inline void vpac270_ide_init(void) {}
643#endif
644
645/******************************************************************************
Marek Vasut54e70bf2010-05-21 03:12:43 +0200646 * Core power regulator
647 ******************************************************************************/
648#if defined(CONFIG_REGULATOR_MAX1586) || \
649 defined(CONFIG_REGULATOR_MAX1586_MODULE)
650static struct regulator_consumer_supply vpac270_max1587a_consumers[] = {
Axel Lin0bf189a2012-05-08 16:25:10 +0800651 REGULATOR_SUPPLY("vcc_core", NULL),
Marek Vasut54e70bf2010-05-21 03:12:43 +0200652};
653
654static struct regulator_init_data vpac270_max1587a_v3_info = {
655 .constraints = {
656 .name = "vcc_core range",
657 .min_uV = 900000,
658 .max_uV = 1705000,
659 .always_on = 1,
660 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
661 },
662 .consumer_supplies = vpac270_max1587a_consumers,
663 .num_consumer_supplies = ARRAY_SIZE(vpac270_max1587a_consumers),
664};
665
666static struct max1586_subdev_data vpac270_max1587a_subdevs[] = {
667 {
668 .name = "vcc_core",
669 .id = MAX1586_V3,
670 .platform_data = &vpac270_max1587a_v3_info,
671 }
672};
673
674static struct max1586_platform_data vpac270_max1587a_info = {
675 .subdevs = vpac270_max1587a_subdevs,
676 .num_subdevs = ARRAY_SIZE(vpac270_max1587a_subdevs),
677 .v3_gain = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
678};
679
680static struct i2c_board_info __initdata vpac270_pi2c_board_info[] = {
681 {
682 I2C_BOARD_INFO("max1586", 0x14),
683 .platform_data = &vpac270_max1587a_info,
684 },
685};
686
687static void __init vpac270_pmic_init(void)
688{
689 i2c_register_board_info(1, ARRAY_AND_SIZE(vpac270_pi2c_board_info));
690}
691#else
692static inline void vpac270_pmic_init(void) {}
693#endif
694
695
696/******************************************************************************
Marek543cd842010-03-09 04:04:12 +0100697 * Machine init
698 ******************************************************************************/
699static void __init vpac270_init(void)
700{
701 pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config));
702
703 pxa_set_ffuart_info(NULL);
704 pxa_set_btuart_info(NULL);
705 pxa_set_stuart_info(NULL);
Marek Vasut54e70bf2010-05-21 03:12:43 +0200706 pxa_set_i2c_info(NULL);
707 pxa27x_set_i2c_power_info(NULL);
Marek543cd842010-03-09 04:04:12 +0100708
Marek Vasut54e70bf2010-05-21 03:12:43 +0200709 vpac270_pmic_init();
Marek543cd842010-03-09 04:04:12 +0100710 vpac270_lcd_init();
711 vpac270_mmc_init();
712 vpac270_nor_init();
Marek Vasutbcc399b2010-05-01 06:54:36 +0200713 vpac270_onenand_init();
Marek543cd842010-03-09 04:04:12 +0100714 vpac270_leds_init();
715 vpac270_keys_init();
Marek Vasut3d98f882010-03-10 05:24:27 +0100716 vpac270_uhc_init();
717 vpac270_udc_init();
Marek Vasut947fb572010-03-10 05:38:54 +0100718 vpac270_eth_init();
Marek Vasut1a8fb702010-03-26 04:45:54 +0100719 vpac270_ts_init();
Marek Vasut83a4a102010-03-26 05:38:10 +0100720 vpac270_rtc_init();
Marek Vasut052345a2010-04-26 21:46:07 +0200721 vpac270_ide_init();
Robert Jarzmika927ef82015-07-11 21:33:06 +0200722
723 regulator_has_full_constraints();
Marek543cd842010-03-09 04:04:12 +0100724}
725
726MACHINE_START(VPAC270, "Voipac PXA270")
Nicolas Pitre7375aba2011-07-05 22:38:15 -0400727 .atag_offset = 0x100,
Marek Vasut851982c2010-10-11 02:20:19 +0200728 .map_io = pxa27x_map_io,
Rob Herring4e611092012-01-03 16:53:48 -0600729 .nr_irqs = PXA_NR_IRQS,
Marek543cd842010-03-09 04:04:12 +0100730 .init_irq = pxa27x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800731 .handle_irq = pxa27x_handle_irq,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700732 .init_time = pxa_timer_init,
Russell King271a74f2011-11-04 14:15:53 +0000733 .init_machine = vpac270_init,
734 .restart = pxa_restart,
Marek543cd842010-03-09 04:04:12 +0100735MACHINE_END