Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / arch / arm / mach-omap2 / board-devkit8000.c
1 /*
2  * board-devkit8000.c - TimLL Devkit8000
3  *
4  * Copyright (C) 2009 Kim Botherway
5  * Copyright (C) 2010 Thomas Weber
6  *
7  * Modified from mach-omap2/board-omap3beagle.c
8  *
9  * Initial code: Syed Mohammed Khasim
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2 as
13  * published by the Free Software Foundation.
14  */
15
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
19 #include <linux/delay.h>
20 #include <linux/err.h>
21 #include <linux/clk.h>
22 #include <linux/io.h>
23 #include <linux/leds.h>
24 #include <linux/gpio.h>
25 #include <linux/input.h>
26 #include <linux/gpio_keys.h>
27
28 #include <linux/mtd/mtd.h>
29 #include <linux/mtd/partitions.h>
30 #include <linux/mtd/nand.h>
31 #include <linux/mmc/host.h>
32
33 #include <linux/regulator/machine.h>
34 #include <linux/i2c/twl.h>
35
36 #include <mach/hardware.h>
37 #include <mach/id.h>
38 #include <asm/mach-types.h>
39 #include <asm/mach/arch.h>
40 #include <asm/mach/map.h>
41 #include <asm/mach/flash.h>
42
43 #include <plat/board.h>
44 #include <plat/common.h>
45 #include <plat/gpmc.h>
46 #include <plat/nand.h>
47 #include <plat/usb.h>
48 #include <plat/display.h>
49
50 #include <plat/mcspi.h>
51 #include <linux/input/matrix_keypad.h>
52 #include <linux/spi/spi.h>
53 #include <linux/spi/ads7846.h>
54 #include <linux/dm9000.h>
55 #include <linux/interrupt.h>
56
57 #include "sdram-micron-mt46h32m32lf-6.h"
58
59 #include "mux.h"
60 #include "hsmmc.h"
61 #include "timer-gp.h"
62
63 #define NAND_BLOCK_SIZE         SZ_128K
64
65 #define OMAP_DM9000_GPIO_IRQ    25
66 #define OMAP3_DEVKIT_TS_GPIO    27
67
68 static struct mtd_partition devkit8000_nand_partitions[] = {
69         /* All the partition sizes are listed in terms of NAND block size */
70         {
71                 .name           = "X-Loader",
72                 .offset         = 0,
73                 .size           = 4 * NAND_BLOCK_SIZE,
74                 .mask_flags     = MTD_WRITEABLE,        /* force read-only */
75         },
76         {
77                 .name           = "U-Boot",
78                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
79                 .size           = 15 * NAND_BLOCK_SIZE,
80                 .mask_flags     = MTD_WRITEABLE,        /* force read-only */
81         },
82         {
83                 .name           = "U-Boot Env",
84                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
85                 .size           = 1 * NAND_BLOCK_SIZE,
86         },
87         {
88                 .name           = "Kernel",
89                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
90                 .size           = 32 * NAND_BLOCK_SIZE,
91         },
92         {
93                 .name           = "File System",
94                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x680000 */
95                 .size           = MTDPART_SIZ_FULL,
96         },
97 };
98
99 static struct omap_nand_platform_data devkit8000_nand_data = {
100         .options        = NAND_BUSWIDTH_16,
101         .parts          = devkit8000_nand_partitions,
102         .nr_parts       = ARRAY_SIZE(devkit8000_nand_partitions),
103         .dma_channel    = -1,           /* disable DMA in OMAP NAND driver */
104 };
105
106 static struct omap2_hsmmc_info mmc[] = {
107         {
108                 .mmc            = 1,
109                 .caps           = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
110                 .gpio_wp        = 29,
111         },
112         {}      /* Terminator */
113 };
114
115 static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
116 {
117         twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
118         twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
119
120         if (gpio_is_valid(dssdev->reset_gpio))
121                 gpio_set_value(dssdev->reset_gpio, 1);
122         return 0;
123 }
124
125 static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
126 {
127         if (gpio_is_valid(dssdev->reset_gpio))
128                 gpio_set_value(dssdev->reset_gpio, 0);
129 }
130
131 static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
132 {
133         if (gpio_is_valid(dssdev->reset_gpio))
134                 gpio_set_value(dssdev->reset_gpio, 1);
135         return 0;
136 }
137
138 static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
139 {
140         if (gpio_is_valid(dssdev->reset_gpio))
141                 gpio_set_value(dssdev->reset_gpio, 0);
142 }
143
144 static struct regulator_consumer_supply devkit8000_vmmc1_supply =
145         REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0");
146
147
148 /* ads7846 on SPI */
149 static struct regulator_consumer_supply devkit8000_vio_supply =
150         REGULATOR_SUPPLY("vcc", "spi2.0");
151
152 static struct omap_dss_device devkit8000_lcd_device = {
153         .name                   = "lcd",
154         .driver_name            = "generic_panel",
155         .type                   = OMAP_DISPLAY_TYPE_DPI,
156         .phy.dpi.data_lines     = 24,
157         .reset_gpio             = -EINVAL, /* will be replaced */
158         .platform_enable        = devkit8000_panel_enable_lcd,
159         .platform_disable       = devkit8000_panel_disable_lcd,
160 };
161 static struct omap_dss_device devkit8000_dvi_device = {
162         .name                   = "dvi",
163         .driver_name            = "generic_panel",
164         .type                   = OMAP_DISPLAY_TYPE_DPI,
165         .phy.dpi.data_lines     = 24,
166         .reset_gpio             = -EINVAL, /* will be replaced */
167         .platform_enable        = devkit8000_panel_enable_dvi,
168         .platform_disable       = devkit8000_panel_disable_dvi,
169 };
170
171 static struct omap_dss_device devkit8000_tv_device = {
172         .name                   = "tv",
173         .driver_name            = "venc",
174         .type                   = OMAP_DISPLAY_TYPE_VENC,
175         .phy.venc.type          = OMAP_DSS_VENC_TYPE_SVIDEO,
176 };
177
178
179 static struct omap_dss_device *devkit8000_dss_devices[] = {
180         &devkit8000_lcd_device,
181         &devkit8000_dvi_device,
182         &devkit8000_tv_device,
183 };
184
185 static struct omap_dss_board_info devkit8000_dss_data = {
186         .num_devices = ARRAY_SIZE(devkit8000_dss_devices),
187         .devices = devkit8000_dss_devices,
188         .default_device = &devkit8000_lcd_device,
189 };
190
191 static struct platform_device devkit8000_dss_device = {
192         .name           = "omapdss",
193         .id             = -1,
194         .dev            = {
195                 .platform_data = &devkit8000_dss_data,
196         },
197 };
198
199 static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
200         REGULATOR_SUPPLY("vdda_dac", "omapdss");
201
202 static uint32_t board_keymap[] = {
203         KEY(0, 0, KEY_1),
204         KEY(1, 0, KEY_2),
205         KEY(2, 0, KEY_3),
206         KEY(0, 1, KEY_4),
207         KEY(1, 1, KEY_5),
208         KEY(2, 1, KEY_6),
209         KEY(3, 1, KEY_F5),
210         KEY(0, 2, KEY_7),
211         KEY(1, 2, KEY_8),
212         KEY(2, 2, KEY_9),
213         KEY(3, 2, KEY_F6),
214         KEY(0, 3, KEY_F7),
215         KEY(1, 3, KEY_0),
216         KEY(2, 3, KEY_F8),
217         PERSISTENT_KEY(4, 5),
218         KEY(4, 4, KEY_VOLUMEUP),
219         KEY(5, 5, KEY_VOLUMEDOWN),
220         0
221 };
222
223 static struct matrix_keymap_data board_map_data = {
224         .keymap                 = board_keymap,
225         .keymap_size            = ARRAY_SIZE(board_keymap),
226 };
227
228 static struct twl4030_keypad_data devkit8000_kp_data = {
229         .keymap_data    = &board_map_data,
230         .rows           = 6,
231         .cols           = 6,
232         .rep            = 1,
233 };
234
235 static struct gpio_led gpio_leds[];
236
237 static int devkit8000_twl_gpio_setup(struct device *dev,
238                 unsigned gpio, unsigned ngpio)
239 {
240         omap_mux_init_gpio(29, OMAP_PIN_INPUT);
241         /* gpio + 0 is "mmc0_cd" (input/IRQ) */
242         mmc[0].gpio_cd = gpio + 0;
243         omap2_hsmmc_init(mmc);
244
245         /* link regulators to MMC adapters */
246         devkit8000_vmmc1_supply.dev = mmc[0].dev;
247
248         /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
249         gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
250
251         /* gpio + 1 is "LCD_PWREN" (out, active high) */
252         devkit8000_lcd_device.reset_gpio = gpio + 1;
253         gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
254         /* Disable until needed */
255         gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
256
257         /* gpio + 7 is "DVI_PD" (out, active low) */
258         devkit8000_dvi_device.reset_gpio = gpio + 7;
259         gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
260         /* Disable until needed */
261         gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);
262
263         return 0;
264 }
265
266 static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
267         .gpio_base      = OMAP_MAX_GPIO_LINES,
268         .irq_base       = TWL4030_GPIO_IRQ_BASE,
269         .irq_end        = TWL4030_GPIO_IRQ_END,
270         .use_leds       = true,
271         .pullups        = BIT(1),
272         .pulldowns      = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
273                                 | BIT(15) | BIT(16) | BIT(17),
274         .setup          = devkit8000_twl_gpio_setup,
275 };
276
277 static struct regulator_consumer_supply devkit8000_vpll1_supply =
278         REGULATOR_SUPPLY("vdds_dsi", "omapdss");
279
280 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
281 static struct regulator_init_data devkit8000_vmmc1 = {
282         .constraints = {
283                 .min_uV                 = 1850000,
284                 .max_uV                 = 3150000,
285                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
286                                         | REGULATOR_MODE_STANDBY,
287                 .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
288                                         | REGULATOR_CHANGE_MODE
289                                         | REGULATOR_CHANGE_STATUS,
290         },
291         .num_consumer_supplies  = 1,
292         .consumer_supplies      = &devkit8000_vmmc1_supply,
293 };
294
295 /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
296 static struct regulator_init_data devkit8000_vdac = {
297         .constraints = {
298                 .min_uV                 = 1800000,
299                 .max_uV                 = 1800000,
300                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
301                                         | REGULATOR_MODE_STANDBY,
302                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
303                                         | REGULATOR_CHANGE_STATUS,
304         },
305         .num_consumer_supplies  = 1,
306         .consumer_supplies      = &devkit8000_vdda_dac_supply,
307 };
308
309 /* VPLL1 for digital video outputs */
310 static struct regulator_init_data devkit8000_vpll1 = {
311         .constraints = {
312                 .min_uV                 = 1800000,
313                 .max_uV                 = 1800000,
314                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
315                                         | REGULATOR_MODE_STANDBY,
316                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
317                                         | REGULATOR_CHANGE_STATUS,
318         },
319         .num_consumer_supplies  = 1,
320         .consumer_supplies      = &devkit8000_vpll1_supply,
321 };
322
323 /* VAUX4 for ads7846 and nubs */
324 static struct regulator_init_data devkit8000_vio = {
325         .constraints = {
326                 .min_uV                 = 1800000,
327                 .max_uV                 = 1800000,
328                 .apply_uV               = true,
329                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
330                         | REGULATOR_MODE_STANDBY,
331                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
332                         | REGULATOR_CHANGE_STATUS,
333         },
334         .num_consumer_supplies  = 1,
335         .consumer_supplies      = &devkit8000_vio_supply,
336 };
337
338 static struct twl4030_usb_data devkit8000_usb_data = {
339         .usb_mode       = T2_USB_MODE_ULPI,
340 };
341
342 static struct twl4030_codec_audio_data devkit8000_audio_data = {
343         .audio_mclk = 26000000,
344 };
345
346 static struct twl4030_codec_data devkit8000_codec_data = {
347         .audio_mclk = 26000000,
348         .audio = &devkit8000_audio_data,
349 };
350
351 static struct twl4030_platform_data devkit8000_twldata = {
352         .irq_base       = TWL4030_IRQ_BASE,
353         .irq_end        = TWL4030_IRQ_END,
354
355         /* platform_data for children goes here */
356         .usb            = &devkit8000_usb_data,
357         .gpio           = &devkit8000_gpio_data,
358         .codec          = &devkit8000_codec_data,
359         .vmmc1          = &devkit8000_vmmc1,
360         .vdac           = &devkit8000_vdac,
361         .vpll1          = &devkit8000_vpll1,
362         .vio            = &devkit8000_vio,
363         .keypad         = &devkit8000_kp_data,
364 };
365
366 static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = {
367         {
368                 I2C_BOARD_INFO("tps65930", 0x48),
369                 .flags = I2C_CLIENT_WAKE,
370                 .irq = INT_34XX_SYS_NIRQ,
371                 .platform_data = &devkit8000_twldata,
372         },
373 };
374
375 static int __init devkit8000_i2c_init(void)
376 {
377         omap_register_i2c_bus(1, 2600, devkit8000_i2c_boardinfo,
378                         ARRAY_SIZE(devkit8000_i2c_boardinfo));
379         /* Bus 3 is attached to the DVI port where devices like the pico DLP
380          * projector don't work reliably with 400kHz */
381         omap_register_i2c_bus(3, 400, NULL, 0);
382         return 0;
383 }
384
385 static struct gpio_led gpio_leds[] = {
386         {
387                 .name                   = "led1",
388                 .default_trigger        = "heartbeat",
389                 .gpio                   = 186,
390                 .active_low             = true,
391         },
392         {
393                 .name                   = "led2",
394                 .default_trigger        = "mmc0",
395                 .gpio                   = 163,
396                 .active_low             = true,
397         },
398         {
399                 .name                   = "ledB",
400                 .default_trigger        = "none",
401                 .gpio                   = 153,
402                 .active_low             = true,
403         },
404         {
405                 .name                   = "led3",
406                 .default_trigger        = "none",
407                 .gpio                   = 164,
408                 .active_low             = true,
409         },
410 };
411
412 static struct gpio_led_platform_data gpio_led_info = {
413         .leds           = gpio_leds,
414         .num_leds       = ARRAY_SIZE(gpio_leds),
415 };
416
417 static struct platform_device leds_gpio = {
418         .name   = "leds-gpio",
419         .id     = -1,
420         .dev    = {
421                 .platform_data  = &gpio_led_info,
422         },
423 };
424
425 static struct gpio_keys_button gpio_buttons[] = {
426         {
427                 .code                   = BTN_EXTRA,
428                 .gpio                   = 26,
429                 .desc                   = "user",
430                 .wakeup                 = 1,
431         },
432 };
433
434 static struct gpio_keys_platform_data gpio_key_info = {
435         .buttons        = gpio_buttons,
436         .nbuttons       = ARRAY_SIZE(gpio_buttons),
437 };
438
439 static struct platform_device keys_gpio = {
440         .name   = "gpio-keys",
441         .id     = -1,
442         .dev    = {
443                 .platform_data  = &gpio_key_info,
444         },
445 };
446
447
448 static void __init devkit8000_init_irq(void)
449 {
450         omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
451                              mt46h32m32lf6_sdrc_params);
452         omap_init_irq();
453 #ifdef CONFIG_OMAP_32K_TIMER
454         omap2_gp_clockevent_set_gptimer(12);
455 #endif
456         omap_gpio_init();
457 }
458
459 static void __init devkit8000_ads7846_init(void)
460 {
461         int gpio = OMAP3_DEVKIT_TS_GPIO;
462         int ret;
463
464         ret = gpio_request(gpio, "ads7846_pen_down");
465         if (ret < 0) {
466                 printk(KERN_ERR "Failed to request GPIO %d for "
467                                 "ads7846 pen down IRQ\n", gpio);
468                 return;
469         }
470
471         gpio_direction_input(gpio);
472 }
473
474 static int ads7846_get_pendown_state(void)
475 {
476         return !gpio_get_value(OMAP3_DEVKIT_TS_GPIO);
477 }
478
479 static struct ads7846_platform_data ads7846_config = {
480         .x_max                  = 0x0fff,
481         .y_max                  = 0x0fff,
482         .x_plate_ohms           = 180,
483         .pressure_max           = 255,
484         .debounce_max           = 10,
485         .debounce_tol           = 5,
486         .debounce_rep           = 1,
487         .get_pendown_state      = ads7846_get_pendown_state,
488         .keep_vref_on           = 1,
489         .settle_delay_usecs     = 150,
490 };
491
492 static struct omap2_mcspi_device_config ads7846_mcspi_config = {
493         .turbo_mode     = 0,
494         .single_channel = 1,    /* 0: slave, 1: master */
495 };
496
497 static struct spi_board_info devkit8000_spi_board_info[] __initdata = {
498         {
499                 .modalias               = "ads7846",
500                 .bus_num                = 2,
501                 .chip_select            = 0,
502                 .max_speed_hz           = 1500000,
503                 .controller_data        = &ads7846_mcspi_config,
504                 .irq                    = OMAP_GPIO_IRQ(OMAP3_DEVKIT_TS_GPIO),
505                 .platform_data          = &ads7846_config,
506         }
507 };
508
509 #define OMAP_DM9000_BASE        0x2c000000
510
511 static struct resource omap_dm9000_resources[] = {
512         [0] = {
513                 .start          = OMAP_DM9000_BASE,
514                 .end            = (OMAP_DM9000_BASE + 0x4 - 1),
515                 .flags          = IORESOURCE_MEM,
516         },
517         [1] = {
518                 .start          = (OMAP_DM9000_BASE + 0x400),
519                 .end            = (OMAP_DM9000_BASE + 0x400 + 0x4 - 1),
520                 .flags          = IORESOURCE_MEM,
521         },
522         [2] = {
523                 .start          = OMAP_GPIO_IRQ(OMAP_DM9000_GPIO_IRQ),
524                 .flags          = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
525         },
526 };
527
528 static struct dm9000_plat_data omap_dm9000_platdata = {
529         .flags = DM9000_PLATF_16BITONLY,
530 };
531
532 static struct platform_device omap_dm9000_dev = {
533         .name = "dm9000",
534         .id = -1,
535         .num_resources  = ARRAY_SIZE(omap_dm9000_resources),
536         .resource       = omap_dm9000_resources,
537         .dev = {
538                 .platform_data = &omap_dm9000_platdata,
539         },
540 };
541
542 static void __init omap_dm9000_init(void)
543 {
544         unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
545         struct omap_die_id odi;
546
547         if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) {
548                 printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
549                         OMAP_DM9000_GPIO_IRQ);
550                 return;
551                 }
552
553         gpio_direction_input(OMAP_DM9000_GPIO_IRQ);
554
555         /* init the mac address using DIE id */
556         omap_get_die_id(&odi);
557
558         eth_addr[0] = 0x02; /* locally administered */
559         eth_addr[1] = odi.id_1 & 0xff;
560         eth_addr[2] = (odi.id_0 & 0xff000000) >> 24;
561         eth_addr[3] = (odi.id_0 & 0x00ff0000) >> 16;
562         eth_addr[4] = (odi.id_0 & 0x0000ff00) >> 8;
563         eth_addr[5] = (odi.id_0 & 0x000000ff);
564 }
565
566 static struct platform_device *devkit8000_devices[] __initdata = {
567         &devkit8000_dss_device,
568         &leds_gpio,
569         &keys_gpio,
570         &omap_dm9000_dev,
571 };
572
573 static void __init devkit8000_flash_init(void)
574 {
575         u8 cs = 0;
576         u8 nandcs = GPMC_CS_NUM + 1;
577
578         /* find out the chip-select on which NAND exists */
579         while (cs < GPMC_CS_NUM) {
580                 u32 ret = 0;
581                 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
582
583                 if ((ret & 0xC00) == 0x800) {
584                         printk(KERN_INFO "Found NAND on CS%d\n", cs);
585                         if (nandcs > GPMC_CS_NUM)
586                                 nandcs = cs;
587                 }
588                 cs++;
589         }
590
591         if (nandcs > GPMC_CS_NUM) {
592                 printk(KERN_INFO "NAND: Unable to find configuration "
593                                  "in GPMC\n ");
594                 return;
595         }
596
597         if (nandcs < GPMC_CS_NUM) {
598                 devkit8000_nand_data.cs = nandcs;
599
600                 printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
601                 if (gpmc_nand_init(&devkit8000_nand_data) < 0)
602                         printk(KERN_ERR "Unable to register NAND device\n");
603         }
604 }
605
606 static struct omap_musb_board_data musb_board_data = {
607         .interface_type         = MUSB_INTERFACE_ULPI,
608         .mode                   = MUSB_OTG,
609         .power                  = 100,
610 };
611
612 static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
613
614         .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
615         .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
616         .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
617
618         .phy_reset  = true,
619         .reset_gpio_port[0]  = -EINVAL,
620         .reset_gpio_port[1]  = -EINVAL,
621         .reset_gpio_port[2]  = -EINVAL
622 };
623
624 static struct omap_board_mux board_mux[] __initdata = {
625         /* nCS and IRQ for Devkit8000 ethernet */
626         OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE0),
627         OMAP3_MUX(ETK_D11, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
628
629         /* McSPI 2*/
630         OMAP3_MUX(MCSPI2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
631         OMAP3_MUX(MCSPI2_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
632         OMAP3_MUX(MCSPI2_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
633         OMAP3_MUX(MCSPI2_CS0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
634         OMAP3_MUX(MCSPI2_CS1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
635
636         /* PENDOWN GPIO */
637         OMAP3_MUX(ETK_D13, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
638
639         /* mUSB */
640         OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
641         OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
642         OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
643         OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
644         OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
645         OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
646         OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
647         OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
648         OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
649         OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
650         OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
651         OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
652
653         /* USB 1 */
654         OMAP3_MUX(ETK_CTL, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
655         OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
656         OMAP3_MUX(ETK_D8, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
657         OMAP3_MUX(ETK_D9, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
658         OMAP3_MUX(ETK_D0, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
659         OMAP3_MUX(ETK_D1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
660         OMAP3_MUX(ETK_D2, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
661         OMAP3_MUX(ETK_D3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
662         OMAP3_MUX(ETK_D4, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
663         OMAP3_MUX(ETK_D5, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
664         OMAP3_MUX(ETK_D6, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
665         OMAP3_MUX(ETK_D7, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
666
667         /* MMC 1 */
668         OMAP3_MUX(SDMMC1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
669         OMAP3_MUX(SDMMC1_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
670         OMAP3_MUX(SDMMC1_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
671         OMAP3_MUX(SDMMC1_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
672         OMAP3_MUX(SDMMC1_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
673         OMAP3_MUX(SDMMC1_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
674         OMAP3_MUX(SDMMC1_DAT4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
675         OMAP3_MUX(SDMMC1_DAT5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
676         OMAP3_MUX(SDMMC1_DAT6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
677         OMAP3_MUX(SDMMC1_DAT7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
678
679         /* McBSP 2 */
680         OMAP3_MUX(MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
681         OMAP3_MUX(MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
682         OMAP3_MUX(MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
683         OMAP3_MUX(MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
684
685         /* I2C 1 */
686         OMAP3_MUX(I2C1_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
687         OMAP3_MUX(I2C1_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
688
689         /* I2C 2 */
690         OMAP3_MUX(I2C2_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
691         OMAP3_MUX(I2C2_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
692
693         /* I2C 3 */
694         OMAP3_MUX(I2C3_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
695         OMAP3_MUX(I2C3_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
696
697         /* I2C 4 */
698         OMAP3_MUX(I2C4_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
699         OMAP3_MUX(I2C4_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
700
701         /* serial ports */
702         OMAP3_MUX(MCBSP3_CLKX, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
703         OMAP3_MUX(MCBSP3_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
704         OMAP3_MUX(UART1_TX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
705         OMAP3_MUX(UART1_RX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
706
707         /* DSS */
708         OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
709         OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
710         OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
711         OMAP3_MUX(DSS_ACBIAS, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
712         OMAP3_MUX(DSS_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
713         OMAP3_MUX(DSS_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
714         OMAP3_MUX(DSS_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
715         OMAP3_MUX(DSS_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
716         OMAP3_MUX(DSS_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
717         OMAP3_MUX(DSS_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
718         OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
719         OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
720         OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
721         OMAP3_MUX(DSS_DATA9, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
722         OMAP3_MUX(DSS_DATA10, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
723         OMAP3_MUX(DSS_DATA11, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
724         OMAP3_MUX(DSS_DATA12, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
725         OMAP3_MUX(DSS_DATA13, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
726         OMAP3_MUX(DSS_DATA14, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
727         OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
728         OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
729         OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
730         OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
731         OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
732         OMAP3_MUX(DSS_DATA20, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
733         OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
734         OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
735         OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
736
737         /* expansion port */
738         /* McSPI 1 */
739         OMAP3_MUX(MCSPI1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
740         OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
741         OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
742         OMAP3_MUX(MCSPI1_CS0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
743         OMAP3_MUX(MCSPI1_CS3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
744
745         /* HDQ */
746         OMAP3_MUX(HDQ_SIO, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
747
748         /* McSPI4 */
749         OMAP3_MUX(MCBSP1_CLKR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
750         OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
751         OMAP3_MUX(MCBSP1_DR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
752         OMAP3_MUX(MCBSP1_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP),
753
754         /* MMC 2 */
755         OMAP3_MUX(SDMMC2_DAT4, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
756         OMAP3_MUX(SDMMC2_DAT5, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
757         OMAP3_MUX(SDMMC2_DAT6, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
758         OMAP3_MUX(SDMMC2_DAT7, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
759
760         /* I2C3 */
761         OMAP3_MUX(I2C3_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
762         OMAP3_MUX(I2C3_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
763
764         OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
765         OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
766         OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
767
768         OMAP3_MUX(GPMC_NCS7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
769         OMAP3_MUX(GPMC_NCS3, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
770
771         /* TPS IRQ */
772         OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \
773                         OMAP_PIN_INPUT_PULLUP),
774
775         { .reg_offset = OMAP_MUX_TERMINATOR },
776 };
777
778 static void __init devkit8000_init(void)
779 {
780         omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
781         omap_serial_init();
782
783         omap_dm9000_init();
784
785         devkit8000_i2c_init();
786         platform_add_devices(devkit8000_devices,
787                         ARRAY_SIZE(devkit8000_devices));
788
789         spi_register_board_info(devkit8000_spi_board_info,
790         ARRAY_SIZE(devkit8000_spi_board_info));
791
792         devkit8000_ads7846_init();
793
794         usb_musb_init(&musb_board_data);
795         usb_ehci_init(&ehci_pdata);
796         devkit8000_flash_init();
797
798         /* Ensure SDRC pins are mux'd for self-refresh */
799         omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
800         omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
801 }
802
803 MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
804         .boot_params    = 0x80000100,
805         .map_io         = omap3_map_io,
806         .reserve        = omap_reserve,
807         .init_irq       = devkit8000_init_irq,
808         .init_machine   = devkit8000_init,
809         .timer          = &omap_timer,
810 MACHINE_END