From patchwork Fri Dec 2 06:39:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Bai X-Patchwork-Id: 9458105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5DA846074E for ; Fri, 2 Dec 2016 10:14:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 430722852C for ; Fri, 2 Dec 2016 10:14:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 340AE28540; Fri, 2 Dec 2016 10:14:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19ED72852C for ; Fri, 2 Dec 2016 10:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932454AbcLBKOi (ORCPT ); Fri, 2 Dec 2016 05:14:38 -0500 Received: from mail-eopbgr10045.outbound.protection.outlook.com ([40.107.1.45]:39077 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759266AbcLBKOd (ORCPT ); Fri, 2 Dec 2016 05:14:33 -0500 X-Greylist: delayed 3627 seconds by postgrey-1.27 at vger.kernel.org; Fri, 02 Dec 2016 05:14:32 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gjXxRtwOs1Za6G0lM0OkOttO3B3YvHF3vIQeHEE5KW0=; b=gpmnx4YNRbwgYCMuvdYxIsk9Uvb+6UyF5a7Br+4K/FHPL9XETUIOMt+2ZP1mRwHNMnjlqh8PY6lGlfkI7Bn3oAwy6bASs+c3i9ILFS51BrsgBX+qF0I0VYgfE8YPGt5l3RuN2K16IKQXvCnbE2M3Kede4hjWnMHAksFmd/7f/FE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ping.bai@nxp.com; Received: from b51503-01.ap.freescale.net (192.158.241.86) by DB4PR04MB537.eurprd04.prod.outlook.com (10.141.237.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Fri, 2 Dec 2016 06:41:04 +0000 From: Bai Ping To: , , , , , CC: , , , , , , , , , Subject: [PATCH 08/11] ARM: imx: Add suspend/resume support for imx6sll Date: Fri, 2 Dec 2016 14:39:31 +0800 Message-ID: <1480660774-25055-9-git-send-email-ping.bai@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1480660774-25055-1-git-send-email-ping.bai@nxp.com> References: <1480660774-25055-1-git-send-email-ping.bai@nxp.com> MIME-Version: 1.0 X-Originating-IP: [192.158.241.86] X-ClientProxiedBy: KL1PR03CA0025.apcprd03.prod.outlook.com (10.165.63.35) To DB4PR04MB537.eurprd04.prod.outlook.com (10.141.237.27) X-MS-Office365-Filtering-Correlation-Id: 89339d43-0991-4def-38f9-08d41a7e3438 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB4PR04MB537; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB537; 3:VBnvwCDbeWglvX40DYsoHC94pFT/EhTrBGwEPVdrEkVFLyE6Acvm0/YLho+uhmki9EXHh8qC/9l9qNxIVE9cdLci14cVBYD5+6Vb3+Tyh2t0VSbwEMFH7IMT/36qWCTz0/gYD0jX+tjKaDlyR/cdmKpw7Bh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bF+EKiEJ0c8SizyEWyaiZJADN4k4tyMfVUEGqsADt2Sc41e6iCyNV8h6hpVWUbdFYCgzZjHXCFK1UqtHxKsT6g2uGCmNgpixHaCb12STO8t1PkQ0qbrUQQg0BPp+1Fn+QjjEhkgC5EASq76QUmZ4Z78qEq1+T19VkrPbKVLxs1R81ugl2OAjK+7nSJd9+8SZWCC; 20:nq49UeuFa02j7YpLbwBeToZQRlWE7oXgarTbHWXP4sPeoqjkPgaRu1DleYEkOkynEew68iHLIBQPYUkmHjSAX8ob1z9QwFwiZTQ6KMvgZUuKbklWl5FTbOHR+03/3WzIw7NATxXsav6nrGJoG65keIDDf1ydNzplU0grpX/ThjGnKp7xsKY/2K6WUYFM7RI99YU+N9U0AjoLcKuhzVwqxO87d4/ghbcRwK7MsBenaFbAHiHcjlDY+ZnzdhG0tFwttJFaLirn8tMiywelmzLuZRUZgimZZFDWhQb7UQtYmIdndvxBeehHuSpzoUxRireLRUgVMaBksAGjqpPa9TMxhDkqKFl406GIPSbxUeZgzduQzIJ+Kz45McuAfaw2BOsIM5mCHtuxlxgJjdQTqu1TG/1eU+KzaRjNiE0zYpniSvbfiX9U6xWe6NvHP2nG2Uu31TAqLnJWx35Y51DulLAYMann4REAsNmE3mzH9WKEGy5Ppn0RHAP90pjsL/9oLNBU X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148)(6047074); SRVR:DB4PR04MB537; BCL:0; PCL:0; RULEID:; SRVR:DB4PR04MB537; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB537; 4:cHaAAGTpTQqDUK3sVd+CEt52fO8Uni6kn4273ywgZDMz8tL1EvMItezLj/Xxo/kv5xwynD5HiftfVX1MgTWMMS879AhsHhmzOxRPeLUaPjCz9WzB4WaUbV332BvLtviPJdii8KlGzNOFSg8wEQz2truI1Tj/iqVoT3VTMK4B46DPNpdISw+zM2tAZqZ7gdeO1gaSNOJcK19MVCP0NQgM/YYDSioR1mTrNxynNCuvbyK0jEc2cY2p1xI9PvEOpGQzgJsVtDA3zRUR8y3yBxi/YfhoYZxn7N6I9HJ5tE5goCbtAPVrfw63gkQ4ntiQeod/Tjv7RGvJlq/QJXQpMrcPo3adN/hhbHiNuert8N9geOxwNLqGe/vl+XLaOo0ppxjXLzWIlijysHvaTs4hhwSWk1caYYoQihWbyx/v9+mDD3/57/vh6ZxiTK9KcKrjaXgv/PKlCTKt1a1egw51KGNMq+X5hkxGXXq7zGsA/0TbhOXJViYoHcZ4BMJeuvQ3NVVCH9FnkXUDBnR4OOg8mg9/a1msU2e28X3R93Hh6S0vu/nN7fjhecbjVXV3xCFRn4wAnJ1/LI4QyDpBAqqbfUvww8lPwGPpoRjmtvxQrsL9fLySZAqnmlXS8mPP2VY4jRF4Y+OQWLmcNS9/AmTnX4gcDM1bjEuw9RrMAJzJPcatz7c= X-Forefront-PRVS: 0144B30E41 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6009001)(7916002)(189002)(199003)(6666003)(68736007)(575784001)(42186005)(81166006)(101416001)(15650500001)(2906002)(8676002)(97736004)(2950100002)(5660300001)(105586002)(3846002)(36756003)(106356001)(81156014)(6506004)(6512004)(189998001)(6116002)(48376002)(86362001)(92566002)(50466002)(7736002)(305945005)(50226002)(4326007)(47776003)(7846002)(7416002)(38730400001)(5001770100001)(33646002)(2201001)(733004)(39450400002)(5003940100001)(6486002)(39410400001)(76176999)(66066001)(50986999)(7099028)(32563001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB537; H:b51503-01.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB4PR04MB537; 23:C1756nQRuHeZ9Hv3RyUEuqU0Yj9BtqBx6XirMMd4FR?= =?us-ascii?Q?NDTjROWT4OiwNpIPdBhPs7otPCctOeIXULSgVqQ50mYuzKNUnIvFABsfG+pL?= =?us-ascii?Q?hiO5RpdYzg/MayJc4qmJFTpO+HgMz/QSKB9RK1tdNYEHQAdNr0CFNN9/SKo9?= =?us-ascii?Q?bxfSM5NFRp8hvhaEXr8zpBUQH6E7UNNzV7domhzI8309oIqzfH7P9KkwinNn?= =?us-ascii?Q?TN8C1o6OnEAnX58zcEmeOTFm9j9a29YScZoZXOiknE6JdGU5covoIcGkSoEF?= =?us-ascii?Q?Ta6y6wGA8LRhrOqW+DHNaVYzp3gcPP2u4Vm8Q61m8XjklxywFUN1Ze4Yc7Fe?= =?us-ascii?Q?MTFXzZUkMssYABGmIV9g+rHZh2Lamp1gYFYYelJpzsg2G24Pj0u1FvOlun2C?= =?us-ascii?Q?+QPBshAcwlci68zb8QigqcUmGqaUQoxVuHm1tkSvotvLEksvcBrPGnNU+pFC?= =?us-ascii?Q?6uSKyEdi9+Q8iTEBf/xWee90lS+8aM84dlUQ+Si9S5p5/eQFqr87K+FbqDyx?= =?us-ascii?Q?XaYcli6So0wU3azOI3QOTFrxXjVcSaZQ6/wDwDNJDYJHp1keIZ0+RYzZ9MO8?= =?us-ascii?Q?4q1XWQ5ix6ECf+JBdY/O1/aJw0W7EBWeTpKLeBdT10/y8nHq3Di4hKaApqMR?= =?us-ascii?Q?iA8BycVg9VN39+UolfV469IaRvSIrelABz2PHPYtyTdAcx886HgfcGSvFmwh?= =?us-ascii?Q?6dkEERuBH4cMLzbclWUneBzuoPKitA0J3rjM8d+2HRP0eTHFZL57ptSXD52A?= =?us-ascii?Q?4jorDG7pArPmfR/jRyk5jyJRdSHoh0JVNpMj10/aL/MHkoGL7ChVZQN6RbDM?= =?us-ascii?Q?NTvSS4eFpbQjHKbWXk9x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YivoTAakcQGmwS8179uj9MU/tsVnCw2JAp72CtaGWCoy9OdNVL4cGjb+/igdiXel0ZtsKA4mbWRMTf9+2ez/nJ0YJf; 5:Yhj8D6sAIBytWaD7/OA5YxVmX+2j7xx8MOxk3StyNm3IHyCvrD6VLeRbcILzMRyUWluOM9OlYI17e+cirT+tM9OgKYjPa5w0MjmlwLGYowUGx3p5hFUBQ+fXl94k8/uAZoYurSf6eDd4bQwffgLgyMirE/lxtHbgxl4s18QBgbY=; 24:e98J5cKeibyD2f49j+bPXlmjNgykOswRqs0vS0kPTedyAClWQbfeE/viXqononU+yYBupG2DEaTilIhQT3x+m0ax/Ln0TceZcCNZGHthnHA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB537; 7:O6Y4lZEDy1HPagoqbC/wrFtS9f6LnNtjtDQxeOY8S4nYb/JhE2C9LSr5uMaKbE2WACOAyVRPLJy63yUUDPPpNodRbBnZmZ8/6ACZYc/Iw35M9pLnoUH8V+upnfEnU+gH/JoA8c/4GYH+mC4F9W+GZEcuocLV0xn5XGW+r4fdWZDDThjpJUVvhHqTWndOrWvlB91BQW3AMEzEtHn+9L+ajxykwZ7Wek88O+5uyeDTxkPl2LxU7ZItcWziSl+mbf1/rSSiQWgdv3Opw3SCEXtPBoxBbShdV8ENz9monzOOCB/060S09ci/NbthoMnDCloYiYzpz2LwSG5hDfcdn2cuvYWnkXRkC5YXkEdB7mffkHBh4xdoJ05mmMSC0eZHcBo2FP5z8T97qV8HwGSgcHV0UAOil4x8tjbe1Vm8HZFc/1TXyhqBREEEaGCpnHYWkwBGMCF1gmhHWNR4hpYVi8tXaw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2016 06:41:04.9454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB537 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add suspend/resume support for imx6sll. Signed-off-by: Bai Ping --- 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)