Commit 9072e03d authored by Swee Leong Ching's avatar Swee Leong Ching Committed by David S. Miller

net: stmmac: Add support for TX/RX channel interrupt

Enable TX/RX channel interrupt registration for MAC that interrupts CPU
through shared peripheral interrupt (SPI).

Per channel interrupts and interrupt-names are registered through,
Eg: 4 tx and 4 rx channels:
interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
             <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
             <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
             <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
             <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
             <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
             <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
             <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "dma_tx0",
                  "dma_tx1",
                  "dma_tx2",
                  "dma_tx3",
                  "dma_rx0",
                  "dma_rx1",
                  "dma_rx2",
                  "dma_rx3";
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 477bd4be
...@@ -710,6 +710,10 @@ EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt); ...@@ -710,6 +710,10 @@ EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt);
int stmmac_get_platform_resources(struct platform_device *pdev, int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res) struct stmmac_resources *stmmac_res)
{ {
char irq_name[9];
int i;
int irq;
memset(stmmac_res, 0, sizeof(*stmmac_res)); memset(stmmac_res, 0, sizeof(*stmmac_res));
/* Get IRQ information early to have an ability to ask for deferred /* Get IRQ information early to have an ability to ask for deferred
...@@ -743,6 +747,30 @@ int stmmac_get_platform_resources(struct platform_device *pdev, ...@@ -743,6 +747,30 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
dev_info(&pdev->dev, "IRQ eth_lpi not found\n"); dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
} }
/* For RX Channel */
for (i = 0; i < MTL_MAX_RX_QUEUES; i++) {
snprintf(irq_name, sizeof(irq_name), "dma_rx%i", i);
irq = platform_get_irq_byname_optional(pdev, irq_name);
if (irq == -EPROBE_DEFER)
return irq;
else if (irq < 0)
break;
stmmac_res->rx_irq[i] = irq;
}
/* For TX Channel */
for (i = 0; i < MTL_MAX_TX_QUEUES; i++) {
snprintf(irq_name, sizeof(irq_name), "dma_tx%i", i);
irq = platform_get_irq_byname_optional(pdev, irq_name);
if (irq == -EPROBE_DEFER)
return irq;
else if (irq < 0)
break;
stmmac_res->tx_irq[i] = irq;
}
stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0); stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
return PTR_ERR_OR_ZERO(stmmac_res->addr); return PTR_ERR_OR_ZERO(stmmac_res->addr);
......
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