Skip to content

Commit f68ea68

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

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
66
*/
77
#include <linux/module.h>
8+
#include <linux/of_address.h>
89
#include <linux/io.h>
910

1011
#include "hardware.h"
@@ -14,9 +15,15 @@ static int mx35_cpu_rev = -1;
1415

1516
static int mx35_read_cpu_rev(void)
1617
{
18+
void __iomem *iim_base;
19+
struct device_node *np;
1720
u32 rev;
1821

19-
rev = imx_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
22+
np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
23+
iim_base = of_iomap(np, 0);
24+
BUG_ON(!iim_base);
25+
26+
rev = imx_readl(iim_base + MXC_IIMSREV);
2027
switch (rev) {
2128
case 0x00:
2229
return IMX_CHIP_REVISION_1_0;

0 commit comments

Comments
 (0)