devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bai Ping <ping.bai@nxp.com>
To: shawnguo@kernel.org, mturquette@baylibre.com,
	sboyd@codeaurora.org, robh+dt@kernel.org, mark.rutland@arm.com,
	linus.walleij@linaro.org
Cc: devicetree@vger.kernel.org, kernel@pengutronix.de,
	daniel.lezcano@linaro.org, linux-gpio@vger.kernel.org,
	p.zabel@pengutronix.de, fabio.estevam@nxp.com,
	tglx@linutronix.de, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, ping.bai@nxp.com
Subject: [PATCH 08/11] ARM: imx: Add suspend/resume support for imx6sll
Date: Fri, 2 Dec 2016 14:39:31 +0800	[thread overview]
Message-ID: <1480660774-25055-9-git-send-email-ping.bai@nxp.com> (raw)
In-Reply-To: <1480660774-25055-1-git-send-email-ping.bai@nxp.com>

Add suspend/resume support for imx6sll.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
---
 arch/arm/mach-imx/pm-imx6.c | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index 1515e49..2ed4316 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -145,6 +145,13 @@ struct imx6_pm_socdata {
 	0x494, 0x4b0,	            /* MODE_CTL, MODE, */
 };
 
+static const u32 imx6sll_mmdc_io_offset[] __initconst = {
+	0x294, 0x298, 0x29c, 0x2a0, /* DQM0 ~ DQM3 */
+	0x544, 0x54c, 0x554, 0x558, /* GPR_B0DS ~ GPR_B3DS */
+	0x530, 0x540, 0x2ac, 0x52c, /* MODE_CTL, MODE, SDCLK_0, GPR_ADDDS */
+	0x2a4, 0x2a8,		    /* SDCKE0, SDCKE1*/
+};
+
 static const struct imx6_pm_socdata imx6q_pm_data __initconst = {
 	.mmdc_compat = "fsl,imx6q-mmdc",
 	.src_compat = "fsl,imx6q-src",
@@ -195,6 +202,15 @@ struct imx6_pm_socdata {
 	.mmdc_io_offset = imx6ul_mmdc_io_offset,
 };
 
+static const struct imx6_pm_socdata imx6sll_pm_data __initconst = {
+	.mmdc_compat = "fsl,imx6sll-mmdc",
+	.src_compat = "fsl,imx6sll-src",
+	.iomuxc_compat = "fsl,imx6sll-iomuxc",
+	.gpc_compat = "fsl,imx6sll-gpc",
+	.pl310_compat = "arm,pl310-cache",
+	.mmdc_io_num = ARRAY_SIZE(imx6sll_mmdc_io_offset),
+	.mmdc_io_offset = imx6sll_mmdc_io_offset,
+};
 /*
  * This structure is for passing necessary data for low level ocram
  * suspend code(arch/arm/mach-imx/suspend-imx6.S), if this struct
@@ -293,9 +309,10 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
 		val |= 0x2 << BP_CLPCR_LPM;
 		val &= ~BM_CLPCR_VSTBY;
 		val &= ~BM_CLPCR_SBYOS;
-		if (cpu_is_imx6sl())
+		if (cpu_is_imx6sl() || cpu_is_imx6sll())
 			val |= BM_CLPCR_BYPASS_PMIC_READY;
-		if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul())
+		if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul() ||
+			cpu_is_imx6sll())
 			val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
 		else
 			val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
@@ -310,9 +327,10 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
 		val |= 0x3 << BP_CLPCR_STBY_COUNT;
 		val |= BM_CLPCR_VSTBY;
 		val |= BM_CLPCR_SBYOS;
-		if (cpu_is_imx6sl() || cpu_is_imx6sx())
+		if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6sll())
 			val |= BM_CLPCR_BYPASS_PMIC_READY;
-		if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul())
+		if (cpu_is_imx6sl() || cpu_is_imx6sx() ||
+		    cpu_is_imx6ul() || cpu_is_imx6sll())
 			val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
 		else
 			val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
@@ -373,6 +391,7 @@ static int imx6q_pm_enter(suspend_state_t state)
 			imx6sl_set_wait_clk(true);
 		/* Zzz ... */
 		cpu_do_idle();
+
 		if (cpu_is_imx6sl())
 			imx6sl_set_wait_clk(false);
 		imx_gpc_post_resume();
@@ -632,7 +651,10 @@ void __init imx6dl_pm_init(void)
 
 void __init imx6sl_pm_init(void)
 {
-	imx6_pm_common_init(&imx6sl_pm_data);
+	if (cpu_is_imx6sl())
+		imx6_pm_common_init(&imx6sl_pm_data);
+	else
+		imx6_pm_common_init(&imx6sll_pm_data);
 }
 
 void __init imx6sx_pm_init(void)
-- 
1.9.1

  parent reply	other threads:[~2016-12-02  6:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02  6:39 [PATCH 00/11] Add basic code support for imx6sll Bai Ping
2016-12-02  6:39 ` [PATCH 01/11] ARM: imx: Add basic msl " Bai Ping
2016-12-02  6:39 ` [PATCH 02/11] driver: clocksource: add gpt timer " Bai Ping
2016-12-02  6:39 ` [PATCH 03/11] driver: clk: imx: Add clock driver " Bai Ping
2016-12-08 22:52   ` Stephen Boyd
2016-12-12  2:58     ` Jacky Bai
2016-12-13 23:28       ` Stephen Boyd
2016-12-02  6:39 ` [PATCH 04/11] driver: pinctrl: imx: Add pinctrl driver support " Bai Ping
     [not found] ` <1480660774-25055-1-git-send-email-ping.bai-3arQi8VN3Tc@public.gmane.org>
2016-12-02  6:39   ` [PATCH 05/11] ARM: dts: imx: Add basic dtsi " Bai Ping
2016-12-02  6:39 ` [PATCH 06/11] ARM: dts: imx: Add imx6sll EVK board dts support Bai Ping
2016-12-05 10:25   ` Fabio Estevam
2016-12-06  8:39     ` Jacky Bai
2016-12-02  6:39 ` [PATCH 07/11] ARM: debug: Add low level debug support for imx6sll Bai Ping
2016-12-02  6:39 ` Bai Ping [this message]
2016-12-02  6:39 ` [PATCH 09/11] ARM: imx: correct i.mx6sll dram io low power mode Bai Ping
2016-12-02  6:39 ` [PATCH 10/11] Document: dt: binding: imx: update doc for imx6sll Bai Ping
2016-12-08 22:54   ` Stephen Boyd
2016-12-12  2:32     ` Jacky Bai
     [not found]   ` <1480660774-25055-11-git-send-email-ping.bai-3arQi8VN3Tc@public.gmane.org>
2016-12-09 18:12     ` Rob Herring
2016-12-12  2:59       ` Jacky Bai
2016-12-02  6:39 ` [PATCH 11/11] ARM: configs: enable imx6sll support in defconfig Bai Ping

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=1480660774-25055-9-git-send-email-ping.bai@nxp.com \
    --to=ping.bai@nxp.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).