07 Jul, 2017

1 commit

  • Since commit 5b9d44df2307f (mkimage: Display a better list of available image
    types) mkimage usage text suggest to "use -T to see a list of available image
    types". Unfortunately, commit 02221f29deb8 (mkimage: Convert to use getopt())
    broke that feature, because getopt() fails when -T has no option argument.

    Add a pseudo image type name 'list' that lists all image types. Update the
    usage text accordingly.

    Cc: Simon Glass
    Signed-off-by: Baruch Siach

    Baruch Siach
     

21 Jan, 2017

1 commit


15 Jan, 2017

1 commit

  • 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
     

03 Jan, 2017

1 commit

  • When we want to use Secure Boot with HAB from SPL over U-Boot.img,
    we need to append the IVT to the image and leave space for the CSF.
    Images generated as firmware_ivt can directly be signed using the
    Freescale code signing tool. For creation of a CSF, mkimage outputs
    the correct HAB Blocks for the image.
    The changes to the usual firmware image class are quite small,
    that is why I implemented that directly into the default_image.

    Cc: sbabic@denx.de

    v2-Changes: None

    Signed-off-by: Sven Ebenfeld
    Reviewed-by: George McCollister
    Tested-by: George McCollister

    Sven Ebenfeld
     

06 Nov, 2016

1 commit

  • Adds -i option that allows specifying a ramdisk file to be added to the
    FIT image when we are using the automatic FIT mode (no ITS file).

    This makes adding Depthcharge support to LAVA much more convenient, as
    no additional configuration files need to be kept around in the machine
    that dispatches jobs to the boards.

    Signed-off-by: Tomeu Vizoso
    Cc: Simon Glass
    Cc: Matt Hart
    Cc: Neil Williams
    Reviewed-by: Simon Glass

    Tomeu Vizoso
     

31 Oct, 2016

2 commits


06 Aug, 2016

1 commit


15 Jul, 2016

9 commits


25 Jun, 2016

1 commit

  • When building a FIT with external data (-E), U-Boot proper may require
    absolute positioning for executing the external firmware. To acheive this
    use the (-p) switch, which will replace the amended 'data-offset' with
    'data-position' indicating the absolute position of external data.

    It is considered an error if the requested absolute position overlaps with the
    initial data required for the compact FIT.

    Signed-off-by: Teddy Reed

    Teddy Reed
     

23 May, 2016

1 commit

  • Some build systems want to be quiet unless there is a problem. At present
    mkimage displays quite a bit of information when generating a FIT file. Add
    a '-q' flag to silence this.

    Signed-off-by: Simon Glass
    Acked-by: Joe Hershberger

    Simon Glass
     

03 May, 2016

2 commits

  • Commit 7a439cadcf3192eb012a2432ca34670b676c74d2 broke generation of SPL
    loadable FIT images (CONFIG_SPL_LOAD_FIT).
    Fix it by removing the unnecessary storage of expected image type. This was a
    left over of the previous implementation. It is not longer necessary since the
    mkimage -b switch always has one parameter.

    Tested-by: Lokesh Vutla
    Signed-off-by: Andreas Bießmann

    Andreas Bießmann
     
  • The getopt(3) optstring '-' is a GNU extension which is not available on BSD
    systems like OS X.

    Remove this dependency by implementing argument parsing in another way. This
    will also change the lately introduced '-b' switch behaviour.

    Signed-off-by: Andreas Bießmann
    Reviewed-by: Simon Glass

    Andreas Bießmann
     

15 Mar, 2016

