17 Jan, 2020

2 commits

  • This commit add to u-boot the support to decrypt
    fit image encrypted with aes. The FIT image contains
    the key name and the IV name. Then u-boot look for
    the key and IV in his device tree and decrypt images
    before moving to the next stage.

    Signed-off-by: Philippe Reynes

    Philippe Reynes
     
  • This commit add the support of encrypting image with aes
    in mkimage. To enable the ciphering, a node cipher with
    a reference to a key and IV (Initialization Vector) must
    be added to the its file. Then mkimage add the encrypted
    image to the FIT and add the key and IV to the u-boot
    device tree.

    Signed-off-by: Philippe Reynes

    Philippe Reynes
     

07 Dec, 2019

1 commit

  • Imported from linux kernel v5.3:
    asn1.h without changes
    asn1_ber_bytecode.h without changes
    asn1_decoder.h without changes
    asn1_compiler.c without changes

    This host command will be used to create a ASN1 parser, for example,
    for pkcs7 messages or x509 certificates. More specifically, it will
    generate *byte code* which will be interpreted by asn1 decoder library.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     

26 Aug, 2019

1 commit


29 Jul, 2019

1 commit

  • in case of bmp_logo, the video_bmp driver is used for
    drawing a bmp logo. This driver supports only "full"
    bmp data. Adding a logo with the bmp_logo tool to
    u-boot binary adds currently only real data and drops
    the bmp header.

    This patch adds now the full bmp data to the u-boot
    binary, so video_bmp driver works with the logo embedded
    into u-boot.

    Fixed also some checkpatch error poping up with this
    patch.

    Signed-off-by: Heiko Schocher

    Heiko Schocher
     

24 Jul, 2019

1 commit

  • Some Intel SoCs from about 2016 boot using an internal microcontroller via
    an 'IFWI' image. This is a special format which can hold firmware images.
    In U-Boot's case it holds u-boot-tpl.bin.

    Add this tool, taken from coreboot, so that we can build bootable images
    on apollolake SoCs.

    This tool itself has no tests. Some amount of coverage will be provided by
    the binman tests that use it, so enable building the tool on sandbox.

    Signed-off-by: Simon Glass

    Simon Glass
     

07 Jun, 2019

1 commit

  • This adds a size check for SPL that can dynamically check generated
    SPL binaries (including devicetree) for a size limit that ensures
    this image plus global data, heap and stack fit in initial SRAM.

    Since some of these sizes are not available to make, a new host tool
    'spl_size_limit' is added that dumps the resulting maximum size for
    an SPL binary to stdout. This tool is used in toplevel Makefile to
    implement the size check on SPL binaries.

    Signed-off-by: Simon Goldschmidt

    Simon Goldschmidt
     

10 May, 2019

