Commit 8b88f7ef authored by Fabio Estevam's avatar Fabio Estevam Committed by Shawn Guo

ARM: mx25: Retrieve IIM base from dt

We should use dt to retrieve the IIM base address.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
parent d8a3beea
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include "iim.h" #include "iim.h"
#include "hardware.h" #include "hardware.h"
...@@ -20,8 +22,15 @@ static int mx25_cpu_rev = -1; ...@@ -20,8 +22,15 @@ static int mx25_cpu_rev = -1;
static int mx25_read_cpu_rev(void) static int mx25_read_cpu_rev(void)
{ {
u32 rev; 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) { 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