Commit f68ea682 authored by Fabio Estevam's avatar Fabio Estevam Committed by Shawn Guo

ARM: imx35: Retrieve the IIM base address from devicetree

Now that imx35 has been converted to a devicetree-only platform,
retrieve the IIM base address from devicetree.
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 445cf02c
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Copyright (c) 2009 Daniel Mack <daniel@caiaq.de> * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_address.h>
#include <linux/io.h> #include <linux/io.h>
#include "hardware.h" #include "hardware.h"
...@@ -14,9 +15,15 @@ static int mx35_cpu_rev = -1; ...@@ -14,9 +15,15 @@ static int mx35_cpu_rev = -1;
static int mx35_read_cpu_rev(void) static int mx35_read_cpu_rev(void)
{ {
void __iomem *iim_base;
struct device_node *np;
u32 rev; u32 rev;
rev = imx_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV)); np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
iim_base = of_iomap(np, 0);
BUG_ON(!iim_base);
rev = imx_readl(iim_base + MXC_IIMSREV);
switch (rev) { switch (rev) {
case 0x00: case 0x00:
return IMX_CHIP_REVISION_1_0; return IMX_CHIP_REVISION_1_0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment