2016-05-23 09:20:20 +00:00
|
|
|
From 190df1a9dbf4d8809b7f991194ce60e47f2290a2 Mon Sep 17 00:00:00 2001
|
|
|
|
From: John Crispin <john@phrozen.org>
|
2016-04-26 11:43:38 +00:00
|
|
|
Date: Wed, 23 Mar 2016 18:31:48 +0100
|
2016-05-23 09:20:20 +00:00
|
|
|
Subject: [PATCH 096/102] net-next: mediatek: add support for IRQ grouping
|
2016-04-26 11:43:38 +00:00
|
|
|
|
|
|
|
The ethernet core has 3 IRQs. using the IRQ grouping registers we are able
|
|
|
|
to separate TX and RX IRQs, which allows us to service them on separate
|
2016-05-23 09:20:20 +00:00
|
|
|
cores. This patch splits the irq handler into 2 separate functions, one for
|
|
|
|
TX and another for RX. The TX housekeeping is split out into its own NAPI
|
|
|
|
handler.
|
2016-04-26 11:43:38 +00:00
|
|
|
|
2016-05-23 09:20:20 +00:00
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
2016-04-26 11:43:38 +00:00
|
|
|
---
|
2016-05-23 09:20:20 +00:00
|
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 156 +++++++++++++++++----------
|
|
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.h | 15 ++-
|
|
|
|
2 files changed, 111 insertions(+), 60 deletions(-)
|
2016-04-26 11:43:38 +00:00
|
|
|
|
2016-05-23 09:20:20 +00:00
|
|
|
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
|
|
index c869064..718cbb2 100644
|
2016-04-26 11:43:38 +00:00
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -905,14 +905,13 @@ release_desc:
|
2016-04-26 11:43:38 +00:00
|
|
|
return done;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again)
|
|
|
|
+static int mtk_poll_tx(struct mtk_eth *eth, int budget)
|
|
|
|
{
|
|
|
|
struct mtk_tx_ring *ring = ð->tx_ring;
|
|
|
|
struct mtk_tx_dma *desc;
|
|
|
|
struct sk_buff *skb;
|
|
|
|
struct mtk_tx_buf *tx_buf;
|
|
|
|
- int total = 0, done = 0;
|
|
|
|
- unsigned int bytes = 0;
|
|
|
|
+ unsigned int bytes = 0, done = 0;
|
|
|
|
u32 cpu, dma;
|
|
|
|
static int condition;
|
|
|
|
int i;
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -964,63 +963,82 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again)
|
|
|
|
netdev_completed_queue(eth->netdev[i], done, bytes);
|
2016-04-26 11:43:38 +00:00
|
|
|
}
|
2016-04-27 08:58:15 +00:00
|
|
|
|
2016-05-23 09:20:20 +00:00
|
|
|
- /* read hw index again make sure no new tx packet */
|
2016-04-26 11:43:38 +00:00
|
|
|
- if (cpu != dma || cpu != mtk_r32(eth, MTK_QTX_DRX_PTR))
|
|
|
|
- *tx_again = true;
|
|
|
|
- else
|
2016-05-23 09:20:20 +00:00
|
|
|
- mtk_w32(eth, MTK_TX_DONE_INT, MTK_QMTK_INT_STATUS);
|
|
|
|
-
|
2016-04-26 11:43:38 +00:00
|
|
|
- if (!total)
|
|
|
|
- return 0;
|
|
|
|
-
|
2016-05-23 09:20:20 +00:00
|
|
|
if (mtk_queue_stopped(eth) &&
|
|
|
|
(atomic_read(&ring->free_count) > ring->thresh))
|
2016-04-26 11:43:38 +00:00
|
|
|
mtk_wake_queue(eth);
|
|
|
|
|
|
|
|
- return total;
|
|
|
|
+ return done;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int mtk_poll(struct napi_struct *napi, int budget)
|
|
|
|
+static void mtk_handle_status_irq(struct mtk_eth *eth)
|
|
|
|
{
|
|
|
|
- struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi);
|
2016-05-23 09:20:20 +00:00
|
|
|
- u32 status, status2, mask;
|
2016-04-26 11:43:38 +00:00
|
|
|
- int tx_done, rx_done;
|
|
|
|
- bool tx_again = false;
|
|
|
|
-
|
|
|
|
- status = mtk_r32(eth, MTK_QMTK_INT_STATUS);
|
|
|
|
- status2 = mtk_r32(eth, MTK_INT_STATUS2);
|
|
|
|
- tx_done = 0;
|
|
|
|
- rx_done = 0;
|
|
|
|
- tx_again = 0;
|
|
|
|
-
|
2016-05-23 09:20:20 +00:00
|
|
|
- if (status & MTK_TX_DONE_INT)
|
2016-04-26 11:43:38 +00:00
|
|
|
- tx_done = mtk_poll_tx(eth, budget, &tx_again);
|
|
|
|
-
|
2016-05-23 09:20:20 +00:00
|
|
|
- if (status & MTK_RX_DONE_INT)
|
|
|
|
- rx_done = mtk_poll_rx(napi, budget, eth);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ u32 status2 = mtk_r32(eth, MTK_INT_STATUS2);
|
|
|
|
|
2016-05-23 09:20:20 +00:00
|
|
|
if (unlikely(status2 & (MTK_GDM1_AF | MTK_GDM2_AF))) {
|
2016-04-26 11:43:38 +00:00
|
|
|
mtk_stats_update(eth);
|
2016-05-23 09:20:20 +00:00
|
|
|
mtk_w32(eth, (MTK_GDM1_AF | MTK_GDM2_AF),
|
|
|
|
MTK_INT_STATUS2);
|
2016-04-26 11:43:38 +00:00
|
|
|
}
|
|
|
|
+}
|
2016-05-08 19:57:27 +00:00
|
|
|
+
|
2016-04-26 11:43:38 +00:00
|
|
|
+static int mtk_napi_tx(struct napi_struct *napi, int budget)
|
|
|
|
+{
|
|
|
|
+ struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi);
|
|
|
|
+ u32 status, mask;
|
|
|
|
+ int tx_done = 0;
|
|
|
|
+
|
|
|
|
+ mtk_handle_status_irq(eth);
|
2016-05-23 09:20:20 +00:00
|
|
|
+ mtk_w32(eth, MTK_TX_DONE_INT, MTK_QMTK_INT_STATUS);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ tx_done = mtk_poll_tx(eth, budget);
|
2016-05-23 09:20:20 +00:00
|
|
|
+
|
|
|
|
+ if (unlikely(netif_msg_intr(eth))) {
|
|
|
|
+ status = mtk_r32(eth, MTK_QMTK_INT_STATUS);
|
|
|
|
+ mask = mtk_r32(eth, MTK_QDMA_INT_MASK);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ dev_info(eth->dev,
|
|
|
|
+ "done tx %d, intr 0x%08x/0x%x\n",
|
|
|
|
+ tx_done, status, mask);
|
2016-05-23 09:20:20 +00:00
|
|
|
+ }
|
|
|
|
+
|
2016-04-26 11:43:38 +00:00
|
|
|
+ if (tx_done == budget)
|
2016-05-23 09:20:20 +00:00
|
|
|
+ return budget;
|
|
|
|
+
|
|
|
|
+ status = mtk_r32(eth, MTK_QMTK_INT_STATUS);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ if (status & MTK_TX_DONE_INT)
|
2016-05-23 09:20:20 +00:00
|
|
|
+ return budget;
|
|
|
|
+
|
|
|
|
+ napi_complete(napi);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ mtk_irq_enable(eth, MTK_TX_DONE_INT);
|
|
|
|
+
|
|
|
|
+ return tx_done;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int mtk_napi_rx(struct napi_struct *napi, int budget)
|
|
|
|
+{
|
|
|
|
+ struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi);
|
|
|
|
+ u32 status, mask;
|
|
|
|
+ int rx_done = 0;
|
2016-04-27 08:58:15 +00:00
|
|
|
+
|
2016-05-23 09:20:20 +00:00
|
|
|
+ mtk_handle_status_irq(eth);
|
|
|
|
+ mtk_w32(eth, MTK_RX_DONE_INT, MTK_QMTK_INT_STATUS);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ rx_done = mtk_poll_rx(napi, budget, eth);
|
2016-05-23 09:20:20 +00:00
|
|
|
|
|
|
|
if (unlikely(netif_msg_intr(eth))) {
|
|
|
|
+ status = mtk_r32(eth, MTK_QMTK_INT_STATUS);
|
|
|
|
mask = mtk_r32(eth, MTK_QDMA_INT_MASK);
|
|
|
|
- netdev_info(eth->netdev[0],
|
|
|
|
- "done tx %d, rx %d, intr 0x%08x/0x%x\n",
|
|
|
|
- tx_done, rx_done, status, mask);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ dev_info(eth->dev,
|
|
|
|
+ "done rx %d, intr 0x%08x/0x%x\n",
|
|
|
|
+ rx_done, status, mask);
|
2016-05-23 09:20:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- if (tx_again || rx_done == budget)
|
2016-04-26 11:43:38 +00:00
|
|
|
+ if (rx_done == budget)
|
2016-05-23 09:20:20 +00:00
|
|
|
return budget;
|
|
|
|
|
|
|
|
status = mtk_r32(eth, MTK_QMTK_INT_STATUS);
|
|
|
|
- if (status & (tx_intr | rx_intr))
|
2016-04-26 11:43:38 +00:00
|
|
|
+ if (status & MTK_RX_DONE_INT)
|
2016-05-23 09:20:20 +00:00
|
|
|
return budget;
|
|
|
|
|
|
|
|
napi_complete(napi);
|
|
|
|
- mtk_irq_enable(eth, MTK_RX_DONE_INT | MTK_RX_DONE_INT);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ mtk_irq_enable(eth, MTK_RX_DONE_INT);
|
|
|
|
|
|
|
|
return rx_done;
|
|
|
|
}
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1256,22 +1274,26 @@ static void mtk_tx_timeout(struct net_device *dev)
|
2016-04-26 11:43:38 +00:00
|
|
|
schedule_work(ð->pending_work);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static irqreturn_t mtk_handle_irq(int irq, void *_eth)
|
|
|
|
+static irqreturn_t mtk_handle_irq_rx(int irq, void *_eth)
|
|
|
|
{
|
|
|
|
struct mtk_eth *eth = _eth;
|
2016-05-23 09:20:20 +00:00
|
|
|
- u32 status;
|
2016-04-26 11:43:38 +00:00
|
|
|
|
2016-05-23 09:20:20 +00:00
|
|
|
- status = mtk_r32(eth, MTK_QMTK_INT_STATUS);
|
|
|
|
- if (unlikely(!status))
|
|
|
|
- return IRQ_NONE;
|
|
|
|
+ if (likely(napi_schedule_prep(ð->rx_napi))) {
|
|
|
|
+ __napi_schedule(ð->rx_napi);
|
|
|
|
+ mtk_irq_disable(eth, MTK_RX_DONE_INT);
|
|
|
|
+ }
|
2016-04-26 11:43:38 +00:00
|
|
|
|
|
|
|
- if (likely(status & (MTK_RX_DONE_INT | MTK_TX_DONE_INT))) {
|
2016-05-23 09:20:20 +00:00
|
|
|
- if (likely(napi_schedule_prep(ð->rx_napi)))
|
|
|
|
- __napi_schedule(ð->rx_napi);
|
2016-04-26 11:43:38 +00:00
|
|
|
- } else {
|
|
|
|
- mtk_w32(eth, status, MTK_QMTK_INT_STATUS);
|
|
|
|
+ return IRQ_HANDLED;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static irqreturn_t mtk_handle_irq_tx(int irq, void *_eth)
|
|
|
|
+{
|
|
|
|
+ struct mtk_eth *eth = _eth;
|
|
|
|
+
|
2016-05-23 09:20:20 +00:00
|
|
|
+ if (likely(napi_schedule_prep(ð->tx_napi))) {
|
|
|
|
+ __napi_schedule(ð->tx_napi);
|
2016-04-26 11:43:38 +00:00
|
|
|
+ mtk_irq_disable(eth, MTK_TX_DONE_INT);
|
2016-05-23 09:20:20 +00:00
|
|
|
}
|
|
|
|
- mtk_irq_disable(eth, (MTK_RX_DONE_INT | MTK_TX_DONE_INT));
|
2016-04-26 11:43:38 +00:00
|
|
|
|
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1284,7 +1306,7 @@ static void mtk_poll_controller(struct net_device *dev)
|
2016-04-26 11:43:38 +00:00
|
|
|
u32 int_mask = MTK_TX_DONE_INT | MTK_RX_DONE_INT;
|
|
|
|
|
|
|
|
mtk_irq_disable(eth, int_mask);
|
|
|
|
- mtk_handle_irq(dev->irq, dev);
|
|
|
|
+ mtk_handle_irq(dev->irq[0], dev);
|
|
|
|
mtk_irq_enable(eth, int_mask);
|
|
|
|
}
|
|
|
|
#endif
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1320,6 +1342,7 @@ static int mtk_open(struct net_device *dev)
|
2016-04-26 11:43:38 +00:00
|
|
|
if (err)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
+ napi_enable(ð->tx_napi);
|
|
|
|
napi_enable(ð->rx_napi);
|
|
|
|
mtk_irq_enable(eth, MTK_TX_DONE_INT | MTK_RX_DONE_INT);
|
|
|
|
}
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1368,6 +1391,7 @@ static int mtk_stop(struct net_device *dev)
|
2016-04-26 11:43:38 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
mtk_irq_disable(eth, MTK_TX_DONE_INT | MTK_RX_DONE_INT);
|
|
|
|
+ napi_disable(ð->tx_napi);
|
|
|
|
napi_disable(ð->rx_napi);
|
|
|
|
|
|
|
|
mtk_stop_dma(eth, MTK_QDMA_GLO_CFG);
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1405,7 +1429,11 @@ static int __init mtk_hw_init(struct mtk_eth *eth)
|
2016-04-26 11:43:38 +00:00
|
|
|
/* Enable RX VLan Offloading */
|
|
|
|
mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
|
|
|
|
|
|
|
|
- err = devm_request_irq(eth->dev, eth->irq, mtk_handle_irq, 0,
|
|
|
|
+ err = devm_request_irq(eth->dev, eth->irq[1], mtk_handle_irq_tx, 0,
|
|
|
|
+ dev_name(eth->dev), eth);
|
|
|
|
+ if (err)
|
|
|
|
+ return err;
|
|
|
|
+ err = devm_request_irq(eth->dev, eth->irq[2], mtk_handle_irq_rx, 0,
|
|
|
|
dev_name(eth->dev), eth);
|
|
|
|
if (err)
|
|
|
|
return err;
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1421,7 +1449,11 @@ static int __init mtk_hw_init(struct mtk_eth *eth)
|
2016-04-26 11:43:38 +00:00
|
|
|
mtk_w32(eth, 0, MTK_RST_GL);
|
|
|
|
|
|
|
|
/* FE int grouping */
|
|
|
|
- mtk_w32(eth, 0, MTK_FE_INT_GRP);
|
|
|
|
+ mtk_w32(eth, MTK_TX_DONE_INT, MTK_PDMA_INT_GRP1);
|
|
|
|
+ mtk_w32(eth, MTK_RX_DONE_INT, MTK_PDMA_INT_GRP2);
|
|
|
|
+ mtk_w32(eth, MTK_TX_DONE_INT, MTK_QDMA_INT_GRP1);
|
|
|
|
+ mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2);
|
|
|
|
+ mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i));
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1469,7 +1501,9 @@ static void mtk_uninit(struct net_device *dev)
|
2016-04-26 11:43:38 +00:00
|
|
|
phy_disconnect(mac->phy_dev);
|
|
|
|
mtk_mdio_cleanup(eth);
|
|
|
|
mtk_irq_disable(eth, ~0);
|
|
|
|
- free_irq(dev->irq, dev);
|
|
|
|
+ free_irq(eth->irq[0], dev);
|
|
|
|
+ free_irq(eth->irq[1], dev);
|
|
|
|
+ free_irq(eth->irq[2], dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mtk_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1744,10 +1778,10 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
|
2016-04-26 11:43:38 +00:00
|
|
|
dev_err(eth->dev, "error bringing up device\n");
|
|
|
|
goto free_netdev;
|
|
|
|
}
|
|
|
|
- eth->netdev[id]->irq = eth->irq;
|
|
|
|
+ eth->netdev[id]->irq = eth->irq[0];
|
|
|
|
netif_info(eth, probe, eth->netdev[id],
|
|
|
|
"mediatek frame engine at 0x%08lx, irq %d\n",
|
|
|
|
- eth->netdev[id]->base_addr, eth->netdev[id]->irq);
|
|
|
|
+ eth->netdev[id]->base_addr, eth->irq[0]);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1764,6 +1798,7 @@ static int mtk_probe(struct platform_device *pdev)
|
2016-04-26 11:43:38 +00:00
|
|
|
struct mtk_soc_data *soc;
|
|
|
|
struct mtk_eth *eth;
|
|
|
|
int err;
|
|
|
|
+ int i;
|
|
|
|
|
|
|
|
match = of_match_device(of_mtk_match, &pdev->dev);
|
|
|
|
soc = (struct mtk_soc_data *)match->data;
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1799,10 +1834,12 @@ static int mtk_probe(struct platform_device *pdev)
|
2016-04-26 11:43:38 +00:00
|
|
|
return PTR_ERR(eth->rstc);
|
|
|
|
}
|
|
|
|
|
|
|
|
- eth->irq = platform_get_irq(pdev, 0);
|
|
|
|
- if (eth->irq < 0) {
|
|
|
|
- dev_err(&pdev->dev, "no IRQ resource found\n");
|
|
|
|
- return -ENXIO;
|
|
|
|
+ for (i = 0; i < 3; i++) {
|
|
|
|
+ eth->irq[i] = platform_get_irq(pdev, i);
|
|
|
|
+ if (eth->irq[i] < 0) {
|
|
|
|
+ dev_err(&pdev->dev, "no IRQ%d resource found\n", i);
|
|
|
|
+ return -ENXIO;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
eth->clk_ethif = devm_clk_get(&pdev->dev, "ethif");
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1843,7 +1880,9 @@ static int mtk_probe(struct platform_device *pdev)
|
2016-04-26 11:43:38 +00:00
|
|
|
* for NAPI to work
|
|
|
|
*/
|
|
|
|
init_dummy_netdev(ð->dummy_dev);
|
|
|
|
- netif_napi_add(ð->dummy_dev, ð->rx_napi, mtk_poll,
|
|
|
|
+ netif_napi_add(ð->dummy_dev, ð->tx_napi, mtk_napi_tx,
|
|
|
|
+ MTK_NAPI_WEIGHT);
|
|
|
|
+ netif_napi_add(ð->dummy_dev, ð->rx_napi, mtk_napi_rx,
|
|
|
|
MTK_NAPI_WEIGHT);
|
|
|
|
|
|
|
|
platform_set_drvdata(pdev, eth);
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -1864,6 +1903,7 @@ static int mtk_remove(struct platform_device *pdev)
|
2016-04-26 11:43:38 +00:00
|
|
|
clk_disable_unprepare(eth->clk_gp1);
|
|
|
|
clk_disable_unprepare(eth->clk_gp2);
|
|
|
|
|
|
|
|
+ netif_napi_del(ð->tx_napi);
|
|
|
|
netif_napi_del(ð->rx_napi);
|
|
|
|
mtk_cleanup(eth);
|
|
|
|
platform_set_drvdata(pdev, NULL);
|
2016-05-23 09:20:20 +00:00
|
|
|
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
|
|
index 3159d2a..f82e3ac 100644
|
2016-04-26 11:43:38 +00:00
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
|
|
@@ -68,6 +68,10 @@
|
|
|
|
/* Unicast Filter MAC Address Register - High */
|
|
|
|
#define MTK_GDMA_MAC_ADRH(x) (0x50C + (x * 0x1000))
|
|
|
|
|
|
|
|
+/* PDMA Interrupt grouping registers */
|
|
|
|
+#define MTK_PDMA_INT_GRP1 0xa50
|
|
|
|
+#define MTK_PDMA_INT_GRP2 0xa54
|
|
|
|
+
|
|
|
|
/* QDMA TX Queue Configuration Registers */
|
|
|
|
#define MTK_QTX_CFG(x) (0x1800 + (x * 0x10))
|
|
|
|
#define QDMA_RES_THRES 4
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -125,6 +129,11 @@
|
2016-04-26 11:43:38 +00:00
|
|
|
#define MTK_TX_DONE_INT (MTK_TX_DONE_INT0 | MTK_TX_DONE_INT1 | \
|
|
|
|
MTK_TX_DONE_INT2 | MTK_TX_DONE_INT3)
|
|
|
|
|
|
|
|
+/* QDMA Interrupt grouping registers */
|
|
|
|
+#define MTK_QDMA_INT_GRP1 0x1a20
|
|
|
|
+#define MTK_QDMA_INT_GRP2 0x1a24
|
|
|
|
+#define MTK_RLS_DONE_INT BIT(0)
|
|
|
|
+
|
|
|
|
/* QDMA Interrupt Status Register */
|
|
|
|
#define MTK_QDMA_INT_MASK 0x1A1C
|
|
|
|
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -356,7 +365,8 @@ struct mtk_rx_ring {
|
2016-04-26 11:43:38 +00:00
|
|
|
* @dma_refcnt: track how many netdevs are using the DMA engine
|
|
|
|
* @tx_ring: Pointer to the memore holding info about the TX ring
|
|
|
|
* @rx_ring: Pointer to the memore holding info about the RX ring
|
|
|
|
- * @rx_napi: The NAPI struct
|
|
|
|
+ * @tx_napi: The TX NAPI struct
|
|
|
|
+ * @rx_napi: The RX NAPI struct
|
|
|
|
* @scratch_ring: Newer SoCs need memory for a second HW managed TX ring
|
|
|
|
* @phy_scratch_ring: physical address of scratch_ring
|
|
|
|
* @scratch_head: The scratch memory that scratch_ring points to.
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -377,7 +387,7 @@ struct mtk_eth {
|
2016-04-26 11:43:38 +00:00
|
|
|
struct net_device dummy_dev;
|
|
|
|
struct net_device *netdev[MTK_MAX_DEVS];
|
|
|
|
struct mtk_mac *mac[MTK_MAX_DEVS];
|
|
|
|
- int irq;
|
|
|
|
+ int irq[3];
|
|
|
|
u32 msg_enable;
|
|
|
|
unsigned long sysclk;
|
|
|
|
struct regmap *ethsys;
|
2016-05-23 09:20:20 +00:00
|
|
|
@@ -385,6 +395,7 @@ struct mtk_eth {
|
2016-04-26 11:43:38 +00:00
|
|
|
atomic_t dma_refcnt;
|
|
|
|
struct mtk_tx_ring tx_ring;
|
|
|
|
struct mtk_rx_ring rx_ring;
|
|
|
|
+ struct napi_struct tx_napi;
|
|
|
|
struct napi_struct rx_napi;
|
|
|
|
struct mtk_tx_dma *scratch_ring;
|
|
|
|
dma_addr_t phy_scratch_ring;
|
2016-05-23 09:20:20 +00:00
|
|
|
--
|
|
|
|
1.7.10.4
|
|
|
|
|