cxgb4: Update register range and SGE registers for T6 adapter
authorHariprasad Shenai <hariprasad@chelsio.com>
Wed, 23 Dec 2015 17:17:14 +0000 (22:47 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Dec 2015 03:34:45 +0000 (22:34 -0500)
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4/sge.c
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
drivers/net/ethernet/chelsio/cxgb4/t4_regs.h

index 2642593289d999bdfdf17ec2c59b2c75b24fb4b6..c0dd533eeafb32529bd9adadda4f90492e95b7a8 100644 (file)
@@ -4855,8 +4855,9 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        /* configure SGE_STAT_CFG_A to read WC stats */
        if (!is_t4(adapter->params.chip))
-               t4_write_reg(adapter, SGE_STAT_CFG_A,
-                            STATSOURCE_T5_V(7) | STATMODE_V(0));
+               t4_write_reg(adapter, SGE_STAT_CFG_A, STATSOURCE_T5_V(7) |
+                            (is_t5(adapter->params.chip) ? STATMODE_V(0) :
+                             T6_STATMODE_V(0)));
 
        for_each_port(adapter, i) {
                struct net_device *netdev;
index 099b946f017f6d69cc5552110a3fd22ec7917194..5829c9caa1fa0375e3902c39b6c5ecc90f88db2c 100644 (file)
@@ -3202,10 +3202,21 @@ int t4_sge_init(struct adapter *adap)
         * buffers.
         */
        sge_conm_ctrl = t4_read_reg(adap, SGE_CONM_CTRL_A);
-       if (is_t4(adap->params.chip))
+       switch (CHELSIO_CHIP_VERSION(adap->params.chip)) {
+       case CHELSIO_T4:
                egress_threshold = EGRTHRESHOLD_G(sge_conm_ctrl);
-       else
+               break;
+       case CHELSIO_T5:
                egress_threshold = EGRTHRESHOLDPACKING_G(sge_conm_ctrl);
+               break;
+       case CHELSIO_T6:
+               egress_threshold = T6_EGRTHRESHOLDPACKING_G(sge_conm_ctrl);
+               break;
+       default:
+               dev_err(adap->pdev_dev, "Unsupported Chip version %d\n",
+                       CHELSIO_CHIP_VERSION(adap->params.chip));
+               return -EINVAL;
+       }
        s->fl_starve_thres = 2*egress_threshold + 1;
 
        t4_idma_monitor_init(adap, &s->idma_monitor);
index 42754c06b7d8491d8d7a6dd64ed10be58ab321e1..c613bd6a609139ac32253e7a4794ec191f1ec900 100644 (file)
@@ -1942,8 +1942,12 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size)
                0x1190, 0x1194,
                0x11a0, 0x11a4,
                0x11b0, 0x11b4,
-               0x11fc, 0x1254,
-               0x1280, 0x133c,
+               0x11fc, 0x1258,
+               0x1280, 0x12d4,
+               0x12d9, 0x12d9,
+               0x12de, 0x12de,
+               0x12e3, 0x12e3,
+               0x12e8, 0x133c,
                0x1800, 0x18fc,
                0x3000, 0x302c,
                0x3060, 0x30b0,
@@ -1973,7 +1977,7 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size)
                0x5e50, 0x5e94,
                0x5ea0, 0x5eb0,
                0x5ec0, 0x5ec0,
-               0x5ec8, 0x5ecc,
+               0x5ec8, 0x5ed0,
                0x6000, 0x6020,
                0x6028, 0x6040,
                0x6058, 0x609c,
@@ -2048,7 +2052,8 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size)
                0x19150, 0x19194,
                0x1919c, 0x191b0,
                0x191d0, 0x191e8,
-               0x19238, 0x192b0,
+               0x19238, 0x19290,
+               0x192a4, 0x192b0,
                0x192bc, 0x192bc,
                0x19348, 0x1934c,
                0x193f8, 0x19418,
@@ -2442,7 +2447,8 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size)
                0x40280, 0x40280,
                0x40304, 0x40304,
                0x40330, 0x4033c,
-               0x41304, 0x413c8,
+               0x41304, 0x413b8,
+               0x413c0, 0x413c8,
                0x413d0, 0x413dc,
                0x413f0, 0x413f0,
                0x41400, 0x4140c,
index 91b52a21a2e7f16cfae0bb536638ee6b61cabf9f..0971cc41c7474297c7a4b449bbb76c897e809351 100644 (file)
 #define STATSOURCE_T5_V(x) ((x) << STATSOURCE_T5_S)
 #define STATSOURCE_T5_G(x) (((x) >> STATSOURCE_T5_S) & STATSOURCE_T5_M)
 
+#define T6_STATMODE_S    0
+#define T6_STATMODE_V(x) ((x) << T6_STATMODE_S)
+
 #define SGE_DBFIFO_STATUS2_A 0x1118
 
 #define HP_INT_THRESH_T5_S    10