1 commit

  • Due to some mistakes in the source code, it was not possible to really
    turn FIT support off. This commit fixes the problem by means of the
    following changes:

    - Enclose "bootm_host_load_image" and "bootm_host_load_images" between
    checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.

    - Enclose the declaration of "bootm_host_load_images" between checks for
    CONFIG_FIT_SIGNATURE, in common/bootm.h.

    - Condition the compilation and linking of fit_common.o fit_image.o
    image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.

    Signed-off-by: Carlos Santos
    [fabio: adapt for 2016.07]
    Signed-off-by: Fabio Estevam
    [Ricardo: fix conditional compilation and linking of the files mentioned above
    for 2016.07]
    Signed-off-by: Ricardo Martincoski
    [Jörg: adapt for 2019.01]
    Signed-off-by: Jörg Krause
    [Retrieved from:
    https://git.buildroot.net/buildroot/tree/package/uboot-tools/0003-Make-FIT-support-really-optional.patch]
    Signed-off-by: Fabrice Fontaine

    Fabrice Fontaine
     

03 May, 2019

1 commit


27 Apr, 2019

1 commit


03 Apr, 2019

1 commit

  • Parts of the code are using C99 constructs (such as variables declared
    inside loops), but also GNU extensions (such as typeof), so using
    -std=gnu99 is necessary to build with older versions of gcc that don't
    default to building with gnu99.

    It fixes the following build failure:

    ./tools/../lib/crc16.c: In function "crc16_ccitt":
    ./tools/../lib/crc16.c:70:2: error: "for" loop initial declarations are only allowed in C99 mode
    for (int i = 0; i < len; i++)
    ^
    ./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code

    when building the host tools with gcc 4.7.

    Signed-off-by: Thomas Petazzoni
    Reviewed-by: Philipp Tomsich

    Thomas Petazzoni
     

01 Jan, 2019

2 commits


16 Dec, 2018

1 commit

  • The motivation for this is to allow distributions to distribute all
    possible tools in a generic way, avoiding the need of specific tools
    building for each machine.

    Especially on OpenEmbedded / Yocto Project ecosystem, it is very
    common each BSP to end providing their specific tools when they need
    to generate images for some SoC (e.g MX23 / MX28 in meta-freescale
    case).

    Using this, we can package the tools doing:

    $: make tools-only_defconfig
    $: make tools-only

    Signed-off-by: Otavio Salvador
    [trini: Add MAINTAINERS entry for myself, add to .travis.yml, make
    U-Boot itself buildable to not trip up other frameworks]
    Signed-off-by: Tom Rini

    Otavio Salvador
     

09 Dec, 2018

1 commit

  • The CRC16-CCITT checksum function is useful for space-constrained
    applications (such as obtaining a checksum across a 2KBit or 4KBit
    EEPROM) in boot applications. It has not been accessible from boot
    scripts until now (due to not having a dedicated command and not being
    supported by the hash infrstructure) limiting its applicability
    outside of custom commands.

    This adds the CRC16-CCITT (poly 0x1021, init 0x0) algorithm to the
    list of available hashes and adds a new crc16_ccitt_wd_buf() to make
    this possible.

    Signed-off-by: Philipp Tomsich
    [trini: Fix building crc16.o for SPL/TPL]
    Signed-off-by: Tom Rini

    Philipp Tomsich
     

29 Nov, 2018

1 commit


22 Oct, 2018

1 commit

  • i.MX8/8X bootable image type is container type.
    The bootable image, containers a container set which supports two
    container. The 1st container is for SECO firmware, the 2nd container
    needs to include scfw, m4_0/1 image, ACore images per your requirement.

    Signed-off-by: Peng Fan

    Peng Fan
     

11 Jul, 2018

1 commit

  • This adds a new config value FIT_SIGNATURE_MAX_SIZE, which controls the
    max size of a FIT header's totalsize field. The field is checked before
    signature checks are applied to protect from reading past the intended
    FIT regions.

    This field is not part of the vboot signature so it should be sanity
    checked. If the field is corrupted then the structure or string region
    reads may have unintended behavior, such as reading from device memory.
    A default value of 256MB is set and intended to support most max storage
    sizes.

    Suggested-by: Simon Glass
    Signed-off-by: Teddy Reed
    Reviewed-by: Simon Glass

    Teddy Reed
     

11 May, 2018

1 commit

  • The officially described way to generate boot.bin files for ZynqMP is to
    describe the contents of the target binary using a file of the "bif"
    format. This file then links to other files that all get packed into a
    bootable image.

    This patch adds support to read such a .bif file and generate a respective
    ZynqMP boot.bin file that can include the normal image and pmu files, but
    also supports image partitions now. This makes it a handy replacement for
    the proprietary "bootgen" utility that is currently used to generate
    boot.bin files with FSBL.

    Signed-off-by: Alexander Graf
    Signed-off-by: Michal Simek

    Alexander Graf
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

23 Mar, 2018

1 commit


20 Mar, 2018

1 commit


05 Mar, 2018

1 commit


29 Jan, 2018

2 commits

  • libfdt_env.h is supposed to provide system-dependent defines.

    scripts/dtc/libfdt/libfdt_env.h from upstream DTC is suitable
    for user-space, so we should use this for USE_HOSTCC case.

    For compiling U-Boot, we need to override such system-dependent
    defines, so use imported from Linux.

    selects a proper one. Maybe, we should split header
    inclusion completely, but I do not want too many patches at one.

    I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS.

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

    Masahiro Yamada
     
  • The only difference between scripts/dtc/libfdt/fdt_rw.c and
    lib/libfdt/fdt_rw.c is fdt_remove_unused_strings().

    It is only used by fdtgrep, so we do not need to compile it for U-Boot
    image. Move it to tools/libfdt/fdw_rw.c so that lib/libfdt/fdt_rw.c
    can be a wrapper of scripts/dtc/libfdt/fdt_rw.c.

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

    Masahiro Yamada
     

23 Jan, 2018

1 commit

  • For testing EFI disk management we need an in-memory image of
    a disk.

    The tool file2include converts a file to a C include. The file
    is separated into strings of 8 bytes. Only the non-zero strings
    are written to the include. The output format has been designed
    to maintain readability.

    #define EFI_ST_DISK_IMG { 0x00010000, { \
    {0x000001b8, "\x94\x37\x69\xfc\x00\x00\x00\x00"}, /* .7i..... */ \
    {0x000001c0, "\x02\x00\x83\x02\x02\x00\x01\x00"}, /* ........ */ \
    {0x000001c8, "\x00\x00\x7f\x00\x00\x00\x00\x00"}, /* ........ */ \
    {0x000001f8, "\x00\x00\x00\x00\x00\x00\x55\xaa"}, /* ......U. */ \
    ...
    {0x00006000, "\x48\x65\x6c\x6c\x6f\x20\x77\x6f"}, /* Hello wo */ \
    {0x00006008, "\x72\x6c\x64\x21\x0a\x00\x00\x00"}, /* rld!.... */ \
    {0, NULL} } }

    As the disk image needed for testing contains mostly zeroes a high
    compression ratio can be attained.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

12 Jan, 2018

1 commit

  • Add prelink-riscv to arrange .rela.dyn and .rela.got
    in compile time. So that u-boot can be directly
    executed without fixup.

    Signed-off-by: Chih-Mao Chen
    Signed-off-by: Rick Chen
    Signed-off-by: Rick Chen
    Signed-off-by: Greentime Hu

    Rick Chen
     

