netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ixgb: make sure jumbos stay enabled after reset
@ 2007-12-14 19:48 Auke Kok
  2007-12-14 19:48 ` [PATCH 2/2] ixgb: enable sun hardware support for broadcom phy Auke Kok
  2007-12-14 21:13 ` [PATCH 1/2] ixgb: make sure jumbos stay enabled after reset Jeff Garzik
  0 siblings, 2 replies; 6+ messages in thread
From: Auke Kok @ 2007-12-14 19:48 UTC (permalink / raw)
  To: jeff; +Cc: netdev, auke-jan.h.kok, jesse.brandeburg, matheos.worku

From: Matheos Worku <matheos.worku@sun.com>

Currently a device reset (ethtool -r ethX) would cause the
adapter to fall back to regular MTU sizes.

Signed-off-by: Matheos Worku <matheos.worku@sun.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---

 drivers/net/ixgb/ixgb_main.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 3021234..bf9085f 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -320,10 +320,22 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
 void
 ixgb_reset(struct ixgb_adapter *adapter)
 {
+	struct ixgb_hw *hw = &adapter->hw;
 
-	ixgb_adapter_stop(&adapter->hw);
-	if(!ixgb_init_hw(&adapter->hw))
+	ixgb_adapter_stop(hw);
+	if (!ixgb_init_hw(hw))
 		DPRINTK(PROBE, ERR, "ixgb_init_hw failed.\n");
+
+	/* restore frame size information */
+	IXGB_WRITE_REG(hw, MFS, hw->max_frame_size << IXGB_MFS_SHIFT);
+	if (hw->max_frame_size >
+	    IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) {
+		u32 ctrl0 = IXGB_READ_REG(hw, CTRL0);
+		if (!(ctrl0 & IXGB_CTRL0_JFE)) {
+			ctrl0 |= IXGB_CTRL0_JFE;
+			IXGB_WRITE_REG(hw, CTRL0, ctrl0);
+		}
+	}
 }
 
 /**


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ixgb: enable sun hardware support for broadcom phy
  2007-12-14 19:48 [PATCH 1/2] ixgb: make sure jumbos stay enabled after reset Auke Kok
@ 2007-12-14 19:48 ` Auke Kok
  2007-12-18  1:17   ` Jeff Garzik
  2007-12-14 21:13 ` [PATCH 1/2] ixgb: make sure jumbos stay enabled after reset Jeff Garzik
  1 sibling, 1 reply; 6+ messages in thread
From: Auke Kok @ 2007-12-14 19:48 UTC (permalink / raw)
  To: jeff; +Cc: netdev, auke-jan.h.kok, jesse.brandeburg, matheos.worku

From: Matheos Worku <matheos.worku@sun.com>

Implement support for a SUN-specific PHY.

SUN provides a modified 82597-based board with their own
PHY that works with very little modification to the code. This
patch implements this new PHY which is identified by the
subvendor device ID. The device ID of the adapter remains
the same.

Signed-off-by: Matheos Worku <matheos.worku@sun.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---

 drivers/net/ixgb/ixgb_hw.c   |   82 +++++++++++++++++++++++++++++++++++++++++-
 drivers/net/ixgb/ixgb_hw.h   |    3 +-
 drivers/net/ixgb/ixgb_ids.h  |    4 ++
 drivers/net/ixgb/ixgb_main.c |   10 +++--
 4 files changed, 91 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
index 2c6367a..80a8b98 100644
--- a/drivers/net/ixgb/ixgb_hw.c
+++ b/drivers/net/ixgb/ixgb_hw.c
@@ -45,6 +45,8 @@ static boolean_t ixgb_link_reset(struct ixgb_hw *hw);
 
 static void ixgb_optics_reset(struct ixgb_hw *hw);
 
+static void ixgb_optics_reset_bcm(struct ixgb_hw *hw);
+
 static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw);
 
 static void ixgb_clear_hw_cntrs(struct ixgb_hw *hw);
@@ -90,10 +92,20 @@ static uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
 	ASSERT(!(ctrl_reg & IXGB_CTRL0_RST));
 #endif
 
-	if (hw->phy_type == ixgb_phy_type_txn17401) {
-		ixgb_optics_reset(hw);
+	if (hw->subsystem_vendor_id == SUN_SUBVENDOR_ID) {
+		ctrl_reg =  /* Enable interrupt from XFP and SerDes */
+			   IXGB_CTRL1_GPI0_EN |
+			   IXGB_CTRL1_SDP6_DIR |
+			   IXGB_CTRL1_SDP7_DIR |
+			   IXGB_CTRL1_SDP6 |
+			   IXGB_CTRL1_SDP7;
+		IXGB_WRITE_REG(hw, CTRL1, ctrl_reg);
+		ixgb_optics_reset_bcm(hw);
 	}
 
