board-omap3beagle.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. /*
  2. * linux/arch/arm/mach-omap2/board-omap3beagle.c
  3. *
  4. * Copyright (C) 2008 Texas Instruments
  5. *
  6. * Modified from mach-omap2/board-3430sdp.c
  7. *
  8. * Initial code: Syed Mohammed Khasim
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/delay.h>
  18. #include <linux/err.h>
  19. #include <linux/clk.h>
  20. #include <linux/io.h>
  21. #include <linux/leds.h>
  22. #include <linux/gpio.h>
  23. #include <linux/input.h>
  24. #include <linux/gpio_keys.h>
  25. #include <linux/mtd/mtd.h>
  26. #include <linux/mtd/partitions.h>
  27. #include <linux/mtd/nand.h>
  28. #include <linux/mmc/host.h>
  29. #include <linux/regulator/machine.h>
  30. #include <linux/i2c/twl.h>
  31. #include <mach/hardware.h>
  32. #include <asm/mach-types.h>
  33. #include <asm/mach/arch.h>
  34. #include <asm/mach/map.h>
  35. #include <asm/mach/flash.h>
  36. #include <plat/board.h>
  37. #include <plat/common.h>
  38. #include <plat/display.h>
  39. #include <plat/panel-generic-dpi.h>
  40. #include <plat/gpmc.h>
  41. #include <plat/nand.h>
  42. #include <plat/usb.h>
  43. #include "mux.h"
  44. #include "hsmmc.h"
  45. #include "timer-gp.h"
  46. #define NAND_BLOCK_SIZE SZ_128K
  47. /*
  48. * OMAP3 Beagle revision
  49. * Run time detection of Beagle revision is done by reading GPIO.
  50. * GPIO ID -
  51. * AXBX = GPIO173, GPIO172, GPIO171: 1 1 1
  52. * C1_3 = GPIO173, GPIO172, GPIO171: 1 1 0
  53. * C4 = GPIO173, GPIO172, GPIO171: 1 0 1
  54. * XM = GPIO173, GPIO172, GPIO171: 0 0 0
  55. */
  56. enum {
  57. OMAP3BEAGLE_BOARD_UNKN = 0,
  58. OMAP3BEAGLE_BOARD_AXBX,
  59. OMAP3BEAGLE_BOARD_C1_3,
  60. OMAP3BEAGLE_BOARD_C4,
  61. OMAP3BEAGLE_BOARD_XM,
  62. };
  63. static u8 omap3_beagle_version;
  64. static u8 omap3_beagle_get_rev(void)
  65. {
  66. return omap3_beagle_version;
  67. }
  68. static void __init omap3_beagle_init_rev(void)
  69. {
  70. int ret;
  71. u16 beagle_rev = 0;
  72. omap_mux_init_gpio(171, OMAP_PIN_INPUT_PULLUP);
  73. omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP);
  74. omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP);
  75. ret = gpio_request(171, "rev_id_0");
  76. if (ret < 0)
  77. goto fail0;
  78. ret = gpio_request(172, "rev_id_1");
  79. if (ret < 0)
  80. goto fail1;
  81. ret = gpio_request(173, "rev_id_2");
  82. if (ret < 0)
  83. goto fail2;
  84. gpio_direction_input(171);
  85. gpio_direction_input(172);
  86. gpio_direction_input(173);
  87. beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1)
  88. | (gpio_get_value(173) << 2);
  89. switch (beagle_rev) {
  90. case 7:
  91. printk(KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n");
  92. omap3_beagle_version = OMAP3BEAGLE_BOARD_AXBX;
  93. break;
  94. case 6:
  95. printk(KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n");
  96. omap3_beagle_version = OMAP3BEAGLE_BOARD_C1_3;
  97. break;
  98. case 5:
  99. printk(KERN_INFO "OMAP3 Beagle Rev: C4\n");
  100. omap3_beagle_version = OMAP3BEAGLE_BOARD_C4;
  101. break;
  102. case 0:
  103. printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
  104. omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
  105. break;
  106. default:
  107. printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
  108. omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
  109. }
  110. return;
  111. fail2:
  112. gpio_free(172);
  113. fail1:
  114. gpio_free(171);
  115. fail0:
  116. printk(KERN_ERR "Unable to get revision detection GPIO pins\n");
  117. omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
  118. return;
  119. }
  120. static struct mtd_partition omap3beagle_nand_partitions[] = {
  121. /* All the partition sizes are listed in terms of NAND block size */
  122. {
  123. .name = "X-Loader",
  124. .offset = 0,
  125. .size = 4 * NAND_BLOCK_SIZE,
  126. .mask_flags = MTD_WRITEABLE, /* force read-only */
  127. },
  128. {
  129. .name = "U-Boot",
  130. .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
  131. .size = 15 * NAND_BLOCK_SIZE,
  132. .mask_flags = MTD_WRITEABLE, /* force read-only */
  133. },
  134. {
  135. .name = "U-Boot Env",
  136. .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
  137. .size = 1 * NAND_BLOCK_SIZE,
  138. },
  139. {
  140. .name = "Kernel",
  141. .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
  142. .size = 32 * NAND_BLOCK_SIZE,
  143. },
  144. {
  145. .name = "File System",
  146. .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
  147. .size = MTDPART_SIZ_FULL,
  148. },
  149. };
  150. static struct omap_nand_platform_data omap3beagle_nand_data = {
  151. .options = NAND_BUSWIDTH_16,
  152. .parts = omap3beagle_nand_partitions,
  153. .nr_parts = ARRAY_SIZE(omap3beagle_nand_partitions),
  154. .dma_channel = -1, /* disable DMA in OMAP NAND driver */
  155. .nand_setup = NULL,
  156. .dev_ready = NULL,
  157. };
  158. /* DSS */
  159. static int beagle_enable_dvi(struct omap_dss_device *dssdev)
  160. {
  161. if (gpio_is_valid(dssdev->reset_gpio))
  162. gpio_set_value(dssdev->reset_gpio, 1);
  163. return 0;
  164. }
  165. static void beagle_disable_dvi(struct omap_dss_device *dssdev)
  166. {
  167. if (gpio_is_valid(dssdev->reset_gpio))
  168. gpio_set_value(dssdev->reset_gpio, 0);
  169. }
  170. static struct panel_generic_dpi_data dvi_panel = {
  171. .name = "generic",
  172. .platform_enable = beagle_enable_dvi,
  173. .platform_disable = beagle_disable_dvi,
  174. };
  175. static struct omap_dss_device beagle_dvi_device = {
  176. .type = OMAP_DISPLAY_TYPE_DPI,
  177. .name = "dvi",
  178. .driver_name = "generic_dpi_panel",
  179. .data = &dvi_panel,
  180. .phy.dpi.data_lines = 24,
  181. .reset_gpio = -EINVAL,
  182. };
  183. static struct omap_dss_device beagle_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 *beagle_dss_devices[] = {
  190. &beagle_dvi_device,
  191. &beagle_tv_device,
  192. };
  193. static struct omap_dss_board_info beagle_dss_data = {
  194. .num_devices = ARRAY_SIZE(beagle_dss_devices),
  195. .devices = beagle_dss_devices,
  196. .default_device = &beagle_dvi_device,
  197. };
  198. static struct platform_device beagle_dss_device = {
  199. .name = "omapdss",
  200. .id = -1,
  201. .dev = {
  202. .platform_data = &beagle_dss_data,
  203. },
  204. };
  205. static struct regulator_consumer_supply beagle_vdac_supply =
  206. REGULATOR_SUPPLY("vdda_dac", "omapdss");
  207. static struct regulator_consumer_supply beagle_vdvi_supply =
  208. REGULATOR_SUPPLY("vdds_dsi", "omapdss");
  209. static void __init beagle_display_init(void)
  210. {
  211. int r;
  212. r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
  213. if (r < 0) {
  214. printk(KERN_ERR "Unable to get DVI reset GPIO\n");
  215. return;
  216. }
  217. gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
  218. }
  219. #include "sdram-micron-mt46h32m32lf-6.h"
  220. static struct omap2_hsmmc_info mmc[] = {
  221. {
  222. .mmc = 1,
  223. .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
  224. .gpio_wp = 29,
  225. },
  226. {} /* Terminator */
  227. };
  228. static struct regulator_consumer_supply beagle_vmmc1_supply = {
  229. .supply = "vmmc",
  230. };
  231. static struct regulator_consumer_supply beagle_vsim_supply = {
  232. .supply = "vmmc_aux",
  233. };
  234. static struct gpio_led gpio_leds[];
  235. static int beagle_twl_gpio_setup(struct device *dev,
  236. unsigned gpio, unsigned ngpio)
  237. {
  238. int r;
  239. if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
  240. mmc[0].gpio_wp = -EINVAL;
  241. } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
  242. (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
  243. omap_mux_init_gpio(23, OMAP_PIN_INPUT);
  244. mmc[0].gpio_wp = 23;
  245. } else {
  246. omap_mux_init_gpio(29, OMAP_PIN_INPUT);
  247. }
  248. /* gpio + 0 is "mmc0_cd" (input/IRQ) */
  249. mmc[0].gpio_cd = gpio + 0;
  250. omap2_hsmmc_init(mmc);
  251. /* link regulators to MMC adapters */
  252. beagle_vmmc1_supply.dev = mmc[0].dev;
  253. beagle_vsim_supply.dev = mmc[0].dev;
  254. /* REVISIT: need ehci-omap hooks for external VBUS
  255. * power switch and overcurrent detect
  256. */
  257. if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
  258. r = gpio_request(gpio + 1, "EHCI_nOC");
  259. if (!r) {
  260. r = gpio_direction_input(gpio + 1);
  261. if (r)
  262. gpio_free(gpio + 1);
  263. }
  264. if (r)
  265. pr_err("%s: unable to configure EHCI_nOC\n", __func__);
  266. }
  267. /*
  268. * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
  269. * high / others active low)
  270. */
  271. gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
  272. if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
  273. gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
  274. else
  275. gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
  276. /* DVI reset GPIO is different between beagle revisions */
  277. if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
  278. beagle_dvi_device.reset_gpio = 129;
  279. else
  280. beagle_dvi_device.reset_gpio = 170;
  281. /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
  282. gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
  283. /*
  284. * gpio + 1 on Xm controls the TFP410's enable line (active low)
  285. * gpio + 2 control varies depending on the board rev as follows:
  286. * P7/P8 revisions(prototype): Camera EN
  287. * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
  288. */
  289. if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
  290. r = gpio_request(gpio + 1, "nDVI_PWR_EN");
  291. if (!r) {
  292. r = gpio_direction_output(gpio + 1, 0);
  293. if (r)
  294. gpio_free(gpio + 1);
  295. }
  296. if (r)
  297. pr_err("%s: unable to configure nDVI_PWR_EN\n",
  298. __func__);
  299. r = gpio_request(gpio + 2, "DVI_LDO_EN");
  300. if (!r) {
  301. r = gpio_direction_output(gpio + 2, 1);
  302. if (r)
  303. gpio_free(gpio + 2);
  304. }
  305. if (r)
  306. pr_err("%s: unable to configure DVI_LDO_EN\n",
  307. __func__);
  308. }
  309. return 0;
  310. }
  311. static struct twl4030_gpio_platform_data beagle_gpio_data = {
  312. .gpio_base = OMAP_MAX_GPIO_LINES,
  313. .irq_base = TWL4030_GPIO_IRQ_BASE,
  314. .irq_end = TWL4030_GPIO_IRQ_END,
  315. .use_leds = true,
  316. .pullups = BIT(1),
  317. .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
  318. | BIT(15) | BIT(16) | BIT(17),
  319. .setup = beagle_twl_gpio_setup,
  320. };
  321. /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
  322. static struct regulator_init_data beagle_vmmc1 = {
  323. .constraints = {
  324. .min_uV = 1850000,
  325. .max_uV = 3150000,
  326. .valid_modes_mask = REGULATOR_MODE_NORMAL
  327. | REGULATOR_MODE_STANDBY,
  328. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  329. | REGULATOR_CHANGE_MODE
  330. | REGULATOR_CHANGE_STATUS,
  331. },
  332. .num_consumer_supplies = 1,
  333. .consumer_supplies = &beagle_vmmc1_supply,
  334. };
  335. /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
  336. static struct regulator_init_data beagle_vsim = {
  337. .constraints = {
  338. .min_uV = 1800000,
  339. .max_uV = 3000000,
  340. .valid_modes_mask = REGULATOR_MODE_NORMAL
  341. | REGULATOR_MODE_STANDBY,
  342. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  343. | REGULATOR_CHANGE_MODE
  344. | REGULATOR_CHANGE_STATUS,
  345. },
  346. .num_consumer_supplies = 1,
  347. .consumer_supplies = &beagle_vsim_supply,
  348. };
  349. /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
  350. static struct regulator_init_data beagle_vdac = {
  351. .constraints = {
  352. .min_uV = 1800000,
  353. .max_uV = 1800000,
  354. .valid_modes_mask = REGULATOR_MODE_NORMAL
  355. | REGULATOR_MODE_STANDBY,
  356. .valid_ops_mask = REGULATOR_CHANGE_MODE
  357. | REGULATOR_CHANGE_STATUS,
  358. },
  359. .num_consumer_supplies = 1,
  360. .consumer_supplies = &beagle_vdac_supply,
  361. };
  362. /* VPLL2 for digital video outputs */
  363. static struct regulator_init_data beagle_vpll2 = {
  364. .constraints = {
  365. .name = "VDVI",
  366. .min_uV = 1800000,
  367. .max_uV = 1800000,
  368. .valid_modes_mask = REGULATOR_MODE_NORMAL
  369. | REGULATOR_MODE_STANDBY,
  370. .valid_ops_mask = REGULATOR_CHANGE_MODE
  371. | REGULATOR_CHANGE_STATUS,
  372. },
  373. .num_consumer_supplies = 1,
  374. .consumer_supplies = &beagle_vdvi_supply,
  375. };
  376. static struct twl4030_usb_data beagle_usb_data = {
  377. .usb_mode = T2_USB_MODE_ULPI,
  378. };
  379. static struct twl4030_codec_audio_data beagle_audio_data = {
  380. .audio_mclk = 26000000,
  381. };
  382. static struct twl4030_codec_data beagle_codec_data = {
  383. .audio_mclk = 26000000,
  384. .audio = &beagle_audio_data,
  385. };
  386. static struct twl4030_platform_data beagle_twldata = {
  387. .irq_base = TWL4030_IRQ_BASE,
  388. .irq_end = TWL4030_IRQ_END,
  389. /* platform_data for children goes here */
  390. .usb = &beagle_usb_data,
  391. .gpio = &beagle_gpio_data,
  392. .codec = &beagle_codec_data,
  393. .vmmc1 = &beagle_vmmc1,
  394. .vsim = &beagle_vsim,
  395. .vdac = &beagle_vdac,
  396. .vpll2 = &beagle_vpll2,
  397. };
  398. static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
  399. {
  400. I2C_BOARD_INFO("twl4030", 0x48),
  401. .flags = I2C_CLIENT_WAKE,
  402. .irq = INT_34XX_SYS_NIRQ,
  403. .platform_data = &beagle_twldata,
  404. },
  405. };
  406. static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
  407. {
  408. I2C_BOARD_INFO("eeprom", 0x50),
  409. },
  410. };
  411. static int __init omap3_beagle_i2c_init(void)
  412. {
  413. omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
  414. ARRAY_SIZE(beagle_i2c_boardinfo));
  415. /* Bus 3 is attached to the DVI port where devices like the pico DLP
  416. * projector don't work reliably with 400kHz */
  417. omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
  418. return 0;
  419. }
  420. static struct gpio_led gpio_leds[] = {
  421. {
  422. .name = "beagleboard::usr0",
  423. .default_trigger = "heartbeat",
  424. .gpio = 150,
  425. },
  426. {
  427. .name = "beagleboard::usr1",
  428. .default_trigger = "mmc0",
  429. .gpio = 149,
  430. },
  431. {
  432. .name = "beagleboard::pmu_stat",
  433. .gpio = -EINVAL, /* gets replaced */
  434. .active_low = true,
  435. },
  436. };
  437. static struct gpio_led_platform_data gpio_led_info = {
  438. .leds = gpio_leds,
  439. .num_leds = ARRAY_SIZE(gpio_leds),
  440. };
  441. static struct platform_device leds_gpio = {
  442. .name = "leds-gpio",
  443. .id = -1,
  444. .dev = {
  445. .platform_data = &gpio_led_info,
  446. },
  447. };
  448. static struct gpio_keys_button gpio_buttons[] = {
  449. {
  450. .code = BTN_EXTRA,
  451. .gpio = 7,
  452. .desc = "user",
  453. .wakeup = 1,
  454. },
  455. };
  456. static struct gpio_keys_platform_data gpio_key_info = {
  457. .buttons = gpio_buttons,
  458. .nbuttons = ARRAY_SIZE(gpio_buttons),
  459. };
  460. static struct platform_device keys_gpio = {
  461. .name = "gpio-keys",
  462. .id = -1,
  463. .dev = {
  464. .platform_data = &gpio_key_info,
  465. },
  466. };
  467. static void __init omap3_beagle_init_irq(void)
  468. {
  469. omap2_init_common_infrastructure();
  470. omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
  471. mt46h32m32lf6_sdrc_params);
  472. omap_init_irq();
  473. #ifdef CONFIG_OMAP_32K_TIMER
  474. omap2_gp_clockevent_set_gptimer(12);
  475. #endif
  476. }
  477. static struct platform_device *omap3_beagle_devices[] __initdata = {
  478. &leds_gpio,
  479. &keys_gpio,
  480. &beagle_dss_device,
  481. };
  482. static void __init omap3beagle_flash_init(void)
  483. {
  484. u8 cs = 0;
  485. u8 nandcs = GPMC_CS_NUM + 1;
  486. /* find out the chip-select on which NAND exists */
  487. while (cs < GPMC_CS_NUM) {
  488. u32 ret = 0;
  489. ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
  490. if ((ret & 0xC00) == 0x800) {
  491. printk(KERN_INFO "Found NAND on CS%d\n", cs);
  492. if (nandcs > GPMC_CS_NUM)
  493. nandcs = cs;
  494. }
  495. cs++;
  496. }
  497. if (nandcs > GPMC_CS_NUM) {
  498. printk(KERN_INFO "NAND: Unable to find configuration "
  499. "in GPMC\n ");
  500. return;
  501. }
  502. if (nandcs < GPMC_CS_NUM) {
  503. omap3beagle_nand_data.cs = nandcs;
  504. printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
  505. if (gpmc_nand_init(&omap3beagle_nand_data) < 0)
  506. printk(KERN_ERR "Unable to register NAND device\n");
  507. }
  508. }
  509. static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
  510. .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
  511. .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
  512. .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
  513. .phy_reset = true,
  514. .reset_gpio_port[0] = -EINVAL,
  515. .reset_gpio_port[1] = 147,
  516. .reset_gpio_port[2] = -EINVAL
  517. };
  518. #ifdef CONFIG_OMAP_MUX
  519. static struct omap_board_mux board_mux[] __initdata = {
  520. { .reg_offset = OMAP_MUX_TERMINATOR },
  521. };
  522. #endif
  523. static struct omap_musb_board_data musb_board_data = {
  524. .interface_type = MUSB_INTERFACE_ULPI,
  525. .mode = MUSB_OTG,
  526. .power = 100,
  527. };
  528. static void __init omap3_beagle_init(void)
  529. {
  530. omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  531. omap3_beagle_init_rev();
  532. omap3_beagle_i2c_init();
  533. platform_add_devices(omap3_beagle_devices,
  534. ARRAY_SIZE(omap3_beagle_devices));
  535. omap_serial_init();
  536. omap_mux_init_gpio(170, OMAP_PIN_INPUT);
  537. gpio_request(170, "DVI_nPD");
  538. /* REVISIT leave DVI powered down until it's needed ... */
  539. gpio_direction_output(170, true);
  540. usb_musb_init(&musb_board_data);
  541. usb_ehci_init(&ehci_pdata);
  542. omap3beagle_flash_init();
  543. /* Ensure SDRC pins are mux'd for self-refresh */
  544. omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
  545. omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  546. beagle_display_init();
  547. }
  548. MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
  549. /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
  550. .boot_params = 0x80000100,
  551. .map_io = omap3_map_io,
  552. .reserve = omap_reserve,
  553. .init_irq = omap3_beagle_init_irq,
  554. .init_machine = omap3_beagle_init,
  555. .timer = &omap_timer,
  556. MACHINE_END