Skip to contentSkip to conversation

sfc: Falcon board/PHY support

PATCH In review Ben Hutchings 2 participants 4 messages Sep 22, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover sfc: Falcon board/PHY support

These patches update the board and PHY code to support precisely the boards that are actually in use.

Ben.

Ben Hutchings (2):
sfc: Remove support for SFN4111T, SFT9001 and Falcon GMAC
sfc: Add support for SFE4003 board and TXC43128 PHY

 drivers/net/sfc/Makefile        |    5 +-
 drivers/net/sfc/falcon.c        |  120 ++-------
 drivers/net/sfc/falcon_boards.c |  203 ++++++---------
 drivers/net/sfc/falcon_gmac.c   |  230 ----------------
 drivers/net/sfc/mac.h           |    1 -
 drivers/net/sfc/mdio_10g.c      |   30 +--
 drivers/net/sfc/net_driver.h    |    2 -
 drivers/net/sfc/phy.h           |   18 +-
 drivers/net/sfc/tenxpress.c     |  424 ++---------------------------
 drivers/net/sfc/txc43128_phy.c  |  560 +++++++++++++++++++++++++++++++++++++++
 drivers/net/sfc/workarounds.h   |    9 +-
 11 files changed, 710 insertions(+), 892 deletions(-)
 delete mode 100644 drivers/net/sfc/falcon_gmac.c
 create mode 100644 drivers/net/sfc/txc43128_phy.c
Signature · 7 lines
1.7.2.1


-- 
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.
#1 lore raw

PATCH 1/2 sfc: Remove support for SFN4111T, SFT9001 and Falcon GMAC

SFN4111T never reached production and is not being used for internal or customer testing.

Since we have no production Falcon boards using the SFT9001 or the GMAC, remove support for them as well.

---
 drivers/net/sfc/Makefile        |    2 +-
 drivers/net/sfc/falcon.c        |  117 ++---------
 drivers/net/sfc/falcon_boards.c |  127 +-----------
 drivers/net/sfc/falcon_gmac.c   |  230 ---------------------
 drivers/net/sfc/mac.h           |    1 -
 drivers/net/sfc/mdio_10g.c      |   30 +---
 drivers/net/sfc/net_driver.h    |    2 -
 drivers/net/sfc/phy.h           |    7 +-
 drivers/net/sfc/tenxpress.c     |  424 +++------------------------------------
 drivers/net/sfc/workarounds.h   |    9 +-
 10 files changed, 56 insertions(+), 893 deletions(-)
 delete mode 100644 drivers/net/sfc/falcon_gmac.c
drivers/net/sfc/Makefile +1 -1
index fd9272b..39f7c1b 100644
@@ -1,5 +1,5 @@
 sfc-y			+= efx.o nic.o falcon.o siena.o tx.o rx.o filter.o \
-			   falcon_gmac.o falcon_xmac.o mcdi_mac.o \
+			   falcon_xmac.o mcdi_mac.o \
 			   selftest.o ethtool.o qt202x_phy.o mdio_10g.o \
 			   tenxpress.o falcon_boards.o mcdi.o mcdi_phy.o
 sfc-$(CONFIG_SFC_MTD)	+= mtd.o
drivers/net/sfc/falcon.c +18 -99

187 lines not on this page · raw message

drivers/net/sfc/falcon_boards.c +4 -123

171 lines not on this page · raw message

drivers/net/sfc/falcon_gmac.c deleted +0 -230

230 lines not on this page · raw message

drivers/net/sfc/mac.h +0 -1
index f1aa5f3..7a6e5ca 100644
@@ -13,7 +13,6 @@
 
 #include "net_driver.h"
 
-extern struct efx_mac_operations falcon_gmac_operations;
 extern struct efx_mac_operations falcon_xmac_operations;
 extern struct efx_mac_operations efx_mcdi_mac_operations;
 extern void falcon_reconfigure_xmac_core(struct efx_nic *efx);
