All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] Fix RGMII delays for 88E1118
@ 2022-01-04 16:37 Russell King (Oracle)
  2022-01-04 16:38 ` [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR Russell King (Oracle)
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Russell King (Oracle) @ 2022-01-04 16:37 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Corentin Labbe
  Cc: David S. Miller, Jakub Kicinski, netdev

Hi,

This series fixes the RGMII delays for 88E1118 Marvell PHYs, after a
report by Corentin Labbe that the Marvell driver fails to work.

Patch 1 cleans up the paged register accesses in m88e1118_config_init()
and patch 2 adds the RGMII delay configuration.

This comes with an element of risk as existing DT may need to be fixed
for this in a similar way as we have done in the recent past for other
PHY drivers that have misinterpreted the RGMII interface modes.

 drivers/net/phy/marvell.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR
  2022-01-04 16:37 [PATCH net-next 0/2] Fix RGMII delays for 88E1118 Russell King (Oracle)
@ 2022-01-04 16:38 ` Russell King (Oracle)
  2022-01-04 16:44   ` Andrew Lunn
  2022-01-04 19:53   ` Corentin Labbe
  2022-01-04 16:38 ` [PATCH net-next 2/2] net: phy: marvell: configure RGMII delays for 88E1118 Russell King (Oracle)
  2022-01-05 18:40 ` [PATCH net-next 0/2] Fix " patchwork-bot+netdevbpf
  2 siblings, 2 replies; 7+ messages in thread
From: Russell King (Oracle) @ 2022-01-04 16:38 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Corentin Labbe
  Cc: David S. Miller, Jakub Kicinski, netdev

Use phy_write_paged() in m88e1118_config_init() to set the MSCR value.
We leave the other paged write for the LEDs in case the DT register
parsing is relying on this page.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/marvell.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 4fcfca4e1702..64e7874c95f4 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1225,28 +1225,22 @@ static int m88e1118_config_aneg(struct phy_device *phydev)
 
 static int m88e1118_config_init(struct phy_device *phydev)
 {
+	u16 leds;
 	int err;
 
-	/* Change address */
-	err = marvell_set_page(phydev, MII_MARVELL_MSCR_PAGE);
-	if (err < 0)
-		return err;
-
 	/* Enable 1000 Mbit */
-	err = phy_write(phydev, 0x15, 0x1070);
-	if (err < 0)
-		return err;
-
-	/* Change address */
-	err = marvell_set_page(phydev, MII_MARVELL_LED_PAGE);
+	err = phy_write_paged(phydev, MII_MARVELL_MSCR_PAGE,
+			      MII_88E1121_PHY_MSCR_REG, 0x1070);
 	if (err < 0)
 		return err;
 
 	/* Adjust LED Control */
 	if (phydev->dev_flags & MARVELL_PHY_M1118_DNS323_LEDS)
-		err = phy_write(phydev, 0x10, 0x1100);
+		leds = 0x1100;
 	else
-		err = phy_write(phydev, 0x10, 0x021e);
+		leds = 0x021e;
+
+	err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, 0x10, leds);
 	if (err < 0)
 		return err;
 
@@ -1254,7 +1248,7 @@ static int m88e1118_config_init(struct phy_device *phydev)
 	if (err < 0)
 		return err;
 
-	/* Reset address */
+	/* Reset page register */
 	err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);
 	if (err < 0)
 		return err;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 2/2] net: phy: marvell: configure RGMII delays for 88E1118
  2022-01-04 16:37 [PATCH net-next 0/2] Fix RGMII delays for 88E1118 Russell King (Oracle)
  2022-01-04 16:38 ` [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR Russell King (Oracle)
@ 2022-01-04 16:38 ` Russell King (Oracle)
  2022-01-04 16:45   ` Andrew Lunn
  2022-01-05 18:40 ` [PATCH net-next 0/2] Fix " patchwork-bot+netdevbpf
  2 siblings, 1 reply; 7+ messages in thread
From: Russell King (Oracle) @ 2022-01-04 16:38 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Corentin Labbe
  Cc: David S. Miller, Jakub Kicinski, netdev

Corentin Labbe reports that the SSI 1328 does not work when allowing
the PHY to operate at gigabit speeds, but does work with the generic
PHY driver.

This appears to be because m88e1118_config_init() writes a fixed value
to the MSCR register, claiming that this is to enable 1G speeds.
However, this always sets bits 4 and 5, enabling RGMII transmit and
receive delays. The suspicion is that the original board this was
added for required the delays to make 1G speeds work.

Add the necessary configuration for RGMII delays for the 88E1118 to
bring this into line with the requirements for RGMII support, and thus
make the SSI 1328 work.

Corentin Labbe has tested this on gemini-ssi1328 and gemini-ns2502.

Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/marvell.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 64e7874c95f4..739859c0dfb1 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1234,6 +1234,12 @@ static int m88e1118_config_init(struct phy_device *phydev)
 	if (err < 0)
 		return err;
 
