1. 21 Jul, 2015 2 commits
  2. 23 Apr, 2015 1 commit
  3. 11 Dec, 2014 1 commit
    • Przemyslaw Marczak's avatar
      lib: errno: introduce errno_str(): returns errno related message · 59345b1f
      Przemyslaw Marczak authored
      The functions error's numbers are standarized - but the error
      messages are not.
      The errors are often handled with unclear error messages,
      so why not use an errno standarized messages.
      - This could decrease the binary size.
      - Appended with a detailed information,
        the error message will be clear.
      This commit introduces new function:
      - const char *errno_to_str(int errno)
      The functions returns a pointer to the errno corresponding text message:
      - if errno is null or positive number - a pointer to "Success" message
      - if errno is negative - a pointer to errno related message
      Signed-off-by: default avatarPrzemyslaw Marczak <p.marczak@samsung.com>
      Reviewed-by: default avatarTom Rini <trini@ti.com>
  4. 08 Dec, 2014 3 commits
  5. 25 Aug, 2014 2 commits
    • Heiko Schocher's avatar
      lib, linux: move linux specific defines to linux/compat.h · 0c06db59
      Heiko Schocher authored
      - move linux specific defines from usb and video code
        into linux/compat.h
      - move common linux specific defines from include/ubi_uboot.h
        to linux/compat.h
      - add for new mtd/ubi/ubifs sync new needed linux specific
        defines to linux/compat.h
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Anatolij Gustschin <agust@denx.de>
      [trini: Add spin_lock_irqsave/spin_unlock_irqrestore dummies from
      Signed-off-by: default avatarTom Rini <trini@ti.com>
    • Heiko Schocher's avatar
      lib, list_sort: add list_sort from linux 3.14 · c068d44a
      Heiko Schocher authored
      from linux 3.14:
      commit 455c6fdbd219161bd09b1165f11699d6d73de11c
      Author: Linus Torvalds <torvalds@linux-foundation.org>
      Date:   Sun Mar 30 20:40:15 2014 -0700
          Linux 3.14
      Needed for the MTD/UBI/UBIFS resync
      Just copied the files from Linux, and added in the c-file
      the "#define __UBOOT__" for adding U-Boot special code. In
      this case we use this just for adding including U-Boot
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Sergey Lapin <slapin@ossfans.org>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Tom Rini <trini@ti.com>
  6. 23 Jun, 2014 1 commit
    • Heiko Schocher's avatar
      lib, fdt: move fdtdec_get_int() out of lib/fdtdec.c · b047d671
      Heiko Schocher authored
      move fdtdec_get_int() out of lib/fdtdec.c into lib/fdtdec_common.c
      as this function is also used, if CONFIG_OF_CONTROL is not
      used. Poped up on the ids8313 board using signed FIT images,
      and activating CONFIG_SYS_GENERIC_BOARD. Without this patch
      it shows on boot:
      No valid FDT found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>
      With this patch, it boots again with CONFIG_SYS_GENERIC_BOARD
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      Cc: Tom Rini <trini@ti.com>
  7. 23 May, 2014 1 commit
  8. 02 Apr, 2014 2 commits
    • Przemyslaw Marczak's avatar
      lib: uuid: add functions to generate UUID version 4 · 4e4815fe
      Przemyslaw Marczak authored
      This patch adds support to generate UUID (Universally Unique Identifier)
      in version 4 based on RFC4122, which is randomly.
      Source: https://www.ietf.org/rfc/rfc4122.txt
      - new configs:
        - CONFIG_LIB_UUID for compile lib/uuid.c
        - CONFIG_RANDOM_UUID for functions gen_rand_uuid() and gen_rand_uuid_str()
      - add configs dependency to include/config_fallbacks.h for lib uuid.
      - add gen_rand_uuid() - this function writes 16 bytes len binary representation
        of UUID v4 to the memory at given address.
      - add gen_rand_uuid_str() - this function writes 37 bytes len hexadecimal
        ASCII string representation of UUID v4 to the memory at given address.
      Signed-off-by: default avatarPrzemyslaw Marczak <p.marczak@samsung.com>
      Cc: Stephen Warren <swarren@nvidia.com>
      Cc: Lukasz Majewski <l.majewski@samsung.com>
      [trini: Add CONFIG_EFI_PARTITION to fallbacks]
      Signed-off-by: default avatarTom Rini <trini@ti.com>
    • Przemyslaw Marczak's avatar
      part_efi: move uuid<->string conversion functions into lib/uuid.c · a96a0e61
      Przemyslaw Marczak authored
      This commit introduces cleanup for uuid library.
      - move uuid<->string conversion functions into lib/uuid.c so they can be
        used by code outside part_efi.c.
      - rename uuid_string() to uuid_bin_to_str() for consistency with existing
      - add an error return code to uuid_str_to_bin()
      - update existing code to the new library functions.
      Signed-off-by: default avatarPrzemyslaw Marczak <p.marczak@samsung.com>
      Cc: Stephen Warren <swarren@nvidia.com>
      Cc: Lukasz Majewski <l.majewski@samsung.com>
      Cc: trini@ti.com
  9. 28 Mar, 2014 1 commit
    • Przemyslaw Marczak's avatar
      lib: rand: introduce new configs: CONFIG_LIB_RAND and CONFIG_LIB_HW_RAND · 3c1c68cc
      Przemyslaw Marczak authored
      New configs:
      - CONFIG_LIB_RAND    - to enable implementation of rand library in lib/rand.c
      - CONFIG_LIB_HW_RAND - to enable hardware based implementations of lib rand
      Other changes:
      - add CONFIG_LIB_RAND to boards configs which needs rand()
      - put only one rand.o dependency in lib/Makefile
      CONFIG_LIB_HW_RAND should be defined for drivers which implements rand library
      (declared in include/common.h):
      - void srand(unsigned int seed)
      - unsigned int rand(void)
      - unsigned int rand_r(unsigned int *seedp)
      Signed-off-by: default avatarPrzemyslaw Marczak <p.marczak@samsung.com>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Tom Rini <trini@ti.com>
      Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
  10. 07 Mar, 2014 1 commit
    • Masahiro Yamada's avatar
      kbuild, blackfin: Add CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED · e91df49f
      Masahiro Yamada authored
      Many (but not all) of Blackfin boards give -O2 option
      to compile under lib/ directory.
      That means lib/ should be speed-optimized,
      whereas other parts should be size-optimized.
      We want to keep the same behavior,
      but do not want to parse board/*/config.mk again and again.
      We've got no choice but to invent a new method.
      CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED, if it is enabled,
      gives -O2 flag only for building under lib/ directory.
      Dirty codes which I had marked as "FIX ME"
      in board/${BOARD}/config.mk have been deleted.
      defined in include/configs/${BOARD}.h.
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Cc: Sonic Zhang <sonic.zhang@analog.com>
  11. 26 Feb, 2014 1 commit
    • Tom Rini's avatar
      arm: Switch to -mno-unaligned-access when supported by the compiler · 1551df35
      Tom Rini authored
      When we tell the compiler to optimize for ARMv7 (and ARMv6 for that
      matter) it assumes a default of SCTRL.A being cleared and unaligned
      accesses being allowed and fast at the hardware level.  We set this bit
      and must pass along -mno-unaligned-access so that the compiler will
      still breakdown accesses and not trigger a data abort.
      To better help understand the requirements of the project with respect
      to unaligned memory access, the
      Documentation/unaligned-memory-access.txt file has been added as
      doc/README.unaligned-memory-access.txt and is taken from the v3.14-rc1
      tag of the kernel.
      Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
      Cc: Mans Rullgard <mans@mansr.com>
      Signed-off-by: default avatarTom Rini <trini@ti.com>
  12. 19 Feb, 2014 2 commits
    • Masahiro Yamada's avatar
      kbuild: use Linux Kernel build scripts · 6825a95b
      Masahiro Yamada authored
      Now we are ready to switch over to real Kbuild.
      This commit disables temporary scripts:
        scripts/{Makefile.build.tmp, Makefile.host.tmp}
      and enables real Kbuild scripts:
      This switch is triggered by the line in scripts/Kbuild.include
        -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
        +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
      We need to adjust some build scripts for U-Boot.
      But smaller amount of modification is preferable.
      Additionally, we need to fix compiler flags which are
      locally added or removed.
      In Kbuild, it is not allowed to change CFLAGS locally.
      Instead, ccflags-y, asflags-y, cppflags-y,
      CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
      are prepared for that purpose.
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Tested-by: default avatarGerhard Sittig <gsi@denx.de>
    • Masahiro Yamada's avatar
      kbuild: change out-of-tree build · 9e414032
      Masahiro Yamada authored
      This commit changes the working directory
      where the build process occurs.
      Before this commit, build process occurred under the source
      tree for both in-tree and out-of-tree build.
      That's why we needed to add $(obj) prefix to all generated
      files in makefiles like follows:
        $(obj)u-boot.bin:  $(obj)u-boot
      Here, $(obj) is empty for in-tree build, whereas it points
      to the output directory for out-of-tree build.
      And our old build system changes the current working directory
      with "make -C <sub-dir>" syntax when descending into the
      On the other hand, Kbuild uses a different idea
      to handle out-of-tree build and directory descending.
      The build process of Kbuild always occurs under the output tree.
      When "O=dir/to/store/output/files" is given, the build system
      changes the current working directory to that directory and
      restarts the make.
      Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>"
      syntax for descending into sub-directories.
      (We can write it like "make $(obj)=<sub-dir>" with a shorthand.)
      This means the current working directory is always the top
      of the output directory.
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Tested-by: default avatarGerhard Sittig <gsi@denx.de>
  13. 09 Jan, 2014 1 commit
  14. 25 Nov, 2013 1 commit
  15. 31 Oct, 2013 1 commit
  16. 24 Jul, 2013 1 commit
  17. 26 Jun, 2013 1 commit
    • Simon Glass's avatar
      Add trace library · b2e16a85
      Simon Glass authored
      Add a library which supports tracing of execution using built-in gcc
      features and a microsecond timer. This can be used to record a list of
      function which are executed, along with a timestamp for each. Later
      this information can be sent to the host for processing.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
  18. 20 Jun, 2013 1 commit
  19. 05 May, 2013 1 commit
    • Mike Dunn's avatar
      lib: import bitrev library from the linux kernel · 0dd9c7a9
      Mike Dunn authored
      This patch adds the bitrev library from the linux kernel.  This is a simple
      algorithm that uses an 8 bit look-up table to reverse the bits in data types of
      8, 16, or 32 bit widths.  The docg4 nand flash driver uses it.
      [port from linux kernel v3.9 commit 7ee32a6d30d1c8a3b7a07a6269da8f0a08662927]
      [originally added: v2.6.20 by commit a5cfc1ec58a07074dacb6aa8c79eff864c966d12]
      Signed-off-by: default avatarMike Dunn <mikedunn@newsguy.com>
  20. 01 May, 2013 2 commits
    • Andreas Bießmann's avatar
      lib: consolidate hang() · d2eae43b
      Andreas Bießmann authored
      Delete all occurrences of hang() and provide a generic function.
      Signed-off-by: default avatarAndreas Bießmann <andreas.devel@googlemail.com>
      Acked-by: default avatarAlbert ARIBAUD <albert.u.boot@aribaud.net>
      [trini: Modify check around puts() in hang.c slightly]
      Signed-off-by: default avatarTom Rini <trini@ti.com>
    • Wolfgang Denk's avatar
      Add SLRE - Super Light Regular Expression library · a5ecbe62
      Wolfgang Denk authored
      Downloaded from http://slre.sourceforge.net/
      and adapted for U-Boot environment.
      Used to implement regex operations on environment variables.
      Code size is ~ 3.5 KiB on PPC.
      To enable this code, define the  CONFIG_REGEX  option in your board
      config file.
      Note:  There are more recent versions of the SLRE library available at
       ; unfortunately, the new code has a heavily
      reorked API which makes it less usable for our purposes:
      - the return code is strings, which are more difficult to process
      - we don't get any information any more which sub-string of the data
        was matched by the given regex
      - it is much more cumbersome to work with arbitrary expressions, where
        for example the number of substrings for capturing are not known at
        compile time
      Also, there does not seem to be any real changes or improvements of
      the functionality.
      Because of this, we deliberately stick with the older code.
      Note 2: the test code (built when SLRE_TEST is defined) was modified
      to allow for more extensive testing; now we can test the regexp
      matching on all lines on a text file (instead of the whole data in the
      file as a single block).
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
  21. 12 Apr, 2013 1 commit
    • Che-liang Chiou's avatar
      tpm: Add TPM command library · 8732b070
      Che-liang Chiou authored
      TPM command library implements a subset of TPM commands defined in TCG
      Main Specification 1.2 that are useful for implementing secure boot.
      More TPM commands could be added out of necessity.
      You may exercise these commands through the 'tpm' command.  However, the
      raw TPM commands are too primitive for writing secure boot in command
      interpreter scripts; so the 'tpm' command also provides helper functions
      to make scripting easier.
      For example, to define a counter in TPM non-volatile storage and
      initialize it to zero:
      $ tpm init
      $ tpm startup TPM_ST_CLEAR
      $ tpm nv_define d 0x1001 0x1
      $ tpm nv_write d 0x1001 0
      And then increment the counter by one:
      $ tpm nv_read d 0x1001 i
      $ setexpr.l i $i + 1
      $ tpm nv_write d 0x1001 $i
      Signed-off-by: default avatarChe-Liang Chiou <clchiou@chromium.org>
  22. 08 Apr, 2013 1 commit
    • Andreas Bießmann's avatar
      omap_gpmc: add support for hw assisted BCH8 · 4a093006
      Andreas Bießmann authored
      The kernel states:
      The OMAP3 GPMC hardware BCH engine computes remainder polynomials, it does not
      provide automatic error location and correction: this step is implemented using
      the BCH library.
      And we do so in u-boot.
      This implementation uses the same layout for BCH8 but it is fix. The current
      provided layout does only work with 64 Byte OOB.
      Signed-off-by: default avatarAndreas Bießmann <andreas.devel@googlemail.com>
      Cc: Tom Rini <trini@ti.com>
      Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mansoor Ahamed <mansoor.ahamed@ti.com>
      Cc: Thomas Weber <thomas.weber.linux@googlemail.com>
  23. 15 Mar, 2013 1 commit
  24. 13 Dec, 2012 1 commit
  25. 06 Dec, 2012 1 commit
  26. 15 Oct, 2012 1 commit
    • Albert ARIBAUD's avatar
      ARM: prevent misaligned array inits · b823fd9b
      Albert ARIBAUD authored
      Under option -munaligned-access, gcc can perform local char
      or 16-bit array initializations using misaligned native
      accesses which will throw a data abort exception. Fix files
      where these array initializations were unneeded, and for
      files known to contain such initializations, enforce gcc
      option -mno-unaligned-access.
      Signed-off-by: default avatarAlbert ARIBAUD <albert.u.boot@aribaud.net>
      [trini: Switch to usign call cc-option for -mno-unaligned-access as
      Albert had done previously as that's really correct]
      Signed-off-by: default avatarTom Rini <trini@ti.com>
  27. 01 Oct, 2012 1 commit
  28. 29 Sep, 2012 1 commit
  29. 07 Jul, 2012 3 commits
  30. 15 May, 2012 1 commit
  31. 29 Mar, 2012 1 commit
    • Simon Glass's avatar
      fdt: Add tests for fdtdec · dc254f38
      Simon Glass authored
      The fdtdec_find_aliases_for_id() function is complicated enough that
      it really should have some tests. This does not necessarily need to be
      committed to U-Boot, but it might be useful.
      (note there are a few minor inconsistencies with this patch which will be
      cleaned up when the USB series is applied)
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarTom Warren <twarren@nvidia.com>