14 Jan, 2017

1 commit


05 Dec, 2016

1 commit

  • After an image is selected out of a FIT blob for further processing we
    run an optional, platform specific, post-processing function on this
    component. This post-processing may modify the position and size of the
    image, so after post-processing we update the location and size for this
    image in the FIT header. This can cause problems as the position of
    subsequent components in the FIT blob are only referenced by relative
    position to the end of the last component. When we resize or move a
    component the following components position will be calculated
    incorrectly. To fix this, we do not update the FIT header but instead
    only update our local understanding of the image data. This also allows
    us to re-run post-processing steps if needed.

    Signed-off-by: Andrew F. Davis
    Tested-by: Carlos Hernandez
    Reviewed-by: Simon Glass
    Reviewed-by: Lokesh Vutla

    Andrew F. Davis
     

24 Nov, 2016

1 commit


23 Nov, 2016

1 commit

  • To support loading a 32-bit OS, the execution state will change from
    AArch64 to AArch32 when jumping to kernel.

    The architecture information will be got through checking FIT image,
    then U-Boot will load 32-bit OS or 64-bit OS automatically.

    Signed-off-by: Ebony Zhu
    Signed-off-by: Alison Wang
    Signed-off-by: Chenhui Zhao
    Reviewed-by: York Sun

    Alison Wang
     

14 Oct, 2016

2 commits

  • The signature for this macro has changed. Bring in the upstream version and
    adjust U-Boot's usages to suit.

    Signed-off-by: Simon Glass
    Update to drivers/power/pmic/palmas.c:
    Signed-off-by: Keerthy

    Change-Id: I6cc9021339bfe686f9df21d61a1095ca2b3776e8

    Simon Glass
     
  • These have now landed upstream. The naming is different and in one case the
    function signature has changed. Update the code to match.

    This applies the following upstream commits by
    Thierry Reding :

    604e61e fdt: Add functions to retrieve strings
    8702bd1 fdt: Add a function to get the index of a string
    2218387 fdt: Add a function to count strings

    Signed-off-by: Simon Glass

    Simon Glass
     

22 Sep, 2016

