Re: [U-Boot] [RFC PATCH v2 3/3] net: ag7xxx: No longer ignore link status
On Tue, Jun 27, 2017 at 11:10 AM, Marek Vasutwrote: > On 06/27/2017 05:46 PM, Joe Hershberger wrote: >> On Tue, Jun 27, 2017 at 4:32 AM, Marek Vasut wrote: >>> On 06/26/2017 09:40 PM, Joe Hershberger wrote: In the case of the WAN port, pay attention to the link status. In the case of LAN ports, stop reading the link status since we don't care. Signed-off-by: Joe Hershberger >>> >>> Well, let's see how that works, ev. I'll have to bisect. >>> btw I hope all this is post-2017.07 material. >> >> I'm not intending to apply any of these until you sign off it's >> functionality. > > Hm, maybe Wills can help with that ... CCed So... still functional? Thanks, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v2 3/3] net: ag7xxx: No longer ignore link status
On 06/27/2017 05:46 PM, Joe Hershberger wrote: > On Tue, Jun 27, 2017 at 4:32 AM, Marek Vasutwrote: >> On 06/26/2017 09:40 PM, Joe Hershberger wrote: >>> In the case of the WAN port, pay attention to the link status. >>> In the case of LAN ports, stop reading the link status since we don't >>> care. >>> >>> Signed-off-by: Joe Hershberger >> >> Well, let's see how that works, ev. I'll have to bisect. >> btw I hope all this is post-2017.07 material. > > I'm not intending to apply any of these until you sign off it's functionality. Hm, maybe Wills can help with that ... CCed -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v2 3/3] net: ag7xxx: No longer ignore link status
On Tue, Jun 27, 2017 at 4:32 AM, Marek Vasutwrote: > On 06/26/2017 09:40 PM, Joe Hershberger wrote: >> In the case of the WAN port, pay attention to the link status. >> In the case of LAN ports, stop reading the link status since we don't >> care. >> >> Signed-off-by: Joe Hershberger > > Well, let's see how that works, ev. I'll have to bisect. > btw I hope all this is post-2017.07 material. I'm not intending to apply any of these until you sign off it's functionality. -Joe ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v2 3/3] net: ag7xxx: No longer ignore link status
On 06/26/2017 09:40 PM, Joe Hershberger wrote: > In the case of the WAN port, pay attention to the link status. > In the case of LAN ports, stop reading the link status since we don't > care. > > Signed-off-by: Joe HershbergerWell, let's see how that works, ev. I'll have to bisect. btw I hope all this is post-2017.07 material. > --- > This is a pass at improving the code quality. > This has not been tested in any way. > > Changes in v2: > - New - Split link status change into its own patch (so it can be dropped if > it affects behavior) > > drivers/net/ag7xxx.c | 18 ++ > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/ag7xxx.c b/drivers/net/ag7xxx.c > index 00e6806..c8352d1 100644 > --- a/drivers/net/ag7xxx.c > +++ b/drivers/net/ag7xxx.c > @@ -100,6 +100,12 @@ enum ag7xxx_model { > /* Rx Status */ > #define AG7XXX_ETH_DMA_RX_STATUS 0x194 > > +/* PHY Control Registers */ > + > +/* PHY Specific Status Register */ > +#define AG7XXX_PHY_PSSR 0x11 > +#define AG7XXX_PHY_PSSR_LINK_UP BIT(10) > + > /* Custom register at 0x1807 */ > #define AG7XXX_GMAC_ETH_CFG 0x00 > #define AG7XXX_ETH_CFG_SW_PHY_ADDR_SWAP BIT(8) > @@ -758,10 +764,13 @@ static int ag933x_phy_setup_common(struct udevice *dev) > return ret; > > /* Read out link status */ > - ret = ag7xxx_mdio_read(priv->bus, phymax, 0, MII_MIPSCR); > + ret = ag7xxx_mdio_read(priv->bus, phymax, 0, AG7XXX_PHY_PSSR); > if (ret < 0) > return ret; > > + if (!(ret & AG7XXX_PHY_PSSR_LINK_UP)) > + return -ENOLINK; > + > return 0; > } > > @@ -778,13 +787,6 @@ static int ag933x_phy_setup_common(struct udevice *dev) > return ret; > } > > - for (i = 0; i < phymax; i++) { > - /* Read out link status */ > - ret = ag7xxx_mdio_read(priv->bus, i, 0, MII_MIPSCR); > - if (ret < 0) > - return ret; > - } > - > return 0; > } > > -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot