From patchwork Tue Apr 7 14:19:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 25684 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id BCD9BDE333 for ; Wed, 8 Apr 2009 00:20:09 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by ozlabs.org (Postfix) with ESMTP id 9CFD8DDFD6 for ; Wed, 8 Apr 2009 00:19:50 +1000 (EST) Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 833F61C00142; Tue, 7 Apr 2009 16:19:46 +0200 (CEST) X-Auth-Info: swS4QZvdcYxHccXKEKEmq1X/drDDYk6zOp5P8w9nYKU= Received: from localhost (p5496DB35.dip.t-dialin.net [84.150.219.53]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTP id 7EAE190193; Tue, 7 Apr 2009 16:19:48 +0200 (CEST) From: Anatolij Gustschin To: linuxppc-dev@ozlabs.org Subject: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code Date: Tue, 7 Apr 2009 16:19:48 +0200 Message-Id: <1239113988-4579-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.5.6.3 Cc: Anatolij Gustschin X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org If the firmware missed to initialize the PHY correctly, Linux may hang up on socrates while eth0/eth1 interface startup (caused by continuous unacknowledged PHY interrupt). This patch adds PHY fixup to socrates platform code to ensure the PHY is pre-initialized correctly. It is needed to be compatible with older firmware. Signed-off-by: Anatolij Gustschin --- arch/powerpc/platforms/85xx/socrates.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c index d0e8443..2275a39 100644 --- a/arch/powerpc/platforms/85xx/socrates.c +++ b/arch/powerpc/platforms/85xx/socrates.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -78,6 +79,21 @@ static void __init socrates_pic_init(void) of_node_put(np); } +static int socrates_m88e1121_fixup(struct phy_device *phydev) +{ + int err; + + err = phy_write(phydev, 0x12, 0); + if (err < 0) + return err; + + err = phy_read(phydev, 0x13); + if (err < 0) + return err; + + return 0; +} + /* * Setup the architecture */ @@ -105,6 +121,8 @@ static struct of_device_id __initdata socrates_of_bus_ids[] = { static void __init socrates_init(void) { of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL); + phy_register_fixup_for_uid(0x1410cb0, 0xffffff0, + socrates_m88e1121_fixup); } /*