linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: linuxppc-dev@ozlabs.org
Cc: Anatolij Gustschin <agust@denx.de>
Subject: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code
Date: Tue,  7 Apr 2009 16:19:48 +0200	[thread overview]
Message-ID: <1239113988-4579-1-git-send-email-agust@denx.de> (raw)

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 <agust@denx.de>
---
 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 <linux/delay.h>
 #include <linux/seq_file.h>
 #include <linux/of_platform.h>
+#include <linux/phy.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
@@ -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);
 }
 
 /*
-- 
1.5.6.3

             reply	other threads:[~2009-04-07 14:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 14:19 Anatolij Gustschin [this message]
2009-04-07 14:30 ` [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code Anton Vorontsov
2009-04-07 17:24   ` Anatolij Gustschin
2009-04-07 18:09     ` Anton Vorontsov
2009-04-07 18:40       ` Anton Vorontsov
2009-04-21 17:19 ` [PATCH v2] " Anatolij Gustschin
2009-04-21 21:54   ` Kumar Gala
2009-04-21 22:04     ` Kumar Gala
2009-04-21 23:24       ` Anatolij Gustschin
2009-06-16 13:46         ` Kumar Gala
2009-06-23 10:15           ` Anatolij Gustschin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1239113988-4579-1-git-send-email-agust@denx.de \
    --to=agust@denx.de \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).