From: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
To: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Stefan Eichenberger <eichest@gmail.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH net] net: phy: c45: select 10BASE-T1L type when forcing 10 Mbit/s
Date: Wed, 4 Nov 2026 17:25:33 +0200 [thread overview]
Message-ID: <20261104152534.1425241-1-iustin.stolniceanu@analog.com> (raw)
Since 25108a834e14, genphy_c45_pma_setup_forced() writes the type
selection field of the BASE-T1 PMA/PMD control register (1.2100) on
every forced setup, using 0 for anything other than 1000 Mbit/s. 0 is
100BASE-T1, which a 10BASE-T1L PHY like the ADIN1100 does not support,
so the forced link never comes up.
Select 10BASE-T1L for SPEED_10 when the PHY reports 10baseT1L_Full
support.
Tested on EVAL-ADIN1110EBZ (ADIN1110 with internal ADIN1100 PHY). After
ethtool -s ethX autoneg off speed 10 master-slave forced-master
1.2100 reads 0xc002, it was 0xc000 before.
Fixes: 25108a834e14 ("net: phy: c45: add support for 1000BASE-T1 forced setup")
Signed-off-by: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
---
drivers/net/phy/phy-c45.c | 4 ++++
include/uapi/linux/mdio.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 870920311f9a..8671deda81c9 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -182,6 +182,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
bt1_ctrl = 0;
if (phydev->speed == SPEED_1000)
bt1_ctrl = MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000;
+ else if (phydev->speed == SPEED_10 &&
+ linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT,
+ phydev->supported))
+ bt1_ctrl = MDIO_PMA_PMD_BT1_CTRL_STRAP_B10L;
ret = phy_modify_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_PMD_BT1_CTRL,
MDIO_PMA_PMD_BT1_CTRL_STRAP, bt1_ctrl);
diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h
index 06f4bc3c20c7..f46529451cc8 100644
--- a/include/uapi/linux/mdio.h
+++ b/include/uapi/linux/mdio.h
@@ -419,6 +419,7 @@
/* BASE-T1 PMA/PMD control register */
#define MDIO_PMA_PMD_BT1_CTRL_STRAP 0x000F /* Type selection (Strap) */
#define MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000 0x0001 /* Select 1000BASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_STRAP_B10L 0x0002 /* Select 10BASE-T1L */
#define MDIO_PMA_PMD_BT1_CTRL_CFG_MST 0x4000 /* MASTER-SLAVE config value */
/* 1000BASE-T1 PCS control register */
--
2.43.0
next reply other threads:[~2026-11-04 15:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 15:25 Iustin Stolniceanu [this message]
2026-11-04 16:27 ` Andrew Lunn
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=20261104152534.1425241-1-iustin.stolniceanu@analog.com \
--to=iustin.stolniceanu@analog.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=eichest@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®