netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com
Subject: [PATCH 43/52] sfc: Remove workaround for old firmware bug
Date: Mon, 1 Sep 2008 12:49:20 +0100	[thread overview]
Message-ID: <20080901114919.GJ7908@solarflare.com> (raw)
In-Reply-To: <20080901111621.GT7908@solarflare.com>

There was a bug in XAUI synchronisation in early 10Xpress firmware
versions.  This is fixed in released firmware and we do not need to
work around it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c         |    1 -
 drivers/net/sfc/falcon_xmac.c |   88 +----------------------------------------
 drivers/net/sfc/net_driver.h  |    2 -
 drivers/net/sfc/sfe4001.c     |   12 ------
 drivers/net/sfc/tenxpress.c   |   51 -----------------------
 drivers/net/sfc/workarounds.h |    2 -
 drivers/net/sfc/xfp_phy.c     |    1 -
 7 files changed, 1 insertions(+), 156 deletions(-)

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index c295ea6..ef72413 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1750,7 +1750,6 @@ static struct efx_phy_operations efx_dummy_phy_operations = {
 	.check_hw        = efx_port_dummy_op_int,
 	.fini		 = efx_port_dummy_op_void,
 	.clear_interrupt = efx_port_dummy_op_void,
-	.reset_xaui      = efx_port_dummy_op_void,
 };
 
 static struct efx_board efx_dummy_board_info = {
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c
index 0d9f68f..d401231 100644
--- a/drivers/net/sfc/falcon_xmac.c
+++ b/drivers/net/sfc/falcon_xmac.c
@@ -78,79 +78,7 @@ static void falcon_setup_xaui(struct efx_nic *efx)
 	falcon_write(efx, &txdrv, XX_TXDRV_CTL_REG);
 }
 
-static void falcon_hold_xaui_in_rst(struct efx_nic *efx)
-{
-	efx_oword_t reg;
-
-	EFX_ZERO_OWORD(reg);
-	EFX_SET_OWORD_FIELD(reg, XX_PWRDNA_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_PWRDNB_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_PWRDNC_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_PWRDND_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_RSTPLLAB_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_RSTPLLCD_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_RESETA_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_RESETB_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_RESETC_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_RESETD_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_RSTXGXSRX_EN, 1);
-	EFX_SET_OWORD_FIELD(reg, XX_RSTXGXSTX_EN, 1);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
-}
-
-static int _falcon_reset_xaui_a(struct efx_nic *efx)
-{
-	efx_oword_t reg;
-
-	falcon_hold_xaui_in_rst(efx);
-	falcon_read(efx, &reg, XX_PWR_RST_REG);
-
-	/* Follow the RAMBUS XAUI data reset sequencing
-	 * Channels A and B first: power down, reset PLL, reset, clear
-	 */
-	EFX_SET_OWORD_FIELD(reg, XX_PWRDNA_EN, 0);
-	EFX_SET_OWORD_FIELD(reg, XX_PWRDNB_EN, 0);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
-
-	EFX_SET_OWORD_FIELD(reg, XX_RSTPLLAB_EN, 0);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
-
-	EFX_SET_OWORD_FIELD(reg, XX_RESETA_EN, 0);
-	EFX_SET_OWORD_FIELD(reg, XX_RESETB_EN, 0);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
-
-	/* Channels C and D: power down, reset PLL, reset, clear */
-	EFX_SET_OWORD_FIELD(reg, XX_PWRDNC_EN, 0);
-	EFX_SET_OWORD_FIELD(reg, XX_PWRDND_EN, 0);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
-
-	EFX_SET_OWORD_FIELD(reg, XX_RSTPLLCD_EN, 0);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
-
-	EFX_SET_OWORD_FIELD(reg, XX_RESETC_EN, 0);
-	EFX_SET_OWORD_FIELD(reg, XX_RESETD_EN, 0);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
-
-	/* Setup XAUI */
-	falcon_setup_xaui(efx);
-	udelay(10);
-
-	/* Take XGXS out of reset */
-	EFX_ZERO_OWORD(reg);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
-
-	return 0;
-}
-
-static int _falcon_reset_xaui_b(struct efx_nic *efx)
+int falcon_reset_xaui(struct efx_nic *efx)
 {
 	efx_oword_t reg;
 	int count;
@@ -171,20 +99,6 @@ static int _falcon_reset_xaui_b(struct efx_nic *efx)
 	return -ETIMEDOUT;
 }
 
