From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
Jakub Kicinski <kuba@kernel.org>,
davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Russell King <linux@armlinux.org.uk>,
Heiner Kallweit <hkallweit1@gmail.com>, Yao Zi <me@ziyao.cc>,
Frank <Frank.Sae@motor-comm.com>
Cc: "Maxime Chevallier" <maxime.chevallier@bootlin.com>,
thomas.petazzoni@bootlin.com,
"Alexis Lothoré" <alexis.lothore@bootlin.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com
Subject: [PATCH net-next 2/3] net: phy: motorcomm: Add a dedicated .config_init for YT8531S
Date: Mon, 31 Aug 2026 09:37:44 +0200 [thread overview]
Message-ID: <20260831073747.361482-3-maxime.chevallier@bootlin.com> (raw)
In-Reply-To: <20260831073747.361482-1-maxime.chevallier@bootlin.com>
The YT8531S PHY configuration logic is similar to the YT8521, but with
some extra steps for the RGMII configuration. In preparation for
improvements in the YT8531S configuration for the version found
integrated with the YT6801 PCIe NIC, let's split the logic out by
extending the YT8521 configuration sequence.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
drivers/net/phy/motorcomm.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
index 58e4d67b945f..36c229460a77 100644
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -1700,19 +1700,12 @@ static int __yt8521_config_init(struct phy_device *phydev)
return ret;
}
- if (device_property_read_bool(dev, "motorcomm,keep-pll-enabled")) {
+ if (device_property_read_bool(dev, "motorcomm,keep-pll-enabled"))
/* enable RXC clock when no wire plug */
- ret = ytphy_modify_ext(phydev, YT8521_CLOCK_GATING_REG,
- YT8521_CGR_RX_CLK_EN, 0);
- if (ret < 0)
- return ret;
- }
+ return ytphy_modify_ext(phydev, YT8521_CLOCK_GATING_REG,
+ YT8521_CGR_RX_CLK_EN, 0);
- if (phy_interface_is_rgmii(phydev) &&
- phydev_id_compare(phydev, PHY_ID_YT8531S))
- ret = yt8531_set_ds(phydev);
-
- return ret;
+ return 0;
}
/**
@@ -1735,6 +1728,25 @@ static int yt8521_config_init(struct phy_device *phydev)
return phy_restore_page(phydev, old_page, ret);
}
+static int yt8531s_config_init(struct phy_device *phydev)
+{
+ int old_page, ret = 0;
+
+ old_page = phy_select_page(phydev, YT8521_RSSR_UTP_SPACE);
+ if (old_page < 0)
+ goto err_restore_page;
+
+ ret = __yt8521_config_init(phydev);
+ if (ret)
+ goto err_restore_page;
+
+ if (phy_interface_is_rgmii(phydev))
+ ret = yt8531_set_ds(phydev);
+
+err_restore_page:
+ return phy_restore_page(phydev, old_page, ret);
+}
+
static const unsigned long supported_trgs = (BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
BIT(TRIGGER_NETDEV_LINK) |
@@ -3143,7 +3155,7 @@ static struct phy_driver motorcomm_phy_drvs[] = {
.set_wol = ytphy_set_wol,
.config_aneg = yt8521_config_aneg,
.aneg_done = yt8521_aneg_done,
- .config_init = yt8521_config_init,
+ .config_init = yt8531s_config_init,
.read_status = yt8521_read_status,
.soft_reset = yt8521_soft_reset,
.suspend = yt8521_suspend,
--
2.55.0
next prev parent reply other threads:[~2026-08-31 7:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 7:37 [PATCH net-next 0/3] net: phy: motorcomm: Enable analog frontend DAC on yt8531S Maxime Chevallier
2026-08-31 7:37 ` [PATCH net-next 1/3] net: phy: motorcomm: Split yt8521_config_init() page management Maxime Chevallier
2026-08-31 7:37 ` Maxime Chevallier [this message]
2026-08-31 7:37 ` [PATCH net-next 3/3] net: phy: motorcomm: Enable analog frontend on YT8531S Maxime Chevallier
2026-09-01 13:59 ` Paolo Abeni
2026-09-01 14:21 ` Maxime Chevallier
2026-09-01 16:56 ` Yao Zi
2026-09-01 16:33 ` [PATCH net-next 0/3] net: phy: motorcomm: Enable analog frontend DAC on yt8531S Yao Zi
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=20260831073747.361482-3-maxime.chevallier@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=Frank.Sae@motor-comm.com \
--cc=alexandre.torgue@foss.st.com \
--cc=alexis.lothore@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horms@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=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=me@ziyao.cc \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=thomas.petazzoni@bootlin.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox