1. 27 Jan, 2017 7 commits
  2. 14 Jan, 2017 2 commits
    • Masahiro Yamada's avatar
      fiptool: fix add_image() and add_image_desc() implementation · 11c0a4ff
      Masahiro Yamada authored
      The "make fip" shows the content of the generated FIP at the end of
      the build.  (This is shown by "fiptool info" command.)
      
      Prior to commit e0f083a0 ("fiptool: Prepare ground for expanding
      the set of images at runtime"), the last part of the build log of
       make CROSS_COMPILE=aarch64-linux-gnu- BL33=../u-boot/u-boot.bin fip
      was like follows:
      
       Trusted Boot Firmware BL2: offset=0xB0, size=0x4188, cmdline="--tb-fw"
       EL3 Runtime Firmware BL31: offset=0x4238, size=0x6090, cmdline="--soc-fw"
       Non-Trusted Firmware BL33: offset=0xA2C8, size=0x58B51, cmdline="--nt-fw"
      
      With that commit, now it is displayed like follows:
      
       Non-Trusted Firmware BL33: offset=0xB0, size=0x58B51, cmdline="--nt-fw"
       EL3 Runtime Firmware BL31: offset=0x58C01, size=0x6090, cmdline="--soc-fw"
       Trusted Boot Firmware BL2: offset=0x5EC91, size=0x4188, cmdline="--tb-fw"
      
      You will notice two differences:
        - the contents are displayed in BL33, BL31, BL2 order
        - the offset values are wrong
      
      The latter is more serious, and means "fiptool info" is broken.
      
      Another interesting change is "fiptool update" every time reverses
      the image order.  For example, if you input FIP with BL2, BL31, BL33
      in this order, the command will pack BL33, BL31, BL2 into FIP, in
      this order.  Of course, the order of components is not a big deal
      except that users will have poor impression about this.
      
      The root cause is in the implementation of add_image(); the
      image_head points to the last added image.  For example, if you call
      add_image() for BL2, BL31, BL33 in this order, the resulted image
      chain is:
      
        image_head -> BL33 -> BL31 -> BL2
      
      Then, they are processed from the image_head in "for" loops:
      
        for (image = image_head; image != NULL; image = image->next) {
      
      This means images are handled in Last-In First-Out manner.
      
      Interestingly, "fiptool create" is still correct because
      add_image_desc() also reverses the descriptor order and the command
      works as before due to the double reverse.
      
      The implementation of add_image() is efficient, but it made the
      situation too complicated.
      
      Let's make image_head point to the first added image.  This will
      add_image() inefficient because every call of add_image() follows
      the ->next chain to get the tail.  We can solve it by adopting a
      nicer linked list structure, but I am not doing as far as that
      because we handle only limited number of images anyway.
      
      Do likewise for add_image_desc().
      
      Fixes: e0f083a0
      
       ("fiptool: Prepare ground for expanding the set of images at runtime")
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      11c0a4ff
    • Masahiro Yamada's avatar
      fiptool: introduce xzalloc() helper function · 696ccba6
      Masahiro Yamada authored
      
      
      We often want to zero out allocated memory.
      
      My main motivation for this commit is to set image::next and
      image_desc::next to NULL automatically in the next commit.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      696ccba6
  3. 30 Dec, 2016 5 commits
  4. 05 Dec, 2016 4 commits
  5. 26 Oct, 2016 1 commit
  6. 18 Oct, 2016 1 commit
    • dp-arm's avatar
      fiptool: Link `toc_entry` and `image` structures via UUID · b04efcce
      dp-arm authored
      
      
      The `toc_entry` and `image` data structures had a cyclic
      relationship.  This patch removes the explicit dependencies and introduces
      functions to link them via the UUID.
      
      This change highlights the intent of the code better and makes it more
      flexible for future enhancements.
      
      Change-Id: I0c3dd7bfda2a631a3827c8ba4831849c500affe9
      Signed-off-by: default avatardp-arm <dimitris.papastamos@arm.com>
      b04efcce
  7. 15 Sep, 2016 1 commit
    • dp-arm's avatar
      fiptool: Invoke command specific usage function · 85ee2778
      dp-arm authored
      Instead of always calling the top level usage function when an
      error is detected, call the command-specific usage function.
      
      For example running `fiptool create` will produce the same output
      as `fiptool help create`.  This is more convenient for the user
      when they make a mistake.
      
      Change-Id: I60178ab89d47adf93cdfe6d8b5d5f778a5ea3bca
      85ee2778
  8. 12 Sep, 2016 1 commit
    • dp-arm's avatar
      fiptool: Add support for printing the sha256 digest with info command · 9df69ba3
      dp-arm authored
      This feature allows one to quickly verify that the expected
      image is contained in the FIP without extracting the image and
      running sha256sum(1) on it.
      
      The sha256 digest is only shown when the verbose flag is used.
      
      This change requires libssl-dev to be installed in order to build
      Trusted Firmware. Previously, libssl-dev was optionally needed only
      to support Trusted Board Boot configurations.
      
      Fixes ARM-Software/tf-issues#124
      
      Change-Id: Ifb1408d17f483d482bb270a589ee74add25ec5a6
      9df69ba3
  9. 25 Aug, 2016 1 commit
  10. 15 Aug, 2016 1 commit
  11. 29 Jul, 2016 1 commit
    • dp-arm's avatar
      Replace fip_create with fiptool · 819281ee
      dp-arm authored
      fiptool provides a more consistent and intuitive interface compared to
      the fip_create program.  It serves as a better base to build on more
      features in the future.
      
      fiptool supports various subcommands.  Below are the currently
      supported subcommands:
      
      1) info   - List the images contained in a FIP file.
      2) create - Create a new FIP file with the given images.
      3) update - Update an existing FIP with the given images.
      4) unpack - Extract a selected set or all the images from a FIP file.
      5) remove - Remove images from a FIP file.  This is a new command that
         was not present in fip_create.
      
      To create a new FIP file, replace "fip_create" with "fiptool create".
      
      To update a FIP file, replace "fip_create" with "fiptool update".
      
      To dump the contents of a FIP file, replace "fip_create --dump" with
      "fiptool info".
      
      A compatibility script that emulates the basic functionality of
      fip_create is provided.  Existing scripts might or might not work with
      the compatibility script.  Users are strongly encouraged to migrate to
      fiptool.
      
      Fixes ARM-Software/tf-issues#87
      Fixes ARM-Software/tf-issues#108
      Fixes ARM-Software/tf-issues#361
      
      Change-Id: I7ee4da7ac60179cc83cf46af890fd8bc61a53330
      819281ee