mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
Cc: 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: Re: [PATCH net] net: phy: c45: select 10BASE-T1L type when forcing 10 Mbit/s
Date: Wed, 4 Nov 2026 17:27:35 +0100	[thread overview]
Message-ID: <fb774957-6e00-4d04-ae40-23e286cd691a@lunn.ch> (raw)
In-Reply-To: <20261104152534.1425241-1-iustin.stolniceanu@analog.com>

>  /* 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

      reply	other threads:[~2026-11-04 16:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 15:25 Iustin Stolniceanu
2026-11-04 16:27 ` Andrew Lunn [this message]

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=fb774957-6e00-4d04-ae40-23e286cd691a@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=eichest@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=iustin.stolniceanu@analog.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®