/******************************************************************* * Routine:board_eth_init * Description: take the Ethernet controller out of reset and wait * for the EEPROM load to complete. ******************************************************************/ int board_eth_init(bd_t *bis) { int rc = 0; #ifdef CONFIG_LAN91C96 int cnt = 20; __raw_writeb(0x03, OMAP2420_CTRL_BASE + 0x0f2); /*protect->gpio74 */ __raw_writew(0x0, LAN_RESET_REGISTER); do { __raw_writew(0x1, LAN_RESET_REGISTER); udelay(100); if (cnt == 0) goto eth_reset_err_out; --cnt; } while (__raw_readw(LAN_RESET_REGISTER) != 0x1); cnt = 20; do { __raw_writew(0x0, LAN_RESET_REGISTER); udelay(100); if (cnt == 0) goto eth_reset_err_out; --cnt; } while (__raw_readw(LAN_RESET_REGISTER) != 0x0000); udelay(1000); mask_config_reg(ETH_CONTROL_REG, 0x01); udelay(1000); rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE); eth_reset_err_out: #endif return rc; }
/**************************************** * Routine: muxSetupUsb0 (ostboot) * Description: Setup usb muxing *****************************************/ void muxSetupUsb0(void) { mask_config_reg(CONTROL_PADCONF_USB0_PUEN, 0x1f); mask_config_reg(CONTROL_PADCONF_USB0_VP, 0x1f); mask_config_reg(CONTROL_PADCONF_USB0_VM, 0x1f); mask_config_reg(CONTROL_PADCONF_USB0_RCV, 0x1f); mask_config_reg(CONTROL_PADCONF_USB0_TXEN, 0x1f); mask_config_reg(CONTROL_PADCONF_USB0_SE0, 0x1f); mask_config_reg(CONTROL_PADCONF_USB0_DAT, 0x1f); }
/******************************************************************* * Routine:ether_init * Description: take the Ethernet controller out of reset and wait * for the EEPROM load to complete. ******************************************************************/ void ether_init(void) { #ifdef CONFIG_DRIVER_LAN91C96 int cnt = 20; __raw_writeb(0x03, OMAP2420_CTRL_BASE + 0x0f2); /*protect->gpio74 */ __raw_writew(0x0, LAN_RESET_REGISTER); do { __raw_writew(0x1, LAN_RESET_REGISTER); udelay(100); if (cnt == 0) { printf("1. eth reset err\n"); goto eth_reset_err_out; } --cnt; } while (__raw_readw(LAN_RESET_REGISTER) != 0x1); cnt = 20; do { __raw_writew(0x0, LAN_RESET_REGISTER); udelay(100); if (cnt == 0) { printf("2. eth reset err\n"); goto eth_reset_err_out; } --cnt; } while (__raw_readw(LAN_RESET_REGISTER) != 0x0000); udelay(1000); mask_config_reg(ETH_CONTROL_REG, 0x01); udelay(1000); eth_reset_err_out: return; #endif }