12 May, 2017

3 commits


10 May, 2017

2 commits

  • In some boards like the Raspberry Pi the initial bootloader will pass
    a DT to the kernel. When using U-Boot as such kernel, the board code in
    U-Boot should be able to provide U-Boot with this, already assembled
    device tree blob.

    This patch introduces a new config option CONFIG_OF_BOARD to use instead
    of CONFIG_OF_EMBED or CONFIG_OF_SEPARATE which will initialize the DT
    from a board-specific funtion instead of bundling one with U-Boot or as
    a separated file. This allows boards like the Raspberry Pi to reuse the
    device tree passed from the bootcode.bin and start.elf firmware
    files, including the run-time selected device tree overlays.

    Signed-off-by: Alex Deymo
    Reviewed-by: Simon Glass

    Alex Deymo
     
  • A common use of memmove() can be handled by memcpy(). Also memcpy()
    includes an optimisation for large sizes: it copies a word at a time. So
    we can get a speed-up by calling memcpy() to handle our move in this case.

    Update memmove() to call memcpy() if the destination is before the source.

    Signed-off-by: Simon Glass
    Reviewed-by: Tom Rini

    Simon Glass
     

06 May, 2017

1 commit


30 Apr, 2017

1 commit


14 Apr, 2017

4 commits


13 Apr, 2017

3 commits

  • Sync with Linux commit ad0376eb1483b ("Merge tag 'edac_for_4.11_2'").

    Signed-off-by: Peng Fan
    Cc: Tom Rini

    Peng Fan
     
  • Add support for %p, %pa[p], %pM, %pm and %pI4 formats to tiny-printf.
    %pM and %pI4 are widely used by SPL networking stack and is required if
    networking support is desired in SPL.
    %p, %pa and %pap are mostly used by debug prints and hence supported
    only when DEBUG is enabled.

    Before this patch:
    $ size spl/u-boot-spl
    text data bss dec hex filename
    99325 4899 218584 322808 4ecf8 spl/u-boot-spl

    After this patch (with CONFIG_SPL_NET_SUPPORT):
    $ size spl/u-boot-spl
    text data bss dec hex filename
    99666 4899 218584 323149 4ee4d spl/u-boot-spl

    So, this patch adds ~350 bytes to code size.

    If CONFIG_SPL_NET_SUPPORT is not enabled, this adds ~25 bytes.

    If CONFIG_USE_TINY_PRINTF is disabled then:
    $ size spl/u-boot-spl
    text data bss dec hex filename
    101116 4899 218584 324599 4f3f7 spl/u-boot-spl

    So, there is still ~1.4K space saved even with support for %pM/%pI4.

    Compiler used is to build is:
    arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016

    Signed-off-by: Vignesh R
    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass

    Vignesh R
     
  • aes.h is a too generic name if this file can
    be exported and used by a program.
    Rename it to avoid any conflicts with
    other files (for example, from openSSL).

    Signed-off-by: Stefano Babic

    Stefano Babic
     

11 Apr, 2017

2 commits

  • For some reason Python 3 seems to think it does not need to build
    the library. Using the --force parameter makes sure that the library
    gets built always. This is especially important since we move the
    library in the next step of the Makefile, hence forcing a rebuild
    every time the higher level Makefile triggers a rebuild is required
    to make sure the library is always there.

    Signed-off-by: Stefan Agner
    Acked-by: Simon Glass

    Stefan Agner
     
  • This a few minor changes down from upstream since the last sync.

    Signed-off-by: Simon Glass

    Simon Glass
     

07 Apr, 2017

3 commits


05 Apr, 2017

1 commit

  • Most of the time the optimised memset() is what we want. For extreme
    situations such as TPL it may be too large. For example on the 'rock'
    board, using a simple loop saves a useful 48 bytes. With gcc 4.9 and
    the rodata bug, this patch is enough to reduce the TPL image below the
    limit.

    Signed-off-by: Simon Glass
    Reviewed-by: Heiko Stuebner

    Simon Glass
     

27 Mar, 2017

2 commits

  • If we want to load a key into a TPM, we need to know the designated parent
    key's handle, so that the TPM is able to insert the key at the correct place in
    the key hierarchy.

    However, if we want to load a key whose designated parent key we also
    previously loaded ourselves, we first need to memorize this parent key's handle
    (since the handles for the key are chosen at random when they are inserted into
    the TPM). If we are, however, unable to do so, for example if the parent key is
    loaded into the TPM during production, and its child key during the actual
    boot, we must find a different mechanism to identify the parent key.

    To solve this problem, we add a function that allows U-Boot to load a key into
    the TPM using their designated parent key's SHA1 hash, and the corresponding
    auth data.

    Signed-off-by: Mario Six
    Reviewed-by: Simon Glass

    mario.six@gdsys.cc
     
  • Use CONFIG_IS_ENABLED() macro to check whether OF_TRANSLATE is enabled, so
    that code block is compiled irrespective of SPL or U-Boot build
    and fdt address translation is used.

    Signed-off-by: Vignesh R

    Vignesh R
     

21 Mar, 2017

1 commit

  • The CAAM in IMX parts doesn't support public key hardware acceleration
    (PKHA), so don't use RSA_FREESCALE_EXP. If you try to use it on IMX
    (assuming you have the clocks enabled first) you will get back an
    "Invalid KEY Command" error since PKHA isn't a valid key destination for
    these parts.

    Signed-off-by: George McCollister
    Reviewed-by: Tom Rini

    George McCollister
     

