board-igep0020.c 17 KB

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