mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keerthy <j-keerthy@ti.com>
To: <tony@atomide.com>
Cc: <ssantosh@kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-omap@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <d-gerlach@ti.com>,
	<j-keerthy@ti.com>, <t-kristo@ti.com>
Subject: [PATCH] soc: ti: pm33xx: Enable DS0 for the platforms on which it is functional
Date: Wed, 22 Aug 2018 11:02:31 +0530	[thread overview]
Message-ID: <1534915951-8783-1-git-send-email-j-keerthy@ti.com> (raw)

Enable DS0 for only those platforms on which it is functional

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/mach-omap2/pm33xx-core.c    | 5 +++++
 drivers/soc/ti/pm33xx.c              | 9 +++++++++
 include/linux/platform_data/pm33xx.h | 2 ++
 3 files changed, 16 insertions(+)

diff --git a/arch/arm/mach-omap2/pm33xx-core.c b/arch/arm/mach-omap2/pm33xx-core.c
index f4971e4..f0f6e8e 100644
--- a/arch/arm/mach-omap2/pm33xx-core.c
+++ b/arch/arm/mach-omap2/pm33xx-core.c
@@ -135,6 +135,11 @@ static int am43xx_suspend(unsigned int state, int (*fn)(unsigned long),
 {
 	int ret = 0;
 
+	if (!(args & WFI_FLAG_DEEP_SLEEP0)) {
+		pr_err("DS0 mode not supported\n");
+		return -ENOTSUPP;
+	}
+
 	amx3_pre_suspend_common();
 	scu_power_mode(scu_base, SCU_PM_POWEROFF);
 	ret = cpu_suspend(args, fn);
diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
index d0dab32..53238d7 100644
--- a/drivers/soc/ti/pm33xx.c
+++ b/drivers/soc/ti/pm33xx.c
@@ -324,6 +324,15 @@ static int am33xx_pm_probe(struct platform_device *pdev)
 	suspend_wfi_flags |= WFI_FLAG_SAVE_EMIF;
 	suspend_wfi_flags |= WFI_FLAG_WAKE_M3;
 
+	/*
+	 * Deep Sleep0 mode is currently functional only on am437x-gp-evm,
+	 * am33xx-evm and boneblack family. Hence set the DS0 flag
+	 */
+	if (of_machine_is_compatible("ti,am437x-gp-evm") ||
+	    of_machine_is_compatible("ti,am335x-bone-black") ||
+	    of_machine_is_compatible("ti,am335x-evm"))
+		suspend_wfi_flags |= WFI_FLAG_DEEP_SLEEP0;
+
 	ret = pm_ops->init();
 	if (ret) {
 		dev_err(dev, "Unable to call core pm init!\n");
diff --git a/include/linux/platform_data/pm33xx.h b/include/linux/platform_data/pm33xx.h
index fbf5ed7..5c54b64 100644
--- a/include/linux/platform_data/pm33xx.h
+++ b/include/linux/platform_data/pm33xx.h
@@ -28,12 +28,14 @@
  * WFI_FLAG_WAKE_M3: Disable MPU clock or clockdomain to cause wkup_m3 to
  *		     execute when WFI instruction executes.
  * WFI_FLAG_RTC_ONLY: Configure the RTC to enter RTC+DDR mode.
+ * WFI_FLAG_DEEP_SLEEP0: Configure to enter Depp Sleep 0 mode.
  */
 #define WFI_FLAG_FLUSH_CACHE		BIT(0)
 #define WFI_FLAG_SELF_REFRESH		BIT(1)
 #define WFI_FLAG_SAVE_EMIF		BIT(2)
 #define WFI_FLAG_WAKE_M3		BIT(3)
 #define WFI_FLAG_RTC_ONLY		BIT(4)
+#define WFI_FLAG_DEEP_SLEEP0		BIT(5)
 
 #ifndef __ASSEMBLER__
 struct am33xx_pm_sram_addr {
-- 
1.9.1


             reply	other threads:[~2018-08-22  5:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22  5:32 Keerthy [this message]
2018-08-22  7:34 ` Johan Hovold
2018-08-22  7:37   ` Johan Hovold
2018-08-22  8:20     ` J, KEERTHY
2018-08-22  8:43       ` Johan Hovold
2018-08-22 11:07         ` J, KEERTHY
2018-08-22 14:22           ` Tony Lindgren
2018-08-27  7:05             ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1534915951-8783-1-git-send-email-j-keerthy@ti.com \
    --to=j-keerthy@ti.com \
    --cc=d-gerlach@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®