From: Swathi K S <swathi.ks@samsung.com>
To: krzk+dt@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
robh@kernel.org, conor+dt@kernel.org, richardcochran@gmail.com,
mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com
Cc: rmk+kernel@armlinux.org.uk, swathi.ks@samsung.com,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v6 2/2] net: stmmac: dwc-qos: Add FSD EQoS support
Date: Thu, 13 Feb 2025 10:16:24 +0530 [thread overview]
Message-ID: <20250213044624.37334-3-swathi.ks@samsung.com> (raw)
In-Reply-To: <20250213044624.37334-1-swathi.ks@samsung.com>
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@samsung.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
prev parent reply other threads:[~2025-02-13 5:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250213044950epcas5p1a7badb480a7e8d843fe0ff51bcf5cbf4@epcas5p1.samsung.com>
2025-02-13 4:46 ` [PATCH v6 0/2] net: stmmac: dwc-qos: Add FSD EQoS support Swathi K S
2025-02-13 4:46 ` [PATCH v6 1/2] dt-bindings: net: Add FSD EQoS device tree bindings Swathi K S
2025-02-13 7:54 ` Krzysztof Kozlowski
2025-02-13 11:04 ` Swathi K S
2025-02-13 12:00 ` Krzysztof Kozlowski
2025-02-14 4:53 ` Swathi K S
2025-02-14 7:31 ` Krzysztof Kozlowski
2025-02-14 9:33 ` Swathi K S
2025-02-14 10:55 ` Krzysztof Kozlowski
2025-02-14 0:19 ` Andrew Lunn
2025-02-14 5:17 ` Swathi K S
2025-02-14 13:10 ` Andrew Lunn
2025-02-17 5:19 ` Swathi K S
2025-02-17 15:18 ` Andrew Lunn
2025-02-18 3:55 ` Swathi K S
2025-02-18 15:33 ` Andrew Lunn
2025-02-13 4:46 ` Swathi K S [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250213044624.37334-3-swathi.ks@samsung.com \
--to=swathi.ks@samsung.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.