aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Estevam2020-09-16 21:41:18 -0300
committerShawn Guo2020-09-22 14:08:06 +0800
commit2cf98d12958cbb52c23e9e613687171dd6e60120 (patch)
treeff201af626c8a3192ec2167878e3d7b7c223740c
parent3172225d45bd918a5c4865e7cd8eb0c9d79f8530 (diff)
ARM: imx3: Retrieve the CCM base address from devicetree
Now that imx31 and imx35 has been converted to a devicetree-only platform, retrieve the CCM 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>
-rw-r--r--arch/arm/mach-imx/mm-imx3.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 4df7edc7ae7c..b7c5e15bb972 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -11,6 +11,7 @@
#include <linux/init.h>
#include <linux/err.h>
#include <linux/io.h>
+#include <linux/of_address.h>
#include <linux/pinctrl/machine.h>
#include <asm/system_misc.h>
@@ -99,10 +100,14 @@ static void imx31_idle(void)
void __init imx31_init_early(void)
{
+ struct device_node *np;
+
mxc_set_cpu_type(MXC_CPU_MX31);
arch_ioremap_caller = imx3_ioremap_caller;
arm_pm_idle = imx31_idle;
- mx3_ccm_base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR);
+ np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
+ mx3_ccm_base = of_iomap(np, 0);
+ BUG_ON(!mx3_ccm_base);
}
void __init mx31_init_irq(void)
@@ -137,10 +142,14 @@ static void imx35_idle(void)
void __init imx35_init_early(void)
{
+ struct device_node *np;
+
mxc_set_cpu_type(MXC_CPU_MX35);
arm_pm_idle = imx35_idle;
arch_ioremap_caller = imx3_ioremap_caller;
- mx3_ccm_base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR);
+ np = of_find_compatible_node(NULL, NULL, "fsl,imx35-ccm");
+ mx3_ccm_base = of_iomap(np, 0);
+ BUG_ON(!mx3_ccm_base);
}
void __init mx35_init_irq(void)