Commit 9bb59b96 authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller

cxgb4: Fix T5 adapter accessing T4 adapter registers

Fixes few register access for both T4 and T5.
PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS & PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS
is T4 only register don't let T5 access them. For T5 MA_PARITY_ERROR_STATUS2
is additionally read. MPS_TRC_RSS_CONTROL is T4 only register, for T5 use
MPS_T5_TRC_RSS_CONTROL.
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 63a92fe6
...@@ -1253,7 +1253,9 @@ freeout: t4_free_sge_resources(adap); ...@@ -1253,7 +1253,9 @@ freeout: t4_free_sge_resources(adap);
goto freeout; goto freeout;
} }
t4_write_reg(adap, MPS_TRC_RSS_CONTROL, t4_write_reg(adap, is_t4(adap->params.chip) ?
MPS_TRC_RSS_CONTROL :
MPS_T5_TRC_RSS_CONTROL,
RSSCONTROL(netdev2pinfo(adap->port[0])->tx_chan) | RSSCONTROL(netdev2pinfo(adap->port[0])->tx_chan) |
QUEUENUMBER(s->ethrxq[0].rspq.abs_id)); QUEUENUMBER(s->ethrxq[0].rspq.abs_id));
return 0; return 0;
......
...@@ -1403,15 +1403,18 @@ static void pcie_intr_handler(struct adapter *adapter) ...@@ -1403,15 +1403,18 @@ static void pcie_intr_handler(struct adapter *adapter)
int fat; int fat;
fat = t4_handle_intr_status(adapter, if (is_t4(adapter->params.chip))
PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, fat = t4_handle_intr_status(adapter,
sysbus_intr_info) + PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS,
t4_handle_intr_status(adapter, sysbus_intr_info) +
PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, t4_handle_intr_status(adapter,
pcie_port_intr_info) + PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS,
t4_handle_intr_status(adapter, PCIE_INT_CAUSE, pcie_port_intr_info) +
is_t4(adapter->params.chip) ? t4_handle_intr_status(adapter, PCIE_INT_CAUSE,
pcie_intr_info : t5_pcie_intr_info); pcie_intr_info);
else
fat = t4_handle_intr_status(adapter, PCIE_INT_CAUSE,
t5_pcie_intr_info);
if (fat) if (fat)
t4_fatal_err(adapter); t4_fatal_err(adapter);
...@@ -1777,10 +1780,16 @@ static void ma_intr_handler(struct adapter *adap) ...@@ -1777,10 +1780,16 @@ static void ma_intr_handler(struct adapter *adap)
{ {
u32 v, status = t4_read_reg(adap, MA_INT_CAUSE); u32 v, status = t4_read_reg(adap, MA_INT_CAUSE);
if (status & MEM_PERR_INT_CAUSE) if (status & MEM_PERR_INT_CAUSE) {
dev_alert(adap->pdev_dev, dev_alert(adap->pdev_dev,
"MA parity error, parity status %#x\n", "MA parity error, parity status %#x\n",
t4_read_reg(adap, MA_PARITY_ERROR_STATUS)); t4_read_reg(adap, MA_PARITY_ERROR_STATUS));
if (is_t5(adap->params.chip))
dev_alert(adap->pdev_dev,
"MA parity error, parity status %#x\n",
t4_read_reg(adap,
MA_PARITY_ERROR_STATUS2));
}
if (status & MEM_WRAP_INT_CAUSE) { if (status & MEM_WRAP_INT_CAUSE) {
v = t4_read_reg(adap, MA_INT_WRAP_STATUS); v = t4_read_reg(adap, MA_INT_WRAP_STATUS);
dev_alert(adap->pdev_dev, "MA address wrap-around error by " dev_alert(adap->pdev_dev, "MA address wrap-around error by "
......
...@@ -511,6 +511,7 @@ ...@@ -511,6 +511,7 @@
#define MEM_WRAP_CLIENT_NUM_GET(x) (((x) & MEM_WRAP_CLIENT_NUM_MASK) >> MEM_WRAP_CLIENT_NUM_SHIFT) #define MEM_WRAP_CLIENT_NUM_GET(x) (((x) & MEM_WRAP_CLIENT_NUM_MASK) >> MEM_WRAP_CLIENT_NUM_SHIFT)
#define MA_PCIE_FW 0x30b8 #define MA_PCIE_FW 0x30b8
#define MA_PARITY_ERROR_STATUS 0x77f4 #define MA_PARITY_ERROR_STATUS 0x77f4
#define MA_PARITY_ERROR_STATUS2 0x7804
#define MA_EXT_MEMORY1_BAR 0x7808 #define MA_EXT_MEMORY1_BAR 0x7808
#define EDC_0_BASE_ADDR 0x7900 #define EDC_0_BASE_ADDR 0x7900
...@@ -959,6 +960,7 @@ ...@@ -959,6 +960,7 @@
#define TRCMULTIFILTER 0x00000001U #define TRCMULTIFILTER 0x00000001U
#define MPS_TRC_RSS_CONTROL 0x9808 #define MPS_TRC_RSS_CONTROL 0x9808
#define MPS_T5_TRC_RSS_CONTROL 0xa00c
#define RSSCONTROL_MASK 0x00ff0000U #define RSSCONTROL_MASK 0x00ff0000U
#define RSSCONTROL_SHIFT 16 #define RSSCONTROL_SHIFT 16
#define RSSCONTROL(x) ((x) << RSSCONTROL_SHIFT) #define RSSCONTROL(x) ((x) << RSSCONTROL_SHIFT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment