Skip to contentSkip to conversation

Use different PBA value for E1000 PCI and PCIe cards

PATCH New Roy Zang 4 participants 4 messages Aug 21, 2009 – Sep 4, 2009 Network drivers

lore
Share & tools
lore

Roy Zang

author
#0 lore raw

PATCH 1/1 Use different PBA value for E1000 PCI and PCIe cards

From: Roy Zang <[email protected]>

Use different PBA value for E1000 PCI and PCIe cards.

---
Andre, please help to verify it on your board.
Thanks.
Roy

 drivers/net/e1000.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/net/e1000.c +10 -2
index 777783a..57123dd 100644
@@ -51,7 +51,8 @@ tested on both gig copper and gig fiber boards
 #define bus_to_phys(devno, a)	pci_mem_to_phys(devno, a)
 #define mdelay(n)	udelay((n)*1000)
 
-#define E1000_DEFAULT_PBA    0x000a0026
+#define E1000_DEFAULT_PCI_PBA	0x00000030
+#define E1000_DEFAULT_PCIE_PBA	0x000a0026
 
 /* NIC specific static variables go here */
 
@@ -1350,9 +1351,16 @@ e1000_reset_hw(struct e1000_hw *hw)
 	uint32_t ctrl_ext;
 	uint32_t icr;
 	uint32_t manc;
+	uint32_t pba = 0;
 
 	DEBUGFUNC();
 
+	/* get the correct pba value for both PCI and PCIe*/
+	if (hw->mac_type <  e1000_82571)
+		pba = E1000_DEFAULT_PCI_PBA;
+	else
+		pba = E1000_DEFAULT_PCIE_PBA;
+
 	/* For 82542 (rev 2.0), disable MWI before issuing a device reset */
 	if (hw->mac_type == e1000_82542_rev2_0) {
 		DEBUGOUT("Disabling MWI on 82542 rev 2.0\n");
@@ -1420,7 +1428,7 @@ e1000_reset_hw(struct e1000_hw *hw)
 	if (hw->mac_type == e1000_82542_rev2_0) {
 		pci_write_config_word(hw->pdev, PCI_COMMAND, hw->pci_cmd_word);
 	}
-	E1000_WRITE_REG(hw, PBA, E1000_DEFAULT_PBA);
+	E1000_WRITE_REG(hw, PBA, pba);
 }
 
 /******************************************************************************
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 Use different PBA value for E1000 PCI and PCIe cards

---

Tested on 82541ER @ mvBC-P board.

Quoted 44 lines · Roy Zang

From: Roy Zang <[email protected]>

Use different PBA value for E1000 PCI and PCIe cards.

---
Andre, please help to verify it on your board.
Thanks.
Roy

 drivers/net/e1000.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/net/e1000.c +9 -1
index 777783a..57123dd 100644
@@ -51,7 +51,8 @@ tested on both gig copper and gig fiber boards
 #define bus_to_phys(devno, a)	pci_mem_to_phys(devno, a)
 #define mdelay(n)	udelay((n)*1000)
 
-#define E1000_DEFAULT_PBA    0x000a0026
+#define E1000_DEFAULT_PCI_PBA	0x00000030
+#define E1000_DEFAULT_PCIE_PBA	0x000a0026
 
 /* NIC specific static variables go here */
 
@@ -1350,9 +1351,16 @@ e1000_reset_hw(struct e1000_hw *hw)
 	uint32_t ctrl_ext;
 	uint32_t icr;
 	uint32_t manc;
+	uint32_t pba = 0;
 
 	DEBUGFUNC();
 
