mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 6/7] ARM: microsom: make ETH work on production modules
Date: Fri,  6 Nov 2015 17:25:38 +0100	[thread overview]
Message-ID: <1446827139-339-6-git-send-email-l.stach@pengutronix.de> (raw)
In-Reply-To: <1446827139-339-1-git-send-email-l.stach@pengutronix.de>

The pre-production modules had an external crystal to generate the PHY
reference clock. Production modules rely on the i.MX6 to output the
correct clock.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/solidrun-microsom/board.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/solidrun-microsom/board.c b/arch/arm/boards/solidrun-microsom/board.c
index 280653f5b8d1..28a60b9e8c79 100644
--- a/arch/arm/boards/solidrun-microsom/board.c
+++ b/arch/arm/boards/solidrun-microsom/board.c
@@ -25,6 +25,7 @@
 #include <mach/imx6-regs.h>
 #include <mach/imx6.h>
 #include <mfd/imx6q-iomuxc-gpr.h>
+#include <linux/clk.h>
 #include <linux/sizes.h>
 #include <linux/phy.h>
 
@@ -61,13 +62,26 @@ static int ar8035_phy_fixup(struct phy_device *dev)
 	return 0;
 }
 
+static void microsom_eth_init(void)
+{
+	void __iomem *iomux = (void *)MX6_IOMUXC_BASE_ADDR;
+	u32 val;
+
+	clk_set_rate(clk_lookup("enet_ref"), 25000000);
+
+	val = readl(iomux + IOMUXC_GPR1);
+	val |= IMX6Q_GPR1_ENET_CLK_SEL_ANATOP;
+	writel(val, iomux + IOMUXC_GPR1);
+
+	phy_register_fixup_for_uid(0x004dd072, 0xffffffef, ar8035_phy_fixup);
+}
 static int hummingboard_device_init(void)
 {
 	if (!of_machine_is_compatible("solidrun,hummingboard/dl") &&
 	    !of_machine_is_compatible("solidrun,hummingboard/q"))
 		return 0;
 
-	phy_register_fixup_for_uid(0x004dd072, 0xffffffef, ar8035_phy_fixup);
+	microsom_eth_init();
 
 	/* enable USB VBUS */
 	gpio_direction_output(IMX_GPIO_NR(3, 22), 1);
-- 
2.6.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-11-06 16:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06 16:25 [PATCH 1/7] ARM: imx6: add MMDC arbitration control register define Lucas Stach
2015-11-06 16:25 ` [PATCH 2/7] ARM: microsom: delete cargo-cult from Makefile Lucas Stach
2015-11-06 16:25 ` [PATCH 3/7] ARM: microsom: change barebox image name for Hummingboard Lucas Stach
2015-11-06 16:25 ` [PATCH 4/7] ARM: microsom: import DCD from SolidRun U-Boot Lucas Stach
2015-11-06 16:25 ` [PATCH 5/7] ARM: microsom: add full set of module variants on Hummingboard Lucas Stach
2015-11-06 16:25 ` Lucas Stach [this message]
2015-11-06 16:25 ` [PATCH 7/7] ARM: microsom: get MAC address from fuses Lucas Stach
2015-11-09  6:32 ` [PATCH 1/7] ARM: imx6: add MMDC arbitration control register define Sascha Hauer

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=1446827139-339-6-git-send-email-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.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