From patchwork Thu Nov 14 16:58:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Marginean X-Patchwork-Id: 1194972 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 47DSQV4598z9sP3 for ; Fri, 15 Nov 2019 04:00:02 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 41B45C21D56; Thu, 14 Nov 2019 16:59:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 488A7C21CB6; Thu, 14 Nov 2019 16:59:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 12E02C21C29; Thu, 14 Nov 2019 16:59:12 +0000 (UTC) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lists.denx.de (Postfix) with ESMTPS id B742BC21C2F for ; Thu, 14 Nov 2019 16:59:12 +0000 (UTC) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 846821A07AF; Thu, 14 Nov 2019 17:59:12 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 772481A049B; Thu, 14 Nov 2019 17:59:12 +0100 (CET) Received: from fsr-ub1864-115.ea.freescale.net (fsr-ub1864-115.ea.freescale.net [10.171.82.26]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 21A57205D5; Thu, 14 Nov 2019 17:59:12 +0100 (CET) From: Alex Marginean To: u-boot@lists.denx.de Date: Thu, 14 Nov 2019 18:58:46 +0200 Message-Id: <20191114165847.11725-2-alexandru.marginean@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191114165847.11725-1-alexandru.marginean@nxp.com> References: <20191114165847.11725-1-alexandru.marginean@nxp.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Cc: Razvan Ionut Cirjan , Claudiu Manoil , Joe Hershberger Subject: [U-Boot] [PATCH 2/3] drivers: net: fsl_enetc: move PCS and PHY config to probe X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "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 Acked-by: Joe Hershberger --- 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);