]> git.baikalelectronics.ru Git - uboot.git/commitdiff
net: mvneta: Write PHY address just before enabling HW polling
authorMarek Behún <marek.behun@nic.cz>
Wed, 27 Apr 2022 10:41:59 +0000 (12:41 +0200)
committerStefan Roese <sr@denx.de>
Wed, 4 May 2022 05:05:51 +0000 (07:05 +0200)
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>
drivers/net/mvneta.c

index 5b1c4fe5fcf955d9d05e556e14ba45f8356ecbd0..4917857681f802020227d3c3e854b239768ca73b 100644 (file)
@@ -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);