Skip to contentSkip to conversation

binman: Support devicetree update in all entries

PATCH New Simon Glass 2 participants 56 messages Mar 18, 2021 – Mar 19, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v3 cover binman: Support devicetree update in all entries

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
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#1 lore raw

PATCH v3 1/27 binman: Allow extracting to current directory

Extracting files to the current directory is not normally a very friendly thing to do, but it can be warranted, e.g. in a new temporary dir. At present binman reports an error when such an attempt is made. Fix it.

---

(no changes since v1)

 tools/binman/control.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/binman/control.py +1 -1
index 1952b2abf48..9c0cafeafc4 100644
@@ -241,7 +241,7 @@ def ExtractEntries(image_fname, output_fname, outdir, entry_paths,
         # If this entry has children, create a directory for it and put its
         # data in a file called 'root' in that directory
         if entry.GetEntries():
-            if not os.path.exists(fname):
+            if fname and not os.path.exists(fname):
                 os.makedirs(fname)
             fname = os.path.join(fname, 'root')
         tout.Notice("Write entry '%s' size %x to '%s'" %
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#2 lore raw

PATCH v3 1/27 binman: Allow extracting to current directory

Extracting files to the current directory is not normally a very friendly thing to do, but it can be warranted, e.g. in a new temporary dir. At present binman reports an error when such an attempt is made. Fix it.

---

(no changes since v1)

 tools/binman/control.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm/next, thanks!

#3 lore raw

PATCH v3 2/27 binman: Document ExpandEntries() in the base class

In reply to Simon Glass

Move the documentation to the base method as it is with other methods. Also update it a little while we are here.

---

(no changes since v1)

 tools/binman/entry.py         | 11 +++++++++++
 tools/binman/etype/section.py |  6 ------
 2 files changed, 11 insertions(+), 6 deletions(-)
tools/binman/entry.py +11 -0
index d58a730f3d5..507760e2a86 100644
@@ -211,6 +211,17 @@ class Entry(object):
         return {}
 
     def ExpandEntries(self):
+        """Expand out entries which produce other entries
+
+        Some entries generate subnodes automatically, from which sub-entries
+        are then created. This method allows those to be added to the binman
+        definition for the current image. An entry which implements this method
+        should call state.AddSubnode() to add a subnode and can add properties
+        with state.AddString(), etc.
+
+        An example is 'files', which produces a section containing a list of
+        files.
+        """
         pass
 
     def AddMissingProperties(self, have_image_pos):
tools/binman/etype/section.py +0 -6
index 1ceadef13f3..2103919b0c3 100644
@@ -126,12 +126,6 @@ class Entry_section(Entry):
         return True
 
     def ExpandEntries(self):
-        """Expand out any entries which have calculated sub-entries
-
-        Some entries are expanded out at runtime, e.g. 'files', which produces
-        a section containing a list of files. Process these entries so that
-        this information is added to the device tree.
-        """
         super().ExpandEntries()
         for entry in self._entries.values():
             entry.ExpandEntries()
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#4 lore raw

PATCH v3 2/27 binman: Document ExpandEntries() in the base class

Move the documentation to the base method as it is with other methods. Also update it a little while we are here.

---

(no changes since v1)

 tools/binman/entry.py         | 11 +++++++++++
 tools/binman/etype/section.py |  6 ------
 2 files changed, 11 insertions(+), 6 deletions(-)

Applied to u-boot-dm/next, thanks!

#5 lore raw

PATCH v3 3/27 binman: Update entry help for files-align

In reply to Simon Glass

Regenerate the entry documentation, which step was missed when the files-align feature was added.

Fixes 6eb9932668f ("binman: Support alignment of files")

---

(no changes since v1)

 tools/binman/README.entries | 1 +
 1 file changed, 1 insertion(+)
tools/binman/README.entries +1 -0
index 999b77690f0..7cca030409e 100644
@@ -302,6 +302,7 @@ Properties / Entry arguments:
     - files-compress: Compression algorithm to use:
         none: No compression
         lz4: Use lz4 compression (via 'lz4' command-line utility)
+    - files-align: Align each file to the given alignment
 
 This entry reads a number of files and places each in a separate sub-entry
 within this entry. To access these you need to enable device-tree updates
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#6 lore raw

PATCH v3 3/27 binman: Update entry help for files-align

Regenerate the entry documentation, which step was missed when the files-align feature was added.

Fixes 6eb9932668f ("binman: Support alignment of files")

---

(no changes since v1)

 tools/binman/README.entries | 1 +
 1 file changed, 1 insertion(+)

Applied to u-boot-dm/next, thanks!

#7 lore raw

PATCH v3 4/27 binman: Tidy up underscores in entry documentation

In reply to Simon Glass

Several entries currently use an underscore in the entry-type name, but in fact a hyphen is used. Update the docs to fix this as it might be confusing.

Also simplify the 'filename' comment and fix the 'operation' typo.

---

(no changes since v1)

 tools/binman/README.entries                 | 23 ++++++++++-----------
 tools/binman/etype/blob.py                  |  2 +-
 tools/binman/etype/u_boot.py                |  2 +-
 tools/binman/etype/u_boot_dtb_with_ucode.py |  4 ++--
 tools/binman/etype/u_boot_nodtb.py          |  6 +++---
 tools/binman/etype/u_boot_spl_nodtb.py      |  7 +++----
 tools/binman/etype/u_boot_with_ucode_ptr.py |  2 +-
 7 files changed, 22 insertions(+), 24 deletions(-)
tools/binman/README.entries +11 -12
index 7cca030409e..3fbc06d9264 100644
@@ -39,7 +39,7 @@ Properties / Entry arguments:
 
 This entry reads data from a file and places it in the entry. The
 default filename is often specified specified by the subclass. See for
-example the 'u_boot' entry which provides the filename 'u-boot.bin'.
+example the 'u-boot' entry which provides the filename 'u-boot.bin'.
 
 If compression is enabled, an extra 'uncomp-size' property is written to
 the node (if enabled with -u) which provides the uncompressed size of the
@@ -840,7 +840,7 @@ Properties / Entry arguments:
 
 This is the U-Boot binary, containing relocation information to allow it
 to relocate itself at runtime. The binary typically includes a device tree
-blob at the end of it. Use u_boot_nodtb if you want to package the device
+blob at the end of it. Use u-boot-nodtb if you want to package the device
 tree separately.
 
 U-Boot can access binman symbols at runtime. See:
@@ -876,9 +876,9 @@ See Entry_u_boot_ucode for full details of the three entries involved in
 this process. This entry provides the U-Boot device-tree file, which
 contains the microcode. If the microcode is not being collated into one
 place then the offset and size of the microcode is recorded by this entry,
-for use by u_boot_with_ucode_ptr. If it is being collated, then this
+for use by u-boot-with-ucode_ptr. If it is being collated, then this
 entry deletes the microcode from the device tree (to save space) and makes
-it available to u_boot_ucode.
+it available to u-boot-ucode.
 
 
 
@@ -920,12 +920,12 @@ Entry: u-boot-nodtb: U-Boot flat binary without device tree appended
 --------------------------------------------------------------------
 
 Properties / Entry arguments:
-    - filename: Filename of u-boot.bin (default 'u-boot-nodtb.bin')
+    - filename: Filename to include (default 'u-boot-nodtb.bin')
 
 This is the U-Boot binary, containing relocation information to allow it
 to relocate itself at runtime. It does not include a device tree blob at
-the end of it so normally cannot work without it. You can add a u_boot_dtb
-entry after this one, or use a u_boot entry instead (which contains both
+the end of it so normally cannot work without it. You can add a u-boot-dtb
+entry after this one, or use a u-boot entry instead (which contains both
 U-Boot and the device tree).
 
 
@@ -1000,13 +1000,12 @@ Entry: u-boot-spl-nodtb: SPL binary without device tree appended
 ----------------------------------------------------------------
 
 Properties / Entry arguments:
-    - filename: Filename of spl/u-boot-spl-nodtb.bin (default
-        'spl/u-boot-spl-nodtb.bin')
+    - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin')
 
 This is the U-Boot SPL binary, It does not include a device tree blob at
 the end of it so may not be able to work without it, assuming SPL needs
-a device tree to operation on your platform. You can add a u_boot_spl_dtb
-entry after this one, or use a u_boot_spl entry instead (which contains
+a device tree to operate on your platform. You can add a u-boot-spl-dtb
+entry after this one, or use a u-boot-spl entry instead (which contains
 both SPL and the device tree).
 
 
@@ -1148,7 +1147,7 @@ Properties / Entry arguments:
 See Entry_u_boot_ucode for full details of the three entries involved in
 this process. This entry updates U-Boot with the offset and size of the
 microcode, to allow early x86 boot code to find it without doing anything
-complicated. Otherwise it is the same as the u_boot entry.
+complicated. Otherwise it is the same as the u-boot entry.
 
 
 
tools/binman/etype/blob.py +1 -1
index 81756c326d9..e609a8b253f 100644
@@ -24,7 +24,7 @@ class Entry_blob(Entry):
 
     This entry reads data from a file and places it in the entry. The
     default filename is often specified specified by the subclass. See for
-    example the 'u_boot' entry which provides the filename 'u-boot.bin'.
+    example the 'u-boot' entry which provides the filename 'u-boot.bin'.
 
     If compression is enabled, an extra 'uncomp-size' property is written to
     the node (if enabled with -u) which provides the uncompressed size of the
tools/binman/etype/u_boot.py +1 -1
index 4767197e13a..de783b26772 100644
@@ -16,7 +16,7 @@ class Entry_u_boot(Entry_blob):
 
     This is the U-Boot binary, containing relocation information to allow it
     to relocate itself at runtime. The binary typically includes a device tree
-    blob at the end of it. Use u_boot_nodtb if you want to package the device
+    blob at the end of it. Use u-boot-nodtb if you want to package the device
     tree separately.
 
     U-Boot can access binman symbols at runtime. See:
tools/binman/etype/u_boot_dtb_with_ucode.py +2 -2
index 66a9db55cad..554b3b2e008 100644
@@ -19,9 +19,9 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob_dtb):
     this process. This entry provides the U-Boot device-tree file, which
     contains the microcode. If the microcode is not being collated into one
     place then the offset and size of the microcode is recorded by this entry,
-    for use by u_boot_with_ucode_ptr. If it is being collated, then this
+    for use by u-boot-with-ucode_ptr. If it is being collated, then this
     entry deletes the microcode from the device tree (to save space) and makes
-    it available to u_boot_ucode.
+    it available to u-boot-ucode.
     """
     def __init__(self, section, etype, node):
         # Put this here to allow entry-docs and help to work without libfdt
tools/binman/etype/u_boot_nodtb.py +3 -3
index e84df490f65..289b24fa6c6 100644
@@ -12,12 +12,12 @@ class Entry_u_boot_nodtb(Entry_blob):
     """U-Boot flat binary without device tree appended
 
     Properties / Entry arguments:
-        - filename: Filename of u-boot.bin (default 'u-boot-nodtb.bin')
+        - filename: Filename to include (default 'u-boot-nodtb.bin')
 
     This is the U-Boot binary, containing relocation information to allow it
     to relocate itself at runtime. It does not include a device tree blob at
-    the end of it so normally cannot work without it. You can add a u_boot_dtb
-    entry after this one, or use a u_boot entry instead (which contains both
+    the end of it so normally cannot work without it. You can add a u-boot-dtb
+    entry after this one, or use a u-boot entry instead (which contains both
     U-Boot and the device tree).
     """
     def __init__(self, section, etype, node):
tools/binman/etype/u_boot_spl_nodtb.py +3 -4
index c154cfde57b..41d75054910 100644
@@ -12,13 +12,12 @@ class Entry_u_boot_spl_nodtb(Entry_blob):
     """SPL binary without device tree appended
 
     Properties / Entry arguments:
-        - filename: Filename of spl/u-boot-spl-nodtb.bin (default
-            'spl/u-boot-spl-nodtb.bin')
+        - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin')
 
     This is the U-Boot SPL binary, It does not include a device tree blob at
     the end of it so may not be able to work without it, assuming SPL needs
-    a device tree to operation on your platform. You can add a u_boot_spl_dtb
-    entry after this one, or use a u_boot_spl entry instead (which contains
+    a device tree to operate on your platform. You can add a u-boot-spl-dtb
+    entry after this one, or use a u-boot-spl entry instead (which contains
     both SPL and the device tree).
     """
     def __init__(self, section, etype, node):
tools/binman/etype/u_boot_with_ucode_ptr.py +1 -1
index 92d2fc68538..20be22a1fd2 100644
@@ -26,7 +26,7 @@ class Entry_u_boot_with_ucode_ptr(Entry_blob):
     See Entry_u_boot_ucode for full details of the three entries involved in
     this process. This entry updates U-Boot with the offset and size of the
     microcode, to allow early x86 boot code to find it without doing anything
-    complicated. Otherwise it is the same as the u_boot entry.
+    complicated. Otherwise it is the same as the u-boot entry.
     """
     def __init__(self, section, etype, node):
         super().__init__(section, etype, node)
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#8 lore raw

PATCH v3 4/27 binman: Tidy up underscores in entry documentation

Several entries currently use an underscore in the entry-type name, but in fact a hyphen is used. Update the docs to fix this as it might be confusing.

Also simplify the 'filename' comment and fix the 'operation' typo.

---

(no changes since v1)

 tools/binman/README.entries                 | 23 ++++++++++-----------
 tools/binman/etype/blob.py                  |  2 +-
 tools/binman/etype/u_boot.py                |  2 +-
 tools/binman/etype/u_boot_dtb_with_ucode.py |  4 ++--
 tools/binman/etype/u_boot_nodtb.py          |  6 +++---
 tools/binman/etype/u_boot_spl_nodtb.py      |  7 +++----
 tools/binman/etype/u_boot_with_ucode_ptr.py |  2 +-
 7 files changed, 22 insertions(+), 24 deletions(-)

Applied to u-boot-dm/next, thanks!

#9 lore raw

PATCH v3 5/27 binman: Correct the documentation for u-boot-spl-bss-pad

In reply to Simon Glass

The documentation for this entry indicates that the SPL binary is included along with the padding. It is not, so update it to correct the error.

---

(no changes since v1)

 tools/binman/README.entries              | 17 ++++++++++-------
 tools/binman/etype/u_boot_spl_bss_pad.py | 17 ++++++++++-------
 2 files changed, 20 insertions(+), 14 deletions(-)
tools/binman/README.entries +10 -7
index 3fbc06d9264..5c6663e2c7c 100644
@@ -960,13 +960,16 @@ Entry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region
 Properties / Entry arguments:
     None
 
-This is similar to u_boot_spl except that padding is added after the SPL
-binary to cover the BSS (Block Started by Symbol) region. This region holds
-the various used by SPL. It is set to 0 by SPL when it starts up. If you
-want to append data to the SPL image (such as a device tree file), you must
-pad out the BSS region to avoid the data overlapping with U-Boot variables.
-This entry is useful in that case. It automatically pads out the entry size
-to cover both the code, data and BSS.
+This holds the padding added after the SPL binary to cover the BSS (Block
+Started by Symbol) region. This region holds the various variables used by
+SPL. It is set to 0 by SPL when it starts up. If you want to append data to
+the SPL image (such as a device tree file), you must pad out the BSS region
+to avoid the data overlapping with U-Boot variables. This entry is useful in
+that case. It automatically pads out the entry size to cover both the code,
+data and BSS.
+
+The contents of this entry will a certain number of zero bytes, determined
+by __bss_size
 
 The ELF file 'spl/u-boot-spl' must also be available for this to work, since
 binman uses that to look up the BSS address.
tools/binman/etype/u_boot_spl_bss_pad.py +10 -7
index df15cd24ce7..18c5596bd35 100644
@@ -18,13 +18,16 @@ class Entry_u_boot_spl_bss_pad(Entry_blob):
     Properties / Entry arguments:
         None
 
-    This is similar to u_boot_spl except that padding is added after the SPL
-    binary to cover the BSS (Block Started by Symbol) region. This region holds
-    the various used by SPL. It is set to 0 by SPL when it starts up. If you
-    want to append data to the SPL image (such as a device tree file), you must
-    pad out the BSS region to avoid the data overlapping with U-Boot variables.
-    This entry is useful in that case. It automatically pads out the entry size
-    to cover both the code, data and BSS.
+    This holds the padding added after the SPL binary to cover the BSS (Block
+    Started by Symbol) region. This region holds the various variables used by
+    SPL. It is set to 0 by SPL when it starts up. If you want to append data to
+    the SPL image (such as a device tree file), you must pad out the BSS region
+    to avoid the data overlapping with U-Boot variables. This entry is useful in
+    that case. It automatically pads out the entry size to cover both the code,
+    data and BSS.
+
+    The contents of this entry will a certain number of zero bytes, determined
+    by __bss_size
 
     The ELF file 'spl/u-boot-spl' must also be available for this to work, since
     binman uses that to look up the BSS address.
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#10 lore raw

PATCH v3 5/27 binman: Correct the documentation for u-boot-spl-bss-pad

The documentation for this entry indicates that the SPL binary is included along with the padding. It is not, so update it to correct the error.

---

(no changes since v1)

 tools/binman/README.entries              | 17 ++++++++++-------
 tools/binman/etype/u_boot_spl_bss_pad.py | 17 ++++++++++-------
 2 files changed, 20 insertions(+), 14 deletions(-)

Applied to u-boot-dm/next, thanks!

#11 lore raw

PATCH v3 6/27 binman: Support symbols in u-boot-spl-nodtb

In reply to Simon Glass

Since this is an execuable we should be able insert symbol values into it. Add support for this.

Use common code for this test and the original testSymbols. Use hex consistently for the values and add some more comments.

---

Changes in v3:
- Add new patch to support symbols in u-boot-spl-nodtb

 tools/binman/README.entries             |  9 +++++
 tools/binman/etype/u_boot_spl_nodtb.py  | 14 +++++++
 tools/binman/ftest.py                   | 49 +++++++++++++++----------
 tools/binman/test/053_symbols.dts       |  2 +-
 tools/binman/test/192_symbols_nodtb.dts | 26 +++++++++++++
 tools/binman/test/u_boot_binman_syms.c  |  2 +-
 6 files changed, 81 insertions(+), 21 deletions(-)
 create mode 100644 tools/binman/test/192_symbols_nodtb.dts
tools/binman/README.entries +9 -0
index 5c6663e2c7c..1dbdd0be03d 100644
@@ -1011,6 +1011,15 @@ a device tree to operate on your platform. You can add a u-boot-spl-dtb
 entry after this one, or use a u-boot-spl entry instead (which contains
 both SPL and the device tree).
 
+SPL can access binman symbols at runtime. See:
+
+    'Access to binman entry offsets at run time (symbols)'
+
+in the binman README for more information.
+
+The ELF file 'spl/u-boot-spl' must also be available for this to work, since
+binman uses that to look up symbols to write into the SPL binary.
+
 
 
 Entry: u-boot-spl-with-ucode-ptr: U-Boot SPL with embedded microcode pointer
tools/binman/etype/u_boot_spl_nodtb.py +14 -0
index 41d75054910..dbf2f12743a 100644
@@ -5,6 +5,7 @@
 # Entry-type module for 'u-boot-spl-nodtb.bin'
 #
 
+from binman import elf
 from binman.entry import Entry
 from binman.etype.blob import Entry_blob
 
@@ -19,9 +20,22 @@ class Entry_u_boot_spl_nodtb(Entry_blob):
     a device tree to operate on your platform. You can add a u-boot-spl-dtb
     entry after this one, or use a u-boot-spl entry instead (which contains
     both SPL and the device tree).
+
+    SPL can access binman symbols at runtime. See:
+
+        'Access to binman entry offsets at run time (symbols)'
+
+    in the binman README for more information.
+
+    The ELF file 'spl/u-boot-spl' must also be available for this to work, since
+    binman uses that to look up symbols to write into the SPL binary.
     """
     def __init__(self, section, etype, node):
         super().__init__(section, etype, node)
+        self.elf_fname = 'spl/u-boot-spl'
 
     def GetDefaultFilename(self):
         return 'spl/u-boot-spl-nodtb.bin'
+
+    def WriteSymbols(self, section):
+        elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage())
tools/binman/ftest.py +30 -19

69 lines not on this page · raw message

tools/binman/test/053_symbols.dts +1 -1
index 8af575158f5..29658092764 100644
@@ -10,7 +10,7 @@
 		};
 
 		u-boot {
-			offset = <24>;
+			offset = <0x18>;
 		};
 
 		u-boot-spl2 {
tools/binman/test/192_symbols_nodtb.dts new file +26 -0
new file mode 100644
index 00000000000..5c900d60709
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		pad-byte = <0xff>;
+		u-boot-spl-nodtb {
+		};
+		u-boot-spl-dtb {
+		};
+
+		u-boot {
+			offset = <0x38>;
+		};
+
+		u-boot-spl2 {
+			type = "u-boot-spl-nodtb";
+		};
+		u-boot-spl-dtb2 {
+			type = "u-boot-spl-dtb";
+		};
+	};
+};
tools/binman/test/u_boot_binman_syms.c +1 -1
index 4520b319f16..37fc339ce84 100644
@@ -8,7 +8,7 @@
 #define CONFIG_BINMAN
 #include <binman_sym.h>
 
-binman_sym_declare(unsigned long, u_boot_spl, offset);
+binman_sym_declare(unsigned long, u_boot_spl_any, offset);
 binman_sym_declare(unsigned long long, u_boot_spl2, offset);
 binman_sym_declare(unsigned long, u_boot_any, image_pos);
 binman_sym_declare(unsigned long, u_boot_any, size);
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#12 lore raw

PATCH v3 6/27 binman: Support symbols in u-boot-spl-nodtb

Since this is an execuable we should be able insert symbol values into it. Add support for this.

Use common code for this test and the original testSymbols. Use hex consistently for the values and add some more comments.

---

Changes in v3:
- Add new patch to support symbols in u-boot-spl-nodtb

 tools/binman/README.entries             |  9 +++++
 tools/binman/etype/u_boot_spl_nodtb.py  | 14 +++++++
 tools/binman/ftest.py                   | 49 +++++++++++++++----------
 tools/binman/test/053_symbols.dts       |  2 +-
 tools/binman/test/192_symbols_nodtb.dts | 26 +++++++++++++
 tools/binman/test/u_boot_binman_syms.c  |  2 +-
 6 files changed, 81 insertions(+), 21 deletions(-)
 create mode 100644 tools/binman/test/192_symbols_nodtb.dts

Applied to u-boot-dm/next, thanks!

#13 lore raw

PATCH v3 7/27 binman: Add support for u-boot-tpl-nodtb

In reply to Simon Glass

Allow this entry type to be placed in an image. This is the TPL binary, without a devicetree appended.

---

(no changes since v1)

 tools/binman/README.entries                | 23 ++++++++++++
 tools/binman/etype/u_boot_tpl_nodtb.py     | 41 ++++++++++++++++++++++
 tools/binman/ftest.py                      |  6 ++++
 tools/binman/test/192_u_boot_tpl_nodtb.dts | 13 +++++++
 4 files changed, 83 insertions(+)
 create mode 100644 tools/binman/etype/u_boot_tpl_nodtb.py
 create mode 100644 tools/binman/test/192_u_boot_tpl_nodtb.dts
tools/binman/README.entries +23 -0
index 1dbdd0be03d..8651ba05f29 100644
@@ -1089,6 +1089,29 @@ be relocated to any address for execution.
 
 
 
+Entry: u-boot-tpl-nodtb: TPL binary without device tree appended
+----------------------------------------------------------------
+
+Properties / Entry arguments:
+    - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin')
+
+This is the U-Boot TPL binary, It does not include a device tree blob at
+the end of it so may not be able to work without it, assuming TPL needs
+a device tree to operate on your platform. You can add a u-boot-tpl-dtb
+entry after this one, or use a u-boot-tpl entry instead (which contains
+both TPL and the device tree).
+
+TPL can access binman symbols at runtime. See:
+
+    'Access to binman entry offsets at run time (symbols)'
+
+in the binman README for more information.
+
+The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
+binman uses that to look up symbols to write into the TPL binary.
+
+
+
 Entry: u-boot-tpl-with-ucode-ptr: U-Boot TPL with embedded microcode pointer
 ----------------------------------------------------------------------------
 
tools/binman/etype/u_boot_tpl_nodtb.py new file +41 -0

41 lines not on this page · raw message

tools/binman/ftest.py +6 -0
index e056601b9a4..684e507e6ed 100644
@@ -4256,6 +4256,12 @@ class TestFunctional(unittest.TestCase):
 
         self.assertEquals(U_BOOT_DATA, u_boot.ReadData())
 
+    def testTplNoDtb(self):
+        """Test that an image with tpl/u-boot-tpl-nodtb.bin can be created"""
+        data = self._DoReadFile('192_u_boot_tpl_nodtb.dts')
+        self.assertEqual(U_BOOT_TPL_NODTB_DATA,
+                         data[:len(U_BOOT_TPL_NODTB_DATA)])
+
 
 if __name__ == "__main__":
     unittest.main()
tools/binman/test/192_u_boot_tpl_nodtb.dts new file +13 -0
new file mode 100644
index 00000000000..94cef395e89
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		u-boot-tpl-nodtb {
+		};
+	};
+};
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#14 lore raw

PATCH v3 7/27 binman: Add support for u-boot-tpl-nodtb

Allow this entry type to be placed in an image. This is the TPL binary, without a devicetree appended.

---

(no changes since v1)

 tools/binman/README.entries                | 23 ++++++++++++
 tools/binman/etype/u_boot_tpl_nodtb.py     | 41 ++++++++++++++++++++++
 tools/binman/ftest.py                      |  6 ++++
 tools/binman/test/192_u_boot_tpl_nodtb.dts | 13 +++++++
 4 files changed, 83 insertions(+)
 create mode 100644 tools/binman/etype/u_boot_tpl_nodtb.py
 create mode 100644 tools/binman/test/192_u_boot_tpl_nodtb.dts

Applied to u-boot-dm/next, thanks!

#15 lore raw

PATCH v3 8/27 binman: Add support for u-boot-tpl-bss-bad

In reply to Simon Glass

This entry holds the padding between the end of of TPL binary and the end of BSS. This region must be left empty so that the devicetree can be appended correctly and remain accessible without interfering with BSS.

---

(no changes since v1)

 tools/binman/README.entries              | 22 ++++++++++++
 tools/binman/etype/u_boot_tpl_bss_pad.py | 44 ++++++++++++++++++++++++
 tools/binman/ftest.py                    | 16 +++++++++
 tools/binman/test/193_tpl_bss_pad.dts    | 19 ++++++++++
 4 files changed, 101 insertions(+)
 create mode 100644 tools/binman/etype/u_boot_tpl_bss_pad.py
 create mode 100644 tools/binman/test/193_tpl_bss_pad.dts
tools/binman/README.entries +22 -0
index 8651ba05f29..368c976497d 100644
@@ -1056,6 +1056,28 @@ binman uses that to look up symbols to write into the TPL binary.
 
 
 
+Entry: u-boot-tpl-bss-pad: U-Boot TPL binary padded with a BSS region
+---------------------------------------------------------------------
+
+Properties / Entry arguments:
+    None
+
+This holds the padding added after the TPL binary to cover the BSS (Block
+Started by Symbol) region. This region holds the various variables used by
+TPL. It is set to 0 by TPL when it starts up. If you want to append data to
+the TPL image (such as a device tree file), you must pad out the BSS region
+to avoid the data overlapping with U-Boot variables. This entry is useful in
+that case. It automatically pads out the entry size to cover both the code,
+data and BSS.
+
+The contents of this entry will a certain number of zero bytes, determined
+by __bss_size
+
+The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
+binman uses that to look up the BSS address.
+
+
+
 Entry: u-boot-tpl-dtb: U-Boot TPL device tree
 ---------------------------------------------
 
tools/binman/etype/u_boot_tpl_bss_pad.py new file +44 -0

44 lines not on this page · raw message

tools/binman/ftest.py +16 -0
index 684e507e6ed..d1bf64ce271 100644
@@ -4262,6 +4262,22 @@ class TestFunctional(unittest.TestCase):
         self.assertEqual(U_BOOT_TPL_NODTB_DATA,
                          data[:len(U_BOOT_TPL_NODTB_DATA)])
 
+    def testTplBssPad(self):
+        """Test that we can pad TPL's BSS with zeros"""
+        # ELF file with a '__bss_size' symbol
+        self._SetupTplElf()
+        data = self._DoReadFile('193_tpl_bss_pad.dts')
+        self.assertEqual(U_BOOT_TPL_DATA + tools.GetBytes(0, 10) + U_BOOT_DATA,
+                         data)
+
+    def testTplBssPadMissing(self):
+        """Test that a missing symbol is detected"""
+        self._SetupTplElf('u_boot_ucode_ptr')
+        with self.assertRaises(ValueError) as e:
+            self._DoReadFile('193_tpl_bss_pad.dts')
+        self.assertIn('Expected __bss_size symbol in tpl/u-boot-tpl',
+                      str(e.exception))
+
 
 if __name__ == "__main__":
     unittest.main()
tools/binman/test/193_tpl_bss_pad.dts new file +19 -0
new file mode 100644
index 00000000000..f5c2db0646c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		u-boot-tpl {
+		};
+
+		u-boot-tpl-bss-pad {
+		};
+
+		u-boot {
+		};
+	};
+};
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#16 lore raw

PATCH v3 8/27 binman: Add support for u-boot-tpl-bss-bad

This entry holds the padding between the end of of TPL binary and the end of BSS. This region must be left empty so that the devicetree can be appended correctly and remain accessible without interfering with BSS.

---

(no changes since v1)

 tools/binman/README.entries              | 22 ++++++++++++
 tools/binman/etype/u_boot_tpl_bss_pad.py | 44 ++++++++++++++++++++++++
 tools/binman/ftest.py                    | 16 +++++++++
 tools/binman/test/193_tpl_bss_pad.dts    | 19 ++++++++++
 4 files changed, 101 insertions(+)
 create mode 100644 tools/binman/etype/u_boot_tpl_bss_pad.py
 create mode 100644 tools/binman/test/193_tpl_bss_pad.dts

Applied to u-boot-dm/next, thanks!

#17 lore raw

PATCH v3 9/27 binman: Drop unnecessary 'type' property in tests

In reply to Simon Glass

A few tests declare a type when this can be inferred from the node name. Drop these lines, since it might cause confusion.

---

Changes in v3:
- Add new patch to drop unnecessary 'type' property in tests

 tools/binman/test/149_symbols_tpl.dts     | 1 -
 tools/binman/test/155_symbols_tpl_x86.dts | 1 -
 2 files changed, 2 deletions(-)
tools/binman/test/149_symbols_tpl.dts +0 -1
index dfc84af5e72..0a4ab3f1fab 100644
@@ -21,7 +21,6 @@
 
 		section {
 			u-boot-tpl {
-				type = "u-boot-tpl";
 			};
 		};
 	};
tools/binman/test/155_symbols_tpl_x86.dts +0 -1
index 72ca4474474..9d7dc51b3d9 100644
@@ -24,7 +24,6 @@
 
 		section {
 			u-boot-tpl {
-				type = "u-boot-tpl";
 			};
 		};
 	};
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#18 lore raw

PATCH v3 9/27 binman: Drop unnecessary 'type' property in tests

A few tests declare a type when this can be inferred from the node name. Drop these lines, since it might cause confusion.

---

Changes in v3:
- Add new patch to drop unnecessary 'type' property in tests

 tools/binman/test/149_symbols_tpl.dts     | 1 -
 tools/binman/test/155_symbols_tpl_x86.dts | 1 -
 2 files changed, 2 deletions(-)

Applied to u-boot-dm/next, thanks!

#19 lore raw

PATCH v3 10/27 binman: Use the fake SPL/TPL only if requested

In reply to Simon Glass

At present we always use the main devicetree for SPL/TPL as well when setting up the state. But this it not needed if there is a real devicetree for SPL or TPL. In fact it confuses things since we cannot distinguish between one being provided and using the fake one.

Update the code to create the fakes only when requested. Put the mapping in a constant so we can use it elsewhere.

Rename 'other_fname' to 'fname' while we are here since there is nothing 'other' about it.

---

Changes in v3:
- Add new patch to use the fake SPL/TPL only if requested

 tools/binman/state.py | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
tools/binman/state.py +15 -8
index bb3e36ea7af..cef5f660bba 100644
@@ -13,6 +13,12 @@ import os
 from patman import tools
 from patman import tout
 
+# Map an dtb etype to its expected filename
+DTB_TYPE_FNAME = {
+    'u-boot-spl-dtb': 'spl/u-boot-spl.dtb',
+    'u-boot-tpl-dtb': 'tpl/u-boot-tpl.dtb',
+    }
+
 # Records the device-tree files known to binman, keyed by entry type (e.g.
 # 'u-boot-spl-dtb'). These are the output FDT files, which can be updated by
 # binman. They have been copied to <xxx>.out files.
@@ -178,19 +184,20 @@ def Prepare(images, dtb):
     output_fdt_info.clear()
     fdt_path_prefix = ''
     output_fdt_info['u-boot-dtb'] = [dtb, 'u-boot.dtb', None]
-    output_fdt_info['u-boot-spl-dtb'] = [dtb, 'spl/u-boot-spl.dtb', None]
-    output_fdt_info['u-boot-tpl-dtb'] = [dtb, 'tpl/u-boot-tpl.dtb', None]
-    if not use_fake_dtb:
+    if use_fake_dtb:
+        for etype, fname in DTB_TYPE_FNAME.items():
+            output_fdt_info[etype] = [dtb, fname, None]
+    else:
         fdt_set = {}
         for image in images.values():
             fdt_set.update(image.GetFdts())
         for etype, other in fdt_set.items():
-            entry, other_fname = other
-            infile = tools.GetInputFilename(other_fname)
-            other_fname_dtb = fdt_util.EnsureCompiled(infile)
+            entry, fname = other
+            infile = tools.GetInputFilename(fname)
+            fname_dtb = fdt_util.EnsureCompiled(infile)
             out_fname = tools.GetOutputFilename('%s.out' %
-                    os.path.split(other_fname)[1])
-            tools.WriteFile(out_fname, tools.ReadFile(other_fname_dtb))
+                    os.path.split(fname)[1])
+            tools.WriteFile(out_fname, tools.ReadFile(fname_dtb))
             other_dtb = fdt.FdtScan(out_fname)
             output_fdt_info[etype] = [other_dtb, out_fname, entry]
 
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#20 lore raw

