Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • stable
  • extraversion
  • early-display
  • variant-emmc-nvme-boot
  • 2024-07-19
  • 2024-06-30
  • 2023-10-18
  • 2023-10-10
  • 2023-07-04
  • 2023-01-25
  • v3
  • variant-emmc-nvme-boot
  • 2020-06-01
14 results

usb.c

Blame
    • Remy Bohmer's avatar
      be19d324
      Fix for USB sticks not working on ARM while using GCC 4.x compilers · be19d324
      Remy Bohmer authored
      
      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: default avatarRemy Bohmer <linux@bohmer.net>
      Signed-off-by: default avatarMarkus Klotzbuecher <mk@denx.de>
      be19d324
      History
      Fix for USB sticks not working on ARM while using GCC 4.x compilers
      Remy Bohmer authored
      
      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: default avatarRemy Bohmer <linux@bohmer.net>
      Signed-off-by: default avatarMarkus Klotzbuecher <mk@denx.de>
    usb.c 36.69 KiB