board-igep0020.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  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. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/delay.h>
  14. #include <linux/err.h>
  15. #include <linux/clk.h>
  16. #include <linux/io.h>
  17. #include <linux/gpio.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/input.h>
  20. #include <linux/regulator/machine.h>
  21. #include <linux/regulator/fixed.h>
  22. #include <linux/i2c/twl.h>
  23. #include <linux/mmc/host.h>
  24. #include <asm/mach-types.h>
  25. #include <asm/mach/arch.h>
  26. #include <plat/board.h>
  27. #include <plat/common.h>
  28. #include <plat/gpmc.h>
  29. #include <plat/usb.h>
  30. #include <plat/display.h>
  31. #include <plat/panel-generic-dpi.h>
  32. #include <plat/onenand.h>
  33. #include "mux.h"
  34. #include "hsmmc.h"
  35. #include "sdram-numonyx-m65kxxxxam.h"
  36. #include "common-board-devices.h"
  37. #define IGEP2_SMSC911X_CS 5
  38. #define IGEP2_SMSC911X_GPIO 176
  39. #define IGEP2_GPIO_USBH_NRESET 24
  40. #define IGEP2_GPIO_LED0_GREEN 26
  41. #define IGEP2_GPIO_LED0_RED 27
  42. #define IGEP2_GPIO_LED1_RED 28
  43. #define IGEP2_GPIO_DVI_PUP 170
  44. #define IGEP2_RB_GPIO_WIFI_NPD 94
  45. #define IGEP2_RB_GPIO_WIFI_NRESET 95
  46. #define IGEP2_RB_GPIO_BT_NRESET 137
  47. #define IGEP2_RC_GPIO_WIFI_NPD 138
  48. #define IGEP2_RC_GPIO_WIFI_NRESET 139
  49. #define IGEP2_RC_GPIO_BT_NRESET 137
  50. /*
  51. * IGEP2 Hardware Revision Table
  52. *
  53. * --------------------------------------------------------------------------
  54. * | Id. | Hw Rev. | HW0 (28) | WIFI_NPD | WIFI_NRESET | BT_NRESET |
  55. * --------------------------------------------------------------------------
  56. * | 0 | B | high | gpio94 | gpio95 | - |
  57. * | 0 | B/C (B-compatible) | high | gpio94 | gpio95 | gpio137 |
  58. * | 1 | C | low | gpio138 | gpio139 | gpio137 |
  59. * --------------------------------------------------------------------------
  60. */
  61. #define IGEP2_BOARD_HWREV_B 0
  62. #define IGEP2_BOARD_HWREV_C 1
  63. static u8 hwrev;
  64. static void __init igep2_get_revision(void)
  65. {
  66. u8 ret;
  67. omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
  68. if (gpio_request_one(IGEP2_GPIO_LED1_RED, GPIOF_IN, "GPIO_HW0_REV")) {
  69. pr_warning("IGEP2: Could not obtain gpio GPIO_HW0_REV\n");
  70. pr_err("IGEP2: Unknown Hardware Revision\n");
  71. return;
  72. }
  73. ret = gpio_get_value(IGEP2_GPIO_LED1_RED);
  74. if (ret == 0) {
  75. pr_info("IGEP2: Hardware Revision C (B-NON compatible)\n");
  76. hwrev = IGEP2_BOARD_HWREV_C;
  77. } else if (ret == 1) {
  78. pr_info("IGEP2: Hardware Revision B/C (B compatible)\n");
  79. hwrev = IGEP2_BOARD_HWREV_B;
  80. } else {
  81. pr_err("IGEP2: Unknown Hardware Revision\n");
  82. hwrev = -1;
  83. }
  84. gpio_free(IGEP2_GPIO_LED1_RED);
  85. }
  86. #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
  87. defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
  88. #define ONENAND_MAP 0x20000000
  89. /* NAND04GR4E1A ( x2 Flash built-in COMBO POP MEMORY )
  90. * Since the device is equipped with two DataRAMs, and two-plane NAND
  91. * Flash memory array, these two component enables simultaneous program
  92. * of 4KiB. Plane1 has only even blocks such as block0, block2, block4
  93. * while Plane2 has only odd blocks such as block1, block3, block5.
  94. * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
  95. */
  96. static struct mtd_partition igep_onenand_partitions[] = {
  97. {
  98. .name = "X-Loader",
  99. .offset = 0,
  100. .size = 2 * (64*(2*2048))
  101. },
  102. {
  103. .name = "U-Boot",
  104. .offset = MTDPART_OFS_APPEND,
  105. .size = 6 * (64*(2*2048)),
  106. },
  107. {
  108. .name = "Environment",
  109. .offset = MTDPART_OFS_APPEND,
  110. .size = 2 * (64*(2*2048)),
  111. },
  112. {
  113. .name = "Kernel",
  114. .offset = MTDPART_OFS_APPEND,
  115. .size = 12 * (64*(2*2048)),
  116. },
  117. {
  118. .name = "File System",
  119. .offset = MTDPART_OFS_APPEND,
  120. .size = MTDPART_SIZ_FULL,
  121. },
  122. };
  123. static struct omap_onenand_platform_data igep_onenand_data = {
  124. .parts = igep_onenand_partitions,
  125. .nr_parts = ARRAY_SIZE(igep_onenand_partitions),
  126. .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */
  127. };
  128. static struct platform_device igep_onenand_device = {
  129. .name = "omap2-onenand",
  130. .id = -1,
  131. .dev = {
  132. .platform_data = &igep_onenand_data,
  133. },
  134. };
  135. static void __init igep_flash_init(void)
  136. {
  137. u8 cs = 0;
  138. u8 onenandcs = GPMC_CS_NUM + 1;
  139. for (cs = 0; cs < GPMC_CS_NUM; cs++) {
  140. u32 ret;
  141. ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
  142. /* Check if NAND/oneNAND is configured */
  143. if ((ret & 0xC00) == 0x800)
  144. /* NAND found */
  145. pr_err("IGEP: Unsupported NAND found\n");
  146. else {
  147. ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
  148. if ((ret & 0x3F) == (ONENAND_MAP >> 24))
  149. /* ONENAND found */
  150. onenandcs = cs;
  151. }
  152. }
  153. if (onenandcs > GPMC_CS_NUM) {
  154. pr_err("IGEP: Unable to find configuration in GPMC\n");
  155. return;
  156. }
  157. igep_onenand_data.cs = onenandcs;
  158. if (platform_device_register(&igep_onenand_device) < 0)
  159. pr_err("IGEP: Unable to register OneNAND device\n");
  160. }
  161. #else
  162. static void __init igep_flash_init(void) {}
  163. #endif
  164. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  165. #include <linux/smsc911x.h>
  166. #include <plat/gpmc-smsc911x.h>
  167. static struct omap_smsc911x_platform_data smsc911x_cfg = {
  168. .cs = IGEP2_SMSC911X_CS,
  169. .gpio_irq = IGEP2_SMSC911X_GPIO,
  170. .gpio_reset = -EINVAL,
  171. .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  172. };
  173. static inline void __init igep2_init_smsc911x(void)
  174. {
  175. gpmc_smsc911x_init(&smsc911x_cfg);
  176. }
  177. #else
  178. static inline void __init igep2_init_smsc911x(void) { }
  179. #endif
  180. static struct regulator_consumer_supply igep_vmmc1_supply =
  181. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
  182. /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
  183. static struct regulator_init_data igep_vmmc1 = {
  184. .constraints = {
  185. .min_uV = 1850000,
  186. .max_uV = 3150000,
  187. .valid_modes_mask = REGULATOR_MODE_NORMAL
  188. | REGULATOR_MODE_STANDBY,
  189. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  190. | REGULATOR_CHANGE_MODE
  191. | REGULATOR_CHANGE_STATUS,
  192. },
  193. .num_consumer_supplies = 1,
  194. .consumer_supplies = &igep_vmmc1_supply,
  195. };
  196. static struct regulator_consumer_supply igep_vio_supply =
  197. REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
  198. static struct regulator_init_data igep_vio = {
  199. .constraints = {
  200. .min_uV = 1800000,
  201. .max_uV = 1800000,
  202. .apply_uV = 1,
  203. .valid_modes_mask = REGULATOR_MODE_NORMAL
  204. | REGULATOR_MODE_STANDBY,
  205. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  206. | REGULATOR_CHANGE_MODE
  207. | REGULATOR_CHANGE_STATUS,
  208. },
  209. .num_consumer_supplies = 1,
  210. .consumer_supplies = &igep_vio_supply,
  211. };
  212. static struct regulator_consumer_supply igep_vmmc2_supply =
  213. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
  214. static struct regulator_init_data igep_vmmc2 = {
  215. .constraints = {
  216. .valid_modes_mask = REGULATOR_MODE_NORMAL,
  217. .always_on = 1,
  218. },
  219. .num_consumer_supplies = 1,
  220. .consumer_supplies = &igep_vmmc2_supply,
  221. };
  222. static struct fixed_voltage_config igep_vwlan = {
  223. .supply_name = "vwlan",
  224. .microvolts = 3300000,
  225. .gpio = -EINVAL,
  226. .enabled_at_boot = 1,
  227. .init_data = &igep_vmmc2,
  228. };
  229. static struct platform_device igep_vwlan_device = {
  230. .name = "reg-fixed-voltage",
  231. .id = 0,
  232. .dev = {
  233. .platform_data = &igep_vwlan,
  234. },
  235. };
  236. static struct omap2_hsmmc_info mmc[] = {
  237. {
  238. .mmc = 1,
  239. .caps = MMC_CAP_4_BIT_DATA,
  240. .gpio_cd = -EINVAL,
  241. .gpio_wp = -EINVAL,
  242. },
  243. #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
  244. {
  245. .mmc = 2,
  246. .caps = MMC_CAP_4_BIT_DATA,
  247. .gpio_cd = -EINVAL,
  248. .gpio_wp = -EINVAL,
  249. },
  250. #endif
  251. {} /* Terminator */
  252. };
  253. #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
  254. #include <linux/leds.h>
  255. static struct gpio_led igep_gpio_leds[] = {
  256. [0] = {
  257. .name = "gpio-led:red:d0",
  258. .gpio = IGEP2_GPIO_LED0_RED,
  259. .default_trigger = "default-off"
  260. },
  261. [1] = {
  262. .name = "gpio-led:green:d0",
  263. .gpio = IGEP2_GPIO_LED0_GREEN,
  264. .default_trigger = "default-off",
  265. },
  266. [2] = {
  267. .name = "gpio-led:red:d1",
  268. .gpio = IGEP2_GPIO_LED1_RED,
  269. .default_trigger = "default-off",
  270. },
  271. [3] = {
  272. .name = "gpio-led:green:d1",
  273. .default_trigger = "heartbeat",
  274. .gpio = -EINVAL, /* gets replaced */
  275. .active_low = 1,
  276. },
  277. };
  278. static struct gpio_led_platform_data igep_led_pdata = {
  279. .leds = igep_gpio_leds,
  280. .num_leds = ARRAY_SIZE(igep_gpio_leds),
  281. };
  282. static struct platform_device igep_led_device = {
  283. .name = "leds-gpio",
  284. .id = -1,
  285. .dev = {
  286. .platform_data = &igep_led_pdata,
  287. },
  288. };
  289. static void __init igep_leds_init(void)
  290. {
  291. platform_device_register(&igep_led_device);
  292. }
  293. #else
  294. static struct gpio igep_gpio_leds[] __initdata = {
  295. { IGEP2_GPIO_LED0_RED, GPIOF_OUT_INIT_LOW, "gpio-led:red:d0" },
  296. { IGEP2_GPIO_LED0_GREEN, GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" },
  297. { IGEP2_GPIO_LED1_RED, GPIOF_OUT_INIT_LOW, "gpio-led:red:d1" },
  298. };
  299. static inline void igep_leds_init(void)
  300. {
  301. if (gpio_request_array(igep_gpio_leds, ARRAY_SIZE(igep_gpio_leds))) {
  302. pr_warning("IGEP v2: Could not obtain leds gpios\n");
  303. return;
  304. }
  305. gpio_export(IGEP2_GPIO_LED0_RED, 0);
  306. gpio_export(IGEP2_GPIO_LED0_GREEN, 0);
  307. gpio_export(IGEP2_GPIO_LED1_RED, 0);
  308. }
  309. #endif
  310. static struct gpio igep2_twl_gpios[] = {
  311. { -EINVAL, GPIOF_IN, "GPIO_EHCI_NOC" },
  312. { -EINVAL, GPIOF_OUT_INIT_LOW, "GPIO_USBH_CPEN" },
  313. };
  314. static int igep_twl_gpio_setup(struct device *dev,
  315. unsigned gpio, unsigned ngpio)
  316. {
  317. int ret;
  318. /* gpio + 0 is "mmc0_cd" (input/IRQ) */
  319. mmc[0].gpio_cd = gpio + 0;
  320. omap2_hsmmc_init(mmc);
  321. /*
  322. * REVISIT: need ehci-omap hooks for external VBUS
  323. * power switch and overcurrent detect
  324. */
  325. igep2_twl_gpios[0].gpio = gpio + 1;
  326. /* TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN (out, active low) */
  327. igep2_twl_gpios[1].gpio = gpio + TWL4030_GPIO_MAX;
  328. ret = gpio_request_array(igep2_twl_gpios, ARRAY_SIZE(igep2_twl_gpios));
  329. if (ret < 0)
  330. pr_err("IGEP2: Could not obtain gpio for USBH_CPEN");
  331. /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
  332. #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
  333. ret = gpio_request_one(gpio + TWL4030_GPIO_MAX + 1, GPIOF_OUT_INIT_HIGH,
  334. "gpio-led:green:d1");
  335. if (ret == 0)
  336. gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
  337. else
  338. pr_warning("IGEP: Could not obtain gpio GPIO_LED1_GREEN\n");
  339. #else
  340. igep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
  341. #endif
  342. return 0;
  343. };
  344. static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = {
  345. .gpio_base = OMAP_MAX_GPIO_LINES,
  346. .irq_base = TWL4030_GPIO_IRQ_BASE,
  347. .irq_end = TWL4030_GPIO_IRQ_END,
  348. .use_leds = true,
  349. .setup = igep_twl_gpio_setup,
  350. };
  351. static struct twl4030_usb_data igep_usb_data = {
  352. .usb_mode = T2_USB_MODE_ULPI,
  353. };
  354. static int igep2_enable_dvi(struct omap_dss_device *dssdev)
  355. {
  356. gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1);
  357. return 0;
  358. }
  359. static void igep2_disable_dvi(struct omap_dss_device *dssdev)
  360. {
  361. gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);
  362. }
  363. static struct panel_generic_dpi_data dvi_panel = {
  364. .name = "generic",
  365. .platform_enable = igep2_enable_dvi,
  366. .platform_disable = igep2_disable_dvi,
  367. };
  368. static struct omap_dss_device igep2_dvi_device = {
  369. .type = OMAP_DISPLAY_TYPE_DPI,
  370. .name = "dvi",
  371. .driver_name = "generic_dpi_panel",
  372. .data = &dvi_panel,
  373. .phy.dpi.data_lines = 24,
  374. };
  375. static struct omap_dss_device *igep2_dss_devices[] = {
  376. &igep2_dvi_device
  377. };
  378. static struct omap_dss_board_info igep2_dss_data = {
  379. .num_devices = ARRAY_SIZE(igep2_dss_devices),
  380. .devices = igep2_dss_devices,
  381. .default_device = &igep2_dvi_device,
  382. };
  383. static struct regulator_consumer_supply igep2_vpll2_supplies[] = {
  384. REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
  385. REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
  386. };
  387. static struct regulator_init_data igep2_vpll2 = {
  388. .constraints = {
  389. .name = "VDVI",
  390. .min_uV = 1800000,
  391. .max_uV = 1800000,
  392. .apply_uV = true,
  393. .valid_modes_mask = REGULATOR_MODE_NORMAL
  394. | REGULATOR_MODE_STANDBY,
  395. .valid_ops_mask = REGULATOR_CHANGE_MODE
  396. | REGULATOR_CHANGE_STATUS,
  397. },
  398. .num_consumer_supplies = ARRAY_SIZE(igep2_vpll2_supplies),
  399. .consumer_supplies = igep2_vpll2_supplies,
  400. };
  401. static void __init igep2_display_init(void)
  402. {
  403. int err = gpio_request_one(IGEP2_GPIO_DVI_PUP, GPIOF_OUT_INIT_HIGH,
  404. "GPIO_DVI_PUP");
  405. if (err)
  406. pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n");
  407. }
  408. static struct platform_device *igep_devices[] __initdata = {
  409. &igep_vwlan_device,
  410. };
  411. static void __init igep_init_early(void)
  412. {
  413. omap2_init_common_infrastructure();
  414. omap2_init_common_devices(m65kxxxxam_sdrc_params,
  415. m65kxxxxam_sdrc_params);
  416. }
  417. static struct twl4030_codec_audio_data igep2_audio_data;
  418. static struct twl4030_codec_data igep2_codec_data = {
  419. .audio_mclk = 26000000,
  420. .audio = &igep2_audio_data,
  421. };
  422. static int igep2_keymap[] = {
  423. KEY(0, 0, KEY_LEFT),
  424. KEY(0, 1, KEY_RIGHT),
  425. KEY(0, 2, KEY_A),
  426. KEY(0, 3, KEY_B),
  427. KEY(1, 0, KEY_DOWN),
  428. KEY(1, 1, KEY_UP),
  429. KEY(1, 2, KEY_E),
  430. KEY(1, 3, KEY_F),
  431. KEY(2, 0, KEY_ENTER),
  432. KEY(2, 1, KEY_I),
  433. KEY(2, 2, KEY_J),
  434. KEY(2, 3, KEY_K),
  435. KEY(3, 0, KEY_M),
  436. KEY(3, 1, KEY_N),
  437. KEY(3, 2, KEY_O),
  438. KEY(3, 3, KEY_P)
  439. };
  440. static struct matrix_keymap_data igep2_keymap_data = {
  441. .keymap = igep2_keymap,
  442. .keymap_size = ARRAY_SIZE(igep2_keymap),
  443. };
  444. static struct twl4030_keypad_data igep2_keypad_pdata = {
  445. .keymap_data = &igep2_keymap_data,
  446. .rows = 4,
  447. .cols = 4,
  448. .rep = 1,
  449. };
  450. static struct twl4030_platform_data igep_twldata = {
  451. .irq_base = TWL4030_IRQ_BASE,
  452. .irq_end = TWL4030_IRQ_END,
  453. /* platform_data for children goes here */
  454. .usb = &igep_usb_data,
  455. .codec = &igep2_codec_data,
  456. .gpio = &igep_twl4030_gpio_pdata,
  457. .keypad = &igep2_keypad_pdata,
  458. .vmmc1 = &igep_vmmc1,
  459. .vpll2 = &igep2_vpll2,
  460. .vio = &igep_vio,
  461. };
  462. static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
  463. {
  464. I2C_BOARD_INFO("eeprom", 0x50),
  465. },
  466. };
  467. static void __init igep_i2c_init(void)
  468. {
  469. int ret;
  470. omap3_pmic_init("twl4030", &igep_twldata);
  471. /*
  472. * Bus 3 is attached to the DVI port where devices like the pico DLP
  473. * projector don't work reliably with 400kHz
  474. */
  475. ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
  476. ARRAY_SIZE(igep2_i2c3_boardinfo));
  477. if (ret)
  478. pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
  479. }
  480. static const struct usbhs_omap_board_data igep2_usbhs_bdata __initconst = {
  481. .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
  482. .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
  483. .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
  484. .phy_reset = true,
  485. .reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
  486. .reset_gpio_port[1] = -EINVAL,
  487. .reset_gpio_port[2] = -EINVAL,
  488. };
  489. #ifdef CONFIG_OMAP_MUX
  490. static struct omap_board_mux board_mux[] __initdata = {
  491. { .reg_offset = OMAP_MUX_TERMINATOR },
  492. };
  493. #endif
  494. #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
  495. static struct gpio igep_wlan_bt_gpios[] __initdata = {
  496. { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_NPD" },
  497. { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_NRESET" },
  498. { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_BT_NRESET" },
  499. };
  500. static void __init igep_wlan_bt_init(void)
  501. {
  502. int err;
  503. /* GPIO's for WLAN-BT combo depends on hardware revision */
  504. if (hwrev == IGEP2_BOARD_HWREV_B) {
  505. igep_wlan_bt_gpios[0].gpio = IGEP2_RB_GPIO_WIFI_NPD;
  506. igep_wlan_bt_gpios[1].gpio = IGEP2_RB_GPIO_WIFI_NRESET;
  507. igep_wlan_bt_gpios[2].gpio = IGEP2_RB_GPIO_BT_NRESET;
  508. } else if (hwrev == IGEP2_BOARD_HWREV_C) {
  509. igep_wlan_bt_gpios[0].gpio = IGEP2_RC_GPIO_WIFI_NPD;
  510. igep_wlan_bt_gpios[1].gpio = IGEP2_RC_GPIO_WIFI_NRESET;
  511. igep_wlan_bt_gpios[2].gpio = IGEP2_RC_GPIO_BT_NRESET;
  512. } else
  513. return;
  514. err = gpio_request_array(igep_wlan_bt_gpios,
  515. ARRAY_SIZE(igep_wlan_bt_gpios));
  516. if (err) {
  517. pr_warning("IGEP2: Could not obtain WIFI/BT gpios\n");
  518. return;
  519. }
  520. gpio_export(igep_wlan_bt_gpios[0].gpio, 0);
  521. gpio_export(igep_wlan_bt_gpios[1].gpio, 0);
  522. gpio_export(igep_wlan_bt_gpios[2].gpio, 0);
  523. gpio_set_value(igep_wlan_bt_gpios[1].gpio, 0);
  524. udelay(10);
  525. gpio_set_value(igep_wlan_bt_gpios[1].gpio, 1);
  526. }
  527. #else
  528. static inline void __init igep_wlan_bt_init(void) { }
  529. #endif
  530. static void __init igep_init(void)
  531. {
  532. omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  533. /* Get IGEP2 hardware revision */
  534. igep2_get_revision();
  535. /* Register I2C busses and drivers */
  536. igep_i2c_init();
  537. platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices));
  538. omap_display_init(&igep2_dss_data);
  539. omap_serial_init();
  540. usb_musb_init(NULL);
  541. usbhs_init(&igep2_usbhs_bdata);
  542. igep_flash_init();
  543. igep_leds_init();
  544. igep2_display_init();
  545. igep2_init_smsc911x();
  546. /*
  547. * WLAN-BT combo module from MuRata which has a Marvell WLAN
  548. * (88W8686) + CSR Bluetooth chipset. Uses SDIO interface.
  549. */
  550. igep_wlan_bt_init();
  551. }
  552. MACHINE_START(IGEP0020, "IGEP v2 board")
  553. .boot_params = 0x80000100,
  554. .reserve = omap_reserve,
  555. .map_io = omap3_map_io,
  556. .init_early = igep_init_early,
  557. .init_irq = omap_init_irq,
  558. .init_machine = igep_init,
  559. .timer = &omap_timer,
  560. MACHINE_END