Skip to contentSkip to conversation

net: stmmac: socfpga: support both stmmaceth-ocp and ahb reset names

PATCH Superseded Dinh Nguyen 2 participants 4 messages Dec 29, 2025 – Dec 30, 2025

Subsystems (7)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Dinh Nguyen

author maintainer
#0 lore raw

cover net: stmmac: socfpga: support both stmmaceth-ocp and ahb reset names

The dwmac-socfpga stmmac ethernet controller supports 2 standard reset lines, named "stmmaceth" and "stmmaceth-ocp". At the time of upstreaming support for the platform, the "stmmaceth-ocp" name was used for the 2nd reset name. We later realized that the "stmmaceth-ocp" reset name is the same as the "ahb" name that is used by the standard stmmac driver. But since the "stmmaceth-ocp" name support has already been introduced to the wild, it cannot just be removed from the driver, thus we can modify the driver to support both "stmmaceth-ocp" and "ahb", with the idea that "ahb" will be used going forward.

This series add the support to call reset assert/de-assert both "abh" and "stmmaceth-ocp" to the dwmac-socfpga platform driver, then reverts the patch that uses the DTS "stmmaceth-ocp" reset name.

---
Dinh Nguyen (2):
net: stmmac: socfpga: add call to assert/deassert ahb reset line Revert "arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb""

 arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi | 6 +++---
 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c  | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251229-remove_ocp-44786389b052

Best regards,

Signature · 1 line
Dinh Nguyen <[email protected]>
author maintainer
#1 lore raw

PATCH 1/2 net: stmmac: socfpga: add call to assert/deassert ahb reset line

The "stmmaceth-ocp" reset line of stmmac controller on the SoCFPGA platform is essentially the "ahb" reset on the standard stmmac controller. But since stmmaceth-ocp has already been introduced into the wild, we cannot just remove support for it. But what we can do is to support both "stmmaceth-ocp" and "ahb" reset names. Going forward we will be using "ahb", but in order to not break ABI, we will be call reset assert/de-assert both ahb and stmmaceth-ocp.

The ethernet hardware on SoCFPGA requires either the stmmaceth-ocp or ahb reset to be asserted every time before changing the phy mode, then de-asserted when the phy mode has been set.

With this change, we should be able to revert patch:
commit 62a40a0d5634 ("arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb"")

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +4 -0
index a2b52d2c4eb6..79df55515c71 100644
@@ -407,6 +407,7 @@ static int socfpga_gen5_set_phy_mode(struct socfpga_dwmac *dwmac)
 
 	/* Assert reset to the enet controller before changing the phy mode */
 	reset_control_assert(dwmac->stmmac_ocp_rst);
+	reset_control_assert(dwmac->plat_dat->stmmac_ahb_rst);
 	reset_control_assert(dwmac->stmmac_rst);
 
 	regmap_read(sys_mgr_base_addr, reg_offset, &ctrl);
@@ -436,6 +437,7 @@ static int socfpga_gen5_set_phy_mode(struct socfpga_dwmac *dwmac)
 	 * the enet controller, and operation to start in requested mode
 	 */
 	reset_control_deassert(dwmac->stmmac_ocp_rst);
+	reset_control_deassert(dwmac->plat_dat->stmmac_ahb_rst);
 	reset_control_deassert(dwmac->stmmac_rst);
 	if (phymode == PHY_INTERFACE_MODE_SGMII)
 		socfpga_sgmii_config(dwmac, true);
@@ -463,6 +465,7 @@ static int socfpga_gen10_set_phy_mode(struct socfpga_dwmac *dwmac)
 
 	/* Assert reset to the enet controller before changing the phy mode */
 	reset_control_assert(dwmac->stmmac_ocp_rst);
+	reset_control_assert(dwmac->plat_dat->stmmac_ahb_rst);
 	reset_control_assert(dwmac->stmmac_rst);
 
 	regmap_read(sys_mgr_base_addr, reg_offset, &ctrl);
@@ -489,6 +492,7 @@ static int socfpga_gen10_set_phy_mode(struct socfpga_dwmac *dwmac)
 	 * the enet controller, and operation to start in requested mode
 	 */
 	reset_control_deassert(dwmac->stmmac_ocp_rst);
+	reset_control_deassert(dwmac->plat_dat->stmmac_ahb_rst);
 	reset_control_deassert(dwmac->stmmac_rst);
 	if (phymode == PHY_INTERFACE_MODE_SGMII)
 		socfpga_sgmii_config(dwmac, true);
Signature · 1 line
2.42.0.411.g813d9a9188
author maintainer
#2 lore raw

PATCH 2/2 Revert "arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb""

In reply to Dinh Nguyen

This reverts commit 62a40a0d5634834790f7166ab592be247390d857.

With the patch "add call to assert/deassert ahb reset line" in place, we can safely remove the "stmmaceth-ocp" reset name and just use the standard "ahb" reset name.

---
 arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi +3 -3
index b108265e9bde..6b6e77596ffa 100644
@@ -440,7 +440,7 @@ gmac0: ethernet@ff800000 {
 			clocks = <&l4_mp_clk>, <&peri_emac_ptp_clk>;
 			clock-names = "stmmaceth", "ptp_ref";
 			resets = <&rst EMAC0_RESET>, <&rst EMAC0_OCP_RESET>;
-			reset-names = "stmmaceth", "stmmaceth-ocp";
+			reset-names = "stmmaceth", "ahb";
 			snps,axi-config = <&socfpga_axi_setup>;
 			status = "disabled";
 		};
@@ -460,7 +460,7 @@ gmac1: ethernet@ff802000 {
 			clocks = <&l4_mp_clk>, <&peri_emac_ptp_clk>;
 			clock-names = "stmmaceth", "ptp_ref";
 			resets = <&rst EMAC1_RESET>, <&rst EMAC1_OCP_RESET>;
-			reset-names = "stmmaceth", "stmmaceth-ocp";
+			reset-names = "stmmaceth", "ahb";
 			snps,axi-config = <&socfpga_axi_setup>;
 			status = "disabled";
 		};
@@ -480,7 +480,7 @@ gmac2: ethernet@ff804000 {
 			clocks = <&l4_mp_clk>, <&peri_emac_ptp_clk>;
 			clock-names = "stmmaceth", "ptp_ref";
 			resets = <&rst EMAC2_RESET>, <&rst EMAC2_OCP_RESET>;
-			reset-names = "stmmaceth", "stmmaceth-ocp";
+			reset-names = "stmmaceth", "ahb";
 			snps,axi-config = <&socfpga_axi_setup>;
 			status = "disabled";
 		};
Signature · 1 line
2.42.0.411.g813d9a9188
#3 lore raw

Re: [PATCH 2/2] Revert "arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb""

Quoted 5 lines · Dinh Nguyen

This reverts commit 62a40a0d5634834790f7166ab592be247390d857.

With the patch "add call to assert/deassert ahb reset line" in place, we can safely remove the "stmmaceth-ocp" reset name and just use the standard "ahb" reset name.

altr,socfpga-stmmac.yamle says:

# TODO: Determine how to handle the Arria10 reset-name, stmmaceth-ocp, that

  # does not validate against net/snps,dwmac.yaml.

Please add a patch to the series adding stmmaceth-ocp, but mark it as deprecated, and comment that ahb should be used instead.

Andrew

---
pw-bot: cr