Commit f602b976 authored by Tom Lendacky's avatar Tom Lendacky Committed by David S. Miller

amd-xgbe: Interrupt summary bits are h/w version dependent

There is a difference in the bit position of the normal interrupt summary
enable (NIE) and abnormal interrupt summary enable (AIE) between revisions
of the hardware.  For older revisions the NIE and AIE bits are positions
16 and 15 respectively.  For newer revisions the NIE and AIE bits are
positions 15 and 14.  The effect in changing the bit position is that
newer hardware won't receive AIE interrupts in the current version of the
driver.  Specifically, the driver uses this interrupt to collect
statistics on when a receive buffer unavailable event occurs and to
restart the driver/device when a fatal bus error occurs.

Update the driver to set the interrupt enable bit based on the reported
version of the hardware.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f8045ca9
...@@ -210,11 +210,15 @@ ...@@ -210,11 +210,15 @@
#define DMA_CH_CR_PBLX8_WIDTH 1 #define DMA_CH_CR_PBLX8_WIDTH 1
#define DMA_CH_CR_SPH_INDEX 24 #define DMA_CH_CR_SPH_INDEX 24
#define DMA_CH_CR_SPH_WIDTH 1 #define DMA_CH_CR_SPH_WIDTH 1
#define DMA_CH_IER_AIE_INDEX 15 #define DMA_CH_IER_AIE20_INDEX 15
#define DMA_CH_IER_AIE20_WIDTH 1
#define DMA_CH_IER_AIE_INDEX 14
#define DMA_CH_IER_AIE_WIDTH 1 #define DMA_CH_IER_AIE_WIDTH 1
#define DMA_CH_IER_FBEE_INDEX 12 #define DMA_CH_IER_FBEE_INDEX 12
#define DMA_CH_IER_FBEE_WIDTH 1 #define DMA_CH_IER_FBEE_WIDTH 1
#define DMA_CH_IER_NIE_INDEX 16 #define DMA_CH_IER_NIE20_INDEX 16
#define DMA_CH_IER_NIE20_WIDTH 1
#define DMA_CH_IER_NIE_INDEX 15
#define DMA_CH_IER_NIE_WIDTH 1 #define DMA_CH_IER_NIE_WIDTH 1
#define DMA_CH_IER_RBUE_INDEX 7 #define DMA_CH_IER_RBUE_INDEX 7
#define DMA_CH_IER_RBUE_WIDTH 1 #define DMA_CH_IER_RBUE_WIDTH 1
......
...@@ -649,13 +649,15 @@ static void xgbe_config_flow_control(struct xgbe_prv_data *pdata) ...@@ -649,13 +649,15 @@ static void xgbe_config_flow_control(struct xgbe_prv_data *pdata)
static void xgbe_enable_dma_interrupts(struct xgbe_prv_data *pdata) static void xgbe_enable_dma_interrupts(struct xgbe_prv_data *pdata)
{ {
struct xgbe_channel *channel; struct xgbe_channel *channel;
unsigned int i; unsigned int i, ver;
/* Set the interrupt mode if supported */ /* Set the interrupt mode if supported */
if (pdata->channel_irq_mode) if (pdata->channel_irq_mode)
XGMAC_IOWRITE_BITS(pdata, DMA_MR, INTM, XGMAC_IOWRITE_BITS(pdata, DMA_MR, INTM,
pdata->channel_irq_mode); pdata->channel_irq_mode);
ver = XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER);
for (i = 0; i < pdata->channel_count; i++) { for (i = 0; i < pdata->channel_count; i++) {
channel = pdata->channel[i]; channel = pdata->channel[i];
...@@ -671,8 +673,13 @@ static void xgbe_enable_dma_interrupts(struct xgbe_prv_data *pdata) ...@@ -671,8 +673,13 @@ static void xgbe_enable_dma_interrupts(struct xgbe_prv_data *pdata)
* AIE - Abnormal Interrupt Summary Enable * AIE - Abnormal Interrupt Summary Enable
* FBEE - Fatal Bus Error Enable * FBEE - Fatal Bus Error Enable
*/ */
XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE, 1); if (ver < 0x21) {
XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE, 1); XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE20, 1);
XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE20, 1);
} else {
XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE, 1);
XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE, 1);
}
XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, FBEE, 1); XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, FBEE, 1);
if (channel->tx_ring) { if (channel->tx_ring) {
......
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