devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fugang Duan <B38611@freescale.com>
To: shawn.guo@linaro.org
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/4] ARM: imx6sl: config iomux-gpr1 to select clock for fec
Date: Tue, 3 Sep 2013 12:26:25 +0800	[thread overview]
Message-ID: <1378182385-9205-5-git-send-email-B38611@freescale.com> (raw)
In-Reply-To: <1378182385-9205-1-git-send-email-B38611@freescale.com>

Config iomux-gpr1 to select clock source for fec system clock.
Clear gpr1[14], gpr1[18-17] bit to select the fec clock source
from internal anatop PLL.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
---
 arch/arm/mach-imx/mach-imx6sl.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c
index 132db26..96fb816 100644
--- a/arch/arm/mach-imx/mach-imx6sl.c
+++ b/arch/arm/mach-imx/mach-imx6sl.c
@@ -11,17 +11,38 @@
 #include <linux/irqchip.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/mfd/syscon.h>
+#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
+#include <linux/regmap.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
 #include "common.h"
 
+static void __init imx6sl_fec_init(void)
+{
+	struct regmap *gpr;
+
+	/* set FEC clock from internal PLL clock source */
+	gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sl-iomuxc-gpr");
+	if (!IS_ERR(gpr)) {
+		regmap_update_bits(gpr, IOMUXC_GPR1,
+			IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK, 0);
+		regmap_update_bits(gpr, IOMUXC_GPR1,
+			IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK, 0);
+	} else {
+		pr_err("failed to find fsl,imx6sl-iomux-gpr regmap\n");
+	}
+}
+
 static void __init imx6sl_init_machine(void)
 {
 	mxc_arch_reset_init_dt();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
+	imx6sl_fec_init();
 }
 
 static void __init imx6sl_init_irq(void)
-- 
1.7.1

  parent reply	other threads:[~2013-09-03  4:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03  4:26 [PATCH v2 0/4] *** ARM: imx6sl: add FEC support for imx6sl evk platform *** Fugang Duan
2013-09-03  4:26 ` [PATCH v2 1/4] ARM: dts: add iomuxc-gpr device node for imx6sl Fugang Duan
2013-09-04 13:23   ` Shawn Guo
2013-09-03  4:26 ` [PATCH v2 2/4] ARM: dts: add fec phy reset for imx6sl evk board Fugang Duan
2013-09-09 14:53   ` Shawn Guo
2013-09-09 15:00     ` Sascha Hauer
2013-09-10  1:26     ` Duan Fugang-B38611
2013-09-10  3:11       ` Shawn Guo
2013-09-10  3:23         ` Duan Fugang-B38611
2013-09-10  3:34           ` Shawn Guo
2013-09-03  4:26 ` [PATCH v2 3/4] ARM: imx6sl: add imx6sl iomux-gpr field define Fugang Duan
2013-09-05  1:44   ` Otavio Salvador
2013-09-05  2:01     ` Duan Fugang-B38611
2013-09-05  2:04       ` Otavio Salvador
2013-09-03  4:26 ` Fugang Duan [this message]
2013-09-04 13:19 ` [PATCH v2 0/4] *** ARM: imx6sl: add FEC support for imx6sl evk platform *** Shawn Guo

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=1378182385-9205-5-git-send-email-B38611@freescale.com \
    --to=b38611@freescale.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=shawn.guo@linaro.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).