mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v1] net: stmmac: init more plat members from DT
@ 2024-06-20  6:40 Furong Xu
  2024-06-20 19:21 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Furong Xu @ 2024-06-20  6:40 UTC (permalink / raw)
  To: David S. Miller, Alexandre Torgue, Jose Abreu, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Joao Pinto,
	Simon Horman
  Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel, xfr,
	rock.xu, Furong Xu

A new option to init some useful members of plat_stmmacenet_data from DT.

Signed-off-by: Furong Xu <0x1207@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 54797edc9b38..b86cfb2570ab 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -497,6 +497,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 
 	of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
 
+	of_property_read_u32(np, "host-dma-width", &plat->host_dma_width);
+
 	plat->force_sf_dma_mode =
 		of_property_read_bool(np, "snps,force_sf_dma_mode");
 
@@ -561,6 +563,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 		plat->pmt = 1;
 		if (of_property_read_bool(np, "snps,tso"))
 			plat->flags |= STMMAC_FLAG_TSO_EN;
+		if (of_property_read_bool(np, "snps,no-sph"))
+			plat->flags |= STMMAC_FLAG_SPH_DISABLE;
 	}
 
 	if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
@@ -573,8 +577,11 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 	if (of_device_is_compatible(np, "snps,dwxgmac")) {
 		plat->has_xgmac = 1;
 		plat->pmt = 1;
+		of_property_read_u32(np, "max-frame-size", &plat->maxmtu);
 		if (of_property_read_bool(np, "snps,tso"))
 			plat->flags |= STMMAC_FLAG_TSO_EN;
+		if (of_property_read_bool(np, "snps,no-sph"))
+			plat->flags |= STMMAC_FLAG_SPH_DISABLE;
 	}
 
 	dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
-- 
2.34.1


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

* Re: [PATCH net-next v1] net: stmmac: init more plat members from DT
  2024-06-20  6:40 [PATCH net-next v1] net: stmmac: init more plat members from DT Furong Xu
@ 2024-06-20 19:21 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2024-06-20 19:21 UTC (permalink / raw)
  To: Furong Xu
  Cc: David S. Miller, Alexandre Torgue, Jose Abreu, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Joao Pinto,
	Simon Horman, netdev, linux-stm32, linux-arm-kernel,
	linux-kernel, xfr, rock.xu

On Thu, Jun 20, 2024 at 02:40:04PM +0800, Furong Xu wrote:
> A new option to init some useful members of plat_stmmacenet_data from DT.

Are these documented in the binding?

Also, do you have a .dts file which makes use of these. We don't like
to add things unless there is a user.

    Andrew

---
pw-bot: cr

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

end of thread, other threads:[~2024-06-20 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-20  6:40 [PATCH net-next v1] net: stmmac: init more plat members from DT Furong Xu
2024-06-20 19:21 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®