mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
net: stmmac: mdio: improve mdio register field definitions
Include the register name in the definitions, and use a name which more closely resembles that used in documentation, while still being descriptive. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Mohd Ayaan Anwar <quic_mohdayaa@quicinc.com> Link: https://patch.msgid.link/E1uu8oM-00000001vp4-3DC5@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
9b88194a3b
commit
3581acbb78
|
|
@ -23,9 +23,9 @@
|
|||
#include "dwxgmac2.h"
|
||||
#include "stmmac.h"
|
||||
|
||||
#define MII_BUSY 0x00000001
|
||||
#define MII_WRITE 0x00000002
|
||||
#define MII_DATA_MASK GENMASK(15, 0)
|
||||
#define MII_ADDR_GBUSY BIT(0)
|
||||
#define MII_ADDR_GWRITE BIT(1)
|
||||
#define MII_DATA_GD_MASK GENMASK(15, 0)
|
||||
|
||||
/* GMAC4 defines */
|
||||
#define MII_GMAC4_GOC_SHIFT 2
|
||||
|
|
@ -237,7 +237,7 @@ static u32 stmmac_mdio_format_addr(struct stmmac_priv *priv,
|
|||
return ((pa << mii_regs->addr_shift) & mii_regs->addr_mask) |
|
||||
((gr << mii_regs->reg_shift) & mii_regs->reg_mask) |
|
||||
priv->gmii_address_bus_config |
|
||||
MII_BUSY;
|
||||
MII_ADDR_GBUSY;
|
||||
}
|
||||
|
||||
static int stmmac_mdio_access(struct stmmac_priv *priv, unsigned int pa,
|
||||
|
|
@ -252,7 +252,7 @@ static int stmmac_mdio_access(struct stmmac_priv *priv, unsigned int pa,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = stmmac_mdio_wait(mii_address, MII_BUSY);
|
||||
ret = stmmac_mdio_wait(mii_address, MII_ADDR_GBUSY);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
|
@ -261,12 +261,12 @@ static int stmmac_mdio_access(struct stmmac_priv *priv, unsigned int pa,
|
|||
writel(data, mii_data);
|
||||
writel(addr, mii_address);
|
||||
|
||||
ret = stmmac_mdio_wait(mii_address, MII_BUSY);
|
||||
ret = stmmac_mdio_wait(mii_address, MII_ADDR_GBUSY);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
/* Read the data from the MII data register if in read mode */
|
||||
ret = read ? readl(mii_data) & MII_DATA_MASK : 0;
|
||||
ret = read ? readl(mii_data) & MII_DATA_GD_MASK : 0;
|
||||
|
||||
out:
|
||||
pm_runtime_put(priv->device);
|
||||
|
|
@ -347,7 +347,7 @@ static int stmmac_mdio_write_c22(struct mii_bus *bus, int phyaddr, int phyreg,
|
|||
if (priv->plat->has_gmac4)
|
||||
cmd = MII_GMAC4_WRITE;
|
||||
else
|
||||
cmd = MII_WRITE;
|
||||
cmd = MII_ADDR_GWRITE;
|
||||
|
||||
return stmmac_mdio_write(priv, phyaddr, phyreg, cmd, phydata);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user