Date: Sun, 2 Feb 2014 18:25:36 -0700 From: Tom Everett <tom@khubla.com> To: ticso@cicely.de Cc: freebsd-arm <freebsd-arm@freebsd.org>, Bernd Walter <ticso@cicely7.cicely.de>, Ian Lepore <ian@freebsd.org> Subject: Re: wandboard / imx6 / exynos4 / cortex-a9 "wrong-endian bug" fixed Message-ID: <CAB3ij4AjkrMfF2YLrjTE5vZx25XT%2B2iTSghKG=kh8iu==XeZ2w@mail.gmail.com> In-Reply-To: <20140202230450.GA42331@cicely7.cicely.de> References: <1391371204.13026.43.camel@revolution.hippie.lan> <20140202230450.GA42331@cicely7.cicely.de>
next in thread | previous in thread | raw e-mail | index | archive | help
I can confirm that a crochet image for Wandboard no longer crashes after this fix. It doesn't mount the FS yet, but that's a known issue, noted here: https://github.com/kientzle/crochet-freebsd/issues/29 Boot log is here: http://files.khubla.com/freebsd-wandboard/wandboard.txt On Sun, Feb 2, 2014 at 4:04 PM, Bernd Walter <ticso@cicely7.cicely.de>wrote: > 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. > -- A better world shall emerge based on faith and understanding - Douglas MacArthur
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB3ij4AjkrMfF2YLrjTE5vZx25XT%2B2iTSghKG=kh8iu==XeZ2w>