[U-Boot] [PATCH 0/2] net: Support Marvell 88E1510 and fix 88E151x init

Hi,
I improved the Errata fixup for Marvell 88E151x Ethernet PHYs and added support for the 88E1510 which is very similar to the 88E1518. I also configured the LEDs and the INTn output for the 88E1510.
Best regards, Clemens Gruber
Clemens Gruber (2): net: Improve 88E151x PHY initialization net: Add support for Marvell 88E1510 PHY
drivers/net/phy/marvell.c | 67 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 14 deletions(-)

- The EEE fixup magic should also be enabled for RGMII - Improved comments
Signed-off-by: Clemens Gruber clemens.gruber@pqgruber.com Cc: Joe Hershberger joe.hershberger@ni.com Cc: Hao Zhang hzhang@ti.com Cc: Michal Simek michal.simek@xilinx.com --- drivers/net/phy/marvell.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 9437c3b..cff5c87 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -303,24 +303,33 @@ static int m88e1518_config(struct phy_device *phydev) * As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512 * /88E1514 Rev A0, Errata Section 3.1 */ + + /* EEE initialization */ + phy_write(phydev, MDIO_DEVAD_NONE, 22, 0x00ff); + phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x214B); + phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2144); + phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x0C28); + phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2146); + phy_write(phydev, MDIO_DEVAD_NONE, 17, 0xB233); + phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x214D); + phy_write(phydev, MDIO_DEVAD_NONE, 17, 0xCC0C); + phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2159); + phy_write(phydev, MDIO_DEVAD_NONE, 22, 0x0000); + + /* SGMII-to-Copper mode initialization */ if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { - phy_write(phydev, MDIO_DEVAD_NONE, 22, 0x00ff); /* page 0xff */ - phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x214B); - phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2144); - phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x0C28); - phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2146); - phy_write(phydev, MDIO_DEVAD_NONE, 17, 0xB233); - phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x214D); - phy_write(phydev, MDIO_DEVAD_NONE, 17, 0xCC0C); - phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2159); - phy_write(phydev, MDIO_DEVAD_NONE, 22, 0x0000); /* reg page 0 */ - phy_write(phydev, MDIO_DEVAD_NONE, 22, 18); /* reg page 18 */ - /* Write HWCFG_MODE = SGMII to Copper */ + /* Select page 18 */ + phy_write(phydev, MDIO_DEVAD_NONE, 22, 18); + + /* In reg 20, write MODE[2:0] = 0x1 (SGMII to Copper) */ m88e1518_phy_writebits(phydev, 20, 0, 3, 1);
- /* Phy reset */ + /* PHY reset is necessary after changing MODE[2:0] */ m88e1518_phy_writebits(phydev, 20, 15, 1, 1); - phy_write(phydev, MDIO_DEVAD_NONE, 22, 0); /* reg page 18 */ + + /* Reset page selection */ + phy_write(phydev, MDIO_DEVAD_NONE, 22, 0); + udelay(100); }

Hi Clemens,
On Sat, Jun 6, 2015 at 7:44 AM, Clemens Gruber clemens.gruber@pqgruber.com wrote:
- The EEE fixup magic should also be enabled for RGMII
- Improved comments
Signed-off-by: Clemens Gruber clemens.gruber@pqgruber.com Cc: Joe Hershberger joe.hershberger@ni.com Cc: Hao Zhang hzhang@ti.com Cc: Michal Simek michal.simek@xilinx.com
Acked-by: Joe Hershberger joe.hershberger@ni.com
I'll pull this into the u-boot-net tree.
Cheers, -Joe

Hi Clemens,
On Wed, Jun 10, 2015 at 9:26 AM, Joe Hershberger joe.hershberger@gmail.com wrote:
Hi Clemens,
On Sat, Jun 6, 2015 at 7:44 AM, Clemens Gruber clemens.gruber@pqgruber.com wrote:
- The EEE fixup magic should also be enabled for RGMII
- Improved comments
Signed-off-by: Clemens Gruber clemens.gruber@pqgruber.com Cc: Joe Hershberger joe.hershberger@ni.com Cc: Hao Zhang hzhang@ti.com Cc: Michal Simek michal.simek@xilinx.com
Acked-by: Joe Hershberger joe.hershberger@ni.com
I'll pull this into the u-boot-net tree.
Applied to u-boot-net, thanks! -Joe