PATCH v3 10/27 binman: Use the fake SPL/TPL only if requested

At present we always use the main devicetree for SPL/TPL as well when setting up the state. But this it not needed if there is a real devicetree for SPL or TPL. In fact it confuses things since we cannot distinguish between one being provided and using the fake one.

Update the code to create the fakes only when requested. Put the mapping in a constant so we can use it elsewhere.

Rename 'other_fname' to 'fname' while we are here since there is nothing 'other' about it.

---

Changes in v3:
- Add new patch to use the fake SPL/TPL only if requested

 tools/binman/state.py | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

Applied to u-boot-dm/next, thanks!

#21 lore raw

PATCH v3 11/27 binman: Drop unnecessary field in output_fdt_info

In reply to Simon Glass

At present we store an entry as the third field in output_fdt_info[]. This is only used to get the type of the entry. Of course multiple entries may have this same type. Also the entry type is the key to this dict, so we can use that instead.

Drop the field and update GetUpdateNodes() to suit. Improve the comment for output_fdt_info a little while here.

---

Changes in v3:
- Add new patch to drop an unnecessary field in output_fdt_info

 tools/binman/state.py | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
tools/binman/state.py +10 -12
index cef5f660bba..053b4fe73f1 100644
@@ -23,11 +23,10 @@ DTB_TYPE_FNAME = {
 # 'u-boot-spl-dtb'). These are the output FDT files, which can be updated by
 # binman. They have been copied to <xxx>.out files.
 #
-#   key: entry type
+#   key: entry type (e.g. 'u-boot-dtb)
 #   value: tuple:
 #       Fdt object
 #       Filename
-#       Entry object, or None if not known
 output_fdt_info = {}
 
 # Prefix to add to an fdtmap path to turn it into a path to the /binman node
@@ -124,11 +123,11 @@ def UpdateFdtContents(etype, data):
         etype: Entry type (e.g. 'u-boot-dtb')
         data: Data to replace the DTB with
     """
-    dtb, fname, entry = output_fdt_info[etype]
+    dtb, fname = output_fdt_info[etype]
     dtb_fname = dtb.GetFilename()
     tools.WriteFile(dtb_fname, data)
     dtb = fdt.FdtScan(dtb_fname)
-    output_fdt_info[etype] = [dtb, fname, entry]
+    output_fdt_info[etype] = [dtb, fname]
 
 def SetEntryArgs(args):
     """Set the value of the entry args
@@ -183,10 +182,10 @@ def Prepare(images, dtb):
     main_dtb = dtb
     output_fdt_info.clear()
     fdt_path_prefix = ''
-    output_fdt_info['u-boot-dtb'] = [dtb, 'u-boot.dtb', None]
+    output_fdt_info['u-boot-dtb'] = [dtb, 'u-boot.dtb']
     if use_fake_dtb:
         for etype, fname in DTB_TYPE_FNAME.items():
-            output_fdt_info[etype] = [dtb, fname, None]
+            output_fdt_info[etype] = [dtb, fname]
     else:
         fdt_set = {}
         for image in images.values():
@@ -199,7 +198,7 @@ def Prepare(images, dtb):
                     os.path.split(fname)[1])
             tools.WriteFile(out_fname, tools.ReadFile(fname_dtb))
             other_dtb = fdt.FdtScan(out_fname)
