/* * Initializes on-chip ethernet controllers. * to override, implement board_eth_init() */ int cpu_eth_init(bd_t *bis) { #if defined(CONFIG_ETHER_ON_FCC) fec_initialize(bis); #endif #if defined(CONFIG_UEC_ETH) uec_standard_init(bis); #endif #if defined(CONFIG_TSEC_ENET) || defined(CONFIG_MPC85XX_FEC) tsec_standard_init(bis); #endif return 0; }
int board_eth_init(bd_t *bis) { struct fsl_pq_mdio_info mdio_info; struct tsec_info_struct tsec_info[4]; ccsr_gur_t *gur __attribute__((unused)) = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); int num = 0; #ifdef CONFIG_VSC7385_ENET char *tmp; unsigned int vscfw_addr; #endif #ifdef CONFIG_TSEC1 SET_STD_TSEC_INFO(tsec_info[num], 1); num++; #endif #ifdef CONFIG_TSEC2 SET_STD_TSEC_INFO(tsec_info[num], 2); if (is_serdes_configured(SGMII_TSEC2)) { printf("eTSEC2 is in sgmii mode.\n"); tsec_info[num].flags |= TSEC_SGMII; } num++; #endif #ifdef CONFIG_TSEC3 SET_STD_TSEC_INFO(tsec_info[num], 3); num++; #endif if (!num) { printf("No TSECs initialized\n"); return 0; } #ifdef CONFIG_VSC7385_ENET /* If a VSC7385 microcode image is present, then upload it. */ tmp = env_get("vscfw_addr"); if (tmp) { vscfw_addr = simple_strtoul(tmp, NULL, 16); printf("uploading VSC7385 microcode from %x\n", vscfw_addr); if (vsc7385_upload_firmware((void *) vscfw_addr, CONFIG_VSC7385_IMAGE_SIZE)) puts("Failure uploading VSC7385 microcode.\n"); } else puts("No address specified for VSC7385 microcode.\n"); #endif mdio_info.regs = TSEC_GET_MDIO_REGS_BASE(1); mdio_info.name = DEFAULT_MII_NAME; fsl_pq_mdio_init(bis, &mdio_info); tsec_eth_init(bis, tsec_info, num); #if defined(CONFIG_UEC_ETH) /* QE0 and QE3 need to be exposed for UCC1 and UCC5 Eth mode */ setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_QE0); setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_QE3); uec_standard_init(bis); #endif return pci_eth_init(bis); }