summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/cpu-imx25.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-03-13 10:31:54 -0300
committerShawn Guo <shawn.guo@linaro.org>2015-03-13 22:06:35 +0800
commit8b88f7ef31ddecd943e3312d6b61e1b1c6eab3d0 (patch)
treee265b117f51f5a58dc2e63b5aff55a37f8122bb5 /arch/arm/mach-imx/cpu-imx25.c
parentd8a3beea003b4c162e5713a1a86596e9296da1d7 (diff)
ARM: mx25: Retrieve IIM base from dt
We should use dt to retrieve the IIM base address. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/cpu-imx25.c')
-rw-r--r--arch/arm/mach-imx/cpu-imx25.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c
index 96ec64b5ff7d..d0ad67e802d3 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;