aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2022-04-27 12:41:59 +0200
committerStefan Roese <sr@denx.de>2022-05-04 07:05:51 +0200
commite06c7f34d2944a66ad0a8486f112ade610512f74 (patch)
tree30226585382a06645f176d6b8112cd178da8b6fa
parent77fcf3cf12516dad3df8c19a51d1cf06e1a4bda3 (diff)
downloadu-boot-e06c7f34d2944a66ad0a8486f112ade610512f74.zip
u-boot-e06c7f34d2944a66ad0a8486f112ade610512f74.tar.gz
u-boot-e06c7f34d2944a66ad0a8486f112ade610512f74.tar.bz2
net: mvneta: Write PHY address just before enabling HW polling
Write PHY address just before enabling HW polling of the PHY. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
-rw-r--r--drivers/net/mvneta.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 5b1c4fe..4917857 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -814,6 +814,8 @@ static void mvneta_defaults_set(struct mvneta_port *pp)
/* Enable PHY polling in hardware if not in fixed-link mode */
if (!pp->fixed_link) {
+ mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr);
+
val = mvreg_read(pp, MVNETA_UNIT_CONTROL);
val |= MVNETA_PHY_POLLING_ENABLE;
mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
@@ -1431,10 +1433,6 @@ static int mvneta_start(struct udevice *dev)
pp->fixed_link = phydev->phy_id == PHY_FIXED_ID;
- /* Set PHY address in case we will enable HW polling */
- if (!pp->fixed_link)
- mvreg_write(pp, MVNETA_PHY_ADDR, phydev->addr);
-
pp->phydev = phydev;
phy_config(phydev);
phy_startup(phydev);