1. 15 Mar, 2012 1 commit
  2. 07 Mar, 2012 2 commits
  3. 03 Mar, 2012 1 commit
    • Simon Glass's avatar
      arm: Don't use printf() in SPL builds · 068f0791
      Simon Glass authored
      raise() likes to call printf() if it is available, but in SPL builds it
      either is not available, or adds a large chunk to the resulting image
      size.
      
      So don't call it even if it is available.
      
      This change reduces SPL size from 10KB to 6.3KB on hawkboard, for
      example, using generic relocation.
      
      Series-to: u-boot
      Series-cc: albert, hs
      Series-cc: Sughosh Ganu <urwithsughosh@gmail.com>
      Series-cc: Christian Riesch <christian.riesch@omicron.at>
      Series-cc: tomr
      
      Change-Id: Ieb3063b0bfdc3469b2d9155aeebf381e76859703
      068f0791
  4. 23 Feb, 2012 24 commits
    • Simon Glass's avatar
      arm: Remove unused code in start.S · be14908f
      Simon Glass authored
      Now that we are using the generic relocation framework, we don't need this
      code.
      
      Note: Here we lose the ARM1176's enable_mmu code. This seems to duplicate
      code already in U-Boot now. Can anyone comment on this?
      
      Series-to: u-boot
      Series-cc: graeme, mikef, albert, wolfgang
      Series-cc: Tom Rini <trini@ti.com>, Jason Liu <r64343@freescale.com>
      Series-version: 5
      Series-changes: 2
      - Make relocation symbols global so we can use them outside start.S
      
      Series-changes: 3
      - Remove the 'reloc' tag from each commit
      - Rebase to master
      
      Series-changes: 4
      - Update start.S pruning to fit with early patches
      - Rebase to master, also bring in ARM master
      
      Cover-letter:
      Introduce generic relocation feature
      
      (This series has trivial conflicts with the generic board series in the
      arch/xxx/config.mk additions and also in that they both add
      include/linux/sections.h. I original had this series first in my list,
      but the generic board series now also applies directly to master, so I
      will leave this one as is until I know what ordering is required.)
      
      This is the second patch series aiming to unify the various board.c files
      in each architecture into a single one. This series implements a generic
      relocation feature, which is the bridge between board_init_f() and
      board_init_r(). It then moves ARM over to use this framework, as an
      example.
      
      On ARM the relocation code is duplicated for each CPU yet it
      is the same. We can bring this up to the arch level. But since (I believe)
      Elf relocation is basically the same process for all archs, there is no
      reason not to bring it up to the generic level.
      
      Each architecture which uses this framework needs to provide a function
      called arch_elf_relocate_entry() which processes a single relocation
      entry. This is a static inline function to reduce code size overhead.
      
      For ARM, a new arch/arm/lib/proc.S file is created, which holds generic
      ARM assembler code (things that cannot be written in C and are common
      functions used by all ARM CPUs). This helps reduce duplication. Interrupt
      handling code and perhaps even some startup code can move there later.
      
      It may be useful for other architectures with a lot of different CPUs
      to have a similar file.
      
      Code size on my ARMv7 system increases by 54 bytes with generic
      relocation. This overhead is mostly just literal pool access and setting
      up to call the relocated U-Boot at the end.
      
      On my system, execution time increases from 10.8ms to 15.6ms due to the
      less efficient C implementations of the copy and zero loops. If execution
      time is of concern, you can define CONFIG_USE_ARCH_MEMSET and
      CONFIG_USE_ARCH_MEMCPY to reduce it. For me this reduces relocation time
      to 5.4ms, i.e. twice as fast as the old system.
      
      To address the build failure in tx25 I have split out the memset()/memcpy()
      functions into their own file. I believe this is somewhat justified by the
      fact that they are now used for relocation, independently of what other
      part of U-Boot may or may not use the string functions. The problem with
      linking with the whole string.o object file is that the code size is too
      large for highly-constrained SPL builds which don't have
      -ffunction-sections defined.
      END
      
      Change-Id: Iab85ee1779980682ff6923f6710727373c2d6f13
      be14908f
    • Simon Glass's avatar
      arm: Move over to generic relocation · 16ca47f4
      Simon Glass authored
      Add a function to process a single ELF relocation and switch ARM over
      to use generic relocation.
      
      Series-changes: 2
      - Use an inline relocation function to reduce code size
      
      Series-changes: 4
      - Remove proc.S file from Makefiles
      - Split out board changes into separate patches
      
      Change-Id: Id9b7b49f8a143548c57d0ce119a94bcb4eb9c322
      16ca47f4
    • Simon Glass's avatar
      smdk6400: Modify to work with generic relocation · 7b895833
      Simon Glass authored
      This seems to use an old SPL framework, or at least it is ugly enough
      that I hope it is old. Add symlinks for the new files required by
      generic relocation.
      
      Series-changes: 4
      - Add new patch to fix smdk6400 with generic relocation
      
      Change-Id: Ia60122d52023dd3d0e70e604c82ab9f77cf5efe9
      7b895833
    • Simon Glass's avatar
      mx31pdk: Modify to work with generic relocation · 8e7e55c0
      Simon Glass authored
      This adds a link symbol and updates the board Makefile so that it's
      SPL implementation will work with generic relocation.
      
      Series-changes: 4
      - Split out mx31pdk changes into new patch
      
      Change-Id: Ia7ae6f9a2237646509ef58b02557a608e6df236d
      8e7e55c0
    • Simon Glass's avatar
      hawkboard: Modify to work with generic relocation · cca3b03f
      Simon Glass authored
      Add use of common/ and lib/ libraries for the SPL stage, and
      add the new link symbol required for generic relocation.
      
      Series-changes: 4
      - Split out hawkboard changes into new patch
      
      Change-Id: I925b03bf21ac3b7970abd9a64ea89bd7d00bed55
      cca3b03f
    • Simon Glass's avatar
      tx25: Modify to work with generic relocation · b2bb315d
      Simon Glass authored
      Add use of common/ and lib/ libraries for the SPL stage, and
      add the new link symbol required for generic relocation.
      
      Series-changes: 4
      - Split out tx25 changes into new patch
      
      Change-Id: Ib486d0597d5a3aa8931d03a92dc39436ff9baa88
      b2bb315d
    • Simon Glass's avatar
      davinci: Use correct #ifdef around gdata/bdata · c13a2c46
      Simon Glass authored
      
      
      This fixes the following warnings in an SPL build when libcommon is
      in use:
      
      spl.c:37: warning: 'gdata' defined but not used
      spl.c:38: warning: 'bdata' defined but not used
      
      Series-changes: 4
      - Add new patch to fix davinci build warnings
      Acked-by: default avatarTom Rini <trini@ti.com>
      Change-Id: I8bb996c19d65209e4ca3fe2ff02f31564c72526e
      c13a2c46
    • Simon Glass's avatar
      arm: Add explicit __image_copy_end symbol for ARM926EJ-S · 78606184
      Simon Glass authored
      The start of the BSS is normally the end of the region in the image
      that must be copied for relocation to work. But for SPL this is apparently
      not always true, and ARMv7 has an explicit __image_copy_end symbol for
      this. Add this new symbol to ARM926EJ-S to support SPL under generic
      relocation.
      
      Change-Id: I70b26dac252bdf7594b2dc993967ac4872346fc2
      78606184
    • Simon Glass's avatar
      Move memcpy(), memset() into new lib/membasic.c · dcb04f80
      Simon Glass authored
      These basic functions are needed by relocation. To avoid bringing in all
      string.c functions (and the resulting code bloat for architectures where
      -ffunction-sections is not used), move these into their own file.
      
      Also tidy up the checkpatch warnings and function comments at the same
      time.
      
      I considered splitting these into two separate files, but I think that is
      overkill. The justification is that these two functions are needed
      regardless of what the 'user' code in U-Boot does, just to support
      relocation.
      
      Series-changes: 4
      - Add new patch to separate out memcpy(), memset()
      
      Change-Id: Ic4c3ce96ae5bbf18c3d01cfbbb07c3a2f858208b
      dcb04f80
    • Simon Glass's avatar
      arm: Add pivot_to_board_init_r() to each start.S · f083e899
      Simon Glass authored
      We don't want this in a common file, or at least not yet, so add
      this function to every start.S individually. The existing code tacked
      on the end of a long relocation function and does not suit our needs
      since it doesn't allow the address of board_init_r() to be passed in
      and cannot be called from C since it expects values in registers r4
      and above.
      
      Series-changes: 4
      - Split out start_call_board_init_r() addition into new patch
      - Put start_call_board_init_r() into each start.S, sadly
      
      Series-changes: 5
      - Rename start_call_board_init_r() to pivot_to_board_init_r()
      
      Change-Id: I7cfcb5c33fde35567a9d31689c8de51b669a6b8e
      f083e899
    • Simon Glass's avatar
      arm: Export and promote relocation symbols · 68623bb3
      Simon Glass authored
      These symbols are currently part-way through each file. Most have the same
      code, but there are small variations.
      
      We move all these relocation symbols to the start next to the other
      exported symbols, and export them so we can use them in generic relocation
      code.
      
      Series-changes: 4
      - Split out change to move relocation symbols to top of start.S files
      
      Change-Id: Ic476c8cdf1b9ce98d80cb0c4d8d64ded2ba4cfb4
      68623bb3
    • Simon Glass's avatar
      Add generic relocation feature · e1aba809
      Simon Glass authored
      Add a relocation implementation as the first thing in the generic board
      library. This library is needed by SPL also.
      
      We create a separate header file for link symbols defined by the link
      scripts. It is helpful to have these all in one place and try to
      make them common across architectures. Since Linux already has a similar
      file, we bring this in even though many of the symbols there are not
      relevant to us.
      
      The __relocate_code() function is what we expect all architectures which
      support relocation will use eventually. For now, they all override this
      with their own version.
      
      Note: The conflict with the generic board series is that the file
      include/asm-generic/sections.h is created in both. This should be easy
      to resolve once we know the order in which these series will be applied.
      
      Series-changes: 2
      - Import asm-generic/sections.h from Linux and add U-Boot extras
      - Squash generic link symbols patch into generic relocation patch
      - Move reloc.c into common/
      - Add function comments
      - Use memset, memcpy instead of inline code
      - Add README file for relocation
      
      Series-changes: 4
      - Use renamed start_call_board_init_r() function
      
      Series-changes: 5
      - Rename start_call_board_init_r() to pivot_to_board_init_r()
      
      Change-Id: I7963c3577e50d20e0190d2b6d8eb5c00ab9c9e74
      e1aba809
    • Simon Glass's avatar
      Define CONFIG_SYS_SKIP_RELOC for all archs · b5f457f0
      Simon Glass authored
      We are introducing a new generic relocation features and we want this to
      be the default. So we need to opt all architectures out first. Some may
      never have relocation, but those that do will eventually move over to
      this generic relocation framework.
      
      This is part of the unified board effort, but since we are only dealing
      with relocation in this series, CONFIG_SYS_SKIP_RELOC is more appropriate
      than CONFIG_SYS_LEGACY_BOARD.
      
      Series-changes: 2
      - Use CONFIG_SYS_SKIP_RELOC instead of CONFIG_SYS_LEGACY_BOARD
      
      Series-changes: 4
      - Capital D on Define of CONFIG_SYS_SKIP_RELOC commit message
      
      Change-Id: Ice8dd142d6da46633647f6484144edf8e18757e3
      b5f457f0
    • Simon Glass's avatar
      Create reloc.h and include it where needed · 91072549
      Simon Glass authored
      Before adding new relocation functions, move this prototype out of
      common.h where things are pretty crowded.
      
      Series-changes: 4
      - Rebase to master
      
      Change-Id: I12ce3a87fb5a56bf33189fd71f36f37d6e2f407a
      91072549
    • Andy Fleming's avatar
      Allow for parallel builds and saved output · 3f056131
      Andy Fleming authored and Simon Glass's avatar Simon Glass committed
      
      
      The MAKEALL script cleverly runs make with the appropriate options
      to use all of the cores on the system, but your average U-Boot build
      can't make much use of more than a few cores.  If you happen to have
      a many-core server, your builds will leave most of the system idle.
      
      In order to make full use of such a system, we need to build multiple
      targets in parallel, and this requires directing make output into
      multiple directories. We add a BUILD_NBUILDS variable, which allows
      users to specify how many builds to run in parallel.
      When BUILD_NBUILDS is set greater than 1, we redefine BUILD_DIR for
      each build to be ${BUILD_DIR}/${target}. Also, we make "./build" the
      default BUILD_DIR when BUILD_NBUILDS is greater than 1.
      
      MAKEALL now tracks which builds are still running, and when one
      finishes, it starts a new build.
      Series-to: arch
      
      Once each build finishes, we run "make tidy" on its directory, to reduce
      the footprint.
      
      As a result, we are left with a build directory with all of the built
      targets still there for use, which means anyone who wanted to use
      MAKEALL as part of a test harness can now do so.
      Signed-off-by: default avatarAndy Fleming <afleming@freescale.com>
      
      Don't delete log dirs before each run
      
      Change-Id: I6615ed874da29464476e86619b01364044098186
      3f056131
    • Simon Glass's avatar
      ppc: Change memsz variable to signed char · 9ebc5098
      Simon Glass authored
      
      
      This seems to be unsigned char for no good reason. Tidy this up and
      remove the casts.
      
      Series-to: u-boot
      Series-cc: wolfgang
      Series-version: 3
      Cover-letter:
      Fix a few warnings that bug me
      This series fixes some warnings which seem to still be left over from
      all the warning-squashing efforts for 2011.12. If patches exist for some
      of these already then please ignore.
      
      The alias problem in USB is a bit odd, since I thought it was already
      fixed. But perhaps it has come back.
      END
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      Change-Id: Iab1c78d8c62de7cc454ce11d091555d3f6f071f4
      9ebc5098
    • Simon Glass's avatar
      m68k: Change memsz to a signed char to avoid warning · c06d6ded
      Simon Glass authored
      
      
      There doesn't seem to be any reason for using uchar here, so change it
      to char. This fixes a warning:
      
      pointer targets in passing argument 1 of 'sprintf' differ in signedness
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      Change-Id: I265a6f1012ef6b40c449bd5b707f279c41851afc
      c06d6ded
    • Simon Glass's avatar
      Remove CONFIG_SYS_EXTBDINFO from snapper9260.h · c01428aa
      Simon Glass authored
      This feature is not available on ARM, so it is an error to define it.
      
      Change-Id: I9a522a38b319fae8a7abdad73c3e2e4f7514c79f
      c01428aa
    • Simon Glass's avatar
      sandbox: Add required header to os.c · 7c28d6dc
      Simon Glass authored
      We should include the sys/time.h header to avoid warnings.
      
      Cc: mikef
      Series-changes: 2
      - Rebase after changes to sandbox header sort patch
      
      Change-Id: I6cd2eab8a2eb2366f0d669c365f3d74499322329
      7c28d6dc
    • Simon Glass's avatar
      sandbox: sort header files in os.c · 14e60124
      Simon Glass authored
      Tidy this up as the list is long and likely to get longer.
      
      Cc: mikef
      Series-changes: 2
      - Sort correctly: include/, sys/, linux/, asm/
      
      Series-changes: 3
      - Keep 'U-Boot header' separate at the end
      
      Change-Id: If25df49acea6ae4aabab9236d153698db027f10a
      14e60124
    • Simon Glass's avatar
      ppc4xx: Fix strict-aliasing warnings in usb_ohci.c · 7d646979
      Simon Glass authored
      This fixes warnings seen with my gcc 4.6.
      
      usb_ohci.c: In function 'submit_control_msg':
      usb_ohci.c:1046: warning: dereferencing pointer 'data_buf.70' does break
      strict-aliasing rules
      usb_ohci.c:1046: note: initialized from here
      usb_ohci.c:1048: warning: dereferencing pointer 'data_buf.70' does break
      strict-aliasing rules
      usb_ohci.c:1048: note: initialized from here
      usb_ohci.c:1050: warning: dereferencing pointer 'data_buf.70' does break
      strict-aliasing rules
      
      Change-Id: Id45cccd27250188c21c52fd4b440fd40e9ea1e21
      7d646979
    • Simon Glass's avatar
      mpc5xxx: Fix strict-aliasing warnings in usb_ohci.c · 342a5591
      Simon Glass authored
      This fixes warnings seen with my gcc 4.6.
      
      usb_ohci.c: In function 'submit_control_msg':
      usb_ohci.c:1041: warning: dereferencing pointer 'data_buf.70' does break
       strict-aliasing rules
      usb_ohci.c:1041: note: initialized from here
      usb_ohci.c:1043: warning: dereferencing pointer 'data_buf.70' does break
       strict-aliasing rules
      usb_ohci.c:1043: note: initialized from here
      usb_ohci.c:1045: warning: dereferencing pointer 'data_buf.70' does break
       strict-aliasing rules
      
      Change-Id: If30cbe85fa2c1ca542215d538f00eea5a03e5966
      342a5591
    • Simon Glass's avatar
      Fix strict-aliasing warning in dlmalloc · 86381dd8
      Simon Glass authored
      This fixes the following warnings in dlmalloc seen with my gcc 4.6.
      
      dlmalloc.c: In function 'malloc_bin_reloc':
      dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules
      dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules
      dlmalloc.c:1490: note: initialized from here
      dlmalloc.c:1493: note: initialized from here
      
      Change-Id: I206bc05777fd6c320da57660ce144d328fd8b2d7
      86381dd8
    • Simon Glass's avatar
      usb: Fix strict-aliasing warning in host/ohci-hcd.c · 16a2edc3
      Simon Glass authored
      This fixes these warnings seen with my gcc 4.6 compiler.
      
      ohci-hcd.c: In function 'submit_control_msg':
      ohci-hcd.c:1307: warning: dereferencing pointer 'pretmp.729' does break strict-aliasing rules
      cc1: note: initialized from here
      ohci-hcd.c:1310: warning: dereferencing pointer 'pretmp.729' does break strict-aliasing rules
      cc1: note: initialized from here
      ohci-hcd.c:1313: warning: dereferencing pointer 'pretmp.729' does break strict-aliasing rules
      
      Change-Id: I33217d1bdfebf723e4a3d25e0c8a11de79811ba3
      16a2edc3
  5. 20 Feb, 2012 10 commits
  6. 18 Feb, 2012 2 commits
    • Linus Walleij's avatar
      integrator: update the Integrator/CP config · 4608adb8
      Linus Walleij authored
      
      
      The Integrator/CP config file was very outdated and gives a
      non functional U-Boot. So:
      
      - Set the CONFIG_ARCH_CINTEGRATOR arch flag correctly
      - Add proper core module configuration options
      - Skip cluttered command lista and just include
        <config_cmd_default.h>
      - Kill off #if 0 network section and insert some example
        configuration that simply just boots from the network
        using TFTP if available.
      - Delete flash control registers that have no business
        in this config file. These are already moved down to
        board/armltd/integrator/integrator-sc.h
      
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      4608adb8
    • Linus Walleij's avatar
      integrator: rewrite the AP PCI driver · 3c8ed26b
      Linus Walleij authored
      
      
      The PCI support for the Integrator AP has apparently never
      been finished and I strongly suspect that it has never worked,
      so let's fix it. This is a list of the more or less
      un-splittable changes done in this driver rewrite:
      
      - Replace the register definitions stashed into the config
        file (!) with a copy if the register file from the Linux
        kernels arch/arm/include/asm/hardware/pci_v3.h
      
      - Delete the unreadable gigantic macros that perform the
        config accesses and replace them with copyedited code from
        Linux arch/arm/mach-integrator/pci_v3.c
      
      - Rewrite the rest of the setup code to use the
        v3_[read|write][lwb]() accessors.
      
      - Enable PCI by default in the AP board configuration.
      
      - Fix checkpatch warnings and make code more conformant.
      Tested-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      3c8ed26b