drivers/net/sfc/mdio_10g.c +4 -26
index eeaf0bd..98d9460 100644
@@ -286,46 +286,24 @@ int efx_mdio_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
  */
 void efx_mdio_an_reconfigure(struct efx_nic *efx)
 {
-	bool xnp = (efx->link_advertising & ADVERTISED_10000baseT_Full
-		    || EFX_WORKAROUND_13204(efx));
 	int reg;
 
 	WARN_ON(!(efx->mdio.mmds & MDIO_DEVS_AN));
 
 	/* Set up the base page */
-	reg = ADVERTISE_CSMA;
-	if (efx->link_advertising & ADVERTISED_10baseT_Half)
-		reg |= ADVERTISE_10HALF;
-	if (efx->link_advertising & ADVERTISED_10baseT_Full)
-		reg |= ADVERTISE_10FULL;
-	if (efx->link_advertising & ADVERTISED_100baseT_Half)
-		reg |= ADVERTISE_100HALF;
-	if (efx->link_advertising & ADVERTISED_100baseT_Full)
-		reg |= ADVERTISE_100FULL;
-	if (xnp)
-		reg |= ADVERTISE_RESV;
-	else if (efx->link_advertising & (ADVERTISED_1000baseT_Half |
-					  ADVERTISED_1000baseT_Full))
-		reg |= ADVERTISE_NPAGE;
+	reg = ADVERTISE_CSMA | ADVERTISE_RESV;
 	if (efx->link_advertising & ADVERTISED_Pause)
 		reg |= ADVERTISE_PAUSE_CAP;
 	if (efx->link_advertising & ADVERTISED_Asym_Pause)
 		reg |= ADVERTISE_PAUSE_ASYM;
 	efx_mdio_write(efx, MDIO_MMD_AN, MDIO_AN_ADVERTISE, reg);
 
-	/* Set up the (extended) next page if necessary */
-	if (efx->phy_op->set_npage_adv)
-		efx->phy_op->set_npage_adv(efx, efx->link_advertising);
+	/* Set up the (extended) next page */
+	efx->phy_op->set_npage_adv(efx, efx->link_advertising);
 
 	/* Enable and restart AN */
 	reg = efx_mdio_read(efx, MDIO_MMD_AN, MDIO_CTRL1);
-	reg |= MDIO_AN_CTRL1_ENABLE;
-	if (!(EFX_WORKAROUND_15195(efx) && LOOPBACK_EXTERNAL(efx)))
-		reg |= MDIO_AN_CTRL1_RESTART;
-	if (xnp)
-		reg |= MDIO_AN_CTRL1_XNP;
-	else
-		reg &= ~MDIO_AN_CTRL1_XNP;
+	reg |= MDIO_AN_CTRL1_ENABLE | MDIO_AN_CTRL1_RESTART | MDIO_AN_CTRL1_XNP;
 	efx_mdio_write(efx, MDIO_MMD_AN, MDIO_CTRL1, reg);
 }
 
drivers/net/sfc/net_driver.h +0 -2
index ea6691c..2497126 100644
@@ -405,8 +405,6 @@ enum efx_int_mode {
 };
 #define EFX_INT_MODE_USE_MSI(x) (((x)->interrupt_mode) <= EFX_INT_MODE_MSI)
 
-#define EFX_IS10G(efx) ((efx)->link_state.speed == 10000)
-
 enum nic_state {
 	STATE_INIT = 0,
 	STATE_RUNNING = 1,
drivers/net/sfc/phy.h +1 -6
index 5bc2613..7ab0757 100644
@@ -11,17 +11,12 @@
 #define EFX_PHY_H
 
 /****************************************************************************
- * 10Xpress (SFX7101 and SFT9001) PHYs
+ * 10Xpress (SFX7101) PHY
  */
 extern struct efx_phy_operations falcon_sfx7101_phy_ops;
-extern struct efx_phy_operations falcon_sft9001_phy_ops;
 
 extern void tenxpress_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
 
-/* Wait for the PHY to boot. Return 0 on success, -EINVAL if the PHY failed
- * to boot due to corrupt flash, or some other negative error code. */
-extern int sft9001_wait_boot(struct efx_nic *efx);
-
 /****************************************************************************
  * AMCC/Quake QT202x PHYs
  */
drivers/net/sfc/tenxpress.c +27 -397

562 lines not on this page · raw message

drivers/net/sfc/workarounds.h +1 -8
index 782e45a..e0d6308 100644
@@ -19,9 +19,7 @@
 #define EFX_WORKAROUND_FALCON_A(efx) (efx_nic_rev(efx) <= EFX_REV_FALCON_A1)
 #define EFX_WORKAROUND_FALCON_AB(efx) (efx_nic_rev(efx) <= EFX_REV_FALCON_B0)
 #define EFX_WORKAROUND_SIENA(efx) (efx_nic_rev(efx) == EFX_REV_SIENA_A0)
-#define EFX_WORKAROUND_10G(efx) EFX_IS10G(efx)
-#define EFX_WORKAROUND_SFT9001(efx) ((efx)->phy_type == PHY_TYPE_SFT9001A || \
-				     (efx)->phy_type == PHY_TYPE_SFT9001B)
+#define EFX_WORKAROUND_10G(efx) 1
 
 /* XAUI resets if link not detected */
 #define EFX_WORKAROUND_5147 EFX_WORKAROUND_ALWAYS
