blob: d7a0db7058e1d3e3e74482dfe0768402452871f3 [file] [log] [blame]
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -08001/*
2 * Copyright (C) 2009 Integration Software and Electronic Engineering.
3 *
4 * Modified from mach-omap2/board-generic.c
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/delay.h>
15#include <linux/err.h>
16#include <linux/clk.h>
17#include <linux/io.h>
18#include <linux/gpio.h>
19#include <linux/interrupt.h>
20
21#include <linux/regulator/machine.h>
Balaji T Kebeb53e2009-12-15 20:09:02 +053022#include <linux/i2c/twl.h>
Sukumar Ghorai3a638332010-09-15 14:49:23 +000023#include <linux/mmc/host.h>
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -080024
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28#include <plat/board.h>
29#include <plat/common.h>
30#include <plat/gpmc.h>
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -080031#include <plat/usb.h>
Enric Balletbo i Serra691de272010-02-17 14:09:26 -080032#include <plat/display.h>
Enric Balletbo i Serracddb4832010-02-17 14:09:26 -080033#include <plat/onenand.h>
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -080034
Tony Lindgrenca5742b2009-12-11 16:16:32 -080035#include "mux.h"
Adrian Hunterd02a900b2010-02-15 10:03:34 -080036#include "hsmmc.h"
Enric Balletbo i Serra22f1baa2010-02-17 14:09:27 -080037#include "sdram-numonyx-m65kxxxxam.h"
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -080038
39#define IGEP2_SMSC911X_CS 5
40#define IGEP2_SMSC911X_GPIO 176
41#define IGEP2_GPIO_USBH_NRESET 24
Enric Balletbo i Serra228893f2010-03-01 11:18:08 +000042#define IGEP2_GPIO_LED0_GREEN 26
43#define IGEP2_GPIO_LED0_RED 27
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -080044#define IGEP2_GPIO_LED1_RED 28
Enric Balletbo i Serra691de272010-02-17 14:09:26 -080045#define IGEP2_GPIO_DVI_PUP 170
Jonas Zetterbergc67b0d92010-02-14 19:33:24 +000046#define IGEP2_GPIO_WIFI_NPD 94
47#define IGEP2_GPIO_WIFI_NRESET 95
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -080048
Enric Balletbo i Serracddb4832010-02-17 14:09:26 -080049#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
50 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
51
52#define ONENAND_MAP 0x20000000
53
54/* NAND04GR4E1A ( x2 Flash built-in COMBO POP MEMORY )
55 * Since the device is equipped with two DataRAMs, and two-plane NAND
56 * Flash memory array, these two component enables simultaneous program
57 * of 4KiB. Plane1 has only even blocks such as block0, block2, block4
58 * while Plane2 has only odd blocks such as block1, block3, block5.
59 * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
60 */
61
62static struct mtd_partition igep2_onenand_partitions[] = {
63 {
64 .name = "X-Loader",
65 .offset = 0,
66 .size = 2 * (64*(2*2048))
67 },
68 {
69 .name = "U-Boot",
70 .offset = MTDPART_OFS_APPEND,
71 .size = 6 * (64*(2*2048)),
72 },
73 {
74 .name = "Environment",
75 .offset = MTDPART_OFS_APPEND,
76 .size = 2 * (64*(2*2048)),
77 },
78 {
79 .name = "Kernel",
80 .offset = MTDPART_OFS_APPEND,
81 .size = 12 * (64*(2*2048)),
82 },
83 {
84 .name = "File System",
85 .offset = MTDPART_OFS_APPEND,
86 .size = MTDPART_SIZ_FULL,
87 },
88};
89
90static int igep2_onenand_setup(void __iomem *onenand_base, int freq)
91{
92 /* nothing is required to be setup for onenand as of now */
93 return 0;
94}
95
96static struct omap_onenand_platform_data igep2_onenand_data = {
97 .parts = igep2_onenand_partitions,
98 .nr_parts = ARRAY_SIZE(igep2_onenand_partitions),
99 .onenand_setup = igep2_onenand_setup,
100 .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */
101};
102
103static struct platform_device igep2_onenand_device = {
104 .name = "omap2-onenand",
105 .id = -1,
106 .dev = {
107 .platform_data = &igep2_onenand_data,
108 },
109};
110
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -0700111static void __init igep2_flash_init(void)
Enric Balletbo i Serracddb4832010-02-17 14:09:26 -0800112{
113 u8 cs = 0;
114 u8 onenandcs = GPMC_CS_NUM + 1;
115
116 while (cs < GPMC_CS_NUM) {
117 u32 ret = 0;
118 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
119
120 /* Check if NAND/oneNAND is configured */
121 if ((ret & 0xC00) == 0x800)
122 /* NAND found */
123 pr_err("IGEP v2: Unsupported NAND found\n");
124 else {
125 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
126 if ((ret & 0x3F) == (ONENAND_MAP >> 24))
127 /* ONENAND found */
128 onenandcs = cs;
129 }
130 cs++;
131 }
132 if (onenandcs > GPMC_CS_NUM) {
133 pr_err("IGEP v2: Unable to find configuration in GPMC\n");
134 return;
135 }
136
137 if (onenandcs < GPMC_CS_NUM) {
138 igep2_onenand_data.cs = onenandcs;
139 if (platform_device_register(&igep2_onenand_device) < 0)
140 pr_err("IGEP v2: Unable to register OneNAND device\n");
141 }
142}
143
144#else
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -0700145static void __init igep2_flash_init(void) {}
Enric Balletbo i Serracddb4832010-02-17 14:09:26 -0800146#endif
147
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800148#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
149
150#include <linux/smsc911x.h>
151
152static struct smsc911x_platform_config igep2_smsc911x_config = {
153 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
154 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
155 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS ,
156 .phy_interface = PHY_INTERFACE_MODE_MII,
157};
158
159static struct resource igep2_smsc911x_resources[] = {
160 {
161 .flags = IORESOURCE_MEM,
162 },
163 {
164 .start = OMAP_GPIO_IRQ(IGEP2_SMSC911X_GPIO),
165 .end = OMAP_GPIO_IRQ(IGEP2_SMSC911X_GPIO),
166 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
167 },
168};
169
170static struct platform_device igep2_smsc911x_device = {
171 .name = "smsc911x",
172 .id = 0,
173 .num_resources = ARRAY_SIZE(igep2_smsc911x_resources),
174 .resource = igep2_smsc911x_resources,
175 .dev = {
176 .platform_data = &igep2_smsc911x_config,
177 },
178};
179
180static inline void __init igep2_init_smsc911x(void)
181{
182 unsigned long cs_mem_base;
183
184 if (gpmc_cs_request(IGEP2_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
185 pr_err("IGEP v2: Failed request for GPMC mem for smsc911x\n");
186 gpmc_cs_free(IGEP2_SMSC911X_CS);
187 return;
188 }
189
190 igep2_smsc911x_resources[0].start = cs_mem_base + 0x0;
191 igep2_smsc911x_resources[0].end = cs_mem_base + 0xff;
192
193 if ((gpio_request(IGEP2_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
194 (gpio_direction_input(IGEP2_SMSC911X_GPIO) == 0)) {
195 gpio_export(IGEP2_SMSC911X_GPIO, 0);
196 } else {
197 pr_err("IGEP v2: Could not obtain gpio for for SMSC911X IRQ\n");
198 return;
199 }
200
201 platform_device_register(&igep2_smsc911x_device);
202}
203
204#else
205static inline void __init igep2_init_smsc911x(void) { }
206#endif
207
208static struct omap_board_config_kernel igep2_config[] __initdata = {
209};
210
211static struct regulator_consumer_supply igep2_vmmc1_supply = {
212 .supply = "vmmc",
213};
214
Jonas Zetterbergc67b0d92010-02-14 19:33:24 +0000215static struct regulator_consumer_supply igep2_vmmc2_supply = {
216 .supply = "vmmc",
217};
218
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800219/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
220static struct regulator_init_data igep2_vmmc1 = {
221 .constraints = {
222 .min_uV = 1850000,
223 .max_uV = 3150000,
224 .valid_modes_mask = REGULATOR_MODE_NORMAL
225 | REGULATOR_MODE_STANDBY,
226 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
227 | REGULATOR_CHANGE_MODE
228 | REGULATOR_CHANGE_STATUS,
229 },
230 .num_consumer_supplies = 1,
231 .consumer_supplies = &igep2_vmmc1_supply,
232};
233
Jonas Zetterbergc67b0d92010-02-14 19:33:24 +0000234/* VMMC2 for OMAP VDD_MMC2 (i/o) and MMC2 WIFI */
235static struct regulator_init_data igep2_vmmc2 = {
236 .constraints = {
237 .min_uV = 1850000,
238 .max_uV = 3150000,
239 .valid_modes_mask = REGULATOR_MODE_NORMAL
240 | REGULATOR_MODE_STANDBY,
241 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
242 | REGULATOR_CHANGE_MODE
243 | REGULATOR_CHANGE_STATUS,
244 },
245 .num_consumer_supplies = 1,
246 .consumer_supplies = &igep2_vmmc2_supply,
247};
248
Adrian Hunter68ff0422010-02-15 10:03:34 -0800249static struct omap2_hsmmc_info mmc[] = {
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800250 {
251 .mmc = 1,
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000252 .caps = MMC_CAP_4_BIT_DATA,
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800253 .gpio_cd = -EINVAL,
254 .gpio_wp = -EINVAL,
255 },
256 {
257 .mmc = 2,
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000258 .caps = MMC_CAP_4_BIT_DATA,
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800259 .gpio_cd = -EINVAL,
260 .gpio_wp = -EINVAL,
261 },
262 {} /* Terminator */
263};
264
Enric Balletbo i Serrabee15392010-10-08 10:22:28 -0700265#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
266#include <linux/leds.h>
267
268static struct gpio_led igep2_gpio_leds[] = {
269 [0] = {
270 .name = "gpio-led:red:d0",
271 .gpio = IGEP2_GPIO_LED0_RED,
272 .default_trigger = "default-off"
273 },
274 [1] = {
275 .name = "gpio-led:green:d0",
276 .gpio = IGEP2_GPIO_LED0_GREEN,
277 .default_trigger = "default-off",
278 },
279 [2] = {
280 .name = "gpio-led:red:d1",
281 .gpio = IGEP2_GPIO_LED1_RED,
282 .default_trigger = "default-off",
283 },
284 [3] = {
285 .name = "gpio-led:green:d1",
286 .default_trigger = "heartbeat",
287 .gpio = -EINVAL, /* gets replaced */
288 },
289};
290
291static struct gpio_led_platform_data igep2_led_pdata = {
292 .leds = igep2_gpio_leds,
293 .num_leds = ARRAY_SIZE(igep2_gpio_leds),
294};
295
296static struct platform_device igep2_led_device = {
297 .name = "leds-gpio",
298 .id = -1,
299 .dev = {
300 .platform_data = &igep2_led_pdata,
301 },
302};
303
304static void __init igep2_leds_init(void)
305{
306 platform_device_register(&igep2_led_device);
307}
308
309#else
310static inline void igep2_leds_init(void)
311{
312 if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) &&
313 (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) {
314 gpio_export(IGEP2_GPIO_LED0_RED, 0);
315 gpio_set_value(IGEP2_GPIO_LED0_RED, 0);
316 } else
317 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n");
318
319 if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) &&
320 (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) {
321 gpio_export(IGEP2_GPIO_LED0_GREEN, 0);
322 gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0);
323 } else
324 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
325
326 if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) &&
327 (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) {
328 gpio_export(IGEP2_GPIO_LED1_RED, 0);
329 gpio_set_value(IGEP2_GPIO_LED1_RED, 0);
330 } else
331 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
332
333}
334#endif
335
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800336static int igep2_twl_gpio_setup(struct device *dev,
337 unsigned gpio, unsigned ngpio)
338{
339 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
340 mmc[0].gpio_cd = gpio + 0;
Adrian Hunter68ff0422010-02-15 10:03:34 -0800341 omap2_hsmmc_init(mmc);
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800342
343 /* link regulators to MMC adapters ... we "know" the
344 * regulators will be set up only *after* we return.
345 */
346 igep2_vmmc1_supply.dev = mmc[0].dev;
Jonas Zetterbergc67b0d92010-02-14 19:33:24 +0000347 igep2_vmmc2_supply.dev = mmc[1].dev;
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800348
Enric Balletbo i Serra61e118d2010-10-08 10:22:19 -0700349 /*
350 * REVISIT: need ehci-omap hooks for external VBUS
351 * power switch and overcurrent detect
352 */
353 if ((gpio_request(gpio + 1, "GPIO_EHCI_NOC") < 0) ||
354 (gpio_direction_input(gpio + 1) < 0))
355 pr_err("IGEP2: Could not obtain gpio for EHCI NOC");
356
357 /*
358 * TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN
359 * (out, active low)
360 */
361 if ((gpio_request(gpio + TWL4030_GPIO_MAX, "GPIO_USBH_CPEN") < 0) ||
362 (gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0) < 0))
363 pr_err("IGEP2: Could not obtain gpio for USBH_CPEN");
364
Enric Balletbo i Serrabee15392010-10-08 10:22:28 -0700365 /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
366#if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
367 if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
368 && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0)) {
369 gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
370 gpio_set_value(gpio + TWL4030_GPIO_MAX + 1, 0);
371 } else
372 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
373#else
374 igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
375#endif
376
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800377 return 0;
378};
379
Enric Balletbo i Serrabee15392010-10-08 10:22:28 -0700380static struct twl4030_gpio_platform_data igep2_twl4030_gpio_pdata = {
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800381 .gpio_base = OMAP_MAX_GPIO_LINES,
382 .irq_base = TWL4030_GPIO_IRQ_BASE,
383 .irq_end = TWL4030_GPIO_IRQ_END,
Enric Balletbo i Serrabee15392010-10-08 10:22:28 -0700384 .use_leds = true,
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800385 .setup = igep2_twl_gpio_setup,
386};
387
388static struct twl4030_usb_data igep2_usb_data = {
389 .usb_mode = T2_USB_MODE_ULPI,
390};
391
Enric Balletbo i Serra691de272010-02-17 14:09:26 -0800392static int igep2_enable_dvi(struct omap_dss_device *dssdev)
393{
394 gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1);
395
396 return 0;
397}
398
399static void igep2_disable_dvi(struct omap_dss_device *dssdev)
400{
401 gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);
402}
403
404static struct omap_dss_device igep2_dvi_device = {
405 .type = OMAP_DISPLAY_TYPE_DPI,
406 .name = "dvi",
407 .driver_name = "generic_panel",
408 .phy.dpi.data_lines = 24,
409 .platform_enable = igep2_enable_dvi,
410 .platform_disable = igep2_disable_dvi,
411};
412
413static struct omap_dss_device *igep2_dss_devices[] = {
414 &igep2_dvi_device
415};
416
417static struct omap_dss_board_info igep2_dss_data = {
418 .num_devices = ARRAY_SIZE(igep2_dss_devices),
419 .devices = igep2_dss_devices,
420 .default_device = &igep2_dvi_device,
421};
422
423static struct platform_device igep2_dss_device = {
424 .name = "omapdss",
425 .id = -1,
426 .dev = {
427 .platform_data = &igep2_dss_data,
428 },
429};
430
431static struct regulator_consumer_supply igep2_vpll2_supply = {
432 .supply = "vdds_dsi",
433 .dev = &igep2_dss_device.dev,
434};
435
436static struct regulator_init_data igep2_vpll2 = {
437 .constraints = {
438 .name = "VDVI",
439 .min_uV = 1800000,
440 .max_uV = 1800000,
441 .apply_uV = true,
442 .valid_modes_mask = REGULATOR_MODE_NORMAL
443 | REGULATOR_MODE_STANDBY,
444 .valid_ops_mask = REGULATOR_CHANGE_MODE
445 | REGULATOR_CHANGE_STATUS,
446 },
447 .num_consumer_supplies = 1,
448 .consumer_supplies = &igep2_vpll2_supply,
449};
450
451static void __init igep2_display_init(void)
452{
453 if (gpio_request(IGEP2_GPIO_DVI_PUP, "GPIO_DVI_PUP") &&
454 gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1))
455 pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n");
456}
Enric Balletbo i Serra228893f2010-03-01 11:18:08 +0000457
Enric Balletbo i Serra691de272010-02-17 14:09:26 -0800458static struct platform_device *igep2_devices[] __initdata = {
459 &igep2_dss_device,
460};
461
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800462static void __init igep2_init_irq(void)
463{
464 omap_board_config = igep2_config;
465 omap_board_config_size = ARRAY_SIZE(igep2_config);
Enric Balletbo i Serra22f1baa2010-02-17 14:09:27 -0800466 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params);
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800467 omap_init_irq();
468 omap_gpio_init();
469}
470
Enric Balletbo i Serra7f5f23d2010-02-17 14:09:25 -0800471static struct twl4030_codec_audio_data igep2_audio_data = {
472 .audio_mclk = 26000000,
473};
474
475static struct twl4030_codec_data igep2_codec_data = {
476 .audio_mclk = 26000000,
477 .audio = &igep2_audio_data,
478};
479
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800480static struct twl4030_platform_data igep2_twldata = {
481 .irq_base = TWL4030_IRQ_BASE,
482 .irq_end = TWL4030_IRQ_END,
483
484 /* platform_data for children goes here */
485 .usb = &igep2_usb_data,
Enric Balletbo i Serra7f5f23d2010-02-17 14:09:25 -0800486 .codec = &igep2_codec_data,
Enric Balletbo i Serrabee15392010-10-08 10:22:28 -0700487 .gpio = &igep2_twl4030_gpio_pdata,
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800488 .vmmc1 = &igep2_vmmc1,
Jonas Zetterbergc67b0d92010-02-14 19:33:24 +0000489 .vmmc2 = &igep2_vmmc2,
Enric Balletbo i Serra691de272010-02-17 14:09:26 -0800490 .vpll2 = &igep2_vpll2,
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800491
492};
493
494static struct i2c_board_info __initdata igep2_i2c_boardinfo[] = {
495 {
496 I2C_BOARD_INFO("twl4030", 0x48),
497 .flags = I2C_CLIENT_WAKE,
498 .irq = INT_34XX_SYS_NIRQ,
499 .platform_data = &igep2_twldata,
500 },
501};
502
503static int __init igep2_i2c_init(void)
504{
505 omap_register_i2c_bus(1, 2600, igep2_i2c_boardinfo,
506 ARRAY_SIZE(igep2_i2c_boardinfo));
507 /* Bus 3 is attached to the DVI port where devices like the pico DLP
508 * projector don't work reliably with 400kHz */
509 omap_register_i2c_bus(3, 100, NULL, 0);
510 return 0;
511}
512
Maulik Mankad884b8362010-02-17 14:09:30 -0800513static struct omap_musb_board_data musb_board_data = {
514 .interface_type = MUSB_INTERFACE_ULPI,
515 .mode = MUSB_OTG,
516 .power = 100,
517};
518
Felipe Balbi6f69a182010-03-04 09:45:53 +0200519static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
Enric Balletbo i Serraf6b74532010-03-01 15:02:36 +0000520 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
521 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
Enric Balletbo i Serrad08854862010-02-17 14:09:26 -0800522 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
523
524 .phy_reset = true,
Enric Balletbo i Serraf6b74532010-03-01 15:02:36 +0000525 .reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
526 .reset_gpio_port[1] = -EINVAL,
Enric Balletbo i Serrad08854862010-02-17 14:09:26 -0800527 .reset_gpio_port[2] = -EINVAL,
528};
529
Tony Lindgrenca5742b2009-12-11 16:16:32 -0800530#ifdef CONFIG_OMAP_MUX
531static struct omap_board_mux board_mux[] __initdata = {
532 { .reg_offset = OMAP_MUX_TERMINATOR },
533};
534#else
535#define board_mux NULL
536#endif
537
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800538static void __init igep2_init(void)
539{
Tony Lindgrenca5742b2009-12-11 16:16:32 -0800540 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800541 igep2_i2c_init();
Enric Balletbo i Serra691de272010-02-17 14:09:26 -0800542 platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800543 omap_serial_init();
Maulik Mankad884b8362010-02-17 14:09:30 -0800544 usb_musb_init(&musb_board_data);
Enric Balletbo i Serrad08854862010-02-17 14:09:26 -0800545 usb_ehci_init(&ehci_pdata);
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800546
Enric Balletbo i Serracddb4832010-02-17 14:09:26 -0800547 igep2_flash_init();
Enric Balletbo i Serrabee15392010-10-08 10:22:28 -0700548 igep2_leds_init();
Enric Balletbo i Serra691de272010-02-17 14:09:26 -0800549 igep2_display_init();
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800550 igep2_init_smsc911x();
551
Jonas Zetterbergc67b0d92010-02-14 19:33:24 +0000552 /* GPIO W-LAN + Bluetooth combo module */
553 if ((gpio_request(IGEP2_GPIO_WIFI_NPD, "GPIO_WIFI_NPD") == 0) &&
554 (gpio_direction_output(IGEP2_GPIO_WIFI_NPD, 1) == 0)) {
555 gpio_export(IGEP2_GPIO_WIFI_NPD, 0);
556/* gpio_set_value(IGEP2_GPIO_WIFI_NPD, 0); */
557 } else
558 pr_warning("IGEP v2: Could not obtain gpio GPIO_WIFI_NPD\n");
559
560 if ((gpio_request(IGEP2_GPIO_WIFI_NRESET, "GPIO_WIFI_NRESET") == 0) &&
561 (gpio_direction_output(IGEP2_GPIO_WIFI_NRESET, 1) == 0)) {
562 gpio_export(IGEP2_GPIO_WIFI_NRESET, 0);
563 gpio_set_value(IGEP2_GPIO_WIFI_NRESET, 0);
564 udelay(10);
565 gpio_set_value(IGEP2_GPIO_WIFI_NRESET, 1);
566 } else
567 pr_warning("IGEP v2: Could not obtain gpio GPIO_WIFI_NRESET\n");
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800568}
569
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800570MACHINE_START(IGEP0020, "IGEP v2 board")
571 .phys_io = 0x48000000,
572 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
573 .boot_params = 0x80000100,
Mike Rapoport869fef42010-08-04 14:43:18 +0300574 .map_io = omap3_map_io,
Russell King71ee7da2010-05-23 10:18:16 +0100575 .reserve = omap_reserve,
Enric Balletbo i Serra58e11162009-11-18 18:41:07 -0800576 .init_irq = igep2_init_irq,
577 .init_machine = igep2_init,
578 .timer = &omap_timer,
579MACHINE_END