[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230927122928.22033-2-ansuelsmth@gmail.com>
Date: Wed, 27 Sep 2023 14:29:28 +0200
From: Christian Marangi <ansuelsmth@...il.com>
To: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Simon Horman <horms@...nel.org>,
Andrew Halaney <ahalaney@...hat.com>,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
Shenwei Wang <shenwei.wang@....com>,
Jochen Henneberg <jh@...neberg-systemdesign.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
netdev@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org
Cc: Christian Marangi <ansuelsmth@...il.com>
Subject: [net-next PATCH 2/2] net: stmmac: add support for DMA Arbitration Scheme
Add support for DMA Arbitration Scheme tune up to program the DMA to put
priority on Rx instead of applying Round-Robin logic.
This special DMA bus mode was defined in the header from a long time but
was never actually implemented. This option is used on the original
setup on the ipq806x-gmac driver based on DWMAC1000.
Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c | 3 +++
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 1 +
include/linux/stmmac.h | 1 +
3 files changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
index daf79cdbd3ec..14eb7e8d61ea 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
@@ -104,6 +104,9 @@ static void dwmac1000_dma_init(void __iomem *ioaddr,
if (dma_cfg->aal)
value |= DMA_BUS_MODE_AAL;
+ if (dma_cfg->arbit)
+ value |= DMA_BUS_MODE_DA;
+
writel(value, ioaddr + DMA_BUS_MODE);
/* Mask interrupts by writing to CSR7 */
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 843bd8804bfa..f5791b03b320 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -576,6 +576,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
dma_cfg->pblx8 = !of_property_read_bool(np, "snps,no-pbl-x8");
dma_cfg->aal = of_property_read_bool(np, "snps,aal");
+ dma_cfg->arbit = of_property_read_bool(np, "snps,arbit");
dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst");
dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst");
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index c0079a7574ae..04a61f1eba90 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -97,6 +97,7 @@ struct stmmac_dma_cfg {
int fixed_burst;
int mixed_burst;
bool aal;
+ bool arbit;
bool eame;
bool multi_msi_en;
bool dche;
--
2.40.1
Powered by blists - more mailing lists