From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Date: Tue, 26 Jun 2012 15:56:21 -0500 Subject: [U-Boot] [PATCH] arm: enable unaligned access on ARMv7 In-Reply-To: <20120622111501.21e1fdcc@aari01-12> References: <1338918451-10126-1-git-send-email-dev@lynxeye.de> <4FCE52FB.3020501@wwwdotorg.org> <1338923180.1377.2.camel@tellur> <20120622111501.21e1fdcc@aari01-12> Message-ID: <4FEA21F5.4080803@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/22/2012 04:15 AM, Albert ARIBAUD wrote: > Hi Lucas, > > On Tue, 05 Jun 2012 21:06:20 +0200, Lucas Stach wrote: >> Hi Stephen, >> >> Am Dienstag, den 05.06.2012, 12:42 -0600 schrieb Stephen Warren: >>> On 06/05/2012 11:47 AM, Lucas Stach wrote: >>>> Recent toolchains default to using the hardware feature for >>>> unaligned access on ARM v7, rather than doing the software >>>> fallback. According to ARM this is safe as all v7 implementations >>>> have to support this feature. >>>> (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/BABJFFAE.html) >>>> >>>> To avoid CPU hangs when doing unaligned memory access, we have to >>>> turn off alignment checking in our CPU initialisation code. >>>> (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/CIHCGCFD.html) >>> >>> Does this behavior change trickle down to Linux/... too, or would >>> an OS completely re-initialize this state, and hence not be >>> affected? >>> >> >> Linux in particular does reinitialize this state and I expect any >> reasonable OS to do so. > > Then what is the point of enabling it on U-Boot? Does it fix some issue > whereby some mis-aligned piece of data cannot be properly aligned? > This is a new optimization feature in gcc 4.7 (and backported to some 4.6 versions like the ubuntu 12.04 arm cross compiler (4.6.3)): http://lists.linaro.org/pipermail/linaro-dev/2012-June/012360.html http://seabright.co.nz/2012/06/11/kernel-not-booting-with-linaro-gcc/ If you don't want to enable unaligned accesses, then "-mno-unaligned-access" needs to be added. Regards, Rob