Re: [PATCH net] net: phy: c45: select 10BASE-T1L type when forcing 10 Mbit/s
From: Andrew Lunn
Date: Wed Nov 04 2026 - 11:34:32 EST
> /* 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 */
I don't know where STRAP comes from, because 802.3 calls it type
selection. Version 2022 defines:
1 x x x = Reserved
0 1 1 1 = Reserved
0 1 1 0 = 10GBASE-T1
0 1 0 1 = 5GBASE-T1
0 1 0 0 = 2.5GBASE-T1
0 0 1 1 = 10BASE-T1S
0 0 1 0 = 10BASE-T1L
0 0 0 1 = 1000BASE-T1
0 0 0 0 = 100BASE-T1
It would be good to add all of these.
> @@ -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);
And this should be made more generic. Maybe add a helper which takes
speed and supported, and returns the correct type selection. We don't
yet have 2.5G, 5G or 10G BaseT1, so you can skip those.
Andrew