-int falcon_reset_xaui(struct efx_nic *efx)
-{
-	int rc;
-
-	if (EFX_WORKAROUND_9388(efx)) {
-		falcon_hold_xaui_in_rst(efx);
-		efx->phy_op->reset_xaui(efx);
-		rc = _falcon_reset_xaui_a(efx);
-	} else {
-		rc = _falcon_reset_xaui_b(efx);
-	}
-	return rc;
-}
-
 static bool falcon_xgmii_status(struct efx_nic *efx)
 {
 	efx_oword_t reg;
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 567df00..be3d2ba 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -503,7 +503,6 @@ enum efx_fc_type {
  * @clear_interrupt: Clear down interrupt
  * @blink: Blink LEDs
  * @check_hw: Check hardware
- * @reset_xaui: Reset XAUI side of PHY for (software sequenced reset)
  * @mmds: MMD presence mask
  * @loopbacks: Supported loopback modes mask
  */
@@ -513,7 +512,6 @@ struct efx_phy_operations {
 	void (*reconfigure) (struct efx_nic *efx);
 	void (*clear_interrupt) (struct efx_nic *efx);
 	int (*check_hw) (struct efx_nic *efx);
-	void (*reset_xaui) (struct efx_nic *efx);
 	int (*test) (struct efx_nic *efx);
 	int mmds;
 	unsigned loopbacks;
diff --git a/drivers/net/sfc/sfe4001.c b/drivers/net/sfc/sfe4001.c
index b7005da..fe4e3fd 100644
--- a/drivers/net/sfc/sfe4001.c
+++ b/drivers/net/sfc/sfe4001.c
@@ -129,18 +129,6 @@ static int sfe4001_poweron(struct efx_nic *efx)
 	unsigned int i, j;
 	int rc;
 	u8 out;
-	efx_oword_t reg;
-
-	/* Ensure that XGXS and XAUI SerDes are held in reset */
-	EFX_POPULATE_OWORD_7(reg, XX_PWRDNA_EN, 1,
-			     XX_PWRDNB_EN, 1,
-			     XX_RSTPLLAB_EN, 1,
-			     XX_RESETA_EN, 1,
-			     XX_RESETB_EN, 1,
-			     XX_RSTXGXSRX_EN, 1,
-			     XX_RSTXGXSTX_EN, 1);
-	falcon_write(efx, &reg, XX_PWR_RST_REG);
-	udelay(10);
 
 	/* Clear any previous over-temperature alert */
 	rc = i2c_smbus_read_byte_data(hwmon_client, RSL);
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c
index 8412dbe..77e7f3a 100644
--- a/drivers/net/sfc/tenxpress.c
+++ b/drivers/net/sfc/tenxpress.c
@@ -146,8 +146,6 @@ static int tenxpress_phy_check(struct efx_nic *efx)
 	return 0;
 }
 
-static void tenxpress_reset_xaui(struct efx_nic *efx);
-
 static int tenxpress_init(struct efx_nic *efx)
 {
 	int rc, reg;
@@ -428,54 +426,6 @@ void tenxpress_phy_blink(struct efx_nic *efx, bool blink)
 			    PMA_PMD_LED_OVERR_REG, reg);
 }
 
-static void tenxpress_reset_xaui(struct efx_nic *efx)
-{
-	int phy = efx->mii.phy_id;
-	int clk_ctrl, test_select, soft_rst2;
-
-	/* Real work is done on clock_ctrl other resets are thought to be
-	 * optional but make the reset more reliable
-	 */
-
-	/* Read */
-	clk_ctrl = mdio_clause45_read(efx, phy, MDIO_MMD_PCS,
-				      PCS_CLOCK_CTRL_REG);
-	test_select = mdio_clause45_read(efx, phy, MDIO_MMD_PCS,
-					 PCS_TEST_SELECT_REG);
-	soft_rst2 = mdio_clause45_read(efx, phy, MDIO_MMD_PCS,
-				       PCS_SOFT_RST2_REG);
-
-	/* Put in reset */
-	test_select &= ~(1 << CLK312_EN_LBN);
-	mdio_clause45_write(efx, phy, MDIO_MMD_PCS,
-			    PCS_TEST_SELECT_REG, test_select);
-
-	soft_rst2 &= ~((1 << XGXS_RST_N_LBN) | (1 << SERDES_RST_N_LBN));
-	mdio_clause45_write(efx, phy, MDIO_MMD_PCS,
-			    PCS_SOFT_RST2_REG, soft_rst2);
-
-	clk_ctrl &= ~(1 << PLL312_RST_N_LBN);
-	mdio_clause45_write(efx, phy, MDIO_MMD_PCS,
-			    PCS_CLOCK_CTRL_REG, clk_ctrl);
-	udelay(10);
-
-	/* Remove reset */
-	clk_ctrl |= (1 << PLL312_RST_N_LBN);
-	mdio_clause45_write(efx, phy, MDIO_MMD_PCS,
-			    PCS_CLOCK_CTRL_REG, clk_ctrl);
-	udelay(10);
-
-	soft_rst2 |= ((1 << XGXS_RST_N_LBN) | (1 << SERDES_RST_N_LBN));
-	mdio_clause45_write(efx, phy, MDIO_MMD_PCS,
-			    PCS_SOFT_RST2_REG, soft_rst2);
-	udelay(10);
-
-	test_select |= (1 << CLK312_EN_LBN);
-	mdio_clause45_write(efx, phy, MDIO_MMD_PCS,
-			    PCS_TEST_SELECT_REG, test_select);
-	udelay(10);
-}
-
 static int tenxpress_phy_test(struct efx_nic *efx)
 {
 	/* BIST is automatically run after a special software reset */
@@ -488,7 +438,6 @@ struct efx_phy_operations falcon_tenxpress_phy_ops = {
 	.check_hw         = tenxpress_phy_check_hw,
 	.fini             = tenxpress_phy_fini,
 	.clear_interrupt  = tenxpress_phy_clear_interrupt,
-	.reset_xaui       = tenxpress_reset_xaui,
 	.test             = tenxpress_phy_test,
 	.mmds             = TENXPRESS_REQUIRED_DEVS,
 	.loopbacks        = TENXPRESS_LOOPBACKS,
diff --git a/drivers/net/sfc/workarounds.h b/drivers/net/sfc/workarounds.h
index a824f59..fa7b49d 100644
--- a/drivers/net/sfc/workarounds.h
+++ b/drivers/net/sfc/workarounds.h
@@ -24,8 +24,6 @@
 #define EFX_WORKAROUND_7575 EFX_WORKAROUND_ALWAYS
 /* TX pkt parser problem with <= 16 byte TXes */
 #define EFX_WORKAROUND_9141 EFX_WORKAROUND_ALWAYS
-/* XGXS and XAUI reset sequencing in SW */
-#define EFX_WORKAROUND_9388 EFX_WORKAROUND_ALWAYS
 /* Low rate CRC errors require XAUI reset */
 #define EFX_WORKAROUND_10750 EFX_WORKAROUND_ALWAYS
 /* TX_EV_PKT_ERR can be caused by a dangling TX descriptor
diff --git a/drivers/net/sfc/xfp_phy.c b/drivers/net/sfc/xfp_phy.c
index f6edecc..276151d 100644
--- a/drivers/net/sfc/xfp_phy.c
+++ b/drivers/net/sfc/xfp_phy.c
@@ -165,7 +165,6 @@ struct efx_phy_operations falcon_xfp_phy_ops = {
 	.check_hw        = xfp_phy_check_hw,
 	.fini            = xfp_phy_fini,
 	.clear_interrupt = xfp_phy_clear_interrupt,
-	.reset_xaui      = efx_port_dummy_op_void,
 	.mmds            = XFP_REQUIRED_DEVS,
 	.loopbacks       = XFP_LOOPBACKS,
 };
-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  parent reply	other threads:[~2008-09-01 11:49 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01 11:16 [PATCH 00/52] sfc: Changes for 2.6.28 Ben Hutchings
2008-09-01 11:43 ` [PATCH 01/52] sfc: Replace net_dev->priv with netdev_priv(net_dev) Ben Hutchings
2008-09-01 11:43 ` [PATCH 02/52] sfc: Change first parameter type of {set,clear}_bit_le() to unsigned Ben Hutchings
2008-09-01 11:44 ` [PATCH 03/52] sfc: Remove unused field efx_channel::reset_work Ben Hutchings
2008-09-01 11:44 ` [PATCH 04/52] sfc: Use separate hardware TX queues to select checksum generation Ben Hutchings
2008-09-01 11:45 ` [PATCH 05/52] sfc: Avoid mangling error codes in efx_test_loopback() Ben Hutchings
2008-09-01 11:45 ` [PATCH 06/52] sfc: Reduce delays in SFE4001 initialisation Ben Hutchings
2008-09-01 11:46 ` [PATCH 07/52] sfc: Remove mistaken hardware workaround Ben Hutchings
2008-09-01 11:46 ` [PATCH 08/52] sfc: XMAC statistics fix-ups Ben Hutchings
2008-09-01 11:46 ` [PATCH 09/52] sfc: Remove inclusion of workarounds.h from efx.c Ben Hutchings
2008-09-01 11:46 ` [PATCH 10/52] sfc: Reverse the XOFF/XON pause frame control fifo thresholds Ben Hutchings
2008-09-01 11:46 ` [PATCH 11/52] sfc: Reduce log level for XGXS lane status Ben Hutchings
2008-09-01 11:46 ` [PATCH 12/52] sfc: Self-test reporting cleanup Ben Hutchings
2008-09-01 11:46 ` [PATCH 13/52] sfc: Speed up loopback self-test Ben Hutchings
2008-09-01 11:46 ` [PATCH 14/52] sfc: Don't leak PCI DMA maps in the TSO code when the queue fills up Ben Hutchings
2008-09-01 11:46 ` [PATCH 15/52] sfc: Use pci_map_single() to map the skb header when doing TSO Ben Hutchings
2008-09-01 11:46 ` [PATCH 16/52] sfc: Reduce the size of struct efx_tx_buffer Ben Hutchings
2008-09-01 11:46 ` [PATCH 17/52] sfc: Use explicit bool for boolean variables, parameters and return values Ben Hutchings
2008-09-01 11:46 ` [PATCH 18/52] sfc: Set net_device::vlan_features appropriately Ben Hutchings
2008-09-01 11:47 ` [PATCH 19/52] sfc: Cleaned up struct tso_state fields Ben Hutchings
2008-09-01 11:47 ` [PATCH 20/52] sfc: Removed forced inlining of long functions Ben Hutchings
2008-09-01 11:47 ` [PATCH 21/52] sfc: Export boot configuration in EEPROM through ethtool Ben Hutchings
2008-09-01 11:47 ` [PATCH 22/52] sfc: Move CPU counting for RSS into a separate function, efx_wanted_rx_queues() Ben Hutchings
2008-09-01 11:47 ` [PATCH 23/52] sfc: Remove efx_channel::has_interrupt Ben Hutchings
2008-09-01 11:47 ` [PATCH 24/52] sfc: Cleanup RX queue information Ben Hutchings
2008-09-01 11:47 ` [PATCH 25/52] sfc: Remove initialisation of RX_FILTER_CTL_REG.NUM_KER Ben Hutchings
2008-09-01 11:47 ` [PATCH 26/52] sfc: Make efx_for_each_channel_rx_queue() more efficient Ben Hutchings
2008-09-01 11:48 ` [PATCH 27/52] sfc: Remove efx_channel::evqnum field Ben Hutchings
2008-09-01 11:48 ` [PATCH 28/52] sfc: Cleanup RX event processing Ben Hutchings
2008-09-01 11:48 ` [PATCH 29/52] sfc: Implement get_sset_count, replacing get_stats_count and self_test_count Ben Hutchings
2008-09-01 11:48 ` [PATCH 30/52] sfc: Make PHY flash mode a device attribute, not a module parameter Ben Hutchings
2008-09-01 11:48 ` [PATCH 31/52] sfc: Do not call netif_{stop,wake}_queue() before register_netdev Ben Hutchings
2008-09-01 11:48 ` [PATCH 32/52] sfc: Enable TSO for 802.1q VLAN devices Ben Hutchings
2008-09-01 11:48 ` [PATCH 33/52] sfc: Remove efx_nic_dummy_op_int() as redundant with efx_port_dummy_op_int() Ben Hutchings
2008-09-01 11:48 ` [PATCH 34/52] sfc: Remove remnants of multi-port abstraction for MAC registers Ben Hutchings
2008-09-01 11:48 ` [PATCH 35/52] sfc: Remove some unreachable error paths Ben Hutchings
2008-09-01 11:48 ` [PATCH 36/52] sfc: Cleanup reset code Ben Hutchings
2008-09-01 11:48 ` [PATCH 37/52] sfc: Rework the bitfield header so that we can identify fields by bit number Ben Hutchings
2008-09-01 11:49 ` [PATCH 38/52] sfc: Extend self-tests Ben Hutchings
2008-09-01 11:49 ` [PATCH 39/52] sfc: Remove the STATE_RESETTING flag Ben Hutchings
2008-09-01 11:49 ` [PATCH 40/52] sfc: Rework efx_set_multicast_hash() Ben Hutchings
2008-09-03 13:54   ` Jeff Garzik
2008-09-01 11:49 ` [PATCH 42/52] sfc: Fix memory BAR release call on error path Ben Hutchings
2008-09-01 11:49 ` Ben Hutchings [this message]
2008-09-01 11:49 ` [PATCH 44/52] sfc: Serialise tenxpress_special_reset() with statistics fetches Ben Hutchings
2008-09-01 11:49 ` [PATCH 45/52] sfc: Don't use EFX_OWORD_FIELD on an event (64-bit, quad-word) Ben Hutchings
2008-09-01 11:49 ` [PATCH 46/52] sfc: Make queue flushes more reliable Ben Hutchings
2008-09-01 11:49 ` [PATCH 47/52] sfc: Don't include net_driver.h from falcon_io.h Ben Hutchings
2008-09-01 11:50 ` [PATCH 48/52] sfc: Stop generating bogus events in tenxpress_check_hw() Ben Hutchings
2008-09-01 11:50 ` [PATCH 49/52] sfc: Insert read memory barrier after checking MAC statistics flag Ben Hutchings
2008-09-01 11:50 ` [PATCH 50/52] sfc: Disable interrupts after a fatal interrupt occurs until reset Ben Hutchings
2008-09-01 11:50 ` [PATCH 51/52] sfc: Remove obsolete comment about PCI modes Ben Hutchings
2008-09-01 11:50 ` [PATCH 52/52] sfc: Use CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS where appropriate Ben Hutchings
2008-09-03 14:07 ` [PATCH 41/52] sfc: Add check for memory allocation failure in falcon_probe_nic() Ben Hutchings
2008-09-13 19:29   ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080901114919.GJ7908@solarflare.com \
    --to=bhutchings@solarflare.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).