diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2011-04-05 10:22:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-06 14:29:07 -0400 |
commit | d78b59f5d18bf064abae2fa5bc87f00545e2160a (patch) | |
tree | 00649b96285b534754a2b36858e2342178b3579c /drivers/net | |
parent | 0a58d6689bb7c0d49addbf6992aa97234bcfc96c (diff) |
tg3: Add 5720 ASIC rev
This patch adds support for the 5720 ASIC rev.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/tg3.c | 30 | ||||
-rw-r--r-- | drivers/net/tg3.h | 5 |
2 files changed, 27 insertions, 8 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index dc6b60b65c0b..53a1209d4f9c 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -2125,7 +2125,8 @@ static void tg3_frob_aux_power(struct tg3 *tp) | |||
2125 | 2125 | ||
2126 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || | 2126 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || |
2127 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 || | 2127 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 || |
2128 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) && | 2128 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
2129 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) && | ||
2129 | tp->pdev_peer != tp->pdev) { | 2130 | tp->pdev_peer != tp->pdev) { |
2130 | struct net_device *dev_peer; | 2131 | struct net_device *dev_peer; |
2131 | 2132 | ||
@@ -7251,6 +7252,11 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
7251 | tw32(0x7c00, val | (1 << 25)); | 7252 | tw32(0x7c00, val | (1 << 25)); |
7252 | } | 7253 | } |
7253 | 7254 | ||
7255 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) { | ||
7256 | val = tr32(TG3_CPMU_CLCK_ORIDE); | ||
7257 | tw32(TG3_CPMU_CLCK_ORIDE, val & ~CPMU_CLCK_ORIDE_MAC_ORIDE_EN); | ||
7258 | } | ||
7259 | |||
7254 | /* Reprobe ASF enable state. */ | 7260 | /* Reprobe ASF enable state. */ |
7255 | tp->tg3_flags &= ~TG3_FLAG_ENABLE_ASF; | 7261 | tp->tg3_flags &= ~TG3_FLAG_ENABLE_ASF; |
7256 | tp->tg3_flags2 &= ~TG3_FLG2_ASF_NEW_HANDSHAKE; | 7262 | tp->tg3_flags2 &= ~TG3_FLG2_ASF_NEW_HANDSHAKE; |
@@ -8214,7 +8220,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
8214 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | 8220 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || |
8215 | (tp->tg3_flags3 & TG3_FLG3_57765_PLUS)) { | 8221 | (tp->tg3_flags3 & TG3_FLG3_57765_PLUS)) { |
8216 | val = tr32(TG3_RDMA_RSRVCTRL_REG); | 8222 | val = tr32(TG3_RDMA_RSRVCTRL_REG); |
8217 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) { | 8223 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || |
8224 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) { | ||
8218 | val &= ~(TG3_RDMA_RSRVCTRL_TXMRGN_MASK | | 8225 | val &= ~(TG3_RDMA_RSRVCTRL_TXMRGN_MASK | |
8219 | TG3_RDMA_RSRVCTRL_FIFO_LWM_MASK | | 8226 | TG3_RDMA_RSRVCTRL_FIFO_LWM_MASK | |
8220 | TG3_RDMA_RSRVCTRL_FIFO_HWM_MASK); | 8227 | TG3_RDMA_RSRVCTRL_FIFO_HWM_MASK); |
@@ -8226,7 +8233,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
8226 | val | TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX); | 8233 | val | TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX); |
8227 | } | 8234 | } |
8228 | 8235 | ||
8229 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) { | 8236 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || |
8237 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) { | ||
8230 | val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); | 8238 | val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); |
8231 | tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val | | 8239 | tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val | |
8232 | TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K | | 8240 | TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K | |
@@ -9050,7 +9058,9 @@ static bool tg3_enable_msix(struct tg3 *tp) | |||
9050 | 9058 | ||
9051 | if (tp->irq_cnt > 1) { | 9059 | if (tp->irq_cnt > 1) { |
9052 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS; | 9060 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS; |
9053 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) { | 9061 | |
9062 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
9063 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) { | ||
9054 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS; | 9064 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS; |
9055 | netif_set_real_num_tx_queues(tp->dev, tp->irq_cnt - 1); | 9065 | netif_set_real_num_tx_queues(tp->dev, tp->irq_cnt - 1); |
9056 | } | 9066 | } |
@@ -13166,7 +13176,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13166 | 13176 | ||
13167 | if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 || | 13177 | if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 || |
13168 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 || | 13178 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 || |
13169 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719) | 13179 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719 || |
13180 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5720) | ||
13170 | pci_read_config_dword(tp->pdev, | 13181 | pci_read_config_dword(tp->pdev, |
13171 | TG3PCI_GEN2_PRODID_ASICREV, | 13182 | TG3PCI_GEN2_PRODID_ASICREV, |
13172 | &prod_id_asic_rev); | 13183 | &prod_id_asic_rev); |
@@ -13321,11 +13332,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13321 | 13332 | ||
13322 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || | 13333 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || |
13323 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 || | 13334 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 || |
13324 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | 13335 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13336 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) | ||
13325 | tp->pdev_peer = tg3_find_peer(tp); | 13337 | tp->pdev_peer = tg3_find_peer(tp); |
13326 | 13338 | ||
13327 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13339 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13328 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | 13340 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || |
13341 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) | ||
13329 | tp->tg3_flags3 |= TG3_FLG3_5717_PLUS; | 13342 | tp->tg3_flags3 |= TG3_FLG3_5717_PLUS; |
13330 | 13343 | ||
13331 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 || | 13344 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 || |
@@ -13444,7 +13457,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13444 | tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS; | 13457 | tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS; |
13445 | 13458 | ||
13446 | tp->pcie_readrq = 4096; | 13459 | tp->pcie_readrq = 4096; |
13447 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | 13460 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || |
13461 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) | ||
13448 | tp->pcie_readrq = 2048; | 13462 | tp->pcie_readrq = 2048; |
13449 | 13463 | ||
13450 | pcie_set_readrq(tp->pdev, tp->pcie_readrq); | 13464 | pcie_set_readrq(tp->pdev, tp->pcie_readrq); |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index b8e6acc019b4..45605f2f7b54 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -58,6 +58,7 @@ | |||
58 | #define TG3PCI_DEVICE_TIGON3_57791 0x16b2 | 58 | #define TG3PCI_DEVICE_TIGON3_57791 0x16b2 |
59 | #define TG3PCI_DEVICE_TIGON3_57795 0x16b6 | 59 | #define TG3PCI_DEVICE_TIGON3_57795 0x16b6 |
60 | #define TG3PCI_DEVICE_TIGON3_5719 0x1657 | 60 | #define TG3PCI_DEVICE_TIGON3_5719 0x1657 |
61 | #define TG3PCI_DEVICE_TIGON3_5720 0x165f | ||
61 | /* 0x04 --> 0x2c unused */ | 62 | /* 0x04 --> 0x2c unused */ |
62 | #define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM | 63 | #define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM |
63 | #define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644 | 64 | #define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644 |
@@ -167,6 +168,7 @@ | |||
167 | #define ASIC_REV_5717 0x5717 | 168 | #define ASIC_REV_5717 0x5717 |
168 | #define ASIC_REV_57765 0x57785 | 169 | #define ASIC_REV_57765 0x57785 |
169 | #define ASIC_REV_5719 0x5719 | 170 | #define ASIC_REV_5719 0x5719 |
171 | #define ASIC_REV_5720 0x5720 | ||
170 | #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) | 172 | #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) |
171 | #define CHIPREV_5700_AX 0x70 | 173 | #define CHIPREV_5700_AX 0x70 |
172 | #define CHIPREV_5700_BX 0x71 | 174 | #define CHIPREV_5700_BX 0x71 |
@@ -1083,6 +1085,9 @@ | |||
1083 | #define CPMU_HST_ACC_MACCLK_6_25 0x00130000 | 1085 | #define CPMU_HST_ACC_MACCLK_6_25 0x00130000 |
1084 | /* 0x3620 --> 0x3630 unused */ | 1086 | /* 0x3620 --> 0x3630 unused */ |
1085 | 1087 | ||
1088 | #define TG3_CPMU_CLCK_ORIDE 0x00003624 | ||
1089 | #define CPMU_CLCK_ORIDE_MAC_ORIDE_EN 0x80000000 | ||
1090 | |||
1086 | #define TG3_CPMU_CLCK_STAT 0x00003630 | 1091 | #define TG3_CPMU_CLCK_STAT 0x00003630 |
1087 | #define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000 | 1092 | #define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000 |
1088 | #define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 | 1093 | #define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 |