From owner-freebsd-arm@FreeBSD.ORG Mon Feb 3 01:25:44 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C54B80D for ; Mon, 3 Feb 2014 01:25:44 +0000 (UTC) Received: from mail-oa0-f49.google.com (mail-oa0-f49.google.com [209.85.219.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F419819CC for ; Mon, 3 Feb 2014 01:25:43 +0000 (UTC) Received: by mail-oa0-f49.google.com with SMTP id i7so7471970oag.36 for ; Sun, 02 Feb 2014 17:25:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qhahAY0YgwD/aOTT7w6e9mr4zSFjg7c0vV4VYWGDPMI=; b=nBe+D04ZvQOtUZ37adtqtnC3aljohhM1b7rpB6QfdX4hlAdJheST/TMqAFn5hDOeMr 1kWTqIZN/eaQF2mXwUqR2Rmfzly3x2vyV6VyUpWTJPPKlPVYjnE/iKwlG42qTMEBEl2u tRr3IfBe4Dp/3Z6aBmFcFHhkgVEUVC0YExeg/4BKzZV6uwBgu3OuajXTtAEUe4owuZQU Ni4u+/KoCSiXApsnJl4VPNGcHPhriWeKJ5i9fRh2P3tAvuARB8fLggB8svLecFNn+NmP ay6RmXQld3x3YRRyMyzhw1M/KJ2QHAJglDlZzaea9/ManjEU929ovzWbvCcT9BqX6cnP NClw== X-Gm-Message-State: ALoCoQl10nikudSPF5NDVvTBvPX0G48w6K3VUxCyYnayYBqx/aIbkjxRJyqOCtwFQQI7ELiA+4zA MIME-Version: 1.0 X-Received: by 10.183.3.102 with SMTP id bv6mr28063143obd.18.1391390736110; Sun, 02 Feb 2014 17:25:36 -0800 (PST) Received: by 10.182.104.169 with HTTP; Sun, 2 Feb 2014 17:25:36 -0800 (PST) In-Reply-To: <20140202230450.GA42331@cicely7.cicely.de> References: <1391371204.13026.43.camel@revolution.hippie.lan> <20140202230450.GA42331@cicely7.cicely.de> Date: Sun, 2 Feb 2014 18:25:36 -0700 Message-ID: Subject: Re: wandboard / imx6 / exynos4 / cortex-a9 "wrong-endian bug" fixed From: Tom Everett To: ticso@cicely.de Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: freebsd-arm , Bernd Walter , Ian Lepore X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 01:25:44 -0000 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 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 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