public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Thangaraj Samynathan <thangaraj.s@microchip.com>
Cc: bryan.whitehead@microchip.com, UNGLinuxDriver@microchip.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, Raju.Lakkaraju@microchip.com,
	maxime.chevallier@bootlin.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: lan743x: add support for RMII interface
Date: Fri, 27 Mar 2026 08:57:35 +0000	[thread overview]
Message-ID: <acZGf53Ls7hpFdXd@shell.armlinux.org.uk> (raw)
In-Reply-To: <20260327054008.79294-3-thangaraj.s@microchip.com>

On Fri, Mar 27, 2026 at 11:10:08AM +0530, Thangaraj Samynathan wrote:
> Enable RMII interface in the lan743x driver for PHY and MAC
> configuration.
> 
> - Select RMII interface in lan743x_phy_interface_select().
> - Update phylink supported_interfaces and MAC capabilities.
> - Enable RMII via RMII_CTL in lan743x_hardware_init().
> - Define RMII_CTL register and enable bit in lan743x_main.h.
> 
> Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
> ---
>  drivers/net/ethernet/microchip/lan743x_main.c | 18 ++++++++++++++++++
>  drivers/net/ethernet/microchip/lan743x_main.h |  3 +++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index b7b1584d867d..86d35810460f 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -1370,6 +1370,8 @@ static void lan743x_phy_interface_select(struct lan743x_adapter *adapter)
>  
>  	if (adapter->is_pci11x1x && adapter->is_sgmii_en)
>  		adapter->phy_interface = PHY_INTERFACE_MODE_SGMII;
> +	else if (adapter->is_pci11x1x && adapter->is_rmii_en)
> +		adapter->phy_interface = PHY_INTERFACE_MODE_RMII;
>  	else if (id_rev == ID_REV_ID_LAN7430_)
>  		adapter->phy_interface = PHY_INTERFACE_MODE_GMII;
>  	else if ((id_rev == ID_REV_ID_LAN7431_) && (data & MAC_CR_MII_EN_))
> @@ -3158,6 +3160,13 @@ static int lan743x_phylink_create(struct lan743x_adapter *adapter)
>  		__set_bit(PHY_INTERFACE_MODE_MII,
>  			  adapter->phylink_config.supported_interfaces);
>  		break;
> +	case PHY_INTERFACE_MODE_RMII:
> +		__set_bit(PHY_INTERFACE_MODE_RMII,
> +			  adapter->phylink_config.supported_interfaces);
> +		adapter->phylink_config.mac_capabilities &= ~MAC_1000FD;

Phylink already knows that gigabit isn't supported with RMII. See
phy_caps_from_interface():

        case PHY_INTERFACE_MODE_REVRMII:
        case PHY_INTERFACE_MODE_RMII:
        case PHY_INTERFACE_MODE_SMII:
        case PHY_INTERFACE_MODE_REVMII:
        case PHY_INTERFACE_MODE_MII:
                link_caps |= BIT(LINK_CAPA_10HD) | BIT(LINK_CAPA_10FD);
                fallthrough;

        case PHY_INTERFACE_MODE_100BASEX:
                link_caps |= BIT(LINK_CAPA_100HD) | BIT(LINK_CAPA_100FD);
                break;

which is used by phylink_get_capabilities() to reduce the MAC
capabilities depending on the interface and rate matching.

The only case to do this is where the MAC really has no 1G support.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

      parent reply	other threads:[~2026-03-27  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27  5:40 [PATCH net-next 0/2] Add RMII Interface Support Thangaraj Samynathan
2026-03-27  5:40 ` [PATCH net-next 1/2] net: lan743x: add RMII strap status detection for PCI11x1x Thangaraj Samynathan
2026-03-27  5:40 ` [PATCH net-next 2/2] net: lan743x: add support for RMII interface Thangaraj Samynathan
2026-03-27  8:47   ` Maxime Chevallier
2026-03-27  9:18     ` Maxime Chevallier
2026-03-27  8:57   ` Russell King (Oracle) [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=acZGf53Ls7hpFdXd@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Raju.Lakkaraju@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thangaraj.s@microchip.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