[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240620064004.573280-1-0x1207@gmail.com>
Date: Thu, 20 Jun 2024 14:40:04 +0800
From: Furong Xu <0x1207@...il.com>
To: "David S. Miller" <davem@...emloft.net>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Joao Pinto <jpinto@...opsys.com>,
Simon Horman <horms@...nel.org>
Cc: netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
xfr@...look.com,
rock.xu@....com,
Furong Xu <0x1207@...il.com>
Subject: [PATCH net-next v1] net: stmmac: init more plat members from DT
A new option to init some useful members of plat_stmmacenet_data from DT.
Signed-off-by: Furong Xu <0x1207@...il.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
Powered by blists - more mailing lists