[PATCH v2] ARM: cache-l2x0: add resume entry for l2 in secure mode

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Sep 29 05:24:06 EDT 2011


On Thu, Sep 29, 2011 at 05:28:29PM +0800, Shawn Guo wrote:
> On Sun, Sep 25, 2011 at 08:26:09PM -0700, Barry Song wrote:
> > we save the l2x0 registers at the first initialization, and platform codes
> > can get them to restore l2x0 status after wakeup.
> > 
> > Cc: Shawn Guo <shawn.guo at linaro.org>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>
> > Signed-off-by: Barry Song <Baohua.Song at csr.com>
> > ---
> >  -v2:
> >  define the structure l2x0_regs to hold all saved registers;
> >  make saved copy of registers non-static so that platform codes can access them;
> >  add asm_offset for l2x0 saved regs(l2x0_regs struct) so that asm codes can use
> > 
> 
> I'm trying to migrate imx6q to this infrastructure, but seeing some
> facts that might stop me from the effort.  Please help me understand
> these facts are correct.
> 
> It seems to me that the only benefit that imx6q gains from the
> infrastructure is the register saving, and I fail to see any benefit
> on the restoring.

That's correct - because I believe that's the only part which is worth
doing in common code.  The restoring tends to be platform dependent so
I don't see the point of having a bunch of code in common files to do
that which almost no one uses.

>  * I still have to save physical base of l2x0 for register restoring.

That could be added to the structure.

>  * I do not have the physical address of l2x0_saved_regs, and I have
>    to manage to get it somehow.

That's true no matter what - we could store the physical address of
the struct somewhere, but then in order for you to obtain that, you'd
somehow need to know the physical address of _that_ location too - so
there's no benefit there.

It can be obtained simply by: __pa(l2x0_saved_regs) in C code, and
saving that in a location known to the platform prior to suspend.



More information about the linux-arm-kernel mailing list