ARM: 7409/1: Do not call flush_cache_user_range with mmap_sem held
[linux/fpc-iii.git] / arch / arm / mach-omap2 / board-4430sdp.c
blob14a5971d0d48792ed75793e23b6deed54137560d
1 /*
2 * Board support file for OMAP4430 SDP.
4 * Copyright (C) 2009 Texas Instruments
6 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
8 * Based on mach-omap2/board-3430sdp.c
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/io.h>
19 #include <linux/gpio.h>
20 #include <linux/usb/otg.h>
21 #include <linux/spi/spi.h>
22 #include <linux/i2c/twl.h>
23 #include <linux/gpio_keys.h>
24 #include <linux/regulator/machine.h>
25 #include <linux/leds.h>
26 #include <linux/leds_pwm.h>
28 #include <mach/hardware.h>
29 #include <mach/omap4-common.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/map.h>
34 #include <plat/board.h>
35 #include <plat/common.h>
36 #include <plat/usb.h>
37 #include <plat/mmc.h>
38 #include <plat/omap4-keypad.h>
39 #include <video/omapdss.h>
41 #include "mux.h"
42 #include "hsmmc.h"
43 #include "timer-gp.h"
44 #include "control.h"
45 #include "common-board-devices.h"
47 #define ETH_KS8851_IRQ 34
48 #define ETH_KS8851_POWER_ON 48
49 #define ETH_KS8851_QUART 138
50 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
51 #define OMAP4_SFH7741_ENABLE_GPIO 188
52 #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
53 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
54 #define HDMI_GPIO_HPD 63 /* Hotplug detect */
56 static const int sdp4430_keymap[] = {
57 KEY(0, 0, KEY_E),
58 KEY(0, 1, KEY_R),
59 KEY(0, 2, KEY_T),
60 KEY(0, 3, KEY_HOME),
61 KEY(0, 4, KEY_F5),
62 KEY(0, 5, KEY_UNKNOWN),
63 KEY(0, 6, KEY_I),
64 KEY(0, 7, KEY_LEFTSHIFT),
66 KEY(1, 0, KEY_D),
67 KEY(1, 1, KEY_F),
68 KEY(1, 2, KEY_G),
69 KEY(1, 3, KEY_SEND),
70 KEY(1, 4, KEY_F6),
71 KEY(1, 5, KEY_UNKNOWN),
72 KEY(1, 6, KEY_K),
73 KEY(1, 7, KEY_ENTER),
75 KEY(2, 0, KEY_X),
76 KEY(2, 1, KEY_C),
77 KEY(2, 2, KEY_V),
78 KEY(2, 3, KEY_END),
79 KEY(2, 4, KEY_F7),
80 KEY(2, 5, KEY_UNKNOWN),
81 KEY(2, 6, KEY_DOT),
82 KEY(2, 7, KEY_CAPSLOCK),
84 KEY(3, 0, KEY_Z),
85 KEY(3, 1, KEY_KPPLUS),
86 KEY(3, 2, KEY_B),
87 KEY(3, 3, KEY_F1),
88 KEY(3, 4, KEY_F8),
89 KEY(3, 5, KEY_UNKNOWN),
90 KEY(3, 6, KEY_O),
91 KEY(3, 7, KEY_SPACE),
93 KEY(4, 0, KEY_W),
94 KEY(4, 1, KEY_Y),
95 KEY(4, 2, KEY_U),
96 KEY(4, 3, KEY_F2),
97 KEY(4, 4, KEY_VOLUMEUP),
98 KEY(4, 5, KEY_UNKNOWN),
99 KEY(4, 6, KEY_L),
100 KEY(4, 7, KEY_LEFT),
102 KEY(5, 0, KEY_S),
103 KEY(5, 1, KEY_H),
104 KEY(5, 2, KEY_J),
105 KEY(5, 3, KEY_F3),
106 KEY(5, 4, KEY_F9),
107 KEY(5, 5, KEY_VOLUMEDOWN),
108 KEY(5, 6, KEY_M),
109 KEY(5, 7, KEY_RIGHT),
111 KEY(6, 0, KEY_Q),
112 KEY(6, 1, KEY_A),
113 KEY(6, 2, KEY_N),
114 KEY(6, 3, KEY_BACK),
115 KEY(6, 4, KEY_BACKSPACE),
116 KEY(6, 5, KEY_UNKNOWN),
117 KEY(6, 6, KEY_P),
118 KEY(6, 7, KEY_UP),
120 KEY(7, 0, KEY_PROG1),
121 KEY(7, 1, KEY_PROG2),
122 KEY(7, 2, KEY_PROG3),
123 KEY(7, 3, KEY_PROG4),
124 KEY(7, 4, KEY_F4),
125 KEY(7, 5, KEY_UNKNOWN),
126 KEY(7, 6, KEY_OK),
127 KEY(7, 7, KEY_DOWN),
130 static struct matrix_keymap_data sdp4430_keymap_data = {
131 .keymap = sdp4430_keymap,
132 .keymap_size = ARRAY_SIZE(sdp4430_keymap),
135 static struct omap4_keypad_platform_data sdp4430_keypad_data = {
136 .keymap_data = &sdp4430_keymap_data,
137 .rows = 8,
138 .cols = 8,
140 static struct gpio_led sdp4430_gpio_leds[] = {
142 .name = "omap4:green:debug0",
143 .gpio = 61,
146 .name = "omap4:green:debug1",
147 .gpio = 30,
150 .name = "omap4:green:debug2",
151 .gpio = 7,
154 .name = "omap4:green:debug3",
155 .gpio = 8,
158 .name = "omap4:green:debug4",
159 .gpio = 50,
162 .name = "omap4:blue:user",
163 .gpio = 169,
166 .name = "omap4:red:user",
167 .gpio = 170,
170 .name = "omap4:green:user",
171 .gpio = 139,
176 static struct gpio_keys_button sdp4430_gpio_keys[] = {
178 .desc = "Proximity Sensor",
179 .type = EV_SW,
180 .code = SW_FRONT_PROXIMITY,
181 .gpio = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO,
182 .active_low = 0,
186 static struct gpio_led_platform_data sdp4430_led_data = {
187 .leds = sdp4430_gpio_leds,
188 .num_leds = ARRAY_SIZE(sdp4430_gpio_leds),
191 static struct led_pwm sdp4430_pwm_leds[] = {
193 .name = "omap4:green:chrg",
194 .pwm_id = 1,
195 .max_brightness = 255,
196 .pwm_period_ns = 7812500,
200 static struct led_pwm_platform_data sdp4430_pwm_data = {
201 .num_leds = ARRAY_SIZE(sdp4430_pwm_leds),
202 .leds = sdp4430_pwm_leds,
205 static struct platform_device sdp4430_leds_pwm = {
206 .name = "leds_pwm",
207 .id = -1,
208 .dev = {
209 .platform_data = &sdp4430_pwm_data,
213 static int omap_prox_activate(struct device *dev)
215 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
216 return 0;
219 static void omap_prox_deactivate(struct device *dev)
221 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0);
224 static struct gpio_keys_platform_data sdp4430_gpio_keys_data = {
225 .buttons = sdp4430_gpio_keys,
226 .nbuttons = ARRAY_SIZE(sdp4430_gpio_keys),
227 .enable = omap_prox_activate,
228 .disable = omap_prox_deactivate,
231 static struct platform_device sdp4430_gpio_keys_device = {
232 .name = "gpio-keys",
233 .id = -1,
234 .dev = {
235 .platform_data = &sdp4430_gpio_keys_data,
239 static struct platform_device sdp4430_leds_gpio = {
240 .name = "leds-gpio",
241 .id = -1,
242 .dev = {
243 .platform_data = &sdp4430_led_data,
246 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
248 .modalias = "ks8851",
249 .bus_num = 1,
250 .chip_select = 0,
251 .max_speed_hz = 24000000,
252 .irq = ETH_KS8851_IRQ,
256 static struct gpio sdp4430_eth_gpios[] __initdata = {
257 { ETH_KS8851_POWER_ON, GPIOF_OUT_INIT_HIGH, "eth_power" },
258 { ETH_KS8851_QUART, GPIOF_OUT_INIT_HIGH, "quart" },
259 { ETH_KS8851_IRQ, GPIOF_IN, "eth_irq" },
262 static int __init omap_ethernet_init(void)
264 int status;
266 /* Request of GPIO lines */
267 status = gpio_request_array(sdp4430_eth_gpios,
268 ARRAY_SIZE(sdp4430_eth_gpios));
269 if (status)
270 pr_err("Cannot request ETH GPIOs\n");
272 return status;
275 static struct platform_device sdp4430_lcd_device = {
276 .name = "sdp4430_lcd",
277 .id = -1,
280 static struct platform_device *sdp4430_devices[] __initdata = {
281 &sdp4430_lcd_device,
282 &sdp4430_gpio_keys_device,
283 &sdp4430_leds_gpio,
284 &sdp4430_leds_pwm,
287 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
288 .ctrl_name = "internal",
291 static struct omap_board_config_kernel sdp4430_config[] __initdata = {
292 { OMAP_TAG_LCD, &sdp4430_lcd_config },
295 static void __init omap_4430sdp_init_early(void)
297 omap2_init_common_infrastructure();
298 omap2_init_common_devices(NULL, NULL);
299 #ifdef CONFIG_OMAP_32K_TIMER
300 omap2_gp_clockevent_set_gptimer(1);
301 #endif
304 static struct omap_musb_board_data musb_board_data = {
305 .interface_type = MUSB_INTERFACE_UTMI,
306 .mode = MUSB_OTG,
307 .power = 100,
310 static struct twl4030_usb_data omap4_usbphy_data = {
311 .phy_init = omap4430_phy_init,
312 .phy_exit = omap4430_phy_exit,
313 .phy_power = omap4430_phy_power,
314 .phy_set_clock = omap4430_phy_set_clk,
315 .phy_suspend = omap4430_phy_suspend,
318 static struct omap2_hsmmc_info mmc[] = {
320 .mmc = 2,
321 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
322 .gpio_cd = -EINVAL,
323 .gpio_wp = -EINVAL,
324 .nonremovable = true,
325 .ocr_mask = MMC_VDD_29_30,
326 .no_off_init = true,
329 .mmc = 1,
330 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
331 .gpio_wp = -EINVAL,
333 {} /* Terminator */
336 static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
338 .supply = "vmmc",
339 .dev_name = "omap_hsmmc.1",
342 static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
344 .supply = "vmmc",
345 .dev_name = "omap_hsmmc.0",
349 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
351 int ret = 0;
352 struct platform_device *pdev = container_of(dev,
353 struct platform_device, dev);
354 struct omap_mmc_platform_data *pdata = dev->platform_data;
356 /* Setting MMC1 Card detect Irq */
357 if (pdev->id == 0) {
358 ret = twl6030_mmc_card_detect_config();
359 if (ret)
360 pr_err("Failed configuring MMC1 card detect\n");
361 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
362 MMCDETECT_INTR_OFFSET;
363 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
365 return ret;
368 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
370 struct omap_mmc_platform_data *pdata;
372 /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
373 if (!dev) {
374 pr_err("Failed %s\n", __func__);
375 return;
377 pdata = dev->platform_data;
378 pdata->init = omap4_twl6030_hsmmc_late_init;
381 static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
383 struct omap2_hsmmc_info *c;
385 omap2_hsmmc_init(controllers);
386 for (c = controllers; c->mmc; c++)
387 omap4_twl6030_hsmmc_set_late_init(c->dev);
389 return 0;
392 static struct regulator_init_data sdp4430_vaux1 = {
393 .constraints = {
394 .min_uV = 1000000,
395 .max_uV = 3000000,
396 .apply_uV = true,
397 .valid_modes_mask = REGULATOR_MODE_NORMAL
398 | REGULATOR_MODE_STANDBY,
399 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
400 | REGULATOR_CHANGE_MODE
401 | REGULATOR_CHANGE_STATUS,
403 .num_consumer_supplies = 1,
404 .consumer_supplies = sdp4430_vaux_supply,
407 static struct regulator_init_data sdp4430_vaux2 = {
408 .constraints = {
409 .min_uV = 1200000,
410 .max_uV = 2800000,
411 .apply_uV = true,
412 .valid_modes_mask = REGULATOR_MODE_NORMAL
413 | REGULATOR_MODE_STANDBY,
414 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
415 | REGULATOR_CHANGE_MODE
416 | REGULATOR_CHANGE_STATUS,
420 static struct regulator_init_data sdp4430_vaux3 = {
421 .constraints = {
422 .min_uV = 1000000,
423 .max_uV = 3000000,
424 .apply_uV = true,
425 .valid_modes_mask = REGULATOR_MODE_NORMAL
426 | REGULATOR_MODE_STANDBY,
427 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
428 | REGULATOR_CHANGE_MODE
429 | REGULATOR_CHANGE_STATUS,
433 /* VMMC1 for MMC1 card */
434 static struct regulator_init_data sdp4430_vmmc = {
435 .constraints = {
436 .min_uV = 1200000,
437 .max_uV = 3000000,
438 .apply_uV = true,
439 .valid_modes_mask = REGULATOR_MODE_NORMAL
440 | REGULATOR_MODE_STANDBY,
441 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
442 | REGULATOR_CHANGE_MODE
443 | REGULATOR_CHANGE_STATUS,
445 .num_consumer_supplies = 1,
446 .consumer_supplies = sdp4430_vmmc_supply,
449 static struct regulator_init_data sdp4430_vpp = {
450 .constraints = {
451 .min_uV = 1800000,
452 .max_uV = 2500000,
453 .apply_uV = true,
454 .valid_modes_mask = REGULATOR_MODE_NORMAL
455 | REGULATOR_MODE_STANDBY,
456 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
457 | REGULATOR_CHANGE_MODE
458 | REGULATOR_CHANGE_STATUS,
462 static struct regulator_init_data sdp4430_vusim = {
463 .constraints = {
464 .min_uV = 1200000,
465 .max_uV = 2900000,
466 .apply_uV = true,
467 .valid_modes_mask = REGULATOR_MODE_NORMAL
468 | REGULATOR_MODE_STANDBY,
469 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
470 | REGULATOR_CHANGE_MODE
471 | REGULATOR_CHANGE_STATUS,
475 static struct regulator_init_data sdp4430_vana = {
476 .constraints = {
477 .min_uV = 2100000,
478 .max_uV = 2100000,
479 .valid_modes_mask = REGULATOR_MODE_NORMAL
480 | REGULATOR_MODE_STANDBY,
481 .valid_ops_mask = REGULATOR_CHANGE_MODE
482 | REGULATOR_CHANGE_STATUS,
486 static struct regulator_init_data sdp4430_vcxio = {
487 .constraints = {
488 .min_uV = 1800000,
489 .max_uV = 1800000,
490 .valid_modes_mask = REGULATOR_MODE_NORMAL
491 | REGULATOR_MODE_STANDBY,
492 .valid_ops_mask = REGULATOR_CHANGE_MODE
493 | REGULATOR_CHANGE_STATUS,
497 static struct regulator_init_data sdp4430_vdac = {
498 .constraints = {
499 .min_uV = 1800000,
500 .max_uV = 1800000,
501 .valid_modes_mask = REGULATOR_MODE_NORMAL
502 | REGULATOR_MODE_STANDBY,
503 .valid_ops_mask = REGULATOR_CHANGE_MODE
504 | REGULATOR_CHANGE_STATUS,
508 static struct regulator_init_data sdp4430_vusb = {
509 .constraints = {
510 .min_uV = 3300000,
511 .max_uV = 3300000,
512 .apply_uV = true,
513 .valid_modes_mask = REGULATOR_MODE_NORMAL
514 | REGULATOR_MODE_STANDBY,
515 .valid_ops_mask = REGULATOR_CHANGE_MODE
516 | REGULATOR_CHANGE_STATUS,
520 static struct regulator_init_data sdp4430_clk32kg = {
521 .constraints = {
522 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
526 static struct twl4030_platform_data sdp4430_twldata = {
527 .irq_base = TWL6030_IRQ_BASE,
528 .irq_end = TWL6030_IRQ_END,
530 /* Regulators */
531 .vmmc = &sdp4430_vmmc,
532 .vpp = &sdp4430_vpp,
533 .vusim = &sdp4430_vusim,
534 .vana = &sdp4430_vana,
535 .vcxio = &sdp4430_vcxio,
536 .vdac = &sdp4430_vdac,
537 .vusb = &sdp4430_vusb,
538 .vaux1 = &sdp4430_vaux1,
539 .vaux2 = &sdp4430_vaux2,
540 .vaux3 = &sdp4430_vaux3,
541 .clk32kg = &sdp4430_clk32kg,
542 .usb = &omap4_usbphy_data
545 static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
547 I2C_BOARD_INFO("tmp105", 0x48),
550 I2C_BOARD_INFO("bh1780", 0x29),
553 static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
555 I2C_BOARD_INFO("hmc5843", 0x1e),
558 static int __init omap4_i2c_init(void)
560 omap4_pmic_init("twl6030", &sdp4430_twldata);
561 omap_register_i2c_bus(2, 400, NULL, 0);
562 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
563 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
564 omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo,
565 ARRAY_SIZE(sdp4430_i2c_4_boardinfo));
566 return 0;
569 static void __init omap_sfh7741prox_init(void)
571 int error;
573 error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO,
574 GPIOF_OUT_INIT_LOW, "sfh7741");
575 if (error < 0)
576 pr_err("%s:failed to request GPIO %d, error %d\n",
577 __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
580 static void sdp4430_hdmi_mux_init(void)
582 omap_mux_init_signal("hdmi_cec",
583 OMAP_PIN_INPUT_PULLUP);
584 omap_mux_init_signal("hdmi_ddc_scl",
585 OMAP_PIN_INPUT_PULLUP);
586 omap_mux_init_signal("hdmi_ddc_sda",
587 OMAP_PIN_INPUT_PULLUP);
590 static struct gpio sdp4430_hdmi_gpios[] = {
591 { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
592 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
593 { HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" },
596 static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
598 int status;
600 status = gpio_request_array(sdp4430_hdmi_gpios,
601 ARRAY_SIZE(sdp4430_hdmi_gpios));
602 if (status)
603 pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
605 return status;
608 static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
610 gpio_free_array(sdp4430_hdmi_gpios, ARRAY_SIZE(sdp4430_hdmi_gpios));
613 static struct omap_dss_hdmi_data sdp4430_hdmi_data = {
614 .hpd_gpio = HDMI_GPIO_HPD,
617 static struct omap_dss_device sdp4430_hdmi_device = {
618 .name = "hdmi",
619 .driver_name = "hdmi_panel",
620 .type = OMAP_DISPLAY_TYPE_HDMI,
621 .platform_enable = sdp4430_panel_enable_hdmi,
622 .platform_disable = sdp4430_panel_disable_hdmi,
623 .channel = OMAP_DSS_CHANNEL_DIGIT,
624 .data = &sdp4430_hdmi_data,
627 static struct omap_dss_device *sdp4430_dss_devices[] = {
628 &sdp4430_hdmi_device,
631 static struct omap_dss_board_info sdp4430_dss_data = {
632 .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
633 .devices = sdp4430_dss_devices,
634 .default_device = &sdp4430_hdmi_device,
637 void omap_4430sdp_display_init(void)
639 sdp4430_hdmi_mux_init();
640 omap_display_init(&sdp4430_dss_data);
642 omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
643 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
644 omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
647 #ifdef CONFIG_OMAP_MUX
648 static struct omap_board_mux board_mux[] __initdata = {
649 OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
650 { .reg_offset = OMAP_MUX_TERMINATOR },
653 static struct omap_device_pad serial2_pads[] __initdata = {
654 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
655 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
656 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
657 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
658 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
659 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
660 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
661 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
664 static struct omap_device_pad serial3_pads[] __initdata = {
665 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
666 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
667 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
668 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
669 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
670 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
671 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
672 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
675 static struct omap_device_pad serial4_pads[] __initdata = {
676 OMAP_MUX_STATIC("uart4_rx.uart4_rx",
677 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
678 OMAP_MUX_STATIC("uart4_tx.uart4_tx",
679 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
682 static struct omap_board_data serial2_data __initdata = {
683 .id = 1,
684 .pads = serial2_pads,
685 .pads_cnt = ARRAY_SIZE(serial2_pads),
688 static struct omap_board_data serial3_data __initdata = {
689 .id = 2,
690 .pads = serial3_pads,
691 .pads_cnt = ARRAY_SIZE(serial3_pads),
694 static struct omap_board_data serial4_data __initdata = {
695 .id = 3,
696 .pads = serial4_pads,
697 .pads_cnt = ARRAY_SIZE(serial4_pads),
700 static inline void board_serial_init(void)
702 struct omap_board_data bdata;
703 bdata.flags = 0;
704 bdata.pads = NULL;
705 bdata.pads_cnt = 0;
706 bdata.id = 0;
707 /* pass dummy data for UART1 */
708 omap_serial_init_port(&bdata);
710 omap_serial_init_port(&serial2_data);
711 omap_serial_init_port(&serial3_data);
712 omap_serial_init_port(&serial4_data);
714 #else
715 #define board_mux NULL
717 static inline void board_serial_init(void)
719 omap_serial_init();
721 #endif
723 static void __init omap_4430sdp_init(void)
725 int status;
726 int package = OMAP_PACKAGE_CBS;
728 if (omap_rev() == OMAP4430_REV_ES1_0)
729 package = OMAP_PACKAGE_CBL;
730 omap4_mux_init(board_mux, NULL, package);
732 omap_board_config = sdp4430_config;
733 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
735 omap4_i2c_init();
736 omap_sfh7741prox_init();
737 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
738 board_serial_init();
739 omap4_twl6030_hsmmc_init(mmc);
741 usb_musb_init(&musb_board_data);
743 status = omap_ethernet_init();
744 if (status) {
745 pr_err("Ethernet initialization failed: %d\n", status);
746 } else {
747 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
748 spi_register_board_info(sdp4430_spi_board_info,
749 ARRAY_SIZE(sdp4430_spi_board_info));
752 status = omap4_keyboard_init(&sdp4430_keypad_data);
753 if (status)
754 pr_err("Keypad initialization failed: %d\n", status);
756 omap_4430sdp_display_init();
759 static void __init omap_4430sdp_map_io(void)
761 omap2_set_globals_443x();
762 omap44xx_map_common_io();
765 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
766 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
767 .boot_params = 0x80000100,
768 .reserve = omap_reserve,
769 .map_io = omap_4430sdp_map_io,
770 .init_early = omap_4430sdp_init_early,
771 .init_irq = gic_init_irq,
772 .init_machine = omap_4430sdp_init,
773 .timer = &omap_timer,
774 MACHINE_END