From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 2/3] mx7: psci: add basic psci support
Date: Tue, 20 Oct 2015 23:04:03 +0200 [thread overview]
Message-ID: <20151020230403.3ba98b53@lilith> (raw)
In-Reply-To: <BY2PR0301MB163850B2C1169D80C249AB2782390@BY2PR0301MB1638.namprd03.prod.outlook.com>
Hello Li,
(sorry for my dropping other receipients from the discussion; restoring
them
On Tue, 20 Oct 2015 15:04:40 +0000, Li Frank <Frank.Li@freescale.com>
wrote:
>
>
> > -----Original Message-----
> > From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net]
> > Sent: Tuesday, October 20, 2015 9:55 AM
> > To: Li Frank-B20596 <Frank.Li@freescale.com>
> > Subject: Re: [U-Boot] [PATCH V2 2/3] mx7: psci: add basic psci support
> >
> > Hello Li,
> >
> > On Tue, 20 Oct 2015 14:29:46 +0000, Li Frank <Frank.Li@freescale.com>
> > wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net]
> > > > Sent: Tuesday, October 20, 2015 9:25 AM
> > > > To: Li Frank-B20596 <Frank.Li@freescale.com>
> > > > Cc: Fan Peng-B51431 <Peng.Fan@freescale.com>; u-boot at lists.denx.de;
> > > > Estevam Fabio-R49496 <Fabio.Estevam@freescale.com>
> > > > Subject: Re: [U-Boot] [PATCH V2 2/3] mx7: psci: add basic psci
> > > > support
> > > >
> > > > Hello Li,
> > > >
> > > > On Tue, 20 Oct 2015 14:05:45 +0000, Li Frank
> > > > <Frank.Li@freescale.com>
> > > > wrote:
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Peng Fan [mailto:Peng.Fan at freescale.com]
> > > > > > Sent: Tuesday, October 20, 2015 1:00 AM
> > > > > > To: u-boot at lists.denx.de
> > > > > > Cc: Fan Peng-B51431 <Peng.Fan@freescale.com>; Li Frank-B20596
> > > > > > <Frank.Li@freescale.com>; Stefano Babic <sbabic@denx.de>;
> > > > > > Estevam
> > > > > > Fabio-
> > > > > > R49496 <Fabio.Estevam@freescale.com>
> > > > > > Subject: [PATCH V2 2/3] mx7: psci: add basic psci support
> > > > > >
> > > > > > 1. add basic psci support for imx7 chip.
> > > > > > 2. support cpu_on and cpu_off.
> > > > > > 3. switch to non-secure mode when boot linux kernel.
> > > > > > 4. set csu allow accessing all peripherial register in non-secure mode.
> > > > > >
> > > > > > Signed-off-by: Frank Li <Frank.Li@freescale.com>
> > > > > > Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> > > > > > Cc: Stefano Babic <sbabic@denx.de>
> > > > > > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > > > > > ---
> > > > > >
> > > > > > Changes V2:
> > > > > > Refine commit msg.
> > > > > >
> > > > > > arch/arm/cpu/armv7/mx7/Makefile | 4 ++
> > > > > > arch/arm/cpu/armv7/mx7/psci-mx7.c | 78
> > > > > > +++++++++++++++++++++++++++++++++++++++
> > > > > > arch/arm/cpu/armv7/mx7/psci.S | 54
> > +++++++++++++++++++++++++++
> > > > > > arch/arm/cpu/armv7/mx7/soc.c | 9 +++++
> > > > > > 4 files changed, 145 insertions(+) create mode 100644
> > > > > > arch/arm/cpu/armv7/mx7/psci-mx7.c create mode
> > > > > > 100644 arch/arm/cpu/armv7/mx7/psci.S
> > > > > >
> > > > > > diff --git a/arch/arm/cpu/armv7/mx7/Makefile
> > > > > > b/arch/arm/cpu/armv7/mx7/Makefile index e6ecef0..f25461c 100644
> > > > > > --- a/arch/arm/cpu/armv7/mx7/Makefile
> > > > > > +++ b/arch/arm/cpu/armv7/mx7/Makefile
> > > > > > @@ -6,3 +6,7 @@
> > > > > > #
> > > > > >
> > > > > > obj-y := soc.o clock.o clock_slice.o
> > > > > > +
> > > > > > +ifdef CONFIG_ARMV7_PSCI
> > > > > > +obj-y += psci.o psci-mx7.o
> > > > >
> > > > > Obj-y += psci-mx7.o psci.o
> > > > > The otherwise psci_text_end will not be last one.
> > > >
> > > > I don't like this object module order sensitivity.
> > > >
> > > > The object module order of secure code modules should not affect the
> > > > resulting binary to the point of possibly preventing it from working
> > > > -- after all, the object module order of 'vanilla' image code does
> > > > not matter (1). We don't have this kind of problem when defining the
> > > > image start and end, why would we have it with the secure code start and
> > end?
> > >
> > > Secure code use psci_text_end to calculate stack top point.
> >
> > Yes, and that does not require defining psci_text_end in an object module, nor
> > does it require specific object module ordering.
>
> If psci_text_end in mid of secure text,
> And psci_text_end + 1k < total secure text size, stack will overwrite the code.
This is a good reason to allocate the PSCCI stack and create a symbol
for its top in the linker script.
> > > > IOW, psci_text_end could (and should) be defined in the linker
> > > > script, not in an object module.
> > >
> > > I agree. The other platform put psci_text_end to object module.
> >
> > Which 'other platform' is this?
>
> arch/arm/cpu/armv7/sunxi
> arch/arm/cpu/armv7/ls102xa
Ok, but they all use the same routine for moving the PSCI code and
setting its stack, right?
Amicalement,
--
Albert.
next prev parent reply other threads:[~2015-10-20 21:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 5:59 [U-Boot] [PATCH V2 1/3] arm: discard relocation entry for secure section Peng Fan
2015-10-20 5:59 ` [U-Boot] [PATCH V2 2/3] mx7: psci: add basic psci support Peng Fan
2015-10-20 10:50 ` Fabio Estevam
2015-10-20 14:05 ` Li Frank
2015-10-20 14:25 ` Albert ARIBAUD
2015-10-20 14:29 ` Li Frank
[not found] ` <20151020165526.1ae0c332@lilith>
[not found] ` <BY2PR0301MB163850B2C1169D80C249AB2782390@BY2PR0301MB1638.namprd03.prod.outlook.com>
2015-10-20 21:04 ` Albert ARIBAUD [this message]
2015-10-20 21:12 ` Li Frank
2015-10-20 5:59 ` [U-Boot] [PATCH V2 3/3] imx: mx7: default enable non-secure mode Peng Fan
2015-10-20 7:05 ` [U-Boot] [PATCH V2 1/3] arm: discard relocation entry for secure section Albert ARIBAUD
2015-10-20 7:20 ` Peng Fan
2015-10-20 7:32 ` Albert ARIBAUD
2015-10-20 7:41 ` Peng Fan
2015-10-20 12:59 ` Albert ARIBAUD
2015-10-21 9:42 ` Peng Fan
2015-10-21 11:42 ` Albert ARIBAUD
2015-10-21 12:09 ` Peng Fan
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=20151020230403.3ba98b53@lilith \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/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