+	if (hw->phy_type == ixgb_phy_type_txn17401)
+		ixgb_optics_reset(hw);
+
 	return ctrl_reg;
 }
 
@@ -253,6 +265,10 @@ ixgb_identify_phy(struct ixgb_hw *hw)
 		break;
 	}
 
+	/* update phy type for sun specific board */
+	if (hw->subsystem_vendor_id == SUN_SUBVENDOR_ID)
+		phy_type = ixgb_phy_type_bcm;
+
 	return (phy_type);
 }
 
@@ -1225,3 +1241,65 @@ ixgb_optics_reset(struct ixgb_hw *hw)
 
 	return;
 }
+
+/******************************************************************************
+ * Resets the 10GbE optics module for Sun variant NIC.
+ *
+ * hw - Struct containing variables accessed by shared code
+ *****************************************************************************/
+
+#define   IXGB_BCM8704_USER_PMD_TX_CTRL_REG         0xC803
+#define   IXGB_BCM8704_USER_PMD_TX_CTRL_REG_VAL     0x0164
+#define   IXGB_BCM8704_USER_CTRL_REG                0xC800
+#define   IXGB_BCM8704_USER_CTRL_REG_VAL            0x7FBF
+#define   IXGB_BCM8704_USER_DEV3_ADDR               0x0003
+#define   IXGB_SUN_PHY_ADDRESS                      0x0000
+#define   IXGB_SUN_PHY_RESET_DELAY                     305
+
+static void
+ixgb_optics_reset_bcm(struct ixgb_hw *hw)
+{
+	u32 ctrl = IXGB_READ_REG(hw, CTRL0);
+	ctrl &= ~IXGB_CTRL0_SDP2;
+	ctrl |= IXGB_CTRL0_SDP3;
+	IXGB_WRITE_REG(hw, CTRL0, ctrl);
+
+	/* SerDes needs extra delay */
+	msleep(IXGB_SUN_PHY_RESET_DELAY);
+
+	/* Broadcom 7408L configuration */
+	/* Reference clock config */
+	ixgb_write_phy_reg(hw,
+			   IXGB_BCM8704_USER_PMD_TX_CTRL_REG,
+			   IXGB_SUN_PHY_ADDRESS,
+			   IXGB_BCM8704_USER_DEV3_ADDR,
+			   IXGB_BCM8704_USER_PMD_TX_CTRL_REG_VAL);
+	/*  we must read the registers twice */
+	ixgb_read_phy_reg(hw,
+			  IXGB_BCM8704_USER_PMD_TX_CTRL_REG,
+			  IXGB_SUN_PHY_ADDRESS,
+			  IXGB_BCM8704_USER_DEV3_ADDR);
+	ixgb_read_phy_reg(hw,
+			  IXGB_BCM8704_USER_PMD_TX_CTRL_REG,
+			  IXGB_SUN_PHY_ADDRESS,
+			  IXGB_BCM8704_USER_DEV3_ADDR);
+
+	ixgb_write_phy_reg(hw,
+			   IXGB_BCM8704_USER_CTRL_REG,
+			   IXGB_SUN_PHY_ADDRESS,
+			   IXGB_BCM8704_USER_DEV3_ADDR,
+			   IXGB_BCM8704_USER_CTRL_REG_VAL);
+	ixgb_read_phy_reg(hw,
+			  IXGB_BCM8704_USER_CTRL_REG,
+			  IXGB_SUN_PHY_ADDRESS,
+			  IXGB_BCM8704_USER_DEV3_ADDR);
+	ixgb_read_phy_reg(hw,
+			  IXGB_BCM8704_USER_CTRL_REG,
+			  IXGB_SUN_PHY_ADDRESS,
+			  IXGB_BCM8704_USER_DEV3_ADDR);
+
+	/* SerDes needs extra delay */
+	msleep(IXGB_SUN_PHY_RESET_DELAY);
+
+	return;
+}
diff --git a/drivers/net/ixgb/ixgb_hw.h b/drivers/net/ixgb/ixgb_hw.h
index af56433..f4e0044 100644
--- a/drivers/net/ixgb/ixgb_hw.h
+++ b/drivers/net/ixgb/ixgb_hw.h
@@ -44,7 +44,8 @@ typedef enum {
 	ixgb_phy_type_g6005,	/* 850nm, MM fiber, XPAK transceiver */
 	ixgb_phy_type_g6104,	/* 1310nm, SM fiber, XPAK transceiver */
 	ixgb_phy_type_txn17201,	/* 850nm, MM fiber, XPAK transceiver */
-	ixgb_phy_type_txn17401	/* 1310nm, SM fiber, XENPAK transceiver */
+	ixgb_phy_type_txn17401,	/* 1310nm, SM fiber, XENPAK transceiver */
+	ixgb_phy_type_bcm	/* SUN specific board */
 } ixgb_phy_type;
 
 /* XPAK transceiver vendors, for the SR adapters */