10 commits

  • One limitation of FIT is that all the data is 'inline' within it, using a
    'data' property in each image node. This means that to find out what is in
    the FIT it is necessary to scan the entire file. Once loaded it can be
    scanned and then the images can be copied to the correct place in memory.

    In SPL it can take a significant amount of time to copy images around in
    memory. Also loading data that does not end up being used is wasteful. It
    would be useful if the FIT were small, acting as a directory, with the
    actual data stored elsewhere.

    This allows SPL to load the entire FIT, without the images, then load the
    images it wants later.

    Add a -E option to mkimage to request that it output an 'external' FIT.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • To make the auto-FIT feature useful we need to be able to provide a list of
    device tree files on the command line for mkimage to add into the FIT. Add
    support for this feature.

    So far there is no support for hashing or verified boot using this method.
    For those cases, a .its file must still be provided.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present, when generating a FIT, mkimage requires a .its file containing
    the structure of the FIT and referring to the images to be included.

    Creating the .its file is a separate step that makes it harder to use FIT.
    This is not required for creating legacy images.

    Often the FIT is pretty standard, consisting of an OS image, some device
    tree files and a single configuration. We can handle this case automatically
    and avoid needing a .its file at all.

    To start with, support automatically generate the FIT using a new '-f auto'
    option. Initially this only supports adding a single image (e.g. a linux
    kernel) and a single configuration.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present FIT images are set up by providing a device tree source file
    which is a file with a .its extension. We want to support automatically
    creating this file based on the image supplied to mkimage. This means that
    even though the final file type is always IH_TYPE_FLATDT, the image inside
    may be something else.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This is not used outside mkimage.c, so make this variable static.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Sometimes incorrect arguments are supplied but the reason is not obvious to
    the user. Add some helpful messages.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • To avoid a forward declaration, move the usage() function higher in the
    file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Adjust the code so that option alphabetical order matches the order in the
    switch() statement. This makes it easier to find options.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The current way of parsing arguments is a bit clumsy. It seems better to
    use getopt() which is commonly used for this purpose.

    Convert the code to use getopt() and make a few minor adjustments as needed.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present main() is very long. Split out the argument processing to make
    it easier to follow.

    Signed-off-by: Simon Glass

    Simon Glass
     

25 Feb, 2016

1 commit

  • To follow the MIPS 32-bit and 64-bit memory map conventions (*) recent
    MIPS Linux kernels are using a 64-bit sign extended value
    (0xffffffff80010000) for the 32-bit load address (0x80010000) of the
    Creator CI20 board kernel. When this 64-bit argument was passed to
    mkimage running on a 32-bit machine such as the Creator CI20 board the
    load address was incorrectly formed from the upper 32-bit sign-extend
    bits (0xffffffff) by the strtoul instead of from the lower 32-bits
    (0x80010000). The mkimage should be able to tolerate the longer
    sign-extended 64-bit version of the 32-bit arguments with the use of
    strtoull. Use of the strtoll in place of the strtol in mkimage.c
    resolves the issue of self hosted kernel builds for the Creator CI20
    board (+) and (++).

    (*) http://techpubs.sgi.com/library/dynaweb_docs/0620/SGI_Developer/books/DevDriver_PG/sgi_html/ch01.html
    (+) https://github.com/MIPS/CI20_linux/issues/23
    (++) https://github.com/MIPS/CI20_linux/issues/22

    Signed-off-by: William Cohen

    William Cohen
     

08 Dec, 2015

1 commit

  • Seems 6ae6e160 broke creating images in certain cases, there
    are two problems with that patch.

    First is that the expression "!x == 4 || !x == 6" is ambiguous. The
    intention here was "!(x == 4) || !(x == 6)" based on reading further in
    the file, where this was borrowed from. This however is interpreted by
    gcc as "(!x) == 4 || (!x) == 6" and always false. gcc-5.x will warn
    about this case.

    The second problem is that we do not want to test for the case of "(NOT x
    is 4) OR (NOT x is 6)" but instead "(x is not equal to 4) AND (x is not
    equal to 6)". This is because in those two cases we already execute the
    code question in another part of the file. Rewrite the expression and
    add parenthesis for clarity.

    Signed-off-by: Marek Vasut
    Cc: Tom Rini
    Cc: Philippe De Swert
    Cc: Simon Glass
    [trini: Re-word Marek's explanation]

    Marek Vasut
     

06 Dec, 2015

1 commit

  • Seems 92a655c3 broke creating multi and script type images.
    Since the file1:file2:file3 string does not get split up,
    it fails on trying to open an non-existing file.

    mkimage -A arm -O linux -T multi -C none -d zImage:splash.bmp:device.dtb uimage
    tools/mkimage: Can't open zImage:splash.bmp:device.dtb: No such file or directory

    Since the sizes of the different parts seem to get added in the actual
    routine that handles multi and script type images, we can probably skip the
    bit of the code that causes the failure for that type of images.

    Signed-off-by: Philippe De Swert

    Philippe De Swert
     

12 Oct, 2015

1 commit


03 Sep, 2015

1 commit


22 Jul, 2015

2 commits


30 Jan, 2015

2 commits