From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: bootwrapper can't be compiled for cubieboard2 Date: Fri, 30 Aug 2013 10:27:31 +0200 Message-ID: <52205773.7070505@linaro.org> References: <1377850008.6935.10.camel@dagon.hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1377850008.6935.10.camel@dagon.hellion.org.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Josh Zhao , xen-devel List-Id: xen-devel@lists.xenproject.org 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=EFvely 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. > >