Skip to contentSkip to conversation

dt-bindings: net: snps,dwmac: DMA Arbitration scheme

PATCH In review Christian Marangi 2 participants 3 messages Sep 27, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: net: snps,dwmac: DMA Arbitration scheme

Document new binding snps,arbit to program the DMA to use Arbitration scheme. (Rx has priority over Tx)

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +6 -0
index 5c2769dc689a..4499f221c29b 100644
@@ -442,6 +442,12 @@ properties:
     description:
       Use Address-Aligned Beats
 
+  snps,arbit:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Program the DMA to use Arbitration scheme.
+      (Rx has priority over Tx)
+
   snps,fixed-burst:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
Signature · 1 line
2.40.1
#1 lore raw

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.

---
 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(+)
drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c +3 -0
index daf79cdbd3ec..14eb7e8d61ea 100644
@@ -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 */
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +1 -0
index 843bd8804bfa..f5791b03b320 100644
@@ -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");
 
include/linux/stmmac.h +1 -0
index c0079a7574ae..04a61f1eba90 100644
@@ -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;
Signature · 1 line
2.40.1
#2 lore raw
In reply to Christian Marangi
Quoted 13 lines · Christian Marangi

Document new binding snps,arbit to program the DMA to use Arbitration scheme. (Rx has priority over Tx)

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +0 -0
index 5c2769dc689a..4499f221c29b 100644

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 449

Quoted 8 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +5 -0
@@ -442,6 +442,12 @@ properties:
     description:
       Use Address-Aligned Beats
 
+  snps,arbit:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Program the DMA to use Arbitration scheme.
+      (Rx has priority over Tx)

Can you explain please what makes this a property of the hardware, or otherwise makes it suitable for inclusion in DT?

Quoted 7 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +1 -0
+
   snps,fixed-burst:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
Signature · 1 line
2.40.1