beagle.c 16 KB

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