Commit 36af9f25 authored by Swee Leong Ching's avatar Swee Leong Ching Committed by David S. Miller

net: stmmac: Use interrupt mode INTM=1 for per channel irq

Enable per DMA channel interrupt that uses shared peripheral
interrupt (SPI), so only per channel TX and RX intr (TI/RI)
are handled by TX/RX ISR without calling common interrupt ISR.
Signed-off-by: default avatarTeoh Ji Sheng <ji.sheng.teoh@intel.com>
Signed-off-by: default avatarSwee Leong Ching <leong.ching.swee@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9072e03d
...@@ -346,6 +346,9 @@ ...@@ -346,6 +346,9 @@
/* DMA Registers */ /* DMA Registers */
#define XGMAC_DMA_MODE 0x00003000 #define XGMAC_DMA_MODE 0x00003000
#define XGMAC_SWR BIT(0) #define XGMAC_SWR BIT(0)
#define XGMAC_DMA_MODE_INTM_MASK GENMASK(13, 12)
#define XGMAC_DMA_MODE_INTM_SHIFT 12
#define XGMAC_DMA_MODE_INTM_MODE1 0x1
#define XGMAC_DMA_SYSBUS_MODE 0x00003004 #define XGMAC_DMA_SYSBUS_MODE 0x00003004
#define XGMAC_WR_OSR_LMT GENMASK(29, 24) #define XGMAC_WR_OSR_LMT GENMASK(29, 24)
#define XGMAC_WR_OSR_LMT_SHIFT 24 #define XGMAC_WR_OSR_LMT_SHIFT 24
......
...@@ -31,6 +31,13 @@ static void dwxgmac2_dma_init(void __iomem *ioaddr, ...@@ -31,6 +31,13 @@ static void dwxgmac2_dma_init(void __iomem *ioaddr,
value |= XGMAC_EAME; value |= XGMAC_EAME;
writel(value, ioaddr + XGMAC_DMA_SYSBUS_MODE); writel(value, ioaddr + XGMAC_DMA_SYSBUS_MODE);
if (dma_cfg->multi_irq_en) {
value = readl(ioaddr + XGMAC_DMA_MODE);
value &= ~XGMAC_DMA_MODE_INTM_MASK;
value |= (XGMAC_DMA_MODE_INTM_MODE1 << XGMAC_DMA_MODE_INTM_SHIFT);
writel(value, ioaddr + XGMAC_DMA_MODE);
}
} }
static void dwxgmac2_dma_init_chan(struct stmmac_priv *priv, static void dwxgmac2_dma_init_chan(struct stmmac_priv *priv,
...@@ -365,20 +372,19 @@ static int dwxgmac2_dma_interrupt(struct stmmac_priv *priv, ...@@ -365,20 +372,19 @@ static int dwxgmac2_dma_interrupt(struct stmmac_priv *priv,
} }
/* TX/RX NORMAL interrupts */ /* TX/RX NORMAL interrupts */
if (likely(intr_status & XGMAC_NIS)) {
if (likely(intr_status & XGMAC_RI)) { if (likely(intr_status & XGMAC_RI)) {
u64_stats_update_begin(&rxq_stats->syncp); u64_stats_update_begin(&rxq_stats->syncp);
rxq_stats->rx_normal_irq_n++; rxq_stats->rx_normal_irq_n++;
u64_stats_update_end(&rxq_stats->syncp); u64_stats_update_end(&rxq_stats->syncp);
ret |= handle_rx; ret |= handle_rx;
} }
if (likely(intr_status & (XGMAC_TI | XGMAC_TBU))) { if (likely(intr_status & (XGMAC_TI | XGMAC_TBU))) {
u64_stats_update_begin(&txq_stats->syncp); u64_stats_update_begin(&txq_stats->syncp);
txq_stats->tx_normal_irq_n++; txq_stats->tx_normal_irq_n++;
u64_stats_update_end(&txq_stats->syncp); u64_stats_update_end(&txq_stats->syncp);
ret |= handle_tx; ret |= handle_tx;
} }
}
/* Clear interrupts */ /* Clear interrupts */
writel(intr_en & intr_status, ioaddr + XGMAC_DMA_CH_STATUS(chan)); writel(intr_en & intr_status, ioaddr + XGMAC_DMA_CH_STATUS(chan));
......
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