public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ian Campbell <ijc@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] sunxi: Set the AUXCR L2EN bit for sun4i/sun5i in FEL boot mode
Date: Mon, 21 Jul 2014 19:39:08 +0100	[thread overview]
Message-ID: <1405967948.27009.62.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <53CA548F.8050709@redhat.com>

On Sat, 2014-07-19 at 13:20 +0200, Hans de Goede wrote:
> Hi,
> 
> On 07/18/2014 07:09 PM, Siarhei Siamashka wrote:
> > This is needed to have feature parity with the normal boot mode,
> > where the L2EN bit in the CP15 Auxiliary Control Register is set
> > by the BROM code right from the start.
> >
> > If this is not done, the Linux system ends up booted with the L2 cache
> > disabled.
> >
> > Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
> > ---
> >   arch/arm/cpu/armv7/sunxi/board.c | 12 ++++++++++++
> >   1 file changed, 12 insertions(+)
> >
> > diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
> > index 49c9448..86cf4c9 100644
> > --- a/arch/arm/cpu/armv7/sunxi/board.c
> > +++ b/arch/arm/cpu/armv7/sunxi/board.c
> > @@ -69,6 +69,18 @@ void s_init(void)
> >   		"mcr p15, 0, r0, c1, c0, 1\n");
> >   #endif
> >
> > +#if defined(CONFIG_SPL_FEL) && (defined(CONFIG_SUN4I) || defined(CONFIG_SUN5I))
> > +	/* For ARM Cortex-A8 based hardware (sun4i and sun5i), the L2EN bit is
> > +	 * set by the BROM code in the "normal" mode, but not in the "FEL" mode.
> > +	 * Here we fix this inconsistency in the Auxiliary Ctl reg by also
> > +	 * setting the missing L2EN bit.
> > +	 */
> > +	asm volatile(
> > +		"mrc p15, 0, r0, c1, c0, 1\n"
> > +		"orr r0, r0, #2\n"
> > +		"mcr p15, 0, r0, c1, c0, 1\n" : : : "r0");
> > +#endif
> > +
> 
> Wouldn't it be better to do this in the start_fel.S file you've introduced in
> the first patch of this series ?

That wouldn't remove the need for the ifdef if that's what you are
thinking since it still needs to be sun4i/sun5i specific.

I think doing it here is in keeping with setting ACTLR.SMP on the
sun6i/sun7i platforms which is just above the context here.

Acked-by: Ian Campbell <ijc@hellion.org.uk>

Although I also wouldn't object to doing it in in start_fel.S if that is
preferred.

I expect this needs to be done on secondary processors. Need to keep
that in mind if/when someone works on PSCI for sun[45]i.

Ian.

  reply	other threads:[~2014-07-21 18:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18 17:09 [U-Boot] [PATCH 0/2] sunxi: FEL boot mode improvements Siarhei Siamashka
2014-07-18 17:09 ` [U-Boot] [PATCH 1/2] sunxi: Use Thumb2 and move stack to gain more SRAM space in FEL mode Siarhei Siamashka
2014-07-19 11:19   ` Hans de Goede
2014-07-21 18:31   ` Ian Campbell
2014-07-25  1:01     ` Siarhei Siamashka
2014-07-25  1:03       ` [U-Boot] [linux-sunxi] " Julian Calaby
2014-07-25  4:11         ` Julian Calaby
2014-07-25  6:56       ` [U-Boot] " Ian Campbell
2014-07-25  1:14   ` Siarhei Siamashka
2014-07-18 17:09 ` [U-Boot] [PATCH 2/2] sunxi: Set the AUXCR L2EN bit for sun4i/sun5i in FEL boot mode Siarhei Siamashka
2014-07-18 18:47   ` Jeroen Hofstee
2014-07-21 20:07     ` Ian Campbell
2014-07-21 20:39       ` Jeroen Hofstee
2014-07-21 20:59         ` Ian Campbell
2014-07-25  0:21           ` Siarhei Siamashka
2014-07-25  6:55             ` Ian Campbell
2014-07-19 11:20   ` Hans de Goede
2014-07-21 18:39     ` Ian Campbell [this message]
2014-07-21 20:34       ` Ian Campbell

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=1405967948.27009.62.camel@dagon.hellion.org.uk \
    --to=ijc@hellion.org.uk \
    --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