board-igep0020.c 19 KB

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