[PATCH 00/20] binman: Support devicetree update in all entries

Simon Glass sjg at chromium.org
Sun Mar 7 20:31:27 CET 2021


U-Boot's various phase binaries actually comprise two or three pieces.
For example, u-boot.bin has the executable followed by a devicetree.

With binman we want to be able to update that devicetree with full image
information so that it is accessible to the executable. This is tricky
if it is not clear where the devicetree starts.

At present this is handled manually, by creating two separate nodes in
the binman definition, u-boot-nodtb and u-boot-dtb, so that binman sees
them separately and can easily update the devicetree. But this is not
very convenient.

Of course we could try to detect the devicetree in the binary, which is
easy enough for binman to do. But this approach rapidly gets out of hand.
When listing an existing image, should we show the devicetree separately?
If we don't then binman cannot extract it by itself, only the whole
binary. With SPL and TPL we may have BSS padding and this is harder
to detect reliably. Also, a design goal of binman is to provide full
information about what is in the image. The detection approach goes
against that.

So instead it seems best to convert these multi-part binaries into a
section with the component parts inside. We can do this automatically
without affecting the operation of binman very much.

One implementation option for this feature would be to update the entries
to behave in two different ways, i.e. either to act as a section containing
sub-entries, or as a simple blob. However this is tricky because each entry
has to use a particular base class. It is not reasonably possible for an
entry to choose between using one base class (e.g. blob) or another
(e.g. section), depending on a flag.

Instead, the approach taken in this series is to replace an entry type
with an expanded version, so 'u-boot' becomes 'u-boot-expanded', for
example. The new entry is a section containing two or three sub-entries.

A similar approach could be take to reduce the complexity of the x86 binman
definition. The microcode is either in TPL, SPL or U-Boot proper, so an
entryarg could control which of those is expanded to include microcode.
That possibility is left for future consideration.


Simon Glass (20):
  binman: Allow extracting to current directory
  binman: Document ExpandEntries() in the base class
  binman: Update entry help for files-align
  binman: Tidy up underscores in entry documentation
  binman: Correct the documentation for u-boot-spl-bss-pad
  binman: Add support for u-boot-tpl-nodtb
  binman: Add support for u-boot-tpl-bss-bad
  binman: Allow using an an 'expanded' entry type
  binman: Allow a way to select expanded entries
  binman: Plumb expanded entries through fully
  binman: Automatically expand phase binaries into sections
  Makefile: Pass new entry args to binman
  x86: Make use of binman expanded entries
  x86: dts: Drop unused CONFIG_SPL
  doc: Move UEFI down a bit
  binman: doc: Add documentation to htmldocs
  binman: Rearrange documentation into headings
  binman: Incorporate entry documentation
  binman: Drop repetitive heading for each entry
  binman: Update various pieces of the documentation

 Makefile                                     |   8 +
 arch/x86/dts/u-boot.dtsi                     |  17 +-
 doc/index.rst                                |  25 +-
 doc/package/binman                           |   1 +
 doc/package/fit.rst                          |   8 +
 doc/package/index.rst                        |  20 +
 tools/binman/{README => README.rst}          | 955 ++++++++++---------
 tools/binman/cmdline.py                      |   5 +-
 tools/binman/control.py                      |  28 +-
 tools/binman/{README.entries => entries.rst} | 318 ++++--
 tools/binman/entry.py                        |  71 +-
 tools/binman/entry_test.py                   |  12 +
 tools/binman/etype/atf_bl31.py               |   2 +-
 tools/binman/etype/blob.py                   |   4 +-
 tools/binman/etype/blob_ext.py               |   2 +-
 tools/binman/etype/blob_phase.py             |  51 +
 tools/binman/etype/cbfs.py                   |  12 +-
 tools/binman/etype/fdtmap.py                 |  30 +-
 tools/binman/etype/files.py                  |   2 +-
 tools/binman/etype/fit.py                    |  21 +-
 tools/binman/etype/intel_cmc.py              |   2 +-
 tools/binman/etype/intel_fsp.py              |   2 +-
 tools/binman/etype/intel_fsp_m.py            |   2 +-
 tools/binman/etype/intel_fsp_s.py            |   2 +-
 tools/binman/etype/intel_fsp_t.py            |   2 +-
 tools/binman/etype/intel_ifwi.py             |  10 +-
 tools/binman/etype/intel_me.py               |   2 +-
 tools/binman/etype/intel_mrc.py              |   2 +-
 tools/binman/etype/intel_refcode.py          |   2 +-
 tools/binman/etype/intel_vbt.py              |   2 +-
 tools/binman/etype/intel_vga.py              |   2 +-
 tools/binman/etype/mkimage.py                |   4 +-
 tools/binman/etype/scp.py                    |   2 +-
 tools/binman/etype/section.py                |  15 +-
 tools/binman/etype/text.py                   |   6 +-
 tools/binman/etype/u_boot.py                 |   8 +-
 tools/binman/etype/u_boot_dtb_with_ucode.py  |   4 +-
 tools/binman/etype/u_boot_expanded.py        |  24 +
 tools/binman/etype/u_boot_nodtb.py           |   8 +-
 tools/binman/etype/u_boot_spl.py             |   3 +
 tools/binman/etype/u_boot_spl_bss_pad.py     |  17 +-
 tools/binman/etype/u_boot_spl_expanded.py    |  45 +
 tools/binman/etype/u_boot_spl_nodtb.py       |  10 +-
 tools/binman/etype/u_boot_tpl.py             |   3 +
 tools/binman/etype/u_boot_tpl_bss_pad.py     |  44 +
 tools/binman/etype/u_boot_tpl_expanded.py    |  45 +
 tools/binman/etype/u_boot_tpl_nodtb.py       |  28 +
 tools/binman/etype/u_boot_with_ucode_ptr.py  |   2 +-
 tools/binman/ftest.py                        | 219 ++++-
 tools/binman/image.py                        |  17 +-
 tools/binman/index.rst                       |   9 +
 tools/binman/setup.py                        |   2 +-
 tools/binman/state.py                        |  19 +-
 tools/binman/test/192_u_boot_tpl_nodtb.dts   |  13 +
 tools/binman/test/193_tpl_bss_pad.dts        |  19 +
 tools/binman/test/194_fdt_incl.dts           |  17 +
 tools/binman/test/195_fdt_incl_tpl.dts       |  13 +
 57 files changed, 1547 insertions(+), 671 deletions(-)
 create mode 120000 doc/package/binman
 create mode 100644 doc/package/fit.rst
 create mode 100644 doc/package/index.rst
 rename tools/binman/{README => README.rst} (64%)
 rename tools/binman/{README.entries => entries.rst} (83%)
 create mode 100644 tools/binman/etype/blob_phase.py
 create mode 100644 tools/binman/etype/u_boot_expanded.py
 create mode 100644 tools/binman/etype/u_boot_spl_expanded.py
 create mode 100644 tools/binman/etype/u_boot_tpl_bss_pad.py
 create mode 100644 tools/binman/etype/u_boot_tpl_expanded.py
 create mode 100644 tools/binman/etype/u_boot_tpl_nodtb.py
 create mode 100644 tools/binman/index.rst
 create mode 100644 tools/binman/test/192_u_boot_tpl_nodtb.dts
 create mode 100644 tools/binman/test/193_tpl_bss_pad.dts
 create mode 100644 tools/binman/test/194_fdt_incl.dts
 create mode 100644 tools/binman/test/195_fdt_incl_tpl.dts

-- 
2.30.1.766.gb4fecdf3b7-goog



More information about the U-Boot mailing list