23 Nov, 2014

1 commit

  • Provide a new modifier to vsprintf() to print phys_addr_t variables to
    avoid having to cast or #ifdef when printing them out. The %pa modifier
    is used for this purpose, so phys_addr_t variables need to be passed by
    reference, like so:

    phys_addr_t start = 0;

    printf("start: %pa\n", &start);

    Depending on the size of phys_addr_t this will print out the address
    with 8 or 16 hexadecimal digits following a 0x prefix.

    Signed-off-by: Thierry Reding
    Tested-by: Stephen Warren
    Signed-off-by: Simon Glass

    Thierry Reding
     

21 Nov, 2014

2 commits

  • U-Boot has imported various utility macros from Linux
    scattering them to various places without consistency.

    In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
    container_of, DIV_ROUND_UP, etc.
    In include/linux/compat.h are min_t, max_t, round_up, round_down,
    etc.
    We also have duplicated defines of min_t in some *.c files.

    Moreover, we are suffering from too cluttered include/common.h.

    This commit moves various macros that originate in
    include/linux/kernel.h of Linux to their original position.

    Note:
    This commit simply moves the macros; the macros roundup,
    min, max, min2, max3, ARRAY_SIZE are different
    from those of Linux at this point.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • The Linux-compatible macro DIV_ROUND_CLOSEST is a bit more flexible
    and safer than DIV_ROUND.

    For example,
    foo = DIV_ROUND_CLOSEST(x, y++)
    works expectedly, but
    foo = DIV_ROUND(x, y++)
    does not. (y is incremented twice.)

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

27 Oct, 2014

3 commits


25 Oct, 2014

1 commit


24 Oct, 2014

2 commits

  • The private libgcc is supported only on ARM, MIPS, PowerPC, SH, x86.
    Those architectures should "select" HAVE_PRIVATE_LIBGCC and
    CONFIG_USE_PRIVATE_LIBGCC should depend on it.

    Currently, this option is enabled on Tegra boards and x86 architecture.
    Move the definition from header files to Kconfig.

    Signed-off-by: Masahiro Yamada
    Tested-by: Simon Glass
    Acked-by: Simon Glass
    Cc: Stephen Warren
    Cc: Tom Warren

    Masahiro Yamada
     
  • CONFIG_SYS_HZ is always defined as 1000 in config_fallbacks.h
    (but some boards still have redundant definitions).

    This commit moves the definition and the document in README to
    Kconfig. Since lib/Kconfig can assure that CONFIG_SYS_HZ is 1000,
    the sanity check in lib/time.c should be removed.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Marek Vasut

    Masahiro Yamada
     

23 Oct, 2014

9 commits


25 Sep, 2014

2 commits


17 Sep, 2014

1 commit

  • U-Boot has imported various source files from other projects,
    mostly Linux.

    Something like

    #ifdef __UBOOT__
    [ modification for U-Boot ]
    #else
    [ original code ]
    #endif

    is an often used strategy for clarification of adjusted parts,
    that is, easier re-sync in future.

    Instead of defining __UBOOT__ in each source file,
    passing it from the top Makefile would be easier.

    Signed-off-by: Masahiro Yamada
    Acked-by: Marek Vasut
    Acked-by: Heiko Schocher

    Masahiro Yamada
     

14 Sep, 2014

1 commit


11 Sep, 2014

1 commit


05 Sep, 2014

2 commits


26 Aug, 2014

3 commits

  • - 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: Heiko Schocher
    Cc: Marek Vasut
    Cc: Anatolij Gustschin
    [trini: Add spin_lock_irqsave/spin_unlock_irqrestore dummies from
    usb/lin_gadet_compat.h]
    Signed-off-by: Tom Rini

    Heiko Schocher
     
  • from linux 3.14:

    commit 455c6fdbd219161bd09b1165f11699d6d73de11c
    Author: Linus Torvalds
    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
    headers.

    Signed-off-by: Heiko Schocher
    Cc: Marek Vasut
    Cc: Sergey Lapin
    Cc: Scott Wood
    Cc: Tom Rini

    Heiko Schocher
     
  • resync with linux:

    commit 455c6fdbd219161bd09b1165f11699d6d73de11c
    Author: Linus Torvalds
    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, changed the license file header,
    and add in the c-file:

    +#define __UBOOT__
    #include
    +#ifndef __UBOOT__
    #include
    +#else
    +#include
    +#endif

    so, it compiles for U-Boot.

    Signed-off-by: Heiko Schocher
    Cc: Marek Vasut
    Cc: Sergey Lapin
    Cc: Scott Wood
    Cc: Tom Rini

    Heiko Schocher
     

09 Aug, 2014

