ath79: ag71xx: fix speed applied to MII0/1_CTRL on ar71xx/ar913x
authorChuanhong Guo <gch981213@gmail.com>
Sun, 12 Aug 2018 04:57:52 +0000 (12:57 +0800)
committerMathias Kresin <dev@kresin.me>
Mon, 13 Aug 2018 06:37:19 +0000 (08:37 +0200)
Currently speed value is applied to interface mode field.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c

index 4f1c75fbff3c24bb407fb7a07f32235cdf5c9d90..1e0bb6937f1bccac658c298daaca1ad97b8f28e5 100644 (file)
@@ -552,8 +552,8 @@ static void ath79_mii_ctrl_set_speed(struct ag71xx *ag)
        }
 
        t = __raw_readl(ag->mii_base);
-       t &= ~(AR71XX_MII_CTRL_IF_MASK);
-       t |= (mii_speed & AR71XX_MII_CTRL_IF_MASK);
+       t &= ~(AR71XX_MII_CTRL_SPEED_MASK << AR71XX_MII_CTRL_SPEED_SHIFT);
+       t |= mii_speed << AR71XX_MII_CTRL_SPEED_SHIFT;
        __raw_writel(t, ag->mii_base);
 }