diff --git a/drivers/net/ixgb/ixgb_ids.h b/drivers/net/ixgb/ixgb_ids.h
index 4376e7e..180d20e 100644
--- a/drivers/net/ixgb/ixgb_ids.h
+++ b/drivers/net/ixgb/ixgb_ids.h
@@ -35,7 +35,8 @@
 
 #define INTEL_VENDOR_ID             0x8086
 #define INTEL_SUBVENDOR_ID          0x8086
-
+#define SUN_VENDOR_ID               0x108E
+#define SUN_SUBVENDOR_ID            0x108E
 
 #define IXGB_DEVICE_ID_82597EX      0x1048   
 #define IXGB_DEVICE_ID_82597EX_SR   0x1A48   
@@ -46,6 +47,7 @@
 #define IXGB_DEVICE_ID_82597EX_CX4   0x109E
 #define IXGB_SUBDEVICE_ID_A00C  0xA00C
 #define IXGB_SUBDEVICE_ID_A01C  0xA01C
+#define IXGB_SUBDEVICE_ID_7036  0x7036
 
 #endif /* #ifndef _IXGB_IDS_H_ */
 /* End of File */
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index bf9085f..af4d5d4 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -36,7 +36,7 @@ static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
 #else
 #define DRIVERNAPI "-NAPI"
 #endif
-#define DRV_VERSION		"1.0.126-k2"DRIVERNAPI
+#define DRV_VERSION		"1.0.126-k4"DRIVERNAPI
 const char ixgb_driver_version[] = DRV_VERSION;
 static const char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
 
@@ -212,9 +212,11 @@ static void
 ixgb_irq_enable(struct ixgb_adapter *adapter)
 {
 	if(atomic_dec_and_test(&adapter->irq_sem)) {
-		IXGB_WRITE_REG(&adapter->hw, IMS,
-			       IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | IXGB_INT_TXDW |
-			       IXGB_INT_LSC);
+		u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 |
+			  IXGB_INT_TXDW | IXGB_INT_LSC;
+		if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID)
+			val |= IXGB_INT_GPI0;
+		IXGB_WRITE_REG(&adapter->hw, IMS, val);
 		IXGB_WRITE_FLUSH(&adapter->hw);
 	}
 }


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ixgb: make sure jumbos stay enabled after reset
  2007-12-14 19:48 [PATCH 1/2] ixgb: make sure jumbos stay enabled after reset Auke Kok
  2007-12-14 19:48 ` [PATCH 2/2] ixgb: enable sun hardware support for broadcom phy Auke Kok
@ 2007-12-14 21:13 ` Jeff Garzik
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-12-14 21:13 UTC (permalink / raw)
  To: Auke Kok; +Cc: netdev, jesse.brandeburg, matheos.worku

Auke Kok wrote:
> From: Matheos Worku <matheos.worku@sun.com>
> 
> Currently a device reset (ethtool -r ethX) would cause the
> adapter to fall back to regular MTU sizes.
> 
> Signed-off-by: Matheos Worku <matheos.worku@sun.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
> 
>  drivers/net/ixgb/ixgb_main.c |   16 ++++++++++++++--
>  1 files changed, 14 insertions(+), 2 deletions(-)

applied #upstream-fixes



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ixgb: enable sun hardware support for broadcom phy
  2007-12-14 19:48 ` [PATCH 2/2] ixgb: enable sun hardware support for broadcom phy Auke Kok
@ 2007-12-18  1:17   ` Jeff Garzik
  2008-01-14 19:43     ` Matheos Worku
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2007-12-18  1:17 UTC (permalink / raw)
  To: Auke Kok; +Cc: netdev, jesse.brandeburg, matheos.worku

Auke Kok wrote:
> From: Matheos Worku <matheos.worku@sun.com>
> 
> Implement support for a SUN-specific PHY.
> 
> SUN provides a modified 82597-based board with their own
> PHY that works with very little modification to the code. This
> patch implements this new PHY which is identified by the
> subvendor device ID. The device ID of the adapter remains
> the same.
> 
> Signed-off-by: Matheos Worku <matheos.worku@sun.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
> 
>  drivers/net/ixgb/ixgb_hw.c   |   82 +++++++++++++++++++++++++++++++++++++++++-
>  drivers/net/ixgb/ixgb_hw.h   |    3 +-
>  drivers/net/ixgb/ixgb_ids.h  |    4 ++
>  drivers/net/ixgb/ixgb_main.c |   10 +++--
>  4 files changed, 91 insertions(+), 8 deletions(-)

applied #upstream



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ixgb: enable sun hardware support for broadcom phy
  2007-12-18  1:17   ` Jeff Garzik
