1. 25 7月, 2019 2 次提交
    • S
      binman: Allow entries to expand after packing · c52c9e7d
      Simon Glass 提交于
      Add support for detecting entries that change size after they have already
      been packed, and re-running packing when it happens.
      
      This removes the limitation that entry size cannot change after
      PackEntries() is called.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      c52c9e7d
    • S
      binman: Add a return value to ProcessContentsUpdate() · a0dcaf20
      Simon Glass 提交于
      At present if this function tries to update the contents such that the
      size changes, it raises an error. We plan to add the ability to change
      the size of entries after packing is completed, since in some cases it is
      not possible to determine the size in advance.
      
      An example of this is with a compressed device tree, where the values
      of the device tree change in SetCalculatedProperties() or
      ProcessEntryContents(). While the device tree itself does not change size,
      since placeholders for any new properties have already bee added by
      AddMissingProperties(), we cannot predict the size of the device tree
      after compression. If a value changes from 0 to 0x1234 (say), then the
      compressed device tree may expand.
      
      As a first step towards supporting this, make ProcessContentsUpdate()
      return a value indicating whether the content size is OK. For now this is
      always True (since otherwise binman raises an error), but later patches
      will adjust this.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      a0dcaf20
  2. 24 7月, 2019 4 次提交
  3. 11 7月, 2019 3 次提交
  4. 08 5月, 2019 1 次提交
  5. 30 9月, 2018 6 次提交
    • S
      binman: Correct fmap output on x86 · f8f8df6e
      Simon Glass 提交于
      Normally x86 platforms use the end-at-4gb option. This currently produces
      an FMAP with positions which have a large offset. The use of end-at-4gb is
      a useful convenience within binman, but we don't really want to export
      a map with these offsets.
      
      Fix this by subtracting the 'skip at start' parameter.
      
      Also put the code which convers names to fmap format, for clarity.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      f8f8df6e
    • S
      binman: Record the parent section of each section · 08723a7a
      Simon Glass 提交于
      At present sections have no record of their parent so it is not possible
      to traverse up the tree to the root and figure out the position of a
      section within the image.
      
      Change the constructor to record this information.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      08723a7a
    • S
      binman: Support hashing entries · e0e5df93
      Simon Glass 提交于
      Sometimesi it us useful to be able to verify the content of entries with
      a hash. Add an easy way to do this in binman. The hash information can be
      retrieved from the device tree at run time.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      e0e5df93
    • S
      binman: Support expanding entries · ba64a0bb
      Simon Glass 提交于
      It is useful to have entries which can grow automatically to fill
      available space. Add support for this.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      ba64a0bb
    • S
      binman: Support adding files · 0a98b28b
      Simon Glass 提交于
      In some cases it is useful to add a group of files to the image and be
      able to access them at run-time. Of course it is possible to generate
      the binman config file with a set of blobs each with a filename. But for
      convenience, add an entry type which can do this.
      
      Add required support (for adding nodes and string properties) into the
      state module.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      0a98b28b
    • S
      binman: Allow zero-size sections · b4e1a38c
      Simon Glass 提交于
      At present if there is only a zero-size entry in a section this is
      reported as an error, e.g.:
      
         Offset 0x0 (0) is outside the section starting at 0x0 (0)
      
      Adjust the logic in CheckEntries() to avoid this.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      b4e1a38c
  6. 29 9月, 2018 2 次提交
  7. 28 9月, 2018 1 次提交
    • J
      binman: Add a new "skip-at-start" property in Section class · 94b57db0
      Jagdish Gediya 提交于
      Currently binman calculates '_skip_at_start' based on 'end-at-4gb'
      property and it is used for x86 images.
      
      For PowerPC mpc85xx based CPU, CONFIG_SYS_TEXT_BASE is the entry
      offset of the first entry. It can be 0xeff40000 or 0xfff40000 for
      nor flash boot, 0x201000 for sd boot etc, so "_skip_at_start"
      should be set to CONFIG_SYS_TEXT_BASE.
      
      'end-at-4gb' property is not applicable where CONFIG_SYS_TEXT_BASE +
      Image size != 4gb.
      
      Add new property 'skip-at-start' in Section class so that
      '_skip_at_start' can be calculated either based on 'end-at-4gb'
      or based on "skip-at-start".
      
      Add a test case to check that 'skip-at-start' and 'end-at-4gb'
      property can't be used together.
      Signed-off-by: NJagdish Gediya <jagdish.gediya@nxp.com>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NYork Sun <york.sun@nxp.com>
      94b57db0
  8. 02 8月, 2018 5 次提交
    • S
      binman: Show the image position in the map · 1be70d20
      Simon Glass 提交于
      At present the map only shows the offset and size for each region. The
      image position provides the actual position of each entry in the image,
      regardless of the section hierarchy.
      
      Add the image position to the map.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      1be70d20
    • S
      binman: Add an entry for a Chromium vblock · 24d0d3c3
      Simon Glass 提交于
      This adds support for a Chromium verified boot block, used to sign a
      read-write section of the image.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      24d0d3c3
    • S
      binman: Add a new 'image-pos' property · dbf6be9f
      Simon Glass 提交于
      At present each entry has an offset within its parent section. This is
      useful for figuring out how entries relate to one another. However it
      is sometimes necessary to locate an entry within an image, regardless
      of which sections it is nested inside.
      
      Add a new 'image-pos' property to provide this information. Also add
      some documentation for the -u option binman provides, which updates the
      device tree with final entry information.
      
      Since the image position is a better symbol to use for the position of
      U-Boot as obtained by SPL, update the SPL symbols to use this instead of
      offset, which might be incorrect if hierarchical sections are used.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      dbf6be9f
    • S
      binman: Enhance the map and fdt-update output · 8122f396
      Simon Glass 提交于
      At present the .map file produced for each image does not include the
      overall image size. This is useful information.
      
      Update the code to generate it in the .map file as well as the updated
      FDT. Also fix a few comments while we are here.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      8122f396
    • S
      binman: Rename 'position' to 'offset' · 3ab9598d
      Simon Glass 提交于
      After some thought, I believe there is an unfortunate naming flaw in
      binman. Entries have a position and size, but now that we support
      hierarchical sections it is unclear whether a position should be an
      absolute position within the image, or a relative position within its
      parent section.
      
      At present 'position' actually means the relative position. This indicates
      a need for an 'image position' for code that wants to find the location of
      an entry without having to do calculations back through parents to
      discover this image position.
      
      A better name for the current 'position' or 'pos' is 'offset'. It is not
      always an absolute position, but it is always an offset from its parent
      offset.
      
      It is unfortunate to rename this concept now, 18 months after binman was
      introduced. However I believe it is the right thing to do. The impact is
      mostly limited to binman itself and a few changes to in-tree users to
      binman:
      
         tegra
         sunxi
         x86
      
      The change makes old binman definitions (e.g. downstream or out-of-tree)
      incompatible if they use the 'pos = <...>' property. Later work will
      adjust binman to generate an error when it is used.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      3ab9598d
  9. 09 7月, 2018 3 次提交
    • S
      binman: Add a SetCalculatedProperties() method · 078ab1a2
      Simon Glass 提交于
      Once binman has packed the image, the position and size of each entry is
      known. It is then possible for binman to update the device tree with these
      positions. Since placeholder values have been added, this does not affect
      the size of the device tree and therefore the packing does not need to be
      performed again.
      
      Add a new SetCalculatedProperties method to handle this.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      078ab1a2
    • S
      binman: Add a ProcessFdt() method · ecab8973
      Simon Glass 提交于
      Some entry types modify the device tree, e.g. to remove microcode or add a
      property. So far this just modifies their local copy and does not affect
      a 'shared' device tree.
      
      Rather than doing this modification in the ObtainContents() method, and a
      new ProcessFdt() method which is specifically designed to modify this
      shared device tree.
      
      Move the existing device-tree code over to use this method, reducing
      ObtainContents() to the goal of just obtaining the contents without any
      processing, even for device tree.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      ecab8973
    • S
      binman: Correct operation of ObtainContents() · 736bb0ae
      Simon Glass 提交于
      This method is supposed to return the contents of an entry. However at
      present there is no check that it actually does. Also some implementations
      do not return 'True' to indicate success, as required.
      
      Add a check for things working as expected, and correct the
      implementations.
      
      This requires some additional test cases to cover things which were missed
      originally. Add these at the same time.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      736bb0ae
  10. 08 6月, 2018 4 次提交
  11. 07 5月, 2018 1 次提交
    • T
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini 提交于
      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: NTom Rini <trini@konsulko.com>
      83d290c5
  12. 13 12月, 2017 1 次提交
    • S
      binman: Support accessing binman tables at run time · 19790632
      Simon Glass 提交于
      Binman construct images consisting of multiple binary files. These files
      sometimes need to know (at run timme) where their peers are located. For
      example, SPL may want to know where U-Boot is located in the image, so
      that it can jump to U-Boot correctly on boot.
      
      In general the positions where the binaries end up after binman has
      finished packing them cannot be known at compile time. One reason for
      this is that binman does not know the size of the binaries until
      everything is compiled, linked and converted to binaries with objcopy.
      
      To make this work, we add a feature to binman which checks each binary
      for symbol names starting with '_binman'. These are then decoded to figure
      out which entry and property they refer to. Then binman writes the value
      of this symbol into the appropriate binary. With this, the symbol will
      have the correct value at run time.
      
      Macros are used to make this easier to use. As an example, this declares
      a symbol that will access the 'u-boot-spl' entry to find the 'pos' value
      (i.e. the position of SPL in the image):
      
         binman_sym_declare(unsigned long, u_boot_spl, pos);
      
      This converts to a symbol called '_binman_u_boot_spl_prop_pos' in any
      binary that includes it. Binman then updates the value in that binary,
      ensuring that it can be accessed at runtime with:
      
         ulong u_boot_pos = binman_sym(ulong, u_boot_spl, pos);
      
      This assigns the variable u_boot_pos to the position of SPL in the image.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      19790632
  13. 23 11月, 2017 1 次提交
    • S
      binman: Set up 'entry' to permit full test coverage · 4d5994f9
      Simon Glass 提交于
      There is a little check at the top of entry.py which decides if importlib
      is available. At present this has no test coverage. To add this we will
      need to import the module twice, once with importlib and once without.
      In preparation for allowing a test to control the importing of this
      module, remove all global imports of the 'entry' module.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      4d5994f9
  14. 20 12月, 2016 1 次提交