board-omap3pandora.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. /*
  2. * board-omap3pandora.c (Pandora Handheld Console)
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  16. * 02110-1301 USA
  17. *
  18. */
  19. #include <linux/init.h>
  20. #include <linux/kernel.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/spi/spi.h>
  23. #include <linux/spi/ads7846.h>
  24. #include <linux/regulator/machine.h>
  25. #include <linux/i2c/twl.h>
  26. #include <linux/leds.h>
  27. #include <linux/input.h>
  28. #include <linux/input/matrix_keypad.h>
  29. #include <linux/gpio_keys.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/mach/arch.h>
  32. #include <asm/mach/map.h>
  33. #include <plat/board.h>
  34. #include <plat/common.h>
  35. #include <mach/gpio.h>
  36. #include <mach/hardware.h>
  37. #include <plat/mcspi.h>
  38. #include <plat/usb.h>
  39. #include <plat/display.h>
  40. #include "mux.h"
  41. #include "sdram-micron-mt46h32m32lf-6.h"
  42. #include "hsmmc.h"
  43. #define OMAP3_PANDORA_TS_GPIO 94
  44. /* hardware debounce: (value + 1) * 31us */
  45. #define GPIO_DEBOUNCE_TIME 127
  46. static struct gpio_led pandora_gpio_leds[] = {
  47. {
  48. .name = "pandora::sd1",
  49. .default_trigger = "mmc0",
  50. .gpio = 128,
  51. }, {
  52. .name = "pandora::sd2",
  53. .default_trigger = "mmc1",
  54. .gpio = 129,
  55. }, {
  56. .name = "pandora::bluetooth",
  57. .gpio = 158,
  58. }, {
  59. .name = "pandora::wifi",
  60. .gpio = 159,
  61. },
  62. };
  63. static struct gpio_led_platform_data pandora_gpio_led_data = {
  64. .leds = pandora_gpio_leds,
  65. .num_leds = ARRAY_SIZE(pandora_gpio_leds),
  66. };
  67. static struct platform_device pandora_leds_gpio = {
  68. .name = "leds-gpio",
  69. .id = -1,
  70. .dev = {
  71. .platform_data = &pandora_gpio_led_data,
  72. },
  73. };
  74. #define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \
  75. { \
  76. .gpio = gpio_num, \
  77. .type = ev_type, \
  78. .code = ev_code, \
  79. .active_low = act_low, \
  80. .desc = "btn " descr, \
  81. }
  82. #define GPIO_BUTTON_LOW(gpio_num, event_code, description) \
  83. GPIO_BUTTON(gpio_num, EV_KEY, event_code, 1, description)
  84. static struct gpio_keys_button pandora_gpio_keys[] = {
  85. GPIO_BUTTON_LOW(110, KEY_UP, "up"),
  86. GPIO_BUTTON_LOW(103, KEY_DOWN, "down"),
  87. GPIO_BUTTON_LOW(96, KEY_LEFT, "left"),
  88. GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"),
  89. GPIO_BUTTON_LOW(109, KEY_KP1, "game 1"),
  90. GPIO_BUTTON_LOW(111, KEY_KP2, "game 2"),
  91. GPIO_BUTTON_LOW(106, KEY_KP3, "game 3"),
  92. GPIO_BUTTON_LOW(101, KEY_KP4, "game 4"),
  93. GPIO_BUTTON_LOW(102, BTN_TL, "l"),
  94. GPIO_BUTTON_LOW(97, BTN_TL2, "l2"),
  95. GPIO_BUTTON_LOW(105, BTN_TR, "r"),
  96. GPIO_BUTTON_LOW(107, BTN_TR2, "r2"),
  97. GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"),
  98. GPIO_BUTTON_LOW(99, KEY_MENU, "menu"),
  99. GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"),
  100. GPIO_BUTTON(100, EV_KEY, KEY_LEFTALT, 0, "alt"),
  101. GPIO_BUTTON(108, EV_SW, SW_LID, 1, "lid"),
  102. };
  103. static struct gpio_keys_platform_data pandora_gpio_key_info = {
  104. .buttons = pandora_gpio_keys,
  105. .nbuttons = ARRAY_SIZE(pandora_gpio_keys),
  106. };
  107. static struct platform_device pandora_keys_gpio = {
  108. .name = "gpio-keys",
  109. .id = -1,
  110. .dev = {
  111. .platform_data = &pandora_gpio_key_info,
  112. },
  113. };
  114. static void __init pandora_keys_gpio_init(void)
  115. {
  116. /* set debounce time for GPIO banks 4 and 6 */
  117. omap_set_gpio_debounce_time(32 * 3, GPIO_DEBOUNCE_TIME);
  118. omap_set_gpio_debounce_time(32 * 5, GPIO_DEBOUNCE_TIME);
  119. }
  120. static int board_keymap[] = {
  121. /* row, col, code */
  122. KEY(0, 0, KEY_9),
  123. KEY(0, 1, KEY_8),
  124. KEY(0, 2, KEY_I),
  125. KEY(0, 3, KEY_J),
  126. KEY(0, 4, KEY_N),
  127. KEY(0, 5, KEY_M),
  128. KEY(1, 0, KEY_0),
  129. KEY(1, 1, KEY_7),
  130. KEY(1, 2, KEY_U),
  131. KEY(1, 3, KEY_H),
  132. KEY(1, 4, KEY_B),
  133. KEY(1, 5, KEY_SPACE),
  134. KEY(2, 0, KEY_BACKSPACE),
  135. KEY(2, 1, KEY_6),
  136. KEY(2, 2, KEY_Y),
  137. KEY(2, 3, KEY_G),
  138. KEY(2, 4, KEY_V),
  139. KEY(2, 5, KEY_FN),
  140. KEY(3, 0, KEY_O),
  141. KEY(3, 1, KEY_5),
  142. KEY(3, 2, KEY_T),
  143. KEY(3, 3, KEY_F),
  144. KEY(3, 4, KEY_C),
  145. KEY(4, 0, KEY_P),
  146. KEY(4, 1, KEY_4),
  147. KEY(4, 2, KEY_R),
  148. KEY(4, 3, KEY_D),
  149. KEY(4, 4, KEY_X),
  150. KEY(5, 0, KEY_K),
  151. KEY(5, 1, KEY_3),
  152. KEY(5, 2, KEY_E),
  153. KEY(5, 3, KEY_S),
  154. KEY(5, 4, KEY_Z),
  155. KEY(6, 0, KEY_L),
  156. KEY(6, 1, KEY_2),
  157. KEY(6, 2, KEY_W),
  158. KEY(6, 3, KEY_A),
  159. KEY(6, 4, KEY_DOT),
  160. KEY(7, 0, KEY_ENTER),
  161. KEY(7, 1, KEY_1),
  162. KEY(7, 2, KEY_Q),
  163. KEY(7, 3, KEY_LEFTSHIFT),
  164. KEY(7, 4, KEY_COMMA),
  165. };
  166. static struct matrix_keymap_data board_map_data = {
  167. .keymap = board_keymap,
  168. .keymap_size = ARRAY_SIZE(board_keymap),
  169. };
  170. static struct twl4030_keypad_data pandora_kp_data = {
  171. .keymap_data = &board_map_data,
  172. .rows = 8,
  173. .cols = 6,
  174. .rep = 1,
  175. };
  176. static struct omap_dss_device pandora_lcd_device = {
  177. .name = "lcd",
  178. .driver_name = "tpo_td043mtea1_panel",
  179. .type = OMAP_DISPLAY_TYPE_DPI,
  180. .phy.dpi.data_lines = 24,
  181. .reset_gpio = 157,
  182. };
  183. static struct omap_dss_device pandora_tv_device = {
  184. .name = "tv",
  185. .driver_name = "venc",
  186. .type = OMAP_DISPLAY_TYPE_VENC,
  187. .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
  188. };
  189. static struct omap_dss_device *pandora_dss_devices[] = {
  190. &pandora_lcd_device,
  191. &pandora_tv_device,
  192. };
  193. static struct omap_dss_board_info pandora_dss_data = {
  194. .num_devices = ARRAY_SIZE(pandora_dss_devices),
  195. .devices = pandora_dss_devices,
  196. .default_device = &pandora_lcd_device,
  197. };
  198. static struct platform_device pandora_dss_device = {
  199. .name = "omapdss",
  200. .id = -1,
  201. .dev = {
  202. .platform_data = &pandora_dss_data,
  203. },
  204. };
  205. static struct omap2_hsmmc_info omap3pandora_mmc[] = {
  206. {
  207. .mmc = 1,
  208. .wires = 4,
  209. .gpio_cd = -EINVAL,
  210. .gpio_wp = 126,
  211. .ext_clock = 0,
  212. },
  213. {
  214. .mmc = 2,
  215. .wires = 4,
  216. .gpio_cd = -EINVAL,
  217. .gpio_wp = 127,
  218. .ext_clock = 1,
  219. .transceiver = true,
  220. },
  221. {
  222. .mmc = 3,
  223. .wires = 4,
  224. .gpio_cd = -EINVAL,
  225. .gpio_wp = -EINVAL,
  226. },
  227. {} /* Terminator */
  228. };
  229. static int omap3pandora_twl_gpio_setup(struct device *dev,
  230. unsigned gpio, unsigned ngpio)
  231. {
  232. /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */
  233. omap3pandora_mmc[0].gpio_cd = gpio + 0;
  234. omap3pandora_mmc[1].gpio_cd = gpio + 1;
  235. omap2_hsmmc_init(omap3pandora_mmc);
  236. return 0;
  237. }
  238. static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
  239. .gpio_base = OMAP_MAX_GPIO_LINES,
  240. .irq_base = TWL4030_GPIO_IRQ_BASE,
  241. .irq_end = TWL4030_GPIO_IRQ_END,
  242. .setup = omap3pandora_twl_gpio_setup,
  243. };
  244. static struct regulator_consumer_supply pandora_vmmc1_supply =
  245. REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0");
  246. static struct regulator_consumer_supply pandora_vmmc2_supply =
  247. REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1");
  248. static struct regulator_consumer_supply pandora_vdda_dac_supply =
  249. REGULATOR_SUPPLY("vdda_dac", "omapdss");
  250. static struct regulator_consumer_supply pandora_vdds_supplies[] = {
  251. REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
  252. REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
  253. };
  254. static struct regulator_consumer_supply pandora_vcc_lcd_supply =
  255. REGULATOR_SUPPLY("vcc", "display0");
  256. static struct regulator_consumer_supply pandora_usb_phy_supply =
  257. REGULATOR_SUPPLY("hsusb0", "ehci-omap.0");
  258. /* ads7846 on SPI and 2 nub controllers on I2C */
  259. static struct regulator_consumer_supply pandora_vaux4_supplies[] = {
  260. REGULATOR_SUPPLY("vcc", "spi1.0"),
  261. REGULATOR_SUPPLY("vcc", "3-0066"),
  262. REGULATOR_SUPPLY("vcc", "3-0067"),
  263. };
  264. static struct regulator_consumer_supply pandora_adac_supply =
  265. REGULATOR_SUPPLY("vcc", "soc-audio");
  266. /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
  267. static struct regulator_init_data pandora_vmmc1 = {
  268. .constraints = {
  269. .min_uV = 1850000,
  270. .max_uV = 3150000,
  271. .valid_modes_mask = REGULATOR_MODE_NORMAL
  272. | REGULATOR_MODE_STANDBY,
  273. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  274. | REGULATOR_CHANGE_MODE
  275. | REGULATOR_CHANGE_STATUS,
  276. },
  277. .num_consumer_supplies = 1,
  278. .consumer_supplies = &pandora_vmmc1_supply,
  279. };
  280. /* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */
  281. static struct regulator_init_data pandora_vmmc2 = {
  282. .constraints = {
  283. .min_uV = 1850000,
  284. .max_uV = 3150000,
  285. .valid_modes_mask = REGULATOR_MODE_NORMAL
  286. | REGULATOR_MODE_STANDBY,
  287. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  288. | REGULATOR_CHANGE_MODE
  289. | REGULATOR_CHANGE_STATUS,
  290. },
  291. .num_consumer_supplies = 1,
  292. .consumer_supplies = &pandora_vmmc2_supply,
  293. };
  294. /* VDAC for DSS driving S-Video */
  295. static struct regulator_init_data pandora_vdac = {
  296. .constraints = {
  297. .min_uV = 1800000,
  298. .max_uV = 1800000,
  299. .apply_uV = true,
  300. .valid_modes_mask = REGULATOR_MODE_NORMAL
  301. | REGULATOR_MODE_STANDBY,
  302. .valid_ops_mask = REGULATOR_CHANGE_MODE
  303. | REGULATOR_CHANGE_STATUS,
  304. },
  305. .num_consumer_supplies = 1,
  306. .consumer_supplies = &pandora_vdda_dac_supply,
  307. };
  308. /* VPLL2 for digital video outputs */
  309. static struct regulator_init_data pandora_vpll2 = {
  310. .constraints = {
  311. .min_uV = 1800000,
  312. .max_uV = 1800000,
  313. .apply_uV = true,
  314. .valid_modes_mask = REGULATOR_MODE_NORMAL
  315. | REGULATOR_MODE_STANDBY,
  316. .valid_ops_mask = REGULATOR_CHANGE_MODE
  317. | REGULATOR_CHANGE_STATUS,
  318. },
  319. .num_consumer_supplies = ARRAY_SIZE(pandora_vdds_supplies),
  320. .consumer_supplies = pandora_vdds_supplies,
  321. };
  322. /* VAUX1 for LCD */
  323. static struct regulator_init_data pandora_vaux1 = {
  324. .constraints = {
  325. .min_uV = 3000000,
  326. .max_uV = 3000000,
  327. .apply_uV = true,
  328. .valid_modes_mask = REGULATOR_MODE_NORMAL
  329. | REGULATOR_MODE_STANDBY,
  330. .valid_ops_mask = REGULATOR_CHANGE_MODE
  331. | REGULATOR_CHANGE_STATUS,
  332. },
  333. .num_consumer_supplies = 1,
  334. .consumer_supplies = &pandora_vcc_lcd_supply,
  335. };
  336. /* VAUX2 for USB host PHY */
  337. static struct regulator_init_data pandora_vaux2 = {
  338. .constraints = {
  339. .min_uV = 1800000,
  340. .max_uV = 1800000,
  341. .apply_uV = true,
  342. .valid_modes_mask = REGULATOR_MODE_NORMAL
  343. | REGULATOR_MODE_STANDBY,
  344. .valid_ops_mask = REGULATOR_CHANGE_MODE
  345. | REGULATOR_CHANGE_STATUS,
  346. },
  347. .num_consumer_supplies = 1,
  348. .consumer_supplies = &pandora_usb_phy_supply,
  349. };
  350. /* VAUX4 for ads7846 and nubs */
  351. static struct regulator_init_data pandora_vaux4 = {
  352. .constraints = {
  353. .min_uV = 2800000,
  354. .max_uV = 2800000,
  355. .apply_uV = true,
  356. .valid_modes_mask = REGULATOR_MODE_NORMAL
  357. | REGULATOR_MODE_STANDBY,
  358. .valid_ops_mask = REGULATOR_CHANGE_MODE
  359. | REGULATOR_CHANGE_STATUS,
  360. },
  361. .num_consumer_supplies = ARRAY_SIZE(pandora_vaux4_supplies),
  362. .consumer_supplies = pandora_vaux4_supplies,
  363. };
  364. /* VSIM for audio DAC */
  365. static struct regulator_init_data pandora_vsim = {
  366. .constraints = {
  367. .min_uV = 2800000,
  368. .max_uV = 2800000,
  369. .apply_uV = true,
  370. .valid_modes_mask = REGULATOR_MODE_NORMAL
  371. | REGULATOR_MODE_STANDBY,
  372. .valid_ops_mask = REGULATOR_CHANGE_MODE
  373. | REGULATOR_CHANGE_STATUS,
  374. },
  375. .num_consumer_supplies = 1,
  376. .consumer_supplies = &pandora_adac_supply,
  377. };
  378. static struct twl4030_usb_data omap3pandora_usb_data = {
  379. .usb_mode = T2_USB_MODE_ULPI,
  380. };
  381. static struct twl4030_codec_audio_data omap3pandora_audio_data = {
  382. .audio_mclk = 26000000,
  383. };
  384. static struct twl4030_codec_data omap3pandora_codec_data = {
  385. .audio_mclk = 26000000,
  386. .audio = &omap3pandora_audio_data,
  387. };
  388. static struct twl4030_platform_data omap3pandora_twldata = {
  389. .irq_base = TWL4030_IRQ_BASE,
  390. .irq_end = TWL4030_IRQ_END,
  391. .gpio = &omap3pandora_gpio_data,
  392. .usb = &omap3pandora_usb_data,
  393. .codec = &omap3pandora_codec_data,
  394. .vmmc1 = &pandora_vmmc1,
  395. .vmmc2 = &pandora_vmmc2,
  396. .vdac = &pandora_vdac,
  397. .vpll2 = &pandora_vpll2,
  398. .vaux1 = &pandora_vaux1,
  399. .vaux2 = &pandora_vaux2,
  400. .vaux4 = &pandora_vaux4,
  401. .vsim = &pandora_vsim,
  402. .keypad = &pandora_kp_data,
  403. };
  404. static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = {
  405. {
  406. I2C_BOARD_INFO("tps65950", 0x48),
  407. .flags = I2C_CLIENT_WAKE,
  408. .irq = INT_34XX_SYS_NIRQ,
  409. .platform_data = &omap3pandora_twldata,
  410. },
  411. };
  412. static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = {
  413. {
  414. I2C_BOARD_INFO("bq27500", 0x55),
  415. .flags = I2C_CLIENT_WAKE,
  416. },
  417. };
  418. static int __init omap3pandora_i2c_init(void)
  419. {
  420. omap_register_i2c_bus(1, 2600, omap3pandora_i2c_boardinfo,
  421. ARRAY_SIZE(omap3pandora_i2c_boardinfo));
  422. /* i2c2 pins are not connected */
  423. omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo,
  424. ARRAY_SIZE(omap3pandora_i2c3_boardinfo));
  425. return 0;
  426. }
  427. static void __init omap3pandora_ads7846_init(void)
  428. {
  429. int gpio = OMAP3_PANDORA_TS_GPIO;
  430. int ret;
  431. ret = gpio_request(gpio, "ads7846_pen_down");
  432. if (ret < 0) {
  433. printk(KERN_ERR "Failed to request GPIO %d for "
  434. "ads7846 pen down IRQ\n", gpio);
  435. return;
  436. }
  437. gpio_direction_input(gpio);
  438. }
  439. static int ads7846_get_pendown_state(void)
  440. {
  441. return !gpio_get_value(OMAP3_PANDORA_TS_GPIO);
  442. }
  443. static struct ads7846_platform_data ads7846_config = {
  444. .x_max = 0x0fff,
  445. .y_max = 0x0fff,
  446. .x_plate_ohms = 180,
  447. .pressure_max = 255,
  448. .debounce_max = 10,
  449. .debounce_tol = 3,
  450. .debounce_rep = 1,
  451. .get_pendown_state = ads7846_get_pendown_state,
  452. .keep_vref_on = 1,
  453. };
  454. static struct omap2_mcspi_device_config ads7846_mcspi_config = {
  455. .turbo_mode = 0,
  456. .single_channel = 1, /* 0: slave, 1: master */
  457. };
  458. static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
  459. {
  460. .modalias = "ads7846",
  461. .bus_num = 1,
  462. .chip_select = 0,
  463. .max_speed_hz = 1500000,
  464. .controller_data = &ads7846_mcspi_config,
  465. .irq = OMAP_GPIO_IRQ(OMAP3_PANDORA_TS_GPIO),
  466. .platform_data = &ads7846_config,
  467. }, {
  468. .modalias = "tpo_td043mtea1_panel_spi",
  469. .bus_num = 1,
  470. .chip_select = 1,
  471. .max_speed_hz = 375000,
  472. .platform_data = &pandora_lcd_device,
  473. }
  474. };
  475. static void __init omap3pandora_init_irq(void)
  476. {
  477. omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
  478. mt46h32m32lf6_sdrc_params);
  479. omap_init_irq();
  480. omap_gpio_init();
  481. }
  482. static struct platform_device *omap3pandora_devices[] __initdata = {
  483. &pandora_leds_gpio,
  484. &pandora_keys_gpio,
  485. &pandora_dss_device,
  486. };
  487. static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
  488. .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
  489. .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
  490. .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
  491. .phy_reset = true,
  492. .reset_gpio_port[0] = 16,
  493. .reset_gpio_port[1] = -EINVAL,
  494. .reset_gpio_port[2] = -EINVAL
  495. };
  496. #ifdef CONFIG_OMAP_MUX
  497. static struct omap_board_mux board_mux[] __initdata = {
  498. { .reg_offset = OMAP_MUX_TERMINATOR },
  499. };
  500. #else
  501. #define board_mux NULL
  502. #endif
  503. static struct omap_musb_board_data musb_board_data = {
  504. .interface_type = MUSB_INTERFACE_ULPI,
  505. .mode = MUSB_OTG,
  506. .power = 100,
  507. };
  508. static void __init omap3pandora_init(void)
  509. {
  510. omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  511. omap3pandora_i2c_init();
  512. platform_add_devices(omap3pandora_devices,
  513. ARRAY_SIZE(omap3pandora_devices));
  514. omap_serial_init();
  515. spi_register_board_info(omap3pandora_spi_board_info,
  516. ARRAY_SIZE(omap3pandora_spi_board_info));
  517. omap3pandora_ads7846_init();
  518. usb_ehci_init(&ehci_pdata);
  519. pandora_keys_gpio_init();
  520. usb_musb_init(&musb_board_data);
  521. /* Ensure SDRC pins are mux'd for self-refresh */
  522. omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
  523. omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  524. }
  525. static void __init omap3pandora_map_io(void)
  526. {
  527. omap2_set_globals_343x();
  528. omap34xx_map_common_io();
  529. }
  530. MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
  531. .phys_io = 0x48000000,
  532. .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
  533. .boot_params = 0x80000100,
  534. .map_io = omap3pandora_map_io,
  535. .init_irq = omap3pandora_init_irq,
  536. .init_machine = omap3pandora_init,
  537. .timer = &omap_timer,
  538. MACHINE_END