Skip to contentSkip to conversation

net: mvpp2: Fix GoP port 3 Networking Complex Control configurations

PATCH Superseded [email protected] 4 participants 7 messages Dec 17, 2020

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 net: mvpp2: Fix GoP port 3 Networking Complex Control configurations

From: Stefan Chulski <[email protected]>

During GoP port 2 Networking Complex Control mode of operation configurations, also GoP port 3 mode of operation was wrongly set.
Patch removes these configurations.
GENCONF_CTRL0_PORTX naming also fixed.

Fixes f84bf386f395 ("net: mvpp2: initialize the GoP")
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h      | 6 +++---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2.h +3 -3
index 6bd7e40..39c4e5c 100644
@@ -651,9 +651,9 @@
 #define     GENCONF_PORT_CTRL1_EN(p)			BIT(p)
 #define     GENCONF_PORT_CTRL1_RESET(p)			(BIT(p) << 28)
 #define GENCONF_CTRL0					0x1120
-#define     GENCONF_CTRL0_PORT0_RGMII			BIT(0)
-#define     GENCONF_CTRL0_PORT1_RGMII_MII		BIT(1)
-#define     GENCONF_CTRL0_PORT1_RGMII			BIT(2)
+#define     GENCONF_CTRL0_PORT2_RGMII			BIT(0)
+#define     GENCONF_CTRL0_PORT3_RGMII_MII		BIT(1)
+#define     GENCONF_CTRL0_PORT3_RGMII			BIT(2)
 
 /* Various constants */
 
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +4 -4
index d64dc12..d2b0506 100644
@@ -1231,9 +1231,9 @@ static void mvpp22_gop_init_rgmii(struct mvpp2_port *port)
 
 	regmap_read(priv->sysctrl_base, GENCONF_CTRL0, &val);
 	if (port->gop_id == 2)
-		val |= GENCONF_CTRL0_PORT0_RGMII | GENCONF_CTRL0_PORT1_RGMII;
+		val |= GENCONF_CTRL0_PORT2_RGMII;
 	else if (port->gop_id == 3)
-		val |= GENCONF_CTRL0_PORT1_RGMII_MII;
+		val |= GENCONF_CTRL0_PORT3_RGMII_MII;
 	regmap_write(priv->sysctrl_base, GENCONF_CTRL0, val);
 }
 
@@ -1250,9 +1250,9 @@ static void mvpp22_gop_init_sgmii(struct mvpp2_port *port)
 	if (port->gop_id > 1) {
 		regmap_read(priv->sysctrl_base, GENCONF_CTRL0, &val);
 		if (port->gop_id == 2)
-			val &= ~GENCONF_CTRL0_PORT0_RGMII;
+			val &= ~GENCONF_CTRL0_PORT2_RGMII;
 		else if (port->gop_id == 3)
-			val &= ~GENCONF_CTRL0_PORT1_RGMII_MII;
+			val &= ~GENCONF_CTRL0_PORT3_RGMII_MII;
 		regmap_write(priv->sysctrl_base, GENCONF_CTRL0, val);
 	}
 }
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 2/2 net: mvpp2: disable force link UP during port init procedure

From: Stefan Chulski <[email protected]>

Force link UP can be enabled by bootloader during tftpboot and breaks NFS support.
Force link UP disabled during port init procedure.

---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +13 -1
index d2b0506..0ad3177 100644
@@ -5479,7 +5479,7 @@ static int mvpp2_port_init(struct mvpp2_port *port)
 	struct mvpp2 *priv = port->priv;
 	struct mvpp2_txq_pcpu *txq_pcpu;
 	unsigned int thread;
