mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philippe Reynes <tremyfr@yahoo.fr>
To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: s.hauer@pengutronix.de, julien.boibessot@armadeus.com,
	eric.jarrige@armadeus.org, Philippe Reynes <tremyfr@yahoo.fr>
Subject: [PATCH 1/4] apf27: enable Ethernet PHY
Date: Sun, 25 Nov 2012 21:17:02 +0100	[thread overview]
Message-ID: <1353874625-14754-2-git-send-email-tremyfr@yahoo.fr> (raw)
In-Reply-To: <1353874625-14754-1-git-send-email-tremyfr@yahoo.fr>

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 <tremyfr@yahoo.fr>
---
 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 <linux/irq.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
+#include <linux/delay.h>
+#include <linux/phy.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <mach/common.h>
@@ -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);
 }
-- 
1.7.4.4


  reply	other threads:[~2012-11-25 20:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-25 20:17 [PATCH 0/4] apf27: enable Ethernet PHY and add support of ds1374 rtc Philippe Reynes
2012-11-25 20:17 ` Philippe Reynes [this message]
2012-11-25 20:17 ` [PATCH 2/4] ds1374: add support of device tree Philippe Reynes
2012-11-26  9:08   ` Thomas Petazzoni
2012-11-25 20:17 ` [PATCH 3/4] imx27-dt: configure i2c1 gpio on armadeus apf27 Philippe Reynes
2012-11-26  9:28   ` Thomas Petazzoni
2012-11-26  9:59     ` Sascha Hauer
2012-11-25 20:17 ` [PATCH 4/4] apf27: add rtc ds1374 to the device tree Philippe Reynes

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=1353874625-14754-2-git-send-email-tremyfr@yahoo.fr \
    --to=tremyfr@yahoo.fr \
    --cc=eric.jarrige@armadeus.org \
    --cc=julien.boibessot@armadeus.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    /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

all inboxes | Powered by JetHome®