All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 3/5] ls102xa: HYP/non-sec: support for ls102xa boards
Date: Thu, 20 Nov 2014 13:06:55 +0100	[thread overview]
Message-ID: <20141120130655.3807bb21@lilith> (raw)
In-Reply-To: <ad77d24d2e8e4f898d0e7052a6560cb4@BY2PR0301MB0613.namprd03.prod.outlook.com>

Hello Li.Xiubo at freescale.com,

On Wed, 19 Nov 2014 07:21:26 +0000, Li.Xiubo at freescale.com
<Li.Xiubo@freescale.com> wrote:
> Hi Albert,
> 
> > -----Original Message-----
> > From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net]
> > Sent: Tuesday, November 18, 2014 3:18 PM
> > To: Xiubo Li-B47053
> > Cc: Sun York-R58495; Jin Zhengxiong-R64188; u-boot at lists.denx.de
> > Subject: Re: [PATCH v3 3/5] ls102xa: HYP/non-sec: support for ls102xa boards
> > 
> > Hello Li.Xiubo at freescale.com,
> > 
> > On Tue, 18 Nov 2014 02:01:02 +0000, Li.Xiubo at freescale.com
> > <Li.Xiubo@freescale.com> wrote:
> > > Hi Albert,
> > >
> > >
> > > > > > > > > +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> > > > > > > > > +/* Setting the address at which secondary cores start from.*/
> > > > > > > > > +void smp_set_core_boot_addr(unsigned long addr, int corenr)
> > > > > > > > > +{
> > > > > > > > > +	struct ccsr_gur __iomem *gur = (void
> > *)(CONFIG_SYS_FSL_GUTS_ADDR);
> > > > > > > > > +
> > > > > > > > > +	/*
> > > > > > > > > +	 * After setting the secondary cores start address,
> > > > > > > > > +	 * just release them to boot.
> > > > > > > > > +	 */
> > > > > > > > > +	out_be32(&gur->scratchrw[0], addr);
> > > > > > > > > +	out_be32(&gur->brrl, 0x2);
> > > > > > > > > +}
> > > > > > > >
> > > > > > > > This function does not exactly "[set] the address at which
> > secondary
> > > > > > > > cores start from"; it sets *a* secondary core's boot address, and
> > then
> > > > > > > > it *boots* it.
> > > > > > > >
> > > > > > >
> > > > > > > Okay, I will fix it later.
> > > > > > >
> > > > > > > > Why does this version of smp_set_core_boot_addr() need to boot the
> > > > core
> > > > > > > > in addition to setting the address, whereas the existing ones in
> > > > > > > > virt_v7, vexpress_common and arndale don't boot the cores?
> > > > > > > >
> > > > > > >
> > > > > > > Yes, they don't doing the release operation.
> > > > > > >
> > > > > > > For Low Power Management requirement, maybe only one core will be
> > used,
> > > > and
> > > > > > then
> > > > > > > We also make sure that the secondary core must be in low power and
> > deep
> > > > > > sleep
> > > > > > > mode(using wfi). So I just release it here, to make sure that the
> > wfi
> > > > > > instruction
> > > > > > > will be executed as early as possible.
> > > > > >
> > > > > > Right after smp_set_core_boot_addr() is called, kick_all_cpus()
> > isgoing
> > > > > > to be called. Wouldn't that boot your CPUs just as well?
> > > > > >
> > > > >
> > > > > Yes, it will.
> > > > >
> > > > > But before that we must do the holdoff bit set operation as the SoC's
> > > > requirement.
> > > > >
> > > > > The BRR contains control bits for enabling boot for each core. On
> > exiting
> > > > HRESET or
> > > > > PORESET, the RCW BOOT_HO field optionally allows for logical core 0 to
> > be
> > > > released
> > > > > for booting or to remain in boot holdoff. All other cores remain in boot
> > > > holdoff until their
> > > > > corresponding bit is set.
> > > > >
> > > > > Maybe the comment is not very clear and a bit confusing.
> > > >
> > > > Before I'm lost entirely, do you mean that the comment:
> > > >
> > > > > > > > > +	/*
> > > > > > > > > +	 * After setting the secondary cores start address,
> > > > > > > > > +	 * just release them to boot.
> > > > > > > > > +	 */
> > > >
> > > > Is actually wrong, and the instructions that follow it do not actually
> > > > boot the secondary core(s)?
> > > >
> > >
> > > The comment should be:
> > >     /*
> > >      * After setting the secondary core's start address,
> > >      * just release it from holdoff.
> > >      */
> > > From my tests, for most time the release instructions will boot the
> > secondary
> > > core(s) without smp_kick_all_cpus(). One time has failed.
> > >
> > > So I think the release can not make sure that it will boot the secondary
> > core(s).
> > 
> > Thanks for clarifying.
> > 
> > If a holdoff release is the right way to boot a secondary core for you,
> > then I think the right place to do it is not smp_set_core_boot_addr()
> > but smp_kick_all_cpus(), of which you could make a strong version which
> > would do the holdoff release instead of whatever the weak version does.
> > 
> 
> Yes, I do think a strong version will be okay.
> 
> In file arch/arm/cpu/armv7/ls102xa/cpu.c, add the strong version:
> 
> +/* Release the secondary core from holdoff state and boot it */
> +void smp_kick_all_cpus(void)
> +{
> +       struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
> +
> +       out_be32(&gur->brrl, 0x2);
> +}
> +
> Is this okay ?

