Skip to content

Commit 3172225

Browse files
fabioestevamShawn Guo
authored andcommitted
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: Fabio Estevam <festevam@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
1 parent d54debc commit 3172225

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

arch/arm/mach-imx/cpu-imx31.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include <linux/module.h>
9+
#include <linux/of_address.h>
910
#include <linux/io.h>
1011

1112
#include "common.h"
@@ -32,10 +33,16 @@ static struct {
3233

3334
static int mx31_read_cpu_rev(void)
3435
{
36+
void __iomem *iim_base;
37+
struct device_node *np;
3538
u32 i, srev;
3639

40+
np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim");
41+
iim_base = of_iomap(np, 0);
42+
BUG_ON(!iim_base);
43+
3744
/* read SREV register from IIM module */
38-
srev = imx_readl(MX31_IO_ADDRESS(MX31_IIM_BASE_ADDR + MXC_IIMSREV));
45+
srev = imx_readl(iim_base + MXC_IIMSREV);
3946
srev &= 0xff;
4047

4148
for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)

0 commit comments

Comments
 (0)