]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/arm/mach-omap2/board-devkit8000.c
Merge branch 'next' into for-linus
[karo-tx-linux.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 #include <linux/usb/phy.h>
33
34 #include <linux/regulator/machine.h>
35 #include <linux/i2c/twl.h>
36 #include "id.h"
37 #include <asm/mach-types.h>
38 #include <asm/mach/arch.h>
39 #include <asm/mach/map.h>
40 #include <asm/mach/flash.h>
41
42 #include "common.h"
43 #include "gpmc.h"
44 #include <linux/platform_data/mtd-nand-omap2.h>
45 #include <video/omapdss.h>
46 #include <video/omap-panel-generic-dpi.h>
47 #include <video/omap-panel-tfp410.h>
48
49 #include <linux/platform_data/spi-omap2-mcspi.h>
50 #include <linux/input/matrix_keypad.h>
51 #include <linux/spi/spi.h>
52 #include <linux/dm9000.h>
53 #include <linux/interrupt.h>
54
55 #include "sdram-micron-mt46h32m32lf-6.h"
56 #include "mux.h"
57 #include "hsmmc.h"
58 #include "board-flash.h"
59 #include "common-board-devices.h"
60
61 #define NAND_CS                 0
62
63 #define OMAP_DM9000_GPIO_IRQ    25
64 #define OMAP3_DEVKIT_TS_GPIO    27
65
66 static struct mtd_partition devkit8000_nand_partitions[] = {
67         /* All the partition sizes are listed in terms of NAND block size */
68         {
69                 .name           = "X-Loader",
70                 .offset         = 0,
71                 .size           = 4 * NAND_BLOCK_SIZE,
72                 .mask_flags     = MTD_WRITEABLE,        /* force read-only */
73         },
74         {
75                 .name           = "U-Boot",
76                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
77                 .size           = 15 * NAND_BLOCK_SIZE,
78                 .mask_flags     = MTD_WRITEABLE,        /* force read-only */
79         },
80         {
81                 .name           = "U-Boot Env",
82                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
83                 .size           = 1 * NAND_BLOCK_SIZE,
84         },
85         {
86                 .name           = "Kernel",
87                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
88                 .size           = 32 * NAND_BLOCK_SIZE,
89         },
90         {
91                 .name           = "File System",
92                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x680000 */
93                 .size           = MTDPART_SIZ_FULL,
94         },
95 };
96
97 static struct omap2_hsmmc_info mmc[] = {
98         {
99                 .mmc            = 1,
100                 .caps           = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
101                 .gpio_wp        = 29,
102                 .deferred       = true,
103         },
104         {}      /* Terminator */
105 };
106
107 static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
108 {
109         if (gpio_is_valid(dssdev->reset_gpio))
110                 gpio_set_value_cansleep(dssdev->reset_gpio, 1);
111         return 0;
112 }
113
114 static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
115 {
116         if (gpio_is_valid(dssdev->reset_gpio))
117                 gpio_set_value_cansleep(dssdev->reset_gpio, 0);
118 }
119
120 static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = {
121         REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
122 };
123
124 /* ads7846 on SPI */
125 static struct regulator_consumer_supply devkit8000_vio_supply[] = {
126         REGULATOR_SUPPLY("vcc", "spi2.0"),
127 };
128
129 static struct panel_generic_dpi_data lcd_panel = {
130         .name                   = "innolux_at070tn83",
131         .platform_enable        = devkit8000_panel_enable_lcd,
132         .platform_disable       = devkit8000_panel_disable_lcd,
133 };
134
135 static struct omap_dss_device devkit8000_lcd_device = {
136         .name                   = "lcd",
137         .type                   = OMAP_DISPLAY_TYPE_DPI,
138         .driver_name            = "generic_dpi_panel",
139         .data                   = &lcd_panel,
140         .phy.dpi.data_lines     = 24,
141 };
142
143 static struct tfp410_platform_data dvi_panel = {
144         .power_down_gpio        = -1,
145         .i2c_bus_num            = 1,
146 };
147
148 static struct omap_dss_device devkit8000_dvi_device = {
149         .name                   = "dvi",
150         .type                   = OMAP_DISPLAY_TYPE_DPI,
151         .driver_name            = "tfp410",
152         .data                   = &dvi_panel,
153         .phy.dpi.data_lines     = 24,
154 };
155
156 static struct omap_dss_device devkit8000_tv_device = {
157         .name                   = "tv",
158         .driver_name            = "venc",
159         .type                   = OMAP_DISPLAY_TYPE_VENC,
160         .phy.venc.type          = OMAP_DSS_VENC_TYPE_SVIDEO,
161 };
162
163
164 static struct omap_dss_device *devkit8000_dss_devices[] = {
165         &devkit8000_lcd_device,
166         &devkit8000_dvi_device,
167         &devkit8000_tv_device,
168 };
169
170 static struct omap_dss_board_info devkit8000_dss_data = {
171         .num_devices = ARRAY_SIZE(devkit8000_dss_devices),
172         .devices = devkit8000_dss_devices,
173         .default_device = &devkit8000_lcd_device,
174 };
175
176 static uint32_t board_keymap[] = {
177         KEY(0, 0, KEY_1),
178         KEY(1, 0, KEY_2),
179         KEY(2, 0, KEY_3),
180         KEY(0, 1, KEY_4),
181         KEY(1, 1, KEY_5),
182         KEY(2, 1, KEY_6),
183         KEY(3, 1, KEY_F5),
184         KEY(0, 2, KEY_7),
185         KEY(1, 2, KEY_8),
186         KEY(2, 2, KEY_9),
187         KEY(3, 2, KEY_F6),
188         KEY(0, 3, KEY_F7),
189         KEY(1, 3, KEY_0),
190         KEY(2, 3, KEY_F8),
191         PERSISTENT_KEY(4, 5),
192         KEY(4, 4, KEY_VOLUMEUP),
193         KEY(5, 5, KEY_VOLUMEDOWN),
194         0
195 };
196
197 static struct matrix_keymap_data board_map_data = {
198         .keymap                 = board_keymap,
199         .keymap_size            = ARRAY_SIZE(board_keymap),
200 };
201
202 static struct twl4030_keypad_data devkit8000_kp_data = {
203         .keymap_data    = &board_map_data,
204         .rows           = 6,
205         .cols           = 6,
206         .rep            = 1,
207 };
208
209 static struct gpio_led gpio_leds[];
210
211 static int devkit8000_twl_gpio_setup(struct device *dev,
212                 unsigned gpio, unsigned ngpio)
213 {
214         int ret;
215
216         /* gpio + 0 is "mmc0_cd" (input/IRQ) */
217         mmc[0].gpio_cd = gpio + 0;
218         omap_hsmmc_late_init(mmc);
219
220         /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
221         gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
222
223         /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
224         devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
225         ret = gpio_request_one(devkit8000_lcd_device.reset_gpio,
226                                GPIOF_OUT_INIT_LOW, "LCD_PWREN");
227         if (ret < 0) {
228                 devkit8000_lcd_device.reset_gpio = -EINVAL;
229                 printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
230         }
231
232         /* gpio + 7 is "DVI_PD" (out, active low) */
233         dvi_panel.power_down_gpio = gpio + 7;
234
235         return 0;
236 }
237
238 static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
239         .use_leds       = true,
240         .pulldowns      = BIT(1) | BIT(2) | BIT(6) | BIT(8) | BIT(13)
241                                 | BIT(15) | BIT(16) | BIT(17),
242         .setup          = devkit8000_twl_gpio_setup,
243 };
244
245 static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
246         REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
247         REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
248 };
249
250 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
251 static struct regulator_init_data devkit8000_vmmc1 = {
252         .constraints = {
253                 .min_uV                 = 1850000,
254                 .max_uV                 = 3150000,
255                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
256                                         | REGULATOR_MODE_STANDBY,
257                 .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
258                                         | REGULATOR_CHANGE_MODE
259                                         | REGULATOR_CHANGE_STATUS,
260         },
261         .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vmmc1_supply),
262         .consumer_supplies      = devkit8000_vmmc1_supply,
263 };
264
265 /* VPLL1 for digital video outputs */
266 static struct regulator_init_data devkit8000_vpll1 = {
267         .constraints = {
268                 .min_uV                 = 1800000,
269                 .max_uV                 = 1800000,
270                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
271                                         | REGULATOR_MODE_STANDBY,
272                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
273                                         | REGULATOR_CHANGE_STATUS,
274         },
275         .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vpll1_supplies),
276         .consumer_supplies      = devkit8000_vpll1_supplies,
277 };
278
279 /* VAUX4 for ads7846 and nubs */
280 static struct regulator_init_data devkit8000_vio = {
281         .constraints = {
282                 .min_uV                 = 1800000,
283                 .max_uV                 = 1800000,
284                 .apply_uV               = true,
285                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
286                         | REGULATOR_MODE_STANDBY,
287                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
288                         | REGULATOR_CHANGE_STATUS,
289         },
290         .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vio_supply),
291         .consumer_supplies      = devkit8000_vio_supply,
292 };
293
294 static struct twl4030_platform_data devkit8000_twldata = {
295         /* platform_data for children goes here */
296         .gpio           = &devkit8000_gpio_data,
297         .vmmc1          = &devkit8000_vmmc1,
298         .vpll1          = &devkit8000_vpll1,
299         .vio            = &devkit8000_vio,
300         .keypad         = &devkit8000_kp_data,
301 };
302
303 static int __init devkit8000_i2c_init(void)
304 {
305         omap3_pmic_get_config(&devkit8000_twldata,
306                           TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
307                           TWL_COMMON_REGULATOR_VDAC);
308         omap3_pmic_init("tps65930", &devkit8000_twldata);
309         /* Bus 3 is attached to the DVI port where devices like the pico DLP
310          * projector don't work reliably with 400kHz */
311         omap_register_i2c_bus(3, 400, NULL, 0);
312         return 0;
313 }
314
315 static struct gpio_led gpio_leds[] = {
316         {
317                 .name                   = "led1",
318                 .default_trigger        = "heartbeat",
319                 .gpio                   = 186,
320                 .active_low             = true,
321         },
322         {
323                 .name                   = "led2",
324                 .default_trigger        = "mmc0",
325                 .gpio                   = 163,
326                 .active_low             = true,
327         },
328         {
329                 .name                   = "ledB",
330                 .default_trigger        = "none",
331                 .gpio                   = 153,
332                 .active_low             = true,
333         },
334         {
335                 .name                   = "led3",
336                 .default_trigger        = "none",
337                 .gpio                   = 164,
338                 .active_low             = true,
339         },
340 };
341
342 static struct gpio_led_platform_data gpio_led_info = {
343         .leds           = gpio_leds,
344         .num_leds       = ARRAY_SIZE(gpio_leds),
345 };
346
347 static struct platform_device leds_gpio = {
348         .name   = "leds-gpio",
349         .id     = -1,
350         .dev    = {
351                 .platform_data  = &gpio_led_info,
352         },
353 };
354
355 static struct gpio_keys_button gpio_buttons[] = {
356         {
357                 .code                   = BTN_EXTRA,
358                 .gpio                   = 26,
359                 .desc                   = "user",
360                 .wakeup                 = 1,
361         },
362 };
363
364 static struct gpio_keys_platform_data gpio_key_info = {
365         .buttons        = gpio_buttons,
366         .nbuttons       = ARRAY_SIZE(gpio_buttons),
367 };
368
369 static struct platform_device keys_gpio = {
370         .name   = "gpio-keys",
371         .id     = -1,
372         .dev    = {
373                 .platform_data  = &gpio_key_info,
374         },
375 };
376
377 #define OMAP_DM9000_BASE        0x2c000000
378
379 static struct resource omap_dm9000_resources[] = {
380         [0] = {
381                 .start          = OMAP_DM9000_BASE,
382                 .end            = (OMAP_DM9000_BASE + 0x4 - 1),
383                 .flags          = IORESOURCE_MEM,
384         },
385         [1] = {
386                 .start          = (OMAP_DM9000_BASE + 0x400),
387                 .end            = (OMAP_DM9000_BASE + 0x400 + 0x4 - 1),
388                 .flags          = IORESOURCE_MEM,
389         },
390         [2] = {
391                 .flags          = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
392         },
393 };
394
395 static struct dm9000_plat_data omap_dm9000_platdata = {
396         .flags = DM9000_PLATF_16BITONLY,
397 };
398
399 static struct platform_device omap_dm9000_dev = {
400         .name = "dm9000",
401         .id = -1,
402         .num_resources  = ARRAY_SIZE(omap_dm9000_resources),
403         .resource       = omap_dm9000_resources,
404         .dev = {
405                 .platform_data = &omap_dm9000_platdata,
406         },
407 };
408
409 static void __init omap_dm9000_init(void)
410 {
411         unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
412         struct omap_die_id odi;
413         int ret;
414
415         ret = gpio_request_one(OMAP_DM9000_GPIO_IRQ, GPIOF_IN, "dm9000 irq");
416         if (ret < 0) {
417                 printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
418                         OMAP_DM9000_GPIO_IRQ);
419                 return;
420         }
421
422         /* init the mac address using DIE id */
423         omap_get_die_id(&odi);
424
425         eth_addr[0] = 0x02; /* locally administered */
426         eth_addr[1] = odi.id_1 & 0xff;
427         eth_addr[2] = (odi.id_0 & 0xff000000) >> 24;
428         eth_addr[3] = (odi.id_0 & 0x00ff0000) >> 16;
429         eth_addr[4] = (odi.id_0 & 0x0000ff00) >> 8;
430         eth_addr[5] = (odi.id_0 & 0x000000ff);
431 }
432
433 static struct platform_device *devkit8000_devices[] __initdata = {
434         &leds_gpio,
435         &keys_gpio,
436         &omap_dm9000_dev,
437 };
438
439 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
440
441         .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
442         .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
443         .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
444
445         .phy_reset  = true,
446         .reset_gpio_port[0]  = -EINVAL,
447         .reset_gpio_port[1]  = -EINVAL,
448         .reset_gpio_port[2]  = -EINVAL
449 };
450
451 #ifdef CONFIG_OMAP_MUX
452 static struct omap_board_mux board_mux[] __initdata = {
453         /* nCS and IRQ for Devkit8000 ethernet */
454         OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE0),
455         OMAP3_MUX(ETK_D11, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
456
457         /* McSPI 2*/
458         OMAP3_MUX(MCSPI2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
459         OMAP3_MUX(MCSPI2_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
460         OMAP3_MUX(MCSPI2_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
461         OMAP3_MUX(MCSPI2_CS0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
462         OMAP3_MUX(MCSPI2_CS1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
463
464         /* PENDOWN GPIO */
465         OMAP3_MUX(ETK_D13, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
466
467         /* mUSB */
468         OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
469         OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
470         OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
471         OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
472         OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
473         OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
474         OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
475         OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
476         OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
477         OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
478         OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
479         OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
480
481         /* USB 1 */
482         OMAP3_MUX(ETK_CTL, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
483         OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
484         OMAP3_MUX(ETK_D8, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
485         OMAP3_MUX(ETK_D9, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
486         OMAP3_MUX(ETK_D0, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
487         OMAP3_MUX(ETK_D1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
488         OMAP3_MUX(ETK_D2, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
489         OMAP3_MUX(ETK_D3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
490         OMAP3_MUX(ETK_D4, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
491         OMAP3_MUX(ETK_D5, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
492         OMAP3_MUX(ETK_D6, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
493         OMAP3_MUX(ETK_D7, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
494
495         /* MMC 1 */
496         OMAP3_MUX(SDMMC1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
497         OMAP3_MUX(SDMMC1_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
498         OMAP3_MUX(SDMMC1_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
499         OMAP3_MUX(SDMMC1_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
500         OMAP3_MUX(SDMMC1_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
501         OMAP3_MUX(SDMMC1_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
502         OMAP3_MUX(SDMMC1_DAT4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
503         OMAP3_MUX(SDMMC1_DAT5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
504         OMAP3_MUX(SDMMC1_DAT6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
505         OMAP3_MUX(SDMMC1_DAT7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
506
507         /* McBSP 2 */
508         OMAP3_MUX(MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
509         OMAP3_MUX(MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
510         OMAP3_MUX(MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
511         OMAP3_MUX(MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
512
513         /* I2C 1 */
514         OMAP3_MUX(I2C1_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
515         OMAP3_MUX(I2C1_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
516
517         /* I2C 2 */
518         OMAP3_MUX(I2C2_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
519         OMAP3_MUX(I2C2_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
520
521         /* I2C 3 */
522         OMAP3_MUX(I2C3_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
523         OMAP3_MUX(I2C3_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
524
525         /* I2C 4 */
526         OMAP3_MUX(I2C4_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
527         OMAP3_MUX(I2C4_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
528
529         /* serial ports */
530         OMAP3_MUX(MCBSP3_CLKX, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
531         OMAP3_MUX(MCBSP3_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
532         OMAP3_MUX(UART1_TX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
533         OMAP3_MUX(UART1_RX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
534
535         /* DSS */
536         OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
537         OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
538         OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
539         OMAP3_MUX(DSS_ACBIAS, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
540         OMAP3_MUX(DSS_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
541         OMAP3_MUX(DSS_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
542         OMAP3_MUX(DSS_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
543         OMAP3_MUX(DSS_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
544         OMAP3_MUX(DSS_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
545         OMAP3_MUX(DSS_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
546         OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
547         OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
548         OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
549         OMAP3_MUX(DSS_DATA9, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
550         OMAP3_MUX(DSS_DATA10, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
551         OMAP3_MUX(DSS_DATA11, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
552         OMAP3_MUX(DSS_DATA12, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
553         OMAP3_MUX(DSS_DATA13, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
554         OMAP3_MUX(DSS_DATA14, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
555         OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
556         OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
557         OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
558         OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
559         OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
560         OMAP3_MUX(DSS_DATA20, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
561         OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
562         OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
563         OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
564
565         /* expansion port */
566         /* McSPI 1 */
567         OMAP3_MUX(MCSPI1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
568         OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
569         OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
570         OMAP3_MUX(MCSPI1_CS0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
571         OMAP3_MUX(MCSPI1_CS3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
572
573         /* HDQ */
574         OMAP3_MUX(HDQ_SIO, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
575
576         /* McSPI4 */
577         OMAP3_MUX(MCBSP1_CLKR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
578         OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
579         OMAP3_MUX(MCBSP1_DR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
580         OMAP3_MUX(MCBSP1_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP),
581
582         /* MMC 2 */
583         OMAP3_MUX(SDMMC2_DAT4, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
584         OMAP3_MUX(SDMMC2_DAT5, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
585         OMAP3_MUX(SDMMC2_DAT6, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
586         OMAP3_MUX(SDMMC2_DAT7, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
587
588         /* I2C3 */
589         OMAP3_MUX(I2C3_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
590         OMAP3_MUX(I2C3_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
591
592         OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
593         OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
594         OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
595
596         OMAP3_MUX(GPMC_NCS7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
597         OMAP3_MUX(GPMC_NCS3, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
598
599         /* TPS IRQ */
600         OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \
601                         OMAP_PIN_INPUT_PULLUP),
602
603         { .reg_offset = OMAP_MUX_TERMINATOR },
604 };
605 #endif
606
607 static void __init devkit8000_init(void)
608 {
609         omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
610         omap_serial_init();
611         omap_sdrc_init(mt46h32m32lf6_sdrc_params,
612                                   mt46h32m32lf6_sdrc_params);
613
614         omap_dm9000_init();
615
616         omap_hsmmc_init(mmc);
617         devkit8000_i2c_init();
618         omap_dm9000_resources[2].start = gpio_to_irq(OMAP_DM9000_GPIO_IRQ);
619         platform_add_devices(devkit8000_devices,
620                         ARRAY_SIZE(devkit8000_devices));
621
622         omap_display_init(&devkit8000_dss_data);
623
624         omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);
625
626         usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
627         usb_musb_init(NULL);
628         usbhs_init(&usbhs_bdata);
629         board_nand_init(devkit8000_nand_partitions,
630                         ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS,
631                         NAND_BUSWIDTH_16, NULL);
632         omap_twl4030_audio_init("omap3beagle", NULL);
633
634         /* Ensure SDRC pins are mux'd for self-refresh */
635         omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
636         omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
637 }
638
639 MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
640         .atag_offset    = 0x100,
641         .reserve        = omap_reserve,
642         .map_io         = omap3_map_io,
643         .init_early     = omap35xx_init_early,
644         .init_irq       = omap3_init_irq,
645         .handle_irq     = omap3_intc_handle_irq,
646         .init_machine   = devkit8000_init,
647         .init_late      = omap35xx_init_late,
648         .init_time      = omap3_secure_sync32k_timer_init,
649         .restart        = omap3xxx_restart,
650 MACHINE_END