aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-12-17 21:47:31 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:22 -0500
commitb881955b7d045e7486e9af08398242aeb7199f67 (patch)
treefadf96f161a8a03bd285c4b63140407ab5f527d9 /drivers
parent06daa168b681797c91ce1fd567d706b9b84738e2 (diff)
cxgb3 - parity initialization for T3C adapters.
Add parity initialization for T3C adapters. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/cxgb3/adapter.h1
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c82
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c15
-rw-r--r--drivers/net/cxgb3/regs.h248
-rw-r--r--drivers/net/cxgb3/sge.c24
-rw-r--r--drivers/net/cxgb3/t3_hw.c131
6 files changed, 472 insertions, 29 deletions
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index 60a62f510db7..eb305a0895fc 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -71,6 +71,7 @@ enum { /* adapter flags */
71 USING_MSI = (1 << 1), 71 USING_MSI = (1 << 1),
72 USING_MSIX = (1 << 2), 72 USING_MSIX = (1 << 2),
73 QUEUES_BOUND = (1 << 3), 73 QUEUES_BOUND = (1 << 3),
74 TP_PARITY_INIT = (1 << 4),
74}; 75};
75 76
76struct fl_pg_chunk { 77struct fl_pg_chunk {
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 944423c497d2..d1aa7779796e 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -306,6 +306,77 @@ static int request_msix_data_irqs(struct adapter *adap)
306 return 0; 306 return 0;
307} 307}
308 308
309static int await_mgmt_replies(struct adapter *adap, unsigned long init_cnt,
310 unsigned long n)
311{
312 int attempts = 5;
313
314 while (adap->sge.qs[0].rspq.offload_pkts < init_cnt + n) {
315 if (!--attempts)
316 return -ETIMEDOUT;
317 msleep(10);
318 }
319 return 0;
320}
321
322static int init_tp_parity(struct adapter *adap)
323{
324 int i;
325 struct sk_buff *skb;
326 struct cpl_set_tcb_field *greq;
327 unsigned long cnt = adap->sge.qs[0].rspq.offload_pkts;
328
329 t3_tp_set_offload_mode(adap, 1);
330
331 for (i = 0; i < 16; i++) {
332 struct cpl_smt_write_req *req;
333
334 skb = alloc_skb(sizeof(*req), GFP_KERNEL | __GFP_NOFAIL);
335 req = (struct cpl_smt_write_req *)__skb_put(skb, sizeof(*req));
336 memset(req, 0, sizeof(*req));
337 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
338 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, i));
339 req->iff = i;
340 t3_mgmt_tx(adap, skb);
341 }
342
343 for (i = 0; i < 2048; i++) {
344 struct cpl_l2t_write_req *req;
345
346 skb = alloc_skb(sizeof(*req), GFP_KERNEL | __GFP_NOFAIL);
347 req = (struct cpl_l2t_write_req *)__skb_put(skb, sizeof(*req));
348 memset(req, 0, sizeof(*req));
349 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
350 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, i));
351 req->params = htonl(V_L2T_W_IDX(i));
352 t3_mgmt_tx(adap, skb);
353 }
354
355 for (i = 0; i < 2048; i++) {
356 struct cpl_rte_write_req *req;
357
358 skb = alloc_skb(sizeof(*req), GFP_KERNEL | __GFP_NOFAIL);
359 req = (struct cpl_rte_write_req *)__skb_put(skb, sizeof(*req));
360 memset(req, 0, sizeof(*req));
361 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
362 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RTE_WRITE_REQ, i));
363 req->l2t_idx = htonl(V_L2T_W_IDX(i));
364 t3_mgmt_tx(adap, skb);
365 }
366
367 skb = alloc_skb(sizeof(*greq), GFP_KERNEL | __GFP_NOFAIL);
368 greq = (struct cpl_set_tcb_field *)__skb_put(skb, sizeof(*greq));
369 memset(greq, 0, sizeof(*greq));
370 greq->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
371 OPCODE_TID(greq) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, 0));
372 greq->mask = cpu_to_be64(1);
373 t3_mgmt_tx(adap, skb);
374
375 i = await_mgmt_replies(adap, cnt, 16 + 2048 + 2048 + 1);
376 t3_tp_set_offload_mode(adap, 0);
377 return i;
378}
379
309/** 380/**
310 * setup_rss - configure RSS 381 * setup_rss - configure RSS
311 * @adap: the adapter 382 * @adap: the adapter
@@ -817,6 +888,7 @@ static int cxgb_up(struct adapter *adap)
817 if (err) 888 if (err)
818 goto out; 889 goto out;
819 890
891 t3_set_reg_field(adap, A_TP_PARA_REG5, 0, F_RXDDPOFFINIT);
820 t3_write_reg(adap, A_ULPRX_TDDP_PSZ, V_HPZ0(PAGE_SHIFT - 12)); 892 t3_write_reg(adap, A_ULPRX_TDDP_PSZ, V_HPZ0(PAGE_SHIFT - 12));
821 893
822 err = setup_sge_qsets(adap); 894 err = setup_sge_qsets(adap);
@@ -856,6 +928,16 @@ static int cxgb_up(struct adapter *adap)
856 t3_sge_start(adap); 928 t3_sge_start(adap);
857 t3_intr_enable(adap); 929 t3_intr_enable(adap);
858 930
931 if (adap->params.rev >= T3_REV_C && !(adap->flags & TP_PARITY_INIT) &&
932 is_offload(adap) && init_tp_parity(adap) == 0)
933 adap->flags |= TP_PARITY_INIT;
934
935 if (adap->flags & TP_PARITY_INIT) {
936 t3_write_reg(adap, A_TP_INT_CAUSE,
937 F_CMCACHEPERR | F_ARPLUTPERR);
938 t3_write_reg(adap, A_TP_INT_ENABLE, 0x7fbfffff);
939 }
940
859 if ((adap->flags & (USING_MSIX | QUEUES_BOUND)) == USING_MSIX) 941 if ((adap->flags & (USING_MSIX | QUEUES_BOUND)) == USING_MSIX)
860 bind_qsets(adap); 942 bind_qsets(adap);
861 adap->flags |= QUEUES_BOUND; 943 adap->flags |= QUEUES_BOUND;
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index 7e5892f1a9db..d48c396bdabb 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -403,8 +403,6 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
403static int rx_offload_blackhole(struct t3cdev *dev, struct sk_buff **skbs, 403static int rx_offload_blackhole(struct t3cdev *dev, struct sk_buff **skbs,
404 int n) 404 int n)
405{ 405{
406 CH_ERR(tdev2adap(dev), "%d unexpected offload packets, first data %u\n",
407 n, ntohl(*(__be32 *)skbs[0]->data));
408 while (n--) 406 while (n--)
409 dev_kfree_skb_any(skbs[n]); 407 dev_kfree_skb_any(skbs[n]);
410 return 0; 408 return 0;
@@ -634,6 +632,18 @@ static int do_l2t_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
634 return CPL_RET_BUF_DONE; 632 return CPL_RET_BUF_DONE;
635} 633}
636 634
635static int do_rte_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
636{
637 struct cpl_rte_write_rpl *rpl = cplhdr(skb);
638
639 if (rpl->status != CPL_ERR_NONE)
640 printk(KERN_ERR
641 "Unexpected RTE_WRITE_RPL status %u for entry %u\n",
642 rpl->status, GET_TID(rpl));
643
644 return CPL_RET_BUF_DONE;
645}
646
637static int do_act_open_rpl(struct t3cdev *dev, struct sk_buff *skb) 647static int do_act_open_rpl(struct t3cdev *dev, struct sk_buff *skb)
638{ 648{
639 struct cpl_act_open_rpl *rpl = cplhdr(skb); 649 struct cpl_act_open_rpl *rpl = cplhdr(skb);
@@ -1257,6 +1267,7 @@ void __init cxgb3_offload_init(void)
1257 1267
1258 t3_register_cpl_handler(CPL_SMT_WRITE_RPL, do_smt_write_rpl); 1268 t3_register_cpl_handler(CPL_SMT_WRITE_RPL, do_smt_write_rpl);
1259 t3_register_cpl_handler(CPL_L2T_WRITE_RPL, do_l2t_write_rpl); 1269 t3_register_cpl_handler(CPL_L2T_WRITE_RPL, do_l2t_write_rpl);
1270 t3_register_cpl_handler(CPL_RTE_WRITE_RPL, do_rte_write_rpl);
1260 t3_register_cpl_handler(CPL_PASS_OPEN_RPL, do_stid_rpl); 1271 t3_register_cpl_handler(CPL_PASS_OPEN_RPL, do_stid_rpl);
1261 t3_register_cpl_handler(CPL_CLOSE_LISTSRV_RPL, do_stid_rpl); 1272 t3_register_cpl_handler(CPL_CLOSE_LISTSRV_RPL, do_stid_rpl);
1262 t3_register_cpl_handler(CPL_PASS_ACCEPT_REQ, do_cr); 1273 t3_register_cpl_handler(CPL_PASS_ACCEPT_REQ, do_cr);
diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index 70e1961acee1..02dbbb300929 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -1,5 +1,17 @@
1#define A_SG_CONTROL 0x0 1#define A_SG_CONTROL 0x0
2 2
3#define S_CONGMODE 29
4#define V_CONGMODE(x) ((x) << S_CONGMODE)
5#define F_CONGMODE V_CONGMODE(1U)
6
7#define S_TNLFLMODE 28
8#define V_TNLFLMODE(x) ((x) << S_TNLFLMODE)
9#define F_TNLFLMODE V_TNLFLMODE(1U)
10
11#define S_FATLPERREN 27
12#define V_FATLPERREN(x) ((x) << S_FATLPERREN)
13#define F_FATLPERREN V_FATLPERREN(1U)
14
3#define S_DROPPKT 20 15#define S_DROPPKT 20
4#define V_DROPPKT(x) ((x) << S_DROPPKT) 16#define V_DROPPKT(x) ((x) << S_DROPPKT)
5#define F_DROPPKT V_DROPPKT(1U) 17#define F_DROPPKT V_DROPPKT(1U)
@@ -172,6 +184,64 @@
172 184
173#define A_SG_INT_CAUSE 0x5c 185#define A_SG_INT_CAUSE 0x5c
174 186
187#define S_HIRCQPARITYERROR 31
188#define V_HIRCQPARITYERROR(x) ((x) << S_HIRCQPARITYERROR)
189#define F_HIRCQPARITYERROR V_HIRCQPARITYERROR(1U)
190
191#define S_LORCQPARITYERROR 30
192#define V_LORCQPARITYERROR(x) ((x) << S_LORCQPARITYERROR)
193#define F_LORCQPARITYERROR V_LORCQPARITYERROR(1U)
194
195#define S_HIDRBPARITYERROR 29
196#define V_HIDRBPARITYERROR(x) ((x) << S_HIDRBPARITYERROR)
197#define F_HIDRBPARITYERROR V_HIDRBPARITYERROR(1U)
198
199#define S_LODRBPARITYERROR 28
200#define V_LODRBPARITYERROR(x) ((x) << S_LODRBPARITYERROR)
201#define F_LODRBPARITYERROR V_LODRBPARITYERROR(1U)
202
203#define S_FLPARITYERROR 22
204#define M_FLPARITYERROR 0x3f
205#define V_FLPARITYERROR(x) ((x) << S_FLPARITYERROR)
206#define G_FLPARITYERROR(x) (((x) >> S_FLPARITYERROR) & M_FLPARITYERROR)
207
208#define S_ITPARITYERROR 20
209#define M_ITPARITYERROR 0x3
210#define V_ITPARITYERROR(x) ((x) << S_ITPARITYERROR)
211#define G_ITPARITYERROR(x) (((x) >> S_ITPARITYERROR) & M_ITPARITYERROR)
212
213#define S_IRPARITYERROR 19
214#define V_IRPARITYERROR(x) ((x) << S_IRPARITYERROR)
215#define F_IRPARITYERROR V_IRPARITYERROR(1U)
216
217#define S_RCPARITYERROR 18
218#define V_RCPARITYERROR(x) ((x) << S_RCPARITYERROR)
219#define F_RCPARITYERROR V_RCPARITYERROR(1U)
220
221#define S_OCPARITYERROR 17
222#define V_OCPARITYERROR(x) ((x) << S_OCPARITYERROR)
223#define F_OCPARITYERROR V_OCPARITYERROR(1U)
224
225#define S_CPPARITYERROR 16
226#define V_CPPARITYERROR(x) ((x) << S_CPPARITYERROR)
227#define F_CPPARITYERROR V_CPPARITYERROR(1U)
228
229#define S_R_REQ_FRAMINGERROR 15
230#define V_R_REQ_FRAMINGERROR(x) ((x) << S_R_REQ_FRAMINGERROR)
231#define F_R_REQ_FRAMINGERROR V_R_REQ_FRAMINGERROR(1U)
232
233#define S_UC_REQ_FRAMINGERROR 14
234#define V_UC_REQ_FRAMINGERROR(x) ((x) << S_UC_REQ_FRAMINGERROR)
235#define F_UC_REQ_FRAMINGERROR V_UC_REQ_FRAMINGERROR(1U)
236
237#define S_HICTLDRBDROPERR 13
238#define V_HICTLDRBDROPERR(x) ((x) << S_HICTLDRBDROPERR)
239#define F_HICTLDRBDROPERR V_HICTLDRBDROPERR(1U)
240
241#define S_LOCTLDRBDROPERR 12
242#define V_LOCTLDRBDROPERR(x) ((x) << S_LOCTLDRBDROPERR)
243#define F_LOCTLDRBDROPERR V_LOCTLDRBDROPERR(1U)
244
175#define S_HIPIODRBDROPERR 11 245#define S_HIPIODRBDROPERR 11
176#define V_HIPIODRBDROPERR(x) ((x) << S_HIPIODRBDROPERR) 246#define V_HIPIODRBDROPERR(x) ((x) << S_HIPIODRBDROPERR)
177#define F_HIPIODRBDROPERR V_HIPIODRBDROPERR(1U) 247#define F_HIPIODRBDROPERR V_HIPIODRBDROPERR(1U)
@@ -286,6 +356,10 @@
286 356
287#define A_PCIX_CFG 0x88 357#define A_PCIX_CFG 0x88
288 358
359#define S_DMASTOPEN 19
360#define V_DMASTOPEN(x) ((x) << S_DMASTOPEN)
361#define F_DMASTOPEN V_DMASTOPEN(1U)
362
289#define S_CLIDECEN 18 363#define S_CLIDECEN 18
290#define V_CLIDECEN(x) ((x) << S_CLIDECEN) 364#define V_CLIDECEN(x) ((x) << S_CLIDECEN)
291#define F_CLIDECEN V_CLIDECEN(1U) 365#define F_CLIDECEN V_CLIDECEN(1U)
@@ -313,6 +387,22 @@
313 387
314#define V_BISTERR(x) ((x) << S_BISTERR) 388#define V_BISTERR(x) ((x) << S_BISTERR)
315 389
390#define S_TXPARERR 18
391#define V_TXPARERR(x) ((x) << S_TXPARERR)
392#define F_TXPARERR V_TXPARERR(1U)
393
394#define S_RXPARERR 17
395#define V_RXPARERR(x) ((x) << S_RXPARERR)
396#define F_RXPARERR V_RXPARERR(1U)
397
398#define S_RETRYLUTPARERR 16
399#define V_RETRYLUTPARERR(x) ((x) << S_RETRYLUTPARERR)
400#define F_RETRYLUTPARERR V_RETRYLUTPARERR(1U)
401
402#define S_RETRYBUFPARERR 15
403#define V_RETRYBUFPARERR(x) ((x) << S_RETRYBUFPARERR)
404#define F_RETRYBUFPARERR V_RETRYBUFPARERR(1U)
405
316#define S_PCIE_MSIXPARERR 12 406#define S_PCIE_MSIXPARERR 12
317#define M_PCIE_MSIXPARERR 0x7 407#define M_PCIE_MSIXPARERR 0x7
318 408
@@ -348,6 +438,10 @@
348 438
349#define A_PCIE_INT_CAUSE 0x84 439#define A_PCIE_INT_CAUSE 0x84
350 440
441#define S_PCIE_DMASTOPEN 24
442#define V_PCIE_DMASTOPEN(x) ((x) << S_PCIE_DMASTOPEN)
443#define F_PCIE_DMASTOPEN V_PCIE_DMASTOPEN(1U)
444
351#define A_PCIE_CFG 0x88 445#define A_PCIE_CFG 0x88
352 446
353#define S_PCIE_CLIDECEN 16 447#define S_PCIE_CLIDECEN 16
@@ -741,6 +835,54 @@
741 835
742#define A_CIM_HOST_INT_ENABLE 0x298 836#define A_CIM_HOST_INT_ENABLE 0x298
743 837
838#define S_DTAGPARERR 28
839#define V_DTAGPARERR(x) ((x) << S_DTAGPARERR)
840#define F_DTAGPARERR V_DTAGPARERR(1U)
841
842#define S_ITAGPARERR 27
843#define V_ITAGPARERR(x) ((x) << S_ITAGPARERR)
844#define F_ITAGPARERR V_ITAGPARERR(1U)
845
846#define S_IBQTPPARERR 26
847#define V_IBQTPPARERR(x) ((x) << S_IBQTPPARERR)
848#define F_IBQTPPARERR V_IBQTPPARERR(1U)
849
850#define S_IBQULPPARERR 25
851#define V_IBQULPPARERR(x) ((x) << S_IBQULPPARERR)
852#define F_IBQULPPARERR V_IBQULPPARERR(1U)
853
854#define S_IBQSGEHIPARERR 24
855#define V_IBQSGEHIPARERR(x) ((x) << S_IBQSGEHIPARERR)
856#define F_IBQSGEHIPARERR V_IBQSGEHIPARERR(1U)
857
858#define S_IBQSGELOPARERR 23
859#define V_IBQSGELOPARERR(x) ((x) << S_IBQSGELOPARERR)
860#define F_IBQSGELOPARERR V_IBQSGELOPARERR(1U)
861
862#define S_OBQULPLOPARERR 22
863#define V_OBQULPLOPARERR(x) ((x) << S_OBQULPLOPARERR)
864#define F_OBQULPLOPARERR V_OBQULPLOPARERR(1U)
865
866#define S_OBQULPHIPARERR 21
867#define V_OBQULPHIPARERR(x) ((x) << S_OBQULPHIPARERR)
868#define F_OBQULPHIPARERR V_OBQULPHIPARERR(1U)
869
870#define S_OBQSGEPARERR 20
871#define V_OBQSGEPARERR(x) ((x) << S_OBQSGEPARERR)
872#define F_OBQSGEPARERR V_OBQSGEPARERR(1U)
873
874#define S_DCACHEPARERR 19
875#define V_DCACHEPARERR(x) ((x) << S_DCACHEPARERR)
876#define F_DCACHEPARERR V_DCACHEPARERR(1U)
877
878#define S_ICACHEPARERR 18
879#define V_ICACHEPARERR(x) ((x) << S_ICACHEPARERR)
880#define F_ICACHEPARERR V_ICACHEPARERR(1U)
881
882#define S_DRAMPARERR 17
883#define V_DRAMPARERR(x) ((x) << S_DRAMPARERR)
884#define F_DRAMPARERR V_DRAMPARERR(1U)
885
744#define A_CIM_HOST_INT_CAUSE 0x29c 886#define A_CIM_HOST_INT_CAUSE 0x29c
745 887
746#define S_BLKWRPLINT 12 888#define S_BLKWRPLINT 12
@@ -799,8 +941,42 @@
799 941
800#define A_CIM_HOST_ACC_DATA 0x2b4 942#define A_CIM_HOST_ACC_DATA 0x2b4
801 943
944#define A_CIM_IBQ_DBG_CFG 0x2c0
945
946#define S_IBQDBGADDR 16
947#define M_IBQDBGADDR 0x1ff
948#define V_IBQDBGADDR(x) ((x) << S_IBQDBGADDR)
949#define G_IBQDBGADDR(x) (((x) >> S_IBQDBGADDR) & M_IBQDBGADDR)
950
951#define S_IBQDBGQID 3
952#define M_IBQDBGQID 0x3
953#define V_IBQDBGQID(x) ((x) << S_IBQDBGQID)
954#define G_IBQDBGQID(x) (((x) >> S_IBQDBGQID) & M_IBQDBGQID)
955
956#define S_IBQDBGWR 2
957#define V_IBQDBGWR(x) ((x) << S_IBQDBGWR)
958#define F_IBQDBGWR V_IBQDBGWR(1U)
959
960#define S_IBQDBGBUSY 1
961#define V_IBQDBGBUSY(x) ((x) << S_IBQDBGBUSY)
962#define F_IBQDBGBUSY V_IBQDBGBUSY(1U)
963
964#define S_IBQDBGEN 0
965#define V_IBQDBGEN(x) ((x) << S_IBQDBGEN)
966#define F_IBQDBGEN V_IBQDBGEN(1U)
967
968#define A_CIM_IBQ_DBG_DATA 0x2c8
969
802#define A_TP_IN_CONFIG 0x300 970#define A_TP_IN_CONFIG 0x300
803 971
972#define S_RXFBARBPRIO 25
973#define V_RXFBARBPRIO(x) ((x) << S_RXFBARBPRIO)
974#define F_RXFBARBPRIO V_RXFBARBPRIO(1U)
975
976#define S_TXFBARBPRIO 24
977#define V_TXFBARBPRIO(x) ((x) << S_TXFBARBPRIO)
978#define F_TXFBARBPRIO V_TXFBARBPRIO(1U)
979
804#define S_NICMODE 14 980#define S_NICMODE 14
805#define V_NICMODE(x) ((x) << S_NICMODE) 981#define V_NICMODE(x) ((x) << S_NICMODE)
806#define F_NICMODE V_NICMODE(1U) 982#define F_NICMODE V_NICMODE(1U)
@@ -973,6 +1149,22 @@
973 1149
974#define A_TP_PC_CONFIG2 0x34c 1150#define A_TP_PC_CONFIG2 0x34c
975 1151
1152#define S_DISBLEDAPARBIT0 15
1153#define V_DISBLEDAPARBIT0(x) ((x) << S_DISBLEDAPARBIT0)
1154#define F_DISBLEDAPARBIT0 V_DISBLEDAPARBIT0(1U)
1155
1156#define S_ENABLEARPMISS 13
1157#define V_ENABLEARPMISS(x) ((x) << S_ENABLEARPMISS)
1158#define F_ENABLEARPMISS V_ENABLEARPMISS(1U)
1159
1160#define S_ENABLENONOFDTNLSYN 12
1161#define V_ENABLENONOFDTNLSYN(x) ((x) << S_ENABLENONOFDTNLSYN)
1162#define F_ENABLENONOFDTNLSYN V_ENABLENONOFDTNLSYN(1U)
1163
1164#define S_ENABLEIPV6RSS 11
1165#define V_ENABLEIPV6RSS(x) ((x) << S_ENABLEIPV6RSS)
1166#define F_ENABLEIPV6RSS V_ENABLEIPV6RSS(1U)
1167
976#define S_CHDRAFULL 4 1168#define S_CHDRAFULL 4
977#define V_CHDRAFULL(x) ((x) << S_CHDRAFULL) 1169#define V_CHDRAFULL(x) ((x) << S_CHDRAFULL)
978#define F_CHDRAFULL V_CHDRAFULL(1U) 1170#define F_CHDRAFULL V_CHDRAFULL(1U)
@@ -1024,6 +1216,12 @@
1024 1216
1025#define A_TP_PARA_REG4 0x370 1217#define A_TP_PARA_REG4 0x370
1026 1218
1219#define A_TP_PARA_REG5 0x374
1220
1221#define S_RXDDPOFFINIT 3
1222#define V_RXDDPOFFINIT(x) ((x) << S_RXDDPOFFINIT)
1223#define F_RXDDPOFFINIT V_RXDDPOFFINIT(1U)
1224
1027#define A_TP_PARA_REG6 0x378 1225#define A_TP_PARA_REG6 0x378
1028 1226
1029#define S_T3A_ENABLEESND 13 1227#define S_T3A_ENABLEESND 13
@@ -1144,6 +1342,10 @@
1144#define V_TNLLKPEN(x) ((x) << S_TNLLKPEN) 1342#define V_TNLLKPEN(x) ((x) << S_TNLLKPEN)
1145#define F_TNLLKPEN V_TNLLKPEN(1U) 1343#define F_TNLLKPEN V_TNLLKPEN(1U)
1146 1344
1345#define S_RRCPLMAPEN 7
1346#define V_RRCPLMAPEN(x) ((x) << S_RRCPLMAPEN)
1347#define F_RRCPLMAPEN V_RRCPLMAPEN(1U)
1348
1147#define S_RRCPLCPUSIZE 4 1349#define S_RRCPLCPUSIZE 4
1148#define M_RRCPLCPUSIZE 0x7 1350#define M_RRCPLCPUSIZE 0x7
1149#define V_RRCPLCPUSIZE(x) ((x) << S_RRCPLCPUSIZE) 1351#define V_RRCPLCPUSIZE(x) ((x) << S_RRCPLCPUSIZE)
@@ -1216,6 +1418,14 @@
1216#define V_FLMRXFLSTEMPTY(x) ((x) << S_FLMRXFLSTEMPTY) 1418#define V_FLMRXFLSTEMPTY(x) ((x) << S_FLMRXFLSTEMPTY)
1217#define F_FLMRXFLSTEMPTY V_FLMRXFLSTEMPTY(1U) 1419#define F_FLMRXFLSTEMPTY V_FLMRXFLSTEMPTY(1U)
1218 1420
1421#define S_ARPLUTPERR 26
1422#define V_ARPLUTPERR(x) ((x) << S_ARPLUTPERR)
1423#define F_ARPLUTPERR V_ARPLUTPERR(1U)
1424
1425#define S_CMCACHEPERR 24
1426#define V_CMCACHEPERR(x) ((x) << S_CMCACHEPERR)
1427#define F_CMCACHEPERR V_CMCACHEPERR(1U)
1428
1219#define A_TP_INT_CAUSE 0x474 1429#define A_TP_INT_CAUSE 0x474
1220 1430
1221#define A_TP_TX_MOD_Q1_Q0_RATE_LIMIT 0x8 1431#define A_TP_TX_MOD_Q1_Q0_RATE_LIMIT 0x8
@@ -1259,9 +1469,37 @@
1259 1469
1260#define A_ULPRX_INT_ENABLE 0x504 1470#define A_ULPRX_INT_ENABLE 0x504
1261 1471
1262#define S_PARERR 0 1472#define S_DATASELFRAMEERR0 7
1263#define V_PARERR(x) ((x) << S_PARERR) 1473#define V_DATASELFRAMEERR0(x) ((x) << S_DATASELFRAMEERR0)
1264#define F_PARERR V_PARERR(1U) 1474#define F_DATASELFRAMEERR0 V_DATASELFRAMEERR0(1U)
1475
1476#define S_DATASELFRAMEERR1 6
1477#define V_DATASELFRAMEERR1(x) ((x) << S_DATASELFRAMEERR1)
1478#define F_DATASELFRAMEERR1 V_DATASELFRAMEERR1(1U)
1479
1480#define S_PCMDMUXPERR 5
1481#define V_PCMDMUXPERR(x) ((x) << S_PCMDMUXPERR)
1482#define F_PCMDMUXPERR V_PCMDMUXPERR(1U)
1483
1484#define S_ARBFPERR 4
1485#define V_ARBFPERR(x) ((x) << S_ARBFPERR)
1486#define F_ARBFPERR V_ARBFPERR(1U)
1487
1488#define S_ARBPF0PERR 3
1489#define V_ARBPF0PERR(x) ((x) << S_ARBPF0PERR)
1490#define F_ARBPF0PERR V_ARBPF0PERR(1U)
1491
1492#define S_ARBPF1PERR 2
1493#define V_ARBPF1PERR(x) ((x) << S_ARBPF1PERR)
1494#define F_ARBPF1PERR V_ARBPF1PERR(1U)
1495
1496#define S_PARERRPCMD 1
1497#define V_PARERRPCMD(x) ((x) << S_PARERRPCMD)
1498#define F_PARERRPCMD V_PARERRPCMD(1U)
1499
1500#define S_PARERRDATA 0
1501#define V_PARERRDATA(x) ((x) << S_PARERRDATA)
1502#define F_PARERRDATA V_PARERRDATA(1U)
1265 1503
1266#define A_ULPRX_INT_CAUSE 0x508 1504#define A_ULPRX_INT_CAUSE 0x508
1267 1505
@@ -1559,6 +1797,10 @@
1559 1797
1560#define A_CPL_INTR_ENABLE 0x650 1798#define A_CPL_INTR_ENABLE 0x650
1561 1799
1800#define S_CIM_OP_MAP_PERR 5
1801#define V_CIM_OP_MAP_PERR(x) ((x) << S_CIM_OP_MAP_PERR)
1802#define F_CIM_OP_MAP_PERR V_CIM_OP_MAP_PERR(1U)
1803
1562#define S_CIM_OVFL_ERROR 4 1804#define S_CIM_OVFL_ERROR 4
1563#define V_CIM_OVFL_ERROR(x) ((x) << S_CIM_OVFL_ERROR) 1805#define V_CIM_OVFL_ERROR(x) ((x) << S_CIM_OVFL_ERROR)
1564#define F_CIM_OVFL_ERROR V_CIM_OVFL_ERROR(1U) 1806#define F_CIM_OVFL_ERROR V_CIM_OVFL_ERROR(1U)
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 666c317dc6d6..cef153d1d32c 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -2443,6 +2443,15 @@ irq_handler_t t3_intr_handler(struct adapter *adap, int polling)
2443 return t3_intr; 2443 return t3_intr;
2444} 2444}
2445 2445
2446#define SGE_PARERR (F_CPPARITYERROR | F_OCPARITYERROR | F_RCPARITYERROR | \
2447 F_IRPARITYERROR | V_ITPARITYERROR(M_ITPARITYERROR) | \
2448 V_FLPARITYERROR(M_FLPARITYERROR) | F_LODRBPARITYERROR | \
2449 F_HIDRBPARITYERROR | F_LORCQPARITYERROR | \
2450 F_HIRCQPARITYERROR)
2451#define SGE_FRAMINGERR (F_UC_REQ_FRAMINGERROR | F_R_REQ_FRAMINGERROR)
2452#define SGE_FATALERR (SGE_PARERR | SGE_FRAMINGERR | F_RSPQCREDITOVERFOW | \
2453 F_RSPQDISABLED)
2454
2446/** 2455/**
2447 * t3_sge_err_intr_handler - SGE async event interrupt handler 2456 * t3_sge_err_intr_handler - SGE async event interrupt handler
2448 * @adapter: the adapter 2457 * @adapter: the adapter
@@ -2453,6 +2462,13 @@ void t3_sge_err_intr_handler(struct adapter *adapter)
2453{ 2462{
2454 unsigned int v, status = t3_read_reg(adapter, A_SG_INT_CAUSE); 2463 unsigned int v, status = t3_read_reg(adapter, A_SG_INT_CAUSE);
2455 2464
2465 if (status & SGE_PARERR)
2466 CH_ALERT(adapter, "SGE parity error (0x%x)\n",
2467 status & SGE_PARERR);
2468 if (status & SGE_FRAMINGERR)
2469 CH_ALERT(adapter, "SGE framing error (0x%x)\n",
2470 status & SGE_FRAMINGERR);
2471
2456 if (status & F_RSPQCREDITOVERFOW) 2472 if (status & F_RSPQCREDITOVERFOW)
2457 CH_ALERT(adapter, "SGE response queue credit overflow\n"); 2473 CH_ALERT(adapter, "SGE response queue credit overflow\n");
2458 2474
@@ -2469,7 +2485,7 @@ void t3_sge_err_intr_handler(struct adapter *adapter)
2469 status & F_HIPIODRBDROPERR ? "high" : "lo"); 2485 status & F_HIPIODRBDROPERR ? "high" : "lo");
2470 2486
2471 t3_write_reg(adapter, A_SG_INT_CAUSE, status); 2487 t3_write_reg(adapter, A_SG_INT_CAUSE, status);
2472 if (status & (F_RSPQCREDITOVERFOW | F_RSPQDISABLED)) 2488 if (status & SGE_FATALERR)
2473 t3_fatal_err(adapter); 2489 t3_fatal_err(adapter);
2474} 2490}
2475 2491
@@ -2781,7 +2797,7 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
2781 unsigned int ctrl, ups = ffs(pci_resource_len(adap->pdev, 2) >> 12); 2797 unsigned int ctrl, ups = ffs(pci_resource_len(adap->pdev, 2) >> 12);
2782 2798
2783 ctrl = F_DROPPKT | V_PKTSHIFT(2) | F_FLMODE | F_AVOIDCQOVFL | 2799 ctrl = F_DROPPKT | V_PKTSHIFT(2) | F_FLMODE | F_AVOIDCQOVFL |
2784 F_CQCRDTCTRL | 2800 F_CQCRDTCTRL | F_CONGMODE | F_TNLFLMODE | F_FATLPERREN |
2785 V_HOSTPAGESIZE(PAGE_SHIFT - 11) | F_BIGENDIANINGRESS | 2801 V_HOSTPAGESIZE(PAGE_SHIFT - 11) | F_BIGENDIANINGRESS |
2786 V_USERSPACESIZE(ups ? ups - 1 : 0) | F_ISCSICOALESCING; 2802 V_USERSPACESIZE(ups ? ups - 1 : 0) | F_ISCSICOALESCING;
2787#if SGE_NUM_GENBITS == 1 2803#if SGE_NUM_GENBITS == 1
@@ -2790,7 +2806,6 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
2790 if (adap->params.rev > 0) { 2806 if (adap->params.rev > 0) {
2791 if (!(adap->flags & (USING_MSIX | USING_MSI))) 2807 if (!(adap->flags & (USING_MSIX | USING_MSI)))
2792 ctrl |= F_ONEINTMULTQ | F_OPTONEINTMULTQ; 2808 ctrl |= F_ONEINTMULTQ | F_OPTONEINTMULTQ;
2793 ctrl |= F_CQCRDTCTRL | F_AVOIDCQOVFL;
2794 } 2809 }
2795 t3_write_reg(adap, A_SG_CONTROL, ctrl); 2810 t3_write_reg(adap, A_SG_CONTROL, ctrl);
2796 t3_write_reg(adap, A_SG_EGR_RCQ_DRB_THRSH, V_HIRCQDRBTHRSH(512) | 2811 t3_write_reg(adap, A_SG_EGR_RCQ_DRB_THRSH, V_HIRCQDRBTHRSH(512) |
@@ -2798,7 +2813,8 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
2798 t3_write_reg(adap, A_SG_TIMER_TICK, core_ticks_per_usec(adap) / 10); 2813 t3_write_reg(adap, A_SG_TIMER_TICK, core_ticks_per_usec(adap) / 10);
2799 t3_write_reg(adap, A_SG_CMDQ_CREDIT_TH, V_THRESHOLD(32) | 2814 t3_write_reg(adap, A_SG_CMDQ_CREDIT_TH, V_THRESHOLD(32) |
2800 V_TIMEOUT(200 * core_ticks_per_usec(adap))); 2815 V_TIMEOUT(200 * core_ticks_per_usec(adap)));
2801 t3_write_reg(adap, A_SG_HI_DRB_HI_THRSH, 1000); 2816 t3_write_reg(adap, A_SG_HI_DRB_HI_THRSH,
2817 adap->params.rev < T3_REV_C ? 1000 : 500);
2802 t3_write_reg(adap, A_SG_HI_DRB_LO_THRSH, 256); 2818 t3_write_reg(adap, A_SG_HI_DRB_LO_THRSH, 256);
2803 t3_write_reg(adap, A_SG_LO_DRB_HI_THRSH, 1000); 2819 t3_write_reg(adap, A_SG_LO_DRB_HI_THRSH, 1000);
2804 t3_write_reg(adap, A_SG_LO_DRB_LO_THRSH, 256); 2820 t3_write_reg(adap, A_SG_LO_DRB_LO_THRSH, 256);
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index dfdda4735bd8..6e5b4992f17e 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -62,7 +62,7 @@ int t3_wait_op_done_val(struct adapter *adapter, int reg, u32 mask,
62 return 0; 62 return 0;
63 } 63 }
64 if (--attempts == 0) 64 if (--attempts == 0)
65 return -EAGAIN; 65 return -EAGAIN;
66 if (delay) 66 if (delay)
67 udelay(delay); 67 udelay(delay);
68 } 68 }
@@ -1263,7 +1263,13 @@ static int t3_handle_intr_status(struct adapter *adapter, unsigned int reg,
1263 return fatal; 1263 return fatal;
1264} 1264}
1265 1265
1266#define SGE_INTR_MASK (F_RSPQDISABLED) 1266#define SGE_INTR_MASK (F_RSPQDISABLED | \
1267 F_UC_REQ_FRAMINGERROR | F_R_REQ_FRAMINGERROR | \
1268 F_CPPARITYERROR | F_OCPARITYERROR | F_RCPARITYERROR | \
1269 F_IRPARITYERROR | V_ITPARITYERROR(M_ITPARITYERROR) | \
1270 V_FLPARITYERROR(M_FLPARITYERROR) | F_LODRBPARITYERROR | \
1271 F_HIDRBPARITYERROR | F_LORCQPARITYERROR | \
1272 F_HIRCQPARITYERROR)
1267#define MC5_INTR_MASK (F_PARITYERR | F_ACTRGNFULL | F_UNKNOWNCMD | \ 1273#define MC5_INTR_MASK (F_PARITYERR | F_ACTRGNFULL | F_UNKNOWNCMD | \
1268 F_REQQPARERR | F_DISPQPARERR | F_DELACTEMPTY | \ 1274 F_REQQPARERR | F_DISPQPARERR | F_DELACTEMPTY | \
1269 F_NFASRCHFAIL) 1275 F_NFASRCHFAIL)
@@ -1280,16 +1286,23 @@ static int t3_handle_intr_status(struct adapter *adapter, unsigned int reg,
1280#define PCIE_INTR_MASK (F_UNXSPLCPLERRR | F_UNXSPLCPLERRC | F_PCIE_PIOPARERR |\ 1286#define PCIE_INTR_MASK (F_UNXSPLCPLERRR | F_UNXSPLCPLERRC | F_PCIE_PIOPARERR |\
1281 F_PCIE_WFPARERR | F_PCIE_RFPARERR | F_PCIE_CFPARERR | \ 1287 F_PCIE_WFPARERR | F_PCIE_RFPARERR | F_PCIE_CFPARERR | \
1282 /* V_PCIE_MSIXPARERR(M_PCIE_MSIXPARERR) | */ \ 1288 /* V_PCIE_MSIXPARERR(M_PCIE_MSIXPARERR) | */ \
1283 V_BISTERR(M_BISTERR)) 1289 F_RETRYBUFPARERR | F_RETRYLUTPARERR | F_RXPARERR | \
1284#define ULPRX_INTR_MASK F_PARERR 1290 F_TXPARERR | V_BISTERR(M_BISTERR))
1285#define ULPTX_INTR_MASK 0 1291#define ULPRX_INTR_MASK (F_PARERRDATA | F_PARERRPCMD | F_ARBPF1PERR | \
1286#define CPLSW_INTR_MASK (F_TP_FRAMING_ERROR | \ 1292 F_ARBPF0PERR | F_ARBFPERR | F_PCMDMUXPERR | \
1293 F_DATASELFRAMEERR1 | F_DATASELFRAMEERR0)
1294#define ULPTX_INTR_MASK 0xfc
1295#define CPLSW_INTR_MASK (F_CIM_OP_MAP_PERR | F_TP_FRAMING_ERROR | \
1287 F_SGE_FRAMING_ERROR | F_CIM_FRAMING_ERROR | \ 1296 F_SGE_FRAMING_ERROR | F_CIM_FRAMING_ERROR | \
1288 F_ZERO_SWITCH_ERROR) 1297 F_ZERO_SWITCH_ERROR)
1289#define CIM_INTR_MASK (F_BLKWRPLINT | F_BLKRDPLINT | F_BLKWRCTLINT | \ 1298#define CIM_INTR_MASK (F_BLKWRPLINT | F_BLKRDPLINT | F_BLKWRCTLINT | \
1290 F_BLKRDCTLINT | F_BLKWRFLASHINT | F_BLKRDFLASHINT | \ 1299 F_BLKRDCTLINT | F_BLKWRFLASHINT | F_BLKRDFLASHINT | \
1291 F_SGLWRFLASHINT | F_WRBLKFLASHINT | F_BLKWRBOOTINT | \ 1300 F_SGLWRFLASHINT | F_WRBLKFLASHINT | F_BLKWRBOOTINT | \
1292 F_FLASHRANGEINT | F_SDRAMRANGEINT | F_RSVDSPACEINT) 1301 F_FLASHRANGEINT | F_SDRAMRANGEINT | F_RSVDSPACEINT | \
1302 F_DRAMPARERR | F_ICACHEPARERR | F_DCACHEPARERR | \
1303 F_OBQSGEPARERR | F_OBQULPHIPARERR | F_OBQULPLOPARERR | \
1304 F_IBQSGELOPARERR | F_IBQSGEHIPARERR | F_IBQULPPARERR | \
1305 F_IBQTPPARERR | F_ITAGPARERR | F_DTAGPARERR)
1293#define PMTX_INTR_MASK (F_ZERO_C_CMD_ERROR | ICSPI_FRM_ERR | OESPI_FRM_ERR | \ 1306#define PMTX_INTR_MASK (F_ZERO_C_CMD_ERROR | ICSPI_FRM_ERR | OESPI_FRM_ERR | \
1294 V_ICSPI_PAR_ERROR(M_ICSPI_PAR_ERROR) | \ 1307 V_ICSPI_PAR_ERROR(M_ICSPI_PAR_ERROR) | \
1295 V_OESPI_PAR_ERROR(M_OESPI_PAR_ERROR)) 1308 V_OESPI_PAR_ERROR(M_OESPI_PAR_ERROR))
@@ -1358,6 +1371,10 @@ static void pcie_intr_handler(struct adapter *adapter)
1358 {F_PCIE_CFPARERR, "PCI command FIFO parity error", -1, 1}, 1371 {F_PCIE_CFPARERR, "PCI command FIFO parity error", -1, 1},
1359 {V_PCIE_MSIXPARERR(M_PCIE_MSIXPARERR), 1372 {V_PCIE_MSIXPARERR(M_PCIE_MSIXPARERR),
1360 "PCI MSI-X table/PBA parity error", -1, 1}, 1373 "PCI MSI-X table/PBA parity error", -1, 1},
1374 {F_RETRYBUFPARERR, "PCI retry buffer parity error", -1, 1},
1375 {F_RETRYLUTPARERR, "PCI retry LUT parity error", -1, 1},
1376 {F_RXPARERR, "PCI Rx parity error", -1, 1},
1377 {F_TXPARERR, "PCI Tx parity error", -1, 1},
1361 {V_BISTERR(M_BISTERR), "PCI BIST error", -1, 1}, 1378 {V_BISTERR(M_BISTERR), "PCI BIST error", -1, 1},
1362 {0} 1379 {0}
1363 }; 1380 };
@@ -1384,15 +1401,15 @@ static void tp_intr_handler(struct adapter *adapter)
1384 }; 1401 };
1385 1402
1386 static struct intr_info tp_intr_info_t3c[] = { 1403 static struct intr_info tp_intr_info_t3c[] = {
1387 { 0x1ffffff, "TP parity error", -1, 1 }, 1404 {0x1fffffff, "TP parity error", -1, 1},
1388 { F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1 }, 1405 {F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1},
1389 { F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1 }, 1406 {F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1},
1390 { 0 } 1407 {0}
1391 }; 1408 };
1392 1409
1393 if (t3_handle_intr_status(adapter, A_TP_INT_CAUSE, 0xffffffff, 1410 if (t3_handle_intr_status(adapter, A_TP_INT_CAUSE, 0xffffffff,
1394 adapter->params.rev < T3_REV_C ? 1411 adapter->params.rev < T3_REV_C ?
1395 tp_intr_info : tp_intr_info_t3c, NULL)) 1412 tp_intr_info : tp_intr_info_t3c, NULL))
1396 t3_fatal_err(adapter); 1413 t3_fatal_err(adapter);
1397} 1414}
1398 1415
@@ -1414,6 +1431,18 @@ static void cim_intr_handler(struct adapter *adapter)
1414 {F_BLKWRCTLINT, "CIM block write to CTL space", -1, 1}, 1431 {F_BLKWRCTLINT, "CIM block write to CTL space", -1, 1},
1415 {F_BLKRDPLINT, "CIM block read from PL space", -1, 1}, 1432 {F_BLKRDPLINT, "CIM block read from PL space", -1, 1},
1416 {F_BLKWRPLINT, "CIM block write to PL space", -1, 1}, 1433 {F_BLKWRPLINT, "CIM block write to PL space", -1, 1},
1434 {F_DRAMPARERR, "CIM DRAM parity error", -1, 1},
1435 {F_ICACHEPARERR, "CIM icache parity error", -1, 1},
1436 {F_DCACHEPARERR, "CIM dcache parity error", -1, 1},
1437 {F_OBQSGEPARERR, "CIM OBQ SGE parity error", -1, 1},
1438 {F_OBQULPHIPARERR, "CIM OBQ ULPHI parity error", -1, 1},
1439 {F_OBQULPLOPARERR, "CIM OBQ ULPLO parity error", -1, 1},
1440 {F_IBQSGELOPARERR, "CIM IBQ SGELO parity error", -1, 1},
1441 {F_IBQSGEHIPARERR, "CIM IBQ SGEHI parity error", -1, 1},
1442 {F_IBQULPPARERR, "CIM IBQ ULP parity error", -1, 1},
1443 {F_IBQTPPARERR, "CIM IBQ TP parity error", -1, 1},
1444 {F_ITAGPARERR, "CIM itag parity error", -1, 1},
1445 {F_DTAGPARERR, "CIM dtag parity error", -1, 1},
1417 {0} 1446 {0}
1418 }; 1447 };
1419 1448
@@ -1428,7 +1457,14 @@ static void cim_intr_handler(struct adapter *adapter)
1428static void ulprx_intr_handler(struct adapter *adapter) 1457static void ulprx_intr_handler(struct adapter *adapter)
1429{ 1458{
1430 static const struct intr_info ulprx_intr_info[] = { 1459 static const struct intr_info ulprx_intr_info[] = {
1431 {F_PARERR, "ULP RX parity error", -1, 1}, 1460 {F_PARERRDATA, "ULP RX data parity error", -1, 1},
1461 {F_PARERRPCMD, "ULP RX command parity error", -1, 1},
1462 {F_ARBPF1PERR, "ULP RX ArbPF1 parity error", -1, 1},
1463 {F_ARBPF0PERR, "ULP RX ArbPF0 parity error", -1, 1},
1464 {F_ARBFPERR, "ULP RX ArbF parity error", -1, 1},
1465 {F_PCMDMUXPERR, "ULP RX PCMDMUX parity error", -1, 1},
1466 {F_DATASELFRAMEERR1, "ULP RX frame error", -1, 1},
1467 {F_DATASELFRAMEERR0, "ULP RX frame error", -1, 1},
1432 {0} 1468 {0}
1433 }; 1469 };
1434 1470
@@ -1447,6 +1483,7 @@ static void ulptx_intr_handler(struct adapter *adapter)
1447 STAT_ULP_CH0_PBL_OOB, 0}, 1483 STAT_ULP_CH0_PBL_OOB, 0},
1448 {F_PBL_BOUND_ERR_CH1, "ULP TX channel 1 PBL out of bounds", 1484 {F_PBL_BOUND_ERR_CH1, "ULP TX channel 1 PBL out of bounds",
1449 STAT_ULP_CH1_PBL_OOB, 0}, 1485 STAT_ULP_CH1_PBL_OOB, 0},
1486 {0xfc, "ULP TX parity error", -1, 1},
1450 {0} 1487 {0}
1451 }; 1488 };
1452 1489
@@ -1521,7 +1558,8 @@ static void pmrx_intr_handler(struct adapter *adapter)
1521static void cplsw_intr_handler(struct adapter *adapter) 1558static void cplsw_intr_handler(struct adapter *adapter)
1522{ 1559{
1523 static const struct intr_info cplsw_intr_info[] = { 1560 static const struct intr_info cplsw_intr_info[] = {
1524/* { F_CIM_OVFL_ERROR, "CPL switch CIM overflow", -1, 1 }, */ 1561 {F_CIM_OP_MAP_PERR, "CPL switch CIM parity error", -1, 1},
1562 {F_CIM_OVFL_ERROR, "CPL switch CIM overflow", -1, 1},
1525 {F_TP_FRAMING_ERROR, "CPL switch TP framing error", -1, 1}, 1563 {F_TP_FRAMING_ERROR, "CPL switch TP framing error", -1, 1},
1526 {F_SGE_FRAMING_ERROR, "CPL switch SGE framing error", -1, 1}, 1564 {F_SGE_FRAMING_ERROR, "CPL switch SGE framing error", -1, 1},
1527 {F_CIM_FRAMING_ERROR, "CPL switch CIM framing error", -1, 1}, 1565 {F_CIM_FRAMING_ERROR, "CPL switch CIM framing error", -1, 1},
@@ -1907,6 +1945,16 @@ static int t3_sge_write_context(struct adapter *adapter, unsigned int id,
1907 0, SG_CONTEXT_CMD_ATTEMPTS, 1); 1945 0, SG_CONTEXT_CMD_ATTEMPTS, 1);
1908} 1946}
1909 1947
1948static int clear_sge_ctxt(struct adapter *adap, unsigned int id,
1949 unsigned int type)
1950{
1951 t3_write_reg(adap, A_SG_CONTEXT_DATA0, 0);
1952 t3_write_reg(adap, A_SG_CONTEXT_DATA1, 0);
1953 t3_write_reg(adap, A_SG_CONTEXT_DATA2, 0);
1954 t3_write_reg(adap, A_SG_CONTEXT_DATA3, 0);
1955 return t3_sge_write_context(adap, id, type);
1956}
1957
1910/** 1958/**
1911 * t3_sge_init_ecntxt - initialize an SGE egress context 1959 * t3_sge_init_ecntxt - initialize an SGE egress context
1912 * @adapter: the adapter to configure 1960 * @adapter: the adapter to configure
@@ -2408,7 +2456,7 @@ static inline unsigned int pm_num_pages(unsigned int mem_size,
2408 t3_write_reg((adap), A_ ## reg, (start)); \ 2456 t3_write_reg((adap), A_ ## reg, (start)); \
2409 start += size 2457 start += size
2410 2458
2411/* 2459/**
2412 * partition_mem - partition memory and configure TP memory settings 2460 * partition_mem - partition memory and configure TP memory settings
2413 * @adap: the adapter 2461 * @adap: the adapter
2414 * @p: the TP parameters 2462 * @p: the TP parameters
@@ -2493,7 +2541,7 @@ static void tp_config(struct adapter *adap, const struct tp_params *p)
2493 V_AUTOSTATE2(1) | V_AUTOSTATE1(0) | 2541 V_AUTOSTATE2(1) | V_AUTOSTATE1(0) |
2494 V_BYTETHRESHOLD(16384) | V_MSSTHRESHOLD(2) | 2542 V_BYTETHRESHOLD(16384) | V_MSSTHRESHOLD(2) |
2495 F_AUTOCAREFUL | F_AUTOENABLE | V_DACK_MODE(1)); 2543 F_AUTOCAREFUL | F_AUTOENABLE | V_DACK_MODE(1));
2496 t3_set_reg_field(adap, A_TP_IN_CONFIG, F_IPV6ENABLE | F_NICMODE, 2544 t3_set_reg_field(adap, A_TP_IN_CONFIG, F_RXFBARBPRIO | F_TXFBARBPRIO,
2497 F_IPV6ENABLE | F_NICMODE); 2545 F_IPV6ENABLE | F_NICMODE);
2498 t3_write_reg(adap, A_TP_TX_RESOURCE_LIMIT, 0x18141814); 2546 t3_write_reg(adap, A_TP_TX_RESOURCE_LIMIT, 0x18141814);
2499 t3_write_reg(adap, A_TP_PARA_REG4, 0x5050105); 2547 t3_write_reg(adap, A_TP_PARA_REG4, 0x5050105);
@@ -2505,7 +2553,9 @@ static void tp_config(struct adapter *adap, const struct tp_params *p)
2505 F_ENABLEEPCMDAFULL, 2553 F_ENABLEEPCMDAFULL,
2506 F_ENABLEOCSPIFULL |F_TXDEFERENABLE | F_HEARBEATDACK | 2554 F_ENABLEOCSPIFULL |F_TXDEFERENABLE | F_HEARBEATDACK |
2507 F_TXCONGESTIONMODE | F_RXCONGESTIONMODE); 2555 F_TXCONGESTIONMODE | F_RXCONGESTIONMODE);
2508 t3_set_reg_field(adap, A_TP_PC_CONFIG2, F_CHDRAFULL, 0); 2556 t3_set_reg_field(adap, A_TP_PC_CONFIG2, F_CHDRAFULL,
2557 F_ENABLEIPV6RSS | F_ENABLENONOFDTNLSYN |
2558 F_ENABLEARPMISS | F_DISBLEDAPARBIT0);
2509 t3_write_reg(adap, A_TP_PROXY_FLOW_CNTL, 1080); 2559 t3_write_reg(adap, A_TP_PROXY_FLOW_CNTL, 1080);
2510 t3_write_reg(adap, A_TP_PROXY_FLOW_CNTL, 1000); 2560 t3_write_reg(adap, A_TP_PROXY_FLOW_CNTL, 1000);
2511 2561
@@ -3212,7 +3262,8 @@ static void config_pcie(struct adapter *adap)
3212 V_REPLAYLMT(rpllmt)); 3262 V_REPLAYLMT(rpllmt));
3213 3263
3214 t3_write_reg(adap, A_PCIE_PEX_ERR, 0xffffffff); 3264 t3_write_reg(adap, A_PCIE_PEX_ERR, 0xffffffff);
3215 t3_set_reg_field(adap, A_PCIE_CFG, F_PCIE_CLIDECEN, F_PCIE_CLIDECEN); 3265 t3_set_reg_field(adap, A_PCIE_CFG, 0,
3266 F_PCIE_DMASTOPEN | F_PCIE_CLIDECEN);
3216} 3267}
3217 3268
3218/* 3269/*
@@ -3225,7 +3276,7 @@ static void config_pcie(struct adapter *adap)
3225 */ 3276 */
3226int t3_init_hw(struct adapter *adapter, u32 fw_params) 3277int t3_init_hw(struct adapter *adapter, u32 fw_params)
3227{ 3278{
3228 int err = -EIO, attempts = 100; 3279 int err = -EIO, attempts, i;
3229 const struct vpd_params *vpd = &adapter->params.vpd; 3280 const struct vpd_params *vpd = &adapter->params.vpd;
3230 3281
3231 if (adapter->params.rev > 0) 3282 if (adapter->params.rev > 0)
@@ -3243,6 +3294,10 @@ int t3_init_hw(struct adapter *adapter, u32 fw_params)
3243 adapter->params.mc5.nfilters, 3294 adapter->params.mc5.nfilters,
3244 adapter->params.mc5.nroutes)) 3295 adapter->params.mc5.nroutes))
3245 goto out_err; 3296 goto out_err;
3297
3298 for (i = 0; i < 32; i++)
3299 if (clear_sge_ctxt(adapter, i, F_CQ))
3300 goto out_err;
3246 } 3301 }
3247 3302
3248 if (tp_init(adapter, &adapter->params.tp)) 3303 if (tp_init(adapter, &adapter->params.tp))
@@ -3258,7 +3313,8 @@ int t3_init_hw(struct adapter *adapter, u32 fw_params)
3258 if (is_pcie(adapter)) 3313 if (is_pcie(adapter))
3259 config_pcie(adapter); 3314 config_pcie(adapter);
3260 else 3315 else
3261 t3_set_reg_field(adapter, A_PCIX_CFG, 0, F_CLIDECEN); 3316 t3_set_reg_field(adapter, A_PCIX_CFG, 0,
3317 F_DMASTOPEN | F_CLIDECEN);
3262 3318
3263 if (adapter->params.rev == T3_REV_C) 3319 if (adapter->params.rev == T3_REV_C)
3264 t3_set_reg_field(adapter, A_ULPTX_CONFIG, 0, 3320 t3_set_reg_field(adapter, A_ULPTX_CONFIG, 0,
@@ -3275,6 +3331,7 @@ int t3_init_hw(struct adapter *adapter, u32 fw_params)
3275 V_BOOTADDR(FW_FLASH_BOOT_ADDR >> 2)); 3331 V_BOOTADDR(FW_FLASH_BOOT_ADDR >> 2));
3276 t3_read_reg(adapter, A_CIM_BOOT_CFG); /* flush */ 3332 t3_read_reg(adapter, A_CIM_BOOT_CFG); /* flush */
3277 3333
3334 attempts = 100;
3278 do { /* wait for uP to initialize */ 3335 do { /* wait for uP to initialize */
3279 msleep(20); 3336 msleep(20);
3280 } while (t3_read_reg(adapter, A_CIM_HOST_ACC_DATA) && --attempts); 3337 } while (t3_read_reg(adapter, A_CIM_HOST_ACC_DATA) && --attempts);
@@ -3409,6 +3466,7 @@ void early_hw_init(struct adapter *adapter, const struct adapter_info *ai)
3409 t3_write_reg(adapter, A_T3DBG_GPIO_EN, 3466 t3_write_reg(adapter, A_T3DBG_GPIO_EN,
3410 ai->gpio_out | F_GPIO0_OEN | F_GPIO0_OUT_VAL); 3467 ai->gpio_out | F_GPIO0_OEN | F_GPIO0_OUT_VAL);
3411 t3_write_reg(adapter, A_MC5_DB_SERVER_INDEX, 0); 3468 t3_write_reg(adapter, A_MC5_DB_SERVER_INDEX, 0);
3469 t3_write_reg(adapter, A_SG_OCO_BASE, V_BASE1(0xfff));
3412 3470
3413 if (adapter->params.rev == 0 || !uses_xaui(adapter)) 3471 if (adapter->params.rev == 0 || !uses_xaui(adapter))
3414 val |= F_ENRGMII; 3472 val |= F_ENRGMII;
@@ -3458,6 +3516,36 @@ static int t3_reset_adapter(struct adapter *adapter)
3458 return 0; 3516 return 0;
3459} 3517}
3460 3518
3519static int __devinit init_parity(struct adapter *adap)
3520{
3521 int i, err, addr;
3522
3523 if (t3_read_reg(adap, A_SG_CONTEXT_CMD) & F_CONTEXT_CMD_BUSY)
3524 return -EBUSY;
3525
3526 for (err = i = 0; !err && i < 16; i++)
3527 err = clear_sge_ctxt(adap, i, F_EGRESS);
3528 for (i = 0xfff0; !err && i <= 0xffff; i++)
3529 err = clear_sge_ctxt(adap, i, F_EGRESS);
3530 for (i = 0; !err && i < SGE_QSETS; i++)
3531 err = clear_sge_ctxt(adap, i, F_RESPONSEQ);
3532 if (err)
3533 return err;
3534
3535 t3_write_reg(adap, A_CIM_IBQ_DBG_DATA, 0);
3536 for (i = 0; i < 4; i++)
3537 for (addr = 0; addr <= M_IBQDBGADDR; addr++) {
3538 t3_write_reg(adap, A_CIM_IBQ_DBG_CFG, F_IBQDBGEN |
3539 F_IBQDBGWR | V_IBQDBGQID(i) |
3540 V_IBQDBGADDR(addr));
3541 err = t3_wait_op_done(adap, A_CIM_IBQ_DBG_CFG,
3542 F_IBQDBGBUSY, 0, 2, 1);
3543 if (err)
3544 return err;
3545 }
3546 return 0;
3547}
3548
3461/* 3549/*
3462 * Initialize adapter SW state for the various HW modules, set initial values 3550 * Initialize adapter SW state for the various HW modules, set initial values
3463 * for some adapter tunables, take PHYs out of reset, and initialize the MDIO 3551 * for some adapter tunables, take PHYs out of reset, and initialize the MDIO
@@ -3525,6 +3613,9 @@ int __devinit t3_prep_adapter(struct adapter *adapter,
3525 } 3613 }
3526 3614
3527 early_hw_init(adapter, ai); 3615 early_hw_init(adapter, ai);
3616 ret = init_parity(adapter);
3617 if (ret)
3618 return ret;
3528 3619
3529 for_each_port(adapter, i) { 3620 for_each_port(adapter, i) {
3530 u8 hw_addr[6]; 3621 u8 hw_addr[6];