17 Mar, 2017

2 commits


15 Mar, 2017

1 commit


14 Mar, 2017

1 commit


06 Feb, 2017

1 commit


01 Feb, 2017

1 commit


28 Jan, 2017

1 commit


15 Jan, 2017

4 commits

  • Add support for signing with the pkcs11 engine. This allows FIT images
    to be signed with keys securely stored on a smartcard, hardware security
    module, etc without exposing the keys.

    Support for other engines can be added in the future by modifying
    rsa_engine_get_pub_key() and rsa_engine_get_priv_key() to construct
    correct key_id strings.

    Signed-off-by: George McCollister

    George McCollister
     
  • Ensure '.' is used to separate octets. If another character is seen
    reject the string outright and return 0.0.0.0.

    Signed-off-by: Chris Packham

    Chris Packham
     
  • Previously values greater than 255 were implicitly truncated. Add some
    stricter checking to reject addresses with components >255.

    With the input "1234192.168.1.1" the old behaviour would truncate the
    address to 192.168.1.1. New behaviour rejects the string outright and
    returns 0.0.0.0, which for the purposes of IP addresses can be
    considered an error.

    Signed-off-by: Chris Packham

    Chris Packham
     
  • Currently, mdelay() and udelay() are declared in include/common.h,
    while ndelay() in include/linux/compat.h. It would be nice to
    collect them into include/linux/delay.h like Linux.

    While we are here, fix the ndelay() implementation; I used the
    DIV_ROUND_UP() instead of (x)/1000 because it must wait *longer*
    than the given period of time.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass

    Masahiro Yamada
     

14 Jan, 2017

1 commit

  • The fdt_overlay_apply() function purports to support the edge cases where
    an overlay has no fixups to be applied, or a base tree which has no
    symbols (the latter can only work if the former is also true). However it
    gets it wrong in a couple of small ways:

    * In the no fixups case, it doesn't fail immediately, but will attempt
    fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node
    offset, which will fail. Instead it should succeed immediately, since
    there's nothing to do.
    * In the case of no symbols, it again doesn't fail immediately. However
    if there is an actual fixup it will fail with an unexpected error,
    because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to
    look up the symbols. We should instead return -FDT_ERR_NOTFOUND
    directly.

    Both of these errors lead to the code returning misleading error codes in
    failing cases.

    [ DTC commit: 7d8ef6e1db9794f72805a0855f4f7f12fadd03d3 ]

    Signed-off-by: David Gibson
    Signed-off-by: Stefan Agner
    Acked-by: Simon Glass

    David Gibson
     

10 Jan, 2017

1 commit


09 Jan, 2017

1 commit


04 Jan, 2017

2 commits

  • tiny-printf does not know about the "-" modifier, which aligns numbers.
    This is used by some SPL code, but as it's purely cosmetical, we just
    ignore this modifier here to avoid changing correct printf strings.

    Signed-off-by: Andre Przywara
    Reviewed-by: Simon Glass
    Reviewed-by: Jagan Teki

    Andre Przywara
     
  • tiny-printf does not know about the "l" modifier so far, which breaks
    the crash dump on AArch64, because it uses %lx to print the registers.
    Add an easy way of handling longs correctly.

    Using a relatively decent compiler (GCC 5.3.0) this does _not_ increase
    the code size of tiny-printf.o for 32-bit builds (where long and int
    are actually the same), actually it looses three (ARM Thumb2) instructions
    from the actual SPL (numbers for orangepi_plus_defconfig):
    text data bss dec hex filename
    758 0 0 758 2f6 spl/lib/tiny-printf.o before
    18839 488 232 19559 4c67 spl/u-boot-spl before
    758 0 0 758 2f6 spl/lib/tiny-printf.o after
    18833 488 232 19553 4c61 spl/u-boot-spl after

    This adds some substantial amount of code to a 64-bit build, though:
    (taken after a later commit, which enables the ARM64 SPL build for sunxi)
    text data bss dec hex filename
    1542 0 0 1542 606 spl/lib/tiny-printf.o before
    25830 392 360 26582 67d6 spl/u-boot-spl before
    1758 0 0 1758 6de spl/lib/tiny-printf.o after
    26040 392 360 26792 68a8 spl/u-boot-spl after

    Signed-off-by: Andre Przywara
    Reviewed-by: Simon Glass
    Reviewed-by: Jagan Teki

    Andre Przywara
     

20 Dec, 2016

1 commit

  • Add two functions for use by board implementations to decode the memory
    banks of the /memory node so as to populate the global data with
    ram_size and board info for memory banks.

    The fdtdec_setup_memory_size() function decodes the first memory bank
    and sets up the gd->ram_size with the size of the memory bank. This
    function should be called from the boards dram_init().

    The fdtdec_setup_memory_banksize() function decode the memory banks
    (up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size
    into the gd->bd->bi_dram array of banks. This function should be called
    from the boards dram_init_banksize().

    Signed-off-by: Nathan Rossi
    Cc: Simon Glass
    Cc: Michal Simek
    Reviewed-by: Simon Glass
    Signed-off-by: Michal Simek

    Nathan Rossi