1. 14 Mar, 2016 6 commits
    • Simon Glass's avatar
      spl: Add an option to load a FIT containing U-Boot · f1dcee59
      Simon Glass authored
      This provides a way to load a FIT containing U-Boot and a selection of device
      tree files. The board can select the correct device tree by probing the
      hardware. Then U-Boot is started with the selected device tree.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      f1dcee59
    • Simon Glass's avatar
      spl: Add a way for boards to select which device tree to load · 4b307f23
      Simon Glass authored
      SPL calls this function with each device tree it can find in the FIT. The
      board should implement this function, using whatever hardware detection it
      can muster to determine the correct device tree.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      4b307f23
    • Simon Glass's avatar
      image: Add functions to obtain short names · cef2e514
      Simon Glass authored
      Sometimes it is useful to obtain the short name for an Operating System,
      architecture or compression mechanism. Provide functions for this.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      cef2e514
    • Simon Glass's avatar
      fdt: Allow libfdt to be used in SPL · aa34fbc0
      Simon Glass authored
      Add an option to enable libfdt in SPL. This can be useful when decoding
      FIT files in SPL.
      
      We need to make sure this option is not enabled in SPL by this change.
      Also this option needs to be enabled in host builds. Si add a new
      IMAGE_USE_LIBFDT #define which can be used in files that are built on the
      host but must also build for U-Boot and SPL.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      aa34fbc0
    • Simon Glass's avatar
      Kconfig: Move CONFIG_FIT and related options to Kconfig · 73223f0e
      Simon Glass authored
      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: default avatarSimon Glass <sjg@chromium.org>
      [trini: Add microblaze change, various configs/ re-applies]
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      73223f0e
    • Simon Glass's avatar
      Move CONFIG_OF_LIBFDT to Kconfig · 69e173eb
      Simon Glass authored
      Move this option to Kconfig and tidy up existing boards.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      69e173eb
  2. 26 Feb, 2016 1 commit
    • Simon Glass's avatar
      image: Correct the OS location code to work on sandbox · 7a80de46
      Simon Glass authored
      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: default avatarSimon Glass <sjg@chromium.org>
      7a80de46
  3. 19 Nov, 2015 1 commit
    • Nathan Rossi's avatar
      tools: zynqimage: Add Xilinx Zynq boot header generation to mkimage · 66eef1e7
      Nathan Rossi authored
      As with other platforms vendors love to create their own boot header
      formats. Xilinx is no different and for the Zynq platform/SoC there
      exists the "boot.bin" which is read by the platforms bootrom. This
      format is described to a useful extent within the Xilinx Zynq TRM.
      
      This implementation adds support for the 'zynqimage' to mkimage. The
      implementation only considers the most common boot header which is
      un-encrypted and packed directly after the boot header itself (no
      XIP, etc.). However this implementation does take into consideration the
      other fields of the header for image dumping use cases (vector table and
      register initialization).
      Signed-off-by: default avatarNathan Rossi <nathan@nathanrossi.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Tom Rini <trini@konsulko.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
      66eef1e7
  4. 11 Oct, 2015 1 commit
    • Julius Werner's avatar
      Add support for LZ4 decompression algorithm · 027b728d
      Julius Werner authored
      This patch adds support for LZ4-compressed FIT image contents. This
      algorithm has a slightly worse compression ration than LZO while being
      nearly twice as fast to decompress. When loading images from a fast
      storage medium this usually results in a boot time win.
      
      Sandbox-tested only since I don't have a U-Boot development system set
      up right now. The code was imported unchanged from coreboot where it's
      proven to work, though. I'm mostly interested in getting this recognized
      by mkImage for use in a downstream project.
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      027b728d
  5. 03 Sep, 2015 3 commits
    • Simon Glass's avatar
      rockchip: Add support for the SPI image · 10b84fe1
      Simon Glass authored
      The Rockchip boot ROM requires a particular file format for booting from SPI.
      It consists of a 512-byte header encoded with RC4, some padding and then up
      to 32KB of executable code in 2KB blocks, separated by 2KB empty blocks.
      
      Add support to mkimage so that an SPL image (u-boot-spl-dtb.bin) can be
      converted to this format. This allows booting from SPI flash on supported
      machines.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      10b84fe1
    • Simon Glass's avatar
      rockchip: Add support for the SD image · f9a3c278
      Simon Glass authored
      The Rockchip boot ROM requires a particular file format. It consists of
      64KB of zeroes, a 512-byte header encoded with RC4, and then some executable
      code.
      
      Add support to mkimage so that an SPL image (u-boot-spl-dtb.bin) can be
      converted to this format.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      f9a3c278
    • Simon Glass's avatar
      rockchip: Add the rkimage format to mkimage · a131c1f4
      Simon Glass authored
      Rockchip SoCs require certain formats for code that they execute, The
      simplest format is a 4-byte header at the start of a binary file. Add
      support for this so that we can create images that the boot ROM understands.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      a131c1f4
  6. 21 Jul, 2015 1 commit
  7. 28 May, 2015 2 commits
  8. 08 May, 2015 1 commit
    • Jörg Krause's avatar
      Fix musl build · 26e355d1
      Jörg Krause authored
      This patch fixes cross-compiling U-Boot tools with the musl C library:
        * including <sys/types.h> is needed for ulong
        * defining _GNU_SOURCE is needed for loff_t
      
      Tested for target at91sam9261ek_dataflash_cs3.
      Signed-off-by: default avatarJörg Krause <joerg.krause@embedded.rocks>
      Cc: Tom Rini <trini@konsulko.com>
      26e355d1
  9. 10 Apr, 2015 1 commit
  10. 30 Jan, 2015 1 commit
  11. 29 Jan, 2015 1 commit
    • Guilherme Maciel Ferreira's avatar
      dumpimage: fit: extract FIT images · 39931f96
      Guilherme Maciel Ferreira authored
      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 = <00000000>;
                entry = <00000000>;
                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: default avatarGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
      39931f96
  12. 14 Jan, 2015 1 commit
  13. 21 Nov, 2014 1 commit
  14. 29 Oct, 2014 1 commit
  15. 22 Oct, 2014 1 commit
  16. 06 Oct, 2014 1 commit
    • Charles Manning's avatar
      tools: socfpga: Add socfpga preloader signing to mkimage · 832472a9
      Charles Manning authored
      Like many platforms, the Altera socfpga platform requires that the
      preloader be "signed" in a certain way or the built-in boot ROM will
      not boot the code.
      
      This change automatically creates an appropriately signed preloader
      from an SPL image.
      
      The signed image includes a CRC which must, of course, be generated
      with a CRC generator that the SoCFPGA boot ROM agrees with otherwise
      the boot ROM will reject the image.
      
      Unfortunately the CRC used in this boot ROM is not the same as the
      Adler CRC in lib/crc32.c. Indeed the Adler code is not technically a
      CRC but is more correctly described as a checksum.
      
      Thus, the appropriate CRC generator is added to lib/ as crc32_alt.c.
      Signed-off-by: default avatarCharles Manning <cdhmanning@gmail.com>
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Chin Liang See <clsee@altera.com>
      Cc: Dinh Nguyen <dinguyen@altera.com>
      Cc: Albert Aribaud <albert.u.boot@aribaud.net>
      Cc: Tom Rini <trini@ti.com>
      Cc: Wolfgang Denk <wd@denx.de>
      Cc: Pavel Machek <pavel@denx.de>
      Acked-by: default avatarPavel Machek <pavel@denx.de>
      
      V2: - Zap unused constant
          - Explicitly print an error message in case of error
          - Rework the hdr_checksum() function to take the *header directly
            instead of a plan buffer pointer
      832472a9
  17. 28 Aug, 2014 1 commit
    • Simon Glass's avatar
      Fix test failure caused by bad handling of ramdisk · fe20a81a
      Simon Glass authored
      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: default avatarSimon Glass <sjg@chromium.org>
      fe20a81a
  18. 21 Aug, 2014 1 commit
    • Bryan Wu's avatar
      image: fix bootm failure for FIT image · 6c454fed
      Bryan Wu authored
      Commit b3dd64f5 "bootm: use genimg_get_kernel_addr()" introduced
      a bug for booting FIT image. It's because calling fit_parse_config()
      twice will give us wrong value in img_addr.
      
      Add a new function genimg_get_kernel_addr_fit() whichl will always
      return fit_uname_config and fit_uname_kernel for CONFIG_FIT.
      genimg_get_kernel_addr() will ignore those to parameters.
      Reported-by: default avatarYork Sun <yorksun@freescale.com>
      Signed-off-by: default avatarBryan Wu <pengw@nvidia.com>
      6c454fed
  19. 09 Aug, 2014 1 commit
  20. 07 Jul, 2014 1 commit
  21. 19 Jun, 2014 3 commits
  22. 05 Jun, 2014 2 commits
  23. 26 May, 2014 1 commit
    • Andreas Bießmann's avatar
      mkimage: add atmelimage · 7b1a4117
      Andreas Bießmann authored
      The new atmelimage converts a machine code BLOB to bootable ROM image. Atmel
      ROM has no sophisticated image format, it only checks the first 7 ARM vectors.
      The vectors can contain valid B or LDR opcodes, the 6'th vector contains the
      image size to load.
      
      Additionally the PMECC header can be written by the atmelimage target. The
      parameters must be given via the -n switch as a coma separated list. For
      example:
      
      mkimage -T atmelimage \
       -n usePmecc=1,sectorPerPage=4,sectorSize=512,spareSize=64,eccBits=4,eccOffset=36 \
       -d spl/u-boot-spl.bin boot.bin
      
      A provided image can be checked for correct header setup. It prints out the
      PMECC header parameters if it has one and the 6'th interrupt vector content.
      
      ---8<---
      Image Type:	ATMEL ROM-Boot Image with PMECC Header
      		PMECC header
      		====================
      		eccOffset:        36
      		sectorSize:      512
      		eccBitReq:         4
      		spareSize:        64
      		nbSectorPerPage:   4
      		usePmecc:          1
      		====================
      		6'th vector has 17044 set
      --->8---
      
      A SPL binary modified with the atmelimage mkimage target was succesfully
      booted on a sama5d34ek via MMC and NAND.
      Signed-off-by: default avatarAndreas Bießmann <andreas.devel@googlemail.com>
      Cc: Bo Shen <voice.shen@atmel.com>
      Cc: Heiko Schocher <hs@denx.de>
      Tested-by: default avatarBo Shen <voice.shen@atmel.com>
      7b1a4117
  24. 08 May, 2014 1 commit
    • Sebastian Siewior's avatar
      image: add support for Android's boot image format · 9ace3fc8
      Sebastian Siewior authored
      This patch adds support for the Android boot-image format. The header
      file is from the Android project and got slightly alterted so the struct +
      its defines are not generic but have something like a namespace. The
      header file is from bootloader/legacy/include/boot/bootimg.h. The header
      parsing has been written from scratch and I looked at
      bootloader/legacy/usbloader/usbloader.c for some details.
      The image contains the physical address (load address) of the kernel and
      ramdisk. This address is considered only for the kernel image.
      The "second image" defined in the image header is currently not
      supported. I haven't found anything that is creating this.
      
      v3 (Rob Herring):
      This is based on http://patchwork.ozlabs.org/patch/126797/ with the
      following changes:
      - Rebased to current mainline
      - Moved android image handling to separate functions in
        common/image-android.c
      - s/u8/char/ in header to fix string function warnings
      - Use SPDX identifiers for licenses
      - Cleaned-up file source information:
        android_image.h is from file include/boot/bootimg.h in repository:
        https://android.googlesource.com/platform/bootable/bootloader/legacy
        The git commit hash is 4205b865141ff2e255fe1d3bd16de18e217ef06a
        usbloader.c would be from the same commit, but it does not appear
        to have been used for any actual code.
      v4:
      - s/andriod/android/
      - Use a separate flag ep_found to track if the entry point has been set
      rather than using a magic value.
      
      Cc: Wolfgang Denk <wd@denx.de>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Reviewed-by: default avatarTom Rini <trini@ti.com>
      Reviewed-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      9ace3fc8
  25. 17 Apr, 2014 1 commit
  26. 21 Mar, 2014 4 commits