USB: Free bandwidth when usb_disable_device is called.
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-omap2 / board-3430sdp.c
blob9afd087cc29c9b1346cde3b161236e6d01b37524
1 /*
2 * linux/arch/arm/mach-omap2/board-3430sdp.c
4 * Copyright (C) 2007 Texas Instruments
6 * Modified from mach-omap2/board-generic.c
8 * Initial code: Syed Mohammed Khasim
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/delay.h>
19 #include <linux/input.h>
20 #include <linux/input/matrix_keypad.h>
21 #include <linux/spi/spi.h>
22 #include <linux/spi/ads7846.h>
23 #include <linux/i2c/twl.h>
24 #include <linux/regulator/machine.h>
25 #include <linux/io.h>
26 #include <linux/gpio.h>
27 #include <linux/mmc/host.h>
29 #include <mach/hardware.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/map.h>
34 #include <plat/mcspi.h>
35 #include <plat/board.h>
36 #include <plat/usb.h>
37 #include <plat/common.h>
38 #include <plat/dma.h>
39 #include <plat/gpmc.h>
40 #include <plat/display.h>
41 #include <plat/panel-generic-dpi.h>
43 #include <plat/gpmc-smc91x.h>
45 #include "board-flash.h"
46 #include "mux.h"
47 #include "sdram-qimonda-hyb18m512160af-6.h"
48 #include "hsmmc.h"
49 #include "pm.h"
50 #include "control.h"
52 #define CONFIG_DISABLE_HFCLK 1
54 #define SDP3430_TS_GPIO_IRQ_SDPV1 3
55 #define SDP3430_TS_GPIO_IRQ_SDPV2 2
57 #define ENABLE_VAUX3_DEDICATED 0x03
58 #define ENABLE_VAUX3_DEV_GRP 0x20
60 #define TWL4030_MSECURE_GPIO 22
62 /* FIXME: These values need to be updated based on more profiling on 3430sdp*/
63 static struct cpuidle_params omap3_cpuidle_params_table[] = {
64 /* C1 */
65 {1, 2, 2, 5},
66 /* C2 */
67 {1, 10, 10, 30},
68 /* C3 */
69 {1, 50, 50, 300},
70 /* C4 */
71 {1, 1500, 1800, 4000},
72 /* C5 */
73 {1, 2500, 7500, 12000},
74 /* C6 */
75 {1, 3000, 8500, 15000},
76 /* C7 */
77 {1, 10000, 30000, 300000},
80 static uint32_t board_keymap[] = {
81 KEY(0, 0, KEY_LEFT),
82 KEY(0, 1, KEY_RIGHT),
83 KEY(0, 2, KEY_A),
84 KEY(0, 3, KEY_B),
85 KEY(0, 4, KEY_C),
86 KEY(1, 0, KEY_DOWN),
87 KEY(1, 1, KEY_UP),
88 KEY(1, 2, KEY_E),
89 KEY(1, 3, KEY_F),
90 KEY(1, 4, KEY_G),
91 KEY(2, 0, KEY_ENTER),
92 KEY(2, 1, KEY_I),
93 KEY(2, 2, KEY_J),
94 KEY(2, 3, KEY_K),
95 KEY(2, 4, KEY_3),
96 KEY(3, 0, KEY_M),
97 KEY(3, 1, KEY_N),
98 KEY(3, 2, KEY_O),
99 KEY(3, 3, KEY_P),
100 KEY(3, 4, KEY_Q),
101 KEY(4, 0, KEY_R),
102 KEY(4, 1, KEY_4),
103 KEY(4, 2, KEY_T),
104 KEY(4, 3, KEY_U),
105 KEY(4, 4, KEY_D),
106 KEY(5, 0, KEY_V),
107 KEY(5, 1, KEY_W),
108 KEY(5, 2, KEY_L),
109 KEY(5, 3, KEY_S),
110 KEY(5, 4, KEY_H),
114 static struct matrix_keymap_data board_map_data = {
115 .keymap = board_keymap,
116 .keymap_size = ARRAY_SIZE(board_keymap),
119 static struct twl4030_keypad_data sdp3430_kp_data = {
120 .keymap_data = &board_map_data,
121 .rows = 5,
122 .cols = 6,
123 .rep = 1,
126 static int ts_gpio; /* Needed for ads7846_get_pendown_state */
129 * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
131 * @return - void. If request gpio fails then Flag KERN_ERR.
133 static void ads7846_dev_init(void)
135 if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) {
136 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
137 return;
140 gpio_direction_input(ts_gpio);
141 gpio_set_debounce(ts_gpio, 310);
144 static int ads7846_get_pendown_state(void)
146 return !gpio_get_value(ts_gpio);
149 static struct ads7846_platform_data tsc2046_config __initdata = {
150 .get_pendown_state = ads7846_get_pendown_state,
151 .keep_vref_on = 1,
152 .wakeup = true,
156 static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
157 .turbo_mode = 0,
158 .single_channel = 1, /* 0: slave, 1: master */
161 static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
162 [0] = {
164 * TSC2046 operates at a max freqency of 2MHz, so
165 * operate slightly below at 1.5MHz
167 .modalias = "ads7846",
168 .bus_num = 1,
169 .chip_select = 0,
170 .max_speed_hz = 1500000,
171 .controller_data = &tsc2046_mcspi_config,
172 .irq = 0,
173 .platform_data = &tsc2046_config,
178 #define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
179 #define SDP3430_LCD_PANEL_ENABLE_GPIO 5
181 static unsigned backlight_gpio;
182 static unsigned enable_gpio;
183 static int lcd_enabled;
184 static int dvi_enabled;
186 static void __init sdp3430_display_init(void)
188 int r;
190 enable_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO;
191 backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
193 r = gpio_request(enable_gpio, "LCD reset");
194 if (r) {
195 printk(KERN_ERR "failed to get LCD reset GPIO\n");
196 goto err0;
199 r = gpio_request(backlight_gpio, "LCD Backlight");
200 if (r) {
201 printk(KERN_ERR "failed to get LCD backlight GPIO\n");
202 goto err1;
205 gpio_direction_output(enable_gpio, 0);
206 gpio_direction_output(backlight_gpio, 0);
208 return;
209 err1:
210 gpio_free(enable_gpio);
211 err0:
212 return;
215 static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
217 if (dvi_enabled) {
218 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
219 return -EINVAL;
222 gpio_direction_output(enable_gpio, 1);
223 gpio_direction_output(backlight_gpio, 1);
225 lcd_enabled = 1;
227 return 0;
230 static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
232 lcd_enabled = 0;
234 gpio_direction_output(enable_gpio, 0);
235 gpio_direction_output(backlight_gpio, 0);
238 static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
240 if (lcd_enabled) {
241 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
242 return -EINVAL;
245 dvi_enabled = 1;
247 return 0;
250 static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev)
252 dvi_enabled = 0;
255 static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
257 return 0;
260 static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
265 static struct omap_dss_device sdp3430_lcd_device = {
266 .name = "lcd",
267 .driver_name = "sharp_ls_panel",
268 .type = OMAP_DISPLAY_TYPE_DPI,
269 .phy.dpi.data_lines = 16,
270 .platform_enable = sdp3430_panel_enable_lcd,
271 .platform_disable = sdp3430_panel_disable_lcd,
274 static struct panel_generic_dpi_data dvi_panel = {
275 .name = "generic",
276 .platform_enable = sdp3430_panel_enable_dvi,
277 .platform_disable = sdp3430_panel_disable_dvi,
280 static struct omap_dss_device sdp3430_dvi_device = {
281 .name = "dvi",
282 .type = OMAP_DISPLAY_TYPE_DPI,
283 .driver_name = "generic_dpi_panel",
284 .data = &dvi_panel,
285 .phy.dpi.data_lines = 24,
288 static struct omap_dss_device sdp3430_tv_device = {
289 .name = "tv",
290 .driver_name = "venc",
291 .type = OMAP_DISPLAY_TYPE_VENC,
292 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
293 .platform_enable = sdp3430_panel_enable_tv,
294 .platform_disable = sdp3430_panel_disable_tv,
298 static struct omap_dss_device *sdp3430_dss_devices[] = {
299 &sdp3430_lcd_device,
300 &sdp3430_dvi_device,
301 &sdp3430_tv_device,
304 static struct omap_dss_board_info sdp3430_dss_data = {
305 .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
306 .devices = sdp3430_dss_devices,
307 .default_device = &sdp3430_lcd_device,
310 static struct omap_board_config_kernel sdp3430_config[] __initdata = {
313 static void __init omap_3430sdp_init_early(void)
315 omap2_init_common_infrastructure();
316 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
319 static int sdp3430_batt_table[] = {
320 /* 0 C*/
321 30800, 29500, 28300, 27100,
322 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
323 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
324 11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
325 8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
326 5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
327 4040, 3910, 3790, 3670, 3550
330 static struct twl4030_bci_platform_data sdp3430_bci_data = {
331 .battery_tmp_tbl = sdp3430_batt_table,
332 .tblsize = ARRAY_SIZE(sdp3430_batt_table),
335 static struct omap2_hsmmc_info mmc[] = {
337 .mmc = 1,
338 /* 8 bits (default) requires S6.3 == ON,
339 * so the SIM card isn't used; else 4 bits.
341 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
342 .gpio_wp = 4,
345 .mmc = 2,
346 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
347 .gpio_wp = 7,
349 {} /* Terminator */
352 static int sdp3430_twl_gpio_setup(struct device *dev,
353 unsigned gpio, unsigned ngpio)
355 /* gpio + 0 is "mmc0_cd" (input/IRQ),
356 * gpio + 1 is "mmc1_cd" (input/IRQ)
358 mmc[0].gpio_cd = gpio + 0;
359 mmc[1].gpio_cd = gpio + 1;
360 omap2_hsmmc_init(mmc);
362 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
363 gpio_request(gpio + 7, "sub_lcd_en_bkl");
364 gpio_direction_output(gpio + 7, 0);
366 /* gpio + 15 is "sub_lcd_nRST" (output) */
367 gpio_request(gpio + 15, "sub_lcd_nRST");
368 gpio_direction_output(gpio + 15, 0);
370 return 0;
373 static struct twl4030_gpio_platform_data sdp3430_gpio_data = {
374 .gpio_base = OMAP_MAX_GPIO_LINES,
375 .irq_base = TWL4030_GPIO_IRQ_BASE,
376 .irq_end = TWL4030_GPIO_IRQ_END,
377 .pulldowns = BIT(2) | BIT(6) | BIT(8) | BIT(13)
378 | BIT(16) | BIT(17),
379 .setup = sdp3430_twl_gpio_setup,
382 static struct twl4030_usb_data sdp3430_usb_data = {
383 .usb_mode = T2_USB_MODE_ULPI,
386 static struct twl4030_madc_platform_data sdp3430_madc_data = {
387 .irq_line = 1,
390 /* regulator consumer mappings */
392 /* ads7846 on SPI */
393 static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = {
394 REGULATOR_SUPPLY("vcc", "spi1.0"),
397 static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
398 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
401 /* VPLL2 for digital video outputs */
402 static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
403 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
404 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
407 static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
408 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
411 static struct regulator_consumer_supply sdp3430_vsim_supplies[] = {
412 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
415 static struct regulator_consumer_supply sdp3430_vmmc2_supplies[] = {
416 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
420 * Apply all the fixed voltages since most versions of U-Boot
421 * don't bother with that initialization.
424 /* VAUX1 for mainboard (irda and sub-lcd) */
425 static struct regulator_init_data sdp3430_vaux1 = {
426 .constraints = {
427 .min_uV = 2800000,
428 .max_uV = 2800000,
429 .apply_uV = true,
430 .valid_modes_mask = REGULATOR_MODE_NORMAL
431 | REGULATOR_MODE_STANDBY,
432 .valid_ops_mask = REGULATOR_CHANGE_MODE
433 | REGULATOR_CHANGE_STATUS,
437 /* VAUX2 for camera module */
438 static struct regulator_init_data sdp3430_vaux2 = {
439 .constraints = {
440 .min_uV = 2800000,
441 .max_uV = 2800000,
442 .apply_uV = true,
443 .valid_modes_mask = REGULATOR_MODE_NORMAL
444 | REGULATOR_MODE_STANDBY,
445 .valid_ops_mask = REGULATOR_CHANGE_MODE
446 | REGULATOR_CHANGE_STATUS,
450 /* VAUX3 for LCD board */
451 static struct regulator_init_data sdp3430_vaux3 = {
452 .constraints = {
453 .min_uV = 2800000,
454 .max_uV = 2800000,
455 .apply_uV = true,
456 .valid_modes_mask = REGULATOR_MODE_NORMAL
457 | REGULATOR_MODE_STANDBY,
458 .valid_ops_mask = REGULATOR_CHANGE_MODE
459 | REGULATOR_CHANGE_STATUS,
461 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vaux3_supplies),
462 .consumer_supplies = sdp3430_vaux3_supplies,
465 /* VAUX4 for OMAP VDD_CSI2 (camera) */
466 static struct regulator_init_data sdp3430_vaux4 = {
467 .constraints = {
468 .min_uV = 1800000,
469 .max_uV = 1800000,
470 .apply_uV = true,
471 .valid_modes_mask = REGULATOR_MODE_NORMAL
472 | REGULATOR_MODE_STANDBY,
473 .valid_ops_mask = REGULATOR_CHANGE_MODE
474 | REGULATOR_CHANGE_STATUS,
478 /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
479 static struct regulator_init_data sdp3430_vmmc1 = {
480 .constraints = {
481 .min_uV = 1850000,
482 .max_uV = 3150000,
483 .valid_modes_mask = REGULATOR_MODE_NORMAL
484 | REGULATOR_MODE_STANDBY,
485 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
486 | REGULATOR_CHANGE_MODE
487 | REGULATOR_CHANGE_STATUS,
489 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc1_supplies),
490 .consumer_supplies = sdp3430_vmmc1_supplies,
493 /* VMMC2 for MMC2 card */
494 static struct regulator_init_data sdp3430_vmmc2 = {
495 .constraints = {
496 .min_uV = 1850000,
497 .max_uV = 1850000,
498 .apply_uV = true,
499 .valid_modes_mask = REGULATOR_MODE_NORMAL
500 | REGULATOR_MODE_STANDBY,
501 .valid_ops_mask = REGULATOR_CHANGE_MODE
502 | REGULATOR_CHANGE_STATUS,
504 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc2_supplies),
505 .consumer_supplies = sdp3430_vmmc2_supplies,
508 /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
509 static struct regulator_init_data sdp3430_vsim = {
510 .constraints = {
511 .min_uV = 1800000,
512 .max_uV = 3000000,
513 .valid_modes_mask = REGULATOR_MODE_NORMAL
514 | REGULATOR_MODE_STANDBY,
515 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
516 | REGULATOR_CHANGE_MODE
517 | REGULATOR_CHANGE_STATUS,
519 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vsim_supplies),
520 .consumer_supplies = sdp3430_vsim_supplies,
523 /* VDAC for DSS driving S-Video */
524 static struct regulator_init_data sdp3430_vdac = {
525 .constraints = {
526 .min_uV = 1800000,
527 .max_uV = 1800000,
528 .apply_uV = true,
529 .valid_modes_mask = REGULATOR_MODE_NORMAL
530 | REGULATOR_MODE_STANDBY,
531 .valid_ops_mask = REGULATOR_CHANGE_MODE
532 | REGULATOR_CHANGE_STATUS,
534 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vdda_dac_supplies),
535 .consumer_supplies = sdp3430_vdda_dac_supplies,
538 static struct regulator_init_data sdp3430_vpll2 = {
539 .constraints = {
540 .name = "VDVI",
541 .min_uV = 1800000,
542 .max_uV = 1800000,
543 .apply_uV = true,
544 .valid_modes_mask = REGULATOR_MODE_NORMAL
545 | REGULATOR_MODE_STANDBY,
546 .valid_ops_mask = REGULATOR_CHANGE_MODE
547 | REGULATOR_CHANGE_STATUS,
549 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vpll2_supplies),
550 .consumer_supplies = sdp3430_vpll2_supplies,
553 static struct twl4030_codec_audio_data sdp3430_audio;
555 static struct twl4030_codec_data sdp3430_codec = {
556 .audio_mclk = 26000000,
557 .audio = &sdp3430_audio,
560 static struct twl4030_platform_data sdp3430_twldata = {
561 .irq_base = TWL4030_IRQ_BASE,
562 .irq_end = TWL4030_IRQ_END,
564 /* platform_data for children goes here */
565 .bci = &sdp3430_bci_data,
566 .gpio = &sdp3430_gpio_data,
567 .madc = &sdp3430_madc_data,
568 .keypad = &sdp3430_kp_data,
569 .usb = &sdp3430_usb_data,
570 .codec = &sdp3430_codec,
572 .vaux1 = &sdp3430_vaux1,
573 .vaux2 = &sdp3430_vaux2,
574 .vaux3 = &sdp3430_vaux3,
575 .vaux4 = &sdp3430_vaux4,
576 .vmmc1 = &sdp3430_vmmc1,
577 .vmmc2 = &sdp3430_vmmc2,
578 .vsim = &sdp3430_vsim,
579 .vdac = &sdp3430_vdac,
580 .vpll2 = &sdp3430_vpll2,
583 static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
585 I2C_BOARD_INFO("twl4030", 0x48),
586 .flags = I2C_CLIENT_WAKE,
587 .irq = INT_34XX_SYS_NIRQ,
588 .platform_data = &sdp3430_twldata,
592 static int __init omap3430_i2c_init(void)
594 /* i2c1 for PMIC only */
595 omap_register_i2c_bus(1, 2600, sdp3430_i2c_boardinfo,
596 ARRAY_SIZE(sdp3430_i2c_boardinfo));
597 /* i2c2 on camera connector (for sensor control) and optional isp1301 */
598 omap_register_i2c_bus(2, 400, NULL, 0);
599 /* i2c3 on display connector (for DVI, tfp410) */
600 omap_register_i2c_bus(3, 400, NULL, 0);
601 return 0;
604 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
606 static struct omap_smc91x_platform_data board_smc91x_data = {
607 .cs = 3,
608 .flags = GPMC_MUX_ADD_DATA | GPMC_TIMINGS_SMC91C96 |
609 IORESOURCE_IRQ_LOWLEVEL,
612 static void __init board_smc91x_init(void)
614 if (omap_rev() > OMAP3430_REV_ES1_0)
615 board_smc91x_data.gpio_irq = 6;
616 else
617 board_smc91x_data.gpio_irq = 29;
619 gpmc_smc91x_init(&board_smc91x_data);
622 #else
624 static inline void board_smc91x_init(void)
628 #endif
630 static void enable_board_wakeup_source(void)
632 /* T2 interrupt line (keypad) */
633 omap_mux_init_signal("sys_nirq",
634 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
637 static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
639 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
640 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
641 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
643 .phy_reset = true,
644 .reset_gpio_port[0] = 57,
645 .reset_gpio_port[1] = 61,
646 .reset_gpio_port[2] = -EINVAL
649 #ifdef CONFIG_OMAP_MUX
650 static struct omap_board_mux board_mux[] __initdata = {
651 { .reg_offset = OMAP_MUX_TERMINATOR },
654 static struct omap_device_pad serial1_pads[] __initdata = {
656 * Note that off output enable is an active low
657 * signal. So setting this means pin is a
658 * input enabled in off mode
660 OMAP_MUX_STATIC("uart1_cts.uart1_cts",
661 OMAP_PIN_INPUT |
662 OMAP_PIN_OFF_INPUT_PULLDOWN |
663 OMAP_OFFOUT_EN |
664 OMAP_MUX_MODE0),
665 OMAP_MUX_STATIC("uart1_rts.uart1_rts",
666 OMAP_PIN_OUTPUT |
667 OMAP_OFF_EN |
668 OMAP_MUX_MODE0),
669 OMAP_MUX_STATIC("uart1_rx.uart1_rx",
670 OMAP_PIN_INPUT |
671 OMAP_PIN_OFF_INPUT_PULLDOWN |
672 OMAP_OFFOUT_EN |
673 OMAP_MUX_MODE0),
674 OMAP_MUX_STATIC("uart1_tx.uart1_tx",
675 OMAP_PIN_OUTPUT |
676 OMAP_OFF_EN |
677 OMAP_MUX_MODE0),
680 static struct omap_device_pad serial2_pads[] __initdata = {
681 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
682 OMAP_PIN_INPUT_PULLUP |
683 OMAP_PIN_OFF_INPUT_PULLDOWN |
684 OMAP_OFFOUT_EN |
685 OMAP_MUX_MODE0),
686 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
687 OMAP_PIN_OUTPUT |
688 OMAP_OFF_EN |
689 OMAP_MUX_MODE0),
690 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
691 OMAP_PIN_INPUT |
692 OMAP_PIN_OFF_INPUT_PULLDOWN |
693 OMAP_OFFOUT_EN |
694 OMAP_MUX_MODE0),
695 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
696 OMAP_PIN_OUTPUT |
697 OMAP_OFF_EN |
698 OMAP_MUX_MODE0),
701 static struct omap_device_pad serial3_pads[] __initdata = {
702 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
703 OMAP_PIN_INPUT_PULLDOWN |
704 OMAP_PIN_OFF_INPUT_PULLDOWN |
705 OMAP_OFFOUT_EN |
706 OMAP_MUX_MODE0),
707 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
708 OMAP_PIN_OUTPUT |
709 OMAP_OFF_EN |
710 OMAP_MUX_MODE0),
711 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
712 OMAP_PIN_INPUT |
713 OMAP_PIN_OFF_INPUT_PULLDOWN |
714 OMAP_OFFOUT_EN |
715 OMAP_MUX_MODE0),
716 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
717 OMAP_PIN_OUTPUT |
718 OMAP_OFF_EN |
719 OMAP_MUX_MODE0),
722 static struct omap_board_data serial1_data = {
723 .id = 0,
724 .pads = serial1_pads,
725 .pads_cnt = ARRAY_SIZE(serial1_pads),
728 static struct omap_board_data serial2_data = {
729 .id = 1,
730 .pads = serial2_pads,
731 .pads_cnt = ARRAY_SIZE(serial2_pads),
734 static struct omap_board_data serial3_data = {
735 .id = 2,
736 .pads = serial3_pads,
737 .pads_cnt = ARRAY_SIZE(serial3_pads),
740 static inline void board_serial_init(void)
742 omap_serial_init_port(&serial1_data);
743 omap_serial_init_port(&serial2_data);
744 omap_serial_init_port(&serial3_data);
746 #else
747 #define board_mux NULL
749 static inline void board_serial_init(void)
751 omap_serial_init();
753 #endif
756 * SDP3430 V2 Board CS organization
757 * Different from SDP3430 V1. Now 4 switches used to specify CS
759 * See also the Switch S8 settings in the comments.
761 static char chip_sel_3430[][GPMC_CS_NUM] = {
762 {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
763 {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
764 {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
767 static struct mtd_partition sdp_nor_partitions[] = {
768 /* bootloader (U-Boot, etc) in first sector */
770 .name = "Bootloader-NOR",
771 .offset = 0,
772 .size = SZ_256K,
773 .mask_flags = MTD_WRITEABLE, /* force read-only */
775 /* bootloader params in the next sector */
777 .name = "Params-NOR",
778 .offset = MTDPART_OFS_APPEND,
779 .size = SZ_256K,
780 .mask_flags = 0,
782 /* kernel */
784 .name = "Kernel-NOR",
785 .offset = MTDPART_OFS_APPEND,
786 .size = SZ_2M,
787 .mask_flags = 0
789 /* file system */
791 .name = "Filesystem-NOR",
792 .offset = MTDPART_OFS_APPEND,
793 .size = MTDPART_SIZ_FULL,
794 .mask_flags = 0
798 static struct mtd_partition sdp_onenand_partitions[] = {
800 .name = "X-Loader-OneNAND",
801 .offset = 0,
802 .size = 4 * (64 * 2048),
803 .mask_flags = MTD_WRITEABLE /* force read-only */
806 .name = "U-Boot-OneNAND",
807 .offset = MTDPART_OFS_APPEND,
808 .size = 2 * (64 * 2048),
809 .mask_flags = MTD_WRITEABLE /* force read-only */
812 .name = "U-Boot Environment-OneNAND",
813 .offset = MTDPART_OFS_APPEND,
814 .size = 1 * (64 * 2048),
817 .name = "Kernel-OneNAND",
818 .offset = MTDPART_OFS_APPEND,
819 .size = 16 * (64 * 2048),
822 .name = "File System-OneNAND",
823 .offset = MTDPART_OFS_APPEND,
824 .size = MTDPART_SIZ_FULL,
828 static struct mtd_partition sdp_nand_partitions[] = {
829 /* All the partition sizes are listed in terms of NAND block size */
831 .name = "X-Loader-NAND",
832 .offset = 0,
833 .size = 4 * (64 * 2048),
834 .mask_flags = MTD_WRITEABLE, /* force read-only */
837 .name = "U-Boot-NAND",
838 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
839 .size = 10 * (64 * 2048),
840 .mask_flags = MTD_WRITEABLE, /* force read-only */
843 .name = "Boot Env-NAND",
845 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
846 .size = 6 * (64 * 2048),
849 .name = "Kernel-NAND",
850 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
851 .size = 40 * (64 * 2048),
854 .name = "File System - NAND",
855 .size = MTDPART_SIZ_FULL,
856 .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
860 static struct flash_partitions sdp_flash_partitions[] = {
862 .parts = sdp_nor_partitions,
863 .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
866 .parts = sdp_onenand_partitions,
867 .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
870 .parts = sdp_nand_partitions,
871 .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
875 static struct omap_musb_board_data musb_board_data = {
876 .interface_type = MUSB_INTERFACE_ULPI,
877 .mode = MUSB_OTG,
878 .power = 100,
881 static void __init omap_3430sdp_init(void)
883 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
884 omap_board_config = sdp3430_config;
885 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
886 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
887 omap3430_i2c_init();
888 omap_display_init(&sdp3430_dss_data);
889 if (omap_rev() > OMAP3430_REV_ES1_0)
890 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
891 else
892 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV1;
893 sdp3430_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
894 spi_register_board_info(sdp3430_spi_board_info,
895 ARRAY_SIZE(sdp3430_spi_board_info));
896 ads7846_dev_init();
897 board_serial_init();
898 usb_musb_init(&musb_board_data);
899 board_smc91x_init();
900 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
901 sdp3430_display_init();
902 enable_board_wakeup_source();
903 usbhs_init(&usbhs_bdata);
906 MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
907 /* Maintainer: Syed Khasim - Texas Instruments Inc */
908 .boot_params = 0x80000100,
909 .reserve = omap_reserve,
910 .map_io = omap3_map_io,
911 .init_early = omap_3430sdp_init_early,
912 .init_irq = omap_init_irq,
913 .init_machine = omap_3430sdp_init,
914 .timer = &omap_timer,
915 MACHINE_END