Yes, thanks!

> I have test the holdoff release in two boards(including the old one before
> I used) for 37 times and all has passed. I have a check the before failed logs,
> It is another issue led to the failure. And also get confirmation that the
> Holdoff release will do reset and then boot the secondary core.

Good -- this makes smp_kick_all_cpus() the right home for holdoff
releast.

> Thanks,

Thank you for your patience. :)

> BRs
> Xiubo

Amicalement,
-- 
Albert.

  reply	other threads:[~2014-11-20 12:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20  9:00 [U-Boot] [PATCH v3 0/5] ls102xa: HYP/non-sec: for ls102xa Xiubo Li
2014-10-20  9:00 ` [U-Boot] [PATCH v3 1/5] ARM: HYP/non-sec: add the pen address BE mode support Xiubo Li
2014-11-13 16:44   ` York Sun
2014-10-20  9:00 ` [U-Boot] [PATCH v3 2/5] ARM: HYP/non-sec: Fix the ARCH Timer frequency setting Xiubo Li
2014-11-13 16:44   ` York Sun
2014-10-20  9:00 ` [U-Boot] [PATCH v3 3/5] ls102xa: HYP/non-sec: support for ls102xa boards Xiubo Li
2014-11-13 16:44   ` York Sun
2014-11-14  7:49   ` Albert ARIBAUD
2014-11-14  9:06     ` Li.Xiubo at freescale.com
2014-11-14 11:44       ` Albert ARIBAUD
2014-11-17  2:16         ` Li.Xiubo at freescale.com
2014-11-17 13:04           ` Albert ARIBAUD
2014-11-18  2:01             ` Li.Xiubo at freescale.com
2014-11-18  7:18               ` Albert ARIBAUD
2014-11-19  7:21                 ` Li.Xiubo at freescale.com
2014-11-20 12:06                   ` Albert ARIBAUD [this message]
2014-11-21  1:55                     ` Li.Xiubo at freescale.com
2014-10-20  9:00 ` [U-Boot] [PATCH v3 4/5] ARM: ls102xa: allow all the peripheral access permissions as R/W Xiubo Li
2014-11-13 16:45   ` York Sun
2014-10-20  9:00 ` [U-Boot] [PATCH v3 5/5] ARM: ls102xa: Setting device's stream id for SMMUs Xiubo Li
2014-11-13 16:45   ` York Sun
2014-11-13  6:15 ` [U-Boot] [PATCH v3 0/5] ls102xa: HYP/non-sec: for ls102xa Albert ARIBAUD

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=20141120130655.3807bb21@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.