From patchwork Mon Aug 18 13:21:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Sajjan X-Patchwork-Id: 4736351 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 608BBC0338 for ; Mon, 18 Aug 2014 13:22:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25D8E20131 for ; Mon, 18 Aug 2014 13:22:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F71520125 for ; Mon, 18 Aug 2014 13:22:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751604AbaHRNVs (ORCPT ); Mon, 18 Aug 2014 09:21:48 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:62663 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbaHRNVr (ORCPT ); Mon, 18 Aug 2014 09:21:47 -0400 Received: by mail-we0-f171.google.com with SMTP id p10so5080327wes.16 for ; Mon, 18 Aug 2014 06:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=TGpdgMdOfzGRGGkKTnyNTxCRs0fiYQctNgSXIUn/Sig=; b=ocOFea03EWmnliV3PEP987D6GzyirK4GuMKVRYzIpBezWf13PkFZx3J1FjzaWrkF3W EmKVbWdWFvpA2MuPHewBrfG/UtVqsDN6WCmuf5OtIWlLBPiN4YcZEjlV38pNGeu25tnJ uqLp1CMaaX87BD/hpKqi/CZiEvYqm+Ifllm1XHIlFcaMgdsVnPAvnWjzBAYbmGcw7eK6 QXekGju5yjRqJ5JTybNhYXe+Ml96OoRy8NN7zoRwKGXx/87ZW9GHh3AQZXMr+WJJ1YDT r38BQzf+a39n4hBxxluuA96WHHDJpASwf9KhpRgC4zzXjROGlOvYd5t0Ksoe5bLUHuZ5 d4sA== MIME-Version: 1.0 X-Received: by 10.180.101.136 with SMTP id fg8mr42103920wib.44.1408368106242; Mon, 18 Aug 2014 06:21:46 -0700 (PDT) Received: by 10.194.25.130 with HTTP; Mon, 18 Aug 2014 06:21:46 -0700 (PDT) In-Reply-To: <53F1EDB4.8040906@gmail.com> References: <1407412789-1919-1-git-send-email-vikas.sajjan@samsung.com> <1407412789-1919-2-git-send-email-vikas.sajjan@samsung.com> <53F1EDB4.8040906@gmail.com> Date: Mon, 18 Aug 2014 18:51:46 +0530 X-Google-Sender-Auth: 7oyRnislEDH93yfH5F8Pdqrw1XU Message-ID: Subject: Re: [PATCH v3 1/2] ARM: EXYNOS: Move Disabling of JPEG USE_RETENTION for exynos5250 to pmu.c From: Vikas Sajjan To: Tomasz Figa Cc: "linux-arm-kernel@lists.infradead.org" , linux-samsung-soc , Kukjin Kim , sunil joshi , Doug Anderson , Olof Johansson Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Tomasz, On Mon, Aug 18, 2014 at 5:42 PM, Tomasz Figa wrote: > Hi Vikas, > > On 07.08.2014 13:59, Vikas Sajjan wrote: >> Move the Disabling of JPEG USE_RETENTION for exynos5250 to pmu.c to make way for >> refactoring of pm.c and to create common functions across exynos4 and >> exynos5250. >> >> Signed-off-by: Vikas Sajjan >> --- >> arch/arm/mach-exynos/pm.c | 7 +------ >> arch/arm/mach-exynos/pmu.c | 6 ++++++ >> 2 files changed, 7 insertions(+), 6 deletions(-) >> >> diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c >> index c4c6d98..fdd68c2 100644 >> --- a/arch/arm/mach-exynos/pm.c >> +++ b/arch/arm/mach-exynos/pm.c >> @@ -265,13 +265,8 @@ static void exynos_pm_prepare(void) >> >> s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save)); >> >> - if (soc_is_exynos5250()) { >> + if (soc_is_exynos5250()) >> s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save)); >> - /* Disable USE_RETENTION of JPEG_MEM_OPTION */ >> - tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION); >> - tmp &= ~EXYNOS5_OPTION_USE_RETENTION; >> - pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION); >> - } >> >> /* Set value of power down register for sleep mode */ >> >> diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c >> index ff9d23f..6021adb 100644 >> --- a/arch/arm/mach-exynos/pmu.c >> +++ b/arch/arm/mach-exynos/pmu.c >> @@ -389,6 +389,7 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) >> static int __init exynos_pmu_init(void) >> { >> unsigned int value; >> + unsigned int tmp; >> >> exynos_pmu_config = exynos4210_pmu_config; >> >> @@ -411,6 +412,11 @@ static int __init exynos_pmu_init(void) >> value &= ~EXYNOS5_SYS_WDTRESET; >> pmu_raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST); >> >> + /* Disable USE_RETENTION of JPEG_MEM_OPTION */ >> + tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION); >> + tmp &= ~EXYNOS5_OPTION_USE_RETENTION; >> + pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION); >> + > > Note that this code is executed once at system bootup. Is this register > preserved across a suspend/resume cycle? > > Anyway, what I suggested in my comment to previous revision of this > series was stuffing this thing into the PMU configuration array. As you > can see in the arrays for Exynos4 SoCs, they just hardcode the > MEM_OPTION registers to constant values, because I believe the only > field from those registers with non-zero value in practice is > EXYNOS5_OPTION_USE_RETENTION (or 0x10 used directly in PMU arrays for > Exynos4 SoCs). This would also cover my comment above, because the > arrays are written to the PMU every time a low power state is being entered. > Is this what you meant, { EXYNOS5_SATA_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, @@ -412,11 +413,6 @@ static int __init exynos_pmu_init(void) value &= ~EXYNOS5_SYS_WDTRESET; pmu_raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST); - /* Disable USE_RETENTION of JPEG_MEM_OPTION */ - tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION); - tmp &= ~EXYNOS5_OPTION_USE_RETENTION; - pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION); - exynos_pmu_config = exynos5250_pmu_config; pr_info("EXYNOS5250 PMU Initialize\n"); } else { for AFTR and LPA mode, i still maintain 0x10 like any other XXX_XXX_MEM_OPTION register, but for sleep mode, I am disabling USE_RETENTION of JPEG_MEM_OPTION as required. Hope this is fine. I tested with the above change on snow, S2R works well. > Best regards, > Tomasz --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 6021adb..67b70fd 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -264,6 +264,7 @@ static const struct exynos_pmu_conf exynos5250_pmu_config[] = { { EXYNOS5_INTRAM_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, { EXYNOS5_INTROM_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, { EXYNOS5_JPEG_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, + { EXYNOS5_JPEG_MEM_OPTION, { 0x10, 0x10, 0x0} }, { EXYNOS5_HSI_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, { EXYNOS5_MCUIOP_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },