Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1354763

[PATCH 16/18] ARM: vf610: PM: enable Suspend-to-RAM only if hardware fixes are in place

From Stefan Agner <stefan@agner.ch>
Newsgroups linux.kernel
Subject [PATCH 16/18] ARM: vf610: PM: enable Suspend-to-RAM only if hardware fixes are in place
Date 2016-03-10 03:20 +0100
Message-ID <raYmK-aJ-37@gated-at.bofh.it> (permalink)
References <raYmJ-aJ-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 arch/arm/mach-imx/pm-vf610.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/pm-vf610.c b/arch/arm/mach-imx/pm-vf610.c
index ecc7c9c..3da93e9 100644
--- a/arch/arm/mach-imx/pm-vf610.c
+++ b/arch/arm/mach-imx/pm-vf610.c
@@ -93,6 +93,7 @@
 
 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;
@@ -382,7 +383,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 = {
@@ -476,6 +478,19 @@ static int __init vf610_suspend_init(const struct vf610_pm_socdata *socdata)
 		return ret;
 #endif
 
+	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");
+
+		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");
-- 
2.7.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/18] ARM: vf610: Suspend/resume with self-refresh mode Stefan Agner <stefan@agner.ch> - 2016-03-10 03:20 +0100
  [PATCH 02/18] ARM: dts: vf610: add GPC as new interrupt parent Stefan Agner <stefan@agner.ch> - 2016-03-10 03:20 +0100
  [PATCH 11/18] pinctrl: pinctrl-imx: implement suspend/resume Stefan Agner <stefan@agner.ch> - 2016-03-10 03:20 +0100
  [PATCH 07/18] ARM: imx: clk-vf610: leave DDR clock on Stefan Agner <stefan@agner.ch> - 2016-03-10 03:20 +0100
  [PATCH 16/18] ARM: vf610: PM: enable Suspend-to-RAM only if hardware fixes are in place Stefan Agner <stefan@agner.ch> - 2016-03-10 03:20 +0100
  [PATCH 15/18] ARM: vf610: PM: initial suspend/resume support Stefan Agner <stefan@agner.ch> - 2016-03-10 03:20 +0100
    Re: [PATCH 15/18] ARM: vf610: PM: initial suspend/resume support kbuild test robot <lkp@intel.com> - 2016-03-10 22:30 +0100
  [PATCH 05/18] ARM: dts: vf610: add modules required for PM Stefan Agner <stefan@agner.ch> - 2016-03-10 03:30 +0100
  [PATCH 06/18] ARM: imx: clk-gate2: allow custom gate configuration Stefan Agner <stefan@agner.ch> - 2016-03-10 03:30 +0100
  [PATCH 10/18] tty: serial: fsl_lpuart: support suspend/resume Stefan Agner <stefan@agner.ch> - 2016-03-10 03:30 +0100
  [PATCH 04/18] ARM: dts: vf610: add on-chip SRAM Stefan Agner <stefan@agner.ch> - 2016-03-10 03:30 +0100
  [PATCH 08/18] ARM: clk: add WKPU unit Stefan Agner <stefan@agner.ch> - 2016-03-10 03:30 +0100
    Re: [PATCH 08/18] ARM: clk: add WKPU unit Stephen Boyd <sboyd@codeaurora.org> - 2016-03-16 02:20 +0100
  [PATCH 03/18] ARM: dts: vf610-colibri: GPIO wakeup key Stefan Agner <stefan@agner.ch> - 2016-03-10 03:30 +0100

csiph-web