]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
Fix for USB sticks not working on ARM while using GCC 4.x compilers
authorRemy Bohmer <linux@bohmer.net>
Tue, 16 Sep 2008 12:55:42 +0000 (14:55 +0200)
committerMarkus Klotzbuecher <mk@denx.de>
Wed, 17 Sep 2008 13:41:05 +0000 (15:41 +0200)
commitbe19d324edc1a1d7f393d24e10d164cd94c91a00
treeb8def4593f28fadb96b1ab713a8a65a2ace03806
parent87b4ef560cf2da4ccc9e59711ad1ff7fafe96670
Fix for USB sticks not working on ARM while using GCC 4.x compilers

The GCC-compiler makes an optimisation error while optimising the routine
usb_set_maxpacket(). This should be fixed in the compiler in the first place,
but there lots of compilers out there that makes this error, that it is
probably wiser to workaround it in U-boot itself.

What happens is that the register r3 is used as loop-counter 'i', but gets
overwritten later on. From there it starts using register r3 for several other
things and the assembler code is becoming a big mess. This is clearly a compiler bug.

This error occurs on at least several versions of Code Sourcery Lite compilers
for ARM. Like the Edition 2008q1, and 2008q3, It has also been seen on other
compilers, while compiling for armv4t, or armv5te with Os, O1 and O2.

We work around it by splitting up this routine in 2 parts, and making sure that
the split out part is NOT inlined any longer. This will make GCC spit out assembler
that do not show this problem. Another possibility is to adapt the Makefile to stop
optimisation for the complete file. I think this solution is nicer.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: Markus Klotzbuecher <mk@denx.de>
common/usb.c