From patchwork Tue Jan 9 07:59:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 10151133 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 612DC601A1 for ; Tue, 9 Jan 2018 08:08:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55489286A2 for ; Tue, 9 Jan 2018 08:08:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4873B28929; Tue, 9 Jan 2018 08:08:19 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42E7C286A2 for ; Tue, 9 Jan 2018 08:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-reply-to:Message-id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=B4t2d8YtT0uuZ8Yx+FTeY1rnlygZtfRhSMKqOtXd5ew=; b=RrGJDkb3qo0BfCyRUTVrqmBMbz 4W2z8pjYoIaeC9VzUg+0LZiBI9e0ovUiipYYXAsxLiR2ld5zCizInaytMG+iHohIceLSdcJNTDAQa sKQhswIZNn//t64C897M4UUlLYCKnfXdTzUnXWxPmIo1Thcjbb2foIwI8khwMULIEBSjoXBeTFlxl L1wl2RlaDuNEJZgb90VI8om5hdz/AiKPt5bTIZckXhruRCFQlCdb+oI9grmTlFeUsSc6fvdklFq5Q UGOU3pTVQzRLfucHhwsw2OgRr5RHM8EhxMOgS8NKWDyYqbHboKeRAIgPE1b0WqMiH3TfxilA88wbd zT6mJWCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eYoxC-0003zv-4d; Tue, 09 Jan 2018 08:08:14 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYoof-000692-JE for linux-arm-kernel@lists.infradead.org; Tue, 09 Jan 2018 07:59:38 +0000 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180109075906epoutp01df6eba533309461e1bbd5ca41ec908b9~IFVkADrPZ0117501175epoutp01L; Tue, 9 Jan 2018 07:59:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180109075906epoutp01df6eba533309461e1bbd5ca41ec908b9~IFVkADrPZ0117501175epoutp01L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1515484746; bh=15SRBy7Cvd7idzNkODjWAN5t2UcozYK9xMzsEY7C2Z8=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=vBii9J+vJbTSm9/cLUMj3eotQXxQMud0234ArnlSvLCfoV4EGzHwKDCFLlSy2LMsW vTRqSqCV5yg4Jgf9S+jC0yWqvAtkIKt0ydfZldhEXNUUf75J1y0CweYtRGbouxgCOl 7C7q/4gedhR6t7m5vjqYVV2g4BaCdOXqEHXmlb3Q= Received: from epsmges2p4.samsung.com (unknown [182.195.40.66]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180109075906epcas1p2838215b2576afc3d40c25f13c11bf422~IFVjlAVxj0840608406epcas1p2_; Tue, 9 Jan 2018 07:59:06 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id EC.AB.04319.A46745A5; Tue, 9 Jan 2018 16:59:06 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20180109075905epcas2p1fe6b554b646dbc80e04273ad6dd8489c~IFVjLUuEH0243002430epcas2p1l; Tue, 9 Jan 2018 07:59:05 +0000 (GMT) X-AuditID: b6c32a48-947ff700000010df-dd-5a54764a845b Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 38.3E.03909.946745A5; Tue, 9 Jan 2018 16:59:05 +0900 (KST) Received: from localhost.localdomain ([10.113.77.231]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P2A00EW93IGT980@mmp2.samsung.com>; Tue, 09 Jan 2018 16:59:05 +0900 (KST) From: Chanwoo Choi To: krzk@kernel.org, m.szyprowski@samsung.com, s.nawrocki@samsung.com, kgene@kernel.org Subject: [RFC PATCH 5/9] soc: samsung: pm: Add support for suspend-to-ram of Exynos5433 Date: Tue, 09 Jan 2018 16:59:02 +0900 Message-id: <1515484746-10656-6-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFKsWRmVeSWpSXmKPExsWy7bCmma5XWUiUwdwFLBYTb1xhsbj+5Tmr xfwj51gtJt2fwGJx41cbq0Xn2SfMF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t2fwGJx41cbq0Xn2SfMFv2PXzNbnD+/gd1i0+NrrBaXd81hs5hxfh+Txdojd9kt Dr9pZ7VYtesPowOfx85Zd9k9Nq3qZPPYvKTeo2/LKkaPz5vkAlijuGxSUnMyy1KL9O0SuDLe ftMsmCxUsencBaYGxtn8XYycHBICJhL3VxxgBrGFBNYxSvQ9c+hi5AKyfzBK9N/cwAiSYBPQ ktj/4gYbiC0iECnxZOpTMJtZYCmTxIOHYDXCQPG2hU9ZQWwWAVWJA9v7WUBsXgFXibW9rYwQ y+QkPux5xA5icwq4Sez+t4YNYrGrxMMHpxknMPIsYGRYxSiZWlCcm55bbFRglJdarlecmFtc mpeul5yfu4kRGIbbDmv172B8vCT+EKMAB6MSD69Ea3CUEGtiWXFl7iFGCQ5mJRFe3/lAId6U xMqq1KL8+KLSnNTiQ4zSHCxK4rz8+ccihQTSE0tSs1NTC1KLYLJMHJxSDYz15ilxlo01k7+X RK7cHvEnPHDiTNPcDc2Sn05/q5Y5qv/42GM+54uW65Ptpl8qmpvnJRos8e9Ixtmg9m/33exn T5jufvyZ/BM9XvYFqh1Tnj/90nRs24PjpabJP39MXOiUdpdxXXEYdwlnwB/nQ5u/LIq+4Nwu 23mjZlfANJejr8xsWcr5Fh9XYinOSDTUYi4qTgQAxApvBz8CAAA= X-CMS-MailID: 20180109075905epcas2p1fe6b554b646dbc80e04273ad6dd8489c X-Msg-Generator: CA CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180109075905epcas2p1fe6b554b646dbc80e04273ad6dd8489c X-RootMTR: 20180109075905epcas2p1fe6b554b646dbc80e04273ad6dd8489c References: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180108_235926_191091_5199A1C1 X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: inki.dae@samsung.com, Jonghwa Lee , linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, tomasz.figa@gmail.com, linux-kernel@vger.kernel.org, jh80.chung@samsung.com, cw00.choi@samsung.com, chanwoo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds the specific exynos_pm_data instance for Exynos5433 in order to support the suspend-to-ram. Exynos5433 SoC need to write the 'cpu_resume' poiter address and the specific magic number for suspend mode. Signed-off-by: Jonghwa Lee Signed-off-by: Chanwoo Choi --- drivers/soc/samsung/exynos-pm.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -- 1.9.1 diff --git a/drivers/soc/samsung/exynos-pm.c b/drivers/soc/samsung/exynos-pm.c index 45d84bbe5e61..70d949ba5cab 100644 --- a/drivers/soc/samsung/exynos-pm.c +++ b/drivers/soc/samsung/exynos-pm.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -123,7 +124,44 @@ static void exynos_pm_finish(void) #define exynos_pm_data_arm_ptr(data) NULL #endif +static int exynos5433_pm_suspend(unsigned long unused) +{ + /* + * Exynos5433 uses PSCI v0.1 which provides the only one + * entry point (psci_ops.cpu_suspend) for both cpuidle and + * suspend-to-RAM. Also, PSCI v0.1 needs the specific 'power_state' + * parameter for the suspend mode. In order to enter suspend mode, + * Exynos5433 calls the 'psci_ops.cpu_suspend' with '0x3010000' + * power_state parameter. + * + * '0x3010000' means that both cluster and system are going to enter + * the power-down state as following: + * - [25:24] 0x3 : Indicate the cluster and system. + * - [16] 0x1 : Indicate power-down state. + */ + return psci_ops.cpu_suspend(0x3010000, __pa_symbol(cpu_resume)); +} + +static int exynos5433_pm_suspend_enter(suspend_state_t state) +{ + if (!sysram_ns_base_addr) + return -EINVAL; + + __raw_writel(virt_to_phys(cpu_resume), sysram_ns_base_addr + 0x8); + __raw_writel(EXYNOS_SLEEP_MAGIC, sysram_ns_base_addr + 0xc); + + return cpu_suspend(0, exynos5433_pm_suspend); +} + +const struct exynos_pm_data exynos5433_pm_data = { + .enter = exynos5433_pm_suspend_enter, +}; + static const struct of_device_id exynos_pm_of_device_ids[] = { + { + .compatible = "samsung,exynos5433-pmu", + .data = exynos_pm_data_arm_ptr(exynos5433_pm_data), + }, { /*sentinel*/ }, };