670cbd567bf3e71a644200b9764e2c3260feb25c
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / arm / mach-omap2 / board-4430sdp.c
1 /*
2  * Board support file for OMAP4430 SDP.
3  *
4  * Copyright (C) 2009 Texas Instruments
5  *
6  * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
7  *
8  * Based on mach-omap2/board-3430sdp.c
9  *
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.
13  */
14
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>
27
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>
33
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
40 #include "mux.h"
41 #include "hsmmc.h"
42 #include "timer-gp.h"
43 #include "control.h"
44
45 #define ETH_KS8851_IRQ                  34
46 #define ETH_KS8851_POWER_ON             48
47 #define ETH_KS8851_QUART                138
48 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO        184
49 #define OMAP4_SFH7741_ENABLE_GPIO               188
50
51 static const int sdp4430_keymap[] = {
52         KEY(0, 0, KEY_E),
53         KEY(0, 1, KEY_R),
54         KEY(0, 2, KEY_T),
55         KEY(0, 3, KEY_HOME),
56         KEY(0, 4, KEY_F5),
57         KEY(0, 5, KEY_UNKNOWN),
58         KEY(0, 6, KEY_I),
59         KEY(0, 7, KEY_LEFTSHIFT),
60
61         KEY(1, 0, KEY_D),
62         KEY(1, 1, KEY_F),
63         KEY(1, 2, KEY_G),
64         KEY(1, 3, KEY_SEND),
65         KEY(1, 4, KEY_F6),
66         KEY(1, 5, KEY_UNKNOWN),
67         KEY(1, 6, KEY_K),
68         KEY(1, 7, KEY_ENTER),
69
70         KEY(2, 0, KEY_X),
71         KEY(2, 1, KEY_C),
72         KEY(2, 2, KEY_V),
73         KEY(2, 3, KEY_END),
74         KEY(2, 4, KEY_F7),
75         KEY(2, 5, KEY_UNKNOWN),
76         KEY(2, 6, KEY_DOT),
77         KEY(2, 7, KEY_CAPSLOCK),
78
79         KEY(3, 0, KEY_Z),
80         KEY(3, 1, KEY_KPPLUS),
81         KEY(3, 2, KEY_B),
82         KEY(3, 3, KEY_F1),
83         KEY(3, 4, KEY_F8),
84         KEY(3, 5, KEY_UNKNOWN),
85         KEY(3, 6, KEY_O),
86         KEY(3, 7, KEY_SPACE),
87
88         KEY(4, 0, KEY_W),
89         KEY(4, 1, KEY_Y),
90         KEY(4, 2, KEY_U),
91         KEY(4, 3, KEY_F2),
92         KEY(4, 4, KEY_VOLUMEUP),
93         KEY(4, 5, KEY_UNKNOWN),
94         KEY(4, 6, KEY_L),
95         KEY(4, 7, KEY_LEFT),
96
97         KEY(5, 0, KEY_S),
98         KEY(5, 1, KEY_H),
99         KEY(5, 2, KEY_J),
100         KEY(5, 3, KEY_F3),
101         KEY(5, 4, KEY_F9),
102         KEY(5, 5, KEY_VOLUMEDOWN),
103         KEY(5, 6, KEY_M),
104         KEY(5, 7, KEY_RIGHT),
105
106         KEY(6, 0, KEY_Q),
107         KEY(6, 1, KEY_A),
108         KEY(6, 2, KEY_N),
109         KEY(6, 3, KEY_BACK),
110         KEY(6, 4, KEY_BACKSPACE),
111         KEY(6, 5, KEY_UNKNOWN),
112         KEY(6, 6, KEY_P),
113         KEY(6, 7, KEY_UP),
114
115         KEY(7, 0, KEY_PROG1),
116         KEY(7, 1, KEY_PROG2),
117         KEY(7, 2, KEY_PROG3),
118         KEY(7, 3, KEY_PROG4),
119         KEY(7, 4, KEY_F4),
120         KEY(7, 5, KEY_UNKNOWN),
121         KEY(7, 6, KEY_OK),
122         KEY(7, 7, KEY_DOWN),
123 };
124
125 static struct matrix_keymap_data sdp4430_keymap_data = {
126         .keymap                 = sdp4430_keymap,
127         .keymap_size            = ARRAY_SIZE(sdp4430_keymap),
128 };
129
130 static struct omap4_keypad_platform_data sdp4430_keypad_data = {
131         .keymap_data            = &sdp4430_keymap_data,
132         .rows                   = 8,
133         .cols                   = 8,
134 };
135 static struct gpio_led sdp4430_gpio_leds[] = {
136         {
137                 .name   = "omap4:green:debug0",
138                 .gpio   = 61,
139         },
140         {
141                 .name   = "omap4:green:debug1",
142                 .gpio   = 30,
143         },
144         {
145                 .name   = "omap4:green:debug2",
146                 .gpio   = 7,
147         },
148         {
149                 .name   = "omap4:green:debug3",
150                 .gpio   = 8,
151         },
152         {
153                 .name   = "omap4:green:debug4",
154                 .gpio   = 50,
155         },
156         {
157                 .name   = "omap4:blue:user",
158                 .gpio   = 169,
159         },
160         {
161                 .name   = "omap4:red:user",
162                 .gpio   = 170,
163         },
164         {
165                 .name   = "omap4:green:user",
166                 .gpio   = 139,
167         },
168
169 };
170
171 static struct gpio_keys_button sdp4430_gpio_keys[] = {
172         {
173                 .desc                   = "Proximity Sensor",
174                 .type                   = EV_SW,
175                 .code                   = SW_FRONT_PROXIMITY,
176                 .gpio                   = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO,
177                 .active_low             = 0,
178         }
179 };
180
181 static struct gpio_led_platform_data sdp4430_led_data = {
182         .leds   = sdp4430_gpio_leds,
183         .num_leds       = ARRAY_SIZE(sdp4430_gpio_leds),
184 };
185
186 static struct led_pwm sdp4430_pwm_leds[] = {
187         {
188                 .name           = "omap4:green:chrg",
189                 .pwm_id         = 1,
190                 .max_brightness = 255,
191                 .pwm_period_ns  = 7812500,
192         },
193 };
194
195 static struct led_pwm_platform_data sdp4430_pwm_data = {
196         .num_leds       = ARRAY_SIZE(sdp4430_pwm_leds),
197         .leds           = sdp4430_pwm_leds,
198 };
199
200 static struct platform_device sdp4430_leds_pwm = {
201         .name   = "leds_pwm",
202         .id     = -1,
203         .dev    = {
204                 .platform_data = &sdp4430_pwm_data,
205         },
206 };
207
208 static int omap_prox_activate(struct device *dev)
209 {
210         gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
211         return 0;
212 }
213
214 static void omap_prox_deactivate(struct device *dev)
215 {
216         gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0);
217 }
218
219 static struct gpio_keys_platform_data sdp4430_gpio_keys_data = {
220         .buttons        = sdp4430_gpio_keys,
221         .nbuttons       = ARRAY_SIZE(sdp4430_gpio_keys),
222         .enable         = omap_prox_activate,
223         .disable        = omap_prox_deactivate,
224 };
225
226 static struct platform_device sdp4430_gpio_keys_device = {
227         .name   = "gpio-keys",
228         .id     = -1,
229         .dev    = {
230                 .platform_data  = &sdp4430_gpio_keys_data,
231         },
232 };
233
234 static struct platform_device sdp4430_leds_gpio = {
235         .name   = "leds-gpio",
236         .id     = -1,
237         .dev    = {
238                 .platform_data = &sdp4430_led_data,
239         },
240 };
241 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
242         {
243                 .modalias               = "ks8851",
244                 .bus_num                = 1,
245                 .chip_select            = 0,
246                 .max_speed_hz           = 24000000,
247                 .irq                    = ETH_KS8851_IRQ,
248         },
249 };
250
251 static int omap_ethernet_init(void)
252 {
253         int status;
254
255         /* Request of GPIO lines */
256
257         status = gpio_request(ETH_KS8851_POWER_ON, "eth_power");
258         if (status) {
259                 pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON);
260                 return status;
261         }
262
263         status = gpio_request(ETH_KS8851_QUART, "quart");
264         if (status) {
265                 pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART);
266                 goto error1;
267         }
268
269         status = gpio_request(ETH_KS8851_IRQ, "eth_irq");
270         if (status) {
271                 pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ);
272                 goto error2;
273         }
274
275         /* Configuration of requested GPIO lines */
276
277         status = gpio_direction_output(ETH_KS8851_POWER_ON, 1);
278         if (status) {
279                 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ);
280                 goto error3;
281         }
282
283         status = gpio_direction_output(ETH_KS8851_QUART, 1);
284         if (status) {
285                 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART);
286                 goto error3;
287         }
288
289         status = gpio_direction_input(ETH_KS8851_IRQ);
290         if (status) {
291                 pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ);
292                 goto error3;
293         }
294
295         return 0;
296
297 error3:
298         gpio_free(ETH_KS8851_IRQ);
299 error2:
300         gpio_free(ETH_KS8851_QUART);
301 error1:
302         gpio_free(ETH_KS8851_POWER_ON);
303         return status;
304 }
305
306 static struct platform_device sdp4430_lcd_device = {
307         .name           = "sdp4430_lcd",
308         .id             = -1,
309 };
310
311 static struct platform_device *sdp4430_devices[] __initdata = {
312         &sdp4430_lcd_device,
313         &sdp4430_gpio_keys_device,
314         &sdp4430_leds_gpio,
315         &sdp4430_leds_pwm,
316 };
317
318 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
319         .ctrl_name      = "internal",
320 };
321
322 static struct omap_board_config_kernel sdp4430_config[] __initdata = {
323         { OMAP_TAG_LCD,         &sdp4430_lcd_config },
324 };
325
326 static void __init omap_4430sdp_init_early(void)
327 {
328         omap2_init_common_infrastructure();
329         omap2_init_common_devices(NULL, NULL);
330 #ifdef CONFIG_OMAP_32K_TIMER
331         omap2_gp_clockevent_set_gptimer(1);
332 #endif
333 }
334
335 static struct omap_musb_board_data musb_board_data = {
336         .interface_type         = MUSB_INTERFACE_UTMI,
337         .mode                   = MUSB_OTG,
338         .power                  = 100,
339 };
340
341 static struct twl4030_usb_data omap4_usbphy_data = {
342         .phy_init       = omap4430_phy_init,
343         .phy_exit       = omap4430_phy_exit,
344         .phy_power      = omap4430_phy_power,
345         .phy_set_clock  = omap4430_phy_set_clk,
346 };
347
348 static struct omap2_hsmmc_info mmc[] = {
349         {
350                 .mmc            = 2,
351                 .caps           =  MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
352                 .gpio_cd        = -EINVAL,
353                 .gpio_wp        = -EINVAL,
354                 .nonremovable   = true,
355                 .ocr_mask       = MMC_VDD_29_30,
356         },
357         {
358                 .mmc            = 1,
359                 .caps           = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
360                 .gpio_wp        = -EINVAL,
361         },
362         {}      /* Terminator */
363 };
364
365 static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
366         {
367                 .supply = "vmmc",
368                 .dev_name = "omap_hsmmc.1",
369         },
370 };
371 static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
372         {
373                 .supply = "vmmc",
374                 .dev_name = "omap_hsmmc.0",
375         },
376 };
377
378 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
379 {
380         int ret = 0;
381         struct platform_device *pdev = container_of(dev,
382                                 struct platform_device, dev);
383         struct omap_mmc_platform_data *pdata = dev->platform_data;
384
385         /* Setting MMC1 Card detect Irq */
386         if (pdev->id == 0) {
387                 ret = twl6030_mmc_card_detect_config();
388                 if (ret)
389                         pr_err("Failed configuring MMC1 card detect\n");
390                 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
391                                                 MMCDETECT_INTR_OFFSET;
392                 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
393         }
394         return ret;
395 }
396
397 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
398 {
399         struct omap_mmc_platform_data *pdata;
400
401         /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
402         if (!dev) {
403                 pr_err("Failed %s\n", __func__);
404                 return;
405         }
406         pdata = dev->platform_data;
407         pdata->init =   omap4_twl6030_hsmmc_late_init;
408 }
409
410 static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
411 {
412         struct omap2_hsmmc_info *c;
413
414         omap2_hsmmc_init(controllers);
415         for (c = controllers; c->mmc; c++)
416                 omap4_twl6030_hsmmc_set_late_init(c->dev);
417
418         return 0;
419 }
420
421 static struct regulator_init_data sdp4430_vaux1 = {
422         .constraints = {
423                 .min_uV                 = 1000000,
424                 .max_uV                 = 3000000,
425                 .apply_uV               = true,
426                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
427                                         | REGULATOR_MODE_STANDBY,
428                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
429                                         | REGULATOR_CHANGE_MODE
430                                         | REGULATOR_CHANGE_STATUS,
431         },
432         .num_consumer_supplies  = 1,
433         .consumer_supplies      = sdp4430_vaux_supply,
434 };
435
436 static struct regulator_init_data sdp4430_vaux2 = {
437         .constraints = {
438                 .min_uV                 = 1200000,
439                 .max_uV                 = 2800000,
440                 .apply_uV               = true,
441                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
442                                         | REGULATOR_MODE_STANDBY,
443                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
444                                         | REGULATOR_CHANGE_MODE
445                                         | REGULATOR_CHANGE_STATUS,
446         },
447 };
448
449 static struct regulator_init_data sdp4430_vaux3 = {
450         .constraints = {
451                 .min_uV                 = 1000000,
452                 .max_uV                 = 3000000,
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,
459         },
460 };
461
462 /* VMMC1 for MMC1 card */
463 static struct regulator_init_data sdp4430_vmmc = {
464         .constraints = {
465                 .min_uV                 = 1200000,
466                 .max_uV                 = 3000000,
467                 .apply_uV               = true,
468                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
469                                         | REGULATOR_MODE_STANDBY,
470                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
471                                         | REGULATOR_CHANGE_MODE
472                                         | REGULATOR_CHANGE_STATUS,
473         },
474         .num_consumer_supplies  = 1,
475         .consumer_supplies      = sdp4430_vmmc_supply,
476 };
477
478 static struct regulator_init_data sdp4430_vpp = {
479         .constraints = {
480                 .min_uV                 = 1800000,
481                 .max_uV                 = 2500000,
482                 .apply_uV               = true,
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,
488         },
489 };
490
491 static struct regulator_init_data sdp4430_vusim = {
492         .constraints = {
493                 .min_uV                 = 1200000,
494                 .max_uV                 = 2900000,
495                 .apply_uV               = true,
496                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
497                                         | REGULATOR_MODE_STANDBY,
498                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
499                                         | REGULATOR_CHANGE_MODE
500                                         | REGULATOR_CHANGE_STATUS,
501         },
502 };
503
504 static struct regulator_init_data sdp4430_vana = {
505         .constraints = {
506                 .min_uV                 = 2100000,
507                 .max_uV                 = 2100000,
508                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
509                                         | REGULATOR_MODE_STANDBY,
510                 .valid_ops_mask  = REGULATOR_CHANGE_MODE
511                                         | REGULATOR_CHANGE_STATUS,
512         },
513 };
514
515 static struct regulator_init_data sdp4430_vcxio = {
516         .constraints = {
517                 .min_uV                 = 1800000,
518                 .max_uV                 = 1800000,
519                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
520                                         | REGULATOR_MODE_STANDBY,
521                 .valid_ops_mask  = REGULATOR_CHANGE_MODE
522                                         | REGULATOR_CHANGE_STATUS,
523         },
524 };
525
526 static struct regulator_init_data sdp4430_vdac = {
527         .constraints = {
528                 .min_uV                 = 1800000,
529                 .max_uV                 = 1800000,
530                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
531                                         | REGULATOR_MODE_STANDBY,
532                 .valid_ops_mask  = REGULATOR_CHANGE_MODE
533                                         | REGULATOR_CHANGE_STATUS,
534         },
535 };
536
537 static struct regulator_init_data sdp4430_vusb = {
538         .constraints = {
539                 .min_uV                 = 3300000,
540                 .max_uV                 = 3300000,
541                 .apply_uV               = true,
542                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
543                                         | REGULATOR_MODE_STANDBY,
544                 .valid_ops_mask  =      REGULATOR_CHANGE_MODE
545                                         | REGULATOR_CHANGE_STATUS,
546         },
547 };
548
549 static struct twl4030_platform_data sdp4430_twldata = {
550         .irq_base       = TWL6030_IRQ_BASE,
551         .irq_end        = TWL6030_IRQ_END,
552
553         /* Regulators */
554         .vmmc           = &sdp4430_vmmc,
555         .vpp            = &sdp4430_vpp,
556         .vusim          = &sdp4430_vusim,
557         .vana           = &sdp4430_vana,
558         .vcxio          = &sdp4430_vcxio,
559         .vdac           = &sdp4430_vdac,
560         .vusb           = &sdp4430_vusb,
561         .vaux1          = &sdp4430_vaux1,
562         .vaux2          = &sdp4430_vaux2,
563         .vaux3          = &sdp4430_vaux3,
564         .usb            = &omap4_usbphy_data
565 };
566
567 static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
568         {
569                 I2C_BOARD_INFO("twl6030", 0x48),
570                 .flags = I2C_CLIENT_WAKE,
571                 .irq = OMAP44XX_IRQ_SYS_1N,
572                 .platform_data = &sdp4430_twldata,
573         },
574 };
575 static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
576         {
577                 I2C_BOARD_INFO("tmp105", 0x48),
578         },
579         {
580                 I2C_BOARD_INFO("bh1780", 0x29),
581         },
582 };
583 static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
584         {
585                 I2C_BOARD_INFO("hmc5843", 0x1e),
586         },
587 };
588 static int __init omap4_i2c_init(void)
589 {
590         /*
591          * Phoenix Audio IC needs I2C1 to
592          * start with 400 KHz or less
593          */
594         omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo,
595                         ARRAY_SIZE(sdp4430_i2c_boardinfo));
596         omap_register_i2c_bus(2, 400, NULL, 0);
597         omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
598                                 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
599         omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo,
600                                 ARRAY_SIZE(sdp4430_i2c_4_boardinfo));
601         return 0;
602 }
603
604 static void __init omap_sfh7741prox_init(void)
605 {
606         int  error;
607
608         error = gpio_request(OMAP4_SFH7741_ENABLE_GPIO, "sfh7741");
609         if (error < 0) {
610                 pr_err("%s:failed to request GPIO %d, error %d\n",
611                         __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
612                 return;
613         }
614
615         error = gpio_direction_output(OMAP4_SFH7741_ENABLE_GPIO , 0);
616         if (error < 0) {
617                 pr_err("%s: GPIO configuration failed: GPIO %d,error %d\n",
618                          __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
619                 gpio_free(OMAP4_SFH7741_ENABLE_GPIO);
620         }
621 }
622
623 #ifdef CONFIG_OMAP_MUX
624 static struct omap_board_mux board_mux[] __initdata = {
625         OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
626         { .reg_offset = OMAP_MUX_TERMINATOR },
627 };
628
629 static struct omap_device_pad serial2_pads[] __initdata = {
630         OMAP_MUX_STATIC("uart2_cts.uart2_cts",
631                          OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
632         OMAP_MUX_STATIC("uart2_rts.uart2_rts",
633                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
634         OMAP_MUX_STATIC("uart2_rx.uart2_rx",
635                          OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
636         OMAP_MUX_STATIC("uart2_tx.uart2_tx",
637                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
638 };
639
640 static struct omap_device_pad serial3_pads[] __initdata = {
641         OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
642                          OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
643         OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
644                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
645         OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
646                          OMAP_PIN_INPUT | OMAP_MUX_MODE0),
647         OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
648                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
649 };
650
651 static struct omap_device_pad serial4_pads[] __initdata = {
652         OMAP_MUX_STATIC("uart4_rx.uart4_rx",
653                          OMAP_PIN_INPUT | OMAP_MUX_MODE0),
654         OMAP_MUX_STATIC("uart4_tx.uart4_tx",
655                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
656 };
657
658 static struct omap_board_data serial2_data = {
659         .id             = 1,
660         .pads           = serial2_pads,
661         .pads_cnt       = ARRAY_SIZE(serial2_pads),
662 };
663
664 static struct omap_board_data serial3_data = {
665         .id             = 2,
666         .pads           = serial3_pads,
667         .pads_cnt       = ARRAY_SIZE(serial3_pads),
668 };
669
670 static struct omap_board_data serial4_data = {
671         .id             = 3,
672         .pads           = serial4_pads,
673         .pads_cnt       = ARRAY_SIZE(serial4_pads),
674 };
675
676 static inline void board_serial_init(void)
677 {
678         struct omap_board_data bdata;
679         bdata.flags     = 0;
680         bdata.pads      = NULL;
681         bdata.pads_cnt  = 0;
682         bdata.id        = 0;
683         /* pass dummy data for UART1 */
684         omap_serial_init_port(&bdata);
685
686         omap_serial_init_port(&serial2_data);
687         omap_serial_init_port(&serial3_data);
688         omap_serial_init_port(&serial4_data);
689 }
690 #else
691 #define board_mux       NULL
692
693 static inline void board_serial_init(void)
694 {
695         omap_serial_init();
696 }
697  #endif
698
699 static void __init omap_4430sdp_init(void)
700 {
701         int status;
702         int package = OMAP_PACKAGE_CBS;
703
704         if (omap_rev() == OMAP4430_REV_ES1_0)
705                 package = OMAP_PACKAGE_CBL;
706         omap4_mux_init(board_mux, package);
707
708         omap_board_config = sdp4430_config;
709         omap_board_config_size = ARRAY_SIZE(sdp4430_config);
710
711         omap4_i2c_init();
712         omap_sfh7741prox_init();
713         platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
714         board_serial_init();
715         omap4_twl6030_hsmmc_init(mmc);
716
717         usb_musb_init(&musb_board_data);
718
719         status = omap_ethernet_init();
720         if (status) {
721                 pr_err("Ethernet initialization failed: %d\n", status);
722         } else {
723                 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
724                 spi_register_board_info(sdp4430_spi_board_info,
725                                 ARRAY_SIZE(sdp4430_spi_board_info));
726         }
727
728         status = omap4_keyboard_init(&sdp4430_keypad_data);
729         if (status)
730                 pr_err("Keypad initialization failed: %d\n", status);
731 }
732
733 static void __init omap_4430sdp_map_io(void)
734 {
735         omap2_set_globals_443x();
736         omap44xx_map_common_io();
737 }
738
739 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
740         /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
741         .boot_params    = 0x80000100,
742         .reserve        = omap_reserve,
743         .map_io         = omap_4430sdp_map_io,
744         .init_early     = omap_4430sdp_init_early,
745         .init_irq       = gic_init_irq,
746         .init_machine   = omap_4430sdp_init,
747         .timer          = &omap_timer,
748 MACHINE_END