All of lore.kernel.org
 help / color / mirror / Atom feed
From: festevam@gmail.com (Fabio Estevam)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] ARM: mx25: Retrieve IIM base from dt
Date: Wed, 11 Mar 2015 09:43:52 -0300	[thread overview]
Message-ID: <1426077835-31081-4-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1426077835-31081-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>
---
 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..0d2d860 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);
+	WARN_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

  parent reply	other threads:[~2015-03-11 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 12:43 [PATCH 1/7] ARM: mx25: Remove mx25_clocks_init() Fabio Estevam
2015-03-11 12:43 ` [PATCH 2/7] ARM: mx25: Remove mm-imx25.c Fabio Estevam
2015-03-11 12:43 ` [PATCH 3/7] ARM: mx25: Remove static memory mapping Fabio Estevam
2015-03-11 12:43 ` Fabio Estevam [this message]
2015-03-11 13:24   ` [PATCH 4/7] ARM: mx25: Retrieve IIM base from dt Russell King - ARM Linux
2015-03-11 14:20     ` Fabio Estevam
2015-03-11 12:43 ` [PATCH 5/7] ARM: mx25: Remove "mx25.h" header file Fabio Estevam
2015-03-11 12:58   ` Fabio Estevam
2015-03-11 12:43 ` [PATCH 6/7] ARM: mx25: Remove imxdi_rtc platform code Fabio Estevam
2015-03-11 12:43 ` [PATCH 7/7] 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=1426077835-31081-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.