Commit d54debc7 authored by Fabio Estevam's avatar Fabio Estevam Committed by Shawn Guo

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: default avatarFabio Estevam <festevam@gmail.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 94b2bec1
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* modify it under the terms of the GNU General Public License. * modify it under the terms of the GNU General Public License.
*/ */
#include <linux/of_address.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -15,13 +16,20 @@ ...@@ -15,13 +16,20 @@
static int mx27_suspend_enter(suspend_state_t state) static int mx27_suspend_enter(suspend_state_t state)
{ {
void __iomem *ccm_base;
struct device_node *np;
u32 cscr; u32 cscr;
np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
ccm_base = of_iomap(np, 0);
BUG_ON(!ccm_base);
switch (state) { switch (state) {
case PM_SUSPEND_MEM: case PM_SUSPEND_MEM:
/* Clear MPEN and SPEN to disable MPLL/SPLL */ /* Clear MPEN and SPEN to disable MPLL/SPLL */
cscr = imx_readl(MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR)); cscr = imx_readl(ccm_base);
cscr &= 0xFFFFFFFC; cscr &= 0xFFFFFFFC;
imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR)); imx_writel(cscr, ccm_base);
/* Executes WFI */ /* Executes WFI */
cpu_do_idle(); cpu_do_idle();
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment