This patch series adds support for an optional reset line to the
ftgmac100 ethernet controller, as used on Aspeed SoCs. On these SoCs,
the internal MAC reset is not sufficient to reset the RMII interface.
By providing a SoC-level reset via the device tree "resets" property,
the driver can properly reset both the MAC and RMII logic, ensuring
correct operation in RMII mode.
The series includes:
- Device tree binding update to document the new "resets" property.
- Addition of MAC1 and MAC2 reset definitions for AST2600.
- Device tree changes for AST2600 to use the new reset properties.
- Driver changes to assert/deassert the reset line as needed.
This improves reliability and initialization of the MAC in RMII mode
on Aspeed platforms.
Jacky Chou (4):
dt-bindings: net: ftgmac100: Add resets property
dt-bindings: clock: ast2600: Add reset definitions for MAC1 and MAC2
ARM: dts: aspeed-g6: Add resets property for MAC controllers
net: ftgmac100: Add optional reset control for RMII mode on Aspeed
SoCs
.../bindings/net/faraday,ftgmac100.yaml | 5 ++++
arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 4 +++
drivers/net/ethernet/faraday/ftgmac100.c | 26 +++++++++++++++++++
include/dt-bindings/clock/ast2600-clock.h | 2 ++
4 files changed, 37 insertions(+)
--
2.34.1
On Aspeed SoCs, the internal MAC reset is insufficient to fully reset the
RMII interface; only the SoC-level reset line can properly reset the RMII
logic. This patch adds support for an optional "resets" property in the
device tree, allowing the driver to assert and deassert the SoC reset line
when operating in RMII mode. This ensures the MAC and RMII interface are
correctly reset and initialized.
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
drivers/net/ethernet/faraday/ftgmac100.c | 26 ++++++++++++++++++++++++
1 file changed, 26 insertions(+)
@@ -101,6 +102,8 @@ struct ftgmac100 {/* AST2500/AST2600 RMII ref clock gate */structclk*rclk;+/* Aspeed reset control */+structreset_control*rst;/* Link management */intcur_speed;
@@ -148,6 +151,23 @@ static int ftgmac100_reset_and_config_mac(struct ftgmac100 *priv){u32maccr=0;+/* Aspeed RMII needs SCU reset to clear status */+if(priv->is_aspeed&&priv->netdev->phydev->interface==PHY_INTERFACE_MODE_RMII){+interr;++err=reset_control_assert(priv->rst);+if(err){+dev_err(priv->dev,"Failed to reset mac (%d)\n",err);+returnerr;+}+usleep_range(10000,20000);+err=reset_control_deassert(priv->rst);+if(err){+dev_err(priv->dev,"Failed to deassert mac reset (%d)\n",err);+returnerr;+}+}+switch(priv->cur_speed){caseSPEED_10:case0:/* no link */
@@ -1968,6 +1988,12 @@ static int ftgmac100_probe(struct platform_device *pdev)}+priv->rst=devm_reset_control_get_optional_exclusive(priv->dev,NULL);+if(IS_ERR(priv->rst)){+err=PTR_ERR(priv->rst);+gotoerr_phy_connect;+}+if(priv->is_aspeed){err=ftgmac100_setup_clk(priv);if(err)
Add the "resets" property to the MAC nodes in the AST2600 device tree,
using the appropriate ASPEED_RESET_MACx definitions.
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 4 ++++
1 file changed, 4 insertions(+)
@@ -35,6 +35,11 @@ properties:-description:MAC IP clock-description:RMII RCLK gate for AST2500/2600+resets:+maxItems:1+description:+Optional reset control for the MAC controller (e.g. Aspeed SoCs)+clock-names:minItems:1items:
Add ASPEED_RESET_MAC1 and ASPEED_RESET_MAC2 reset definitions to
the ast2600-clock binding header. These are required for proper
reset control of the MAC1 and MAC2 ethernet controllers on the
AST2600 SoC.
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
include/dt-bindings/clock/ast2600-clock.h | 2 ++
1 file changed, 2 insertions(+)
From: Andrew Lunn <andrew@lunn.ch> Date: 2025-05-20 14:30:25
On Tue, May 20, 2025 at 05:28:44PM +0800, Jacky Chou wrote:
This patch series adds support for an optional reset line to the
ftgmac100 ethernet controller, as used on Aspeed SoCs. On these SoCs,
the internal MAC reset is not sufficient to reset the RMII interface.
By providing a SoC-level reset via the device tree "resets" property,
the driver can properly reset both the MAC and RMII logic, ensuring
correct operation in RMII mode.
@@ -35,6 +35,11 @@ properties:-description:MAC IP clock-description:RMII RCLK gate for AST2500/2600+resets:+maxItems:1+description:+Optional reset control for the MAC controller (e.g. Aspeed SoCs)
If only aspeed socs support this, then please restrict to just your
products.
On Tue, May 20, 2025 at 05:28:46PM +0800, Jacky Chou wrote:
Add ASPEED_RESET_MAC1 and ASPEED_RESET_MAC2 reset definitions to
the ast2600-clock binding header. These are required for proper
reset control of the MAC1 and MAC2 ethernet controllers on the
AST2600 SoC.