-            output_fdt_info[etype] = [other_dtb, out_fname, entry]
+            output_fdt_info[etype] = [other_dtb, out_fname]
 
 def PrepareFromLoadedData(image):
     """Get device tree files ready for use with a loaded image
@@ -222,7 +221,7 @@ def PrepareFromLoadedData(image):
     tout.Info('Preparing device trees')
     output_fdt_info.clear()
     fdt_path_prefix = ''
-    output_fdt_info['fdtmap'] = [image.fdtmap_dtb, 'u-boot.dtb', None]
+    output_fdt_info['fdtmap'] = [image.fdtmap_dtb, 'u-boot.dtb']
     main_dtb = None
     tout.Info("   Found device tree type 'fdtmap' '%s'" % image.fdtmap_dtb.name)
     for etype, value in image.GetFdts().items():
@@ -240,7 +239,7 @@ def PrepareFromLoadedData(image):
         if 'multiple-images' in image_node.props:
             image_node = dtb.GetNode('/binman/%s' % image.image_node)
         fdt_path_prefix = image_node.path
-        output_fdt_info[etype] = [dtb, None, entry]
+        output_fdt_info[etype] = [dtb, None]
     tout.Info("   FDT path prefix '%s'" % fdt_path_prefix)
 
 
@@ -275,12 +274,11 @@ def GetUpdateNodes(node, for_repack=False):
             is node, SPL and TPL)
     """
     yield node
-    for dtb, fname, entry in output_fdt_info.values():
+    for entry_type, (dtb, fname) in output_fdt_info.items():
         if dtb != node.GetFdt():
-            if for_repack and entry.etype != 'u-boot-dtb':
+            if for_repack and entry_type != 'u-boot-dtb':
                 continue
             other_node = dtb.GetNode(fdt_path_prefix + node.path)
-            #print('   try', fdt_path_prefix + node.path, other_node)
             if other_node:
                 yield other_node
 
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#22 lore raw

PATCH v3 11/27 binman: Drop unnecessary field in output_fdt_info

At present we store an entry as the third field in output_fdt_info[]. This is only used to get the type of the entry. Of course multiple entries may have this same type. Also the entry type is the key to this dict, so we can use that instead.

Drop the field and update GetUpdateNodes() to suit. Improve the comment for output_fdt_info a little while here.

---

Changes in v3:
- Add new patch to drop an unnecessary field in output_fdt_info

 tools/binman/state.py | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

Applied to u-boot-dm/next, thanks!

#23 lore raw

PATCH v3 12/27 binman: Move the comment for GetFdts() to the base class

In reply to Simon Glass

Like with other methods this comment should be in the base class. Move it.

---

Changes in v3:
- Add new patch to move the comment for GetFdts() to the base class

 tools/binman/entry.py          | 2 +-
 tools/binman/etype/blob_dtb.py | 9 ---------
 2 files changed, 1 insertion(+), 10 deletions(-)
tools/binman/entry.py +1 -1
index 507760e2a86..be9419584a2 100644
@@ -205,7 +205,7 @@ class Entry(object):
             Dict:
                 key: Filename from this entry (without the path)
                 value: Tuple:
-                    Fdt object for this dtb, or None if not available
+                    Entry object for this dtb
                     Filename of file containing this dtb
         """
         return {}
tools/binman/etype/blob_dtb.py +0 -9
index 724647a7bbb..3ce7511f6f4 100644
@@ -44,15 +44,6 @@ class Entry_blob_dtb(Entry_blob):
         return None
 
     def GetFdts(self):
-        """Get the device trees used by this entry
-
-        Returns:
-            Dict:
-                key: Filename from this entry (without the path)
-                value: Tuple:
-                    Fdt object for this dtb, or None if not available
-                    Filename of file containing this dtb
-        """
         fname = self.GetDefaultFilename()
         return {self.GetFdtEtype(): [self, fname]}
 
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#24 lore raw

PATCH v3 12/27 binman: Move the comment for GetFdts() to the base class

Like with other methods this comment should be in the base class. Move it.

---

Changes in v3:
- Add new patch to move the comment for GetFdts() to the base class

 tools/binman/entry.py          | 2 +-
 tools/binman/etype/blob_dtb.py | 9 ---------
 2 files changed, 1 insertion(+), 10 deletions(-)

Applied to u-boot-dm/next, thanks!

#25 lore raw

PATCH v3 13/27 binman: Use standard filenames for SPL/TPL devicetree

In reply to Simon Glass

At present, before any entry expansion is done (such as a 'files' entry expanding out to individual entries for each file it contains), we check the binman definition (i.e. '/binman' node) to find out what devicetree files are used in the images.

This is a pain, since the definition may change during expansion. For example if there is no u-boot-spl-dtb entry in the definition at the start, we assume that the SPL devicetree is not used. But if an entry later expands to include this, then we don't notice.

In fact the flexibility provided by the current approach of checking the definition is not really useful. We know that we can have SPL and TPL devicetrees. We know the pathname to each, so we can simply check if the files are present. If they are present, we can prepare them and update them regardless of whether they are actually used. If they are not present, we cannot prepare/update them anyway, i.e. an error will be generated.

Simplify state.Prepare() so it uses a hard-coded list of devicetree files.

Note that state.PrepareFromLoadedData() is left untouched, since in that case we have a complete definition from the loaded file, but cannot of course rely on the devicetree files that created it still being present. So in that case we still check the image defitions.

---

Changes in v3:
- Add new patch to use standard filenames for SPL/TPL devicetree

 tools/binman/state.py | 21 ++++++++++-----------
 tools/patman/tools.py |  8 ++++++--
 2 files changed, 16 insertions(+), 13 deletions(-)
tools/binman/state.py +10 -11
index 053b4fe73f1..84f606b1885 100644
@@ -188,17 +188,16 @@ def Prepare(images, dtb):
             output_fdt_info[etype] = [dtb, fname]
     else:
         fdt_set = {}
-        for image in images.values():
-            fdt_set.update(image.GetFdts())
-        for etype, other in fdt_set.items():
-            entry, fname = other
-            infile = tools.GetInputFilename(fname)
-            fname_dtb = fdt_util.EnsureCompiled(infile)
-            out_fname = tools.GetOutputFilename('%s.out' %
-                    os.path.split(fname)[1])
-            tools.WriteFile(out_fname, tools.ReadFile(fname_dtb))
-            other_dtb = fdt.FdtScan(out_fname)
-            output_fdt_info[etype] = [other_dtb, out_fname]
+        for etype, fname in DTB_TYPE_FNAME.items():
+            infile = tools.GetInputFilename(fname, allow_missing=True)
+            if infile and os.path.exists(infile):
+                fname_dtb = fdt_util.EnsureCompiled(infile)
+                out_fname = tools.GetOutputFilename('%s.out' %
+                        os.path.split(fname)[1])
+                tools.WriteFile(out_fname, tools.ReadFile(fname_dtb))
+                other_dtb = fdt.FdtScan(out_fname)
+                output_fdt_info[etype] = [other_dtb, out_fname]
+
 
 def PrepareFromLoadedData(image):
     """Get device tree files ready for use with a loaded image
tools/patman/tools.py +6 -2
index 10997e43868..e5f391b7aa9 100644
@@ -130,8 +130,12 @@ def GetInputFilename(fname, allow_missing=False):
         allow_missing: True if the filename can be missing
 
     Returns:
-        The full path of the filename, within the input directory, or
-        None on error
+        fname, if indir is None;
+        full path of the filename, within the input directory;
+        None, if file is missing and allow_missing is True
+
+    Raises:
+        ValueError if file is missing and allow_missing is False
     """
     if not indir or fname[:1] == '/':
         return fname
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#26 lore raw

PATCH v3 13/27 binman: Use standard filenames for SPL/TPL devicetree

At present, before any entry expansion is done (such as a 'files' entry expanding out to individual entries for each file it contains), we check the binman definition (i.e. '/binman' node) to find out what devicetree files are used in the images.

This is a pain, since the definition may change during expansion. For example if there is no u-boot-spl-dtb entry in the definition at the start, we assume that the SPL devicetree is not used. But if an entry later expands to include this, then we don't notice.

In fact the flexibility provided by the current approach of checking the definition is not really useful. We know that we can have SPL and TPL devicetrees. We know the pathname to each, so we can simply check if the files are present. If they are present, we can prepare them and update them regardless of whether they are actually used. If they are not present, we cannot prepare/update them anyway, i.e. an error will be generated.

Simplify state.Prepare() so it uses a hard-coded list of devicetree files.

Note that state.PrepareFromLoadedData() is left untouched, since in that case we have a complete definition from the loaded file, but cannot of course rely on the devicetree files that created it still being present. So in that case we still check the image defitions.

---

Changes in v3:
- Add new patch to use standard filenames for SPL/TPL devicetree

 tools/binman/state.py | 21 ++++++++++-----------
 tools/patman/tools.py |  8 ++++++--
 2 files changed, 16 insertions(+), 13 deletions(-)

Applied to u-boot-dm/next, thanks!

#27 lore raw

PATCH v3 14/27 binman: Allow using an an 'expanded' entry type

In reply to Simon Glass

As the first step in supporting expanded entries, add a way for binman to automatically select an 'expanded' version of an entry type, if requested. This is controlled by a class method.

---

(no changes since v1)

 tools/binman/entry.py      | 60 ++++++++++++++++++++++++++++++++------
 tools/binman/entry_test.py | 12 ++++++++
 2 files changed, 63 insertions(+), 9 deletions(-)
tools/binman/entry.py +51 -9
index be9419584a2..1cfa024a9f9 100644
@@ -102,22 +102,30 @@ class Entry(object):
         self.allow_missing = False
 
     @staticmethod
-    def Lookup(node_path, etype):
+    def Lookup(node_path, etype, expanded):
         """Look up the entry class for a node.
 
         Args:
             node_node: Path name of Node object containing information about
                        the entry to create (used for errors)
             etype:   Entry type to use
+            expanded: Use the expanded version of etype
 
         Returns:
-            The entry class object if found, else None
+            The entry class object if found, else None if not found and expanded
+                is True
+
+        Raise:
+            ValueError if expanded is False and the class is not found
         """
         # Convert something like 'u-boot at 0' to 'u_boot' since we are only
         # interested in the type.
         module_name = etype.replace('-', '_')
+
         if '@' in module_name:
             module_name = module_name.split('@')[0]
+        if expanded:
+            module_name += '_expanded'
         module = modules.get(module_name)
 
         # Also allow entry-type modules to be brought in from the etype directory.
@@ -127,6 +135,8 @@ class Entry(object):
             try:
                 module = importlib.import_module('binman.etype.' + module_name)
             except ImportError as e:
+                if expanded:
+                    return None
                 raise ValueError("Unknown entry type '%s' in node '%s' (expected etype/%s.py, error '%s'" %
                                  (etype, node_path, module_name, e))
             modules[module_name] = module
@@ -135,21 +145,31 @@ class Entry(object):
         return getattr(module, 'Entry_%s' % module_name)
 
     @staticmethod
-    def Create(section, node, etype=None):
+    def Create(section, node, etype=None, expanded=False):
         """Create a new entry for a node.
 
         Args:
-            section: Section object containing this node
-            node:    Node object containing information about the entry to
-                     create
-            etype:   Entry type to use, or None to work it out (used for tests)
+            section:  Section object containing this node
+            node:     Node object containing information about the entry to
+                      create
+            etype:    Entry type to use, or None to work it out (used for tests)
+            expanded: True to use expanded versions of entries, where available
 
         Returns:
             A new Entry object of the correct type (a subclass of Entry)
         """
         if not etype:
             etype = fdt_util.GetString(node, 'type', node.name)
-        obj = Entry.Lookup(node.path, etype)
+        obj = Entry.Lookup(node.path, etype, expanded)
+        if obj and expanded:
+            # Check whether to use the expanded entry
+            new_etype = etype + '-expanded'
+            if obj.UseExpanded(node, etype, new_etype):
+                etype = new_etype
+            else:
+                obj = None
+        if not obj:
+            obj = Entry.Lookup(node.path, etype, False)
 
         # Call its constructor to get the object we want.
         return obj(section, etype, node)
@@ -648,7 +668,7 @@ features to produce new behaviours.
             modules.remove('_testing')
         missing = []
         for name in modules:
-            module = Entry.Lookup('WriteDocs', name)
+            module = Entry.Lookup('WriteDocs', name, False)
             docs = getattr(module, '__doc__')
             if test_missing == name:
                 docs = None
@@ -907,3 +927,25 @@ features to produce new behaviours.
             self.uncomp_size = len(indata)
         data = tools.Compress(indata, self.compress)
         return data
+
+    @classmethod
+    def UseExpanded(cls, node, etype, new_etype):
+        """Check whether to use an expanded entry type
+
+        This is called by Entry.Create() when it finds an expanded version of
+        an entry type (e.g. 'u-boot-expanded'). If this method returns True then
+        it will be used (e.g. in place of 'u-boot'). If it returns False, it is
+        ignored.
+
+        Args:
+            node:     Node object containing information about the entry to
+                      create
+            etype:    Original entry type being used
+            new_etype: New entry type proposed
+
+        Returns:
+            True to use this entry type, False to use the original one
+        """
+        tout.Info("Node '%s': etype '%s': %s selected" %
+                  (node.path, etype, new_etype))
+        return True
tools/binman/entry_test.py +12 -0
index 80802f33de6..c3d5f3eef48 100644
@@ -87,6 +87,18 @@ class TestEntry(unittest.TestCase):
         base = entry.Entry.Create(None, self.GetNode(), 'blob-dtb')
         self.assertIsNone(base.ReadChildData(base))
 
+    def testExpandedEntry(self):
+        """Test use of an expanded entry when available"""
+        base = entry.Entry.Create(None, self.GetNode())
+        self.assertEqual('u-boot', base.etype)
+
+        expanded = entry.Entry.Create(None, self.GetNode(), expanded=True)
+        self.assertEqual('u-boot-expanded', expanded.etype)
+
+        with self.assertRaises(ValueError) as e:
+            entry.Entry.Create(None, self.GetNode(), 'missing', expanded=True)
+        self.assertIn("Unknown entry type 'missing' in node '/binman/u-boot'",
+                      str(e.exception))
 
 if __name__ == "__main__":
     unittest.main()
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#28 lore raw

PATCH v3 14/27 binman: Allow using an an 'expanded' entry type

As the first step in supporting expanded entries, add a way for binman to automatically select an 'expanded' version of an entry type, if requested. This is controlled by a class method.

---

(no changes since v1)

 tools/binman/entry.py      | 60 ++++++++++++++++++++++++++++++++------
 tools/binman/entry_test.py | 12 ++++++++
 2 files changed, 63 insertions(+), 9 deletions(-)

Applied to u-boot-dm/next, thanks!

#29 lore raw

PATCH v3 15/27 binman: Allow a way to select expanded entries

In reply to Simon Glass

Add a new command-line option to disable expanded entries. This is needed for most tests, since it is much easier to 'factor out' this function into a separate test and keep the existing packing tests simple.

Add the option and select it by default from tests.

---

(no changes since v1)

 tools/binman/cmdline.py |  3 +++
 tools/binman/ftest.py   | 19 +++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)
tools/binman/cmdline.py +3 -0
index c007d0a036d..0c0f48951f6 100644
@@ -56,6 +56,9 @@ controlled by a description in the board device tree.'''
         default=False, help='Output a map file for each image')
     build_parser.add_argument('-M', '--allow-missing', action='store_true',
         default=False, help='Allow external blobs to be missing')
+    build_parser.add_argument('-n', '--no-expanded', action='store_true',
+            help="Don't use 'expanded' versions of entries where available; "
+                 "normally 'u-boot' becomes 'u-boot-expanded', for example")
     build_parser.add_argument('-O', '--outdir', type=str,
         action='store', help='Path to directory to use for intermediate and '
         'output files')
tools/binman/ftest.py +13 -6
index d1bf64ce271..91825844178 100644
@@ -305,7 +305,8 @@ class TestFunctional(unittest.TestCase):
 
     def _DoTestFile(self, fname, debug=False, map=False, update_dtb=False,
                     entry_args=None, images=None, use_real_dtb=False,
-                    verbosity=None, allow_missing=False, extra_indirs=None):
+                    use_expanded=False, verbosity=None, allow_missing=False,
+                    extra_indirs=None):
         """Run binman with a given test file
 
         Args:
@@ -322,6 +323,8 @@ class TestFunctional(unittest.TestCase):
                 the u-boot-dtb entry. Normally this is not needed and the
                 test contents (the U_BOOT_DTB_DATA string) can be used.
                 But in some test we need the real contents.
