From patchwork Thu Feb 2 01:14:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 139029 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 203A5B71A5 for ; Thu, 2 Feb 2012 12:15:33 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 70314280AF; Thu, 2 Feb 2012 02:15:29 +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 3LScJHQu3Zew; Thu, 2 Feb 2012 02:15:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 39D4E2808A; Thu, 2 Feb 2012 02:15:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ABC722808A for ; Thu, 2 Feb 2012 02:15:21 +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 aXtgpy5ZYH7o for ; Thu, 2 Feb 2012 02:15:20 +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 339772807B for ; Thu, 2 Feb 2012 02:15:18 +0100 (CET) Received: (qmail 25432 invoked by uid 0); 2 Feb 2012 01:15:16 -0000 Received: from unknown (HELO box284.bluehost.com) (69.89.31.84) by oproxy9.bluehost.com with SMTP; 2 Feb 2012 01:15:16 -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=ltmgzhE2zDzxflD/Jf53PRN+5zXtDBVWEJlRVRa0VCRTKMyLa7qjgxMpI4iY3RqSsjlIC4W4HvpMOScA9ffPCbzbALyFVH+OObREtYzUx8kNksWIEqhlhx6ef4Cmpu4H; 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 1RslGb-00028A-PE; Wed, 01 Feb 2012 18:15:13 -0700 Received: from tkisky by officeserver-2 with local (Exim 4.76) (envelope-from ) id 1RslGo-00066G-TQ; Wed, 01 Feb 2012 18:15:26 -0700 From: Troy Kisky To: dirk.behme@googlemail.com Date: Wed, 1 Feb 2012 18:14:46 -0700 Message-Id: <1328145288-23406-4-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1328145288-23406-1-git-send-email-troy.kisky@boundarydevices.com> References: <1328145288-23406-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 v3 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);