board-igep0020.c 17 KB

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