Skip to content

Commit

Permalink
ramips: net/mediatek disable eee
Browse files Browse the repository at this point in the history
This disable eee for mt7530 ports, it causes the link down/up
issue, which happens when connecting to 100Mbit switch

Fixes: FS#1449

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
  • Loading branch information
ptpt52 committed Mar 22, 2020
1 parent 854c9f9 commit eba13cd
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -186,6 +186,22 @@ static void mt7621_hw_init(struct mt7620_gsw *gsw, struct device_node *np)
mt7530_mdio_w32(gsw, 0x7a74, 0x44);
mt7530_mdio_w32(gsw, 0x7a7c, 0x44);

/* Disable EEE */
for (i = 0; i <= 4; i++) {
_mt7620_mii_write(gsw, i, 13, 0x7);
_mt7620_mii_write(gsw, i, 14, 0x3C);
_mt7620_mii_write(gsw, i, 13, 0x4007);
_mt7620_mii_write(gsw, i, 14, 0x0);
}

/* Disable EEE 10Base-Te */
for (i = 0; i <= 4; i++) {
_mt7620_mii_write(gsw, i, 13, 0x1f);
_mt7620_mii_write(gsw, i, 14, 0x027b);
_mt7620_mii_write(gsw, i, 13, 0x401f);
_mt7620_mii_write(gsw, i, 14, 0x1177);
}

/* turn on all PHYs */
for (i = 0; i <= 4; i++) {
val = _mt7620_mii_read(gsw, i, 0);
Expand Down

0 comments on commit eba13cd

Please sign in to comment.