04 Dec, 2017

1 commit


17 Nov, 2017

2 commits

  • Prior to this commit, tools/Makefile pulls all libfdt files from
    lib/libfdt.

    lib/libfdt/ and scripts/dtc/libfdt have the same copies for the
    followings 6 files:
    fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c
    fdt_sw.c

    This commit changes them to #include ones from scripts/dtc/libfdt.

    Unfortunately, U-Boot locally modified the following 3 files:
    fdt_ro.c fdt_wip.c fdt_rw.c

    I did not touch them in order to avoid unpredictable impact.

    The fdt_region.c is U-Boot own file. This is also borrowed from
    lib/libfdt/.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • The pylibfdt is used by dtoc (and, indirectly by binman), but there
    is no reason why it must be generated in the tools/ directory.

    Recently, U-Boot switched over to the bundled DTC, and the directory
    structure under scripts/dtc/ now mirrors the upstream DTC project.
    So, scripts/dtc/pylibfdt is the best location.

    I also rewrote the Makefile in a cleaner Kbuild style.

    The scripts from the upstream have been moved as follows:

    lib/libfdt/pylibfdt/setup.py -> scripts/dtc/pylibfdt/setup.py
    lib/libfdt/pylibfdt/libfdt.i -> scripts/dtc/pylibfdt/libfdt.i_shipped

    The .i_shipped is coped to .i during building because the .i must be
    located in the objtree when we build it out of tree.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

16 Oct, 2017

1 commit


24 Sep, 2017

1 commit


04 Sep, 2017

2 commits


20 Aug, 2017

1 commit

  • On some systems `python` is `python3` (for instance, Archlinux). The
    `PYTHON` variable can be used to point to `python2` to have a successful
    build.

    The use of `PYTHON` is currently limited in the Makefile and needs to be
    extended in other places:

    First, pylibfdt is required to be a Python 2 binding (binman imports
    pylibfdt and is only compatible Python 2), so its setup.py needs to be
    called accordingly. An alternative would be to change the libfdt
    setup.py shebang to python2, but the binding is actually portable. Also,
    it would break on system where there is no such thing as `python2`.

    Secondly, the libfdt import checks need to be done against Python 2 as
    well since the Python 2 compiled modules (in this case _libdft.so) can
    not be imported from Python 3.

    Note on the libfdt imports: "@if ! PYTHONPATH=tools $(PYTHON) -c 'import
    libfdt'; then..." is probably simpler than the currently sub-optimal
    pipe.
    Reviewed-by: Jonathan Gray

    Clément Bœsch
     

15 Aug, 2017

1 commit


26 Jul, 2017

1 commit

  • U-Boot has up until now built with -fpic for the MIPS architecture,
    producing position independent code which uses indirection through a
    global offset table, making relocation fairly straightforward as it
    simply involves patching up GOT entries.

    Using -fpic does however have some downsides. The biggest of these is
    that generated code is bloated in various ways. For example, function
    calls are indirected through the GOT & the t9 register:

    8f998064 lw t9,-32668(gp)
    0320f809 jalr t9

    Without -fpic the call is simply:

    0f803f01 jal be00fc04

    This is more compact & faster (due to the lack of the load & the
    dependency the jump has on its result). It is also easier to read &
    debug because the disassembly shows what function is being called,
    rather than just an offset from gp which would then have to be looked up
    in the ELF to discover the target function.

    Another disadvantage of -fpic is that each function begins with a
    sequence to calculate the value of the gp register, for example:

    3c1c0004 lui gp,0x4
    279c3384 addiu gp,gp,13188
    0399e021 addu gp,gp,t9

    Without using -fpic this sequence no longer appears at the start of each
    function, reducing code size considerably.

    This patch switches U-Boot from building with -fpic to building with
    -fno-pic, in order to gain the benefits described above. The cost of
    this is an extra step during the build process to extract relocation
    data from the ELF & write it into a new .rel section in a compact
    format, plus the added complexity of dealing with multiple types of
    relocation rather than the single type that applied to the GOT. The
    benefit is smaller, cleaner, more debuggable code. The relocate_code()
    function is reimplemented in C to handle the new relocation scheme,
    which also makes it easier to read & debug.

    Taking maltael_defconfig as an example the size of u-boot.bin built
    using the Codescape MIPS 2016.05-06 toolchain (gcc 4.9.2, binutils
    2.24.90) shrinks from 254KiB to 224KiB.

    Signed-off-by: Paul Burton
    Cc: Daniel Schwierzeck
    Cc: u-boot@lists.denx.de
    Reviewed-by: Daniel Schwierzeck
    Tested-by: Daniel Schwierzeck

    Paul Burton
     

23 Jul, 2017

1 commit

  • FreeBSD recently switch to it's BSDL dtc. While it support most of the
    features of the GPL one it still lacks the incbin directive.
    Add the possibility to specify which dtc we want to use for compiling dts
    and generating fit image.

    Signed-off-by: Emmanuel Vadot
    Acked-by: Simon Glass

    Emmanuel Vadot
     

03 Jun, 2017

2 commits