From df98acc6a1252456608958fc17f7da3ae4cfb46c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 21 May 2016 22:16:56 +0200 Subject: mvebu: backport upstream ethernet driver improvements and enable buffer manager support Signed-off-by: Felix Fietkau --- .../030-mvneta-consolidate-autoneg-enabling.patch | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch (limited to 'target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch') diff --git a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch new file mode 100644 index 0000000000..1d98c7decc --- /dev/null +++ b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch @@ -0,0 +1,55 @@ +From: Stas Sergeev +Date: Wed, 2 Dec 2015 20:33:56 +0300 +Subject: [PATCH] mvneta: consolidate autoneg enabling + +This moves autoneg-related bit manipulations to the single place. + +CC: Thomas Petazzoni +CC: netdev@vger.kernel.org +CC: linux-kernel@vger.kernel.org + +Signed-off-by: Stas Sergeev +Signed-off-by: David S. Miller +--- + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -1067,15 +1067,28 @@ static void mvneta_defaults_set(struct m + MVNETA_GMAC_AN_SPEED_EN | + MVNETA_GMAC_AN_DUPLEX_EN; + mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); ++ + val = mvreg_read(pp, MVNETA_GMAC_CLOCK_DIVIDER); + val |= MVNETA_GMAC_1MS_CLOCK_ENABLE; + mvreg_write(pp, MVNETA_GMAC_CLOCK_DIVIDER, val); ++ ++ val = mvreg_read(pp, MVNETA_GMAC_CTRL_2); ++ val |= MVNETA_GMAC2_INBAND_AN_ENABLE; ++ mvreg_write(pp, MVNETA_GMAC_CTRL_2, val); + } else { + val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG); + val &= ~(MVNETA_GMAC_INBAND_AN_ENABLE | + MVNETA_GMAC_AN_SPEED_EN | + MVNETA_GMAC_AN_DUPLEX_EN); + mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); ++ ++ val = mvreg_read(pp, MVNETA_GMAC_CLOCK_DIVIDER); ++ val &= ~MVNETA_GMAC_1MS_CLOCK_ENABLE; ++ mvreg_write(pp, MVNETA_GMAC_CLOCK_DIVIDER, val); ++ ++ val = mvreg_read(pp, MVNETA_GMAC_CTRL_2); ++ val &= ~MVNETA_GMAC2_INBAND_AN_ENABLE; ++ mvreg_write(pp, MVNETA_GMAC_CTRL_2, val); + } + + mvneta_set_ucast_table(pp, -1); +@@ -3230,9 +3243,6 @@ static int mvneta_port_power_up(struct m + return -EINVAL; + } + +- if (pp->use_inband_status) +- ctrl |= MVNETA_GMAC2_INBAND_AN_ENABLE; +- + /* Cancel Port Reset */ + ctrl &= ~MVNETA_GMAC2_PORT_RESET; + mvreg_write(pp, MVNETA_GMAC_CTRL_2, ctrl); -- cgit v1.2.3