From: Fabio Estevam Date: Thu, 17 Sep 2020 00:41:20 +0000 (-0300) Subject: ARM: imx35: Retrieve the IIM base address from devicetree X-Git-Tag: baikal/aarch64/sdk5.9~128 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=916325bd640fd5802f26c7ed8d7cf5b71b2c3c19;p=kernel.git ARM: imx35: Retrieve the IIM base address from devicetree [ Upstream commit 38f93c435d1a20b66ce61d83dde0d63da17ffce0 ] Now that imx35 has been converted to a devicetree-only platform, retrieve the IIM base address from devicetree. Signed-off-by: Fabio Estevam Acked-by: Arnd Bergmann Signed-off-by: Shawn Guo Stable-dep-of: 87b30c4b0efb ("ARM: imx: add missing of_node_put()") Signed-off-by: Sasha Levin --- diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c index ebb3cdabd5068..80e7d8ab9f1bb 100644 --- a/arch/arm/mach-imx/cpu-imx35.c +++ b/arch/arm/mach-imx/cpu-imx35.c @@ -5,6 +5,7 @@ * Copyright (c) 2009 Daniel Mack */ #include +#include #include #include "hardware.h" @@ -14,9 +15,15 @@ static int mx35_cpu_rev = -1; static int mx35_read_cpu_rev(void) { + void __iomem *iim_base; + struct device_node *np; 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) { case 0x00: return IMX_CHIP_REVISION_1_0;