mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Chenhui Zhao <chenhui.zhao@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
	<leoli@freescale.com>, <Jason.Jin@freescale.com>
Subject: Re: [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040
Date: Thu, 20 Mar 2014 18:33:10 -0500	[thread overview]
Message-ID: <1395358390.12479.350.camel@snotra.buserror.net> (raw)
In-Reply-To: <20140319005607.GB9735@localhost.localdomain>

On Wed, 2014-03-19 at 08:56 +0800, Chenhui Zhao wrote:
> On Tue, Mar 18, 2014 at 05:42:09PM -0500, Scott Wood wrote:
> > On Mon, 2014-03-17 at 19:19 +0800, Chenhui Zhao wrote:
> > > On Fri, Mar 14, 2014 at 06:18:27PM -0500, Scott Wood wrote:
> > > > Why do you need the entry mapping on 32-bit but not 64-bit?
> > > 
> > > fsl_booke_entry_mapping.S is for 32-bit. 64-bit calls
> > > initial_tlb_book3e() in exceptions-64e.S.
> > 
> > The answer I was looking for is that __entry_deep_sleep calls
> > start_initialization_book3e which calls the code to handle it.
> > 
> > But why is it driven from sleep.S on 64-bit but not on 32-bit?  Why
> > can't you make it so that the 32-bit TLB setup can be called into in a
> > similar manner?
> 
> Yes. I also wish to do like this. As I mentioned, the problem in 32-bit
> is that the TLB setup code in fsl_booke_entry_mapping.S only setups a temp
> mapping of 4KB, so these code only can run in this 4KB address space. But the
> code in sleep.S is outside of the 4KB space. So can't put the TLB setup
> code in sleep.S. There are two method to solve it.
> 1) The current method is running the TLB setup code of fsl_booke_entry_mapping.S in the 4KB
> space, then jump to the code of sleep.S.
> 2) extend the temp mapping space in the TLB setup code to cover kernel, say 4MB or 8MB. But
> not sure if there are any side effects.

fsl_booke_entry_mapping.S creates a 64M entry.  The 4K entry is only
temporary while in AS1 -- it shouldn't matter if the address you return
to when leaving fsl_booke_entry_mapping.S is outside the 4K, as long as
it's within the 64M entry.

Or am I missing something?

> > > > > > > +#define FSLDELAY(count)		\
> > > > > > > +	li	r3, (count)@l;	\
> > > > > > > +	slwi	r3, r3, 10;	\
> > > > > > > +	mtctr	r3;		\
> > > > > > > +101:	nop;			\
> > > > > > > +	bdnz	101b;
> > > > > > 
> > > > > > You don't need a namespace prefix on local macros in a non-header file.
> > > > > > 
> > > > > > Is the timebase stopped where you're calling this from?
> > > > > 
> > > > > No. My purpose is to avoid jump in the last stage of entering deep sleep.
> > > > > Jump may cause problem at that time.
> > > > 
> > > > "bdnz" is a jump.
> > > > 
> > > > What problems do you think a jump will cause?
> > > 
> > > I mean a far jump which can jump to an address which has not been prefetched in
> > > advance. I wish the code is executed in a restricted environment (predictable code
> > > and address).
> > 
> > Why would a timebase loop require a "far" jump?
> 
> I mean there is far jump in udely().
> 
> Do you mean using a timebase loop in the macro FSLDELAY? If so, I agree.

Yes, I meant a timebase loop, not udelay().

> > > > > > You also probably want to do a "sync, readback, data dependency, isync"
> > > > > > sequence to make sure that the store has hit CCSR before you begin your
> > > > > > delay (or is a delay required at all if you do that?).
> > > > > 
> > > > > Yes. It is safer with a sync sequence.
> > > > > 
> > > > > The DDR controller need some time to signal the external DDR modules to
> > > > > enter self refresh mode.
> > > > 
> > > > Is it documented how much time it requires?
> > > > 
> > > > -Scott
> > > 
> > > No.
> > 
> > How do you know the current delay is adequate in all circumstances (e.g
> > clock speeds), much less on future chips?  Is it documented that a delay
> > is needed at all, or is this just something that appeared to make it
> > work?  If the latter, what happens if you put the synchronization in,
> > but leave out the delay?
> > 
> > -Scott
> 
> The code controls external parts (FPGA/CPLD, DDR module) to act, and
> the sequent code must wait until external parts complete. We can't get
> an ack from external parts, so use delay to make sure the sequence and
> insert enough time to wait.

