Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3099142ybl; Mon, 19 Aug 2019 12:10:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsKXWcRf34VE4HX/foye9ORRa8zq4dDJY5tXd8so/+prJ1dRiw74/9td4zYuxYiiv9TWka X-Received: by 2002:aa7:9882:: with SMTP id r2mr26110767pfl.146.1566241854607; Mon, 19 Aug 2019 12:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566241854; cv=none; d=google.com; s=arc-20160816; b=Zmh1WeNmfHP+YtaAHWEHz0hjATyO00wXrvlZAqt1DCpJcdYSymjVe2urFRhbRPp1rD yoXdE8OHglUkRMvkU7vD6kLAxCthSXf/1ycZ6HEFT1j/oBk5nqfX4qICtAVHPXH/c+3F KLRbpWlXqzx2ekzSJO0V6O/nCh/lcPQQKizigL5AynINNH35UtngBTQP/tE99FUDFhu2 JTr76OJyZ1ype77q5xKlzA4fSW3rdLpjMkyGeLBQuH1h2vvzhbpueoIdqw9y12nIpn7o HGqFdV/AItD4g7xWD78yXI7khTOJgQxebefxZwvu9tTFiPlzercPHMJD5QxGSXFALbPA GyGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=lDgc6QK33DRljdsnrvFj9EKf+a9SbqWwFOOiG9EuoAk=; b=Q46rAgfUrFnOLQma9WktU/rg1xaO5CJxAM3IWJCvLWJ8J7s00zxN7XD8LXOhoaCprq RgwW9Vspi1abzv1qgK9D/xXlk4TaF9MBVVV2lZnlv8ztfbOhjYrbdrSt7iROPFHNqpoN T7db3JgmITNAQRcVUwMxa5hHlBWbTeFgZzdTwNs17psQwETtU/QxlYopUm5ZXTWrpicY KCuq0N08DyI2QFENKMQkDUyElLjGJgVNm5rkG/wiUV7bKcePkFx1bLKwTrf/47ui10yr mOEkaXQglWEUzA3h3BUoZ3bLoR9cPdlRhfSlyLgZ7CpqumFL53BTWQDyz/QMvnSTQtYu hsbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="k3PNkY/z"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si3382521pfe.173.2019.08.19.12.10.39; Mon, 19 Aug 2019 12:10:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="k3PNkY/z"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728432AbfHSTHy (ORCPT + 99 others); Mon, 19 Aug 2019 15:07:54 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:9385 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728185AbfHSTHx (ORCPT ); Mon, 19 Aug 2019 15:07:53 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 19 Aug 2019 12:07:52 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 19 Aug 2019 12:07:51 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 19 Aug 2019 12:07:51 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 19 Aug 2019 19:07:51 +0000 Received: from [10.110.103.66] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 19 Aug 2019 19:07:50 +0000 Subject: Re: [PATCH v9 20/22] soc/tegra: pmc: Configure deep sleep control settings From: Sowjanya Komatineni To: Dmitry Osipenko , , , , , , , , CC: , , , , , , , , , , , , , , , , References: <1565984527-5272-1-git-send-email-skomatineni@nvidia.com> <1565984527-5272-21-git-send-email-skomatineni@nvidia.com> <2092e557-06cb-4a74-fe40-1d83bf67ccca@nvidia.com> Message-ID: Date: Mon, 19 Aug 2019 12:07:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <2092e557-06cb-4a74-fe40-1d83bf67ccca@nvidia.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1566241672; bh=lDgc6QK33DRljdsnrvFj9EKf+a9SbqWwFOOiG9EuoAk=; h=X-PGP-Universal:Subject:From:To:CC:References:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Transfer-Encoding: Content-Language; b=k3PNkY/zqJCaYV+SmTHtuqLnfIrIUjJap4KJsrwrW+761Wh6674laB+NR6y6whumN IvinVjqCeLAR+wbFOdUKjsYgARJy1eRRpS31N+657GvaYq/UgVtJWfJE6jYC/LEdc9 exWUV/5obw5zb8Mb2pE5JHmA2D+sdX7MPNfPOyIFC1hr+9Q1qF3d9d3NXh7OuB9HAS wNegGp+ishXCr+H6dkQivS9IFywlvqvHrc1CDbXVZBxnJ7jV6sJYW5PKkF/c0kzCoO a8XWx4WNFb1ksAaoXq2G0cs59s76KMZdUFx2LA8hRf4ZBtaMaZrnGZWQhnYEHcPoi5 SjmXNk3kQ9eqg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/19/19 11:20 AM, Sowjanya Komatineni wrote: > > On 8/19/19 9:48 AM, Dmitry Osipenko wrote: >> 16.08.2019 22:42, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>> Tegra210 and prior Tegra chips have deep sleep entry and wakeup related >>> timings which are platform specific that should be configured before >>> entering into deep sleep. >>> >>> Below are the timing specific configurations for deep sleep entry and >>> wakeup. >>> - Core rail power-on stabilization timer >>> - OSC clock stabilization timer after SOC rail power is stabilized. >>> - Core power off time is the minimum wake delay to keep the system >>> =C2=A0=C2=A0 in deep sleep state irrespective of any quick wake event. >>> >>> These values depends on the discharge time of regulators and turn OFF >>> time of the PMIC to allow the complete system to finish entering into >>> deep sleep state. >>> >>> These values vary based on the platform design and are specified >>> through the device tree. >>> >>> This patch has implementation to configure these timings which are must >>> to have for proper deep sleep and wakeup operations. >>> >>> Signed-off-by: Sowjanya Komatineni >>> --- >>> =C2=A0 drivers/soc/tegra/pmc.c | 14 +++++++++++++- >>> =C2=A0 1 file changed, 13 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c >>> index 53ed70773872..710969043668 100644 >>> --- a/drivers/soc/tegra/pmc.c >>> +++ b/drivers/soc/tegra/pmc.c >>> @@ -88,6 +88,8 @@ >>> =C2=A0 =C2=A0 #define PMC_CPUPWRGOOD_TIMER=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 0xc8 >>> =C2=A0 #define PMC_CPUPWROFF_TIMER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 0xcc >>> +#define PMC_COREPWRGOOD_TIMER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 0x3c >>> +#define PMC_COREPWROFF_TIMER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= 0xe0 >>> =C2=A0 =C2=A0 #define PMC_PWR_DET_VALUE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 0xe4 >>> =C2=A0 @@ -2277,7 +2279,7 @@ static const struct tegra_pmc_regs=20 >>> tegra20_pmc_regs =3D { >>> =C2=A0 =C2=A0 static void tegra20_pmc_init(struct tegra_pmc *pmc) >>> =C2=A0 { >>> -=C2=A0=C2=A0=C2=A0 u32 value; >>> +=C2=A0=C2=A0=C2=A0 u32 value, osc, pmu, off; >>> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Always enable CPU power reques= t */ >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 value =3D tegra_pmc_readl(pmc, PMC_CNTRL= ); >>> @@ -2303,6 +2305,16 @@ static void tegra20_pmc_init(struct tegra_pmc=20 >>> *pmc) >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 value =3D tegra_pmc_readl(pmc, PMC_CNTRL= ); >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 value |=3D PMC_CNTRL_SYSCLK_OE; >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tegra_pmc_writel(pmc, value, PMC_CNTRL); >>> + >>> +=C2=A0=C2=A0=C2=A0 /* program core timings which are applicable only f= or suspend=20 >>> state */ >>> +=C2=A0=C2=A0=C2=A0 if (pmc->suspend_mode !=3D TEGRA_SUSPEND_NONE) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 osc =3D DIV_ROUND_UP(pmc->c= ore_osc_time * 8192, 1000000); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pmu =3D DIV_ROUND_UP(pmc->c= ore_pmu_time * 32768, 1000000); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 off =3D DIV_ROUND_UP(pmc->c= ore_off_time * 32768, 1000000); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tegra_pmc_writel(pmc, ((osc= << 8) & 0xff00) | (pmu & 0xff), >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 PMC_COREPWRGOOD_TIMER); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tegra_pmc_writel(pmc, off, = PMC_COREPWROFF_TIMER); >>> +=C2=A0=C2=A0=C2=A0 } >>> =C2=A0 } >>> =C2=A0 =C2=A0 static void tegra20_pmc_setup_irq_polarity(struct tegra_p= mc *pmc, >>> >> In the previous version of this patch there were checks for zero values >> of the timers with intention to skip programming of the timers if value >> is zero. I'm a bit puzzled by the new version, given that SUSPEND_NONE >> means that suspending isn't available at all and thus PMC timers won't >> be utilized, hence it shouldn't matter what values are programmed for >> the counters, isn't it? > > Yes, as I see in documentation we already specify all these timings=20 > are required properties when suspend mode is used, I updated in this=20 > version to program core timings only when suspend mode is enabled. > In other words, core timings are for SC7 entry only. So when SC7/suspend=20 mode is not used, these timings doesn't matter.