Skip to content

Commit 2cf98d1

Browse files
fabioestevamShawn Guo
authored andcommitted
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>
1 parent 3172225 commit 2cf98d1

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

arch/arm/mach-imx/mm-imx3.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/init.h>
1212
#include <linux/err.h>
1313
#include <linux/io.h>
14+
#include <linux/of_address.h>
1415
#include <linux/pinctrl/machine.h>
1516

1617
#include <asm/system_misc.h>
@@ -99,10 +100,14 @@ static void imx31_idle(void)
99100

100101
void __init imx31_init_early(void)
101102
{
103+
struct device_node *np;
104+
102105
mxc_set_cpu_type(MXC_CPU_MX31);
103106
arch_ioremap_caller = imx3_ioremap_caller;
104107
arm_pm_idle = imx31_idle;
105-
mx3_ccm_base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR);
108+
np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
109+
mx3_ccm_base = of_iomap(np, 0);
110+
BUG_ON(!mx3_ccm_base);
106111
}
107112

108113
void __init mx31_init_irq(void)
@@ -137,10 +142,14 @@ static void imx35_idle(void)
137142

138143
void __init imx35_init_early(void)
139144
{
145+
struct device_node *np;
146+
140147
mxc_set_cpu_type(MXC_CPU_MX35);
141148
arm_pm_idle = imx35_idle;
142149
arch_ioremap_caller = imx3_ioremap_caller;
143-
mx3_ccm_base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR);
150+
np = of_find_compatible_node(NULL, NULL, "fsl,imx35-ccm");
151+
mx3_ccm_base = of_iomap(np, 0);
152+
BUG_ON(!mx3_ccm_base);
144153
}
145154

146155
void __init mx35_init_irq(void)

0 commit comments

Comments
 (0)