Commit 140bc929 authored by Sergei Poselenov's avatar Sergei Poselenov Committed by David S. Miller

phylib: Basic support for the M88E1121R Marvell chip

Add support for the Marvell M88E1121R Dual GigE PHY
Signed-off-by: default avatarYuri Tikhonov <yur@emcraft.com>
Signed-off-by: default avatarSergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: default avatarAnatolij Gustschin <agust@denx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83400207
...@@ -69,6 +69,11 @@ ...@@ -69,6 +69,11 @@
#define MII_M1111_COPPER 0 #define MII_M1111_COPPER 0
#define MII_M1111_FIBER 1 #define MII_M1111_FIBER 1
#define MII_88E1121_PHY_LED_CTRL 16
#define MII_88E1121_PHY_LED_PAGE 3
#define MII_88E1121_PHY_LED_DEF 0x0030
#define MII_88E1121_PHY_PAGE 22
#define MII_M1011_PHY_STATUS 0x11 #define MII_M1011_PHY_STATUS 0x11
#define MII_M1011_PHY_STATUS_1000 0x8000 #define MII_M1011_PHY_STATUS_1000 0x8000
#define MII_M1011_PHY_STATUS_100 0x4000 #define MII_M1011_PHY_STATUS_100 0x4000
...@@ -154,6 +159,30 @@ static int marvell_config_aneg(struct phy_device *phydev) ...@@ -154,6 +159,30 @@ static int marvell_config_aneg(struct phy_device *phydev)
return err; return err;
} }
static int m88e1121_config_aneg(struct phy_device *phydev)
{
int err, temp;
err = phy_write(phydev, MII_BMCR, BMCR_RESET);
if (err < 0)
return err;
err = phy_write(phydev, MII_M1011_PHY_SCR,
MII_M1011_PHY_SCR_AUTO_CROSS);
if (err < 0)
return err;
temp = phy_read(phydev, MII_88E1121_PHY_PAGE);
phy_write(phydev, MII_88E1121_PHY_PAGE, MII_88E1121_PHY_LED_PAGE);
phy_write(phydev, MII_88E1121_PHY_LED_CTRL, MII_88E1121_PHY_LED_DEF);
phy_write(phydev, MII_88E1121_PHY_PAGE, temp);
err = genphy_config_aneg(phydev);
return err;
}
static int m88e1111_config_init(struct phy_device *phydev) static int m88e1111_config_init(struct phy_device *phydev)
{ {
int err; int err;
...@@ -481,6 +510,18 @@ static struct phy_driver marvell_drivers[] = { ...@@ -481,6 +510,18 @@ static struct phy_driver marvell_drivers[] = {
.config_intr = &marvell_config_intr, .config_intr = &marvell_config_intr,
.driver = {.owner = THIS_MODULE,}, .driver = {.owner = THIS_MODULE,},
}, },
{
.phy_id = 0x01410cb0,
.phy_id_mask = 0xfffffff0,
.name = "Marvell 88E1121R",
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &m88e1121_config_aneg,
.read_status = &marvell_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
.driver = { .owner = THIS_MODULE },
},
{ {
.phy_id = 0x01410cd0, .phy_id = 0x01410cd0,
.phy_id_mask = 0xfffffff0, .phy_id_mask = 0xfffffff0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment