All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds
@ 2019-11-14 16:58 Alex Marginean
  2019-11-14 16:58 ` [U-Boot] [PATCH 2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe Alex Marginean
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alex Marginean @ 2019-11-14 16:58 UTC (permalink / raw)
  To: u-boot

The original code enabled link speeds up to 1Gbps, but the interface can
go up to 2.5G, enable that speed to in PHY AN mask.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
---

I have these patches on top of the following two patch sets, they don't apply
cleanly without them:
https://patchwork.ozlabs.org/project/uboot/list/?series=142879
https://patchwork.ozlabs.org/project/uboot/list/?series=142858

 drivers/net/fsl_enetc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
index c94ba240f8..64dc244da2 100644
--- a/drivers/net/fsl_enetc.c
+++ b/drivers/net/fsl_enetc.c
@@ -215,8 +215,9 @@ static void enetc_config_phy(struct udevice *dev)
 	if (!priv->phy)
 		return;
 
-	supported = GENMASK(6, 0); /* speeds up to 1G & AN */
-	priv->phy->advertising = priv->phy->supported & supported;
+	supported = PHY_GBIT_FEATURES | SUPPORTED_2500baseX_Full;
+	priv->phy->supported &= supported;
+	priv->phy->advertising &= supported;
 
 	phy_config(priv->phy);
 }
-- 
2.17.1

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

* [U-Boot] [PATCH 2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe
  2019-11-14 16:58 [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds Alex Marginean
@ 2019-11-14 16:58 ` Alex Marginean
  2019-11-30  0:41   ` Joe Hershberger
  2019-11-14 16:58 ` [U-Boot] [PATCH 3/3] drivers: net: fsl_enetc_mdio: return with time-out if HW is stuck Alex Marginean
  2019-11-30  0:40 ` [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds Joe Hershberger
  2 siblings, 1 reply; 6+ messages in thread
From: Alex Marginean @ 2019-11-14 16:58 UTC (permalink / raw)
  To: u-boot

This reduces the time needed to establish a link as we don't reset the link
each time the interface is used.  Our Link capabilities do not change at
run-time so there is no need to re-apply PHY configuration each time.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
---

I have these patches on top of the following two patch sets, they don't apply
cleanly without them:
https://patchwork.ozlabs.org/project/uboot/list/?series=142879
https://patchwork.ozlabs.org/project/uboot/list/?series=142858

 drivers/net/fsl_enetc.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
index 64dc244da2..e86f3dddb5 100644
--- a/drivers/net/fsl_enetc.c
+++ b/drivers/net/fsl_enetc.c
@@ -190,12 +190,6 @@ static void enetc_start_pcs(struct udevice *dev)
 	case PHY_INTERFACE_MODE_SGMII_2500:
 		enetc_init_sgmii(dev);
 		break;
-	case PHY_INTERFACE_MODE_RGMII:
-	case PHY_INTERFACE_MODE_RGMII_ID:
-	case PHY_INTERFACE_MODE_RGMII_RXID:
-	case PHY_INTERFACE_MODE_RGMII_TXID:
-		enetc_init_rgmii(dev);
-		break;
 	case PHY_INTERFACE_MODE_XGMII:
 	case PHY_INTERFACE_MODE_USXGMII:
 	case PHY_INTERFACE_MODE_XFI:
@@ -258,6 +252,9 @@ static int enetc_probe(struct udevice *dev)
 
 	dm_pci_clrset_config16(dev, PCI_COMMAND, 0, PCI_COMMAND_MEMORY);
 
+	enetc_start_pcs(dev);
+	enetc_config_phy(dev);
+
 	return 0;
 }
 
@@ -433,8 +430,12 @@ static int enetc_start(struct udevice *dev)
 	enetc_setup_tx_bdr(dev);
 	enetc_setup_rx_bdr(dev);
 
-	enetc_start_pcs(dev);
-	enetc_config_phy(dev);
+	if (priv->if_type == PHY_INTERFACE_MODE_RGMII ||
+	    priv->if_type == PHY_INTERFACE_MODE_RGMII_ID ||
+	    priv->if_type == PHY_INTERFACE_MODE_RGMII_RXID ||
+	    priv->if_type == PHY_INTERFACE_MODE_RGMII_TXID)
+		enetc_init_rgmii(dev);
+
 	if (priv->phy)
 		phy_startup(priv->phy);
 
-- 
2.17.1

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

* [U-Boot] [PATCH 3/3] drivers: net: fsl_enetc_mdio: return with time-out if HW is stuck
  2019-11-14 16:58 [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds Alex Marginean
  2019-11-14 16:58 ` [U-Boot] [PATCH 2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe Alex Marginean
@ 2019-11-14 16:58 ` Alex Marginean
  2019-11-30  0:42   ` Joe Hershberger
  2019-11-30  0:40 ` [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds Joe Hershberger
  2 siblings, 1 reply; 6+ messages in thread
From: Alex Marginean @ 2019-11-14 16:58 UTC (permalink / raw)
  To: u-boot

On some boards MDIO may get stuck if it detects echo on the line.  This is
a know hardware issue, there is a board fix for it.  In case we're running
on a board that doesn't have the fix, we don't want to loop here forever
and freeze U-Boot.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
---
 drivers/net/fsl_enetc_mdio.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/fsl_enetc_mdio.c b/drivers/net/fsl_enetc_mdio.c
index b4463a58a5..47257a6cf6 100644
--- a/drivers/net/fsl_enetc_mdio.c
+++ b/drivers/net/fsl_enetc_mdio.c
@@ -17,8 +17,13 @@
 
 static void enetc_mdio_wait_bsy(struct enetc_mdio_priv *priv)
 {
-	while (enetc_read(priv, ENETC_MDIO_CFG) & ENETC_EMDIO_CFG_BSY)
+	int to = 10000;
+
+	while ((enetc_read(priv, ENETC_MDIO_CFG) & ENETC_EMDIO_CFG_BSY) &&
+	       --to)
 		cpu_relax();
+	if (!to)
+		printf("T");
 }
 
 int enetc_mdio_read_priv(struct enetc_mdio_priv *priv, int addr, int devad,
-- 
2.17.1

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

* [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds
  2019-11-14 16:58 [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds Alex Marginean
  2019-11-14 16:58 ` [U-Boot] [PATCH 2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe Alex Marginean
  2019-11-14 16:58 ` [U-Boot] [PATCH 3/3] drivers: net: fsl_enetc_mdio: return with time-out if HW is stuck Alex Marginean
@ 2019-11-30  0:40 ` Joe Hershberger
  2 siblings, 0 replies; 6+ messages in thread
From: Joe Hershberger @ 2019-11-30  0:40 UTC (permalink / raw)
  To: u-boot

On Thu, Nov 14, 2019 at 10:59 AM Alex Marginean
<alexandru.marginean@nxp.com> wrote:
>
> The original code enabled link speeds up to 1Gbps, but the interface can
> go up to 2.5G, enable that speed to in PHY AN mask.
>
> Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

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

* [U-Boot] [PATCH 2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe
  2019-11-14 16:58 ` [U-Boot] [PATCH 2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe Alex Marginean
@ 2019-11-30  0:41   ` Joe Hershberger
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Hershberger @ 2019-11-30  0:41 UTC (permalink / raw)
  To: u-boot

On Thu, Nov 14, 2019 at 10:59 AM Alex Marginean
<alexandru.marginean@nxp.com> wrote:
>
> This reduces the time needed to establish a link as we don't reset the link
> each time the interface is used.  Our Link capabilities do not change at
> run-time so there is no need to re-apply PHY configuration each time.
>
> Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

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

* [U-Boot] [PATCH 3/3] drivers: net: fsl_enetc_mdio: return with time-out if HW is stuck
  2019-11-14 16:58 ` [U-Boot] [PATCH 3/3] drivers: net: fsl_enetc_mdio: return with time-out if HW is stuck Alex Marginean
@ 2019-11-30  0:42   ` Joe Hershberger
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Hershberger @ 2019-11-30  0:42 UTC (permalink / raw)
  To: u-boot

On Thu, Nov 14, 2019 at 10:59 AM Alex Marginean
<alexandru.marginean@nxp.com> wrote:
>
> On some boards MDIO may get stuck if it detects echo on the line.  This is
> a know hardware issue, there is a board fix for it.  In case we're running
> on a board that doesn't have the fix, we don't want to loop here forever
> and freeze U-Boot.
>
> Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

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

end of thread, other threads:[~2019-11-30  0:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 16:58 [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds Alex Marginean
2019-11-14 16:58 ` [U-Boot] [PATCH 2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe Alex Marginean
2019-11-30  0:41   ` Joe Hershberger
2019-11-14 16:58 ` [U-Boot] [PATCH 3/3] drivers: net: fsl_enetc_mdio: return with time-out if HW is stuck Alex Marginean
2019-11-30  0:42   ` Joe Hershberger
2019-11-30  0:40 ` [U-Boot] [PATCH 1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds Joe Hershberger

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.