+	/* get the correct pba value for both PCI and PCIe*/
+	if (hw->mac_type <  e1000_82571)
+		pba = E1000_DEFAULT_PCI_PBA;
+	else
+		pba = E1000_DEFAULT_PCIE_PBA;
+
 	/* For 82542 (rev 2.0), disable MWI before issuing a device reset */
 	if (hw->mac_type == e1000_82542_rev2_0) {
 		DEBUGOUT("Disabling MWI on 82542 rev 2.0\n");

drivers/net/e1000.c e1000_reset_hw(struct e1000_hw *hw) · line 1434

Quoted 8 lines
drivers/net/e1000.c +1 -1
@@ -1420,7 +1428,7 @@ e1000_reset_hw(struct e1000_hw *hw)
 	if (hw->mac_type == e1000_82542_rev2_0) {
 		pci_write_config_word(hw->pdev, PCI_COMMAND, hw->pci_cmd_word);
 	}
-	E1000_WRITE_REG(hw, PBA, E1000_DEFAULT_PBA);
+	E1000_WRITE_REG(hw, PBA, pba);
 }
 
 /******************************************************************************

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich

#2 lore raw

PATCH 1/1 Use different PBA value for E1000 PCI and PCIe cards

Wolfgang,

2009/8/24 Andr? Schwarz <[email protected]>

Quoted 60 lines

---

Tested on 82541ER @ mvBC-P board.

Quoted 31 lines · Roy Zang

From: Roy Zang <[email protected]>

Use different PBA value for E1000 PCI and PCIe cards.

---
Andre, please help to verify it on your board.
Thanks.
Roy

 drivers/net/e1000.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/net/e1000.c +3 -1
index 777783a..57123dd 100644
@@ -51,7 +51,8 @@ tested on both gig copper and gig fiber boards
 #define bus_to_phys(devno, a)        pci_mem_to_phys(devno, a)
 #define mdelay(n)    udelay((n)*1000)
 
-#define E1000_DEFAULT_PBA    0x000a0026
+#define E1000_DEFAULT_PCI_PBA        0x00000030
+#define E1000_DEFAULT_PCIE_PBA       0x000a0026
 
 /* NIC specific static variables go here */
 
@@ -1350,9 +1351,16 @@ e1000_reset_hw(struct e1000_hw *hw)
      uint32_t ctrl_ext;
      uint32_t icr;
      uint32_t manc;
+     uint32_t pba = 0;

drivers/net/e1000.c e1000_reset_hw(struct e1000_hw *hw) · line 1364

Quoted 10 lines
drivers/net/e1000.c +6 -0
 
      DEBUGFUNC();
 
+     /* get the correct pba value for both PCI and PCIe*/
+     if (hw->mac_type <  e1000_82571)
+             pba = E1000_DEFAULT_PCI_PBA;
+     else
+             pba = E1000_DEFAULT_PCIE_PBA;
+
      /* For 82542 (rev 2.0), disable MWI before issuing a device reset

*/

drivers/net/e1000.c e1000_reset_hw(struct e1000_hw *hw) · line 1429

Quoted 5 lines
drivers/net/e1000.c +0 -0
      if (hw->mac_type == e1000_82542_rev2_0) {
              DEBUGOUT("Disabling MWI on 82542 rev 2.0\n");
@@ -1420,7 +1428,7 @@ e1000_reset_hw(struct e1000_hw *hw)
      if (hw->mac_type == e1000_82542_rev2_0) {
              pci_write_config_word(hw->pdev, PCI_COMMAND,

hw->pci_cmd_word);

drivers/net/e1000.c e1000_reset_hw(struct e1000_hw *hw)

Quoted 6 lines
drivers/net/e1000.c +1 -1
      }
-     E1000_WRITE_REG(hw, PBA, E1000_DEFAULT_PBA);
+     E1000_WRITE_REG(hw, PBA, pba);
 }
 
 
Quoted 8 lines

/******************************************************************************

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich

Please apply this bug fix to master.

regards,
Ben

#3 lore raw

PATCH 1/1 Use different PBA value for E1000 PCI and PCIe cards

In reply to Roy Zang

Dear Roy Zang,

Quoted 11 lines · In message <[email protected]> you wrote:

From: Roy Zang <[email protected]>

Use different PBA value for E1000 PCI and PCIe cards.

---
Andre, please help to verify it on your board.
Thanks.
Roy

 drivers/net/e1000.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

Applied, thanks.

Sorry that I missed this for v2009.08 ...

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
People are very flexible and learn to adjust to strange  surroundings
--  they can become accustomed to read Lisp and Fortran programs, for
example.   - Leon Sterling and Ehud Shapiro, Art of Prolog, MIT Press