+	if (phy_interface_is_rgmii(phydev)) {
+		err = m88e1121_config_aneg_rgmii_delays(phydev);
+		if (err < 0)
+			return err;
+	}
+
 	/* Adjust LED Control */
 	if (phydev->dev_flags & MARVELL_PHY_M1118_DNS323_LEDS)
 		leds = 0x1100;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR
  2022-01-04 16:38 ` [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR Russell King (Oracle)
@ 2022-01-04 16:44   ` Andrew Lunn
  2022-01-04 19:53   ` Corentin Labbe
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2022-01-04 16:44 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, Corentin Labbe, David S. Miller, Jakub Kicinski, netdev

On Tue, Jan 04, 2022 at 04:38:13PM +0000, Russell King (Oracle) wrote:
> Use phy_write_paged() in m88e1118_config_init() to set the MSCR value.
> We leave the other paged write for the LEDs in case the DT register
> parsing is relying on this page.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 2/2] net: phy: marvell: configure RGMII delays for 88E1118
  2022-01-04 16:38 ` [PATCH net-next 2/2] net: phy: marvell: configure RGMII delays for 88E1118 Russell King (Oracle)
@ 2022-01-04 16:45   ` Andrew Lunn
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2022-01-04 16:45 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, Corentin Labbe, David S. Miller, Jakub Kicinski, netdev

On Tue, Jan 04, 2022 at 04:38:19PM +0000, Russell King (Oracle) wrote:
> Corentin Labbe reports that the SSI 1328 does not work when allowing
> the PHY to operate at gigabit speeds, but does work with the generic
> PHY driver.
> 
> This appears to be because m88e1118_config_init() writes a fixed value
> to the MSCR register, claiming that this is to enable 1G speeds.
> However, this always sets bits 4 and 5, enabling RGMII transmit and
> receive delays. The suspicion is that the original board this was
> added for required the delays to make 1G speeds work.
> 
> Add the necessary configuration for RGMII delays for the 88E1118 to
> bring this into line with the requirements for RGMII support, and thus
> make the SSI 1328 work.
> 
> Corentin Labbe has tested this on gemini-ssi1328 and gemini-ns2502.
> 
> Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR
  2022-01-04 16:38 ` [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR Russell King (Oracle)
  2022-01-04 16:44   ` Andrew Lunn
@ 2022-01-04 19:53   ` Corentin Labbe
  1 sibling, 0 replies; 7+ messages in thread
From: Corentin Labbe @ 2022-01-04 19:53 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Jakub Kicinski, netdev

Le Tue, Jan 04, 2022 at 04:38:13PM +0000, Russell King (Oracle) a écrit :
> Use phy_write_paged() in m88e1118_config_init() to set the MSCR value.
> We leave the other paged write for the LEDs in case the DT register
> parsing is relying on this page.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/phy/marvell.c | 22 ++++++++--------------
>  1 file changed, 8 insertions(+), 14 deletions(-)
> 

Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>

Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 0/2] Fix RGMII delays for 88E1118
  2022-01-04 16:37 [PATCH net-next 0/2] Fix RGMII delays for 88E1118 Russell King (Oracle)
  2022-01-04 16:38 ` [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR Russell King (Oracle)
  2022-01-04 16:38 ` [PATCH net-next 2/2] net: phy: marvell: configure RGMII delays for 88E1118 Russell King (Oracle)
@ 2022-01-05 18:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-05 18:40 UTC (permalink / raw)
  To: Russell King; +Cc: andrew, hkallweit1, clabbe.montjoie, davem, kuba, netdev

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 4 Jan 2022 16:37:21 +0000 you wrote:
> Hi,
> 
> This series fixes the RGMII delays for 88E1118 Marvell PHYs, after a
> report by Corentin Labbe that the Marvell driver fails to work.
> 
> Patch 1 cleans up the paged register accesses in m88e1118_config_init()
> and patch 2 adds the RGMII delay configuration.
> 
> [...]

Here is the summary with links:
  - [net-next,1/2] net: phy: marvell: use phy_write_paged() to set MSCR
    https://git.kernel.org/netdev/net-next/c/5b8f970309dd
  - [net-next,2/2] net: phy: marvell: configure RGMII delays for 88E1118
    https://git.kernel.org/netdev/net-next/c/f22725c95ece

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-05 18:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 16:37 [PATCH net-next 0/2] Fix RGMII delays for 88E1118 Russell King (Oracle)
2022-01-04 16:38 ` [PATCH net-next 1/2] net: phy: marvell: use phy_write_paged() to set MSCR Russell King (Oracle)
2022-01-04 16:44   ` Andrew Lunn
2022-01-04 19:53   ` Corentin Labbe
2022-01-04 16:38 ` [PATCH net-next 2/2] net: phy: marvell: configure RGMII delays for 88E1118 Russell King (Oracle)
2022-01-04 16:45   ` Andrew Lunn
2022-01-05 18:40 ` [PATCH net-next 0/2] Fix " patchwork-bot+netdevbpf

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.