From 9d1ac8192ca683263ae66769690e76836f31e1c8 Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Wed, 8 Apr 2020 12:59:43 +0800 Subject: [PATCH] ramips: mt7530 disable eee This disable eee for mt7530 on LINUX_5_4 Signed-off-by: Chen Minqiang --- ...-net-dsa-mt7530-disable-eee-on-ports.patch | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 target/linux/ramips/patches-5.4/961-net-dsa-mt7530-disable-eee-on-ports.patch diff --git a/target/linux/ramips/patches-5.4/961-net-dsa-mt7530-disable-eee-on-ports.patch b/target/linux/ramips/patches-5.4/961-net-dsa-mt7530-disable-eee-on-ports.patch new file mode 100644 index 0000000000..8bc584db2a --- /dev/null +++ b/target/linux/ramips/patches-5.4/961-net-dsa-mt7530-disable-eee-on-ports.patch @@ -0,0 +1,52 @@ +From ab04c52c3040de2bb7eda69fd70d098386df9f41 Mon Sep 17 00:00:00 2001 +From: Chen Minqiang +Date: Wed, 8 Apr 2020 10:39:39 +0800 +Subject: [PATCH] net/dsa/mt7530: disable eee on ports + +Signed-off-by: Chen Minqiang +--- + drivers/net/dsa/mt7530.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c +index 7cbd1bd4c5a6..cc6b4c1f50fb 100644 +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -1237,6 +1237,22 @@ mtk_get_tag_protocol(struct dsa_switch *ds, int port, + } + } + ++static void ++mt7530_port_disable_eee(struct dsa_switch *ds, int i) ++{ ++ /* Disable EEE */ ++ mt7530_phy_write(ds, i, 13, 0x7); ++ mt7530_phy_write(ds, i, 14, 0x3c); ++ mt7530_phy_write(ds, i, 13, 0x4007); ++ mt7530_phy_write(ds, i, 14, 0x0); ++ ++ /* Disable EEE 10Base-Te */ ++ mt7530_phy_write(ds, i, 13, 0x1f); ++ mt7530_phy_write(ds, i, 14, 0x027b); ++ mt7530_phy_write(ds, i, 13, 0x401f); ++ mt7530_phy_write(ds, i, 14, 0x1177); ++} ++ + static int + mt7530_setup(struct dsa_switch *ds) + { +@@ -1373,6 +1389,11 @@ mt7530_setup(struct dsa_switch *ds) + + mt7530_setup_port5(ds, interface); + ++ /* Disable eee on ports */ ++ for (i = 0; i < 5; i++) { ++ mt7530_port_disable_eee(ds, i); ++ } ++ + /* Flush the FDB table */ + ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL); + if (ret < 0) +-- +2.17.1 +