From: festevam@gmail.com (Fabio Estevam)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/7] ARM: mx25: Retrieve IIM base from dt
Date: Wed, 11 Mar 2015 11:21:31 -0300 [thread overview]
Message-ID: <1426083694-6624-4-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1426083694-6624-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 v1:
- Use BUG_ON as suggested by Russell
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);
+ 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
next prev parent reply other threads:[~2015-03-11 14:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 14:21 [PATCH v2 1/7] ARM: mx25: Remove mx25_clocks_init() Fabio Estevam
2015-03-11 14:21 ` [PATCH v2 2/7] ARM: mx25: Remove mm-imx25.c Fabio Estevam
2015-03-13 5:27 ` Shawn Guo
2015-03-11 14:21 ` [PATCH v2 3/7] ARM: mx25: Remove static memory mapping Fabio Estevam
2015-03-13 5:31 ` Shawn Guo
2015-03-11 14:21 ` Fabio Estevam [this message]
2015-03-13 5:35 ` [PATCH v2 4/7] ARM: mx25: Retrieve IIM base from dt Shawn Guo
2015-03-11 14:21 ` [PATCH v2 5/7] ARM: mx25: Remove "mx25.h" header file Fabio Estevam
2015-03-11 14:21 ` [PATCH v2 6/7] ARM: mx25: Remove imxdi_rtc platform code Fabio Estevam
2015-03-11 14:21 ` [PATCH v2 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=1426083694-6624-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.