Skip to content

Commit b5af712

Browse files
Matt Carlsondavem330
authored andcommitted
[TG3]: Add A1 revs
This patch adds the A1 revision of 5784, 5764, and 5761, and applies all previous bugfixes. In places where the list of devices gets too long, the patch uses a new TG3_FLG3_5761_5784_AX_FIXES flag instead. Signed-off-by: Matt Carlson <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5f5c51e commit b5af712

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

drivers/net/tg3.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,8 +1106,7 @@ static int tg3_phy_reset(struct tg3 *tp)
11061106
if (err)
11071107
return err;
11081108

1109-
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
1110-
tp->pci_chip_rev_id == CHIPREV_ID_5761_A0) {
1109+
if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
11111110
u32 val;
11121111

11131112
val = tr32(TG3_CPMU_LSPD_1000MB_CLK);
@@ -1352,8 +1351,7 @@ static void tg3_power_down_phy(struct tg3 *tp)
13521351
(tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
13531352
return;
13541353

1355-
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
1356-
tp->pci_chip_rev_id == CHIPREV_ID_5761_A0) {
1354+
if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
13571355
val = tr32(TG3_CPMU_LSPD_1000MB_CLK);
13581356
val &= ~CPMU_LSPD_1000MB_MACCLK_MASK;
13591357
val |= CPMU_LSPD_1000MB_MACCLK_12_5;
@@ -3154,7 +3152,8 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
31543152
err = tg3_setup_copper_phy(tp, force_reset);
31553153
}
31563154

3157-
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0) {
3155+
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
3156+
tp->pci_chip_rev_id == CHIPREV_ID_5784_A1) {
31583157
u32 val, scale;
31593158

31603159
val = tr32(TG3_CPMU_CLCK_STAT) & CPMU_CLCK_STAT_MAC_CLCK_MASK;
@@ -6390,7 +6389,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
63906389

63916390
tg3_write_sig_legacy(tp, RESET_KIND_INIT);
63926391

6393-
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0) {
6392+
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
6393+
tp->pci_chip_rev_id == CHIPREV_ID_5784_A1) {
63946394
val = tr32(TG3_CPMU_CTRL);
63956395
val &= ~(CPMU_CTRL_LINK_AWARE_MODE | CPMU_CTRL_LINK_IDLE_MODE);
63966396
tw32(TG3_CPMU_CTRL, val);
@@ -9379,8 +9379,7 @@ static int tg3_test_loopback(struct tg3 *tp)
93799379
if (err)
93809380
return TG3_LOOPBACK_FAILED;
93819381

9382-
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
9383-
tp->pci_chip_rev_id == CHIPREV_ID_5761_A0) {
9382+
if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
93849383
int i;
93859384
u32 status;
93869385

@@ -9407,8 +9406,7 @@ static int tg3_test_loopback(struct tg3 *tp)
94079406
if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
94089407
err |= TG3_MAC_LOOPBACK_FAILED;
94099408

9410-
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
9411-
tp->pci_chip_rev_id == CHIPREV_ID_5761_A0) {
9409+
if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
94129410
tw32(TG3_CPMU_CTRL, cpmuctrl);
94139411

94149412
/* Release the mutex */
@@ -10629,7 +10627,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
1062910627
tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
1063010628
tp->led_ctrl = LED_CTRL_MODE_PHY_2;
1063110629

10632-
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0)
10630+
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
10631+
tp->pci_chip_rev_id == CHIPREV_ID_5784_A1)
1063310632
tp->led_ctrl = LED_CTRL_MODE_MAC;
1063410633

1063510634
if (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP) {
@@ -11401,9 +11400,16 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
1140111400
}
1140211401

1140311402
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
11404-
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761)
11403+
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
1140511404
tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
1140611405

11406+
if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 ||
11407+
tp->pci_chip_rev_id == CHIPREV_ID_5784_A1 ||
11408+
tp->pci_chip_rev_id == CHIPREV_ID_5761_A0 ||
11409+
tp->pci_chip_rev_id == CHIPREV_ID_5761_A1)
11410+
tp->tg3_flags3 |= TG3_FLG3_5761_5784_AX_FIXES;
11411+
}
11412+
1140711413
/* Set up tp->grc_local_ctrl before calling tg3_set_power_state().
1140811414
* GPIO1 driven high will bring 5700's external PHY out of reset.
1140911415
* It is also used as eeprom write protect on LOMs.

drivers/net/tg3.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@
109109
#define CHIPREV_ID_5714_A2 0x9002
110110
#define CHIPREV_ID_5906_A1 0xc001
111111
#define CHIPREV_ID_5784_A0 0x5784000
112+
#define CHIPREV_ID_5784_A1 0x5784001
112113
#define CHIPREV_ID_5761_A0 0x5761000
114+
#define CHIPREV_ID_5761_A1 0x5761001
113115
#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
114116
#define ASIC_REV_5700 0x07
115117
#define ASIC_REV_5701 0x00
@@ -2391,6 +2393,7 @@ struct tg3 {
23912393
u32 tg3_flags3;
23922394
#define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
23932395
#define TG3_FLG3_ENABLE_APE 0x00000002
2396+
#define TG3_FLG3_5761_5784_AX_FIXES 0x00000004
23942397

23952398
struct timer_list timer;
23962399
u16 timer_counter;

0 commit comments

Comments
 (0)