All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Josh Zhao <joshsystem@gmail.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: bootwrapper can't be compiled for cubieboard2
Date: Fri, 30 Aug 2013 10:27:31 +0200	[thread overview]
Message-ID: <52205773.7070505@linaro.org> (raw)
In-Reply-To: <1377850008.6935.10.camel@dagon.hellion.org.uk>

On 08/30/2013 10:06 AM, Ian Campbell wrote:
> On Fri, 2013-08-30 at 15:12 +0800, Josh Zhao wrote:
>> Hi Ian,
>> I try compile the bootwrapper for cubieboard2 like this:
>
> Hi Josh,
>
> cubieboards2 support is not really in place yet, so I'm afraid there
> will currently be rough edges like this.
>
> That said I think this worked for me, but based on the discussions I
> think the better approach is to merge Andre's u-boot patches to support
> entry in HYP mode into the cubieboard branch. I'll only work on
> bootwrapper any further if some interesting platform comes along for
> which there is no possibility of updating the bootloader, so for now you
> should consider it dead/dormant.
>
> Anyhow, I've tried inserting Andre's patches into the cubieboard2 uboot
> and stumbled across a problem -- it turns out that u-boot has enabled
> the MMU (SCTLR.M), apparently because it is required for the caches to
> be on (see arch/arm/lib/cache-cp15.c:cache_enable). unfortunately SCTLR
> is banked so when nonsec-virt.S:_secure_monitor enabled SCR.NS
> everything falls apart. Naïvely enabling SCTLR.M while in monitor mode
> didn't seem to help.

Ah, good point. My whole code approach was relying on the fact that 
u-boot runs with MMU _off_. With the MMU differences in HYP mode we may 
run into troubles here, it may work if we switch late enough, though.

> Calling cleanup_before_linux() early in armv7_switch_nonsec() seemed to
> do the job -- Andre, do you think that is the right fix?

Do you have a pointer to a u-boot repository with the cubieboard 
patches? Then I'd take a look.

> Not sure why this didn't affect vexpress etc -- perhaps caches aren't
> enabled for that platform?

AFAIK it's rather normal for u-boot to run with at least some caches 
off. These only get turned on if really necessary.
So I'd refrain from enabling the MMU just to support some cache levels 
on a bootloader.

Thanks for looking at this!
Andre.

> Even with this fixed things don't quite work for me, I don't quite
> remember how/why (I last looked at this 7 days ago). I've been trying to
> set aside Friday as "cubieboard hacking day", but I've ended up with a
> bunch of meetings today, hopefully I'll still manage to investigate a
> bit.
>
> Ian.
>
>

  reply	other threads:[~2013-08-30  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30  7:12 bootwrapper can't be compiled for cubieboard2 Josh Zhao
2013-08-30  8:06 ` Ian Campbell
2013-08-30  8:27   ` Andre Przywara [this message]
2013-08-30  9:51     ` Ian Campbell
2013-08-30 13:12       ` Ian Campbell
2013-08-30 13:24         ` Andre Przywara
2013-09-02  3:59         ` Josh Zhao
2013-09-02 11:38           ` 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=52205773.7070505@linaro.org \
    --to=andre.przywara@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=joshsystem@gmail.com \
    --cc=xen-devel@lists.xen.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 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.