* [PATCH 1/5 net-next] tg3: Add 57766 device support.
@ 2013-02-14 22:13 Michael Chan
2013-02-14 22:13 ` [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0 Michael Chan
2013-02-14 22:25 ` [PATCH 1/5 net-next] tg3: Add 57766 device support Joe Perches
0 siblings, 2 replies; 9+ messages in thread
From: Michael Chan @ 2013-02-14 22:13 UTC (permalink / raw)
To: davem; +Cc: netdev, nsujir
From: Matt Carlson <mcarlson@broadcom.com>
The patch also adds a couple of fixes
- For the 57766, bootcode needs to setup the PCIE Fast Training
Sequence (FTS) value to prevent transmit hangs. Unfortunately, it
does not have enough room in the selfboot case (i.e. devices with no
NVRAM). The driver needs to implement this.
- For performance reasons, the 2k DMA engine mode on the 57766 should
be enabled and dma size limited to 2k for standard sized packets.
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 18 +++++++++++++++++-
drivers/net/ethernet/broadcom/tg3.h | 2 ++
2 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index b1b3bc0..6e676a7 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -332,6 +332,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5720)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57762)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57766)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5762)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5725)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5727)},
@@ -9179,7 +9180,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
}
if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_57765_AX) {
- u32 grc_mode = tr32(GRC_MODE);
+ u32 grc_mode;
+
+ /* Fix transmit hangs */
+ val = tr32(TG3_CPMU_PADRNG_CTL);
+ val |= TG3_CPMU_PADRNG_CTL_RDIV2;
+ tw32(TG3_CPMU_PADRNG_CTL, val);
+
+ grc_mode = tr32(GRC_MODE);
/* Access the lower 1K of DL PCIE block registers. */
val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK;
@@ -9492,6 +9500,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
if (tg3_flag(tp, PCI_EXPRESS))
rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST;
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57766) {
+ tp->dma_limit = 0;
+ if (tp->dev->mtu <= ETH_DATA_LEN) {
+ rdmac_mode |= RDMAC_MODE_JMB_2K_MMRR;
+ tp->dma_limit = TG3_TX_BD_DMA_MAX_2K;
+ }
+ }
+
if (tg3_flag(tp, HW_TSO_1) ||
tg3_flag(tp, HW_TSO_2) ||
tg3_flag(tp, HW_TSO_3))
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index ef6ced2..b676728 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -1164,6 +1164,8 @@
#define CPMU_MUTEX_GNT_DRIVER 0x00001000
#define TG3_CPMU_PHY_STRAP 0x00003664
#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020
+#define TG3_CPMU_PADRNG_CTL 0x00003668
+#define TG3_CPMU_PADRNG_CTL_RDIV2 0x00040000
/* 0x3664 --> 0x36b0 unused */
#define TG3_CPMU_EEE_MODE 0x000036b0
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0
2013-02-14 22:13 [PATCH 1/5 net-next] tg3: Add 57766 device support Michael Chan
@ 2013-02-14 22:13 ` Michael Chan
2013-02-14 22:13 ` [PATCH 3/5 net-next] tg3: Fix 5762 NVRAM sizing Michael Chan
2013-02-14 22:19 ` [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0 David Miller
2013-02-14 22:25 ` [PATCH 1/5 net-next] tg3: Add 57766 device support Joe Perches
1 sibling, 2 replies; 9+ messages in thread
From: Michael Chan @ 2013-02-14 22:13 UTC (permalink / raw)
To: davem; +Cc: netdev, nsujir
This chip supports Energy Efficient Ethernet.
Signed-off-by: Michael Chan <mchan@broadocm.com>
---
drivers/net/ethernet/broadcom/tg3.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 6e676a7..3004d69 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -14514,7 +14514,7 @@ static int tg3_phy_probe(struct tg3 *tp)
(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762 ||
- (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 &&
+ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) ||
(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
tp->pci_chip_rev_id != CHIPREV_ID_57765_A0)))
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/5 net-next] tg3: Fix 5762 NVRAM sizing
2013-02-14 22:13 ` [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0 Michael Chan
@ 2013-02-14 22:13 ` Michael Chan
2013-02-14 22:13 ` [PATCH 4/5 net-next] tg3: Set initial carrier state to off Michael Chan
2013-02-14 22:19 ` [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0 David Miller
1 sibling, 1 reply; 9+ messages in thread
From: Michael Chan @ 2013-02-14 22:13 UTC (permalink / raw)
To: davem; +Cc: netdev, nsujir
Don't set the default size to 128K if it is 5762. Instead, rely on the
size we obtain from NVRAM location 0xf0.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 3004d69..7ac0bd0 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -13883,7 +13883,8 @@ static void tg3_get_5720_nvram_info(struct tg3 *tp)
tp->nvram_size = TG3_NVRAM_SIZE_1MB;
break;
default:
- tp->nvram_size = TG3_NVRAM_SIZE_128KB;
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5762)
+ tp->nvram_size = TG3_NVRAM_SIZE_128KB;
break;
}
break;
@@ -13929,7 +13930,8 @@ static void tg3_get_5720_nvram_info(struct tg3 *tp)
tp->nvram_size = TG3_NVRAM_SIZE_1MB;
break;
default:
- tp->nvram_size = TG3_NVRAM_SIZE_128KB;
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5762)
+ tp->nvram_size = TG3_NVRAM_SIZE_128KB;
break;
}
break;
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/5 net-next] tg3: Set initial carrier state to off.
2013-02-14 22:13 ` [PATCH 3/5 net-next] tg3: Fix 5762 NVRAM sizing Michael Chan
@ 2013-02-14 22:13 ` Michael Chan
2013-02-14 22:13 ` [PATCH 5/5 net-next] tg3: Update version to 3.130 Michael Chan
0 siblings, 1 reply; 9+ messages in thread
From: Michael Chan @ 2013-02-14 22:13 UTC (permalink / raw)
To: davem; +Cc: netdev, nsujir
Before the device is opened, the carrier state should be off. It
will not race with the link interrupt if we set it before calling
register_netdev().
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 7ac0bd0..3829321 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -16902,6 +16902,8 @@ static int tg3_init_one(struct pci_dev *pdev,
tg3_timer_init(tp);
+ tg3_carrier_off(tp);
+
err = register_netdev(dev);
if (err) {
dev_err(&pdev->dev, "Cannot register net device, aborting\n");
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/5 net-next] tg3: Update version to 3.130
2013-02-14 22:13 ` [PATCH 4/5 net-next] tg3: Set initial carrier state to off Michael Chan
@ 2013-02-14 22:13 ` Michael Chan
0 siblings, 0 replies; 9+ messages in thread
From: Michael Chan @ 2013-02-14 22:13 UTC (permalink / raw)
To: davem; +Cc: netdev, nsujir
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 3829321..1b59876 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -94,10 +94,10 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
#define DRV_MODULE_NAME "tg3"
#define TG3_MAJ_NUM 3
-#define TG3_MIN_NUM 129
+#define TG3_MIN_NUM 130
#define DRV_MODULE_VERSION \
__stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
-#define DRV_MODULE_RELDATE "January 06, 2013"
+#define DRV_MODULE_RELDATE "February 14, 2013"
#define RESET_KIND_SHUTDOWN 0
#define RESET_KIND_INIT 1
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0
2013-02-14 22:13 ` [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0 Michael Chan
2013-02-14 22:13 ` [PATCH 3/5 net-next] tg3: Fix 5762 NVRAM sizing Michael Chan
@ 2013-02-14 22:19 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2013-02-14 22:19 UTC (permalink / raw)
To: mchan; +Cc: netdev, nsujir
From: "Michael Chan" <mchan@broadcom.com>
Date: Thu, 14 Feb 2013 14:13:39 -0800
> This chip supports Energy Efficient Ethernet.
>
> Signed-off-by: Michael Chan <mchan@broadocm.com>
This looks more like the correction of an existing test rather
than adding a new one.
If that's the case, construct your commit message to match.
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/5 net-next] tg3: Add 57766 device support.
2013-02-14 22:13 [PATCH 1/5 net-next] tg3: Add 57766 device support Michael Chan
2013-02-14 22:13 ` [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0 Michael Chan
@ 2013-02-14 22:25 ` Joe Perches
2013-02-14 23:13 ` Nithin Nayak Sujir
1 sibling, 1 reply; 9+ messages in thread
From: Joe Perches @ 2013-02-14 22:25 UTC (permalink / raw)
To: Michael Chan, Matt Carlson; +Cc: davem, netdev, nsujir
On Thu, 2013-02-14 at 14:13 -0800, Michael Chan wrote:
> From: Matt Carlson <mcarlson@broadcom.com>
>
> The patch also adds a couple of fixes
>
> - For the 57766, bootcode needs to setup the PCIE Fast Training
> Sequence (FTS) value to prevent transmit hangs. Unfortunately, it
> does not have enough room in the selfboot case (i.e. devices with no
> NVRAM). The driver needs to implement this.
[]
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
[]
> @@ -9179,7 +9180,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
> }
>
> if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_57765_AX) {
> - u32 grc_mode = tr32(GRC_MODE);
> + u32 grc_mode;
> +
> + /* Fix transmit hangs */
> + val = tr32(TG3_CPMU_PADRNG_CTL);
> + val |= TG3_CPMU_PADRNG_CTL_RDIV2;
> + tw32(TG3_CPMU_PADRNG_CTL, val);
> +
This seems to write this val to more devices than just
a 57766. Intentional?
> + grc_mode = tr32(GRC_MODE);
>
> /* Access the lower 1K of DL PCIE block registers. */
> val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK;
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/5 net-next] tg3: Add 57766 device support.
2013-02-14 22:25 ` [PATCH 1/5 net-next] tg3: Add 57766 device support Joe Perches
@ 2013-02-14 23:13 ` Nithin Nayak Sujir
2013-02-14 23:16 ` Joe Perches
0 siblings, 1 reply; 9+ messages in thread
From: Nithin Nayak Sujir @ 2013-02-14 23:13 UTC (permalink / raw)
To: Joe Perches; +Cc: Michael Chan, davem, netdev
On 02/14/2013 02:25 PM, Joe Perches wrote:
> On Thu, 2013-02-14 at 14:13 -0800, Michael Chan wrote:
>> From: Matt Carlson <mcarlson@broadcom.com>
>>
>> The patch also adds a couple of fixes
>>
>> - For the 57766, bootcode needs to setup the PCIE Fast Training
>> Sequence (FTS) value to prevent transmit hangs. Unfortunately, it
>> does not have enough room in the selfboot case (i.e. devices with no
>> NVRAM). The driver needs to implement this.
> []
>> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> []
>> @@ -9179,7 +9180,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
>> }
>>
>> if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_57765_AX) {
>> - u32 grc_mode = tr32(GRC_MODE);
>> + u32 grc_mode;
>> +
>> + /* Fix transmit hangs */
>> + val = tr32(TG3_CPMU_PADRNG_CTL);
>> + val |= TG3_CPMU_PADRNG_CTL_RDIV2;
>> + tw32(TG3_CPMU_PADRNG_CTL, val);
>> +
>
> This seems to write this val to more devices than just
> a 57766. Intentional?
>
Yes. In addition to the 57766, this fix applies to non-AX revisions of the 57765.
It's not apparent from the patch, but this code chunk is inside the conditional -
if (tg3_flag(tp, 57765_CLASS)) {
which is set for 57765 and 57766 devices.
>> + grc_mode = tr32(GRC_MODE);
>>
>> /* Access the lower 1K of DL PCIE block registers. */
>> val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK;
>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/5 net-next] tg3: Add 57766 device support.
2013-02-14 23:13 ` Nithin Nayak Sujir
@ 2013-02-14 23:16 ` Joe Perches
0 siblings, 0 replies; 9+ messages in thread
From: Joe Perches @ 2013-02-14 23:16 UTC (permalink / raw)
To: Nithin Nayak Sujir; +Cc: Michael Chan, davem, netdev
On Thu, 2013-02-14 at 15:13 -0800, Nithin Nayak Sujir wrote:
>
> On 02/14/2013 02:25 PM, Joe Perches wrote:
> > On Thu, 2013-02-14 at 14:13 -0800, Michael Chan wrote:
> >> From: Matt Carlson <mcarlson@broadcom.com>
> >>
> >> The patch also adds a couple of fixes
> >>
> >> - For the 57766, bootcode needs to setup the PCIE Fast Training
> >> Sequence (FTS) value to prevent transmit hangs. Unfortunately, it
> >> does not have enough room in the selfboot case (i.e. devices with no
> >> NVRAM). The driver needs to implement this.
> > []
> >> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> > []
> >> @@ -9179,7 +9180,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
> >> }
> >>
> >> if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_57765_AX) {
> >> - u32 grc_mode = tr32(GRC_MODE);
> >> + u32 grc_mode;
> >> +
> >> + /* Fix transmit hangs */
> >> + val = tr32(TG3_CPMU_PADRNG_CTL);
> >> + val |= TG3_CPMU_PADRNG_CTL_RDIV2;
> >> + tw32(TG3_CPMU_PADRNG_CTL, val);
> >> +
> >
> > This seems to write this val to more devices than just
> > a 57766. Intentional?
> >
>
> Yes. In addition to the 57766, this fix applies to non-AX revisions of the 57765.
>
> It's not apparent from the patch, but this code chunk is inside the conditional -
>
> if (tg3_flag(tp, 57765_CLASS)) {
>
> which is set for 57765 and 57766 devices.
I know.
The commit message does not describe the patch correctly.
The commit message says "for the 57766".
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-02-14 23:16 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-14 22:13 [PATCH 1/5 net-next] tg3: Add 57766 device support Michael Chan
2013-02-14 22:13 ` [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0 Michael Chan
2013-02-14 22:13 ` [PATCH 3/5 net-next] tg3: Fix 5762 NVRAM sizing Michael Chan
2013-02-14 22:13 ` [PATCH 4/5 net-next] tg3: Set initial carrier state to off Michael Chan
2013-02-14 22:13 ` [PATCH 5/5 net-next] tg3: Update version to 3.130 Michael Chan
2013-02-14 22:19 ` [PATCH 2/5 net-next] tg3: Add EEE support for 5717 B0 David Miller
2013-02-14 22:25 ` [PATCH 1/5 net-next] tg3: Add 57766 device support Joe Perches
2013-02-14 23:13 ` Nithin Nayak Sujir
2013-02-14 23:16 ` Joe Perches
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).