linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <oss@buserror.net>
To: "C.H. Zhao" <chenhui.zhao@nxp.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"z.chenhui@gmail.com" <z.chenhui@gmail.com>,
	Jason Jin <jason.jin@nxp.com>
Subject: Re: [v3,4/5] powerpc/pm: support deep sleep feature on T104x
Date: Mon, 03 Oct 2016 12:22:57 -0500	[thread overview]
Message-ID: <1475515377.4917.7.camel@buserror.net> (raw)
In-Reply-To: <AM4PR0401MB2355465DF56ECC2CC4DF7E8B95CE0@AM4PR0401MB2355.eurprd04.prod.outlook.com>

On Thu, 2016-09-29 at 10:21 +0000, C.H. Zhao wrote:
> 
> From: Scott Wood <oss@buserror.net>
> Sent: Thursday, September 29, 2016 4:03 AM
> To: C.H. Zhao
> Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; z.chenhui@g
> mail.com; Jason Jin
> Subject: Re: [v3,4/5] powerpc/pm: support deep sleep feature on T104x
>     
> On Tue, 2016-09-27 at 11:05 +0000, C.H. Zhao wrote:
> > 
> > From: Scott Wood <oss@buserror.net>
> > Sent: Sunday, September 25, 2016 3:24 PM
> > To: C.H. Zhao
> > Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; z.chenhui
> > @g
> > mail.com; Jason Jin
> > Subject: Re: [v3,4/5] powerpc/pm: support deep sleep feature on T104x
> >     
> > On Tue, Aug 02, 2016 at 07:59:31PM +0800, Chenhui Zhao wrote:
> > > 
> > > 
> > > T104x has deep sleep feature, which can switch off most parts of
> > > the SoC when it is in deep sleep mode. This way, it becomes more
> > > energy-efficient.
> > > 
> > > The DDR controller will also be powered off in deep sleep. Therefore,
> > > the last stage (the latter part of fsl_dp_enter_low) will run without
> > > DDR
> > > access. This piece of code and related TLBs are prefetched in advance.
> > > 
> > > Due to the different initialization code between 32-bit and 64-bit, they
> > > have separate resume entry and precedure.
> > > 
> > > The feature supports 32-bit and 64-bit kernel mode.
> > > 
> > > Signed-off-by: Chenhui Zhao <chenhui.zhao@nxp.com>
> > > ---
> > >   arch/powerpc/include/asm/fsl_pm.h             |  24 ++
> > >   arch/powerpc/kernel/asm-offsets.c             |  12 +
> > >   arch/powerpc/kernel/fsl_booke_entry_mapping.S |  10 +
> > >   arch/powerpc/kernel/head_64.S                 |   2 +-
> > >   arch/powerpc/platforms/85xx/Makefile          |   1 +
> > >   arch/powerpc/platforms/85xx/deepsleep.c       | 278 ++++++++++++++
> > >   arch/powerpc/platforms/85xx/qoriq_pm.c        |  25 ++
> > >   arch/powerpc/platforms/85xx/t104x_deepsleep.S | 531
> > > ++++++++++++++++++++++++++
> > >   arch/powerpc/sysdev/fsl_rcpm.c                |   8 +-
> > >   9 files changed, 889 insertions(+), 2 deletions(-)
> > >   create mode 100644 arch/powerpc/platforms/85xx/deepsleep.c
> > >   create mode 100644 arch/powerpc/platforms/85xx/t104x_deepsleep.S
> > > 
> > > diff --git a/arch/powerpc/include/asm/fsl_pm.h
> > > b/arch/powerpc/include/asm/fsl_pm.h
> > > index e05049b..48c2631 100644
> > > --- a/arch/powerpc/include/asm/fsl_pm.h
> > > +++ b/arch/powerpc/include/asm/fsl_pm.h
> > > @@ -20,6 +20,7 @@
> > >   
> > >   #define PLAT_PM_SLEEP        20
> > >   #define PLAT_PM_LPM20        30
> > > +#define PLAT_PM_LPM35        40
> > >   
> > >   #define FSL_PM_SLEEP         (1 << 0)
> > >   #define FSL_PM_DEEP_SLEEP    (1 << 1)
> > > @@ -48,4 +49,27 @@ extern const struct fsl_pm_ops *qoriq_pm_ops;
> > >   
> > >   int __init fsl_rcpm_init(void);
> > >   
> > > +#ifdef CONFIG_FSL_QORIQ_PM
> > > +int fsl_enter_deepsleep(void);
> > > +int fsl_deepsleep_init(void);
> > > +#else
> > > +static inline int fsl_enter_deepsleep(void) { return -1; }
> > > +static inline int fsl_deepsleep_init(void) { return -1; }
> > > +#endif
> > Please return proper error codes.
> > 
> > Where can fsl_deepsleep_init() be called without CONFIG_FSL_QORIQ_PM?
> > 
> > [Chenhui] I can get rid of the ifdef here. And add it
> > in arch/powerpc/sysdev/fsl_rcpm.c.
> No, this is the right place for the ifdef for functions that are called from
> code that doesn't depend on CONFIG_FSL_QORIQ_PM.  But fsl_deepsleep_init()
> is
> called from deepsleep.c which is only built with CONFIG_FSL_QORIQ_PM, and
> it's
> hard to picture a scenario where it would be called from elsewhere.
> 
> 
> [Chenhui] You are right. No need to enclose fsl_deepsleep_init() in the
> ifdef.
>                  But regarding fsl_enter_deepsleep(), it is called in
> rcpm_v2_plat_enter_sleep()
>                  in arch/powerpc/sysdev/fsl_rcpm.c. It still needs to be
> enclosed in the ifdef.

Right.  That's why I specifically asked about fsl_deepsleep_init(). :-)

-Scott

  reply	other threads:[~2016-10-03 17:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 11:59 [PATCH v3 1/5] powerpc/dts: add mcke-gpios for PM feature Chenhui Zhao
2016-08-02 11:59 ` [PATCH v3 0/5] powerpc/pm: QorIQ deep sleep Chenhui Zhao
2016-08-02 11:59 ` [PATCH v3 2/5] powerpc/85xx: support sleep feature on QorIQ SoCs with RCPM Chenhui Zhao
2016-08-02 11:59 ` [PATCH v3 3/5] powerpc: pm: add EPU FSM configuration for deep sleep Chenhui Zhao
2016-08-02 11:59 ` [PATCH v3 4/5] powerpc/pm: support deep sleep feature on T104x Chenhui Zhao
2016-09-25  7:24   ` [v3,4/5] " Scott Wood
2016-09-27 11:05     ` C.H. Zhao
2016-09-28 20:03       ` Scott Wood
2016-09-29 10:21         ` C.H. Zhao
2016-10-03 17:22           ` Scott Wood [this message]
2016-08-02 11:59 ` [PATCH v3 5/5] powerpc/pm: save and restore registers during deep sleep Chenhui Zhao

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=1475515377.4917.7.camel@buserror.net \
    --to=oss@buserror.net \
    --cc=chenhui.zhao@nxp.com \
    --cc=jason.jin@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=z.chenhui@gmail.com \
    /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).