From patchwork Sun Nov 25 20:17:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: trem X-Patchwork-Id: 201566 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DA54C2C007A for ; Mon, 26 Nov 2012 07:20:42 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TcieF-0002rb-Bu; Sun, 25 Nov 2012 20:17:51 +0000 Received: from smtp4-g21.free.fr ([2a01:e0c:1:1599::13]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tcie0-0002py-BJ for linux-arm-kernel@lists.infradead.org; Sun, 25 Nov 2012 20:17:37 +0000 Received: from localhost.localdomain (unknown [88.161.33.221]) by smtp4-g21.free.fr (Postfix) with ESMTP id 9039E4C80FF; Sun, 25 Nov 2012 21:17:30 +0100 (CET) From: Philippe Reynes To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] apf27: enable Ethernet PHY Date: Sun, 25 Nov 2012 21:17:02 +0100 Message-Id: <1353874625-14754-2-git-send-email-tremyfr@yahoo.fr> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1353874625-14754-1-git-send-email-tremyfr@yahoo.fr> References: <1353874625-14754-1-git-send-email-tremyfr@yahoo.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121125_151737_403303_CF8967A0 X-CRM114-Status: GOOD ( 10.81 ) X-Spam-Score: -1.0 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tremyfr[at]yahoo.fr) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: Philippe Reynes , s.hauer@pengutronix.de, eric.jarrige@armadeus.org, julien.boibessot@armadeus.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org At startup the Ethernet PHY is in power down mode, so we need to force the "all capable" mode to activate it. Signed-off-by: Philippe Reynes --- arch/arm/mach-imx/imx27-dt.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c index e80d523..f212f81 100644 --- a/arch/arm/mach-imx/imx27-dt.c +++ b/arch/arm/mach-imx/imx27-dt.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include #include @@ -32,8 +34,27 @@ static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = { { /* sentinel */ } }; +int apf27_lan8700_wakeup(struct phy_device *phydev) +{ + int rc = phy_read(phydev, MII_DCOUNTER); + + phy_write(phydev, MII_DCOUNTER, rc | 0xE0); + phy_write(phydev, MII_BMCR, BMCR_RESET); + udelay(1000); + + return 0; +} + +static void __init apf27_init(void) +{ + phy_register_fixup_for_id("imx27-fec.0-1:1f", apf27_lan8700_wakeup); +} + static void __init imx27_dt_init(void) { + if (of_machine_is_compatible("armadeus,imx27-apf27")) + apf27_init(); + of_platform_populate(NULL, of_default_bus_match_table, imx27_auxdata_lookup, NULL); }