netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] net: stmmac: socfpga: support both stmmaceth-ocp and ahb reset names
@ 2026-01-05 12:08 Dinh Nguyen
  2026-01-05 12:08 ` [PATCH v2 1/3] net: stmmac: socfpga: add call to assert/deassert ahb reset line Dinh Nguyen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dinh Nguyen @ 2026-01-05 12:08 UTC (permalink / raw)
  To: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	Philipp Zabel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Mamta Shukla, Ahmad Fatoum
  Cc: bsp-development.geo, Pengutronix Kernel Team, netdev, linux-stm32,
	linux-arm-kernel, linux-kernel, devicetree, Dinh Nguyen

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.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
Changes in v2:
- Added a dt-binding patch to mark 'stmmaceth-ocp' as deprecated
- Link to v1: https://lore.kernel.org/r/20251229-remove_ocp-v1-0-594294e04bd4@kernel.org

---
Dinh Nguyen (3):
      net: stmmac: socfpga: add call to assert/deassert ahb reset line
      Revert "arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb""
      dt-bindings: net: altr,socfpga-stmmac: deprecate 'stmmaceth-ocp'

 .../devicetree/bindings/net/altr,socfpga-stmmac.yaml          | 11 +++++++++--
 arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi          |  6 +++---
 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c           |  4 ++++
 3 files changed, 16 insertions(+), 5 deletions(-)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251229-remove_ocp-44786389b052

Best regards,
-- 
Dinh Nguyen <dinguyen@kernel.org>


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

* [PATCH v2 1/3] net: stmmac: socfpga: add call to assert/deassert ahb reset line
  2026-01-05 12:08 [PATCH v2 0/3] net: stmmac: socfpga: support both stmmaceth-ocp and ahb reset names Dinh Nguyen
@ 2026-01-05 12:08 ` Dinh Nguyen
  2026-01-05 12:08 ` [PATCH v2 2/3] Revert "arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb"" Dinh Nguyen
  2026-01-05 12:08 ` [PATCH v2 3/3] dt-bindings: net: altr,socfpga-stmmac: deprecate 'stmmaceth-ocp' Dinh Nguyen
  2 siblings, 0 replies; 6+ messages in thread
From: Dinh Nguyen @ 2026-01-05 12:08 UTC (permalink / raw)
  To: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	Philipp Zabel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Mamta Shukla, Ahmad Fatoum
  Cc: bsp-development.geo, Pengutronix Kernel Team, netdev, linux-stm32,
	linux-arm-kernel, linux-kernel, devicetree, Dinh Nguyen

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"")

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index a2b52d2c4eb6..79df55515c71 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -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);

-- 
2.42.0.411.g813d9a9188


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

* [PATCH v2 2/3] Revert "arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb""
  2026-01-05 12:08 [PATCH v2 0/3] net: stmmac: socfpga: support both stmmaceth-ocp and ahb reset names Dinh Nguyen
  2026-01-05 12:08 ` [PATCH v2 1/3] net: stmmac: socfpga: add call to assert/deassert ahb reset line Dinh Nguyen
@ 2026-01-05 12:08 ` Dinh Nguyen
  2026-01-05 12:08 ` [PATCH v2 3/3] dt-bindings: net: altr,socfpga-stmmac: deprecate 'stmmaceth-ocp' Dinh Nguyen
  2 siblings, 0 replies; 6+ messages in thread
From: Dinh Nguyen @ 2026-01-05 12:08 UTC (permalink / raw)
  To: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	Philipp Zabel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Mamta Shukla, Ahmad Fatoum
  Cc: bsp-development.geo, Pengutronix Kernel Team, netdev, linux-stm32,
	linux-arm-kernel, linux-kernel, devicetree, 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.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi b/arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi
index b108265e9bde..6b6e77596ffa 100644
--- a/arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi
+++ b/arch/arm/boot/dts/intel/socfpga/socfpga_arria10.dtsi
@@ -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";
 		};

-- 
2.42.0.411.g813d9a9188


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

* [PATCH v2 3/3] dt-bindings: net: altr,socfpga-stmmac: deprecate 'stmmaceth-ocp'
  2026-01-05 12:08 [PATCH v2 0/3] net: stmmac: socfpga: support both stmmaceth-ocp and ahb reset names Dinh Nguyen
  2026-01-05 12:08 ` [PATCH v2 1/3] net: stmmac: socfpga: add call to assert/deassert ahb reset line Dinh Nguyen
  2026-01-05 12:08 ` [PATCH v2 2/3] Revert "arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb"" Dinh Nguyen
@ 2026-01-05 12:08 ` Dinh Nguyen
  2026-01-06 19:01   ` Rob Herring
  2 siblings, 1 reply; 6+ messages in thread
From: Dinh Nguyen @ 2026-01-05 12:08 UTC (permalink / raw)
  To: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	Philipp Zabel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Mamta Shukla, Ahmad Fatoum
  Cc: bsp-development.geo, Pengutronix Kernel Team, netdev, linux-stm32,
	linux-arm-kernel, linux-kernel, devicetree, Dinh Nguyen

Make the reset name 'stmmaceth-ocp' as deprecated and to use 'ahb' going
forward.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 .../devicetree/bindings/net/altr,socfpga-stmmac.yaml          | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
index fc445ad5a1f1..4ba06a955fe2 100644
--- a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
+++ b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
@@ -13,8 +13,6 @@ description:
   This binding describes the Altera SOCFPGA SoC implementation of the
   Synopsys DWMAC for the Cyclone5, Arria5, Stratix10, Agilex5 and Agilex7
   families of chips.
-  # TODO: Determine how to handle the Arria10 reset-name, stmmaceth-ocp, that
-  # does not validate against net/snps,dwmac.yaml.
 
 select:
   properties:
@@ -84,6 +82,15 @@ properties:
       - sgmii
       - 1000base-x
 
+  resets:
+    minItems: 1
+
+  reset-names:
+    deprecated: true
+    items:
+      - const: stmmaceth-ocp
+    description: Do not use 'stmmaceth-ocp' going forward, please use 'ahb' instead.
+
   rxc-skew-ps:
     description: Skew control of RXC pad
 

-- 
2.42.0.411.g813d9a9188


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

* Re: [PATCH v2 3/3] dt-bindings: net: altr,socfpga-stmmac: deprecate 'stmmaceth-ocp'
  2026-01-05 12:08 ` [PATCH v2 3/3] dt-bindings: net: altr,socfpga-stmmac: deprecate 'stmmaceth-ocp' Dinh Nguyen
