Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Marek Behún
Mon, 09 Nov 2026 14:43
Re: [PATCH net-next 2/2] net: phy: marvell: add RGMII-to-Copper mode configuration
Author: Marek Behún
Date: Mon, 09 Nov 2026 14:43
Date: Mon, 09 Nov 2026 14:43
67 lines
10198 bytes
10198 bytes
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
>
>
Re: [PATCH net-next 2/2] net: phy: marvell: add RGMII-to-Copper mode configuration
Author: Andrew Lunn
Date: Tue, 10 Nov 2026 16:26
Date: Tue, 10 Nov 2026 16:26
12 lines
8760 bytes
8760 bytes
> This first part belongs either to the first patch (deduplicates the mode setting code)
> or to a separate patch.
Yes, that was my thought as well.
Apart from that, the patches look O.K.
Andrew
---
pw-bot: cr
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads