[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54B035F4.4020804@Freescale.com>
Date: Fri, 9 Jan 2015 14:11:32 -0600
From: Emil Medve <Emilian.Medve@...escale.com>
To: <shh.xie@...il.com>, <netdev@...r.kernel.org>,
<davem@...emloft.net>
CC: Andy Fleming <afleming@...il.com>,
Shaohui Xie <Shaohui.Xie@...escale.com>
Subject: Re: [PATCH] net/fsl: Add mEMAC MDIO support to XGMAC MDIO
Hello Shao-Hui,
On 01/04/2015 03:36 AM, shh.xie@...il.com wrote:
> From: Andy Fleming <afleming@...il.com>
>
> The Freescale mEMAC supports operating at 10/100/1000/10G, and
> its associated MDIO controller is likewise capable of operating
> both Clause 22 and Clause 45 MDIO buses. It is nearly identical
> to the MDIO controller on the XGMAC, so we just modify that
> driver.
>
> Portions of this driver developed by:
>
> Sandeep Singh <sandeep@...escale.com>
> Roy Zang <tie-fei.zang@...escale.com>
>
> Signed-off-by: Andy Fleming <afleming@...il.com>
> Signed-off-by: Shaohui Xie <Shaohui.Xie@...escale.com>
> ---
> drivers/net/ethernet/freescale/Kconfig | 3 +-
> drivers/net/ethernet/freescale/xgmac_mdio.c | 64 ++++++++++++++++++++++++-----
> 2 files changed, 55 insertions(+), 12 deletions(-)
>
> ...
>
> diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
> index a352445..e0fc3d1 100644
> --- a/drivers/net/ethernet/freescale/xgmac_mdio.c
> +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
>
> ...
>
> @@ -123,21 +144,39 @@ static int xgmac_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 val
> static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
> {
> struct tgec_mdio_controller __iomem *regs = bus->priv;
> - uint16_t dev_addr = regnum >> 16;
> + uint16_t dev_addr;
> + uint32_t mdio_stat;
> uint32_t mdio_ctl;
> uint16_t value;
> int ret;
>
> + mdio_stat = in_be32(®s->mdio_stat);
> + if (regnum & MII_ADDR_C45) {
> + dev_addr = (regnum >> 16) & 0x1f;
> + mdio_stat |= MDIO_STAT_ENC;
> + } else {
> + dev_addr = regnum & 0x1f;
> + mdio_stat = ~MDIO_STAT_ENC;
Shouldn't this be 'mdio_stat &= ~MDIO_STAT_ENC'?
Cheers,
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists