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