ARM: OMAP: remove plat/board.h file
[pandora-kernel.git] / arch / arm / mach-omap2 / board-igep0020.c
1 /*
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 #include <linux/input.h>
21
22 #include <linux/regulator/machine.h>
23 #include <linux/regulator/fixed.h>
24 #include <linux/i2c/twl.h>
25 #include <linux/mmc/host.h>
26
27 #include <linux/mtd/nand.h>
28
29 #include <asm/mach-types.h>
30 #include <asm/mach/arch.h>
31
32 #include "common.h"
33 #include <plat/gpmc.h>
34 #include <plat/usb.h>
35 #include <video/omapdss.h>
36 #include <video/omap-panel-tfp410.h>
37 #include <plat/onenand.h>
38
39 #include "mux.h"
40 #include "hsmmc.h"
41 #include "sdram-numonyx-m65kxxxxam.h"
42 #include "common-board-devices.h"
43 #include "board-flash.h"
44 #include "control.h"
45
46 #define IGEP2_SMSC911X_CS       5
47 #define IGEP2_SMSC911X_GPIO     176
48 #define IGEP2_GPIO_USBH_NRESET  24
49 #define IGEP2_GPIO_LED0_GREEN   26
50 #define IGEP2_GPIO_LED0_RED     27
51 #define IGEP2_GPIO_LED1_RED     28
52 #define IGEP2_GPIO_DVI_PUP      170
53
54 #define IGEP2_RB_GPIO_WIFI_NPD     94
55 #define IGEP2_RB_GPIO_WIFI_NRESET  95
56 #define IGEP2_RB_GPIO_BT_NRESET    137
57 #define IGEP2_RC_GPIO_WIFI_NPD     138
58 #define IGEP2_RC_GPIO_WIFI_NRESET  139
59 #define IGEP2_RC_GPIO_BT_NRESET    137
60
61 #define IGEP3_GPIO_LED0_GREEN   54
62 #define IGEP3_GPIO_LED0_RED     53
63 #define IGEP3_GPIO_LED1_RED     16
64 #define IGEP3_GPIO_USBH_NRESET  183
65
66 #define IGEP_SYSBOOT_MASK           0x1f
67 #define IGEP_SYSBOOT_NAND           0x0f
68 #define IGEP_SYSBOOT_ONENAND        0x10
69
70 /*
71  * IGEP2 Hardware Revision Table
72  *
73  *  --------------------------------------------------------------------------
74  * | Id. | Hw Rev.            | HW0 (28) | WIFI_NPD | WIFI_NRESET | BT_NRESET |
75  *  --------------------------------------------------------------------------
76  * |  0  | B                  |   high   |  gpio94  |   gpio95    |     -     |
77  * |  0  | B/C (B-compatible) |   high   |  gpio94  |   gpio95    |  gpio137  |
78  * |  1  | C                  |   low    |  gpio138 |   gpio139   |  gpio137  |
79  *  --------------------------------------------------------------------------
80  */
81
82 #define IGEP2_BOARD_HWREV_B     0
83 #define IGEP2_BOARD_HWREV_C     1
84 #define IGEP3_BOARD_HWREV       2
85
86 static u8 hwrev;
87
88 static void __init igep2_get_revision(void)
89 {
90         u8 ret;
91
92         if (machine_is_igep0030()) {
93                 hwrev = IGEP3_BOARD_HWREV;
94                 return;
95         }
96
97         omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
98
99         if (gpio_request_one(IGEP2_GPIO_LED1_RED, GPIOF_IN, "GPIO_HW0_REV")) {
100                 pr_warning("IGEP2: Could not obtain gpio GPIO_HW0_REV\n");
101                 pr_err("IGEP2: Unknown Hardware Revision\n");
102                 return;
103         }
104
105         ret = gpio_get_value(IGEP2_GPIO_LED1_RED);
106         if (ret == 0) {
107                 pr_info("IGEP2: Hardware Revision C (B-NON compatible)\n");
108                 hwrev = IGEP2_BOARD_HWREV_C;
109         } else if (ret ==  1) {
110                 pr_info("IGEP2: Hardware Revision B/C (B compatible)\n");
111                 hwrev = IGEP2_BOARD_HWREV_B;
112         } else {
113                 pr_err("IGEP2: Unknown Hardware Revision\n");
114                 hwrev = -1;
115         }
116
117         gpio_free(IGEP2_GPIO_LED1_RED);
118 }
119
120 #if defined(CONFIG_MTD_ONENAND_OMAP2) ||                \
121         defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) ||     \
122         defined(CONFIG_MTD_NAND_OMAP2) ||               \
123         defined(CONFIG_MTD_NAND_OMAP2_MODULE)
124
125 #define ONENAND_MAP             0x20000000
126
127 /* NAND04GR4E1A ( x2 Flash built-in COMBO POP MEMORY )
128  * Since the device is equipped with two DataRAMs, and two-plane NAND
129  * Flash memory array, these two component enables simultaneous program
130  * of 4KiB. Plane1 has only even blocks such as block0, block2, block4
131  * while Plane2 has only odd blocks such as block1, block3, block5.
132  * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
133  */
134
135 static struct mtd_partition igep_flash_partitions[] = {
136         {
137                 .name           = "X-Loader",
138                 .offset         = 0,
139                 .size           = 2 * (64*(2*2048))
140         },
141         {
142                 .name           = "U-Boot",
143                 .offset         = MTDPART_OFS_APPEND,
144                 .size           = 6 * (64*(2*2048)),
145         },
146         {
147                 .name           = "Environment",
148                 .offset         = MTDPART_OFS_APPEND,
149                 .size           = 2 * (64*(2*2048)),
150         },
151         {
152                 .name           = "Kernel",
153                 .offset         = MTDPART_OFS_APPEND,
154                 .size           = 12 * (64*(2*2048)),
155         },
156         {
157                 .name           = "File System",
158                 .offset         = MTDPART_OFS_APPEND,
159                 .size           = MTDPART_SIZ_FULL,
160         },
161 };
162
163 static inline u32 igep_get_sysboot_value(void)
164 {
165         return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
166 }
167
168 static void __init igep_flash_init(void)
169 {
170         u32 mux;
171         mux = igep_get_sysboot_value();
172
173         if (mux == IGEP_SYSBOOT_NAND) {
174                 pr_info("IGEP: initializing NAND memory device\n");
175                 board_nand_init(igep_flash_partitions,
176                                 ARRAY_SIZE(igep_flash_partitions),
177                                 0, NAND_BUSWIDTH_16);
178         } else if (mux == IGEP_SYSBOOT_ONENAND) {
179                 pr_info("IGEP: initializing OneNAND memory device\n");
180                 board_onenand_init(igep_flash_partitions,
181                                    ARRAY_SIZE(igep_flash_partitions), 0);
182         } else {
183                 pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
184         }
185 }
186
187 #else
188 static void __init igep_flash_init(void) {}
189 #endif
190
191 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
192
193 #include <linux/smsc911x.h>
194 #include <plat/gpmc-smsc911x.h>
195
196 static struct omap_smsc911x_platform_data smsc911x_cfg = {
197         .cs             = IGEP2_SMSC911X_CS,
198         .gpio_irq       = IGEP2_SMSC911X_GPIO,
199         .gpio_reset     = -EINVAL,
200         .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
201 };
202
203 static inline void __init igep2_init_smsc911x(void)
204 {
205         gpmc_smsc911x_init(&smsc911x_cfg);
206 }
207
208 #else
209 static inline void __init igep2_init_smsc911x(void) { }
210 #endif
211
212 static struct regulator_consumer_supply igep_vmmc1_supply[] = {
213         REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
214 };
215
216 /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
217 static struct regulator_init_data igep_vmmc1 = {
218         .constraints = {
219                 .min_uV                 = 1850000,
220                 .max_uV                 = 3150000,
221                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
222                                         | REGULATOR_MODE_STANDBY,
223                 .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
224                                         | REGULATOR_CHANGE_MODE
225                                         | REGULATOR_CHANGE_STATUS,
226         },
227         .num_consumer_supplies  = ARRAY_SIZE(igep_vmmc1_supply),
228         .consumer_supplies      = igep_vmmc1_supply,
229 };
230
231 static struct regulator_consumer_supply igep_vio_supply[] = {
232         REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"),
233 };
234
235 static struct regulator_init_data igep_vio = {
236         .constraints = {
237                 .min_uV                 = 1800000,
238                 .max_uV                 = 1800000,
239                 .apply_uV               = 1,
240                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
241                                         | REGULATOR_MODE_STANDBY,
242                 .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
243                                         | REGULATOR_CHANGE_MODE
244                                         | REGULATOR_CHANGE_STATUS,
245         },
246         .num_consumer_supplies  = ARRAY_SIZE(igep_vio_supply),
247         .consumer_supplies      = igep_vio_supply,
248 };
249
250 static struct regulator_consumer_supply igep_vmmc2_supply[] = {
251         REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
252 };
253
254 static struct regulator_init_data igep_vmmc2 = {
255         .constraints            = {
256                 .valid_modes_mask       = REGULATOR_MODE_NORMAL,
257                 .always_on              = 1,
258         },
259         .num_consumer_supplies  = ARRAY_SIZE(igep_vmmc2_supply),
260         .consumer_supplies      = igep_vmmc2_supply,
261 };
262
263 static struct fixed_voltage_config igep_vwlan = {
264         .supply_name            = "vwlan",
265         .microvolts             = 3300000,
266         .gpio                   = -EINVAL,
267         .enabled_at_boot        = 1,
268         .init_data              = &igep_vmmc2,
269 };
270
271 static struct platform_device igep_vwlan_device = {
272         .name           = "reg-fixed-voltage",
273         .id             = 0,
274         .dev = {
275                 .platform_data  = &igep_vwlan,
276         },
277 };
278
279 static struct omap2_hsmmc_info mmc[] = {
280         {
281                 .mmc            = 1,
282                 .caps           = MMC_CAP_4_BIT_DATA,
283                 .gpio_cd        = -EINVAL,
284                 .gpio_wp        = -EINVAL,
285                 .deferred       = true,
286         },
287 #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
288         {
289                 .mmc            = 2,
290                 .caps           = MMC_CAP_4_BIT_DATA,
291                 .gpio_cd        = -EINVAL,
292                 .gpio_wp        = -EINVAL,
293         },
294 #endif
295         {}      /* Terminator */
296 };
297
298 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
299 #include <linux/leds.h>
300
301 static struct gpio_led igep_gpio_leds[] = {
302         [0] = {
303                 .name                   = "gpio-led:red:d0",
304                 .default_trigger        = "default-off"
305         },
306         [1] = {
307                 .name                   = "gpio-led:green:d0",
308                 .default_trigger        = "default-off",
309         },
310         [2] = {
311                 .name                   = "gpio-led:red:d1",
312                 .default_trigger        = "default-off",
313         },
314         [3] = {
315                 .name                   = "gpio-led:green:d1",
316                 .default_trigger        = "heartbeat",
317                 .gpio                   = -EINVAL, /* gets replaced */
318                 .active_low             = 1,
319         },
320 };
321
322 static struct gpio_led_platform_data igep_led_pdata = {
323         .leds           = igep_gpio_leds,
324         .num_leds       = ARRAY_SIZE(igep_gpio_leds),
325 };
326
327 static struct platform_device igep_led_device = {
328          .name   = "leds-gpio",
329          .id     = -1,
330          .dev    = {
331                  .platform_data  =  &igep_led_pdata,
332         },
333 };
334
335 static void __init igep_leds_init(void)
336 {
337         if (machine_is_igep0020()) {
338                 igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
339                 igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
340                 igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
341         } else {
342                 igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
343                 igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
344                 igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
345         }
346
347         platform_device_register(&igep_led_device);
348 }
349
350 #else
351 static struct gpio igep_gpio_leds[] __initdata = {
352         { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:red:d0"   },
353         { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" },
354         { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:red:d1"   },
355 };
356
357 static inline void igep_leds_init(void)
358 {
359         int i;
360
361         if (machine_is_igep0020()) {
362                 igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
363                 igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
364                 igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
365         } else {
366                 igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
367                 igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
368                 igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
369         }
370
371         if (gpio_request_array(igep_gpio_leds, ARRAY_SIZE(igep_gpio_leds))) {
372                 pr_warning("IGEP v2: Could not obtain leds gpios\n");
373                 return;
374         }
375
376         for (i = 0; i < ARRAY_SIZE(igep_gpio_leds); i++)
377                 gpio_export(igep_gpio_leds[i].gpio, 0);
378 }
379 #endif
380
381 static struct gpio igep2_twl_gpios[] = {
382         { -EINVAL, GPIOF_IN,            "GPIO_EHCI_NOC"  },
383         { -EINVAL, GPIOF_OUT_INIT_LOW,  "GPIO_USBH_CPEN" },
384 };
385
386 static int igep_twl_gpio_setup(struct device *dev,
387                 unsigned gpio, unsigned ngpio)
388 {
389         int ret;
390
391         /* gpio + 0 is "mmc0_cd" (input/IRQ) */
392         mmc[0].gpio_cd = gpio + 0;
393         omap_hsmmc_late_init(mmc);
394
395         /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
396 #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
397         ret = gpio_request_one(gpio + TWL4030_GPIO_MAX + 1, GPIOF_OUT_INIT_HIGH,
398                                "gpio-led:green:d1");
399         if (ret == 0)
400                 gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
401         else
402                 pr_warning("IGEP: Could not obtain gpio GPIO_LED1_GREEN\n");
403 #else
404         igep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
405 #endif
406
407         if (machine_is_igep0030())
408                 return 0;
409
410         /*
411          * REVISIT: need ehci-omap hooks for external VBUS
412          * power switch and overcurrent detect
413          */
414         igep2_twl_gpios[0].gpio = gpio + 1;
415
416         /* TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN (out, active low) */
417         igep2_twl_gpios[1].gpio = gpio + TWL4030_GPIO_MAX;
418
419         ret = gpio_request_array(igep2_twl_gpios, ARRAY_SIZE(igep2_twl_gpios));
420         if (ret < 0)
421                 pr_err("IGEP2: Could not obtain gpio for USBH_CPEN");
422
423         return 0;
424 };
425
426 static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = {
427         .gpio_base      = OMAP_MAX_GPIO_LINES,
428         .irq_base       = TWL4030_GPIO_IRQ_BASE,
429         .irq_end        = TWL4030_GPIO_IRQ_END,
430         .use_leds       = true,
431         .setup          = igep_twl_gpio_setup,
432 };
433
434 static struct tfp410_platform_data dvi_panel = {
435         .i2c_bus_num            = 3,
436         .power_down_gpio        = IGEP2_GPIO_DVI_PUP,
437 };
438
439 static struct omap_dss_device igep2_dvi_device = {
440         .type                   = OMAP_DISPLAY_TYPE_DPI,
441         .name                   = "dvi",
442         .driver_name            = "tfp410",
443         .data                   = &dvi_panel,
444         .phy.dpi.data_lines     = 24,
445 };
446
447 static struct omap_dss_device *igep2_dss_devices[] = {
448         &igep2_dvi_device
449 };
450
451 static struct omap_dss_board_info igep2_dss_data = {
452         .num_devices    = ARRAY_SIZE(igep2_dss_devices),
453         .devices        = igep2_dss_devices,
454         .default_device = &igep2_dvi_device,
455 };
456
457 static struct platform_device *igep_devices[] __initdata = {
458         &igep_vwlan_device,
459 };
460
461 static int igep2_keymap[] = {
462         KEY(0, 0, KEY_LEFT),
463         KEY(0, 1, KEY_RIGHT),
464         KEY(0, 2, KEY_A),
465         KEY(0, 3, KEY_B),
466         KEY(1, 0, KEY_DOWN),
467         KEY(1, 1, KEY_UP),
468         KEY(1, 2, KEY_E),
469         KEY(1, 3, KEY_F),
470         KEY(2, 0, KEY_ENTER),
471         KEY(2, 1, KEY_I),
472         KEY(2, 2, KEY_J),
473         KEY(2, 3, KEY_K),
474         KEY(3, 0, KEY_M),
475         KEY(3, 1, KEY_N),
476         KEY(3, 2, KEY_O),
477         KEY(3, 3, KEY_P)
478 };
479
480 static struct matrix_keymap_data igep2_keymap_data = {
481         .keymap                 = igep2_keymap,
482         .keymap_size            = ARRAY_SIZE(igep2_keymap),
483 };
484
485 static struct twl4030_keypad_data igep2_keypad_pdata = {
486         .keymap_data    = &igep2_keymap_data,
487         .rows           = 4,
488         .cols           = 4,
489         .rep            = 1,
490 };
491
492 static struct twl4030_platform_data igep_twldata = {
493         /* platform_data for children goes here */
494         .gpio           = &igep_twl4030_gpio_pdata,
495         .vmmc1          = &igep_vmmc1,
496         .vio            = &igep_vio,
497 };
498
499 static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
500         {
501                 I2C_BOARD_INFO("eeprom", 0x50),
502         },
503 };
504
505 static void __init igep_i2c_init(void)
506 {
507         int ret;
508
509         omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_USB,
510                               TWL_COMMON_REGULATOR_VPLL2);
511         igep_twldata.vpll2->constraints.apply_uV = true;
512         igep_twldata.vpll2->constraints.name = "VDVI";
513
514         if (machine_is_igep0020()) {
515                 /*
516                  * Bus 3 is attached to the DVI port where devices like the
517                  * pico DLP projector don't work reliably with 400kHz
518                  */
519                 ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
520                                             ARRAY_SIZE(igep2_i2c3_boardinfo));
521                 if (ret)
522                         pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
523
524                 igep_twldata.keypad     = &igep2_keypad_pdata;
525                 /* Get common pmic data */
526                 omap3_pmic_get_config(&igep_twldata, TWL_COMMON_PDATA_AUDIO, 0);
527         }
528
529         omap3_pmic_init("twl4030", &igep_twldata);
530 }
531
532 static const struct usbhs_omap_board_data igep2_usbhs_bdata __initconst = {
533         .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
534         .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
535         .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
536
537         .phy_reset = true,
538         .reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
539         .reset_gpio_port[1] = -EINVAL,
540         .reset_gpio_port[2] = -EINVAL,
541 };
542
543 static const struct usbhs_omap_board_data igep3_usbhs_bdata __initconst = {
544         .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
545         .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
546         .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
547
548         .phy_reset = true,
549         .reset_gpio_port[0] = -EINVAL,
550         .reset_gpio_port[1] = IGEP3_GPIO_USBH_NRESET,
551         .reset_gpio_port[2] = -EINVAL,
552 };
553
554 #ifdef CONFIG_OMAP_MUX
555 static struct omap_board_mux board_mux[] __initdata = {
556         /* SMSC9221 LAN Controller ETH IRQ (GPIO_176) */
557         OMAP3_MUX(MCSPI1_CS2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
558         { .reg_offset = OMAP_MUX_TERMINATOR },
559 };
560 #endif
561
562 #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
563 static struct gpio igep_wlan_bt_gpios[] __initdata = {
564         { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_NPD"    },
565         { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_NRESET" },
566         { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_BT_NRESET"   },
567 };
568
569 static void __init igep_wlan_bt_init(void)
570 {
571         int err;
572
573         /* GPIO's for WLAN-BT combo depends on hardware revision */
574         if (hwrev == IGEP2_BOARD_HWREV_B) {
575                 igep_wlan_bt_gpios[0].gpio = IGEP2_RB_GPIO_WIFI_NPD;
576                 igep_wlan_bt_gpios[1].gpio = IGEP2_RB_GPIO_WIFI_NRESET;
577                 igep_wlan_bt_gpios[2].gpio = IGEP2_RB_GPIO_BT_NRESET;
578         } else if (hwrev == IGEP2_BOARD_HWREV_C || machine_is_igep0030()) {
579                 igep_wlan_bt_gpios[0].gpio = IGEP2_RC_GPIO_WIFI_NPD;
580                 igep_wlan_bt_gpios[1].gpio = IGEP2_RC_GPIO_WIFI_NRESET;
581                 igep_wlan_bt_gpios[2].gpio = IGEP2_RC_GPIO_BT_NRESET;
582         } else
583                 return;
584
585         err = gpio_request_array(igep_wlan_bt_gpios,
586                                  ARRAY_SIZE(igep_wlan_bt_gpios));
587         if (err) {
588                 pr_warning("IGEP2: Could not obtain WIFI/BT gpios\n");
589                 return;
590         }
591
592         gpio_export(igep_wlan_bt_gpios[0].gpio, 0);
593         gpio_export(igep_wlan_bt_gpios[1].gpio, 0);
594         gpio_export(igep_wlan_bt_gpios[2].gpio, 0);
595
596         gpio_set_value(igep_wlan_bt_gpios[1].gpio, 0);
597         udelay(10);
598         gpio_set_value(igep_wlan_bt_gpios[1].gpio, 1);
599
600 }
601 #else
602 static inline void __init igep_wlan_bt_init(void) { }
603 #endif
604
605 static struct regulator_consumer_supply dummy_supplies[] = {
606         REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
607         REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
608 };
609
610 static void __init igep_init(void)
611 {
612         regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies));
613         omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
614
615         /* Get IGEP2 hardware revision */
616         igep2_get_revision();
617
618         omap_hsmmc_init(mmc);
619
620         /* Register I2C busses and drivers */
621         igep_i2c_init();
622         platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices));
623         omap_serial_init();
624         omap_sdrc_init(m65kxxxxam_sdrc_params,
625                                   m65kxxxxam_sdrc_params);
626         usb_musb_init(NULL);
627
628         igep_flash_init();
629         igep_leds_init();
630
631         /*
632          * WLAN-BT combo module from MuRata which has a Marvell WLAN
633          * (88W8686) + CSR Bluetooth chipset. Uses SDIO interface.
634          */
635         igep_wlan_bt_init();
636
637         if (machine_is_igep0020()) {
638                 omap_display_init(&igep2_dss_data);
639                 igep2_init_smsc911x();
640                 usbhs_init(&igep2_usbhs_bdata);
641         } else {
642                 usbhs_init(&igep3_usbhs_bdata);
643         }
644 }
645
646 MACHINE_START(IGEP0020, "IGEP v2 board")
647         .atag_offset    = 0x100,
648         .reserve        = omap_reserve,
649         .map_io         = omap3_map_io,
650         .init_early     = omap35xx_init_early,
651         .init_irq       = omap3_init_irq,
652         .handle_irq     = omap3_intc_handle_irq,
653         .init_machine   = igep_init,
654         .init_late      = omap35xx_init_late,
655         .timer          = &omap3_timer,
656         .restart        = omap_prcm_restart,
657 MACHINE_END
658
659 MACHINE_START(IGEP0030, "IGEP OMAP3 module")
660         .atag_offset    = 0x100,
661         .reserve        = omap_reserve,
662         .map_io         = omap3_map_io,
663         .init_early     = omap35xx_init_early,
664         .init_irq       = omap3_init_irq,
665         .handle_irq     = omap3_intc_handle_irq,
666         .init_machine   = igep_init,
667         .init_late      = omap35xx_init_late,
668         .timer          = &omap3_timer,
669         .restart        = omap_prcm_restart,
670 MACHINE_END