+            use_expanded: True to use expanded entries where available, e.g.
+                'u-boot-expanded' instead of 'u-boot'
             verbosity: Verbosity level to use (0-3, None=don't set it)
             allow_missing: Set the '--allow-missing' flag so that missing
                 external binaries just produce a warning instead of an error
@@ -344,6 +347,8 @@ class TestFunctional(unittest.TestCase):
             args.append('-u')
         if not use_real_dtb:
             args.append('--fake-dtb')
+        if not use_expanded:
+            args.append('--no-expanded')
         if entry_args:
             for arg, value in entry_args.items():
                 args.append('-a%s=%s' % (arg, value))
@@ -403,9 +408,9 @@ class TestFunctional(unittest.TestCase):
         dtb.Pack()
         return dtb.GetContents()
 
-    def _DoReadFileDtb(self, fname, use_real_dtb=False, map=False,
-                       update_dtb=False, entry_args=None, reset_dtbs=True,
-                       extra_indirs=None):
+    def _DoReadFileDtb(self, fname, use_real_dtb=False, use_expanded=False,
+                       map=False, update_dtb=False, entry_args=None,
+                       reset_dtbs=True, extra_indirs=None):
         """Run binman and return the resulting image
 
         This runs binman with a given test file and then reads the resulting
@@ -420,6 +425,8 @@ class TestFunctional(unittest.TestCase):
                 the u-boot-dtb entry. Normally this is not needed and the
                 test contents (the U_BOOT_DTB_DATA string) can be used.
                 But in some test we need the real contents.
+            use_expanded: True to use expanded entries where available, e.g.
+                'u-boot-expanded' instead of 'u-boot'
             map: True to output map files for the images
             update_dtb: Update the offset and size of each entry in the device
                 tree before packing it into the image
@@ -454,7 +461,7 @@ class TestFunctional(unittest.TestCase):
         try:
             retcode = self._DoTestFile(fname, map=map, update_dtb=update_dtb,
                     entry_args=entry_args, use_real_dtb=use_real_dtb,
-                    extra_indirs=extra_indirs)
+                    use_expanded=use_expanded, extra_indirs=extra_indirs)
             self.assertEqual(0, retcode)
             out_dtb_fname = tools.GetOutputFilename('u-boot.dtb.out')
 
@@ -652,7 +659,7 @@ class TestFunctional(unittest.TestCase):
         """Test that we can run it with a specific board"""
         self._SetupDtb('005_simple.dts', 'sandbox/u-boot.dtb')
         TestFunctional._MakeInputFile('sandbox/u-boot.bin', U_BOOT_DATA)
-        result = self._DoBinman('build', '-b', 'sandbox')
+        result = self._DoBinman('build', '-n', '-b', 'sandbox')
         self.assertEqual(0, result)
 
     def testNeedBoard(self):
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#30 lore raw

PATCH v3 15/27 binman: Allow a way to select expanded entries

Add a new command-line option to disable expanded entries. This is needed for most tests, since it is much easier to 'factor out' this function into a separate test and keep the existing packing tests simple.

Add the option and select it by default from tests.

---

(no changes since v1)

 tools/binman/cmdline.py |  3 +++
 tools/binman/ftest.py   | 19 +++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

Applied to u-boot-dm/next, thanks!

#31 lore raw

PATCH v3 16/27 binman: Plumb expanded entries through fully

In reply to Simon Glass

Add support for this feature in the control, image and section modules, so that expanded entries will be selected by default. So far there are no expanded entry types, so this is a nop.

---

(no changes since v1)

 tools/binman/control.py       | 24 ++++++++++++++++++------
 tools/binman/etype/section.py |  3 ++-
 tools/binman/image.py         | 17 ++++++++++++++++-
 3 files changed, 36 insertions(+), 8 deletions(-)
tools/binman/control.py +18 -6
index 9c0cafeafc4..9709aa9a2b2 100644
@@ -28,7 +28,7 @@ images = OrderedDict()
 #    value: Text for the help
 missing_blob_help = {}
 
-def _ReadImageDesc(binman_node):
+def _ReadImageDesc(binman_node, use_expanded):
     """Read the image descriptions from the /binman node
 
     This normally produces a single Image object called 'image'. But if
@@ -36,15 +36,17 @@ def _ReadImageDesc(binman_node):
 
     Args:
         binman_node: Node object of the /binman node
+        use_expanded: True if the FDT will be updated with the entry information
     Returns:
         OrderedDict of Image objects, each of which describes an image
     """
     images = OrderedDict()
     if 'multiple-images' in binman_node.props:
         for node in binman_node.subnodes:
-            images[node.name] = Image(node.name, node)
+            images[node.name] = Image(node.name, node,
+                                      use_expanded=use_expanded)
     else:
-        images['image'] = Image('image', binman_node)
+        images['image'] = Image('image', binman_node, use_expanded=use_expanded)
     return images
 
 def _FindBinmanNode(dtb):
@@ -399,7 +401,7 @@ def ReplaceEntries(image_fname, input_fname, indir, entry_paths,
     return image
 
 
-def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt):
+def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded):
     """Prepare the images to be processed and select the device tree
 
     This function:
@@ -413,6 +415,9 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt):
         dtb_fname: Filename of the device tree file to use (.dts or .dtb)
         selected_images: List of images to output, or None for all
         update_fdt: True to update the FDT wth entry offsets, etc.
+        use_expanded: True to use expanded versions of entries, if available.
+            So if 'u-boot' is called for, we use 'u-boot-expanded' instead. This
+            is needed if update_fdt is True (although tests may disable it)
 
     Returns:
         OrderedDict of images:
@@ -438,7 +443,7 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt):
         raise ValueError("Device tree '%s' does not have a 'binman' "
                             "node" % dtb_fname)
 
-    images = _ReadImageDesc(node)
+    images = _ReadImageDesc(node, use_expanded)
 
     if select_images:
         skip = []
@@ -611,6 +616,13 @@ def Binman(args):
         elf.debug = args.debug
         cbfs_util.VERBOSE = args.verbosity > 2
         state.use_fake_dtb = args.fake_dtb
+
+        # Normally we replace the 'u-boot' etype with 'u-boot-expanded', etc.
+        # When running tests this can be disabled using this flag. When not
+        # updating the FDT in image, it is not needed by binman, but we use it
+        # for consistency, so that the images look the same to U-Boot at
+        # runtime.
+        use_expanded = not args.no_expanded
         try:
             tools.SetInputDirs(args.indir)
             tools.PrepareOutputDir(args.outdir, args.preserve)
@@ -618,7 +630,7 @@ def Binman(args):
             state.SetEntryArgs(args.entry_arg)
 
             images = PrepareImagesAndDtbs(dtb_fname, args.image,
-                                          args.update_fdt)
+                                          args.update_fdt, use_expanded)
             missing = False
             for image in images.values():
                 missing |= ProcessImage(image, args.update_fdt, args.map,
tools/binman/etype/section.py +2 -1
index 2103919b0c3..2f862bddf0f 100644
@@ -84,7 +84,8 @@ class Entry_section(Entry):
         for node in self._node.subnodes:
             if node.name.startswith('hash') or node.name.startswith('signature'):
                 continue
-            entry = Entry.Create(self, node)
+            entry = Entry.Create(self, node,
+                                 expanded=self.GetImage().use_expanded)
             entry.ReadNode()
             entry.SetPrefix(self._name_prefix)
             self._entries[node.name] = entry
tools/binman/image.py +16 -1
index e9494352413..10778f47fe9 100644
@@ -47,9 +47,23 @@ class Image(section.Entry_section):
             exception). This should be used if the Image is being loaded from
             a file rather than generated. In that case we obviously don't need
             the entry arguments since the contents already exists.
+        use_expanded: True if we are updating the FDT wth entry offsets, etc.
+            and should use the expanded versions of the U-Boot entries.
+            Any entry type that includes a devicetree must put it in a
+            separate entry so that it will be updated. For example. 'u-boot'
+            normally just picks up 'u-boot.bin' which includes the
+            devicetree, but this is not updateable, since it comes into
+            binman as one piece and binman doesn't know that it is actually
+            an executable followed by a devicetree. Of course it could be
+            taught this, but then when reading an image (e.g. 'binman ls')
+            it may need to be able to split the devicetree out of the image
+            in order to determine the location of things. Instead we choose
+            to ignore 'u-boot-bin' in this case, and build it ourselves in
+            binman with 'u-boot-dtb.bin' and 'u-boot.dtb'. See
+            Entry_u_boot_expanded and Entry_blob_phase for details.
     """
     def __init__(self, name, node, copy_to_orig=True, test=False,
-                 ignore_missing=False):
+                 ignore_missing=False, use_expanded=False):
         super().__init__(None, 'section', node, test=test)
         self.copy_to_orig = copy_to_orig
         self.name = 'main-section'
@@ -59,6 +73,7 @@ class Image(section.Entry_section):
         self.fdtmap_data = None
         self.allow_repack = False
         self._ignore_missing = ignore_missing
+        self.use_expanded = use_expanded
         if not test:
             self.ReadNode()
 
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#32 lore raw

PATCH v3 16/27 binman: Plumb expanded entries through fully

Add support for this feature in the control, image and section modules, so that expanded entries will be selected by default. So far there are no expanded entry types, so this is a nop.

---

(no changes since v1)

 tools/binman/control.py       | 24 ++++++++++++++++++------
 tools/binman/etype/section.py |  3 ++-
 tools/binman/image.py         | 17 ++++++++++++++++-
 3 files changed, 36 insertions(+), 8 deletions(-)

Applied to u-boot-dm/next, thanks!

#33 lore raw

PATCH v3 17/27 binman: Automatically expand phase binaries into sections

In reply to Simon Glass

When creating an entry, check for an expanded version of that entry, then use it instead. This allows, for example use of:

   u-boot {
   };

instead of having to write out in full:

   u-boot {
      type = "section";
      u-boot-nodtb {
      };

      u-boot-dtb {
      };

};

Add an implementaion of this and associated documentation.

---

Changes in v3:
- Update sizes for new behaviour

 tools/binman/README                       |  77 ++++++++++
 tools/binman/README.entries               |  96 +++++++++++-
 tools/binman/etype/blob_phase.py          |  51 +++++++
 tools/binman/etype/u_boot.py              |   8 +-
 tools/binman/etype/u_boot_expanded.py     |  24 +++
 tools/binman/etype/u_boot_nodtb.py        |   4 +-
 tools/binman/etype/u_boot_spl.py          |   3 +
 tools/binman/etype/u_boot_spl_expanded.py |  45 ++++++
 tools/binman/etype/u_boot_spl_nodtb.py    |   5 +-
 tools/binman/etype/u_boot_tpl.py          |   3 +
 tools/binman/etype/u_boot_tpl_expanded.py |  45 ++++++
 tools/binman/etype/u_boot_tpl_nodtb.py    |   5 +-
 tools/binman/ftest.py                     | 174 ++++++++++++++++++++++
 tools/binman/state.py                     |  19 ++-
 tools/binman/test/194_fdt_incl.dts        |  17 +++
 tools/binman/test/195_fdt_incl_tpl.dts    |  13 ++
 16 files changed, 571 insertions(+), 18 deletions(-)
 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_expanded.py
 create mode 100644 tools/binman/test/194_fdt_incl.dts
 create mode 100644 tools/binman/test/195_fdt_incl_tpl.dts
tools/binman/README +77 -0
index 45f0a0c2cd3..1de703cc653 100644
@@ -840,6 +840,83 @@ of the image) can be used to point to the FDT map. See fdtmap and image-header
 entries for more information.
 
 
+Expanded entries
+----------------
+
+Binman automatically replaces 'u-boot' with an expanded version of that, i.e.
+'u-boot-expanded'. This means that when you write:
+
+    u-boot {
+    };
+
+you actually get:
+
+    u-boot {
+        type = "u-boot-expanded';
+    };
+
+which in turn expands to:
+
+    u-boot {
+        type = "section";
+
+        u-boot-nodtb {
+        };
+
+        u-boot-dtb {
+        };
+    };
+
+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.
+
+The above feature ensures that the devicetree is clearly separated from the
+U-Boot executable and can be updated separately by binman as needed. It can be
+disabled with the --no-expanded flag if required.
+
+The same applies for u-boot-spl and u-boot-spl. In those cases, the expansion
+includes the BSS padding, so for example:
+
+    spl {
+        type = "u-boot-spl"
+    };
+
+you actually get:
+
+    spl {
+        type = "u-boot-expanded';
+    };
+
+which in turn expands to:
+
+    spl {
+        type = "section";
+
+        u-boot-spl-nodtb {
+        };
+
+        u-boot-spl-bss-pad {
+        };
+
+        u-boot-spl-dtb {
+        };
+    };
+
+
+Of course we should not expand SPL if it has no devicetree. Also if the BSS
+padding is not needed (because BSS is in RAM as with CONFIG_SPL_SEPARATE_BSS),
+the 'u-boot-spl-bss-pad' subnode should not be created. The use of the expaned
+entry type is controlled by the UseExpanded() method. In the SPL case it checks
+the 'spl-dtb' entry arg, which is 'y' or '1' if SPL has a devicetree.
+
+For the BSS case, a 'spl-bss-pad' entry arg controls whether it is present. All
+entry args are provided by the U-Boot Makefile.
+
+
 Compression
 -----------
 
tools/binman/README.entries +88 -8

162 lines not on this page · raw message

tools/binman/etype/blob_phase.py new file +51 -0

51 lines not on this page · raw message

tools/binman/etype/u_boot.py +5 -3
index de783b26772..d2eaba6d4aa 100644
@@ -2,7 +2,7 @@
 # Copyright (c) 2016 Google, Inc
 # Written by Simon Glass <[email protected]>
 #
-# Entry-type module for U-Boot binary
+# Entry-type module for the expanded U-Boot binary
 #
 
 from binman.entry import Entry
@@ -16,14 +16,16 @@ class Entry_u_boot(Entry_blob):
 
     This is the U-Boot binary, containing relocation information to allow it
     to relocate itself at runtime. The binary typically includes a device tree
-    blob at the end of it. Use u-boot-nodtb if you want to package the device
-    tree separately.
+    blob at the end of it.
 
     U-Boot can access binman symbols at runtime. See:
 
         'Access to binman entry offsets at run time (fdt)'
 
     in the binman README for more information.
+
+    Note that this entry is automatically replaced with u-boot-expanded unless
+    --no-expanded is used.
     """
     def __init__(self, section, etype, node):
         super().__init__(section, etype, node)
tools/binman/etype/u_boot_expanded.py new file +24 -0
new file mode 100644
index 00000000000..8797824c9f0
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright 2021 Google LLC
+# Written by Simon Glass <[email protected]>
+#
+# Entry-type module for U-Boot binary
+#
+
+from binman.etype.blob_phase import Entry_blob_phase
+
+class Entry_u_boot_expanded(Entry_blob_phase):
+    """U-Boot flat binary broken out into its component parts
+
+    This is a section containing the U-Boot binary and a devicetree. Using this
+    entry type automatically creates this section, with the following entries
+    in it:
+
+       u-boot-nodtb
+       u-boot-dtb
+
+    Having the devicetree separate allows binman to update it in the final
+    image, so that the entries positions are provided to the running U-Boot.
+    """
+    def __init__(self, section, etype, node):
+        super().__init__(section, etype, node, 'u-boot', 'u-boot-dtb', False)
tools/binman/etype/u_boot_nodtb.py +2 -2
index 289b24fa6c6..347ba7dc697 100644
@@ -17,8 +17,8 @@ class Entry_u_boot_nodtb(Entry_blob):
     This is the U-Boot binary, containing relocation information to allow it
     to relocate itself at runtime. It does not include a device tree blob at
     the end of it so normally cannot work without it. You can add a u-boot-dtb
-    entry after this one, or use a u-boot entry instead (which contains both
-    U-Boot and the device tree).
+    entry after this one, or use a u-boot entry instead, normally expands to a
+    section containing u-boot and u-boot-dtb
     """
     def __init__(self, section, etype, node):
         super().__init__(section, etype, node)
tools/binman/etype/u_boot_spl.py +3 -0
index d66e46140be..1c39f982519 100644
@@ -30,6 +30,9 @@ class Entry_u_boot_spl(Entry_blob):
 
     The ELF file 'spl/u-boot-spl' must also be available for this to work, since
     binman uses that to look up symbols to write into the SPL binary.
+
+    Note that this entry is automatically replaced with u-boot-spl-expanded
+    unless --no-expanded is used.
     """
     def __init__(self, section, etype, node):
         super().__init__(section, etype, node)
tools/binman/etype/u_boot_spl_expanded.py new file +45 -0

45 lines not on this page · raw message

tools/binman/etype/u_boot_spl_nodtb.py +3 -2
index dbf2f12743a..316b38172ef 100644
@@ -18,8 +18,9 @@ class Entry_u_boot_spl_nodtb(Entry_blob):
     This is the U-Boot SPL binary, It does not include a device tree blob at
     the end of it so may not be able to work without it, assuming SPL needs
     a device tree to operate on your platform. You can add a u-boot-spl-dtb
-    entry after this one, or use a u-boot-spl entry instead (which contains
-    both SPL and the device tree).
+    entry after this one, or use a u-boot-spl entry instead' which normally
+    expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
+    u-boot-spl-dtb
 
     SPL can access binman symbols at runtime. See:
 
tools/binman/etype/u_boot_tpl.py +3 -0
index 02287ab3275..95d9bd6b20e 100644
@@ -30,6 +30,9 @@ class Entry_u_boot_tpl(Entry_blob):
 
     The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
     binman uses that to look up symbols to write into the TPL binary.
+
+    Note that this entry is automatically replaced with u-boot-tpl-expanded
+    unless --no-expanded is used.
     """
     def __init__(self, section, etype, node):
         super().__init__(section, etype, node)
tools/binman/etype/u_boot_tpl_expanded.py new file +45 -0

45 lines not on this page · raw message

tools/binman/etype/u_boot_tpl_nodtb.py +3 -2
index 9a47f599bf1..98f3853f457 100644
@@ -18,8 +18,9 @@ class Entry_u_boot_tpl_nodtb(Entry_blob):
     This is the U-Boot TPL binary, It does not include a device tree blob at
     the end of it so may not be able to work without it, assuming TPL needs
     a device tree to operate on your platform. You can add a u-boot-tpl-dtb
-    entry after this one, or use a u-boot-tpl entry instead (which contains
-    both TPL and the device tree).
+    entry after this one, or use a u-boot-tpl entry instead, which normally
+    expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and
+    u-boot-tpl-dtb
 
     TPL can access binman symbols at runtime. See:
 
tools/binman/ftest.py +174 -0

180 lines not on this page · raw message

tools/binman/state.py +18 -1
index 84f606b1885..dfb17604554 100644
@@ -141,12 +141,16 @@ def SetEntryArgs(args):
     global entry_args
 
     entry_args = {}
+    tout.Debug('Processing entry args:')
     if args:
         for arg in args:
             m = re.match('([^=]*)=(.*)', arg)
             if not m:
                 raise ValueError("Invalid entry arguemnt '%s'" % arg)
-            entry_args[m.group(1)] = m.group(2)
+            name, value = m.groups()
+            tout.Debug('   %20s = %s' % (name, value))
+            entry_args[name] = value
+    tout.Debug('Processing entry args done')
 
 def GetEntryArg(name):
     """Get the value of an entry argument