Support the 88E1510 PHY which is very similar to the 88E1518. I also set the INTn output and configured the LEDs.
Signed-off-by: Clemens Gruber clemens.gruber@pqgruber.com Cc: Joe Hershberger joe.hershberger@ni.com Cc: Hao Zhang hzhang@ti.com Cc: Michal Simek michal.simek@xilinx.com
--- This replaces the previously sent patch http://patchwork.ozlabs.org/patch/478488/ --- drivers/net/phy/marvell.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index cff5c87..eab1558 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -336,6 +336,25 @@ static int m88e1518_config(struct phy_device *phydev) return m88e1111s_config(phydev); }
+/* Marvell 88E1510 */ +static int m88e1510_config(struct phy_device *phydev) +{ + /* Select page 3 */ + phy_write(phydev, MDIO_DEVAD_NONE, 22, 3); + + /* Enable INTn output on LED[2] */ + m88e1518_phy_writebits(phydev, 18, 7, 1, 1); + + /* Configure LEDs */ + m88e1518_phy_writebits(phydev, 16, 0, 4, 3); /* LED[0]:0011 (ACT) */ + m88e1518_phy_writebits(phydev, 16, 4, 4, 6); /* LED[1]:0110 (LINK) */ + + /* Reset page selection */ + phy_write(phydev, MDIO_DEVAD_NONE, 22, 0); + + return m88e1518_config(phydev); +} + /* Marvell 88E1118 */ static int m88e1118_config(struct phy_device *phydev) { @@ -548,6 +567,16 @@ static struct phy_driver M88E1149S_driver = { .shutdown = &genphy_shutdown, };
+static struct phy_driver M88E1510_driver = { + .name = "Marvell 88E1510", + .uid = 0x1410dd0, + .mask = 0xffffff0, + .features = PHY_GBIT_FEATURES, + .config = &m88e1510_config, + .startup = &m88e1011s_startup, + .shutdown = &genphy_shutdown, +}; + static struct phy_driver M88E1518_driver = { .name = "Marvell 88E1518", .uid = 0x1410dd1, @@ -578,6 +607,7 @@ int phy_marvell_init(void) phy_register(&M88E1118R_driver); phy_register(&M88E1111S_driver); phy_register(&M88E1011S_driver); + phy_register(&M88E1510_driver); phy_register(&M88E1518_driver);
return 0;

Hi Clemens,
On Sat, Jun 6, 2015 at 7:44 AM, Clemens Gruber clemens.gruber@pqgruber.com wrote:
Support the 88E1510 PHY which is very similar to the 88E1518. I also set the INTn output and configured the LEDs.
Signed-off-by: Clemens Gruber clemens.gruber@pqgruber.com Cc: Joe Hershberger joe.hershberger@ni.com Cc: Hao Zhang hzhang@ti.com Cc: Michal Simek michal.simek@xilinx.com
This replaces the previously sent patch http://patchwork.ozlabs.org/patch/478488/
Acked-by: Joe Hershberger joe.hershberger@ni.com
I'll pull this into the u-boot-net tree.
Cheers, -Joe

Hi Clemens,
On Sat, Jun 6, 2015 at 7:44 AM, Clemens Gruber clemens.gruber@pqgruber.com wrote:
Support the 88E1510 PHY which is very similar to the 88E1518. I also set the INTn output and configured the LEDs.
Signed-off-by: Clemens Gruber clemens.gruber@pqgruber.com Cc: Joe Hershberger joe.hershberger@ni.com Cc: Hao Zhang hzhang@ti.com Cc: Michal Simek michal.simek@xilinx.com
Applied to u-boot-net, thanks! -Joe
participants (2)
-
Clemens Gruber
-
Joe Hershberger