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

Simon Glass sjg at chromium.org
Thu Mar 18 08:24:50 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.

Changes in v3:
- Add new patch to support symbols in u-boot-spl-nodtb
- Add new patch to drop unnecessary 'type' property in tests
- Add new patch to use the fake SPL/TPL only if requested
- Add new patch to drop an unnecessary field in output_fdt_info
- Add new patch to move the comment for GetFdts() to the base class
- Add new patch to use standard filenames for SPL/TPL devicetree
- Update sizes for new behaviour
- Fix x86 docs which refer to this
- Update entry docs
- Make a symlink to the entry docs

Changes in v2:
- Move UEFI under develop/ instead
- Add new patch to move driver model docs under develop/
- Put binman docs in doc/develop and FIT in doc/usage
- Rename README.rst to binman.rst and use a symlink

Simon Glass (27):
  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: Support symbols in u-boot-spl-nodtb
  binman: Add support for u-boot-tpl-nodtb
  binman: Add support for u-boot-tpl-bss-bad
  binman: Drop unnecessary 'type' property in tests
  binman: Use the fake SPL/TPL only if requested
  binman: Drop unnecessary field in output_fdt_info
  binman: Move the comment for GetFdts() to the base class
  binman: Use standard filenames for SPL/TPL devicetree
  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 under develop/
  doc: Move driver model docs under develop/
  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/arch/x86.rst                              |   4 +-
 doc/{ => develop}/driver-model/bind.rst       |   0
 doc/{ => develop}/driver-model/debugging.rst  |   0
 doc/{ => develop}/driver-model/design.rst     |   0
 doc/{ => develop}/driver-model/ethernet.rst   |   0
 doc/{ => develop}/driver-model/fdt-fixup.rst  |   0
 .../driver-model/fs_firmware_loader.rst       |   0
 doc/{ => develop}/driver-model/i2c-howto.rst  |   0
 doc/{ => develop}/driver-model/index.rst      |   4 +
 doc/{ => develop}/driver-model/livetree.rst   |   0
 doc/{ => develop}/driver-model/migration.rst  |   0
 doc/{ => develop}/driver-model/of-plat.rst    |   0
 doc/{ => develop}/driver-model/pci-info.rst   |   0
 .../driver-model/pmic-framework.rst           |   0
 .../driver-model/remoteproc-framework.rst     |   0
 .../driver-model/serial-howto.rst             |   0
 .../driver-model/soc-framework.rst            |   0
 doc/{ => develop}/driver-model/spi-howto.rst  |   0
 doc/{ => develop}/driver-model/usb-info.rst   |   0
 doc/develop/index.rst                         |  10 +
 doc/develop/package/binman.rst                |   1 +
 doc/develop/package/entries.rst               |   1 +
 doc/develop/package/index.rst                 |  19 +
 doc/{ => develop}/uefi/index.rst              |   4 +
 doc/{ => develop}/uefi/iscsi.rst              |   0
 doc/{ => develop}/uefi/u-boot_on_efi.rst      |   0
 doc/{ => develop}/uefi/uefi.rst               |   0
 doc/index.rst                                 |  23 -
 doc/usage/fit.rst                             |   8 +
 doc/usage/index.rst                           |   1 +
 tools/binman/README.rst                       |   1 +
 tools/binman/{README => binman.rst}           | 959 ++++++++++--------
 tools/binman/cmdline.py                       |   5 +-
 tools/binman/control.py                       |  28 +-
 tools/binman/{README.entries => entries.rst}  | 336 ++++--
 tools/binman/entry.py                         |  73 +-
 tools/binman/entry_test.py                    |  12 +
 tools/binman/etype/atf_bl31.py                |   2 +-
 tools/binman/etype/blob.py                    |   4 +-
 tools/binman/etype/blob_dtb.py                |   9 -
 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        |  24 +-
 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        |  42 +
 tools/binman/etype/u_boot_with_ucode_ptr.py   |   2 +-
 tools/binman/ftest.py                         | 268 ++++-
 tools/binman/image.py                         |  17 +-
 tools/binman/index.rst                        |   9 +
 tools/binman/setup.py                         |   2 +-
 tools/binman/state.py                         |  71 +-
 tools/binman/test/053_symbols.dts             |   2 +-
 tools/binman/test/149_symbols_tpl.dts         |   1 -
 tools/binman/test/155_symbols_tpl_x86.dts     |   1 -
 tools/binman/test/192_symbols_nodtb.dts       |  26 +
 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 +
 tools/binman/test/u_boot_binman_syms.c        |   2 +-
 tools/patman/tools.py                         |   8 +-
 91 files changed, 1697 insertions(+), 745 deletions(-)
 rename doc/{ => develop}/driver-model/bind.rst (100%)
 rename doc/{ => develop}/driver-model/debugging.rst (100%)
 rename doc/{ => develop}/driver-model/design.rst (100%)
 rename doc/{ => develop}/driver-model/ethernet.rst (100%)
 rename doc/{ => develop}/driver-model/fdt-fixup.rst (100%)
 rename doc/{ => develop}/driver-model/fs_firmware_loader.rst (100%)
 rename doc/{ => develop}/driver-model/i2c-howto.rst (100%)
 rename doc/{ => develop}/driver-model/index.rst (68%)
 rename doc/{ => develop}/driver-model/livetree.rst (100%)
 rename doc/{ => develop}/driver-model/migration.rst (100%)
 rename doc/{ => develop}/driver-model/of-plat.rst (100%)
 rename doc/{ => develop}/driver-model/pci-info.rst (100%)
 rename doc/{ => develop}/driver-model/pmic-framework.rst (100%)
 rename doc/{ => develop}/driver-model/remoteproc-framework.rst (100%)
 rename doc/{ => develop}/driver-model/serial-howto.rst (100%)
 rename doc/{ => develop}/driver-model/soc-framework.rst (100%)
 rename doc/{ => develop}/driver-model/spi-howto.rst (100%)
 rename doc/{ => develop}/driver-model/usb-info.rst (100%)
 create mode 120000 doc/develop/package/binman.rst
 create mode 120000 doc/develop/package/entries.rst
 create mode 100644 doc/develop/package/index.rst
 rename doc/{ => develop}/uefi/index.rst (51%)
 rename doc/{ => develop}/uefi/iscsi.rst (100%)
 rename doc/{ => develop}/uefi/u-boot_on_efi.rst (100%)
 rename doc/{ => develop}/uefi/uefi.rst (100%)
 create mode 100644 doc/usage/fit.rst
 create mode 120000 tools/binman/README.rst
 rename tools/binman/{README => binman.rst} (64%)
 rename tools/binman/{README.entries => entries.rst} (82%)
 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_symbols_nodtb.dts
 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.31.0.rc2.261.g7f71774620-goog



More information about the U-Boot mailing list