summaryrefslogtreecommitdiff
path: root/drivers/net/phy
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/broadcom.c14
-rw-r--r--drivers/net/phy/dp83867.c2
-rw-r--r--drivers/net/phy/ethernet_id.c2
-rw-r--r--drivers/net/phy/realtek.c15
-rw-r--r--drivers/net/phy/xilinx_gmii2rgmii.c9
5 files changed, 13 insertions, 29 deletions
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index ea98cfcc1b5..36c70da181a 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -162,18 +162,6 @@ static int bcm5482_config(struct phy_device *phydev)
return 0;
}
-static int bcm_cygnus_startup(struct phy_device *phydev)
-{
- int ret;
-
- /* Read the Status (2x to make sure link is right) */
- ret = genphy_update_link(phydev);
- if (ret)
- return ret;
-
- return genphy_parse_link(phydev);
-}
-
static void bcm_cygnus_afe(struct phy_device *phydev)
{
/* ensures smdspclk is enabled */
@@ -359,6 +347,6 @@ U_BOOT_PHY_DRIVER(bcm_cygnus) = {
.mask = 0xfffff0,
.features = PHY_GBIT_FEATURES,
.config = &bcm_cygnus_config,
- .startup = &bcm_cygnus_startup,
+ .startup = &genphy_startup,
.shutdown = &genphy_shutdown,
};
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index b861bf7cef3..7111e36aa0d 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -330,7 +330,7 @@ static int dp83867_config(struct phy_device *phydev)
DP83867_RGMIIDCTL, delay);
}
- if (phy_interface_is_sgmii(phydev)) {
+ if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
if (dp83867->sgmii_ref_clk_en)
phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_SGMIICTL,
DP83867_SGMII_TYPE);
diff --git a/drivers/net/phy/ethernet_id.c b/drivers/net/phy/ethernet_id.c
index 8864f99bb32..a715e83db98 100644
--- a/drivers/net/phy/ethernet_id.c
+++ b/drivers/net/phy/ethernet_id.c
@@ -39,7 +39,7 @@ struct phy_device *phy_connect_phy_id(struct mii_dev *bus, struct udevice *dev,
if (!IS_ENABLED(CONFIG_DM_ETH_PHY)) {
ret = gpio_request_by_name_nodev(node, "reset-gpios", 0, &gpio,
- GPIOD_ACTIVE_LOW);
+ GPIOD_IS_OUT | GPIOD_ACTIVE_LOW);
if (!ret) {
assert = ofnode_read_u32_default(node,
"reset-assert-us", 0);
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 247d9753a88..396cac76d63 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -384,17 +384,6 @@ static int rtl8211x_startup(struct phy_device *phydev)
return rtl8211x_parse_status(phydev);
}
-static int rtl8211e_startup(struct phy_device *phydev)
-{
- int ret;
-
- ret = genphy_update_link(phydev);
- if (ret)
- return ret;
-
- return genphy_parse_link(phydev);
-}
-
static int rtl8211f_startup(struct phy_device *phydev)
{
int ret;
@@ -428,7 +417,7 @@ U_BOOT_PHY_DRIVER(rtl8211e) = {
.features = PHY_GBIT_FEATURES,
.probe = &rtl8211e_probe,
.config = &rtl8211e_config,
- .startup = &rtl8211e_startup,
+ .startup = &genphy_startup,
.shutdown = &genphy_shutdown,
};
@@ -465,6 +454,6 @@ U_BOOT_PHY_DRIVER(rtl8201f) = {
.features = PHY_BASIC_FEATURES,
.probe = &rtl8210f_probe,
.config = &rtl8201f_config,
- .startup = &rtl8211e_startup,
+ .startup = &genphy_startup,
.shutdown = &genphy_shutdown,
};
diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 0b7436a7e1e..e2969bc4842 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -48,7 +48,14 @@ static int xilinxgmiitorgmii_config(struct phy_device *phydev)
return -EINVAL;
}
- ext_phydev->interface = PHY_INTERFACE_MODE_RGMII;
+ ext_phydev->interface = ofnode_read_phy_mode(node);
+ if (ext_phydev->interface == PHY_INTERFACE_MODE_NA) {
+ ext_phydev->interface = PHY_INTERFACE_MODE_RGMII;
+ } else if (!phy_interface_is_rgmii(ext_phydev)) {
+ printf("Incorrect external interface type\n");
+ return -EINVAL;
+ }
+
ext_phydev->node = phandle.node;
phydev->priv = ext_phydev;