blob: 07d1b20b11486a6c4c8629e654474e4dd7e5cb56 [file] [log] [blame]
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -07001/*
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>
Maulik Mankadbce06682010-02-17 14:09:32 -080020#include <linux/usb/otg.h>
Abraham Arceb2aa5e52010-05-14 12:05:26 -070021#include <linux/spi/spi.h>
Balaji T K6e30a7d2010-05-12 08:27:30 +000022#include <linux/i2c/twl.h>
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -070023#include <linux/gpio_keys.h>
Balaji T K6e30a7d2010-05-12 08:27:30 +000024#include <linux/regulator/machine.h>
Hemanth V509b6d92010-08-02 13:18:04 +030025#include <linux/leds.h>
Hemanth Vf389f4c2010-12-17 18:15:08 -080026#include <linux/leds_pwm.h>
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -070027
28#include <mach/hardware.h>
Santosh Shilimkarfbc9be12010-05-14 12:05:26 -070029#include <mach/omap4-common.h>
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -070030#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33
Tony Lindgrence491cf2009-10-20 09:40:47 -070034#include <plat/board.h>
35#include <plat/common.h>
Maulik Mankadbce06682010-02-17 14:09:32 -080036#include <plat/usb.h>
kishore kadiyala717c1fb2010-05-15 18:21:06 +000037#include <plat/mmc.h>
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -070038
Benoit Coussonfb6bf632010-08-10 17:43:15 +020039#include "mux.h"
kishore kadiyala717c1fb2010-05-15 18:21:06 +000040#include "hsmmc.h"
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -070041#include "timer-gp.h"
Paul Walmsley4814ced2010-10-08 11:40:20 -060042#include "control.h"
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -070043
Abraham Arceb2aa5e52010-05-14 12:05:26 -070044#define ETH_KS8851_IRQ 34
45#define ETH_KS8851_POWER_ON 48
46#define ETH_KS8851_QUART 138
Keshava Munegowda6aa85a52010-11-21 23:23:42 +053047#define OMAP4SDP_MDM_PWR_EN_GPIO 157
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -070048#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
49#define OMAP4_SFH7741_ENABLE_GPIO 188
Abraham Arceb2aa5e52010-05-14 12:05:26 -070050
Hemanth V509b6d92010-08-02 13:18:04 +030051static struct gpio_led sdp4430_gpio_leds[] = {
52 {
53 .name = "omap4:green:debug0",
54 .gpio = 61,
55 },
56 {
57 .name = "omap4:green:debug1",
58 .gpio = 30,
59 },
60 {
61 .name = "omap4:green:debug2",
62 .gpio = 7,
63 },
64 {
65 .name = "omap4:green:debug3",
66 .gpio = 8,
67 },
68 {
69 .name = "omap4:green:debug4",
70 .gpio = 50,
71 },
72 {
73 .name = "omap4:blue:user",
74 .gpio = 169,
75 },
76 {
77 .name = "omap4:red:user",
78 .gpio = 170,
79 },
80 {
81 .name = "omap4:green:user",
82 .gpio = 139,
83 },
84
85};
86
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -070087static struct gpio_keys_button sdp4430_gpio_keys[] = {
88 {
89 .desc = "Proximity Sensor",
90 .type = EV_SW,
91 .code = SW_FRONT_PROXIMITY,
92 .gpio = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO,
93 .active_low = 0,
94 }
95};
96
Hemanth V509b6d92010-08-02 13:18:04 +030097static struct gpio_led_platform_data sdp4430_led_data = {
98 .leds = sdp4430_gpio_leds,
99 .num_leds = ARRAY_SIZE(sdp4430_gpio_leds),
100};
101
Hemanth Vf389f4c2010-12-17 18:15:08 -0800102static struct led_pwm sdp4430_pwm_leds[] = {
103 {
104 .name = "omap4:green:chrg",
105 .pwm_id = 1,
106 .max_brightness = 255,
107 .pwm_period_ns = 7812500,
108 },
109};
110
111static struct led_pwm_platform_data sdp4430_pwm_data = {
112 .num_leds = ARRAY_SIZE(sdp4430_pwm_leds),
113 .leds = sdp4430_pwm_leds,
114};
115
116static struct platform_device sdp4430_leds_pwm = {
117 .name = "leds_pwm",
118 .id = -1,
119 .dev = {
120 .platform_data = &sdp4430_pwm_data,
121 },
122};
123
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700124static int omap_prox_activate(struct device *dev)
125{
126 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
127 return 0;
128}
129
130static void omap_prox_deactivate(struct device *dev)
131{
132 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0);
133}
134
135static struct gpio_keys_platform_data sdp4430_gpio_keys_data = {
136 .buttons = sdp4430_gpio_keys,
137 .nbuttons = ARRAY_SIZE(sdp4430_gpio_keys),
138 .enable = omap_prox_activate,
139 .disable = omap_prox_deactivate,
140};
141
142static struct platform_device sdp4430_gpio_keys_device = {
143 .name = "gpio-keys",
144 .id = -1,
145 .dev = {
146 .platform_data = &sdp4430_gpio_keys_data,
147 },
148};
149
Hemanth V509b6d92010-08-02 13:18:04 +0300150static struct platform_device sdp4430_leds_gpio = {
151 .name = "leds-gpio",
152 .id = -1,
153 .dev = {
154 .platform_data = &sdp4430_led_data,
155 },
156};
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700157static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
158 {
159 .modalias = "ks8851",
160 .bus_num = 1,
161 .chip_select = 0,
162 .max_speed_hz = 24000000,
163 .irq = ETH_KS8851_IRQ,
164 },
165};
166
167static int omap_ethernet_init(void)
168{
169 int status;
170
171 /* Request of GPIO lines */
172
173 status = gpio_request(ETH_KS8851_POWER_ON, "eth_power");
174 if (status) {
175 pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON);
176 return status;
177 }
178
179 status = gpio_request(ETH_KS8851_QUART, "quart");
180 if (status) {
181 pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART);
182 goto error1;
183 }
184
185 status = gpio_request(ETH_KS8851_IRQ, "eth_irq");
186 if (status) {
187 pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ);
188 goto error2;
189 }
190
191 /* Configuration of requested GPIO lines */
192
193 status = gpio_direction_output(ETH_KS8851_POWER_ON, 1);
194 if (status) {
195 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ);
196 goto error3;
197 }
198
199 status = gpio_direction_output(ETH_KS8851_QUART, 1);
200 if (status) {
201 pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART);
202 goto error3;
203 }
204
205 status = gpio_direction_input(ETH_KS8851_IRQ);
206 if (status) {
207 pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ);
208 goto error3;
209 }
210
211 return 0;
212
213error3:
214 gpio_free(ETH_KS8851_IRQ);
215error2:
216 gpio_free(ETH_KS8851_QUART);
217error1:
218 gpio_free(ETH_KS8851_POWER_ON);
219 return status;
220}
221
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700222static struct platform_device sdp4430_lcd_device = {
223 .name = "sdp4430_lcd",
224 .id = -1,
225};
226
227static struct platform_device *sdp4430_devices[] __initdata = {
228 &sdp4430_lcd_device,
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700229 &sdp4430_gpio_keys_device,
Hemanth V509b6d92010-08-02 13:18:04 +0300230 &sdp4430_leds_gpio,
Hemanth Vf389f4c2010-12-17 18:15:08 -0800231 &sdp4430_leds_pwm,
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700232};
233
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700234static struct omap_lcd_config sdp4430_lcd_config __initdata = {
235 .ctrl_name = "internal",
236};
237
238static struct omap_board_config_kernel sdp4430_config[] __initdata = {
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700239 { OMAP_TAG_LCD, &sdp4430_lcd_config },
240};
241
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700242static void __init omap_4430sdp_init_irq(void)
243{
Santosh Shilimkar5b7815b2009-10-22 14:48:14 -0700244 omap_board_config = sdp4430_config;
245 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
Paul Walmsley48057342010-12-21 15:25:10 -0700246 omap2_init_common_infrastructure();
247 omap2_init_common_devices(NULL, NULL);
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700248#ifdef CONFIG_OMAP_32K_TIMER
249 omap2_gp_clockevent_set_gptimer(1);
250#endif
251 gic_init_irq();
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700252}
253
Keshava Munegowda6aa85a52010-11-21 23:23:42 +0530254static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
255 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
256 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
257 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
258 .phy_reset = false,
259 .reset_gpio_port[0] = -EINVAL,
260 .reset_gpio_port[1] = -EINVAL,
261 .reset_gpio_port[2] = -EINVAL,
262};
263
Maulik Mankadbce06682010-02-17 14:09:32 -0800264static struct omap_musb_board_data musb_board_data = {
265 .interface_type = MUSB_INTERFACE_UTMI,
Hema HK09e72002010-12-10 18:11:42 +0530266 .mode = MUSB_OTG,
Maulik Mankadbce06682010-02-17 14:09:32 -0800267 .power = 100,
268};
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000269
Hema HKe70357e2010-12-10 18:09:52 +0530270static struct twl4030_usb_data omap4_usbphy_data = {
271 .phy_init = omap4430_phy_init,
272 .phy_exit = omap4430_phy_exit,
273 .phy_power = omap4430_phy_power,
274 .phy_set_clock = omap4430_phy_set_clk,
275};
276
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000277static struct omap2_hsmmc_info mmc[] = {
278 {
279 .mmc = 1,
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000280 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000281 .gpio_wp = -EINVAL,
282 },
283 {
284 .mmc = 2,
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000285 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000286 .gpio_cd = -EINVAL,
287 .gpio_wp = -EINVAL,
288 .nonremovable = true,
kishore kadiyala64be9782010-10-01 16:35:28 -0700289 .ocr_mask = MMC_VDD_29_30,
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000290 },
291 {} /* Terminator */
292};
293
Santosh Shilimkar50263912010-08-02 13:18:03 +0300294static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
295 {
296 .supply = "vmmc",
297 .dev_name = "mmci-omap-hs.1",
298 },
299};
Balaji T K6e30a7d2010-05-12 08:27:30 +0000300static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
301 {
302 .supply = "vmmc",
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000303 .dev_name = "mmci-omap-hs.0",
Balaji T K6e30a7d2010-05-12 08:27:30 +0000304 },
Balaji T K6e30a7d2010-05-12 08:27:30 +0000305};
306
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000307static int omap4_twl6030_hsmmc_late_init(struct device *dev)
308{
309 int ret = 0;
310 struct platform_device *pdev = container_of(dev,
311 struct platform_device, dev);
312 struct omap_mmc_platform_data *pdata = dev->platform_data;
313
314 /* Setting MMC1 Card detect Irq */
kishore kadiyala72f2e2c2010-09-24 17:13:20 +0000315 if (pdev->id == 0) {
316 ret = twl6030_mmc_card_detect_config();
317 if (ret)
318 pr_err("Failed configuring MMC1 card detect\n");
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000319 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
320 MMCDETECT_INTR_OFFSET;
kishore kadiyala72f2e2c2010-09-24 17:13:20 +0000321 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
322 }
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000323 return ret;
324}
325
326static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
327{
Benoit Cousson531c21b2010-10-01 16:35:26 -0700328 struct omap_mmc_platform_data *pdata;
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000329
Benoit Cousson531c21b2010-10-01 16:35:26 -0700330 /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
331 if (!dev) {
332 pr_err("Failed %s\n", __func__);
333 return;
334 }
335 pdata = dev->platform_data;
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000336 pdata->init = omap4_twl6030_hsmmc_late_init;
337}
338
339static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
340{
341 struct omap2_hsmmc_info *c;
342
343 omap2_hsmmc_init(controllers);
344 for (c = controllers; c->mmc; c++)
345 omap4_twl6030_hsmmc_set_late_init(c->dev);
346
347 return 0;
348}
349
Balaji T K6e30a7d2010-05-12 08:27:30 +0000350static struct regulator_init_data sdp4430_vaux1 = {
351 .constraints = {
352 .min_uV = 1000000,
353 .max_uV = 3000000,
354 .apply_uV = true,
355 .valid_modes_mask = REGULATOR_MODE_NORMAL
356 | REGULATOR_MODE_STANDBY,
357 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
358 | REGULATOR_CHANGE_MODE
359 | REGULATOR_CHANGE_STATUS,
360 },
Santosh Shilimkar50263912010-08-02 13:18:03 +0300361 .num_consumer_supplies = 1,
362 .consumer_supplies = sdp4430_vaux_supply,
Balaji T K6e30a7d2010-05-12 08:27:30 +0000363};
364
365static struct regulator_init_data sdp4430_vaux2 = {
366 .constraints = {
367 .min_uV = 1200000,
368 .max_uV = 2800000,
369 .apply_uV = true,
370 .valid_modes_mask = REGULATOR_MODE_NORMAL
371 | REGULATOR_MODE_STANDBY,
372 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
373 | REGULATOR_CHANGE_MODE
374 | REGULATOR_CHANGE_STATUS,
375 },
376};
377
378static struct regulator_init_data sdp4430_vaux3 = {
379 .constraints = {
380 .min_uV = 1000000,
381 .max_uV = 3000000,
382 .apply_uV = true,
383 .valid_modes_mask = REGULATOR_MODE_NORMAL
384 | REGULATOR_MODE_STANDBY,
385 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
386 | REGULATOR_CHANGE_MODE
387 | REGULATOR_CHANGE_STATUS,
388 },
389};
390
391/* VMMC1 for MMC1 card */
392static struct regulator_init_data sdp4430_vmmc = {
393 .constraints = {
394 .min_uV = 1200000,
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,
402 },
Santosh Shilimkar50263912010-08-02 13:18:03 +0300403 .num_consumer_supplies = 1,
Balaji T K6e30a7d2010-05-12 08:27:30 +0000404 .consumer_supplies = sdp4430_vmmc_supply,
405};
406
407static struct regulator_init_data sdp4430_vpp = {
408 .constraints = {
409 .min_uV = 1800000,
410 .max_uV = 2500000,
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,
417 },
418};
419
420static struct regulator_init_data sdp4430_vusim = {
421 .constraints = {
422 .min_uV = 1200000,
423 .max_uV = 2900000,
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,
430 },
431};
432
433static struct regulator_init_data sdp4430_vana = {
434 .constraints = {
435 .min_uV = 2100000,
436 .max_uV = 2100000,
437 .apply_uV = true,
438 .valid_modes_mask = REGULATOR_MODE_NORMAL
439 | REGULATOR_MODE_STANDBY,
440 .valid_ops_mask = REGULATOR_CHANGE_MODE
441 | REGULATOR_CHANGE_STATUS,
442 },
443};
444
445static struct regulator_init_data sdp4430_vcxio = {
446 .constraints = {
447 .min_uV = 1800000,
448 .max_uV = 1800000,
449 .apply_uV = true,
450 .valid_modes_mask = REGULATOR_MODE_NORMAL
451 | REGULATOR_MODE_STANDBY,
452 .valid_ops_mask = REGULATOR_CHANGE_MODE
453 | REGULATOR_CHANGE_STATUS,
454 },
455};
456
457static struct regulator_init_data sdp4430_vdac = {
458 .constraints = {
459 .min_uV = 1800000,
460 .max_uV = 1800000,
461 .apply_uV = true,
462 .valid_modes_mask = REGULATOR_MODE_NORMAL
463 | REGULATOR_MODE_STANDBY,
464 .valid_ops_mask = REGULATOR_CHANGE_MODE
465 | REGULATOR_CHANGE_STATUS,
466 },
467};
468
469static struct regulator_init_data sdp4430_vusb = {
470 .constraints = {
471 .min_uV = 3300000,
472 .max_uV = 3300000,
473 .apply_uV = true,
474 .valid_modes_mask = REGULATOR_MODE_NORMAL
475 | REGULATOR_MODE_STANDBY,
476 .valid_ops_mask = REGULATOR_CHANGE_MODE
477 | REGULATOR_CHANGE_STATUS,
478 },
479};
480
481static struct twl4030_platform_data sdp4430_twldata = {
482 .irq_base = TWL6030_IRQ_BASE,
483 .irq_end = TWL6030_IRQ_END,
484
485 /* Regulators */
486 .vmmc = &sdp4430_vmmc,
487 .vpp = &sdp4430_vpp,
488 .vusim = &sdp4430_vusim,
489 .vana = &sdp4430_vana,
490 .vcxio = &sdp4430_vcxio,
491 .vdac = &sdp4430_vdac,
492 .vusb = &sdp4430_vusb,
493 .vaux1 = &sdp4430_vaux1,
494 .vaux2 = &sdp4430_vaux2,
495 .vaux3 = &sdp4430_vaux3,
Hema HKe70357e2010-12-10 18:09:52 +0530496 .usb = &omap4_usbphy_data
Balaji T K6e30a7d2010-05-12 08:27:30 +0000497};
498
499static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
500 {
501 I2C_BOARD_INFO("twl6030", 0x48),
502 .flags = I2C_CLIENT_WAKE,
503 .irq = OMAP44XX_IRQ_SYS_1N,
504 .platform_data = &sdp4430_twldata,
505 },
506};
Shubhrajyoti Datta83078f92010-08-02 13:18:04 +0300507static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
508 {
509 I2C_BOARD_INFO("tmp105", 0x48),
510 },
Hemanth Vd048aca2010-12-17 18:15:08 -0800511 {
512 I2C_BOARD_INFO("bh1780", 0x29),
513 },
Shubhrajyoti Datta83078f92010-08-02 13:18:04 +0300514};
Shubhrajyoti Datta0df891b2010-09-23 18:22:47 -0700515static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
516 {
517 I2C_BOARD_INFO("hmc5843", 0x1e),
518 },
519};
Santosh Shilimkarbaeb73e2010-05-12 08:27:29 +0000520static int __init omap4_i2c_init(void)
521{
522 /*
523 * Phoenix Audio IC needs I2C1 to
524 * start with 400 KHz or less
525 */
Balaji T K6e30a7d2010-05-12 08:27:30 +0000526 omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo,
527 ARRAY_SIZE(sdp4430_i2c_boardinfo));
Santosh Shilimkarbaeb73e2010-05-12 08:27:29 +0000528 omap_register_i2c_bus(2, 400, NULL, 0);
Shubhrajyoti Datta83078f92010-08-02 13:18:04 +0300529 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
530 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
Shubhrajyoti Datta0df891b2010-09-23 18:22:47 -0700531 omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo,
532 ARRAY_SIZE(sdp4430_i2c_4_boardinfo));
Santosh Shilimkarbaeb73e2010-05-12 08:27:29 +0000533 return 0;
534}
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700535
536static void __init omap_sfh7741prox_init(void)
537{
538 int error;
539
540 error = gpio_request(OMAP4_SFH7741_ENABLE_GPIO, "sfh7741");
541 if (error < 0) {
542 pr_err("%s:failed to request GPIO %d, error %d\n",
543 __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
544 return;
545 }
546
547 error = gpio_direction_output(OMAP4_SFH7741_ENABLE_GPIO , 0);
548 if (error < 0) {
549 pr_err("%s: GPIO configuration failed: GPIO %d,error %d\n",
550 __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
551 gpio_free(OMAP4_SFH7741_ENABLE_GPIO);
552 }
553}
554
Benoit Coussonfb6bf632010-08-10 17:43:15 +0200555#ifdef CONFIG_OMAP_MUX
556static struct omap_board_mux board_mux[] __initdata = {
Tony Lindgren7d4ca852011-01-11 15:31:45 -0800557 OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
Benoit Coussonfb6bf632010-08-10 17:43:15 +0200558 { .reg_offset = OMAP_MUX_TERMINATOR },
559};
560#else
561#define board_mux NULL
562#endif
563
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700564static void __init omap_4430sdp_init(void)
565{
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700566 int status;
Benoit Cousson6fea7b02010-09-27 10:50:33 +0200567 int package = OMAP_PACKAGE_CBS;
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700568
Benoit Cousson6fea7b02010-09-27 10:50:33 +0200569 if (omap_rev() == OMAP4430_REV_ES1_0)
570 package = OMAP_PACKAGE_CBL;
571 omap4_mux_init(board_mux, package);
572
Santosh Shilimkarbaeb73e2010-05-12 08:27:29 +0000573 omap4_i2c_init();
Shubhrajyoti Datta94ce7a62010-09-23 18:22:49 -0700574 omap_sfh7741prox_init();
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700575 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700576 omap_serial_init();
kishore kadiyala717c1fb2010-05-15 18:21:06 +0000577 omap4_twl6030_hsmmc_init(mmc);
Keshava Munegowda6aa85a52010-11-21 23:23:42 +0530578
579 /* Power on the ULPI PHY */
Tony Lindgren7d4ca852011-01-11 15:31:45 -0800580 status = gpio_request(OMAP4SDP_MDM_PWR_EN_GPIO, "USBB1 PHY VMDM_3V3");
581 if (status)
582 pr_err("%s: Could not get USBB1 PHY GPIO\n", __func__);
583 else
Keshava Munegowda6aa85a52010-11-21 23:23:42 +0530584 gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1);
Tony Lindgren7d4ca852011-01-11 15:31:45 -0800585
Keshava Munegowda6aa85a52010-11-21 23:23:42 +0530586 usb_ehci_init(&ehci_pdata);
Felipe Balbi46960842010-12-07 09:57:59 +0200587 usb_musb_init(&musb_board_data);
Abraham Arceb2aa5e52010-05-14 12:05:26 -0700588
589 status = omap_ethernet_init();
590 if (status) {
591 pr_err("Ethernet initialization failed: %d\n", status);
592 } else {
593 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
594 spi_register_board_info(sdp4430_spi_board_info,
595 ARRAY_SIZE(sdp4430_spi_board_info));
596 }
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700597}
598
599static void __init omap_4430sdp_map_io(void)
600{
601 omap2_set_globals_443x();
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800602 omap44xx_map_common_io();
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700603}
604
605MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
606 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700607 .boot_params = 0x80000100,
608 .map_io = omap_4430sdp_map_io,
Russell King71ee7da2010-05-23 10:18:16 +0100609 .reserve = omap_reserve,
Santosh Shilimkar46ba0ab2009-05-28 14:16:05 -0700610 .init_irq = omap_4430sdp_init_irq,
611 .init_machine = omap_4430sdp_init,
612 .timer = &omap_timer,
613MACHINE_END