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