-	int queue, err;
+	int queue, err, val;
 
 	/* Checks for hardware constraints */
 	if (port->first_rxq + port->nrxqs >
@@ -5493,6 +5493,18 @@ static int mvpp2_port_init(struct mvpp2_port *port)
 	mvpp2_egress_disable(port);
 	mvpp2_port_disable(port);
 
+	if (mvpp2_is_xlg(port->phy_interface)) {
+		val = readl(port->base + MVPP22_XLG_CTRL0_REG);
+		val &= ~MVPP22_XLG_CTRL0_FORCE_LINK_PASS;
+		val |= MVPP22_XLG_CTRL0_FORCE_LINK_DOWN;
+		writel(val, port->base + MVPP22_XLG_CTRL0_REG);
+	} else {
+		val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG);
+		val &= ~MVPP2_GMAC_FORCE_LINK_PASS;
+		val |= MVPP2_GMAC_FORCE_LINK_DOWN;
+		writel(val, port->base + MVPP2_GMAC_AUTONEG_CONFIG);
+	}
+
 	port->tx_time_coal = MVPP2_TXDONE_COAL_USEC;
 
 	port->txqs = devm_kcalloc(dev, port->ntxqs, sizeof(*port->txqs),
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure

Hi Stefan,

czw., 17 gru 2020 o 10:42 <[email protected]> napisał(a):

Quoted 9 lines

From: Stefan Chulski <[email protected]>

Force link UP can be enabled by bootloader during tftpboot and breaks NFS support.
Force link UP disabled during port init procedure.

---

What are the updates against v1? Please note them in this place for individual patches and list all in the cover letter (in case sending a group of patches).

Do you think it's a fix that should be backported to stable branches? If yes, please add 'Fixes: <commit ID> ("commit title")' and it may be good to add 'Cc: [email protected]' adjacent to the Signed-off-by tag.

Thanks,
Marcin

Quoted 38 lines
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +13 -2
index d2b0506..0ad3177 100644
@@ -5479,7 +5479,7 @@ static int mvpp2_port_init(struct mvpp2_port *port)
        struct mvpp2 *priv = port->priv;
        struct mvpp2_txq_pcpu *txq_pcpu;
        unsigned int thread;
-       int queue, err;
+       int queue, err, val;
 
        /* Checks for hardware constraints */
        if (port->first_rxq + port->nrxqs >
@@ -5493,6 +5493,18 @@ static int mvpp2_port_init(struct mvpp2_port *port)
        mvpp2_egress_disable(port);
        mvpp2_port_disable(port);
 
+       if (mvpp2_is_xlg(port->phy_interface)) {
+               val = readl(port->base + MVPP22_XLG_CTRL0_REG);
+               val &= ~MVPP22_XLG_CTRL0_FORCE_LINK_PASS;
+               val |= MVPP22_XLG_CTRL0_FORCE_LINK_DOWN;
+               writel(val, port->base + MVPP22_XLG_CTRL0_REG);
+       } else {
+               val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG);
+               val &= ~MVPP2_GMAC_FORCE_LINK_PASS;
+               val |= MVPP2_GMAC_FORCE_LINK_DOWN;
+               writel(val, port->base + MVPP2_GMAC_AUTONEG_CONFIG);
+       }
+
        port->tx_time_coal = MVPP2_TXDONE_COAL_USEC;
 
        port->txqs = devm_kcalloc(dev, port->ntxqs, sizeof(*port->txqs),
--

1.9.1

#3 lore raw

Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure

Quoted 10 lines · Marcin Wojtas

Hi Stefan,

czw., 17 gru 2020 o 10:42 <[email protected]> napisał(a):

Quoted 7 lines

From: Stefan Chulski <[email protected]>

Force link UP can be enabled by bootloader during tftpboot and breaks NFS support.
Force link UP disabled during port init procedure.

Quoted 6 lines
Quoted 2 lines

---

What are the updates against v1? Please note them in this place for individual patches and list all in the cover letter (in case sending a group of patches).

It seems the only reason this has been resent is because it's (incorrectly) part of a series that involved a change to patch 1 (adding the Fixes: tag).

As this is a stand-alone fix, it shouldn't be part of a series unless there really is some kind of dependency with the other patch(es) of that series.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#4 lore raw

RE: [EXT] Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure

Quoted 18 lines · Marcin Wojtas
Quoted 10 lines

Hi Stefan,

czw., 17 gru 2020 o 10:42 <[email protected]> napisał(a):

Quoted 7 lines

From: Stefan Chulski <[email protected]>

Force link UP can be enabled by bootloader during tftpboot and breaks NFS support.
Force link UP disabled during port init procedure.

Quoted 6 lines
Quoted 2 lines

---

What are the updates against v1? Please note them in this place for individual patches and list all in the cover letter (in case sending a group of patches).

Quoted 6 lines

It seems the only reason this has been resent is because it's (incorrectly) part of a series that involved a change to patch 1 (adding the
Fixes: tag).

As this is a stand-alone fix, it shouldn't be part of a series unless there really is some kind of dependency with the other patch(es) of that series.

I would repost this two patches separately.

Regards,
Stefan.

#5 lore raw

Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure

In reply to Marcin Wojtas
Quoted 4 lines

Do you think it's a fix that should be backported to stable branches? If yes, please add 'Fixes: <commit ID> ("commit title")' and it may be good to add 'Cc: [email protected]' adjacent to the Signed-off-by tag.

netdev patches should not be Cc: [email protected]. David and Jakub handle stable patches directly.

Andrew

#6 lore raw

Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure

czw., 17 gru 2020 o 15:09 Andrew Lunn <[email protected]> napisał(a):

Quoted 9 lines
Quoted 5 lines

Do you think it's a fix that should be backported to stable branches? If yes, please add 'Fixes: <commit ID> ("commit title")' and it may be good to add 'Cc: [email protected]' adjacent to the Signed-off-by tag.

netdev patches should not be Cc: [email protected]. David and Jakub handle stable patches directly.

Thanks for clarification.

Marcin