summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2020-09-17 03:41:16 +0300
committerShawn Guo <shawnguo@kernel.org>2020-09-22 09:08:00 +0300
commitd54debc72f5f836917c957dce610ec50546ec158 (patch)
tree1292d0939b97a0586fcfcab81e7a32ff7591a702
parent94b2bec1b0e054b27b0a0b5f52a0cd55c83340f4 (diff)
downloadlinux-d54debc72f5f836917c957dce610ec50546ec158.tar.xz
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>
-rw-r--r--arch/arm/mach-imx/pm-imx27.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c
index d943535566c8..020e6deb67c8 100644
--- a/arch/arm/mach-imx/pm-imx27.c
+++ b/arch/arm/mach-imx/pm-imx27.c
@@ -7,6 +7,7 @@
* modify it under the terms of the GNU General Public License.
*/
+#include <linux/of_address.h>
#include <linux/kernel.h>
#include <linux/suspend.h>
#include <linux/io.h>
@@ -15,13 +16,20 @@
static int mx27_suspend_enter(suspend_state_t state)
{
+ void __iomem *ccm_base;
+ struct device_node *np;
u32 cscr;
+
+ np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
+ ccm_base = of_iomap(np, 0);
+ BUG_ON(!ccm_base);
+
switch (state) {
case PM_SUSPEND_MEM:
/* 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;
- imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
+ imx_writel(cscr, ccm_base);
/* Executes WFI */
cpu_do_idle();
break;