@ 2008-01-14 19:43     ` Matheos Worku
  2008-01-28 23:27       ` Kok, Auke
  0 siblings, 1 reply; 6+ messages in thread
From: Matheos Worku @ 2008-01-14 19:43 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Auke Kok, netdev, jesse.brandeburg

Jeff Garzik wrote:
> Auke Kok wrote:
>> From: Matheos Worku <matheos.worku@sun.com>
>>
>> Implement support for a SUN-specific PHY.
>>
>> SUN provides a modified 82597-based board with their own
>> PHY that works with very little modification to the code. This
>> patch implements this new PHY which is identified by the
>> subvendor device ID. The device ID of the adapter remains
>> the same.
>>
>> Signed-off-by: Matheos Worku <matheos.worku@sun.com>
>> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
>> ---
>>
>>  drivers/net/ixgb/ixgb_hw.c   |   82 
>> +++++++++++++++++++++++++++++++++++++++++-
>>  drivers/net/ixgb/ixgb_hw.h   |    3 +-
>>  drivers/net/ixgb/ixgb_ids.h  |    4 ++
>>  drivers/net/ixgb/ixgb_main.c |   10 +++--
>>  4 files changed, 91 insertions(+), 8 deletions(-)
> 
> applied #upstream
> 
> 

Jeff,
Bleated Happy New Year.

I was wondering when this patch will  make  it to Linus' and other 
trees. I just checked Linus's and other net trees, including 
git.kernel.org/?p=linux/kernel/git/jgarzik/netdev-2.6.git and I see only 
the other patch's commit: 3fd7131feacc01c1e23e46c416228f36ebdcc0d4, and 
not this patch.


Regards
Matheos

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ixgb: enable sun hardware support for broadcom phy
  2008-01-14 19:43     ` Matheos Worku
@ 2008-01-28 23:27       ` Kok, Auke
  0 siblings, 0 replies; 6+ messages in thread
From: Kok, Auke @ 2008-01-28 23:27 UTC (permalink / raw)
  To: Matheos Worku; +Cc: Jeff Garzik, netdev, jesse.brandeburg

Matheos Worku wrote:
> Jeff Garzik wrote:
>> Auke Kok wrote:
>>> From: Matheos Worku <matheos.worku@sun.com>
>>>
>>> Implement support for a SUN-specific PHY.
>>>
>>> SUN provides a modified 82597-based board with their own
>>> PHY that works with very little modification to the code. This
>>> patch implements this new PHY which is identified by the
>>> subvendor device ID. The device ID of the adapter remains
>>> the same.
>>>
>>> Signed-off-by: Matheos Worku <matheos.worku@sun.com>
>>> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>>> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
>>> ---
>>>
>>>  drivers/net/ixgb/ixgb_hw.c   |   82
>>> +++++++++++++++++++++++++++++++++++++++++-
>>>  drivers/net/ixgb/ixgb_hw.h   |    3 +-
>>>  drivers/net/ixgb/ixgb_ids.h  |    4 ++
>>>  drivers/net/ixgb/ixgb_main.c |   10 +++--
>>>  4 files changed, 91 insertions(+), 8 deletions(-)
>>
>> applied #upstream
>>
>>
> 
> Jeff,
> Bleated Happy New Year.
> 
> I was wondering when this patch will  make  it to Linus' and other
> trees. I just checked Linus's and other net trees, including
> git.kernel.org/?p=linux/kernel/git/jgarzik/netdev-2.6.git and I see only
> the other patch's commit: 3fd7131feacc01c1e23e46c416228f36ebdcc0d4, and
> not this patch.

It's in the "upstream" branch of that tree:

http://git.kernel.org/?p=linux/kernel/git/jgarzik/netdev-2.6.git;a=history;f=drivers/net/ixgb;hb=upstream

this should be merged in the currently open merge window, so you'll find it
eventually in the 2.6.25 kernel release.

Cheers,

Auke



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-28 23:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-14 19:48 [PATCH 1/2] ixgb: make sure jumbos stay enabled after reset Auke Kok
2007-12-14 19:48 ` [PATCH 2/2] ixgb: enable sun hardware support for broadcom phy Auke Kok
2007-12-18  1:17   ` Jeff Garzik
2008-01-14 19:43     ` Matheos Worku
2008-01-28 23:27       ` Kok, Auke
2007-12-14 21:13 ` [PATCH 1/2] ixgb: make sure jumbos stay enabled after reset Jeff Garzik

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).