@@ -159,6 +163,19 @@ def GetEntryArg(name):
     """
     return entry_args.get(name)
 
+def GetEntryArgBool(name):
+    """Get the value of an entry argument as a boolean
+
+    Args:
+        name: Name of argument to retrieve
+
+    Returns:
+        False if the entry argument is consider False (empty, '0' or 'n'), else
+            True
+    """
+    val = GetEntryArg(name)
+    return val and val not in ['n', '0']
+
 def Prepare(images, dtb):
     """Get device tree files ready for use
 
tools/binman/test/194_fdt_incl.dts new file +17 -0
new file mode 100644
index 00000000000..b14c8ff8f52
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		u-boot {
+		};
+		u-boot-spl {
+		};
+		u-boot-tpl {
+		};
+	};
+};
tools/binman/test/195_fdt_incl_tpl.dts new file +13 -0
new file mode 100644
index 00000000000..3756ac4fc47
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		u-boot-tpl {
+		};
+	};
+};
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#34 lore raw

PATCH v3 17/27 binman: Automatically expand phase binaries into sections

When creating an entry, check for an expanded version of that entry, then use it instead. This allows, for example use of:

   u-boot {
   };

instead of having to write out in full:

   u-boot {
      type = "section";
      u-boot-nodtb {
      };

      u-boot-dtb {
      };

};

Add an implementaion of this and associated documentation.

---

Changes in v3:
- Update sizes for new behaviour

 tools/binman/README                       |  77 ++++++++++
 tools/binman/README.entries               |  96 +++++++++++-
 tools/binman/etype/blob_phase.py          |  51 +++++++
 tools/binman/etype/u_boot.py              |   8 +-
 tools/binman/etype/u_boot_expanded.py     |  24 +++
 tools/binman/etype/u_boot_nodtb.py        |   4 +-
 tools/binman/etype/u_boot_spl.py          |   3 +
 tools/binman/etype/u_boot_spl_expanded.py |  45 ++++++
 tools/binman/etype/u_boot_spl_nodtb.py    |   5 +-
 tools/binman/etype/u_boot_tpl.py          |   3 +
 tools/binman/etype/u_boot_tpl_expanded.py |  45 ++++++
 tools/binman/etype/u_boot_tpl_nodtb.py    |   5 +-
 tools/binman/ftest.py                     | 174 ++++++++++++++++++++++
 tools/binman/state.py                     |  19 ++-
 tools/binman/test/194_fdt_incl.dts        |  17 +++
 tools/binman/test/195_fdt_incl_tpl.dts    |  13 ++
 16 files changed, 571 insertions(+), 18 deletions(-)
 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_expanded.py
 create mode 100644 tools/binman/test/194_fdt_incl.dts
 create mode 100644 tools/binman/test/195_fdt_incl_tpl.dts

Applied to u-boot-dm/next, thanks!

#35 lore raw

PATCH v3 18/27 Makefile: Pass new entry args to binman

In reply to Simon Glass

To support the use of 'expanded' entries, binman needs to be told whether SPL and TPL have a devicetree and whether they need BSS padding. Add these to the Makefile.

---

(no changes since v1)

 Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
Makefile +8 -0
index f0101dce407..c6df83ec5a2 100644
@@ -1336,6 +1336,11 @@ u-boot.ldr:	u-boot
 # Use 'make BINMAN_DEBUG=1' to enable debugging
 # Use 'make BINMAN_VERBOSE=3' to set vebosity level
 default_dt := $(if $(DEVICE_TREE),$(DEVICE_TREE),$(CONFIG_DEFAULT_DEVICE_TREE))
+
+# Tell binman whether we have a devicetree for SPL and TPL
+have_spl_dt := $(if $(CONFIG_SPL_OF_PLATDATA),,$(CONFIG_SPL_OF_CONTROL))
+have_tpl_dt := $(if $(CONFIG_TPL_OF_PLATDATA),,$(CONFIG_TPL_OF_CONTROL))
+
 quiet_cmd_binman = BINMAN  $@
 cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
                 --toolpath $(objtree)/tools \
@@ -1346,6 +1351,9 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
 		-a atf-bl31-path=${BL31} \
 		-a default-dt=$(default_dt) \
 		-a scp-path=$(SCP) \
+		-a spl-bss-pad=$(if $(CONFIG_SPL_SEPARATE_BSS),,1) \
+		-a tpl-bss-pad=$(if $(CONFIG_TPL_SEPARATE_BSS),,1) \
+		-a spl-dtb=$(have_spl_dt) -a tpl-dtb=$(have_tpl_dt) \
 		$(BINMAN_$(@F))
 
 OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#36 lore raw

PATCH v3 18/27 Makefile: Pass new entry args to binman

To support the use of 'expanded' entries, binman needs to be told whether SPL and TPL have a devicetree and whether they need BSS padding. Add these to the Makefile.

---

(no changes since v1)

 Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

Applied to u-boot-dm/next, thanks!

#37 lore raw

PATCH v3 19/27 x86: Make use of binman expanded entries

In reply to Simon Glass

We don't need to spell out the separate pieces of U-Boot phase binaries anymore. Revert to using the simple entry and let binman do the expansion itself as needed.

---

(no changes since v1)

 arch/x86/dts/u-boot.dtsi | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
arch/x86/dts/u-boot.dtsi +1 -10
index bf92f45f2d3..50134b2fe00 100644
@@ -38,20 +38,11 @@
 	};
 #endif
 	spl {
-		type = "section";
+		type = "u-boot-spl";
 		offset = <CONFIG_X86_OFFSET_SPL>;
-		u-boot-spl {
-		};
-		u-boot-spl-dtb {
-		};
 	};
 	u-boot {
-		type = "section";
 		offset = <CONFIG_X86_OFFSET_U_BOOT>;
-		u-boot-nodtb {
-		};
-		u-boot-dtb {
-		};
 	};
 #elif defined(CONFIG_SPL)
 	u-boot-spl-with-ucode-ptr {
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#38 lore raw

PATCH v3 19/27 x86: Make use of binman expanded entries

We don't need to spell out the separate pieces of U-Boot phase binaries anymore. Revert to using the simple entry and let binman do the expansion itself as needed.

---

(no changes since v1)

 arch/x86/dts/u-boot.dtsi | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Applied to u-boot-dm/next, thanks!

#39 lore raw

PATCH v3 20/27 x86: dts: Drop unused CONFIG_SPL

In reply to Simon Glass

This cannot be used since the previous #elif has already dealt with SPL. Drop it.

---

(no changes since v1)

 arch/x86/dts/u-boot.dtsi | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/x86/dts/u-boot.dtsi +1 -5
index 50134b2fe00..ca84d18ad90 100644
@@ -55,11 +55,7 @@
 		offset = <CONFIG_X86_OFFSET_U_BOOT>;
 	};
 #else
-# ifdef CONFIG_SPL
-	u-boot {
-		offset = <CONFIG_SYS_TEXT_BASE>;
-	};
-# elif defined(CONFIG_HAVE_MICROCODE)
+# ifdef CONFIG_HAVE_MICROCODE
 	/* If there is no SPL then we need to put microcode in U-Boot */
 	u-boot-with-ucode-ptr {
 		offset = <CONFIG_X86_OFFSET_U_BOOT>;
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#40 lore raw

PATCH v3 20/27 x86: dts: Drop unused CONFIG_SPL

This cannot be used since the previous #elif has already dealt with SPL. Drop it.

---

(no changes since v1)

 arch/x86/dts/u-boot.dtsi | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Applied to u-boot-dm/next, thanks!

#41 lore raw

PATCH v3 21/27 doc: Move UEFI under develop/

In reply to Simon Glass

Much of the content here is useful only for development. Move it under that section.

---

Changes in v3:
- Fix x86 docs which refer to this

Changes in v2:
- Move UEFI under develop/ instead

 doc/arch/x86.rst                         |  4 ++--
 doc/develop/index.rst                    |  1 +
 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                            | 12 ------------
 7 files changed, 7 insertions(+), 14 deletions(-)
 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%)
doc/arch/x86.rst +2 -2
index cc307aa8d5e..2ebfed871bd 100644
@@ -709,8 +709,8 @@ to load a 'u-boot-payload.efi', see below test logs on QEMU.
   No controllers found
   Hit any key to stop autoboot:  0
 
-See :doc:`../uefi/u-boot_on_efi` and :doc:`../uefi/uefi` for details of
-EFI support in U-Boot.
+See :doc:`../develop/uefi/u-boot_on_efi` and :doc:`../develop/uefi/uefi` for
+details of EFI support in U-Boot.
 
 Chain-loading
 -------------
doc/develop/index.rst +1 -0
index 41c0ba1ebd9..84914bb47bf 100644
@@ -13,6 +13,7 @@ Implementation
    global_data
    logging
    menus
+   uefi/index
    version
 
 Debugging
doc/develop/uefi/index.rst renamed from doc/uefi/index.rst +4 -0
similarity index 51%
rename from doc/uefi/index.rst
rename to doc/develop/uefi/index.rst
index b790a91f174..7e65dbc5d5e 100644
@@ -3,6 +3,10 @@
 Unified Extensible Firmware (UEFI)
 ==================================
 
+U-Boot provides an implementation of the UEFI API allowing to run UEFI
+compliant software like Linux, GRUB, and iPXE. Furthermore U-Boot itself
+can be run an UEFI payload.
+
 .. toctree::
    :maxdepth: 2
 
doc/develop/uefi/iscsi.rst renamed from doc/uefi/iscsi.rst +0 -0
similarity index 100%
rename from doc/uefi/iscsi.rst
rename to doc/develop/uefi/iscsi.rst
doc/develop/uefi/u-boot_on_efi.rst renamed from doc/uefi/u-boot_on_efi.rst +0 -0
similarity index 100%
rename from doc/uefi/u-boot_on_efi.rst
rename to doc/develop/uefi/u-boot_on_efi.rst
doc/develop/uefi/uefi.rst renamed from doc/uefi/uefi.rst +0 -0
similarity index 100%
rename from doc/uefi/uefi.rst
rename to doc/develop/uefi/uefi.rst
doc/index.rst +0 -12
index 4c44955d67f..366963813ac 100644
@@ -38,18 +38,6 @@ want to contribute to U-Boot.
 
    develop/index
 
-Unified Extensible Firmware (UEFI)
-----------------------------------
-
-U-Boot provides an implementation of the UEFI API allowing to run UEFI
-compliant software like Linux, GRUB, and iPXE. Furthermore U-Boot itself
-can be run an UEFI payload.
-
-.. toctree::
-   :maxdepth: 2
-
-   uefi/index
-
 Driver-Model documentation
 --------------------------
 
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#42 lore raw

PATCH v3 21/27 doc: Move UEFI under develop/

Quoted 4 lines · Simon Glass

Much of the content here is useful only for development. Move it under that section.

The patch cannot be applied independently of patch 20/27.

Quoted 102 lines

---

Changes in v3:
- Fix x86 docs which refer to this

Changes in v2:
- Move UEFI under develop/ instead

 doc/arch/x86.rst                         |  4 ++--
 doc/develop/index.rst                    |  1 +
 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                            | 12 ------------
 7 files changed, 7 insertions(+), 14 deletions(-)
 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%)
doc/arch/x86.rst +2 -2
index cc307aa8d5e..2ebfed871bd 100644
@@ -709,8 +709,8 @@ to load a 'u-boot-payload.efi', see below test logs on QEMU.
   No controllers found
   Hit any key to stop autoboot:  0
 
-See :doc:`../uefi/u-boot_on_efi` and :doc:`../uefi/uefi` for details of
-EFI support in U-Boot.
+See :doc:`../develop/uefi/u-boot_on_efi` and :doc:`../develop/uefi/uefi` for
+details of EFI support in U-Boot.
 
 Chain-loading
 -------------
doc/develop/index.rst +1 -0
index 41c0ba1ebd9..84914bb47bf 100644
@@ -13,6 +13,7 @@ Implementation
    global_data
    logging
    menus
+   uefi/index
    version
 
 Debugging
doc/develop/uefi/index.rst renamed from doc/uefi/index.rst +4 -0
similarity index 51%
rename from doc/uefi/index.rst
rename to doc/develop/uefi/index.rst
index b790a91f174..7e65dbc5d5e 100644
@@ -3,6 +3,10 @@
 Unified Extensible Firmware (UEFI)
 ==================================
 
+U-Boot provides an implementation of the UEFI API allowing to run UEFI
+compliant software like Linux, GRUB, and iPXE. Furthermore U-Boot itself
+can be run an UEFI payload.
+
 .. toctree::
    :maxdepth: 2
 
doc/develop/uefi/iscsi.rst renamed from doc/uefi/iscsi.rst +0 -0
similarity index 100%
rename from doc/uefi/iscsi.rst
rename to doc/develop/uefi/iscsi.rst
doc/develop/uefi/u-boot_on_efi.rst renamed from doc/uefi/u-boot_on_efi.rst +0 -0
similarity index 100%
rename from doc/uefi/u-boot_on_efi.rst
rename to doc/develop/uefi/u-boot_on_efi.rst
doc/develop/uefi/uefi.rst renamed from doc/uefi/uefi.rst +0 -0
similarity index 100%
rename from doc/uefi/uefi.rst
rename to doc/develop/uefi/uefi.rst
doc/index.rst +0 -12
index 4c44955d67f..366963813ac 100644
@@ -38,18 +38,6 @@ want to contribute to U-Boot.
 
    develop/index
 
-Unified Extensible Firmware (UEFI)
-----------------------------------
-
-U-Boot provides an implementation of the UEFI API allowing to run UEFI
-compliant software like Linux, GRUB, and iPXE. Furthermore U-Boot itself
-can be run an UEFI payload.
-
-.. toctree::
-   :maxdepth: 2
-
-   uefi/index
-
 Driver-Model documentation
 --------------------------
 
#43 lore raw

PATCH v3 21/27 doc: Move UEFI under develop/

Quoted 4 lines · Simon Glass

Much of the content here is useful only for development. Move it under that section.

The patch cannot be applied independently of patch 20/27.

Quoted 8 lines

---

Changes in v3:
- Fix x86 docs which refer to this

Changes in v2:
- Move UEFI under develop/ instead

Quoted 13 lines
 doc/arch/x86.rst                         |  4 ++--
 doc/develop/index.rst                    |  1 +
 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                            | 12 ------------
 7 files changed, 7 insertions(+), 14 deletions(-)
 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%)

Applied to u-boot-dm/next, thanks!

#44 lore raw

PATCH v3 22/27 doc: Move driver model docs under develop/

In reply to Simon Glass

These docs are useful for developers, not users. Move them under that section.

---

(no changes since v2)

Changes in v2:
- Add new patch to move driver model docs under develop/

 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
 doc/{ => develop}/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
 doc/{ => develop}/driver-model/pmic-framework.rst     |  0
 .../driver-model/remoteproc-framework.rst             |  0
 doc/{ => develop}/driver-model/serial-howto.rst       |  0
 doc/{ => develop}/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                                 |  1 +
 doc/index.rst                                         | 11 -----------
 20 files changed, 5 insertions(+), 11 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%)
doc/develop/driver-model/bind.rst renamed from doc/driver-model/bind.rst +0 -0
similarity index 100%
rename from doc/driver-model/bind.rst
rename to doc/develop/driver-model/bind.rst
doc/develop/driver-model/debugging.rst renamed from doc/driver-model/debugging.rst +0 -0
similarity index 100%
rename from doc/driver-model/debugging.rst
rename to doc/develop/driver-model/debugging.rst
doc/develop/driver-model/design.rst renamed from doc/driver-model/design.rst +0 -0
similarity index 100%
rename from doc/driver-model/design.rst
rename to doc/develop/driver-model/design.rst
doc/develop/driver-model/ethernet.rst renamed from doc/driver-model/ethernet.rst +0 -0
similarity index 100%
rename from doc/driver-model/ethernet.rst
rename to doc/develop/driver-model/ethernet.rst
doc/develop/driver-model/fdt-fixup.rst renamed from doc/driver-model/fdt-fixup.rst +0 -0
similarity index 100%
rename from doc/driver-model/fdt-fixup.rst
rename to doc/develop/driver-model/fdt-fixup.rst
doc/develop/driver-model/fs_firmware_loader.rst renamed from doc/driver-model/fs_firmware_loader.rst +0 -0
similarity index 100%
rename from doc/driver-model/fs_firmware_loader.rst
rename to doc/develop/driver-model/fs_firmware_loader.rst
doc/develop/driver-model/i2c-howto.rst renamed from doc/driver-model/i2c-howto.rst +0 -0
similarity index 100%
rename from doc/driver-model/i2c-howto.rst
rename to doc/develop/driver-model/i2c-howto.rst
doc/develop/driver-model/index.rst renamed from doc/driver-model/index.rst +4 -0
similarity index 68%
rename from doc/driver-model/index.rst
rename to doc/develop/driver-model/index.rst
index c9faf0a5910..fd4575db9b7 100644
@@ -3,6 +3,10 @@
 Driver Model
 ============
 
+The following holds information on the U-Boot device driver framework:
+driver-model, including the design details of itself and several driver
+subsystems
+
 .. toctree::
    :maxdepth: 2
 
