linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: festevam@gmail.com (Fabio Estevam)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/6] ARM: mx25: Retrieve IIM base from dt
Date: Fri, 13 Mar 2015 10:31:54 -0300	[thread overview]
Message-ID: <1426253518-3076-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1426253518-3076-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@freescale.com>

We should use dt to retrieve the IIM base address.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- Only changed the order of this patch as per Shawn's suggestion

 arch/arm/mach-imx/cpu-imx25.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c
index 96ec64b..d0ad67e 100644
--- a/arch/arm/mach-imx/cpu-imx25.c
+++ b/arch/arm/mach-imx/cpu-imx25.c
@@ -11,6 +11,8 @@
  */
 #include <linux/module.h>
 #include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
 
 #include "iim.h"
 #include "hardware.h"
@@ -20,8 +22,15 @@ static int mx25_cpu_rev = -1;
 static int mx25_read_cpu_rev(void)
 {
 	u32 rev;
+	void __iomem *iim_base;
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim");
+	iim_base = of_iomap(np, 0);
+	BUG_ON(!iim_base);
+	rev = readl(iim_base + MXC_IIMSREV);
+	iounmap(iim_base);
 
-	rev = __raw_readl(MX25_IO_ADDRESS(MX25_IIM_BASE_ADDR + MXC_IIMSREV));
 	switch (rev) {
 	case 0x00:
 		return IMX_CHIP_REVISION_1_0;
-- 
1.9.1

  reply	other threads:[~2015-03-13 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 13:31 [PATCH v3 1/6] ARM: mx25: Remove mx25_clocks_init() Fabio Estevam
2015-03-13 13:31 ` Fabio Estevam [this message]
2015-03-13 13:31 ` [PATCH v3 3/6] ARM: mx25: Remove static memory mapping Fabio Estevam
2015-03-13 14:15   ` Shawn Guo
2015-03-13 16:30     ` Fabio Estevam
2015-03-17 12:39     ` Fabio Estevam
2015-03-23 13:29       ` Shawn Guo
2015-03-13 13:31 ` [PATCH v3 4/6] ARM: mx25: Remove "mx25.h" header file Fabio Estevam
2015-03-13 13:31 ` [PATCH v3 5/6] ARM: mx25: Remove imxdi_rtc platform code Fabio Estevam
2015-03-13 13:31 ` [PATCH v3 6/6] ARM: imx_v4_v5_defconfig: Remove CONFIG_MACH_MX25_3DS Fabio Estevam

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=1426253518-3076-2-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).