diff options
author | Barak Witkowski <barak@broadcom.com> | 2012-04-03 14:41:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-04 01:37:59 -0400 |
commit | 7e8e02df17106007f4b043a39d22682f74df6f6f (patch) | |
tree | eaecf5d8ac7cba75350c5717ef2511f1abfb446d | |
parent | 55098c5c61ea99f0fa46ddf817a0f940ca7e6af1 (diff) |
bnx2x: Added support for a new device - 57811
Notice this patch includes lines with over 80 characters, as to not
break strings.
Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 30 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 5 |
3 files changed, 38 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index d9ecc67afa75..992ddd3ecadd 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -815,6 +815,8 @@ struct bnx2x_common { | |||
815 | #define CHIP_NUM_57800_MF 0x16a5 | 815 | #define CHIP_NUM_57800_MF 0x16a5 |
816 | #define CHIP_NUM_57810 0x168e | 816 | #define CHIP_NUM_57810 0x168e |
817 | #define CHIP_NUM_57810_MF 0x16ae | 817 | #define CHIP_NUM_57810_MF 0x16ae |
818 | #define CHIP_NUM_57811 0x163d | ||
819 | #define CHIP_NUM_57811_MF 0x163e | ||
818 | #define CHIP_NUM_57840 0x168d | 820 | #define CHIP_NUM_57840 0x168d |
819 | #define CHIP_NUM_57840_MF 0x16ab | 821 | #define CHIP_NUM_57840_MF 0x16ab |
820 | #define CHIP_IS_E1(bp) (CHIP_NUM(bp) == CHIP_NUM_57710) | 822 | #define CHIP_IS_E1(bp) (CHIP_NUM(bp) == CHIP_NUM_57710) |
@@ -826,6 +828,8 @@ struct bnx2x_common { | |||
826 | #define CHIP_IS_57800_MF(bp) (CHIP_NUM(bp) == CHIP_NUM_57800_MF) | 828 | #define CHIP_IS_57800_MF(bp) (CHIP_NUM(bp) == CHIP_NUM_57800_MF) |
827 | #define CHIP_IS_57810(bp) (CHIP_NUM(bp) == CHIP_NUM_57810) | 829 | #define CHIP_IS_57810(bp) (CHIP_NUM(bp) == CHIP_NUM_57810) |
828 | #define CHIP_IS_57810_MF(bp) (CHIP_NUM(bp) == CHIP_NUM_57810_MF) | 830 | #define CHIP_IS_57810_MF(bp) (CHIP_NUM(bp) == CHIP_NUM_57810_MF) |
831 | #define CHIP_IS_57811(bp) (CHIP_NUM(bp) == CHIP_NUM_57811) | ||
832 | #define CHIP_IS_57811_MF(bp) (CHIP_NUM(bp) == CHIP_NUM_57811_MF) | ||
829 | #define CHIP_IS_57840(bp) (CHIP_NUM(bp) == CHIP_NUM_57840) | 833 | #define CHIP_IS_57840(bp) (CHIP_NUM(bp) == CHIP_NUM_57840) |
830 | #define CHIP_IS_57840_MF(bp) (CHIP_NUM(bp) == CHIP_NUM_57840_MF) | 834 | #define CHIP_IS_57840_MF(bp) (CHIP_NUM(bp) == CHIP_NUM_57840_MF) |
831 | #define CHIP_IS_E1H(bp) (CHIP_IS_57711(bp) || \ | 835 | #define CHIP_IS_E1H(bp) (CHIP_IS_57711(bp) || \ |
@@ -836,6 +840,8 @@ struct bnx2x_common { | |||
836 | CHIP_IS_57800_MF(bp) || \ | 840 | CHIP_IS_57800_MF(bp) || \ |
837 | CHIP_IS_57810(bp) || \ | 841 | CHIP_IS_57810(bp) || \ |
838 | CHIP_IS_57810_MF(bp) || \ | 842 | CHIP_IS_57810_MF(bp) || \ |
843 | CHIP_IS_57811(bp) || \ | ||
844 | CHIP_IS_57811_MF(bp) || \ | ||
839 | CHIP_IS_57840(bp) || \ | 845 | CHIP_IS_57840(bp) || \ |
840 | CHIP_IS_57840_MF(bp)) | 846 | CHIP_IS_57840_MF(bp)) |
841 | #define CHIP_IS_E1x(bp) (CHIP_IS_E1((bp)) || CHIP_IS_E1H((bp))) | 847 | #define CHIP_IS_E1x(bp) (CHIP_IS_E1((bp)) || CHIP_IS_E1H((bp))) |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 7b7a36671fa2..bca99b20206c 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -140,7 +140,9 @@ enum bnx2x_board_type { | |||
140 | BCM57810, | 140 | BCM57810, |
141 | BCM57810_MF, | 141 | BCM57810_MF, |
142 | BCM57840, | 142 | BCM57840, |
143 | BCM57840_MF | 143 | BCM57840_MF, |
144 | BCM57811, | ||
145 | BCM57811_MF | ||
144 | }; | 146 | }; |
145 | 147 | ||
146 | /* indexed by board_type, above */ | 148 | /* indexed by board_type, above */ |
@@ -157,8 +159,9 @@ static struct { | |||
157 | { "Broadcom NetXtreme II BCM57810 10 Gigabit Ethernet" }, | 159 | { "Broadcom NetXtreme II BCM57810 10 Gigabit Ethernet" }, |
158 | { "Broadcom NetXtreme II BCM57810 10 Gigabit Ethernet Multi Function" }, | 160 | { "Broadcom NetXtreme II BCM57810 10 Gigabit Ethernet Multi Function" }, |
159 | { "Broadcom NetXtreme II BCM57840 10/20 Gigabit Ethernet" }, | 161 | { "Broadcom NetXtreme II BCM57840 10/20 Gigabit Ethernet" }, |
160 | { "Broadcom NetXtreme II BCM57840 10/20 Gigabit " | 162 | { "Broadcom NetXtreme II BCM57840 10/20 Gigabit Ethernet Multi Function"}, |
161 | "Ethernet Multi Function"} | 163 | { "Broadcom NetXtreme II BCM57811 10 Gigabit Ethernet"}, |
164 | { "Broadcom NetXtreme II BCM57811 10 Gigabit Ethernet Multi Function"}, | ||
162 | }; | 165 | }; |
163 | 166 | ||
164 | #ifndef PCI_DEVICE_ID_NX2_57710 | 167 | #ifndef PCI_DEVICE_ID_NX2_57710 |
@@ -194,6 +197,12 @@ static struct { | |||
194 | #ifndef PCI_DEVICE_ID_NX2_57840_MF | 197 | #ifndef PCI_DEVICE_ID_NX2_57840_MF |
195 | #define PCI_DEVICE_ID_NX2_57840_MF CHIP_NUM_57840_MF | 198 | #define PCI_DEVICE_ID_NX2_57840_MF CHIP_NUM_57840_MF |
196 | #endif | 199 | #endif |
200 | #ifndef PCI_DEVICE_ID_NX2_57811 | ||
201 | #define PCI_DEVICE_ID_NX2_57811 CHIP_NUM_57811 | ||
202 | #endif | ||
203 | #ifndef PCI_DEVICE_ID_NX2_57811_MF | ||
204 | #define PCI_DEVICE_ID_NX2_57811_MF CHIP_NUM_57811_MF | ||
205 | #endif | ||
197 | static DEFINE_PCI_DEVICE_TABLE(bnx2x_pci_tbl) = { | 206 | static DEFINE_PCI_DEVICE_TABLE(bnx2x_pci_tbl) = { |
198 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57710), BCM57710 }, | 207 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57710), BCM57710 }, |
199 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57711), BCM57711 }, | 208 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57711), BCM57711 }, |
@@ -206,6 +215,8 @@ static DEFINE_PCI_DEVICE_TABLE(bnx2x_pci_tbl) = { | |||
206 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57810_MF), BCM57810_MF }, | 215 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57810_MF), BCM57810_MF }, |
207 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57840), BCM57840 }, | 216 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57840), BCM57840 }, |
208 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57840_MF), BCM57840_MF }, | 217 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57840_MF), BCM57840_MF }, |
218 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57811), BCM57811 }, | ||
219 | { PCI_VDEVICE(BROADCOM, PCI_DEVICE_ID_NX2_57811_MF), BCM57811_MF }, | ||
209 | { 0 } | 220 | { 0 } |
210 | }; | 221 | }; |
211 | 222 | ||
@@ -9126,6 +9137,17 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) | |||
9126 | id |= (val & 0xf); | 9137 | id |= (val & 0xf); |
9127 | bp->common.chip_id = id; | 9138 | bp->common.chip_id = id; |
9128 | 9139 | ||
9140 | /* force 57811 according to MISC register */ | ||
9141 | if (REG_RD(bp, MISC_REG_CHIP_TYPE) & MISC_REG_CHIP_TYPE_57811_MASK) { | ||
9142 | if (CHIP_IS_57810(bp)) | ||
9143 | bp->common.chip_id = (CHIP_NUM_57811 << 16) | | ||
9144 | (bp->common.chip_id & 0x0000FFFF); | ||
9145 | else if (CHIP_IS_57810_MF(bp)) | ||
9146 | bp->common.chip_id = (CHIP_NUM_57811_MF << 16) | | ||
9147 | (bp->common.chip_id & 0x0000FFFF); | ||
9148 | bp->common.chip_id |= 0x1; | ||
9149 | } | ||
9150 | |||
9129 | /* Set doorbell size */ | 9151 | /* Set doorbell size */ |
9130 | bp->db_size = (1 << BNX2X_DB_SHIFT); | 9152 | bp->db_size = (1 << BNX2X_DB_SHIFT); |
9131 | 9153 | ||
@@ -11250,6 +11272,8 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
11250 | case BCM57810_MF: | 11272 | case BCM57810_MF: |
11251 | case BCM57840: | 11273 | case BCM57840: |
11252 | case BCM57840_MF: | 11274 | case BCM57840_MF: |
11275 | case BCM57811: | ||
11276 | case BCM57811_MF: | ||
11253 | max_cos_est = BNX2X_MULTI_TX_COS_E3B0; | 11277 | max_cos_est = BNX2X_MULTI_TX_COS_E3B0; |
11254 | break; | 11278 | break; |
11255 | 11279 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h index ab0a250f95fa..4532172c9fd6 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | |||
@@ -1483,6 +1483,11 @@ | |||
1483 | starts at 0x0 for the A0 tape-out and increments by one for each | 1483 | starts at 0x0 for the A0 tape-out and increments by one for each |
1484 | all-layer tape-out. */ | 1484 | all-layer tape-out. */ |
1485 | #define MISC_REG_CHIP_REV 0xa40c | 1485 | #define MISC_REG_CHIP_REV 0xa40c |
1486 | /* [R 14] otp_misc_do[100:0] spare bits collection: 13:11- | ||
1487 | * otp_misc_do[100:98]; 10:7 - otp_misc_do[87:84]; 6:3 - otp_misc_do[75:72]; | ||
1488 | * 2:1 - otp_misc_do[51:50]; 0 - otp_misc_do[1]. */ | ||
1489 | #define MISC_REG_CHIP_TYPE 0xac60 | ||
1490 | #define MISC_REG_CHIP_TYPE_57811_MASK (1<<1) | ||
1486 | /* [RW 32] The following driver registers(1...16) represent 16 drivers and | 1491 | /* [RW 32] The following driver registers(1...16) represent 16 drivers and |
1487 | 32 clients. Each client can be controlled by one driver only. One in each | 1492 | 32 clients. Each client can be controlled by one driver only. One in each |
1488 | bit represent that this driver control the appropriate client (Ex: bit 5 | 1493 | bit represent that this driver control the appropriate client (Ex: bit 5 |