@ 2026-01-06 19:01   ` Rob Herring
  2026-01-07  2:09     ` Dinh Nguyen
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2026-01-06 19:01 UTC (permalink / raw)
  To: Dinh Nguyen
  Cc: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	Philipp Zabel, Krzysztof Kozlowski, Conor Dooley, Mamta Shukla,
	Ahmad Fatoum, bsp-development.geo, Pengutronix Kernel Team,
	netdev, linux-stm32, linux-arm-kernel, linux-kernel, devicetree

On Mon, Jan 05, 2026 at 06:08:22AM -0600, Dinh Nguyen wrote:
> Make the reset name 'stmmaceth-ocp' as deprecated and to use 'ahb' going
> forward.
> 
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
>  .../devicetree/bindings/net/altr,socfpga-stmmac.yaml          | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
> index fc445ad5a1f1..4ba06a955fe2 100644
> --- a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
> +++ b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
> @@ -13,8 +13,6 @@ description:
>    This binding describes the Altera SOCFPGA SoC implementation of the
>    Synopsys DWMAC for the Cyclone5, Arria5, Stratix10, Agilex5 and Agilex7
>    families of chips.
> -  # TODO: Determine how to handle the Arria10 reset-name, stmmaceth-ocp, that
> -  # does not validate against net/snps,dwmac.yaml.
>  
>  select:
>    properties:
> @@ -84,6 +82,15 @@ properties:
>        - sgmii
>        - 1000base-x
>  
> +  resets:
> +    minItems: 1

That's already the min in the referenced schema.

> +
> +  reset-names:
> +    deprecated: true
> +    items:
> +      - const: stmmaceth-ocp

This says stmmaceth-ocp is the 1st entry, but it is the 2nd.

You can't really fix this to validate a DT using stmmaceth-ocp. I would 
just drop this. So that leaves this with just dropping the TODO.

Rob

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

* Re: [PATCH v2 3/3] dt-bindings: net: altr,socfpga-stmmac: deprecate 'stmmaceth-ocp'
  2026-01-06 19:01   ` Rob Herring
@ 2026-01-07  2:09     ` Dinh Nguyen
  0 siblings, 0 replies; 6+ messages in thread
From: Dinh Nguyen @ 2026-01-07  2:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	Philipp Zabel, Krzysztof Kozlowski, Conor Dooley, Mamta Shukla,
	Ahmad Fatoum, bsp-development.geo, Pengutronix Kernel Team,
	netdev, linux-stm32, linux-arm-kernel, linux-kernel, devicetree



On 1/6/26 13:01, Rob Herring wrote:
> On Mon, Jan 05, 2026 at 06:08:22AM -0600, Dinh Nguyen wrote:
>> Make the reset name 'stmmaceth-ocp' as deprecated and to use 'ahb' going
>> forward.
>>
>> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
>> ---
>>   .../devicetree/bindings/net/altr,socfpga-stmmac.yaml          | 11 +++++++++--
>>   1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
>> index fc445ad5a1f1..4ba06a955fe2 100644
>> --- a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
>> +++ b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
>> @@ -13,8 +13,6 @@ description:
>>     This binding describes the Altera SOCFPGA SoC implementation of the
>>     Synopsys DWMAC for the Cyclone5, Arria5, Stratix10, Agilex5 and Agilex7
>>     families of chips.
>> -  # TODO: Determine how to handle the Arria10 reset-name, stmmaceth-ocp, that
>> -  # does not validate against net/snps,dwmac.yaml.
>>   
>>   select:
>>     properties:
>> @@ -84,6 +82,15 @@ properties:
>>         - sgmii
>>         - 1000base-x
>>   
>> +  resets:
>> +    minItems: 1
> 
> That's already the min in the referenced schema.
>

Yeah, I had to add this, else it would fail the 'make dt_binding_check 
DT_SCHEMA_FILES'.

>> +
>> +  reset-names:
>> +    deprecated: true
>> +    items:
>> +      - const: stmmaceth-ocp
> 
> This says stmmaceth-ocp is the 1st entry, but it is the 2nd.
> 
> You can't really fix this to validate a DT using stmmaceth-ocp. I would
> just drop this. So that leaves this with just dropping the TODO.

Got it.

Thanks,
Dinh


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

end of thread, other threads:[~2026-01-07  2:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 12:08 [PATCH v2 0/3] net: stmmac: socfpga: support both stmmaceth-ocp and ahb reset names Dinh Nguyen
2026-01-05 12:08 ` [PATCH v2 1/3] net: stmmac: socfpga: add call to assert/deassert ahb reset line Dinh Nguyen
2026-01-05 12:08 ` [PATCH v2 2/3] Revert "arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb"" Dinh Nguyen
2026-01-05 12:08 ` [PATCH v2 3/3] dt-bindings: net: altr,socfpga-stmmac: deprecate 'stmmaceth-ocp' Dinh Nguyen
2026-01-06 19:01   ` Rob Herring
2026-01-07  2:09     ` Dinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).