Commit 3172225d authored by Fabio Estevam's avatar Fabio Estevam Committed by Shawn Guo

ARM: imx31: Retrieve the IIM base address from devicetree

Now that imx31 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 d54debc7
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_address.h>
#include <linux/io.h> #include <linux/io.h>
#include "common.h" #include "common.h"
...@@ -32,10 +33,16 @@ static struct { ...@@ -32,10 +33,16 @@ static struct {
static int mx31_read_cpu_rev(void) static int mx31_read_cpu_rev(void)
{ {
void __iomem *iim_base;
struct device_node *np;
u32 i, srev; u32 i, srev;
np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim");
iim_base = of_iomap(np, 0);
BUG_ON(!iim_base);
/* read SREV register from IIM module */ /* read SREV register from IIM module */
srev = imx_readl(MX31_IO_ADDRESS(MX31_IIM_BASE_ADDR + MXC_IIMSREV)); srev = imx_readl(iim_base + MXC_IIMSREV);
srev &= 0xff; srev &= 0xff;
for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++) for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)
......
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