aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-04-13 05:15:33 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-13 23:13:13 -0400
commitcc6ca3023f2c2bbcd062e9d4cf6afc2ba2821ada (patch)
treeaf3ab2bd55cc76e021f2389567cb3b1302d409ca /drivers/net
parentbefdf8978accecac2e0739e6b5075afc62db37fe (diff)
Revert "net: mvneta: fix usage as a module on RGMII configurations"
This reverts commit e3a8786c10e75903f1269474e21fe8cb49c3a670. While this commit allows to use the mvneta driver as a module on some configurations, it breaks other configurations even if mvneta is used built-in. This breakage is due to the fact that on some RGMII platforms, the PCS bit has to be set, and on some other platforms, it has to be cleared. At the moment, we lack informations to know exactly the significance of this bit (the datasheet only says "enables PCS"), and so we can't produce a patch that will work on all platforms at this point. And since this change is breaking the network completely for many users, it's much better to revert it for now. We'll come back later with a proper fix that takes into account all platforms. Basically: * Armada XP GP is configured as RGMII-ID, and needs the PCS bit to be set. * Armada 370 Mirabox is configured as RGMII-ID, and needs the PCS bit to be cleared. And at the moment, we don't know how to make the distinction between those two cases. One hint is that the Armada XP GP appears in fact to be using a QSGMII connection with the PHY (Quad-SGMII), but configuring it as SGMII doesn't work, while RGMII-ID works. This needs more investigation, but in the mean time, let's unbreak the network for all those users. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reported-by: Arnaud Ebalard <arno@natisbad.org> Reported-by: Alexander Reuter <Alexander.Reuter@gmx.net> Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=73401 Cc: stable@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c41
1 files changed, 33 insertions, 8 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index d04b1c3c9b85..b248bcbdae63 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -89,9 +89,8 @@
89#define MVNETA_TX_IN_PRGRS BIT(1) 89#define MVNETA_TX_IN_PRGRS BIT(1)
90#define MVNETA_TX_FIFO_EMPTY BIT(8) 90#define MVNETA_TX_FIFO_EMPTY BIT(8)
91#define MVNETA_RX_MIN_FRAME_SIZE 0x247c 91#define MVNETA_RX_MIN_FRAME_SIZE 0x247c
92#define MVNETA_SERDES_CFG 0x24A0 92#define MVNETA_SGMII_SERDES_CFG 0x24A0
93#define MVNETA_SGMII_SERDES_PROTO 0x0cc7 93#define MVNETA_SGMII_SERDES_PROTO 0x0cc7
94#define MVNETA_RGMII_SERDES_PROTO 0x0667
95#define MVNETA_TYPE_PRIO 0x24bc 94#define MVNETA_TYPE_PRIO 0x24bc
96#define MVNETA_FORCE_UNI BIT(21) 95#define MVNETA_FORCE_UNI BIT(21)
97#define MVNETA_TXQ_CMD_1 0x24e4 96#define MVNETA_TXQ_CMD_1 0x24e4
@@ -712,6 +711,35 @@ static void mvneta_rxq_bm_disable(struct mvneta_port *pp,
712 mvreg_write(pp, MVNETA_RXQ_CONFIG_REG(rxq->id), val); 711 mvreg_write(pp, MVNETA_RXQ_CONFIG_REG(rxq->id), val);
713} 712}
714 713
714
715
716/* Sets the RGMII Enable bit (RGMIIEn) in port MAC control register */
717static void mvneta_gmac_rgmii_set(struct mvneta_port *pp, int enable)
718{
719 u32 val;
720
721 val = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
722
723 if (enable)
724 val |= MVNETA_GMAC2_PORT_RGMII;
725 else
726 val &= ~MVNETA_GMAC2_PORT_RGMII;
727
728 mvreg_write(pp, MVNETA_GMAC_CTRL_2, val);
729}
730
731/* Config SGMII port */
732static void mvneta_port_sgmii_config(struct mvneta_port *pp)
733{
734 u32 val;
735
736 val = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
737 val |= MVNETA_GMAC2_PCS_ENABLE;
738 mvreg_write(pp, MVNETA_GMAC_CTRL_2, val);
739
740 mvreg_write(pp, MVNETA_SGMII_SERDES_CFG, MVNETA_SGMII_SERDES_PROTO);
741}
742
715/* Start the Ethernet port RX and TX activity */ 743/* Start the Ethernet port RX and TX activity */
716static void mvneta_port_up(struct mvneta_port *pp) 744static void mvneta_port_up(struct mvneta_port *pp)
717{ 745{
@@ -2729,15 +2757,12 @@ static void mvneta_port_power_up(struct mvneta_port *pp, int phy_mode)
2729 mvreg_write(pp, MVNETA_UNIT_INTR_CAUSE, 0); 2757 mvreg_write(pp, MVNETA_UNIT_INTR_CAUSE, 0);
2730 2758
2731 if (phy_mode == PHY_INTERFACE_MODE_SGMII) 2759 if (phy_mode == PHY_INTERFACE_MODE_SGMII)
2732 mvreg_write(pp, MVNETA_SERDES_CFG, MVNETA_SGMII_SERDES_PROTO); 2760 mvneta_port_sgmii_config(pp);
2733 else
2734 mvreg_write(pp, MVNETA_SERDES_CFG, MVNETA_RGMII_SERDES_PROTO);
2735 2761
2736 val = mvreg_read(pp, MVNETA_GMAC_CTRL_2); 2762 mvneta_gmac_rgmii_set(pp, 1);
2737
2738 val |= MVNETA_GMAC2_PCS_ENABLE | MVNETA_GMAC2_PORT_RGMII;
2739 2763
2740 /* Cancel Port Reset */ 2764 /* Cancel Port Reset */
2765 val = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
2741 val &= ~MVNETA_GMAC2_PORT_RESET; 2766 val &= ~MVNETA_GMAC2_PORT_RESET;
2742 mvreg_write(pp, MVNETA_GMAC_CTRL_2, val); 2767 mvreg_write(pp, MVNETA_GMAC_CTRL_2, val);
2743 2768