summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-08-06 12:33:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-08-06 12:33:15 +0200
commite188d2ec26e8cf6d4ba0908e76868e91b6999fdf (patch)
tree268e1a3340d6e195a02068a31b70043088d95b8f /drivers
parent4ee01d2b469f65d92c6e7759152cd31fbfbb1414 (diff)
parentab8e23f239ddda7fff4d9a12a9d856d346e0d553 (diff)
downloadbarebox-e188d2ec26e8cf6d4ba0908e76868e91b6999fdf.tar.gz
barebox-e188d2ec26e8cf6d4ba0908e76868e91b6999fdf.tar.xz
Merge branch 'for-next/net'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/at803x.c36
-rw-r--r--drivers/net/phy/phy.c3
2 files changed, 4 insertions, 35 deletions
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index a244c87cba..de5bf200c9 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -33,41 +33,11 @@
static int at803x_config_init(struct phy_device *phydev)
{
- int val;
int ret;
- u32 features;
- features = SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_AUI |
- SUPPORTED_FIBRE | SUPPORTED_BNC;
-
- val = phy_read(phydev, MII_BMSR);
- if (val < 0)
- return val;
-
- if (val & BMSR_ANEGCAPABLE)
- features |= SUPPORTED_Autoneg;
- if (val & BMSR_100FULL)
- features |= SUPPORTED_100baseT_Full;
- if (val & BMSR_100HALF)
- features |= SUPPORTED_100baseT_Half;
- if (val & BMSR_10FULL)
- features |= SUPPORTED_10baseT_Full;
- if (val & BMSR_10HALF)
- features |= SUPPORTED_10baseT_Half;
-
- if (val & BMSR_ESTATEN) {
- val = phy_read(phydev, MII_ESTATUS);
- if (val < 0)
- return val;
-
- if (val & ESTATUS_1000_TFULL)
- features |= SUPPORTED_1000baseT_Full;
- if (val & ESTATUS_1000_THALF)
- features |= SUPPORTED_1000baseT_Half;
- }
-
- phydev->supported = features;
- phydev->advertising = features;
+ ret = genphy_config_init(phydev);
+ if (ret < 0)
+ return ret;
if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
ret = phy_write(phydev, AT803X_DEBUG_ADDR,
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index edf5d03d94..2b3c5e2e02 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -29,7 +29,6 @@
#define PHY_AN_TIMEOUT 10
static struct phy_driver genphy_driver;
-static int genphy_config_init(struct phy_device *phydev);
/**
* phy_aneg_done - return auto-negotiation status
@@ -806,7 +805,7 @@ void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, int devad,
phy_write(phydev, MII_MMD_DATA, data);
}
-static int genphy_config_init(struct phy_device *phydev)
+int genphy_config_init(struct phy_device *phydev)
{
int val;
u32 features;