doc/develop/driver-model/livetree.rst renamed from doc/driver-model/livetree.rst +0 -0
similarity index 100%
rename from doc/driver-model/livetree.rst
rename to doc/develop/driver-model/livetree.rst
doc/develop/driver-model/migration.rst renamed from doc/driver-model/migration.rst +0 -0
similarity index 100%
rename from doc/driver-model/migration.rst
rename to doc/develop/driver-model/migration.rst
doc/develop/driver-model/of-plat.rst renamed from doc/driver-model/of-plat.rst +0 -0
similarity index 100%
rename from doc/driver-model/of-plat.rst
rename to doc/develop/driver-model/of-plat.rst
doc/develop/driver-model/pci-info.rst renamed from doc/driver-model/pci-info.rst +0 -0
similarity index 100%
rename from doc/driver-model/pci-info.rst
rename to doc/develop/driver-model/pci-info.rst
doc/develop/driver-model/pmic-framework.rst renamed from doc/driver-model/pmic-framework.rst +0 -0
similarity index 100%
rename from doc/driver-model/pmic-framework.rst
rename to doc/develop/driver-model/pmic-framework.rst
doc/develop/driver-model/remoteproc-framework.rst renamed from doc/driver-model/remoteproc-framework.rst +0 -0
similarity index 100%
rename from doc/driver-model/remoteproc-framework.rst
rename to doc/develop/driver-model/remoteproc-framework.rst
doc/develop/driver-model/serial-howto.rst renamed from doc/driver-model/serial-howto.rst +0 -0
similarity index 100%
rename from doc/driver-model/serial-howto.rst
rename to doc/develop/driver-model/serial-howto.rst
doc/develop/driver-model/soc-framework.rst renamed from doc/driver-model/soc-framework.rst +0 -0
similarity index 100%
rename from doc/driver-model/soc-framework.rst
rename to doc/develop/driver-model/soc-framework.rst
doc/develop/driver-model/spi-howto.rst renamed from doc/driver-model/spi-howto.rst +0 -0
similarity index 100%
rename from doc/driver-model/spi-howto.rst
rename to doc/develop/driver-model/spi-howto.rst
doc/develop/driver-model/usb-info.rst renamed from doc/driver-model/usb-info.rst +0 -0
similarity index 100%
rename from doc/driver-model/usb-info.rst
rename to doc/develop/driver-model/usb-info.rst
doc/develop/index.rst +1 -0
index 84914bb47bf..444df679578 100644
@@ -10,6 +10,7 @@ Implementation
    :maxdepth: 1
 
    commands
+   driver-model/index
    global_data
    logging
    menus
doc/index.rst +0 -11
index 366963813ac..f7aada966b0 100644
@@ -38,17 +38,6 @@ want to contribute to U-Boot.
 
    develop/index
 
-Driver-Model documentation
---------------------------
-
-The following holds information on the U-Boot device driver framework:
-driver-model, including the design details of itself and several driver
-subsystems.
-
-.. toctree::
-   :maxdepth: 2
-
-   driver-model/index
 
 U-Boot API documentation
 ------------------------
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#45 lore raw

PATCH v3 22/27 doc: Move driver model docs under develop/

These docs are useful for developers, not users. Move them under that section.

---

(no changes since v2)

Changes in v2:
- Add new patch to move driver model docs under develop/

 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
 doc/{ => develop}/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
 doc/{ => develop}/driver-model/pmic-framework.rst     |  0
 .../driver-model/remoteproc-framework.rst             |  0
 doc/{ => develop}/driver-model/serial-howto.rst       |  0
 doc/{ => develop}/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                                 |  1 +
 doc/index.rst                                         | 11 -----------
 20 files changed, 5 insertions(+), 11 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%)

Applied to u-boot-dm/next, thanks!

#46 lore raw

PATCH v3 23/27 binman: doc: Add documentation to htmldocs

In reply to Simon Glass

Add a link to binman's documentation and adjust the files so that it is accessible. Use the name README.rst so it is easy to discover when binman is installed without U-Boot.

---

(no changes since v2)

Changes in v2:
- Put binman docs in doc/develop and FIT in doc/usage
- Rename README.rst to binman.rst and use a symlink

 doc/develop/index.rst               |   8 +
 doc/develop/package/binman.rst      |   1 +
 doc/develop/package/index.rst       |  19 ++
 doc/usage/fit.rst                   |   8 +
 doc/usage/index.rst                 |   1 +
 tools/binman/README.rst             |   1 +
 tools/binman/{README => binman.rst} | 484 ++++++++++++++--------------
 tools/binman/control.py             |   2 +-
 tools/binman/ftest.py               |   4 +-
 tools/binman/index.rst              |   9 +
 tools/binman/setup.py               |   2 +-
 11 files changed, 294 insertions(+), 245 deletions(-)
 create mode 120000 doc/develop/package/binman.rst
 create mode 100644 doc/develop/package/index.rst
 create mode 100644 doc/usage/fit.rst
 create mode 120000 tools/binman/README.rst
 rename tools/binman/{README => binman.rst} (73%)
 create mode 100644 tools/binman/index.rst
doc/develop/index.rst +8 -0
index 444df679578..3edffbc6373 100644
@@ -26,6 +26,14 @@ Debugging
    crash_dumps
    trace
 
+Packaging
+---------
+
+.. toctree::
+   :maxdepth: 1
+
+   package/index
+
 Testing
 -------
 
doc/develop/package/binman.rst new file +1 -0
new file mode 120000
index 00000000000..2e26e84b7d2
@@ -0,0 +1 @@
+../../../tools/binman/binman.rst
\ No newline at end of file
doc/develop/package/index.rst new file +19 -0
new file mode 100644
index 00000000000..9374be2e62c
@@ -0,0 +1,19 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Package U-Boot
+==============
+
+U-Boot uses Flat Image Tree (FIT) as a standard file format for packaging
+images that it it reads and boots. Documentation about FIT is available at
+doc/uImage.FIT
+
+U-Boot also provides binman for cases not covered by FIT. Examples include
+initial execution (since FIT itself does not have an executable header) and
+dealing with device boundaries, such as the read-only/read-write separation in
+SPI flash.
+
+
+.. toctree::
+   :maxdepth: 2
+
+   binman
doc/usage/fit.rst new file +8 -0
new file mode 100644
index 00000000000..70374340577
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Flat Image Tree (FIT)
+=====================
+
+U-Boot uses Flat Image Tree (FIT) as a standard file format for packaging
+images that it it reads and boots. Documentation about FIT is available at
+doc/uImage.FIT
doc/usage/index.rst +1 -0
index f7b706f9166..a79032dc287 100644
@@ -5,6 +5,7 @@ Use U-Boot
    :maxdepth: 1
 
    fdt_overlays
+   fit
    netconsole
    partitions
 
tools/binman/README.rst new file +1 -0
new file mode 120000
index 00000000000..b734f544b73
@@ -0,0 +1 @@
+binman.rst
\ No newline at end of file
tools/binman/binman.rst renamed from tools/binman/README +243 -241

790 lines not on this page · raw message

tools/binman/control.py +1 -1
index 9709aa9a2b2..f57e34daaaa 100644
@@ -569,7 +569,7 @@ def Binman(args):
         if not pager:
             pager = 'more'
         fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
-                            'README')
+                            'README.rst')
         command.Run(pager, fname)
         return 0
 
tools/binman/ftest.py +2 -2
index 432c463b58b..81c213a908a 100644
@@ -631,7 +631,7 @@ class TestFunctional(unittest.TestCase):
     def testFullHelp(self):
         """Test that the full help is displayed with -H"""
         result = self._RunBinman('-H')
-        help_file = os.path.join(self._binman_dir, 'README')
+        help_file = os.path.join(self._binman_dir, 'README.rst')
         # Remove possible extraneous strings
         extra = '::::::::::::::\n' + help_file + '\n::::::::::::::\n'
         gothelp = result.stdout.replace(extra, '')
@@ -644,7 +644,7 @@ class TestFunctional(unittest.TestCase):
         try:
             command.test_result = command.CommandResult()
             result = self._DoBinman('-H')
-            help_file = os.path.join(self._binman_dir, 'README')
+            help_file = os.path.join(self._binman_dir, 'README.rst')
         finally:
             command.test_result = None
 
tools/binman/index.rst new file +9 -0
new file mode 100644
index 00000000000..6eef7b5d050
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Binman
+======
+
+.. toctree::
+   :maxdepth: 2
+
+   README
tools/binman/setup.py +1 -1
index fe408ed6911..2dad43d4937 100644
@@ -7,6 +7,6 @@ setup(name='binman',
       scripts=['binman'],
       packages=['binman', 'binman.etype'],
       package_dir={'binman': ''},
-      package_data={'binman': ['README', 'README.entries']},
+      package_data={'binman': ['README.rst', 'README.entries']},
       classifiers=['Environment :: Console',
                    'Topic :: Software Development :: Embedded Systems'])
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#47 lore raw

PATCH v3 23/27 binman: doc: Add documentation to htmldocs

Add a link to binman's documentation and adjust the files so that it is accessible. Use the name README.rst so it is easy to discover when binman is installed without U-Boot.

---

(no changes since v2)

Changes in v2:
- Put binman docs in doc/develop and FIT in doc/usage
- Rename README.rst to binman.rst and use a symlink

 doc/develop/index.rst               |   8 +
 doc/develop/package/binman.rst      |   1 +
 doc/develop/package/index.rst       |  19 ++
 doc/usage/fit.rst                   |   8 +
 doc/usage/index.rst                 |   1 +
 tools/binman/README.rst             |   1 +
 tools/binman/{README => binman.rst} | 484 ++++++++++++++--------------
 tools/binman/control.py             |   2 +-
 tools/binman/ftest.py               |   4 +-
 tools/binman/index.rst              |   9 +
 tools/binman/setup.py               |   2 +-
 11 files changed, 294 insertions(+), 245 deletions(-)
 create mode 120000 doc/develop/package/binman.rst
 create mode 100644 doc/develop/package/index.rst
 create mode 100644 doc/usage/fit.rst
 create mode 120000 tools/binman/README.rst
 rename tools/binman/{README => binman.rst} (73%)
 create mode 100644 tools/binman/index.rst

Applied to u-boot-dm/next, thanks!

#48 lore raw

PATCH v3 24/27 binman: Rearrange documentation into headings

In reply to Simon Glass

Collect the material into different top-level headings to make it easier to read.

---

(no changes since v1)

 tools/binman/binman.rst | 523 ++++++++++++++++++++--------------------
 1 file changed, 266 insertions(+), 257 deletions(-)
tools/binman/binman.rst +266 -257
index fd6308b6e42..1cdc9de752a 100644
@@ -2,7 +2,7 @@
 .. Copyright (c) 2016 Google, Inc
 
 Introduction
-------------
+============
 
 Firmware often consists of several components which must be packaged together.
 For example, we may have SPL, U-Boot, a device tree and an environment area
@@ -137,6 +137,9 @@ the boundaries between building input files (mkimage) and packaging then
 into a final image (binman).
 
 
+Using binman
+============
+
 Example use of binman in U-Boot
 -------------------------------
 
@@ -230,8 +233,111 @@ You can use other, more specific CONFIG options - see 'Automatic .dtsi
 inclusion' below.
 
 
+Access to binman entry offsets at run time (symbols)
+----------------------------------------------------
+
+Binman assembles images and determines where each entry is placed in the image.
+This information may be useful to U-Boot at run time. For example, in SPL it
+is useful to be able to find the location of U-Boot so that it can be executed
+when SPL is finished.
+
+Binman allows you to declare symbols in the SPL image which are filled in
+with their correct values during the build. For example::
+
+    binman_sym_declare(ulong, u_boot_any, image_pos);
+
+declares a ulong value which will be assigned to the image-pos of any U-Boot
+image (u-boot.bin, u-boot.img, u-boot-nodtb.bin) that is present in the image.
+You can access this value with something like::
+
+    ulong u_boot_offset = binman_sym(ulong, u_boot_any, image_pos);
+
+Thus u_boot_offset will be set to the image-pos of U-Boot in memory, assuming
+that the whole image has been loaded, or is available in flash. You can then
+jump to that address to start U-Boot.
+
+At present this feature is only supported in SPL and TPL. In principle it is
+possible to fill in such symbols in U-Boot proper, as well, but a future C
+library is planned for this instead, to read from the device tree.
+
+As well as image-pos, it is possible to read the size of an entry and its
+offset (which is the start position of the entry within its parent).
+
+A small technical note: Binman automatically adds the base address of the image
+(i.e. __image_copy_start) to the value of the image-pos symbol, so that when the
+image is loaded to its linked address, the value will be correct and actually
+point into the image.
+
+For example, say SPL is at the start of the image and linked to start at address
+80108000. If U-Boot's image-pos is 0x8000 then binman will write an image-pos
+for U-Boot of 80110000 into the SPL binary, since it assumes the image is loaded
+to 80108000, with SPL at 80108000 and U-Boot at 80110000.
+
+For x86 devices (with the end-at-4gb property) this base address is not added
+since it is assumed that images are XIP and the offsets already include the
+address.
+
+
+Access to binman entry offsets at run time (fdt)
+------------------------------------------------
+
+Binman can update the U-Boot FDT to include the final position and size of
+each entry in the images it processes. The option to enable this is -u and it
+causes binman to make sure that the 'offset', 'image-pos' and 'size' properties
+are set correctly for every entry. Since it is not necessary to specify these in
+the image definition, binman calculates the final values and writes these to
+the device tree. These can be used by U-Boot at run-time to find the location
+of each entry.
+
+Alternatively, an FDT map entry can be used to add a special FDT containing
+just the information about the image. This is preceded by a magic string so can
+be located anywhere in the image. An image header (typically at the start or end
+of the image) can be used to point to the FDT map. See fdtmap and image-header
+entries for more information.
+
+
+Map files
+---------
+
+The -m option causes binman to output a .map file for each image that it
+generates. This shows the offset and size of each entry. For example::
+
+      Offset      Size  Name
+    00000000  00000028  main-section
+     00000000  00000010  section at 0
+      00000000  00000004  u-boot
+     00000010  00000010  section at 1
+      00000000  00000004  u-boot
+
+This shows a hierarchical image with two sections, each with a single entry. The
+offsets of the sections are absolute hex byte offsets within the image. The
+offsets of the entries are relative to their respective sections. The size of
+each entry is also shown, in bytes (hex). The indentation shows the entries
+nested inside their sections.
+
+
+Passing command-line arguments to entries
+-----------------------------------------
+
+Sometimes it is useful to pass binman the value of an entry property from the
+command line. For example some entries need access to files and it is not
+always convenient to put these filenames in the image definition (device tree).
+
+The-a option supports this::
+
+    -a<prop>=<value>
+
+where::
+
+    <prop> is the property to set
+    <value> is the value to set it to
+
+Not all properties can be provided this way. Only some entries support it,
+typically for filenames.
+
+
 Image description format
-------------------------
+========================
 
 The binman node is called 'binman'. An example image description is shown
 below::
@@ -528,6 +634,157 @@ allow-repack:
     image description to be stored in the FDT and fdtmap.
 
 
+Hashing Entries
+---------------
+
+It is possible to ask binman to hash the contents of an entry and write that
+value back to the device-tree node. For example::
+
+    binman {
+        u-boot {
+            hash {
+                algo = "sha256";
+            };
+        };
+    };
+
+Here, a new 'value' property will be written to the 'hash' node containing
+the hash of the 'u-boot' entry. Only SHA256 is supported at present. Whole
+sections can be hased if desired, by adding the 'hash' node to the section.
+
+The has value can be chcked at runtime by hashing the data actually read and
+comparing this has to the value in the device tree.
+
+
+Expanded entries
+----------------
+
+Binman automatically replaces 'u-boot' with an expanded version of that, i.e.
+'u-boot-expanded'. This means that when you write::
+
+    u-boot {
+    };
+
+you actually get::
+
+    u-boot {
+        type = "u-boot-expanded';
+    };
+
+which in turn expands to::
+
+    u-boot {
+        type = "section";
+
+        u-boot-nodtb {
+        };
+
+        u-boot-dtb {
+        };
+    };
+
+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.
+
+The above feature ensures that the devicetree is clearly separated from the
+U-Boot executable and can be updated separately by binman as needed. It can be
+disabled with the --no-expanded flag if required.
+
+The same applies for u-boot-spl and u-boot-spl. In those cases, the expansion
+includes the BSS padding, so for example::
+
+    spl {
+        type = "u-boot-spl"
+    };
+
+you actually get::
+
+    spl {
+        type = "u-boot-expanded';
+    };
+
+which in turn expands to::
+
+    spl {
+        type = "section";
+
+        u-boot-spl-nodtb {
+        };
+
+        u-boot-spl-bss-pad {
+        };
+
+        u-boot-spl-dtb {
+        };
+    };
+
+Of course we should not expand SPL if it has no devicetree. Also if the BSS
+padding is not needed (because BSS is in RAM as with CONFIG_SPL_SEPARATE_BSS),
+the 'u-boot-spl-bss-pad' subnode should not be created. The use of the expaned
+entry type is controlled by the UseExpanded() method. In the SPL case it checks
+the 'spl-dtb' entry arg, which is 'y' or '1' if SPL has a devicetree.
+
+For the BSS case, a 'spl-bss-pad' entry arg controls whether it is present. All
+entry args are provided by the U-Boot Makefile.
+
+
+Compression
+-----------
+
+Binman support compression for 'blob' entries (those of type 'blob' and
+derivatives). To enable this for an entry, add a 'compress' property::
+
+    blob {
+        filename = "datafile";
+        compress = "lz4";
+    };
+
+The entry will then contain the compressed data, using the 'lz4' compression
+algorithm. Currently this is the only one that is supported. The uncompressed
+size is written to the node in an 'uncomp-size' property, if -u is used.
+
+Compression is also supported for sections. In that case the entire section is
+compressed in one block, including all its contents. This means that accessing
+an entry from the section required decompressing the entire section. Also, the
+size of a section indicates the space that it consumes in its parent section
+(and typically the image). With compression, the section may contain more data,
+and the uncomp-size property indicates that, as above. The contents of the
+section is compressed first, before any padding is added. This ensures that the
+padding itself is not compressed, which would be a waste of time.
+
+
+Automatic .dtsi inclusion
+-------------------------
+
+It is sometimes inconvenient to add a 'binman' node to the .dts file for each
+board. This can be done by using #include to bring in a common file. Another
+approach supported by the U-Boot build system is to automatically include
+a common header. You can then put the binman node (and anything else that is
+specific to U-Boot, such as u-boot,dm-pre-reloc properies) in that header
+file.
+
+Binman will search for the following files in arch/<arch>/dts::
+
+   <dts>-u-boot.dtsi where <dts> is the base name of the .dts file
+   <CONFIG_SYS_SOC>-u-boot.dtsi
+   <CONFIG_SYS_CPU>-u-boot.dtsi
+   <CONFIG_SYS_VENDOR>-u-boot.dtsi
+   u-boot.dtsi
+
+U-Boot will only use the first one that it finds. If you need to include a
+more general file you can do that from the more specific file using #include.
+If you are having trouble figuring out what is going on, you can uncomment
+the 'warning' line in scripts/Makefile.lib to see what it has found::
+
+   # Uncomment for debugging
+   # This shows all the files that were considered and the one that we chose.
+   # u_boot_dtsi_options_debug = $(u_boot_dtsi_options_raw)
+
+
 Entry Documentation
 -------------------
 