@@ -58,9 +56,4 @@
 /* Leak overlength packets rather than free */
 #define EFX_WORKAROUND_8071 EFX_WORKAROUND_FALCON_A
 
-/* Need to send XNP pages for 100BaseT */
-#define EFX_WORKAROUND_13204 EFX_WORKAROUND_SFT9001
-/* Don't restart AN in near-side loopback */
-#define EFX_WORKAROUND_15195 EFX_WORKAROUND_SFT9001
-
 #endif /* EFX_WORKAROUNDS_H */
Signature · 8 lines
1.7.2.1



-- 
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.
#2 lore raw

PATCH 2/2 sfc: Add support for SFE4003 board and TXC43128 PHY

In reply to Ben Hutchings

This board never went into production, but some engineering samples are in use.

---
 drivers/net/sfc/Makefile        |    3 +-
 drivers/net/sfc/falcon.c        |    3 +
 drivers/net/sfc/falcon_boards.c |   80 ++++++
 drivers/net/sfc/phy.h           |   11 +
 drivers/net/sfc/txc43128_phy.c  |  560 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 656 insertions(+), 1 deletions(-)
 create mode 100644 drivers/net/sfc/txc43128_phy.c
drivers/net/sfc/Makefile +2 -1
index 39f7c1b..ab31c71 100644
@@ -1,7 +1,8 @@
 sfc-y			+= efx.o nic.o falcon.o siena.o tx.o rx.o filter.o \
 			   falcon_xmac.o mcdi_mac.o \
 			   selftest.o ethtool.o qt202x_phy.o mdio_10g.o \
-			   tenxpress.o falcon_boards.o mcdi.o mcdi_phy.o
+			   tenxpress.o txc43128_phy.o falcon_boards.o \
+			   mcdi.o mcdi_phy.o
 sfc-$(CONFIG_SFC_MTD)	+= mtd.o
 
 obj-$(CONFIG_SFC)	+= sfc.o
drivers/net/sfc/falcon.c +3 -0
index 254a599..267019b 100644
@@ -831,6 +831,9 @@ static int falcon_probe_port(struct efx_nic *efx)
 	case PHY_TYPE_QT2025C:
 		efx->phy_op = &falcon_qt202x_phy_ops;
 		break;
+	case PHY_TYPE_TXC43128:
+		efx->phy_op = &falcon_txc_phy_ops;
+		break;
 	default:
 		netif_err(efx, probe, efx->net_dev, "Unknown PHY type %d\n",
 			  efx->phy_type);
drivers/net/sfc/falcon_boards.c +80 -0

98 lines not on this page · raw message

drivers/net/sfc/phy.h +11 -0
index 7ab0757..1dab609 100644
@@ -37,6 +37,17 @@ extern struct efx_phy_operations falcon_qt202x_phy_ops;
 extern void falcon_qt202x_set_led(struct efx_nic *p, int led, int state);
 
 /****************************************************************************
+* Transwitch CX4 retimer
+*/
+extern struct efx_phy_operations falcon_txc_phy_ops;
+
+#define TXC_GPIO_DIR_INPUT	0
+#define TXC_GPIO_DIR_OUTPUT	1
+
+extern void falcon_txc_set_gpio_dir(struct efx_nic *efx, int pin, int dir);
+extern void falcon_txc_set_gpio_val(struct efx_nic *efx, int pin, int val);
+
+/****************************************************************************
  * Siena managed PHYs
  */
 extern struct efx_phy_operations efx_mcdi_phy_ops;
drivers/net/sfc/txc43128_phy.c new file +560 -0

560 lines not on this page · raw message

Signature · 7 lines
1.7.2.1


-- 
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.
maintainer
#3 lore raw
In reply to Ben Hutchings

From: Ben Hutchings <[email protected]>
Date: Wed, 22 Sep 2010 20:58:21 +0100

Quoted 8 lines

These patches update the board and PHY code to support precisely the boards that are actually in use.

Ben.

Ben Hutchings (2):
sfc: Remove support for SFN4111T, SFT9001 and Falcon GMAC
sfc: Add support for SFE4003 board and TXC43128 PHY

Both applied, thanks Ben.