summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/pm-imx6.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2015-04-25 17:37:12 +0200
committerShawn Guo <shawn.guo@linaro.org>2015-06-03 08:44:31 +0200
commitf0b478b5d42ee9d925b45c22cbdc1ad4c90c3cf1 (patch)
tree03bd549929370f183a78002a85dcfb9d1b8cc836 /arch/arm/mach-imx/pm-imx6.c
parentARM: imx6: set initial power mode in pm function (diff)
downloadlinux-f0b478b5d42ee9d925b45c22cbdc1ad4c90c3cf1.tar.xz
linux-f0b478b5d42ee9d925b45c22cbdc1ad4c90c3cf1.zip
ARM: imx6: let pm code map CCM block on its own
We are about to move imx6 clock driver into drivers/clk, so let's get imx6 pm code map CCM block on its own rather than relying on clock driver to do the mapping. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/pm-imx6.c')
-rw-r--r--arch/arm/mach-imx/pm-imx6.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index 5858bde5a4e7..27bc80dab2d8 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -89,6 +89,7 @@ struct imx6_pm_base {
struct imx6_pm_socdata {
u32 ddr_type;
+ const char *ccm_compat;
const char *mmdc_compat;
const char *src_compat;
const char *iomuxc_compat;
@@ -138,6 +139,7 @@ static const u32 imx6sx_mmdc_io_offset[] __initconst = {
};
static const struct imx6_pm_socdata imx6q_pm_data __initconst = {
+ .ccm_compat = "fsl,imx6q-ccm",
.mmdc_compat = "fsl,imx6q-mmdc",
.src_compat = "fsl,imx6q-src",
.iomuxc_compat = "fsl,imx6q-iomuxc",
@@ -147,6 +149,7 @@ static const struct imx6_pm_socdata imx6q_pm_data __initconst = {
};
static const struct imx6_pm_socdata imx6dl_pm_data __initconst = {
+ .ccm_compat = "fsl,imx6q-ccm",
.mmdc_compat = "fsl,imx6q-mmdc",
.src_compat = "fsl,imx6q-src",
.iomuxc_compat = "fsl,imx6dl-iomuxc",
@@ -156,6 +159,7 @@ static const struct imx6_pm_socdata imx6dl_pm_data __initconst = {
};
static const struct imx6_pm_socdata imx6sl_pm_data __initconst = {
+ .ccm_compat = "fsl,imx6sl-ccm",
.mmdc_compat = "fsl,imx6sl-mmdc",
.src_compat = "fsl,imx6sl-src",
.iomuxc_compat = "fsl,imx6sl-iomuxc",
@@ -165,6 +169,7 @@ static const struct imx6_pm_socdata imx6sl_pm_data __initconst = {
};
static const struct imx6_pm_socdata imx6sx_pm_data __initconst = {
+ .ccm_compat = "fsl,imx6sx-ccm",
.mmdc_compat = "fsl,imx6sx-mmdc",
.src_compat = "fsl,imx6sx-src",
.iomuxc_compat = "fsl,imx6sx-iomuxc",
@@ -392,11 +397,6 @@ static const struct platform_suspend_ops imx6q_pm_ops = {
.valid = imx6q_pm_valid,
};
-void __init imx6q_pm_set_ccm_base(void __iomem *base)
-{
- ccm_base = base;
-}
-
static int __init imx6_pm_get_base(struct imx6_pm_base *base,
const char *compat)
{
@@ -482,8 +482,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
/*
* ccm physical address is not used by asm code currently,
- * so get ccm virtual address directly, as we already have
- * it from ccm driver.
+ * so get ccm virtual address directly.
*/
pm_info->ccm_base.vbase = ccm_base;
@@ -554,9 +553,12 @@ put_node:
static void __init imx6_pm_common_init(const struct imx6_pm_socdata
*socdata)
{
+ struct device_node *np;
struct regmap *gpr;
int ret;
+ np = of_find_compatible_node(NULL, NULL, socdata->ccm_compat);
+ ccm_base = of_iomap(np, 0);
WARN_ON(!ccm_base);
imx6_set_lpm(WAIT_CLOCKED);