Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: Implement the 6390 external MDIO bus
Browse files Browse the repository at this point in the history
With all the infrastructure in place, implement access to the external
MDIO bus on the 6390 family.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Jan 24, 2017
1 parent a3c53be commit c61a6a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/dsa/mv88e6xxx/global2.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,12 @@ int mv88e6xxx_g2_smi_phy_read(struct mv88e6xxx_chip *chip,
int addr, int reg, u16 *val)
{
u16 cmd = GLOBAL2_SMI_PHY_CMD_OP_22_READ_DATA | (addr << 5) | reg;
struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv;
int err;

if (mdio_bus->external)
cmd |= GLOBAL2_SMI_PHY_CMD_EXTERNAL;

err = mv88e6xxx_g2_smi_phy_wait(chip);
if (err)
return err;
Expand All @@ -524,8 +528,12 @@ int mv88e6xxx_g2_smi_phy_write(struct mv88e6xxx_chip *chip,
int addr, int reg, u16 val)
{
u16 cmd = GLOBAL2_SMI_PHY_CMD_OP_22_WRITE_DATA | (addr << 5) | reg;
struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv;
int err;

if (mdio_bus->external)
cmd |= GLOBAL2_SMI_PHY_CMD_EXTERNAL;

err = mv88e6xxx_g2_smi_phy_wait(chip);
if (err)
return err;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/dsa/mv88e6xxx/mv88e6xxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@
#define GLOBAL2_PTP_AVB_DATA 0x17
#define GLOBAL2_SMI_PHY_CMD 0x18
#define GLOBAL2_SMI_PHY_CMD_BUSY BIT(15)
#define GLOBAL2_SMI_PHY_CMD_EXTERNAL BIT(13)
#define GLOBAL2_SMI_PHY_CMD_MODE_22 BIT(12)
#define GLOBAL2_SMI_PHY_CMD_OP_22_WRITE_DATA ((0x1 << 10) | \
GLOBAL2_SMI_PHY_CMD_MODE_22 | \
Expand Down

0 comments on commit c61a6a7

Please sign in to comment.