All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Paul Louvel <paul.louvel@bootlin.com>
Cc: 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>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	 netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	 Herve Codina <herve.codina@bootlin.com>
Subject: Re: [PATCH net-next 2/2] net: phy: marvell: add RGMII-to-Copper mode configuration
Date: Mon, 9 Nov 2026 15:43:11 +0100	[thread overview]
Message-ID: <avHb1O3lfPsEb0YY@solitude> (raw)
In-Reply-To: <20261109-marvell-phy-rgmii-v1-2-026979ef4f13@bootlin.com>

On Mon, Nov 09, 2026 at 01:44:56PM +0100, Paul Louvel wrote:
> The driver currently programs it only for SGMII-to-Copper, based on the
> PHY interface mode.
> 
> Some MAC connect to the PHY via RGMII. Add code to configure the device
> in m88e1510_config_init().
> 
> Signed-off-by: Paul Louvel (Schneider Electric) <paul.louvel@bootlin.com>
> ---
>  drivers/net/phy/marvell.c | 31 +++++++------------------------
>  1 file changed, 7 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index aef5f8279133..b8b466eb1c45 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -1394,31 +1394,14 @@ static int m88e1510_config_init(struct phy_device *phydev)
>  	if (err < 0)
>  		return err;
>  
> -	/* SGMII-to-Copper mode initialization */
> -	if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
> -		/* Select page 18 */
> -		err = marvell_set_page(phydev, 18);
> -		if (err < 0)
> -			return err;
> -
> -		/* In reg 20, write MODE[2:0] = 0x1 (SGMII to Copper) */
> -		err = phy_modify(phydev, MII_88E1510_GEN_CTRL_REG_1,
> -				 MII_88E1510_GEN_CTRL_REG_1_MODE_MASK,
> -				 MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII);
> -		if (err < 0)
> -			return err;
> -
> -		/* PHY reset is necessary after changing MODE[2:0] */
> -		err = phy_set_bits(phydev, MII_88E1510_GEN_CTRL_REG_1,
> -				   MII_88E1510_GEN_CTRL_REG_1_RESET);
> -		if (err < 0)
> -			return err;
> +	/* RGMII/SGMII-to-Copper mode initialization */
> +	if (phydev->interface == PHY_INTERFACE_MODE_SGMII)
> +		err = m88e1510_config_mode(phydev, MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII);

This first part belongs either to the first patch (deduplicates the mode setting code)
or to a separate patch.

Marek

> +	else if (phy_interface_is_rgmii(phydev))
> +		err = m88e1510_config_mode(phydev, MII_88E1510_GEN_CTRL_REG_1_MODE_RGMII);
> +	if (err < 0)
> +		return err;
>  
> -		/* Reset page selection */
> -		err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);
> -		if (err < 0)
> -			return err;
> -	}
>  	err = m88e1011_set_downshift(phydev, 3);
>  	if (err < 0)
>  		return err;
> 
> -- 
> 2.56.0
> 
> 

  reply	other threads:[~2026-11-09 14:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 12:44 [PATCH net-next 0/2] net: phy: marvell: add RGMII-to-Copper mode configuration Paul Louvel
2026-11-09 12:44 ` [PATCH net-next 1/2] net: phy: marvell: move mode configuration into standalone function Paul Louvel
2026-11-09 12:44 ` [PATCH net-next 2/2] net: phy: marvell: add RGMII-to-Copper mode configuration Paul Louvel
2026-11-09 14:43   ` Marek Behún [this message]
2026-11-10 16:26     ` 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=avHb1O3lfPsEb0YY@solitude \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paul.louvel@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.