aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tg3.c10
-rw-r--r--drivers/net/tg3.h4
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 2dcde1343cc7..1e1c341da763 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1085,13 +1085,9 @@ static int tg3_mdio_init(struct tg3 *tp)
1085 struct phy_device *phydev; 1085 struct phy_device *phydev;
1086 1086
1087 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { 1087 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
1088 u32 funcnum, is_serdes; 1088 u32 is_serdes;
1089 1089
1090 funcnum = tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC; 1090 tp->phy_addr = PCI_FUNC(tp->pdev->devfn) + 1;
1091 if (funcnum)
1092 tp->phy_addr = 2;
1093 else
1094 tp->phy_addr = 1;
1095 1091
1096 if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) 1092 if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
1097 is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; 1093 is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES;
@@ -13608,7 +13604,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
13608 else 13604 else
13609 tg3_nvram_unlock(tp); 13605 tg3_nvram_unlock(tp);
13610 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { 13606 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
13611 if (tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC) 13607 if (PCI_FUNC(tp->pdev->devfn))
13612 mac_offset = 0xcc; 13608 mac_offset = 0xcc;
13613 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) 13609 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
13614 mac_offset = 0x10; 13610 mac_offset = 0x10;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index c245e809d428..878cdee7cc62 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1073,10 +1073,8 @@
1073#define TG3_CPMU_HST_ACC 0x0000361c 1073#define TG3_CPMU_HST_ACC 0x0000361c
1074#define CPMU_HST_ACC_MACCLK_MASK 0x001f0000 1074#define CPMU_HST_ACC_MACCLK_MASK 0x001f0000
1075#define CPMU_HST_ACC_MACCLK_6_25 0x00130000 1075#define CPMU_HST_ACC_MACCLK_6_25 0x00130000
1076/* 0x3620 --> 0x362c unused */ 1076/* 0x3620 --> 0x3630 unused */
1077 1077
1078#define TG3_CPMU_STATUS 0x0000362c
1079#define TG3_CPMU_STATUS_PCIE_FUNC 0x20000000
1080#define TG3_CPMU_CLCK_STAT 0x00003630 1078#define TG3_CPMU_CLCK_STAT 0x00003630
1081#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000 1079#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000
1082#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 1080#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000