summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2015-06-30 13:13:39 +0200
committerStefan Agner <stefan.agner@toradex.com>2015-08-04 17:51:29 +0200
commitf871d5d9dc03302ec54236dfa23b06bd65304c12 (patch)
tree3e18880a9734dfde8d85879252e641eb9155aa8b /arch/arm/mach-imx
parent81e5f332369e9f6df1a15195dab1d9a58edc798d (diff)
ARM: vf610: PM: enable Suspend-to-RAM only if hardware fixes are in place
To use self-refresh mode for DDR3 SDRAM memory in LPSTOPx mode, the hardware need to have pull-ups/downs populated on RESET/CKE line of the DDR memory. Read the device tree property which indicates whether a given board has such resistors populated.
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/pm-vf610.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/arch/arm/mach-imx/pm-vf610.c b/arch/arm/mach-imx/pm-vf610.c
index fcf820e7b8d7..0d381723d40f 100644
--- a/arch/arm/mach-imx/pm-vf610.c
+++ b/arch/arm/mach-imx/pm-vf610.c
@@ -100,6 +100,7 @@
static void __iomem *ccm_base;
static void __iomem *suspend_ocram_base;
static void (*vf610_suspend_in_ocram_fn)(void __iomem *ocram_vbase);
+static bool has_cke_reset_pulls;
#ifdef DEBUG
static void __iomem *uart_membase;
@@ -423,7 +424,8 @@ static int vf610_pm_enter(suspend_state_t state)
static int vf610_pm_valid(suspend_state_t state)
{
- return (state == PM_SUSPEND_STANDBY || state == PM_SUSPEND_MEM);
+ return (state == PM_SUSPEND_STANDBY ||
+ (state == PM_SUSPEND_MEM && has_cke_reset_pulls));
}
static const struct platform_suspend_ops vf610_pm_ops = {
@@ -521,13 +523,21 @@ static int __init vf610_suspend_init(const struct vf610_pm_socdata *socdata)
return ret;
#endif
- suspend_set_ops(&vf610_pm_ops);
+ node = of_find_compatible_node(NULL, NULL, socdata->ddrmc_compat);
+ if (node) {
+ has_cke_reset_pulls =
+ of_property_read_bool(node, "fsl,has-cke-reset-pulls");
- if (!socdata) {
- pr_warn("%s: invalid argument!\n", __func__);
- return -EINVAL;
+ of_node_put(node);
}
+ if (has_cke_reset_pulls)
+ pr_info("PM: CKE/RESET pulls available, enable Suspend-to-RAM\n");
+ else
+ pr_info("PM: No CKE/RESET pulls, disable Suspend-to-RAM\n");
+
+ suspend_set_ops(&vf610_pm_ops);
+
node = of_find_compatible_node(NULL, NULL, "mmio-sram");
if (!node) {
pr_warn("%s: failed to find ocram node!\n", __func__);