1 commit

  • Commit bac17b78dace ("image-fit: switch ENOLINK to ENOENT") changed
    fit_get_node_from_config to return -ENOENT when a property doesn't
    exist, but didn't change any of its callers which check return values.
    Notably it didn't change boot_get_ramdisk, which leads to U-Boot failing
    to boot FIT images which don't include ramdisks with the following
    message:

    Ramdisk image is corrupt or invalid

    It also didn't take into account that by returning -ENOENT to denote the
    lack of a property we lost the ability to determine from the return
    value of fit_get_node_from_config whether it was the property or the
    configuration node that was missing, which may potentially lead callers
    to accept invalid FIT images.

    Fix this by having fit_get_node_from_config return -EINVAL when the
    configuration node isn't found and -ENOENT when the property isn't
    found, which seems to make semantic sense. Callers that previously
    checked for -ENOLINK are adjusted to check for -ENOENT, which fixes the
    breakage introduced by commit bac17b78dace ("image-fit: switch ENOLINK
    to ENOENT").

    The only other user of the return fit_get_node_from_config return value,
    indirectly, is bootm_find_os which already checked for -ENOENT. From a
    read-through of the code I suspect it ought to have been checking for
    -ENOLINK prior to bac17b78dace ("image-fit: switch ENOLINK to ENOENT")
    anyway, which would make it right after this patch, but this would be
    good to get verified by someone who knows this x86 code or is able to
    test it.

    Signed-off-by: Paul Burton
    Cc: Jonathan Gray
    Cc: Marek Vasut
    Acked-by: Marek Vasut
    Acked-by: Stefan Roese
    Acked-by: George McCollister
    Tested-by: George McCollister

    Paul Burton
     

07 Sep, 2016

2 commits


12 Aug, 2016

1 commit

  • This commit allows injecting a board/platform/device-specific post-
    processing function into the FIT image data loading process, which can
    include modifying the size and altering the starting source address of
    an image data artifact. This might be desired to do things like strip
    headers or footers attached to the images before they were packaged into
    the FIT, or to perform operations such as decryption or authentication.
    Introduce new configuration option CONFIG_FIT_IMAGE_POST_PROCESS to
    allow controlling this feature. If enabled, a platform-specific post-
    process function must be provided.

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

    Andreas Dannenberg
     

26 Jul, 2016

1 commit

  • In certain circumstances it comes in handy to be able to boot into a second
    U-Boot. But as of now it is not possible to boot a U-Boot binary that is inside
    a FIT image, which is problematic for projects that e.g. need to guarantee a
    unbroken chain of trust from SOC all the way into the OS, since the FIT signing
    mechanism cannot be used.

    This patch adds the capability to load such FIT images.

    An example .its snippet (utilizing signature verification) might look
    like the following:

    images {
    firmware@1 {
    description = "2nd stage U-Boot image";
    data = /incbin/("u-boot-dtb.img.gz");
    type = "firmware";
    arch = "arm";
    os = "u-boot";
    compression = "gzip";
    load = ;
    entry = ;
    signature@1 {
    algo = "sha256,rsa4096";
    key-name-hint = "key";
    };
    };
    };

    Signed-off-by: Mario Six
    Reviewed-by: Tom Rini

    mario.six@gdsys.cc
     

17 Jun, 2016

1 commit


24 May, 2016

2 commits


23 May, 2016

1 commit

  • This function returns an error code and its caller may be able to fix the
    error. For example fit_handle_file() expands the device tree to fit if there
    is a lack of space.

    In this case the caller does not want an error displayed. It is confusing,
    since it suggests that something is wrong, when it fact everything is fine.
    Drop the error.

    Signed-off-by: Simon Glass

    Simon Glass
     

15 Mar, 2016

3 commits

  • FIT image supports more than 32 bits in addresses by using #address-cell
    field. Fixing 64-bit support by using this field.

    Signed-off-by: York Sun
    Reviewed-by: Simon Glass

    York Sun
     
  • FIT image supports load address and entry address. Getting these
    addresses can use a common function.

    Signed-off-by: York Sun
    Reviewed-by: Simon Glass

    York Sun
     
  • There are already two FIT options in Kconfig but the CONFIG options are
    still in the header files. We need to do a proper move to fix this.

    Move these options to Kconfig and tidy up board configuration:

    CONFIG_FIT
    CONFIG_OF_BOARD_SETUP
    CONFIG_OF_SYSTEM_SETUP
    CONFIG_FIT_SIGNATURE
    CONFIG_FIT_BEST_MATCH
    CONFIG_FIT_VERBOSE
    CONFIG_OF_STDOUT_VIA_ALIAS
    CONFIG_RSA

    Unfortunately the first one is a little complicated. We need to make sure
    this option is not enabled in SPL by this change. Also this option is
    enabled automatically in the host builds by defining CONFIG_FIT in the
    image.h file. To solve this, add a new IMAGE_USE_FIT #define which can
    be used in files that are built on the host but must also build for U-Boot
    and SPL.

    Note: Masahiro's moveconfig.py script is amazing.

    Signed-off-by: Simon Glass
    [trini: Add microblaze change, various configs/ re-applies]
    Signed-off-by: Tom Rini

    Simon Glass
     

26 Feb, 2016

2 commits

  • This reverts commit 84ca65aa4bd0d03867e9e49805201d0564d3ffb0.

    On signature verification failures fit_image_verify() should NOT exit with
    error. Only keys marked 'required' can cause image verification failure.
    This logic is already there and works correctly.

    Add a comment to make this clear.

    Fixes: 84ca65aa (image-fit: Fix signature checking)
    Signed-off-by: Simon Glass

    Simon Glass
     
  • A recent change broke the 'bootm' command on sandbox. The root cause is
    using a pointer as an address. Conversion from pointer to address needs to
    use map_to_sysmem() so that sandbox can do the right thing. The problem was
    pre-existing but uncovered by a recent commit.

    Fix this. Also move fit_get_end() to the C file to avoid needing to include
    mapmem.h (and thus asm/io.h) everywhere.

    Fixes: 1fec3c5d (common/image.c: Make boot_get_ramdisk() perform a check for Android images)

    Signed-off-by: Simon Glass

    Simon Glass
     

20 Oct, 2015

1 commit


06 Jun, 2015

1 commit

  • This fixes the following compiler warning:

    In file included from tools/common/image-fit.c:1:0:
    ./tools/../common/image-fit.c: In function ‘fit_conf_print’:
    ./tools/../common/image-fit.c:1470:27: warning: logical not is only applied
    to the left hand side of comparison [-Wlogical-not-parentheses]
    (const char **)&uname) > 0;

    Signed-off-by: Hans de Goede

    Hans de Goede
     

