aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2010-10-11 19:12:00 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-11 19:12:00 -0400
commit22fa159d37efbfe781bbb99279efe83f58b87d29 (patch)
tree2778781f91b36cd690700db059ae54b541bcec87 /drivers/net/bnx2.c
parente37ef961e50d74f55e9edb48e54dd2e7963aad39 (diff)
bnx2: Update firmware to 6.0.x.
- Improved flow control and simplified interface - Use hardware RSS indirection table instead of the slower firmware- based table - Lower latency interrupt on 5709 Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c65
1 files changed, 25 insertions, 40 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index b10be27f340a..56f3dfe70038 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -61,11 +61,11 @@
61#define DRV_MODULE_NAME "bnx2" 61#define DRV_MODULE_NAME "bnx2"
62#define DRV_MODULE_VERSION "2.0.17" 62#define DRV_MODULE_VERSION "2.0.17"
63#define DRV_MODULE_RELDATE "July 18, 2010" 63#define DRV_MODULE_RELDATE "July 18, 2010"
64#define FW_MIPS_FILE_06 "bnx2/bnx2-mips-06-5.0.0.j6.fw" 64#define FW_MIPS_FILE_06 "bnx2/bnx2-mips-06-6.0.15.fw"
65#define FW_RV2P_FILE_06 "bnx2/bnx2-rv2p-06-5.0.0.j3.fw" 65#define FW_RV2P_FILE_06 "bnx2/bnx2-rv2p-06-6.0.15.fw"
66#define FW_MIPS_FILE_09 "bnx2/bnx2-mips-09-5.0.0.j15.fw" 66#define FW_MIPS_FILE_09 "bnx2/bnx2-mips-09-6.0.17.fw"
67#define FW_RV2P_FILE_09_Ax "bnx2/bnx2-rv2p-09ax-5.0.0.j10.fw" 67#define FW_RV2P_FILE_09_Ax "bnx2/bnx2-rv2p-09ax-6.0.17.fw"
68#define FW_RV2P_FILE_09 "bnx2/bnx2-rv2p-09-5.0.0.j10.fw" 68#define FW_RV2P_FILE_09 "bnx2/bnx2-rv2p-09-6.0.17.fw"
69 69
70#define RUN_AT(x) (jiffies + (x)) 70#define RUN_AT(x) (jiffies + (x))
71 71
@@ -1269,30 +1269,9 @@ bnx2_init_rx_context(struct bnx2 *bp, u32 cid)
1269 val |= BNX2_L2CTX_CTX_TYPE_SIZE_L2; 1269 val |= BNX2_L2CTX_CTX_TYPE_SIZE_L2;
1270 val |= 0x02 << 8; 1270 val |= 0x02 << 8;
1271 1271
1272 if (CHIP_NUM(bp) == CHIP_NUM_5709) { 1272 if (bp->flow_ctrl & FLOW_CTRL_TX)
1273 u32 lo_water, hi_water; 1273 val |= BNX2_L2CTX_FLOW_CTRL_ENABLE;
1274
1275 if (bp->flow_ctrl & FLOW_CTRL_TX)
1276 lo_water = BNX2_L2CTX_LO_WATER_MARK_DEFAULT;
1277 else
1278 lo_water = BNX2_L2CTX_LO_WATER_MARK_DIS;
1279 if (lo_water >= bp->rx_ring_size)
1280 lo_water = 0;
1281
1282 hi_water = min_t(int, bp->rx_ring_size / 4, lo_water + 16);
1283
1284 if (hi_water <= lo_water)
1285 lo_water = 0;
1286
1287 hi_water /= BNX2_L2CTX_HI_WATER_MARK_SCALE;
1288 lo_water /= BNX2_L2CTX_LO_WATER_MARK_SCALE;
1289 1274
1290 if (hi_water > 0xf)
1291 hi_water = 0xf;
1292 else if (hi_water == 0)
1293 lo_water = 0;
1294 val |= lo_water | (hi_water << BNX2_L2CTX_HI_WATER_MARK_SHIFT);
1295 }
1296 bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_CTX_TYPE, val); 1275 bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_CTX_TYPE, val);
1297} 1276}
1298 1277
@@ -1373,8 +1352,7 @@ bnx2_set_mac_link(struct bnx2 *bp)
1373 /* Acknowledge the interrupt. */ 1352 /* Acknowledge the interrupt. */
1374 REG_WR(bp, BNX2_EMAC_STATUS, BNX2_EMAC_STATUS_LINK_CHANGE); 1353 REG_WR(bp, BNX2_EMAC_STATUS, BNX2_EMAC_STATUS_LINK_CHANGE);
1375 1354
1376 if (CHIP_NUM(bp) == CHIP_NUM_5709) 1355 bnx2_init_all_rx_contexts(bp);
1377 bnx2_init_all_rx_contexts(bp);
1378} 1356}
1379 1357
1380static void 1358static void
@@ -4974,6 +4952,11 @@ bnx2_init_chip(struct bnx2 *bp)
4974 4952
4975 REG_WR(bp, BNX2_HC_CONFIG, val); 4953 REG_WR(bp, BNX2_HC_CONFIG, val);
4976 4954
4955 if (bp->rx_ticks < 25)
4956 bnx2_reg_wr_ind(bp, BNX2_FW_RX_LOW_LATENCY, 1);
4957 else
4958 bnx2_reg_wr_ind(bp, BNX2_FW_RX_LOW_LATENCY, 0);
4959
4977 for (i = 1; i < bp->irq_nvecs; i++) { 4960 for (i = 1; i < bp->irq_nvecs; i++) {
4978 u32 base = ((i - 1) * BNX2_HC_SB_CONFIG_SIZE) + 4961 u32 base = ((i - 1) * BNX2_HC_SB_CONFIG_SIZE) +
4979 BNX2_HC_SB_CONFIG_1; 4962 BNX2_HC_SB_CONFIG_1;
@@ -5242,18 +5225,20 @@ bnx2_init_all_rings(struct bnx2 *bp)
5242 bnx2_init_rx_ring(bp, i); 5225 bnx2_init_rx_ring(bp, i);
5243 5226
5244 if (bp->num_rx_rings > 1) { 5227 if (bp->num_rx_rings > 1) {
5245 u32 tbl_32; 5228 u32 tbl_32 = 0;
5246 u8 *tbl = (u8 *) &tbl_32;
5247
5248 bnx2_reg_wr_ind(bp, BNX2_RXP_SCRATCH_RSS_TBL_SZ,
5249 BNX2_RXP_SCRATCH_RSS_TBL_MAX_ENTRIES);
5250 5229
5251 for (i = 0; i < BNX2_RXP_SCRATCH_RSS_TBL_MAX_ENTRIES; i++) { 5230 for (i = 0; i < BNX2_RXP_SCRATCH_RSS_TBL_MAX_ENTRIES; i++) {
5252 tbl[i % 4] = i % (bp->num_rx_rings - 1); 5231 int shift = (i % 8) << 2;
5253 if ((i % 4) == 3) 5232
5254 bnx2_reg_wr_ind(bp, 5233 tbl_32 |= (i % (bp->num_rx_rings - 1)) << shift;
5255 BNX2_RXP_SCRATCH_RSS_TBL + i, 5234 if ((i % 8) == 7) {
5256 cpu_to_be32(tbl_32)); 5235 REG_WR(bp, BNX2_RLUP_RSS_DATA, tbl_32);
5236 REG_WR(bp, BNX2_RLUP_RSS_COMMAND, (i >> 3) |
5237 BNX2_RLUP_RSS_COMMAND_RSS_WRITE_MASK |
5238 BNX2_RLUP_RSS_COMMAND_WRITE |
5239 BNX2_RLUP_RSS_COMMAND_HASH_MASK);
5240 tbl_32 = 0;
5241 }
5257 } 5242 }
5258 5243
5259 val = BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_ALL_XI | 5244 val = BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_ALL_XI |