From patchwork Wed Feb 8 00:08:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 140037 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id ECC73B6EF1 for ; Wed, 8 Feb 2012 11:08:57 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9DBF728146; Wed, 8 Feb 2012 01:08:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id waMbxL-bcPFF; Wed, 8 Feb 2012 01:08:53 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 70DE4280ED; Wed, 8 Feb 2012 01:08:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3635F280CC for ; Wed, 8 Feb 2012 01:08:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6GSqUOaBcQeT for ; Wed, 8 Feb 2012 01:08:41 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from oproxy9.bluehost.com (oproxy9.bluehost.com [69.89.24.6]) by theia.denx.de (Postfix) with SMTP id 1064C280B8 for ; Wed, 8 Feb 2012 01:08:39 +0100 (CET) Received: (qmail 29216 invoked by uid 0); 8 Feb 2012 00:08:37 -0000 Received: from unknown (HELO box284.bluehost.com) (69.89.31.84) by oproxy9.bluehost.com with SMTP; 8 Feb 2012 00:08:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=boundarydevices.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=6KMcKMm635L3V4OVeXdpcsVTFi8WTlEw1l5o0r5Kr8c=; b=Zl6BWZYF+5Q71QNOTHxSwoMa8mMO2V3CLqJShDGjx0lMLiCtKueNrP4hRFKJ+LrpcEZI7aPwtSwQ66/PLlyLC9hZ+wSytr7Gou5AJscyc5ARwOmduCl827bEVAMs2HoE; Received: from [70.96.116.236] (helo=officeserver-2) by box284.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Ruv5O-00080C-TJ; Tue, 07 Feb 2012 17:08:35 -0700 Received: from tkisky by officeserver-2 with local (Exim 4.76) (envelope-from ) id 1Ruv5g-0001rN-AF; Tue, 07 Feb 2012 17:08:52 -0700 From: Troy Kisky To: dirk.behme@googlemail.com Date: Tue, 7 Feb 2012 17:08:49 -0700 Message-Id: <1328659730-7109-4-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1328659730-7109-1-git-send-email-troy.kisky@boundarydevices.com> References: <1328659730-7109-1-git-send-email-troy.kisky@boundarydevices.com> X-Identified-User: {1412:box284.bluehost.com:boundar4:boundarydevices.com} {sentby:smtp auth 70.96.116.236 authed with troy.kisky@boundarydevices.com} Cc: r49496@freescale.com, jason.hui@linaro.org, u-boot@lists.denx.de, afleming@gmail.com Subject: [U-Boot] [PATCH v5 4/5] net: phy: make board_phy_config responsible for calling drv->config X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Boards may have things they want done before or after normal phy config. Letting the boards call drv->config allows them more flexibilty. Boards affected by this change are corenet_ds and mpc8544ds. Signed-off-by: Troy Kisky Acked-by: Dirk Behme --- board/freescale/corenet_ds/eth_p4080.c | 2 ++ board/freescale/mpc8544ds/mpc8544ds.c | 2 ++ drivers/net/phy/phy.c | 5 ++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/board/freescale/corenet_ds/eth_p4080.c b/board/freescale/corenet_ds/eth_p4080.c index 1f00c14..b87b092 100644 --- a/board/freescale/corenet_ds/eth_p4080.c +++ b/board/freescale/corenet_ds/eth_p4080.c @@ -96,6 +96,8 @@ struct mii_dev *mii_dev_for_muxval(u32 muxval) #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES9) && defined(CONFIG_PHY_TERANETICS) int board_phy_config(struct phy_device *phydev) { + if (phydev->drv->config) + phydev->drv->config(phydev); if (phydev->drv->uid == PHY_UID_TN2020) { unsigned long timeout = 1 * 1000; /* 1 seconds */ enum srds_prtcl device; diff --git a/board/freescale/mpc8544ds/mpc8544ds.c b/board/freescale/mpc8544ds/mpc8544ds.c index 6fe8d39..24a1715 100644 --- a/board/freescale/mpc8544ds/mpc8544ds.c +++ b/board/freescale/mpc8544ds/mpc8544ds.c @@ -261,6 +261,8 @@ int board_phy_config(struct phy_device *phydev) uint phyid; struct mii_dev *bus = phydev->bus; + if (phydev->drv->config) + phydev->drv->config(phydev); if (do_once) return 0; diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index eb55180..7d327f7 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -733,6 +733,8 @@ int phy_startup(struct phy_device *phydev) static int __board_phy_config(struct phy_device *phydev) { + if (phydev->drv->config) + return phydev->drv->config(phydev); return 0; } @@ -741,9 +743,6 @@ int board_phy_config(struct phy_device *phydev) int phy_config(struct phy_device *phydev) { - if (phydev->drv->config) - phydev->drv->config(phydev); - /* Invoke an optional board-specific helper */ board_phy_config(phydev);