Skip to content
Snippets Groups Projects
Commit 91cdaa3a authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Kim Phillips
Browse files

uec: add support for gbit mii status readings

parent aabce7fb
Branches
Tags
No related merge requests found
...@@ -318,6 +318,15 @@ static int genmii_read_status (struct uec_mii_info *mii_info) ...@@ -318,6 +318,15 @@ static int genmii_read_status (struct uec_mii_info *mii_info)
return err; return err;
if (mii_info->autoneg) { if (mii_info->autoneg) {
status = phy_read(mii_info, MII_1000BASETSTATUS);
if (status & (LPA_1000FULL | LPA_1000HALF)) {
mii_info->speed = SPEED_1000;
if (status & LPA_1000FULL)
mii_info->duplex = DUPLEX_FULL;
else
mii_info->duplex = DUPLEX_HALF;
} else {
status = phy_read(mii_info, PHY_ANLPAR); status = phy_read(mii_info, PHY_ANLPAR);
if (status & (PHY_ANLPAR_10FD | PHY_ANLPAR_TXFD)) if (status & (PHY_ANLPAR_10FD | PHY_ANLPAR_TXFD))
...@@ -328,6 +337,7 @@ static int genmii_read_status (struct uec_mii_info *mii_info) ...@@ -328,6 +337,7 @@ static int genmii_read_status (struct uec_mii_info *mii_info)
mii_info->speed = SPEED_100; mii_info->speed = SPEED_100;
else else
mii_info->speed = SPEED_10; mii_info->speed = SPEED_10;
}
mii_info->pause = 0; mii_info->pause = 0;
} }
/* On non-aneg, we assume what we put in BMCR is the speed, /* On non-aneg, we assume what we put in BMCR is the speed,
......
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
#define MII_1000BASETCONTROL_FULLDUPLEXCAP 0x0200 #define MII_1000BASETCONTROL_FULLDUPLEXCAP 0x0200
#define MII_1000BASETCONTROL_HALFDUPLEXCAP 0x0100 #define MII_1000BASETCONTROL_HALFDUPLEXCAP 0x0100
/* 1000BT status */
#define MII_1000BASETSTATUS 0x0a
#define LPA_1000FULL 0x0400
#define LPA_1000HALF 0x0200
/* Cicada Extended Control Register 1 */ /* Cicada Extended Control Register 1 */
#define MII_CIS8201_EXT_CON1 0x17 #define MII_CIS8201_EXT_CON1 0x17
#define MII_CIS8201_EXTCON1_INIT 0x0000 #define MII_CIS8201_EXTCON1_INIT 0x0000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment