diff mbox series

[U-Boot,2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe

Message ID 20191114165847.11725-2-alexandru.marginean@nxp.com
State Accepted
Commit a931f78307300070e3a6cb95958f7dcc5fce3bb6
Delegated to: Joe Hershberger
Headers show
Series [U-Boot,1/3] drivers: net: fsl_enetc: Add 2.5Gbps to supported link speeds | expand

Commit Message

Alexandru Marginean Nov. 14, 2019, 4:58 p.m. UTC
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(-)

Comments

Joe Hershberger Nov. 30, 2019, 12:41 a.m. UTC | #1
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>
diff mbox series

Patch

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);