X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Ftsec.c;h=2524e4f6d2b6644a3ec69cb7324f16d37b202e4c;hb=e0b369e4f71b11dd5716903dd6258028cf07e6e8;hp=770517b87e468db5ee453f6ed0c70fdb99706959;hpb=0ee90cb77e01d6e8ccd37e1bd96678597875c391;p=u-boot diff --git a/drivers/tsec.c b/drivers/tsec.c index 770517b87e..2524e4f6d2 100644 --- a/drivers/tsec.c +++ b/drivers/tsec.c @@ -313,7 +313,8 @@ static int init_phy(struct eth_device *dev) * PHY */ curphy = get_phy_info(dev); - if (NULL == curphy) { + if (curphy == NULL) { + priv->phyinfo = NULL; printf("%s: No PHY found\n", dev->name); return 0; @@ -609,11 +610,10 @@ static void adjust_link(struct eth_device *dev) regs->maccfg2 = ((regs->maccfg2 & ~(MACCFG2_IF)) | MACCFG2_MII); - /* If We're in reduced mode, we need - * to say whether we're 10 or 100 MB. + /* Set R100 bit in all modes although + * it is only used in RGMII mode */ - if ((priv->speed == 100) - && (priv->flags & TSEC_REDUCED)) + if (priv->speed == 100) regs->ecntrl |= ECNTRL_R100; else regs->ecntrl &= ~(ECNTRL_R100); @@ -661,7 +661,8 @@ static void startup_tsec(struct eth_device *dev) rtx.txbd[TX_BUF_CNT - 1].status |= TXBD_WRAP; /* Start up the PHY */ - phy_run_commands(priv, priv->phyinfo->startup); + if(priv->phyinfo) + phy_run_commands(priv, priv->phyinfo->startup); adjust_link(dev); /* Enable Transmit and Receive */ @@ -765,7 +766,8 @@ static void tsec_halt(struct eth_device *dev) regs->maccfg1 &= ~(MACCFG1_TX_EN | MACCFG1_RX_EN); /* Shut down the PHY, as needed */ - phy_run_commands(priv, priv->phyinfo->shutdown); + if(priv->phyinfo) + phy_run_commands(priv, priv->phyinfo->shutdown); } struct phy_info phy_info_M88E1011S = { @@ -813,6 +815,7 @@ struct phy_info phy_info_M88E1111S = { {0x1d, 0x5, NULL}, {0x1e, 0x0, NULL}, {0x1e, 0x100, NULL}, + {0x14, 0x0cd2, NULL}, /* Delay RGMII TX and RX */ {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL}, {MIIM_ANAR, MIIM_ANAR_INIT, NULL}, {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL}, @@ -1107,10 +1110,8 @@ struct phy_info phy_info_dp83865 = { }; struct phy_info *phy_info[] = { -#if 0 - &phy_info_cis8201, -#endif &phy_info_cis8204, + &phy_info_cis8201, &phy_info_M88E1011S, &phy_info_M88E1111S, &phy_info_M88E1145,