devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH 1/2] dt-bindings: net: snps,dwmac: DMA Arbitration scheme
@ 2023-09-27 12:29 Christian Marangi
  2023-09-27 12:29 ` [net-next PATCH 2/2] net: stmmac: add support for DMA Arbitration Scheme Christian Marangi
  2023-09-27 14:59 ` [net-next PATCH 1/2] dt-bindings: net: snps,dwmac: DMA Arbitration scheme Conor Dooley
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Marangi @ 2023-09-27 12:29 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Simon Horman, Andrew Halaney,
	Bartosz Golaszewski, Russell King (Oracle), Shenwei Wang,
	Jochen Henneberg, Giuseppe Cavallaro, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel
  Cc: Christian Marangi

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

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 5c2769dc689a..4499f221c29b 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -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:
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [net-next PATCH 2/2] net: stmmac: add support for DMA Arbitration Scheme
  2023-09-27 12:29 [net-next PATCH 1/2] dt-bindings: net: snps,dwmac: DMA Arbitration scheme Christian Marangi
@ 2023-09-27 12:29 ` Christian Marangi
  2023-09-27 14:59 ` [net-next PATCH 1/2] dt-bindings: net: snps,dwmac: DMA Arbitration scheme Conor Dooley
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Marangi @ 2023-09-27 12:29 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Simon Horman, Andrew Halaney,
	Bartosz Golaszewski, Russell King (Oracle), Shenwei Wang,
	Jochen Henneberg, Giuseppe Cavallaro, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel
  Cc: Christian Marangi

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@gmail.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [net-next PATCH 1/2] dt-bindings: net: snps,dwmac: DMA Arbitration scheme
  2023-09-27 12:29 [net-next PATCH 1/2] dt-bindings: net: snps,dwmac: DMA Arbitration scheme Christian Marangi
  2023-09-27 12:29 ` [net-next PATCH 2/2] net: stmmac: add support for DMA Arbitration Scheme Christian Marangi
@ 2023-09-27 14:59 ` Conor Dooley
  1 sibling, 0 replies; 3+ messages in thread
From: Conor Dooley @ 2023-09-27 14:59 UTC (permalink / raw)
  To: Christian Marangi
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Simon Horman, Andrew Halaney,
	Bartosz Golaszewski, Russell King (Oracle), Shenwei Wang,
	Jochen Henneberg, Giuseppe Cavallaro, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

On Wed, Sep 27, 2023 at 02:29:27PM +0200, Christian Marangi wrote:
> Document new binding snps,arbit to program the DMA to use Arbitration
> scheme. (Rx has priority over Tx)
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index 5c2769dc689a..4499f221c29b 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -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?

> +
>    snps,fixed-burst:
>      $ref: /schemas/types.yaml#/definitions/flag
>      description:
> -- 
> 2.40.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-27 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27 12:29 [net-next PATCH 1/2] dt-bindings: net: snps,dwmac: DMA Arbitration scheme Christian Marangi
2023-09-27 12:29 ` [net-next PATCH 2/2] net: stmmac: add support for DMA Arbitration Scheme Christian Marangi
2023-09-27 14:59 ` [net-next PATCH 1/2] dt-bindings: net: snps,dwmac: DMA Arbitration scheme Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).