Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Feb 2014 00:04:50 +0100
From:      Bernd Walter <ticso@cicely7.cicely.de>
To:        Ian Lepore <ian@FreeBSD.org>
Cc:        freebsd-arm <freebsd-arm@FreeBSD.org>, Bernd Walter <ticso@cicely7.cicely.de>
Subject:   Re: wandboard / imx6 / exynos4 / cortex-a9 "wrong-endian bug" fixed
Message-ID:  <20140202230450.GA42331@cicely7.cicely.de>
In-Reply-To: <1391371204.13026.43.camel@revolution.hippie.lan>
References:  <1391371204.13026.43.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 02, 2014 at 01:00:04PM -0700, Ian Lepore wrote:
> As some of you know from previous email or irc conversations, I've been
> chasing a strange bug for months that affects some cortex-a9 chips,
> which I've been calling the "wrong-endian bug", where some registers get
> restored with wrong-endian values on return from an interrupt, leading
> to a panic or crash during boot.  

This is very great news and a pretty amazing job to find this.
Thank you very much!
In the end it also exaplains the tempeerature dependency on the
Wandboards and why it always happened on my MarSboard.
Unfortunately I'm still time contrained, but likely I will at least
find enough time to do some tests on my iMX6 board collection next
weekend.
I'm especially curious about the MarSboard, which never booted without
the panic.

> I finally tracked the cause down to our gnu assembler (gas), which
> apparently thinks that when you say "msr spsr_all, r0" what you meant by
> "_all" was "only restore 16 of the 32 bits".  It's not a bug per se,
> it's just how the gas authors think the assembler should behave.  So,
> when the chip powers on there may be some garbage bits in the spsr
> register, and they would never get cleared out because only some of the
> bits would get restored, and if the big-endian bit was among them Bad
> Things Happened.  I'm not sure why this only affected some cortex-a9
> chips such as imx6, but maybe some chips set those registers to zero and
> some don't at power-on.
> 
> I fixed the problem by updating our source code to use the newer arm
> instruction syntax for msr and msr instructions, which ensures all 32
> bits get restored.  That change happened in r261393, but because of
> other changes and churn in the tree the first really stable revision
> that includes the fix is r261410.  So if you're working with wandboard
> or another imx6-based system, please make sure to update to this rev.
> 
> -- Ian
> 
> 

-- 
B.Walter <bernd@bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140202230450.GA42331>