28 May, 2015

2 commits

  • Added a trimmed down instance of boot_get_() to satisfy the
    minimum requierments of the added feature. The function follows the
    normal patterns set by other boot_get's, which should make it a
    bit easier to combine them all together into one boot_get_image()
    function in a later refactor.

    Documentation for the new function can be found in source:
    include/image.h

    Signed-off-by: Karl Apsite
    Reviewed-by: Simon Glass

    Karl Apsite
     
  • Added FIT_LOADABLE_PROP, so the user can identify an optional entry
    named "loadables" in their .its configuration. "loadables" is a comma
    separated list in the .its

    Documentation can be found in doc/uImage.FIT/source_file_format.txt and
    doc/uImage.Fit/multi-with-loadables.its

    Signed-off-by: Karl Apsite
    Reviewed-by: Simon Glass

    Karl Apsite
     

19 Apr, 2015

1 commit


17 Feb, 2015

1 commit


30 Jan, 2015

1 commit

  • The dumpimage is able to extract components contained in a FIT image:

    $ ./dumpimage -T flat_dt -i CONTAINER.ITB -p INDEX FILE

    The CONTAINER.ITB is a regular FIT container file. The INDEX is the poisition
    of the sub-image to be retrieved, and FILE is the file (path+name) to save the
    extracted sub-image.

    For example, given the following kernel.its to build a kernel.itb:

    /dts-v1/;
    / {
    ...
    images {
    kernel@1 {
    description = "Kernel 2.6.32-34";
    data = /incbin/("/boot/vmlinuz-2.6.32-34-generic");
    type = "kernel";
    arch = "ppc";
    os = "linux";
    compression = "gzip";
    load = ;
    entry = ;
    hash@1 {
    algo = "md5";
    };
    };
    ...
    };
    ...
    };

    The dumpimage can extract the 'kernel@1' node through the following command:

    $ ./dumpimage -T flat_dt -i kernel.itb -p 0 kernel
    Extracted:
    Image 0 (kernel@1)
    Description: Kernel 2.6.32-34
    Created: Wed Oct 22 15:50:26 2014
    Type: Kernel Image
    Compression: gzip compressed
    Data Size: 4040128 Bytes = 3945.44 kB = 3.85 MB
    Architecture: PowerPC
    OS: Linux
    Load Address: 0x00000000
    Entry Point: 0x00000000
    Hash algo: md5
    Hash value: 22352ad39bdc03e2e50f9cc28c1c3652

    Which results in the file 'kernel' being exactly the same as '/boot/vmlinuz-2.6.32-34-generic'.

    Signed-off-by: Guilherme Maciel Ferreira

    Guilherme Maciel Ferreira
     

15 Jan, 2015

1 commit


29 Oct, 2014

1 commit


25 Oct, 2014

1 commit


22 Oct, 2014

2 commits


29 Aug, 2014

1 commit

  • Commit e3a5bbce broke the FIT image tests by not loading a ramdisk even if
    a load address is provided in the FIT. The rationale was that a load address
    of 0 should be considered to mean 'do not load'.

    Add a new load operation which supports this feature, so that the ramdisk
    will be loaded if a non-zero load address is provided.

    Signed-off-by: Simon Glass

    Simon Glass
     

19 Jun, 2014

5 commits


12 Jun, 2014

1 commit


22 Mar, 2014

1 commit