[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250213044624.37334-3-swathi.ks@samsung.com>
Date: Thu, 13 Feb 2025 10:16:24 +0530
From: Swathi K S <swathi.ks@...sung.com>
To: krzk+dt@...nel.org, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com, robh@...nel.org,
conor+dt@...nel.org, richardcochran@...il.com, mcoquelin.stm32@...il.com,
alexandre.torgue@...s.st.com
Cc: rmk+kernel@...linux.org.uk, swathi.ks@...sung.com,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH v6 2/2] net: stmmac: dwc-qos: Add FSD EQoS support
The FSD SoC contains two instance of the Synopsys DWC ethernet QOS IP core.
The binding that it uses is slightly different from existing ones because
of the integration (clocks, resets).
Signed-off-by: Swathi K S <swathi.ks@...sung.com>
---
.../stmicro/stmmac/dwmac-dwc-qos-eth.c | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
index 5d2dd123979b..e3b383d8e7ef 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
@@ -308,6 +308,29 @@ static void tegra_eqos_remove(struct platform_device *pdev)
gpiod_set_value(eqos->reset, 1);
}
+static int fsd_eqos_probe(struct platform_device *pdev,
+ struct plat_stmmacenet_data *data,
+ struct stmmac_resources *res)
+{
+ struct clk *clk_rx1 = NULL;
+ struct clk *clk_rx2 = NULL;
+
+ for (int i = 0; i < data->num_clks; i++) {
+ if (strcmp(data->clks[i].id, "slave_bus") == 0)
+ data->stmmac_clk = data->clks[i].clk;
+ else if (strcmp(data->clks[i].id, "eqos_rxclk_mux") == 0)
+ clk_rx1 = data->clks[i].clk;
+ else if (strcmp(data->clks[i].id, "eqos_phyrxclk") == 0)
+ clk_rx2 = data->clks[i].clk;
+ }
+
+ /* Eth0 RX clock doesn't support MUX */
+ if (clk_rx1)
+ clk_set_parent(clk_rx1, clk_rx2);
+
+ return 0;
+}
+
struct dwc_eth_dwmac_data {
int (*probe)(struct platform_device *pdev,
struct plat_stmmacenet_data *data,
@@ -324,6 +347,10 @@ static const struct dwc_eth_dwmac_data tegra_eqos_data = {
.remove = tegra_eqos_remove,
};
+static const struct dwc_eth_dwmac_data fsd_eqos_data = {
+ .probe = fsd_eqos_probe,
+};
+
static int dwc_eth_dwmac_probe(struct platform_device *pdev)
{
const struct dwc_eth_dwmac_data *data;
@@ -402,6 +429,7 @@ static void dwc_eth_dwmac_remove(struct platform_device *pdev)
static const struct of_device_id dwc_eth_dwmac_match[] = {
{ .compatible = "snps,dwc-qos-ethernet-4.10", .data = &dwc_qos_data },
{ .compatible = "nvidia,tegra186-eqos", .data = &tegra_eqos_data },
+ { .compatible = "tesla,fsd-ethqos", .data = &fsd_eqos_data },
{ }
};
MODULE_DEVICE_TABLE(of, dwc_eth_dwmac_match);
--
2.17.1
Powered by blists - more mailing lists