@@ -537,6 +794,9 @@ see README.entries. This is generated from the source code using:
     binman entry-docs >tools/binman/README.entries
 
 
+Managing images
+===============
+
 Listing images
 --------------
 
@@ -653,27 +913,9 @@ by increasing the -v/--verbosity from the default of 1:
 
 You can use BINMAN_VERBOSE=5 (for example) when building to select this.
 
-Hashing Entries
----------------
-
-It is possible to ask binman to hash the contents of an entry and write that
-value back to the device-tree node. For example::
-
-    binman {
-        u-boot {
-            hash {
-                algo = "sha256";
-            };
-        };
-    };
-
-Here, a new 'value' property will be written to the 'hash' node containing
-the hash of the 'u-boot' entry. Only SHA256 is supported at present. Whole
-sections can be hased if desired, by adding the 'hash' node to the section.
-
-The has value can be chcked at runtime by hashing the data actually read and
-comparing this has to the value in the device tree.
 
+Technical details
+=================
 
 Order of image creation
 -----------------------
@@ -750,239 +992,6 @@ what happens in this stage.
 final step.
 
 
-Automatic .dtsi inclusion
--------------------------
-
-It is sometimes inconvenient to add a 'binman' node to the .dts file for each
-board. This can be done by using #include to bring in a common file. Another
-approach supported by the U-Boot build system is to automatically include
-a common header. You can then put the binman node (and anything else that is
-specific to U-Boot, such as u-boot,dm-pre-reloc properies) in that header
-file.
-
-Binman will search for the following files in arch/<arch>/dts::
-
-   <dts>-u-boot.dtsi where <dts> is the base name of the .dts file
-   <CONFIG_SYS_SOC>-u-boot.dtsi
-   <CONFIG_SYS_CPU>-u-boot.dtsi
-   <CONFIG_SYS_VENDOR>-u-boot.dtsi
-   u-boot.dtsi
-
-U-Boot will only use the first one that it finds. If you need to include a
-more general file you can do that from the more specific file using #include.
-If you are having trouble figuring out what is going on, you can uncomment
-the 'warning' line in scripts/Makefile.lib to see what it has found::
-
-   # Uncomment for debugging
-   # This shows all the files that were considered and the one that we chose.
-   # u_boot_dtsi_options_debug = $(u_boot_dtsi_options_raw)
-
-
-Access to binman entry offsets at run time (symbols)
-----------------------------------------------------
-
-Binman assembles images and determines where each entry is placed in the image.
-This information may be useful to U-Boot at run time. For example, in SPL it
-is useful to be able to find the location of U-Boot so that it can be executed
-when SPL is finished.
-
-Binman allows you to declare symbols in the SPL image which are filled in
-with their correct values during the build. For example::
-
-    binman_sym_declare(ulong, u_boot_any, image_pos);
-
-declares a ulong value which will be assigned to the image-pos of any U-Boot
-image (u-boot.bin, u-boot.img, u-boot-nodtb.bin) that is present in the image.
-You can access this value with something like::
-
-    ulong u_boot_offset = binman_sym(ulong, u_boot_any, image_pos);
-
-Thus u_boot_offset will be set to the image-pos of U-Boot in memory, assuming
-that the whole image has been loaded, or is available in flash. You can then
-jump to that address to start U-Boot.
-
-At present this feature is only supported in SPL and TPL. In principle it is
-possible to fill in such symbols in U-Boot proper, as well, but a future C
-library is planned for this instead, to read from the device tree.
-
-As well as image-pos, it is possible to read the size of an entry and its
-offset (which is the start position of the entry within its parent).
-
-A small technical note: Binman automatically adds the base address of the image
-(i.e. __image_copy_start) to the value of the image-pos symbol, so that when the
-image is loaded to its linked address, the value will be correct and actually
-point into the image.
-
-For example, say SPL is at the start of the image and linked to start at address
-80108000. If U-Boot's image-pos is 0x8000 then binman will write an image-pos
-for U-Boot of 80110000 into the SPL binary, since it assumes the image is loaded
-to 80108000, with SPL at 80108000 and U-Boot at 80110000.
-
-For x86 devices (with the end-at-4gb property) this base address is not added
-since it is assumed that images are XIP and the offsets already include the
-address.
-
-
-Access to binman entry offsets at run time (fdt)
-------------------------------------------------
-
-Binman can update the U-Boot FDT to include the final position and size of
-each entry in the images it processes. The option to enable this is -u and it
-causes binman to make sure that the 'offset', 'image-pos' and 'size' properties
-are set correctly for every entry. Since it is not necessary to specify these in
-the image definition, binman calculates the final values and writes these to
-the device tree. These can be used by U-Boot at run-time to find the location
-of each entry.
-
-Alternatively, an FDT map entry can be used to add a special FDT containing
-just the information about the image. This is preceded by a magic string so can
-be located anywhere in the image. An image header (typically at the start or end
-of the image) can be used to point to the FDT map. See fdtmap and image-header
-entries for more information.
-
-
-Expanded entries
-----------------
-
-Binman automatically replaces 'u-boot' with an expanded version of that, i.e.
-'u-boot-expanded'. This means that when you write::
-
-    u-boot {
-    };
-
-you actually get::
-
-    u-boot {
-        type = "u-boot-expanded';
-    };
-
-which in turn expands to::
-
-    u-boot {
-        type = "section";
-
-        u-boot-nodtb {
-        };
-
-        u-boot-dtb {
-        };
-    };
-
-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.
-
-The above feature ensures that the devicetree is clearly separated from the
-U-Boot executable and can be updated separately by binman as needed. It can be
-disabled with the --no-expanded flag if required.
-
-The same applies for u-boot-spl and u-boot-spl. In those cases, the expansion
-includes the BSS padding, so for example::
-
-    spl {
-        type = "u-boot-spl"
-    };
-
-you actually get::
-
-    spl {
-        type = "u-boot-expanded';
-    };
-
-which in turn expands to::
-
-    spl {
-        type = "section";
-
-        u-boot-spl-nodtb {
-        };
-
-        u-boot-spl-bss-pad {
-        };
-
-        u-boot-spl-dtb {
-        };
-    };
-
-
-Of course we should not expand SPL if it has no devicetree. Also if the BSS
-padding is not needed (because BSS is in RAM as with CONFIG_SPL_SEPARATE_BSS),
-the 'u-boot-spl-bss-pad' subnode should not be created. The use of the expaned
-entry type is controlled by the UseExpanded() method. In the SPL case it checks
-the 'spl-dtb' entry arg, which is 'y' or '1' if SPL has a devicetree.
-
-For the BSS case, a 'spl-bss-pad' entry arg controls whether it is present. All
-entry args are provided by the U-Boot Makefile.
-
-
-Compression
------------
-
-Binman support compression for 'blob' entries (those of type 'blob' and
-derivatives). To enable this for an entry, add a 'compress' property::
-
-    blob {
-        filename = "datafile";
-        compress = "lz4";
-    };
-
-The entry will then contain the compressed data, using the 'lz4' compression
-algorithm. Currently this is the only one that is supported. The uncompressed
-size is written to the node in an 'uncomp-size' property, if -u is used.
-
-Compression is also supported for sections. In that case the entire section is
-compressed in one block, including all its contents. This means that accessing
-an entry from the section required decompressing the entire section. Also, the
-size of a section indicates the space that it consumes in its parent section
-(and typically the image). With compression, the section may contain more data,
-and the uncomp-size property indicates that, as above. The contents of the
-section is compressed first, before any padding is added. This ensures that the
-padding itself is not compressed, which would be a waste of time.
-
-
-Map files
----------
-
-The -m option causes binman to output a .map file for each image that it
-generates. This shows the offset and size of each entry. For example::
-
-      Offset      Size  Name
-    00000000  00000028  main-section
-     00000000  00000010  section at 0
-      00000000  00000004  u-boot
-     00000010  00000010  section at 1
-      00000000  00000004  u-boot
-
-This shows a hierarchical image with two sections, each with a single entry. The
-offsets of the sections are absolute hex byte offsets within the image. The
-offsets of the entries are relative to their respective sections. The size of
-each entry is also shown, in bytes (hex). The indentation shows the entries
-nested inside their sections.
-
-
-Passing command-line arguments to entries
------------------------------------------
-
-Sometimes it is useful to pass binman the value of an entry property from the
-command line. For example some entries need access to files and it is not
-always convenient to put these filenames in the image definition (device tree).
-
-The-a option supports this::
-
-    -a<prop>=<value>
-
-where::
-
-    <prop> is the property to set
-    <value> is the value to set it to
-
-Not all properties can be provided this way. Only some entries support it,
-typically for filenames.
-
-
 External tools
 --------------
 
@@ -1050,8 +1059,8 @@ Then, you can run the tests under cross-compilation::
 You can also use gcc-i686-linux-gnu similar to the above.
 
 
-Advanced Features / Technical docs
-----------------------------------
+Writing new entries and debugging
+---------------------------------
 
 The behaviour of entries is defined by the Entry class. All other entries are
 a subclass of this. An important subclass is Entry_blob which takes binary
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#49 lore raw

PATCH v3 24/27 binman: Rearrange documentation into headings

Collect the material into different top-level headings to make it easier to read.

---

(no changes since v1)

 tools/binman/binman.rst | 523 ++++++++++++++++++++--------------------
 1 file changed, 266 insertions(+), 257 deletions(-)

Applied to u-boot-dm/next, thanks!

#50 lore raw

PATCH v3 25/27 binman: Incorporate entry documentation

In reply to Simon Glass

Update this to avoid sphinx warnings and incorporate it into the new documentaiton tree.

---

(no changes since v1)

 tools/binman/cmdline.py                      |  2 +-
 tools/binman/{README.entries => entries.rst} | 79 +++++++++++---------
 tools/binman/etype/cbfs.py                   | 10 +--
 tools/binman/etype/fdtmap.py                 | 30 ++++----
 tools/binman/etype/fit.py                    | 19 +++--
 tools/binman/etype/intel_ifwi.py             |  8 +-
 tools/binman/etype/mkimage.py                |  2 +-
 tools/binman/etype/section.py                |  6 +-
 tools/binman/etype/text.py                   |  6 +-
 tools/binman/setup.py                        |  2 +-
 10 files changed, 87 insertions(+), 77 deletions(-)
 rename tools/binman/{README.entries => entries.rst} (97%)
