Skip to content
Snippets Groups Projects
  1. Oct 12, 2010
    • Peter Tyser's avatar
      examples/standalone: Use gcc's -fno-toplevel-reorder · c91d456c
      Peter Tyser authored
      
      Using -fno-toplevel-reorder causes gcc to not reorder functions.  This
      ensures that an application's entry point will be the first function in
      the application's source file.
      
      This change, along with commit 620bbba5
      should cause a standalone application's entry point to be at the base of
      the compiled binary.  Previously, the entry point could change depending
      on gcc version and flags.
      
      Note -fno-toplevel-reorder is only available in gcc version 4.2 or
      greater.
      
      Signed-off-by: default avatarPeter Tyser <ptyser@xes-inc.com>
      c91d456c
  2. Sep 04, 2010
  3. Jul 12, 2010
  4. Jul 04, 2010
    • Wolfgang Denk's avatar
      Make sure that argv[] argument pointers are not modified. · 54841ab5
      Wolfgang Denk authored
      
      The hush shell dynamically allocates (and re-allocates) memory for the
      argument strings in the "char *argv[]" argument vector passed to
      commands.  Any code that modifies these pointers will cause serious
      corruption of the malloc data structures and crash U-Boot, so make
      sure the compiler can check that no such modifications are being done
      by changing the code into "char * const argv[]".
      
      This modification is the result of debugging a strange crash caused
      after adding a new command, which used the following argument
      processing code which has been working perfectly fine in all Unix
      systems since version 6 - but not so in U-Boot:
      
      int main (int argc, char **argv)
      {
      	while (--argc > 0 && **++argv == '-') {
      /* ====> */	while (*++*argv) {
      			switch (**argv) {
      			case 'd':
      				debug++;
      				break;
      			...
      			default:
      				usage ();
      			}
      		}
      	}
      	...
      }
      
      The line marked "====>" will corrupt the malloc data structures and
      usually cause U-Boot to crash when the next command gets executed by
      the shell.  With the modification, the compiler will prevent this with
      an
      	error: increment of read-only location '*argv'
      
      N.B.: The code above can be trivially rewritten like this:
      
      	while (--argc > 0 && **++argv == '-') {
      		char *arg = *argv;
      		while (*++arg) {
      			switch (*arg) {
      			...
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      54841ab5
    • Wolfgang Denk's avatar
      Make *printf() return "int" instead of "void" · d9c27253
      Wolfgang Denk authored
      
      Change the return type of the *printf() functions to the standard
      "int"; no changes are needed but returning the already available
      length count.
      
      This will save a few additional strlen() calls later...
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      d9c27253
  5. Jun 29, 2010
    • Peter Tyser's avatar
      examples/standalone: Remove relocation compile flags for PowerPC · 620bbba5
      Peter Tyser authored
      
      Previously, standalone applications were compiled with gcc flags that
      produced relocatable executables on the PowerPC architecture (eg with
      the -mrelocatable and -fPIC flags).  There's no reason for these
      applications to be fully relocatable at this time since no relocation
      fixups are performed on standalone applications.
      
      Additionally, removing the gcc relocation flags results in the entry
      point of applications residing at the base of the image.  When
      a standalone application was relocatable, the entry point was generally
      located at an offset into the image which was confusing and prone to
      errors.
      
      This change moves the entry point of PowerPC standalone applications
      from 0x40004 (usually) to 0x40000.
      
      Signed-off-by: default avatarPeter Tyser <ptyser@xes-inc.com>
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      620bbba5
  6. May 28, 2010
  7. Apr 21, 2010
  8. Apr 13, 2010
  9. Mar 12, 2010
  10. Feb 01, 2010
    • Mike Frysinger's avatar
      smc91111_eeprom: fix linking error · c4168af3
      Mike Frysinger authored
      
      Building for a bf533-stamp ends up with this error:
      smc91111_eeprom.o: In function `smc91111_eeprom':
      examples/standalone/smc91111_eeprom.c:58: undefined reference to `memset'
      make[2]: *** [smc91111_eeprom] Error 1
      
      The new eth_struct definition means gcc has to zero out the structure on
      the stack, and some gcc versions optimize this with an implicit call to
      memset.  So tweak the structure style to avoid that gcc feature.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      Signed-off-by: default avatarBen Warren <biggerbadderben@gmail.com>
      c4168af3
  11. Jan 18, 2010
  12. Dec 05, 2009
    • Ingo van Lil's avatar
      Generic udelay() with watchdog support · 3eb90bad
      Ingo van Lil authored
      
      According to the PPC reference implementation the udelay() function is
      responsible for resetting the watchdog timer as frequently as needed.
      Most other architectures do not meet that requirement, so long-running
      operations might result in a watchdog reset.
      
      This patch adds a generic udelay() function which takes care of
      resetting the watchdog before calling an architecture-specific
      __udelay().
      
      Signed-off-by: default avatarIngo van Lil <inguin@gmx.de>
      3eb90bad
  13. Dec 02, 2009
    • Mike Frysinger's avatar
      smc91111_eeprom: drop CONFIG stub protection · 64a48060
      Mike Frysinger authored
      
      Since the Makefile now controls the compilation of this, there is no need
      for CONFIG checking nor the stub function.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      64a48060
    • Sanjeev Premi's avatar
      Fix build failure in examples/standalone · 604f7ce5
      Sanjeev Premi authored
      
      Some versions of 'make' do not handle trailing white-spaces
      properly. Trailing spaces in ELF causes a 'fake' source to
      be added to the variable COBJS; leading to build failure
      (listed below). The problem was found with GNU Make 3.80.
      
      Using text-function 'strip' as a workaround for the problem.
      
      make[1]: Entering directory `/home/sanjeev/u-boot/examples/standalone'
      arm-none-linux-gnueabi-gcc -g  -Os   -fno-common -ffixed-r8 -msoft-float
      -D__KERNEL__ -DTEXT_BASE=0x80e80000 -I/home/sanjeev/u-boot/include
      -fno-builtin -ffreestanding -nostdinc -isystem /opt/codesourcery/2009q1-
      203/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -pipe  -DCONFIG_
      ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5
      -Wall -Wstrict-prototypes -fno-stack-protector -g  -Os   -fno-common -ff
      ixed-r8 -msoft-float   -D__KERNEL__ -DTEXT_BASE=0x80e80000 -I/home/sanje
      ev/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/co
      desourcery/2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/includ
      e -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-inte
      rwork -march=armv5 -I.. -Bstatic -T u-boot.lds  -Ttext 0x80e80000 -o .c
      arm-none-linux-gnueabi-gcc: no input files
      make[1]: *** [.c] Error 1
      make[1]: Leaving directory `/home/sanjeev/u-boot/examples/standalone'
      make: *** [examples/standalone] Error 2
      premi #
      
      Signed-off-by: default avatarSanjeev Premi <premi@ti.com>
      
      Fixed typo (s/ElF/ELF/).
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      604f7ce5
  14. Nov 23, 2009
  15. Nov 13, 2009
  16. Oct 27, 2009
  17. Oct 05, 2009
  18. Oct 03, 2009
  19. Sep 15, 2009
  20. Sep 04, 2009
    • Mike Frysinger's avatar
      push LOAD_ADDR out to arch mk files · 262ae0a6
      Mike Frysinger authored
      
      Rather than maintain/extend the current ifeq($(ARCH)) mess that exists in
      the standalone Makefile, push the setting up of LOAD_ADDR out to the arch
      config.mk (and rename to STANDALONE_LOAD_ADDR in the process).  This keeps
      the common code clean and lets the arch do whatever crazy crap it wants in
      its own area.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      262ae0a6
    • Mike Frysinger's avatar
      atmel_df_pow2: standalone to convert dataflashes to pow2 · 65f6f07b
      Mike Frysinger authored
      
      Atmel DataFlashes by default operate with pages that are slightly bigger
      than normal binary sizes (i.e. many are 1056 byte pages rather than 1024
      bytes).  However, they also have a "power of 2" mode where the pages show
      up with the normal binary size.  The latter mode is required in order to
      boot with a Blackfin processor, so many people wish to convert their
      DataFlashes on their development systems to this mode.  This standalone
      application does just that.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      65f6f07b
  21. Sep 02, 2009
  22. Aug 08, 2009
    • Michael Evans's avatar
      Fix examples for OMAP3 boards... · 61c68ae0
      Michael Evans authored
      
      The attached patch corrects an error in the examples/Makefile which
      causes the applications in the examples directory to hang on OMAP3
      based boards. The current Makefile sets -Ttext during linking to
      0x0c100000 which is outside of addressable SDRAM memory. The script
      corrects the existing ifeq...else...endif logic to look at the VENDOR
      tag rather than the CPU tag.
      
      The patch affects the following configs: omap3_beagle_config,
      omap3_overo_config, omap3_evm_config, omap3_pandora_config,
      omap3_zoom1_config and omap3_zoom2_config.
      
      Signed-off-by: default avatarMichael Evans <horse_dung@hotmail.com>
      
      Edited commit message.
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      61c68ae0
  23. Jul 27, 2009
  24. Jul 21, 2009
  25. Jul 20, 2009
  26. Apr 04, 2009
  27. Mar 20, 2009
    • Trent Piepho's avatar
      Fix all linker script to handle all rodata sections · f62fb999
      Trent Piepho authored
      
      A recent gcc added a new unaligned rodata section called '.rodata.str1.1',
      which needs to be added the the linker script.  Instead of just adding this
      one section, we use a wildcard ".rodata*" to get all rodata linker section
      gcc has now and might add in the future.
      
      However, '*(.rodata*)' by itself will result in sub-optimal section
      ordering.  The sections will be sorted by object file, which causes extra
      padding between the unaligned rodata.str.1.1 of one object file and the
      aligned rodata of the next object file.  This is easy to fix by using the
      SORT_BY_ALIGNMENT command.
      
      This patch has not be tested one most of the boards modified.  Some boards
      have a linker script that looks something like this:
      
      *(.text)
      . = ALIGN(16);
      *(.rodata)
      *(.rodata.str1.4)
      *(.eh_frame)
      
      I change this to:
      
      *(.text)
      . = ALIGN(16);
      *(.eh_frame)
      *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
      
      This means the start of rodata will no longer be 16 bytes aligned.
      However, the boundary between text and rodata/eh_frame is still aligned to
      16 bytes, which is what I think the real purpose of the ALIGN call is.
      
      Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
      f62fb999
  28. Mar 18, 2009
  29. Feb 23, 2009
  30. Jan 24, 2009
Loading