beagle.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. /*
  2. * (C) Copyright 2004-2011
  3. * Texas Instruments, <www.ti.com>
  4. *
  5. * Author :
  6. * Sunil Kumar <sunilsaini05@gmail.com>
  7. * Shashi Ranjan <shashiranjanmca05@gmail.com>
  8. *
  9. * Derived from Beagle Board and 3430 SDP code by
  10. * Richard Woodruff <r-woodruff2@ti.com>
  11. * Syed Mohammed Khasim <khasim@ti.com>
  12. *
  13. *
  14. * See file CREDITS for list of people who contributed to this
  15. * project.
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License as
  19. * published by the Free Software Foundation; either version 2 of
  20. * the License, or (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  30. * MA 02111-1307 USA
  31. */
  32. #include <common.h>
  33. #ifdef CONFIG_STATUS_LED
  34. #include <status_led.h>
  35. #endif
  36. #include <twl4030.h>
  37. #include <linux/mtd/nand.h>
  38. #include <asm/io.h>
  39. #include <asm/arch/mmc_host_def.h>
  40. #include <asm/arch/mux.h>
  41. #include <asm/arch/mem.h>
  42. #include <asm/arch/sys_proto.h>
  43. #include <asm/gpio.h>
  44. #include <asm/mach-types.h>
  45. #include <asm/omap_musb.h>
  46. #include <asm/errno.h>
  47. #include <linux/usb/ch9.h>
  48. #include <linux/usb/gadget.h>
  49. #include <linux/usb/musb.h>
  50. #include "beagle.h"
  51. #include <command.h>
  52. #ifdef CONFIG_USB_EHCI
  53. #include <usb.h>
  54. #include <asm/ehci-omap.h>
  55. #endif
  56. #define TWL4030_I2C_BUS 0
  57. #define EXPANSION_EEPROM_I2C_BUS 1
  58. #define EXPANSION_EEPROM_I2C_ADDRESS 0x50
  59. #define TINCANTOOLS_ZIPPY 0x01000100
  60. #define TINCANTOOLS_ZIPPY2 0x02000100
  61. #define TINCANTOOLS_TRAINER 0x04000100
  62. #define TINCANTOOLS_SHOWDOG 0x03000100
  63. #define KBADC_BEAGLEFPGA 0x01000600
  64. #define LW_BEAGLETOUCH 0x01000700
  65. #define BRAINMUX_LCDOG 0x01000800
  66. #define BRAINMUX_LCDOGTOUCH 0x02000800
  67. #define BBTOYS_WIFI 0x01000B00
  68. #define BBTOYS_VGA 0x02000B00
  69. #define BBTOYS_LCD 0x03000B00
  70. #define BCT_BRETTL3 0x01000F00
  71. #define BCT_BRETTL4 0x02000F00
  72. #define LSR_COM6L_ADPT 0x01001300
  73. #define BEAGLE_NO_EEPROM 0xffffffff
  74. DECLARE_GLOBAL_DATA_PTR;
  75. static struct {
  76. unsigned int device_vendor;
  77. unsigned char revision;
  78. unsigned char content;
  79. char fab_revision[8];
  80. char env_var[16];
  81. char env_setting[64];
  82. } expansion_config;
  83. /*
  84. * Routine: board_init
  85. * Description: Early hardware init.
  86. */
  87. int board_init(void)
  88. {
  89. gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
  90. /* board id for Linux */
  91. gd->bd->bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;
  92. /* boot param addr */
  93. gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
  94. #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
  95. status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
  96. #endif
  97. return 0;
  98. }
  99. /*
  100. * Routine: get_board_revision
  101. * Description: Detect if we are running on a Beagle revision Ax/Bx,
  102. * C1/2/3, C4 or xM. This can be done by reading
  103. * the level of GPIO173, GPIO172 and GPIO171. This should
  104. * result in
  105. * GPIO173, GPIO172, GPIO171: 1 1 1 => Ax/Bx
  106. * GPIO173, GPIO172, GPIO171: 1 1 0 => C1/2/3
  107. * GPIO173, GPIO172, GPIO171: 1 0 1 => C4
  108. * GPIO173, GPIO172, GPIO171: 0 0 0 => xM
  109. */
  110. static int get_board_revision(void)
  111. {
  112. int revision;
  113. if (!gpio_request(171, "") &&
  114. !gpio_request(172, "") &&
  115. !gpio_request(173, "")) {
  116. gpio_direction_input(171);
  117. gpio_direction_input(172);
  118. gpio_direction_input(173);
  119. revision = gpio_get_value(173) << 2 |
  120. gpio_get_value(172) << 1 |
  121. gpio_get_value(171);
  122. } else {
  123. printf("Error: unable to acquire board revision GPIOs\n");
  124. revision = -1;
  125. }
  126. return revision;
  127. }
  128. #ifdef CONFIG_SPL_BUILD
  129. /*
  130. * Routine: get_board_mem_timings
  131. * Description: If we use SPL then there is no x-loader nor config header
  132. * so we have to setup the DDR timings ourself on both banks.
  133. */
  134. void get_board_mem_timings(struct board_sdrc_timings *timings)
  135. {
  136. int pop_mfr, pop_id;
  137. /*
  138. * We need to identify what PoP memory is on the board so that
  139. * we know what timings to use. If we can't identify it then
  140. * we know it's an xM. To map the ID values please see nand_ids.c
  141. */
  142. identify_nand_chip(&pop_mfr, &pop_id);
  143. timings->mr = MICRON_V_MR_165;
  144. switch (get_board_revision()) {
  145. case REVISION_C4:
  146. if (pop_mfr == NAND_MFR_STMICRO && pop_id == 0xba) {
  147. /* 512MB DDR */
  148. timings->mcfg = NUMONYX_V_MCFG_165(512 << 20);
  149. timings->ctrla = NUMONYX_V_ACTIMA_165;
  150. timings->ctrlb = NUMONYX_V_ACTIMB_165;
  151. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  152. break;
  153. } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xba) {
  154. /* Beagleboard Rev C4, 512MB Nand/256MB DDR*/
  155. timings->mcfg = MICRON_V_MCFG_165(128 << 20);
  156. timings->ctrla = MICRON_V_ACTIMA_165;
  157. timings->ctrlb = MICRON_V_ACTIMB_165;
  158. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  159. break;
  160. } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xbc) {
  161. /* Beagleboard Rev C5, 256MB DDR */
  162. timings->mcfg = MICRON_V_MCFG_200(256 << 20);
  163. timings->ctrla = MICRON_V_ACTIMA_200;
  164. timings->ctrlb = MICRON_V_ACTIMB_200;
  165. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
  166. break;
  167. }
  168. case REVISION_XM_A:
  169. case REVISION_XM_B:
  170. case REVISION_XM_C:
  171. if (pop_mfr == 0) {
  172. /* 256MB DDR */
  173. timings->mcfg = MICRON_V_MCFG_200(256 << 20);
  174. timings->ctrla = MICRON_V_ACTIMA_200;
  175. timings->ctrlb = MICRON_V_ACTIMB_200;
  176. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
  177. } else {
  178. /* 512MB DDR */
  179. timings->mcfg = NUMONYX_V_MCFG_165(512 << 20);
  180. timings->ctrla = NUMONYX_V_ACTIMA_165;
  181. timings->ctrlb = NUMONYX_V_ACTIMB_165;
  182. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  183. }
  184. break;
  185. default:
  186. /* Assume 128MB and Micron/165MHz timings to be safe */
  187. timings->mcfg = MICRON_V_MCFG_165(128 << 20);
  188. timings->ctrla = MICRON_V_ACTIMA_165;
  189. timings->ctrlb = MICRON_V_ACTIMB_165;
  190. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  191. }
  192. }
  193. #endif
  194. /*
  195. * Routine: get_expansion_id
  196. * Description: This function checks for expansion board by checking I2C
  197. * bus 1 for the availability of an AT24C01B serial EEPROM.
  198. * returns the device_vendor field from the EEPROM
  199. */
  200. static unsigned int get_expansion_id(void)
  201. {
  202. i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
  203. /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
  204. if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
  205. i2c_set_bus_num(TWL4030_I2C_BUS);
  206. return BEAGLE_NO_EEPROM;
  207. }
  208. /* read configuration data */
  209. i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
  210. sizeof(expansion_config));
  211. /* retry reading configuration data with 16bit addressing */
  212. if ((expansion_config.device_vendor == 0xFFFFFF00) ||
  213. (expansion_config.device_vendor == 0xFFFFFFFF)) {
  214. printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n");
  215. i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config,
  216. sizeof(expansion_config));
  217. }
  218. i2c_set_bus_num(TWL4030_I2C_BUS);
  219. return expansion_config.device_vendor;
  220. }
  221. #ifdef CONFIG_VIDEO_OMAP3
  222. /*
  223. * Configure DSS to display background color on DVID
  224. * Configure VENC to display color bar on S-Video
  225. */
  226. static void beagle_display_init(void)
  227. {
  228. omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH);
  229. switch (get_board_revision()) {
  230. case REVISION_AXBX:
  231. case REVISION_CX:
  232. case REVISION_C4:
  233. omap3_dss_panel_config(&dvid_cfg);
  234. break;
  235. case REVISION_XM_A:
  236. case REVISION_XM_B:
  237. case REVISION_XM_C:
  238. default:
  239. omap3_dss_panel_config(&dvid_cfg_xm);
  240. break;
  241. }
  242. }
  243. /*
  244. * Enable DVI power
  245. */
  246. static void beagle_dvi_pup(void)
  247. {
  248. uchar val;
  249. switch (get_board_revision()) {
  250. case REVISION_AXBX:
  251. case REVISION_CX:
  252. case REVISION_C4:
  253. case REVISION_XM_A:
  254. gpio_request(170, "");
  255. gpio_direction_output(170, 0);
  256. gpio_set_value(170, 1);
  257. break;
  258. case REVISION_XM_B:
  259. case REVISION_XM_C:
  260. default:
  261. #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3)
  262. #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6)
  263. i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
  264. val |= 4;
  265. i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
  266. i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
  267. val |= 4;
  268. i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
  269. break;
  270. }
  271. }
  272. #endif
  273. #ifdef CONFIG_USB_MUSB_OMAP2PLUS
  274. static struct musb_hdrc_config musb_config = {
  275. .multipoint = 1,
  276. .dyn_fifo = 1,
  277. .num_eps = 16,
  278. .ram_bits = 12,
  279. };
  280. static struct omap_musb_board_data musb_board_data = {
  281. .interface_type = MUSB_INTERFACE_ULPI,
  282. };
  283. static struct musb_hdrc_platform_data musb_plat = {
  284. #if defined(CONFIG_MUSB_HOST)
  285. .mode = MUSB_HOST,
  286. #elif defined(CONFIG_MUSB_GADGET)
  287. .mode = MUSB_PERIPHERAL,
  288. #else
  289. #error "Please define either CONFIG_MUSB_HOST or CONFIG_MUSB_GADGET"
  290. #endif
  291. .config = &musb_config,
  292. .power = 100,
  293. .platform_ops = &omap2430_ops,
  294. .board_data = &musb_board_data,
  295. };
  296. #endif
  297. /*
  298. * Routine: misc_init_r
  299. * Description: Configure board specific parts
  300. */
  301. int misc_init_r(void)
  302. {
  303. struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
  304. struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
  305. struct control_prog_io *prog_io_base = (struct control_prog_io *)OMAP34XX_CTRL_BASE;
  306. /* Enable i2c2 pullup resisters */
  307. writel(~(PRG_I2C2_PULLUPRESX), &prog_io_base->io1);
  308. switch (get_board_revision()) {
  309. case REVISION_AXBX:
  310. printf("Beagle Rev Ax/Bx\n");
  311. setenv("beaglerev", "AxBx");
  312. break;
  313. case REVISION_CX:
  314. printf("Beagle Rev C1/C2/C3\n");
  315. setenv("beaglerev", "Cx");
  316. MUX_BEAGLE_C();
  317. break;
  318. case REVISION_C4:
  319. printf("Beagle Rev C4\n");
  320. setenv("beaglerev", "C4");
  321. MUX_BEAGLE_C();
  322. /* Set VAUX2 to 1.8V for EHCI PHY */
  323. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  324. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  325. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  326. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  327. break;
  328. case REVISION_XM_A:
  329. printf("Beagle xM Rev A\n");
  330. setenv("beaglerev", "xMA");
  331. MUX_BEAGLE_XM();
  332. /* Set VAUX2 to 1.8V for EHCI PHY */
  333. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  334. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  335. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  336. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  337. break;
  338. case REVISION_XM_B:
  339. printf("Beagle xM Rev B\n");
  340. setenv("beaglerev", "xMB");
  341. MUX_BEAGLE_XM();
  342. /* Set VAUX2 to 1.8V for EHCI PHY */
  343. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  344. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  345. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  346. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  347. break;
  348. case REVISION_XM_C:
  349. printf("Beagle xM Rev C\n");
  350. setenv("beaglerev", "xMC");
  351. MUX_BEAGLE_XM();
  352. /* Set VAUX2 to 1.8V for EHCI PHY */
  353. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  354. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  355. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  356. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  357. break;
  358. default:
  359. printf("Beagle unknown 0x%02x\n", get_board_revision());
  360. MUX_BEAGLE_XM();
  361. /* Set VAUX2 to 1.8V for EHCI PHY */
  362. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  363. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  364. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  365. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  366. }
  367. switch (get_expansion_id()) {
  368. case TINCANTOOLS_ZIPPY:
  369. printf("Recognized Tincantools Zippy board (rev %d %s)\n",
  370. expansion_config.revision,
  371. expansion_config.fab_revision);
  372. MUX_TINCANTOOLS_ZIPPY();
  373. setenv("buddy", "zippy");
  374. break;
  375. case TINCANTOOLS_ZIPPY2:
  376. printf("Recognized Tincantools Zippy2 board (rev %d %s)\n",
  377. expansion_config.revision,
  378. expansion_config.fab_revision);
  379. MUX_TINCANTOOLS_ZIPPY();
  380. setenv("buddy", "zippy2");
  381. break;
  382. case TINCANTOOLS_TRAINER:
  383. printf("Recognized Tincantools Trainer board (rev %d %s)\n",
  384. expansion_config.revision,
  385. expansion_config.fab_revision);
  386. MUX_TINCANTOOLS_ZIPPY();
  387. MUX_TINCANTOOLS_TRAINER();
  388. setenv("buddy", "trainer");
  389. break;
  390. case TINCANTOOLS_SHOWDOG:
  391. printf("Recognized Tincantools Showdow board (rev %d %s)\n",
  392. expansion_config.revision,
  393. expansion_config.fab_revision);
  394. /* Place holder for DSS2 definition for showdog lcd */
  395. setenv("defaultdisplay", "showdoglcd");
  396. setenv("buddy", "showdog");
  397. break;
  398. case KBADC_BEAGLEFPGA:
  399. printf("Recognized KBADC Beagle FPGA board\n");
  400. MUX_KBADC_BEAGLEFPGA();
  401. setenv("buddy", "beaglefpga");
  402. break;
  403. case LW_BEAGLETOUCH:
  404. printf("Recognized Liquidware BeagleTouch board\n");
  405. setenv("buddy", "beagletouch");
  406. break;
  407. case BRAINMUX_LCDOG:
  408. printf("Recognized Brainmux LCDog board\n");
  409. setenv("buddy", "lcdog");
  410. break;
  411. case BRAINMUX_LCDOGTOUCH:
  412. printf("Recognized Brainmux LCDog Touch board\n");
  413. setenv("buddy", "lcdogtouch");
  414. break;
  415. case BBTOYS_WIFI:
  416. printf("Recognized BeagleBoardToys WiFi board\n");
  417. MUX_BBTOYS_WIFI()
  418. setenv("buddy", "bbtoys-wifi");
  419. break;;
  420. case BBTOYS_VGA:
  421. printf("Recognized BeagleBoardToys VGA board\n");
  422. break;;
  423. case BBTOYS_LCD:
  424. printf("Recognized BeagleBoardToys LCD board\n");
  425. break;;
  426. case BCT_BRETTL3:
  427. printf("Recognized bct electronic GmbH brettl3 board\n");
  428. break;
  429. case BCT_BRETTL4:
  430. printf("Recognized bct electronic GmbH brettl4 board\n");
  431. break;
  432. case LSR_COM6L_ADPT:
  433. printf("Recognized LSR COM6L Adapter Board\n");
  434. MUX_BBTOYS_WIFI()
  435. setenv("buddy", "lsr-com6l-adpt");
  436. break;
  437. case BEAGLE_NO_EEPROM:
  438. printf("No EEPROM on expansion board\n");
  439. setenv("buddy", "none");
  440. break;
  441. default:
  442. printf("Unrecognized expansion board: %x\n",
  443. expansion_config.device_vendor);
  444. setenv("buddy", "unknown");
  445. }
  446. if (expansion_config.content == 1)
  447. setenv(expansion_config.env_var, expansion_config.env_setting);
  448. twl4030_power_init();
  449. switch (get_board_revision()) {
  450. case REVISION_XM_A:
  451. case REVISION_XM_B:
  452. twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
  453. break;
  454. default:
  455. twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
  456. break;
  457. }
  458. /* Set GPIO states before they are made outputs */
  459. writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1,
  460. &gpio6_base->setdataout);
  461. writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
  462. GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout);
  463. /* Configure GPIOs to output */
  464. writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe);
  465. writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
  466. GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe);
  467. dieid_num_r();
  468. #ifdef CONFIG_VIDEO_OMAP3
  469. beagle_dvi_pup();
  470. beagle_display_init();
  471. omap3_dss_enable();
  472. #endif
  473. #ifdef CONFIG_USB_MUSB_OMAP2PLUS
  474. musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE);
  475. #endif
  476. return 0;
  477. }
  478. /*
  479. * Routine: set_muxconf_regs
  480. * Description: Setting up the configuration Mux registers specific to the
  481. * hardware. Many pins need to be moved from protect to primary
  482. * mode.
  483. */
  484. void set_muxconf_regs(void)
  485. {
  486. MUX_BEAGLE();
  487. }
  488. #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
  489. int board_mmc_init(bd_t *bis)
  490. {
  491. return omap_mmc_init(0, 0, 0, -1, -1);
  492. }
  493. #endif
  494. #if defined(CONFIG_USB_EHCI) && !defined(CONFIG_SPL_BUILD)
  495. /* Call usb_stop() before starting the kernel */
  496. void show_boot_progress(int val)
  497. {
  498. if (val == BOOTSTAGE_ID_RUN_OS)
  499. usb_stop();
  500. }
  501. static struct omap_usbhs_board_data usbhs_bdata = {
  502. .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
  503. .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
  504. .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
  505. };
  506. int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
  507. {
  508. return omap_ehci_hcd_init(&usbhs_bdata, hccr, hcor);
  509. }
  510. int ehci_hcd_stop(int index)
  511. {
  512. return omap_ehci_hcd_stop();
  513. }
  514. #endif /* CONFIG_USB_EHCI */
  515. #if defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET)
  516. int board_eth_init(bd_t *bis)
  517. {
  518. return usb_eth_initialize(bis);
  519. }
  520. #endif