Skip to content

Commit d54debc

Browse files
fabioestevamShawn Guo
authored andcommitted
ARM: imx27: Retrieve the CCM base address from devicetree
Now that imx27 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 94b2bec commit d54debc

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

arch/arm/mach-imx/pm-imx27.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* modify it under the terms of the GNU General Public License.
88
*/
99

10+
#include <linux/of_address.h>
1011
#include <linux/kernel.h>
1112
#include <linux/suspend.h>
1213
#include <linux/io.h>
@@ -15,13 +16,20 @@
1516

1617
static int mx27_suspend_enter(suspend_state_t state)
1718
{
19+
void __iomem *ccm_base;
20+
struct device_node *np;
1821
u32 cscr;
22+
23+
np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
24+
ccm_base = of_iomap(np, 0);
25+
BUG_ON(!ccm_base);
26+
1927
switch (state) {
2028
case PM_SUSPEND_MEM:
2129
/* Clear MPEN and SPEN to disable MPLL/SPLL */
22-
cscr = imx_readl(MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
30+
cscr = imx_readl(ccm_base);
2331
cscr &= 0xFFFFFFFC;
24-
imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
32+
imx_writel(cscr, ccm_base);
2533
/* Executes WFI */
2634
cpu_do_idle();
2735
break;

0 commit comments

Comments
 (0)