tools/binman/cmdline.py +1 -1
index 0c0f48951f6..95f9ba27fbd 100644
@@ -69,7 +69,7 @@ controlled by a description in the board device tree.'''
         default=False, help='Update the binman node with offset/size info')
 
     entry_parser = subparsers.add_parser('entry-docs',
-        help='Write out entry documentation (see README.entries)')
+        help='Write out entry documentation (see entries.rst)')
 
     list_parser = subparsers.add_parser('ls', help='List files in an image')
     list_parser.add_argument('-i', '--image', type=str, required=True,
tools/binman/entries.rst renamed from tools/binman/README.entries +42 -37

189 lines not on this page · raw message

tools/binman/etype/cbfs.py +5 -5
index 6cdbaa085f5..baf9c3e45b7 100644
@@ -22,7 +22,7 @@ class Entry_cbfs(Entry):
 
     CBFS is used by coreboot as its way of orgnanising SPI-flash contents.
 
-    The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.:
+    The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.::
 
         cbfs {
             size = <0x100000>;
@@ -38,7 +38,7 @@ class Entry_cbfs(Entry):
     Note that the size is required since binman does not support calculating it.
     The contents of each entry is just what binman would normally provide if it
     were not a CBFS node. A blob type can be used to import arbitrary files as
-    with the second subnode below:
+    with the second subnode below::
 
         cbfs {
             size = <0x100000>;
@@ -84,7 +84,7 @@ class Entry_cbfs(Entry):
             This is an ELF file that has been loaded (i.e. mapped to memory), so
             appears in the CBFS as a flat binary. The input file must be an ELF
             image, for example this puts "u-boot" (the ELF image) into a 'stage'
-            entry:
+            entry::
 
                 cbfs {
                     size = <0x100000>;
@@ -94,7 +94,7 @@ class Entry_cbfs(Entry):
                     };
                 };
 
-            You can use your own ELF file with something like:
+            You can use your own ELF file with something like::
 
                 cbfs {
                     size = <0x100000>;
@@ -127,7 +127,7 @@ class Entry_cbfs(Entry):
     particular offset in the CBFS and a few other things.
 
     Of course binman can create images containing multiple CBFSs, simply by
-    defining these in the binman config:
+    defining these in the binman config::
 
 
         binman {
tools/binman/etype/fdtmap.py +15 -15
index 6ca88a100e5..2339feeba8d 100644
@@ -53,24 +53,24 @@ class Entry_fdtmap(Entry):
     Note that the -u option must be provided to ensure that binman updates the
     FDT with the position of each entry.
 
-    Example output for a simple image with U-Boot and an FDT map:
-
-    / {
-        image-name = "binman";
-        size = <0x00000112>;
-        image-pos = <0x00000000>;
-        offset = <0x00000000>;
-        u-boot {
-            size = <0x00000004>;
+    Example output for a simple image with U-Boot and an FDT map::
+
+        / {
+            image-name = "binman";
+            size = <0x00000112>;
             image-pos = <0x00000000>;
             offset = <0x00000000>;
+            u-boot {
+                size = <0x00000004>;
+                image-pos = <0x00000000>;
+                offset = <0x00000000>;
+            };
+            fdtmap {
+                size = <0x0000010e>;
+                image-pos = <0x00000004>;
+                offset = <0x00000004>;
+            };
         };
-        fdtmap {
-            size = <0x0000010e>;
-            image-pos = <0x00000004>;
-            offset = <0x00000004>;
-        };
-    };
 
     If allow-repack is used then 'orig-offset' and 'orig-size' properties are
     added as necessary. See the binman README.
tools/binman/etype/fit.py +11 -8
index 1a7cbd7cec7..c4fa711b850 100644
@@ -22,7 +22,7 @@ class Entry_fit(Entry):
     Nodes for the FIT should be written out in the binman configuration just as
     they would be in a file passed to mkimage.
 
-    For example, this creates an image containing a FIT with U-Boot SPL:
+    For example, this creates an image containing a FIT with U-Boot SPL::
 
         binman {
             fit {
@@ -52,7 +52,7 @@ class Entry_fit(Entry):
     The fit,fdt-list property (see above) indicates that of-list should be used.
     If the property is missing you will get an error.
 
-    Then add a 'generator node', a node with a name starting with '@':
+    Then add a 'generator node', a node with a name starting with '@'::
 
         images {
             @fdt-SEQ {
@@ -67,7 +67,7 @@ class Entry_fit(Entry):
     node acts like a template to generate the nodes. The generator node itself
     does not appear in the output - it is replaced with what binman generates.
 
-    You can create config nodes in a similar way:
+    You can create config nodes in a similar way::
 
         configurations {
             default = "@config-DEFAULT-SEQ";
@@ -84,8 +84,10 @@ class Entry_fit(Entry):
 
     Available substitutions for '@' nodes are:
 
-        SEQ    Sequence number of the generated fdt (1, 2, ...)
-        NAME   Name of the dtb as provided (i.e. without adding '.dtb')
+    SEQ:
+        Sequence number of the generated fdt (1, 2, ...)
+    NAME
+        Name of the dtb as provided (i.e. without adding '.dtb')
 
     Note that if no devicetree files are provided (with '-a of-list' as above)
     then no nodes will be generated.
@@ -94,10 +96,11 @@ class Entry_fit(Entry):
     if of configuration whose devicetree matches the 'default-dt' entry
     argument, e.g. with '-a default-dt=sun50i-a64-pine64-lts'.
 
-    Available substitutions for '@' property values are:
+    Available substitutions for '@' property values are
 
-        DEFAULT-SEQ  Sequence number of the default fdt,as provided by the
-                     'default-dt' entry argument
+    DEFAULT-SEQ:
+        Sequence number of the default fdt,as provided by the 'default-dt' entry
+        argument
 
     Properties (in the 'fit' node itself):
         fit,external-offset: Indicates that the contents of the FIT are external
tools/binman/etype/intel_ifwi.py +4 -4
index 1a0e481c198..c2ede641aa5 100644
@@ -37,10 +37,10 @@ class Entry_intel_ifwi(Entry_blob_ext):
     sub-partition (and optional entry name).
 
     Properties for subnodes:
-        ifwi-subpart - sub-parition to put this entry into, e.g. "IBBP"
-        ifwi-entry - entry name t use, e.g. "IBBL"
-        ifwi-replace - if present, indicates that the item should be replaced
-            in the IFWI. Otherwise it is added.
+        - ifwi-subpart: sub-parition to put this entry into, e.g. "IBBP"
+        - ifwi-entry: entry name t use, e.g. "IBBL"
+        - ifwi-replace: if present, indicates that the item should be replaced
+          in the IFWI. Otherwise it is added.
 
     See README.x86 for information about x86 binary blobs.
     """
tools/binman/etype/mkimage.py +1 -1
index 8fddc881187..f8c491d5d0a 100644
@@ -19,7 +19,7 @@ class Entry_mkimage(Entry):
         - args: Other arguments to pass
 
     The data passed to mkimage is collected from subnodes of the mkimage node,
-    e.g.:
+    e.g.::
 
         mkimage {
             args = "-n test -T imximage";
tools/binman/etype/section.py +4 -2
index 2f862bddf0f..cce1500b4e5 100644
@@ -22,11 +22,13 @@ from patman.tools import ToHexSize
 class Entry_section(Entry):
     """Entry that contains other entries
 
-    Properties / Entry arguments: (see binman README for more information)
+    Properties / Entry arguments: (see binman README for more information):
         pad-byte: Pad byte to use when padding
         sort-by-offset: True if entries should be sorted by offset, False if
-            they must be in-order in the device tree description
+        they must be in-order in the device tree description
+
         end-at-4gb: Used to build an x86 ROM which ends at 4GB (2^32)
+
         skip-at-start: Number of bytes before the first entry starts. These
             effectively adjust the starting offset of entries. For example,
             if this is 16, then the first entry would start at 16. An entry
tools/binman/etype/text.py +3 -3
index a69c2a4ec48..45dfcc401e4 100644
@@ -25,7 +25,7 @@ class Entry_text(Entry):
         <text>: The text to place in the entry (overrides the above mechanism).
             This is useful when the text is constant.
 
-    Example node:
+    Example node::
 
         text {
             size = <50>;
@@ -38,7 +38,7 @@ class Entry_text(Entry):
 
     and binman will insert that string into the entry.
 
-    It is also possible to put the string directly in the node:
+    It is also possible to put the string directly in the node::
 
         text {
             size = <8>;
@@ -46,7 +46,7 @@ class Entry_text(Entry):
             message = "a message directly in the node"
         };
 
-    or just:
+    or just::
 
         text {
             size = <8>;
tools/binman/setup.py +1 -1
index 2dad43d4937..5ed94abdaf9 100644
@@ -7,6 +7,6 @@ setup(name='binman',
       scripts=['binman'],
       packages=['binman', 'binman.etype'],
       package_dir={'binman': ''},
-      package_data={'binman': ['README.rst', 'README.entries']},
+      package_data={'binman': ['README.rst', 'entries.rst']},
       classifiers=['Environment :: Console',
                    'Topic :: Software Development :: Embedded Systems'])
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#51 lore raw

PATCH v3 25/27 binman: Incorporate entry documentation

Update this to avoid sphinx warnings and incorporate it into the new documentaiton tree.

---

(no changes since v1)

 tools/binman/cmdline.py                      |  2 +-
 tools/binman/{README.entries => entries.rst} | 79 +++++++++++---------
 tools/binman/etype/cbfs.py                   | 10 +--
 tools/binman/etype/fdtmap.py                 | 30 ++++----
 tools/binman/etype/fit.py                    | 19 +++--
 tools/binman/etype/intel_ifwi.py             |  8 +-
 tools/binman/etype/mkimage.py                |  2 +-
 tools/binman/etype/section.py                |  6 +-
 tools/binman/etype/text.py                   |  6 +-
 tools/binman/setup.py                        |  2 +-
 10 files changed, 87 insertions(+), 77 deletions(-)
 rename tools/binman/{README.entries => entries.rst} (97%)

Applied to u-boot-dm/next, thanks!

#52 lore raw

PATCH v3 26/27 binman: Drop repetitive heading for each entry

In reply to Simon Glass

Many entries start 'Entry containing a'. This looks fine in the source code but is annoying when viewed in the htmldocs table of contents. Drop these unnecessary words.

---

Changes in v3:
- Update entry docs

 tools/binman/entries.rst            | 76 ++++++++++++++---------------
 tools/binman/etype/atf_bl31.py      |  2 +-
 tools/binman/etype/blob.py          |  2 +-
 tools/binman/etype/blob_ext.py      |  2 +-
 tools/binman/etype/cbfs.py          |  2 +-
 tools/binman/etype/files.py         |  2 +-
 tools/binman/etype/fit.py           |  2 +-
 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    |  2 +-
 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       |  2 +-
 tools/binman/etype/scp.py           |  2 +-
 20 files changed, 57 insertions(+), 57 deletions(-)
tools/binman/entries.rst +38 -38
index 2d79850c641..f6faa15562f 100644
@@ -11,8 +11,8 @@ features to produce new behaviours.
 
 
 
-Entry: atf-bl31: Entry containing an ARM Trusted Firmware (ATF) BL31 blob
--------------------------------------------------------------------------
+Entry: atf-bl31: ARM Trusted Firmware (ATF) BL31 blob
+-----------------------------------------------------
 
 Properties / Entry arguments:
     - atf-bl31-path: Filename of file to read into entry. This is typically
@@ -25,8 +25,8 @@ about ATF.
 
 
 
-Entry: blob: Entry containing an arbitrary binary blob
-------------------------------------------------------
+Entry: blob: Arbitrary binary blob
+----------------------------------
 
 Note: This should not be used by itself. It is normally used as a parent
 class by other entry types.
@@ -56,8 +56,8 @@ obtained from the list of available device-tree files, managed by the
 
 
 
-Entry: blob-ext: Entry containing an externally built binary blob
------------------------------------------------------------------
+Entry: blob-ext: Externally built binary blob
+---------------------------------------------
 
 Note: This should not be used by itself. It is normally used as a parent
 class by other entry types.
@@ -96,8 +96,8 @@ entry; similarly for SPL.
 
 
 
-Entry: cbfs: Entry containing a Coreboot Filesystem (CBFS)
-----------------------------------------------------------
+Entry: cbfs: Coreboot Filesystem (CBFS)
+---------------------------------------
 
 A CBFS provides a way to group files into a group. It has a simple directory
 structure and allows the position of individual files to be set, since it is
@@ -303,8 +303,8 @@ added as necessary. See the binman README.
 
 
 
-Entry: files: Entry containing a set of files
----------------------------------------------
+Entry: files: A set of files arranged in a section
+--------------------------------------------------
 
 Properties / Entry arguments:
     - pattern: Filename pattern to match the files to include
@@ -335,8 +335,8 @@ byte value of a region.
 
 
 
-Entry: fit: Entry containing a FIT
-----------------------------------
+Entry: fit: Flat Image Tree (FIT)
+---------------------------------
 
 This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the
 input provided.
@@ -491,8 +491,8 @@ first/last in the entry list.
 
 
 
-Entry: intel-cmc: Entry containing an Intel Chipset Micro Code (CMC) file
--------------------------------------------------------------------------
+Entry: intel-cmc: Intel Chipset Micro Code (CMC) file
+-----------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -544,8 +544,8 @@ This entry contains a pointer to the FIT. It is required to be at address
 
 
 
-Entry: intel-fsp: Entry containing an Intel Firmware Support Package (FSP) file
--------------------------------------------------------------------------------
+Entry: intel-fsp: Intel Firmware Support Package (FSP) file
+-----------------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -561,8 +561,8 @@ See README.x86 for information about x86 binary blobs.
 
 
 
-Entry: intel-fsp-m: Entry containing Intel Firmware Support Package (FSP) memory init
--------------------------------------------------------------------------------------
+Entry: intel-fsp-m: Intel Firmware Support Package (FSP) memory init
+--------------------------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -578,8 +578,8 @@ See README.x86 for information about x86 binary blobs.
 
 
 
-Entry: intel-fsp-s: Entry containing Intel Firmware Support Package (FSP) silicon init
---------------------------------------------------------------------------------------
+Entry: intel-fsp-s: Intel Firmware Support Package (FSP) silicon init
+---------------------------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -595,8 +595,8 @@ See README.x86 for information about x86 binary blobs.
 
 
 
-Entry: intel-fsp-t: Entry containing Intel Firmware Support Package (FSP) temp ram init
----------------------------------------------------------------------------------------
+Entry: intel-fsp-t: Intel Firmware Support Package (FSP) temp ram init
+----------------------------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -611,8 +611,8 @@ See README.x86 for information about x86 binary blobs.
 
 
 
-Entry: intel-ifwi: Entry containing an Intel Integrated Firmware Image (IFWI) file
-----------------------------------------------------------------------------------
+Entry: intel-ifwi: Intel Integrated Firmware Image (IFWI) file
+--------------------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry. This is either the
@@ -645,8 +645,8 @@ See README.x86 for information about x86 binary blobs.
 
 
 
-Entry: intel-me: Entry containing an Intel Management Engine (ME) file
-----------------------------------------------------------------------
+Entry: intel-me: Intel Management Engine (ME) file
+--------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -665,8 +665,8 @@ See README.x86 for information about x86 binary blobs.
 
 
 
-Entry: intel-mrc: Entry containing an Intel Memory Reference Code (MRC) file
-----------------------------------------------------------------------------
+Entry: intel-mrc: Intel Memory Reference Code (MRC) file
+--------------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -679,8 +679,8 @@ See README.x86 for information about x86 binary blobs.
 
 
 
-Entry: intel-refcode: Entry containing an Intel Reference Code file
--------------------------------------------------------------------
+Entry: intel-refcode: Intel Reference Code file
+-----------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -693,8 +693,8 @@ See README.x86 for information about x86 binary blobs.
 
 
 
-Entry: intel-vbt: Entry containing an Intel Video BIOS Table (VBT) file
------------------------------------------------------------------------
+Entry: intel-vbt: Intel Video BIOS Table (VBT) file
+---------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -706,8 +706,8 @@ See README.x86 for information about Intel binary blobs.
 
 
 
-Entry: intel-vga: Entry containing an Intel Video Graphics Adaptor (VGA) file
------------------------------------------------------------------------------
+Entry: intel-vga: Intel Video Graphics Adaptor (VGA) file
+---------------------------------------------------------
 
 Properties / Entry arguments:
     - filename: Filename of file to read into entry
@@ -721,8 +721,8 @@ See README.x86 for information about Intel binary blobs.
 
 
 
-Entry: mkimage: Entry containing a binary produced by mkimage
--------------------------------------------------------------
+Entry: mkimage: Binary produced by mkimage
+------------------------------------------
 
 Properties / Entry arguments:
     - datafile: Filename for -d argument
@@ -756,8 +756,8 @@ placed at offset 'RESET_VECTOR_ADDRESS - 0xffc'.
 
 
 
-Entry: scp: Entry containing a System Control Processor (SCP) firmware blob
----------------------------------------------------------------------------
+Entry: scp: System Control Processor (SCP) firmware blob
+--------------------------------------------------------
 
 Properties / Entry arguments:
     - scp-path: Filename of file to read into the entry, typically scp.bin
tools/binman/etype/atf_bl31.py +1 -1
index 195adc714b5..163d7141840 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg
 
 class Entry_atf_bl31(Entry_blob_named_by_arg):
-    """Entry containing an ARM Trusted Firmware (ATF) BL31 blob
+    """ARM Trusted Firmware (ATF) BL31 blob
 
     Properties / Entry arguments:
         - atf-bl31-path: Filename of file to read into entry. This is typically
tools/binman/etype/blob.py +1 -1
index e609a8b253f..018f8c9a319 100644
@@ -11,7 +11,7 @@ from patman import tools
 from patman import tout
 
 class Entry_blob(Entry):
-    """Entry containing an arbitrary binary blob
+    """Arbitrary binary blob
 
     Note: This should not be used by itself. It is normally used as a parent
     class by other entry types.
tools/binman/etype/blob_ext.py +1 -1
index e372445f300..d6b0ca17c3f 100644
@@ -13,7 +13,7 @@ from patman import tools
 from patman import tout
 
 class Entry_blob_ext(Entry_blob):
-    """Entry containing an externally built binary blob
+    """Externally built binary blob
 
     Note: This should not be used by itself. It is normally used as a parent
     class by other entry types.
tools/binman/etype/cbfs.py +1 -1
index baf9c3e45b7..1daddeb8229 100644
@@ -13,7 +13,7 @@ from binman.entry import Entry
 from dtoc import fdt_util
 
 class Entry_cbfs(Entry):
-    """Entry containing a Coreboot Filesystem (CBFS)
+    """Coreboot Filesystem (CBFS)
 
     A CBFS provides a way to group files into a group. It has a simple directory
     structure and allows the position of individual files to be set, since it is
tools/binman/etype/files.py +1 -1
index 1feebd0510e..5db36abef0b 100644
@@ -15,7 +15,7 @@ from patman import tools
 
 
 class Entry_files(Entry_section):
-    """Entry containing a set of files
+    """A set of files arranged in a section
 
     Properties / Entry arguments:
         - pattern: Filename pattern to match the files to include
tools/binman/etype/fit.py +1 -1
index c4fa711b850..6936f5736a6 100644
@@ -14,7 +14,7 @@ from dtoc.fdt import Fdt
 from patman import tools
 
 class Entry_fit(Entry):
-    """Entry containing a FIT
+    """Flat Image Tree (FIT)
 
     This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the
     input provided.
tools/binman/etype/intel_cmc.py +1 -1
index 644fa421d3f..494d43c9cf9 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_cmc(Entry_blob_ext):
-    """Entry containing an Intel Chipset Micro Code (CMC) file
+    """Intel Chipset Micro Code (CMC) file
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_fsp.py +1 -1
index 2ac012bce19..326cb7d09b3 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_fsp(Entry_blob_ext):
-    """Entry containing an Intel Firmware Support Package (FSP) file
+    """Intel Firmware Support Package (FSP) file
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_fsp_m.py +1 -1
index 434b0f1856e..9bcac790ed9 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_fsp_m(Entry_blob_ext):
-    """Entry containing Intel Firmware Support Package (FSP) memory init
+    """Intel Firmware Support Package (FSP) memory init
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_fsp_s.py +1 -1
index 564e1228bba..1d5046d452b 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_fsp_s(Entry_blob_ext):
-    """Entry containing Intel Firmware Support Package (FSP) silicon init
+    """Intel Firmware Support Package (FSP) silicon init
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_fsp_t.py +1 -1
index df0c5fbee0f..80d95cc6f9c 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_fsp_t(Entry_blob_ext):
-    """Entry containing Intel Firmware Support Package (FSP) temp ram init
+    """Intel Firmware Support Package (FSP) temp ram init
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_ifwi.py +1 -1
index c2ede641aa5..903d39bdbeb 100644
@@ -13,7 +13,7 @@ from dtoc import fdt_util
 from patman import tools
 
 class Entry_intel_ifwi(Entry_blob_ext):
-    """Entry containing an Intel Integrated Firmware Image (IFWI) file
+    """Intel Integrated Firmware Image (IFWI) file
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry. This is either the
tools/binman/etype/intel_me.py +1 -1
index a6fe5427f31..b93ebabdc9e 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_me(Entry_blob_ext):
-    """Entry containing an Intel Management Engine (ME) file
+    """Intel Management Engine (ME) file
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_mrc.py +1 -1
index ccbb046519d..bb8b26ff686 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_mrc(Entry_blob_ext):
-    """Entry containing an Intel Memory Reference Code (MRC) file
+    """Intel Memory Reference Code (MRC) file
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_refcode.py +1 -1
index 5ead08b2be4..9112730a9a4 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_refcode(Entry_blob_ext):
-    """Entry containing an Intel Reference Code file
+    """Intel Reference Code file
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_vbt.py +1 -1
index 2a98c123688..8afd576600c 100644
@@ -7,7 +7,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_vbt(Entry_blob_ext):
-    """Entry containing an Intel Video BIOS Table (VBT) file
+    """Intel Video BIOS Table (VBT) file
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/intel_vga.py +1 -1
index a103f1ce0ee..51e6465f0d0 100644
@@ -8,7 +8,7 @@
 from binman.etype.blob_ext import Entry_blob_ext
 
 class Entry_intel_vga(Entry_blob_ext):
-    """Entry containing an Intel Video Graphics Adaptor (VGA) file
+    """Intel Video Graphics Adaptor (VGA) file
 
     Properties / Entry arguments:
         - filename: Filename of file to read into entry
tools/binman/etype/mkimage.py +1 -1
index f8c491d5d0a..e9f82729ab4 100644
@@ -12,7 +12,7 @@ from dtoc import fdt_util
 from patman import tools
 
 class Entry_mkimage(Entry):
-    """Entry containing a binary produced by mkimage
+    """Binary produced by mkimage
 
     Properties / Entry arguments:
         - datafile: Filename for -d argument
tools/binman/etype/scp.py +1 -1
index 93f8787d2d7..a9bee3ce8bc 100644
@@ -7,7 +7,7 @@
 from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg
 
 class Entry_scp(Entry_blob_named_by_arg):
-    """Entry containing a System Control Processor (SCP) firmware blob
+    """System Control Processor (SCP) firmware blob
 
     Properties / Entry arguments:
         - scp-path: Filename of file to read into the entry, typically scp.bin
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#53 lore raw

PATCH v3 26/27 binman: Drop repetitive heading for each entry

Many entries start 'Entry containing a'. This looks fine in the source code but is annoying when viewed in the htmldocs table of contents. Drop these unnecessary words.

---

Changes in v3:
- Update entry docs

 tools/binman/entries.rst            | 76 ++++++++++++++---------------
 tools/binman/etype/atf_bl31.py      |  2 +-
 tools/binman/etype/blob.py          |  2 +-
 tools/binman/etype/blob_ext.py      |  2 +-
 tools/binman/etype/cbfs.py          |  2 +-
 tools/binman/etype/files.py         |  2 +-
 tools/binman/etype/fit.py           |  2 +-
 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    |  2 +-
 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       |  2 +-
 tools/binman/etype/scp.py           |  2 +-
 20 files changed, 57 insertions(+), 57 deletions(-)

Applied to u-boot-dm/next, thanks!

#54 lore raw

PATCH v3 27/27 binman: Update various pieces of the documentation

In reply to Simon Glass

A few sections are a little out of date now. Update them.

---

Changes in v3:
- Make a symlink to the entry docs

 doc/develop/package/entries.rst |  1 +
 tools/binman/binman.rst         | 83 +++++++++++++++++----------------
 2 files changed, 45 insertions(+), 39 deletions(-)
 create mode 120000 doc/develop/package/entries.rst
doc/develop/package/entries.rst new file +1 -0
new file mode 120000
index 00000000000..ecedcebaad4
@@ -0,0 +1 @@
+../../../tools/binman/entries.rst
\ No newline at end of file
tools/binman/binman.rst +44 -39

130 lines not on this page · raw message

Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#55 lore raw

PATCH v3 27/27 binman: Update various pieces of the documentation

A few sections are a little out of date now. Update them.

---

Changes in v3:
- Make a symlink to the entry docs

 doc/develop/package/entries.rst |  1 +
 tools/binman/binman.rst         | 83 +++++++++++++++++----------------
 2 files changed, 45 insertions(+), 39 deletions(-)
 create mode 120000 doc/develop/package/entries.rst

Applied to u-boot-dm/next, thanks!