4 commits

  • If a 32-bit system has 2GB of RAM, and the base address of that RAM is
    2GB, then start+size will overflow a 32-bit value (to a value of 0).

    __lmb_alloc_base is affected by this; it calculates the minimum of
    (start+size of RAM) and max_addr. However, when start+size is 0, it
    is always less than max_addr, which causes the value of max_addr not
    to be taken into account when restricting the allocation's location.

    Fix this by calculating start+size separately, and if that calculation
    underflows, using -1 (interpreted as the max unsigned value) as the
    value instead, and then taking the min of that and max_addr. Now that
    start+size doesn't overflow, it's typically large, and max_addr
    dominates the min() call, and is taken into account.

    The user-visible symptom of this bug is that CONFIG_BOOTMAP_SZ is ignored
    on Tegra124 systems with 2GB of RAM, which in turn causes the DT to be
    relocated at the very end of RAM, which the ARM Linux kernel doesn't map
    during early boot, and which causes boot failures. With this fix,
    CONFIG_BOOTMAP_SZ correctly restricts the relocated DT to a much lower
    address, and everything works.

    Signed-off-by: Stephen Warren

    Stephen Warren
     
  • 1. Failure to set the return code correctly
    2. Failure to detect the loop end condition when the value is equal to
    the modulus.

    Reported-by: Jeroen Hofstee
    Signed-off-by: Simon Glass

    Simon Glass
     
  • This brings in changes up to commit f9e91a48 in the libfdt repo.
    Mostly this is whitespace/minor changes. But there are a few new
    features:

    - fdt_size_cells() and fdt_address_cells()
    - fdt_resize()

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Remove the verified boot limitation that only allows a single
    RSA public exponent of 65537 (F4). This change allows use with
    existing PKI infrastructure and has been tested with HSM-based
    PKI.

    Change the configuration OF tree format to store the RSA public
    exponent as a 64 bit integer and implement backward compatibility
    for verified boot configuration trees without this extra field.

    Parameterise vboot_test.sh to test different public exponents.

    Mathematics and other hard work by Andrew Bott.

    Tested with the following public exponents: 3, 5, 17, 257, 39981,
    50457, 65537 and 4294967297.

    Signed-off-by: Andrew Bott
    Signed-off-by: Andrew Wishart
    Signed-off-by: Neil Piercy
    Signed-off-by: Michael van der Westhuizen
    Cc: Simon Glass

    Michael van der Westhuizen
     

23 Jul, 2014

3 commits

  • This simple function returns the node offset of a named alias.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Aliases are used to provide U-Boot's numbering of devices, such as:

    aliases {
    spi0 = "/spi@12330000";
    }

    spi@12330000 {
    ...
    }

    This tells us that the SPI controller at 12330000 is considered to be the
    first SPI controller (SPI 0). So we have a numbering for the SPI node.

    Add a function that returns the numbering for a node assume that it exists
    in the list of aliases.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • If we are to have driver model before relocation we need to support some
    way of calling memory allocation routines.

    The standard malloc() is pretty complicated:

    1. It uses some BSS memory for its state, and BSS is not available before
    relocation

    2. It supports algorithms for reducing memory fragmentation and improving
    performace of free(). Before relocation we could happily just not support
    free().

    3. It includes about 4KB of code (Thumb 2) and 1KB of data. However since
    this has been loaded anyway this is not really a problem.

    The simplest way to support pre-relocation malloc() is to reserve an area
    of memory and allocate it in increasing blocks as needed. This
    implementation does this.

    To enable it, you need to define the size of the malloc() pool as described
    in the README. It will be located above the pre-relocation stack on
    supported architectures.

    Note that this implementation is only useful on machines which have some
    memory available before dram_init() is called - this includes those that
    do no DRAM init (like tegra) and those that do it in SPL (quite a few
    boards). Enabling driver model preior to relocation for the rest of the
    boards is left for a later exercise.

    Signed-off-by: Simon Glass

    Simon Glass
     

22 Jul, 2014

2 commits

  • When this option is enabled, CRLF is treated like LF when importing environments
    from text files, which means CRs ('\r') in front of LFs ('\n') are just ignored.

    Drawback of enabling this option is that (maybe exported) variables which have
    a trailing CR in their content will get imported without that CR. But this
    drawback is very unlikely and the big advantage of letting Windows user create
    a *working* uEnv.txt too is likely more welcome.

    Signed-off-by: Alexander Holler

    Alexander Holler
     
  • As I initially suspected overflow in time handling, I took a detailed
    look at lib/time.c. This adds comments about units being used, reduces
    amount of type casting being done, and makes __udelay() always wait at
    least one tick. (Current code could do no delaying at all for short
    delays).

    Signed-off-by: Pavel Machek

    Pavel Machek
     

19 Jul, 2014

3 commits