It would be good if you could get the hardware designers to provide an
upper bound for how long we need to wait.

-Scott



      reply	other threads:[~2014-03-20 23:33 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07  4:57 [PATCH 1/9] powerpc/fsl: add PVR definition for E500MC and E5500 Chenhui Zhao
2014-03-07  4:57 ` [PATCH 2/9] powerpc/cache: add cache flush operation for various e500 Chenhui Zhao
2014-03-07  4:57 ` [PATCH 3/9] powerpc/rcpm: add RCPM driver Chenhui Zhao
2014-03-11 23:42   ` Scott Wood
2014-03-12  3:59     ` Chenhui Zhao
2014-03-14 22:34       ` Scott Wood
2014-03-07  4:58 ` [PATCH 4/9] powerpc/85xx: support CPU hotplug for e500mc and e5500 Chenhui Zhao
2014-03-11 23:48   ` Scott Wood
2014-03-12  4:34     ` Chenhui Zhao
2014-03-07  4:58 ` [PATCH 5/9] powerpc/85xx: disable irq by hardware when suspend for 64-bit Chenhui Zhao
2014-03-11 23:51   ` Scott Wood
2014-03-12  7:46     ` Chenhui Zhao
2014-03-14 22:41       ` Scott Wood
2014-03-17  9:37         ` Chenhui Zhao
2014-03-07  4:58 ` [PATCH 6/9] powerpc/85xx: support sleep feature on QorIQ SoCs with RCPM Chenhui Zhao
2014-03-12  0:00   ` Scott Wood
2014-03-12  8:08     ` Chenhui Zhao
2014-03-14 22:46       ` Scott Wood
2014-03-07  4:58 ` [PATCH 7/9] fsl: add EPU FSM configuration for deep sleep Chenhui Zhao
2014-03-12  0:08   ` Scott Wood
2014-03-12  8:34     ` Chenhui Zhao
2014-03-14 22:51       ` Scott Wood
2014-03-17 10:27         ` Chenhui Zhao
2014-03-18 23:21           ` Scott Wood
2014-03-19  0:08             ` Chenhui Zhao
2014-03-07  4:58 ` [PATCH 8/9] powerpc/85xx: add save/restore functions for core registers Chenhui Zhao
2014-03-12  0:45   ` Scott Wood
2014-03-12  9:42     ` Chenhui Zhao
2014-03-14 23:01       ` Scott Wood
2014-03-17 10:50         ` Chenhui Zhao
2014-03-07  4:58 ` [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040 Chenhui Zhao
2014-03-12  1:10   ` Scott Wood
2014-03-12  5:57     ` Kevin Hao
2014-03-12 17:43       ` Scott Wood
2014-03-13  7:46         ` Kevin Hao
2014-03-14 22:26           ` Scott Wood
2014-03-16  4:58             ` Kevin Hao
2014-03-18 23:18               ` Scott Wood
2014-03-20 11:47                 ` Kevin Hao
2014-03-20 11:59                   ` David Laight
2014-03-20 22:07                     ` Scott Wood
2014-03-21  9:21                       ` David Laight
2014-03-21 21:16                         ` Scott Wood
2014-03-20 22:17                   ` Scott Wood
2014-03-12 10:40     ` Chenhui Zhao
2014-03-14 23:18       ` Scott Wood
2014-03-17 11:19         ` Chenhui Zhao
2014-03-18 22:42           ` Scott Wood
2014-03-19  0:56             ` Chenhui Zhao
2014-03-20 23:33               ` Scott Wood [this message]

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=1395358390.12479.350.camel@snotra.buserror.net \
    --to=scottwood@freescale.com \
    --cc=Jason.Jin@freescale.com \
    --cc=chenhui.zhao@freescale.com \
    --cc=leoli@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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

all inboxes | Powered by JetHome®