binary-manager 0.0.6__tar.gz → 0.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {binary-manager-0.0.6/src/binary_manager.egg-info → binary_manager-0.0.7}/PKG-INFO +185 -141
- {binary-manager-0.0.6 → binary_manager-0.0.7}/README.rst +182 -139
- {binary-manager-0.0.6 → binary_manager-0.0.7}/pyproject.toml +1 -1
- {binary-manager-0.0.6 → binary_manager-0.0.7/src/binary_manager.egg-info}/PKG-INFO +185 -141
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binary_manager.egg-info/SOURCES.txt +8 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/bintool.py +14 -3
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/cbfstool.py +2 -1
- binary_manager-0.0.7/src/binman/btool/cst.py +53 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/fdt_add_pubkey.py +4 -0
- binary_manager-0.0.7/src/binman/btool/fdtgrep.py +136 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/mkeficapsule.py +2 -1
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/mkimage.py +5 -2
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/openssl.py +21 -2
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/control.py +115 -37
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/elf.py +11 -7
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/entry.py +43 -5
- binary_manager-0.0.7/src/binman/etype/alternates_fdt.py +132 -0
- binary_manager-0.0.7/src/binman/etype/atf_bl1.py +23 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/atf_bl31.py +1 -1
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/atf_fip.py +2 -2
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/blob.py +6 -1
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/blob_dtb.py +5 -3
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/blob_phase.py +5 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/cbfs.py +1 -1
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/efi_capsule.py +27 -22
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/efi_empty_capsule.py +12 -10
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/fdtmap.py +3 -2
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/fit.py +245 -43
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/fmap.py +1 -3
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/image_header.py +1 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_descriptor.py +1 -1
- binary_manager-0.0.7/src/binman/etype/nxp_header_ddrfw.py +29 -0
- binary_manager-0.0.7/src/binman/etype/nxp_imx8mcst.py +194 -0
- binary_manager-0.0.7/src/binman/etype/nxp_imx8mimage.py +75 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/pre_load.py +2 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/section.py +22 -38
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/ti_board_config.py +7 -0
- binary_manager-0.0.7/src/binman/etype/ti_dm.py +22 -0
- binary_manager-0.0.7/src/binman/etype/ti_secure.py +174 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_spl_nodtb.py +0 -2
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_spl_pubkey_dtb.py +2 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_tpl_nodtb.py +0 -2
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_vpl.py +3 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_vpl_nodtb.py +2 -2
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/x509_cert.py +4 -1
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/fip_util.py +8 -8
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/image.py +33 -12
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/main.py +13 -5
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/setup.py +1 -1
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/state.py +2 -0
- binary-manager-0.0.6/src/binman/etype/ti_secure.py +0 -78
- {binary-manager-0.0.6 → binary_manager-0.0.7}/LICENSE +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/setup.cfg +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binary_manager.egg-info/dependency_links.txt +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binary_manager.egg-info/entry_points.txt +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binary_manager.egg-info/requires.txt +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binary_manager.egg-info/top_level.txt +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/__init__.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/_testing.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/bootgen.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/btool_gzip.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/bzip2.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/fiptool.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/futility.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/ifwitool.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/lz4.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/lzma_alone.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/lzop.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/xz.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/btool/zstd.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/cbfs_util.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/cmdline.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/_testing.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/blob_ext.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/blob_ext_list.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/blob_named_by_arg.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/collection.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/cros_ec_rw.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/encrypted.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/files.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/fill.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/gbb.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_cmc.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_fit.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_fit_ptr.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_fsp.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_fsp_m.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_fsp_s.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_fsp_t.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_ifwi.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_me.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_mrc.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_refcode.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_vbt.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/intel_vga.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/mkimage.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/null.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/opensbi.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/powerpc_mpc85xx_bootpg_resetvec.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/rockchip_tpl.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/scp.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/tee_os.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/text.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/ti_secure_rom.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_dtb.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_dtb_with_ucode.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_elf.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_env.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_expanded.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_img.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_nodtb.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_spl.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_spl_bss_pad.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_spl_dtb.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_spl_elf.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_spl_expanded.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_spl_with_ucode_ptr.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_tpl.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_tpl_bss_pad.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_tpl_dtb.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_tpl_dtb_with_ucode.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_tpl_elf.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_tpl_expanded.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_tpl_with_ucode_ptr.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_ucode.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_vpl_bss_pad.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_vpl_dtb.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_vpl_elf.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_vpl_expanded.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/u_boot_with_ucode_ptr.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/vblock.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/x86_reset16.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/x86_reset16_spl.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/x86_reset16_tpl.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/x86_start16.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/x86_start16_spl.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/x86_start16_tpl.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/etype/xilinx_bootgen.py +0 -0
- {binary-manager-0.0.6 → binary_manager-0.0.7}/src/binman/fmap_util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: binary-manager
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: Binman firmware-packaging tool
|
|
5
5
|
Author-email: Simon Glass <sjg@chromium.org>
|
|
6
6
|
Project-URL: Homepage, https://docs.u-boot.org/en/latest/develop/package/index.html
|
|
@@ -14,6 +14,7 @@ License-File: LICENSE
|
|
|
14
14
|
Requires-Dist: pylibfdt
|
|
15
15
|
Requires-Dist: u_boot_pylib>=0.0.6
|
|
16
16
|
Requires-Dist: dtoc>=0.0.6
|
|
17
|
+
Dynamic: license-file
|
|
17
18
|
|
|
18
19
|
.. SPDX-License-Identifier: GPL-2.0+
|
|
19
20
|
.. Copyright (c) 2016 Google, Inc
|
|
@@ -22,7 +23,7 @@ Introduction
|
|
|
22
23
|
============
|
|
23
24
|
|
|
24
25
|
Firmware often consists of several components which must be packaged together.
|
|
25
|
-
For example, we may have SPL, U-Boot, a
|
|
26
|
+
For example, we may have SPL, U-Boot, a devicetree and an environment area
|
|
26
27
|
grouped together and placed in MMC flash. When the system starts, it must be
|
|
27
28
|
able to find these pieces.
|
|
28
29
|
|
|
@@ -36,7 +37,7 @@ together.
|
|
|
36
37
|
What it does
|
|
37
38
|
------------
|
|
38
39
|
|
|
39
|
-
Binman reads your board's
|
|
40
|
+
Binman reads your board's devicetree and finds a node which describes the
|
|
40
41
|
required image layout. It uses this to work out what to place where.
|
|
41
42
|
|
|
42
43
|
Binman provides a mechanism for building images, from simple SPL + U-Boot
|
|
@@ -48,12 +49,12 @@ needed.
|
|
|
48
49
|
Features
|
|
49
50
|
--------
|
|
50
51
|
|
|
51
|
-
Apart from basic padding, alignment and positioning features, Binman supports
|
|
52
|
-
hierarchical images, compression, hashing and dealing with the binary blobs
|
|
52
|
+
Apart from basic padding, alignment, and positioning features, Binman supports
|
|
53
|
+
hierarchical images, compression, hashing and dealing with the binary blobs,
|
|
53
54
|
which are a sad trend in open-source firmware at present.
|
|
54
55
|
|
|
55
56
|
Executable binaries can access the location of other binaries in an image by
|
|
56
|
-
using special linker symbols (zero-overhead but
|
|
57
|
+
using special linker symbols (zero-overhead but limited) or by reading
|
|
57
58
|
the devicetree description of the image.
|
|
58
59
|
|
|
59
60
|
Binman is designed primarily for use with U-Boot and associated binaries such
|
|
@@ -72,14 +73,14 @@ Motivation
|
|
|
72
73
|
----------
|
|
73
74
|
|
|
74
75
|
As mentioned above, packaging of firmware is quite a different task from
|
|
75
|
-
building the various parts. In many cases the various binaries which go into
|
|
76
|
-
|
|
76
|
+
building the various parts. In many cases the various binaries which go into image
|
|
77
|
+
come from separate build systems. For example, ARM Trusted Firmware
|
|
77
78
|
is used on ARMv8 devices but is not built in the U-Boot tree. If a Linux kernel
|
|
78
79
|
is included in the firmware image, it is built elsewhere.
|
|
79
80
|
|
|
80
|
-
It is of course possible to add
|
|
81
|
+
It is of course possible to add further build rules to the U-Boot
|
|
81
82
|
build system to cover these cases. It can shell out to other Makefiles and
|
|
82
|
-
build scripts. But it seems
|
|
83
|
+
build scripts. But it seems preferable to create a clear divide between building
|
|
83
84
|
software and packaging it.
|
|
84
85
|
|
|
85
86
|
At present this is handled by manual instructions, different for each board,
|
|
@@ -99,7 +100,7 @@ Benefits:
|
|
|
99
100
|
- Avoids cluttering the U-Boot build system with image-building code
|
|
100
101
|
- The image description is automatically available at run-time in U-Boot,
|
|
101
102
|
SPL. It can be made available to other software also
|
|
102
|
-
- The image description is easily readable (
|
|
103
|
+
- The image description is easily readable (a text file in devicetree
|
|
103
104
|
format) and permits flexible packing of binaries
|
|
104
105
|
|
|
105
106
|
|
|
@@ -119,7 +120,7 @@ You can install binman using::
|
|
|
119
120
|
|
|
120
121
|
pip install binary-manager
|
|
121
122
|
|
|
122
|
-
The name
|
|
123
|
+
The name was chosen since binman conflicts with an existing package.
|
|
123
124
|
|
|
124
125
|
If you are using binman within the U-Boot tree, it may be easiest to add a
|
|
125
126
|
symlink from your local `~/.bin` directory to `/path/to/tools/binman/binman`.
|
|
@@ -133,9 +134,9 @@ load / execution addresses, compression. It also supports verification
|
|
|
133
134
|
through hashing and RSA signatures.
|
|
134
135
|
|
|
135
136
|
FIT was originally designed to support booting a Linux kernel (with an
|
|
136
|
-
optional ramdisk) and
|
|
137
|
-
Now that U-Boot supports configuration via
|
|
138
|
-
load U-Boot from a FIT, with the
|
|
137
|
+
optional ramdisk) and devicetree chosen from assorted options in the FIT.
|
|
138
|
+
Now that U-Boot supports configuration via devicetree, it is possible to
|
|
139
|
+
load U-Boot from a FIT, with the devicetree chosen by SPL.
|
|
139
140
|
|
|
140
141
|
Binman considers FIT to be one of the binaries it can place in the image.
|
|
141
142
|
|
|
@@ -157,7 +158,7 @@ Relationship to mkimage
|
|
|
157
158
|
-----------------------
|
|
158
159
|
|
|
159
160
|
The mkimage tool provides a means to create a FIT. Traditionally it has
|
|
160
|
-
needed an image description file: a
|
|
161
|
+
needed an image description file: a devicetree, like binman, but in a
|
|
161
162
|
different format. More recently it has started to support a '-f auto' mode
|
|
162
163
|
which can generate that automatically.
|
|
163
164
|
|
|
@@ -190,7 +191,7 @@ build system.
|
|
|
190
191
|
Consider sunxi. It has the following steps:
|
|
191
192
|
|
|
192
193
|
#. It uses a custom mksunxiboot tool to build an SPL image called
|
|
193
|
-
sunxi-spl.bin. This should
|
|
194
|
+
sunxi-spl.bin. This should better go into mkimage.
|
|
194
195
|
|
|
195
196
|
#. It uses mkimage to package U-Boot into a legacy image file (so that it can
|
|
196
197
|
hold the load and execution address) called u-boot.img.
|
|
@@ -210,7 +211,7 @@ can be replaced by a call to binman.
|
|
|
210
211
|
Invoking binman within U-Boot
|
|
211
212
|
-----------------------------
|
|
212
213
|
|
|
213
|
-
Within U-Boot, binman is invoked by the build system, i.e
|
|
214
|
+
Within U-Boot, binman is invoked by the build system, i.e., when you type 'make'
|
|
214
215
|
or use buildman to build U-Boot. There is no need to run binman independently
|
|
215
216
|
during development. Everything happens automatically and is set up for your
|
|
216
217
|
SoC or board so that binman produced the right things.
|
|
@@ -225,10 +226,10 @@ invocations as well, but these should be dropped when those architectures are
|
|
|
225
226
|
converted to use binman properly.
|
|
226
227
|
|
|
227
228
|
As above, the term 'binary' is used for something in INPUTS-y and 'image' is
|
|
228
|
-
used for the things that binman creates.
|
|
229
|
-
image(s) and it is the image that is actually loaded on the board.
|
|
229
|
+
used for the things that binman creates. Hence, the binaries are inputs to the
|
|
230
|
+
image(s), and it is the image that is actually loaded on the board.
|
|
230
231
|
|
|
231
|
-
Again, at present, there are a
|
|
232
|
+
Again, at present, there are a few things created in Makefile which should
|
|
232
233
|
be done by binman (when we get around to it), like `u-boot-ivt.img`,
|
|
233
234
|
`lpc32xx-spl.img`, `u-boot-with-nand-spl.imx`, `u-boot-spl-padx4.sfp` and
|
|
234
235
|
`u-boot-mtk.bin`, just to pick on a few. When completed this will remove about
|
|
@@ -239,15 +240,15 @@ are needed, in that one invocation. It does this by working through the image
|
|
|
239
240
|
descriptions one by one, collecting the input binaries, processing them as
|
|
240
241
|
needed and producing the final images.
|
|
241
242
|
|
|
242
|
-
The same binaries may be used
|
|
243
|
+
The same binaries may be used for multiple images. For example, binman may be used
|
|
243
244
|
to produce an SD-card image and a SPI-flash image. In this case the binaries
|
|
244
245
|
going into the process are the same, but binman produces slightly different
|
|
245
246
|
images in each case.
|
|
246
247
|
|
|
247
248
|
For some SoCs, U-Boot is not the only project that produces the necessary
|
|
248
249
|
binaries. For example, ARM Trusted Firmware (ATF) is a project that produces
|
|
249
|
-
binaries which must be
|
|
250
|
-
to work you must have built ATF before you build U-Boot and you must tell U-Boot
|
|
250
|
+
binaries which must be incorporated, such as `bl31.elf` or `bl31.bin`. For this
|
|
251
|
+
to work you must have built ATF before you build U-Boot, and you must tell U-Boot
|
|
251
252
|
where to find the bl31 image, using the BL31 environment variable.
|
|
252
253
|
|
|
253
254
|
How do you know how to incorporate ATF? It is handled by the atf-bl31 entry type
|
|
@@ -284,29 +285,29 @@ nor is there any need to provide a real ATF BL31 binary (for example). These can
|
|
|
284
285
|
be added later by invoking binman again, providing all the required inputs
|
|
285
286
|
from the first time, plus any that were missing or placeholders.
|
|
286
287
|
|
|
287
|
-
|
|
288
|
+
Then, in practice binman is often used twice:
|
|
288
289
|
|
|
289
|
-
-
|
|
290
|
-
-
|
|
290
|
+
- Once within the U-Boot build system, for development and testing
|
|
291
|
+
- Again, outside U-Boot to assembly and final production images
|
|
291
292
|
|
|
292
293
|
While the same input binaries are used in each case, you will of course you will
|
|
293
|
-
need to create your own binman command line,
|
|
294
|
+
need to create your own binman command line, like that in `cmd_binman` in
|
|
294
295
|
the Makefile. You may find the -I and --toolpath options useful. The
|
|
295
|
-
|
|
296
|
+
devicetree file is provided to binman in binary form, so there is no need to
|
|
296
297
|
have access to the original `.dts` sources.
|
|
297
298
|
|
|
298
299
|
|
|
299
300
|
Assembling the image description
|
|
300
301
|
--------------------------------
|
|
301
302
|
|
|
302
|
-
Since binman uses the
|
|
303
|
+
Since binman uses the devicetree for its image description, you can use the
|
|
303
304
|
same files that describe your board's hardware to describe how the image is
|
|
304
|
-
assembled. Typically the images description is in a common file used by all
|
|
305
|
+
assembled. Typically, the images description is in a common file used by all
|
|
305
306
|
boards with a particular SoC (e.g. `imx8mp-u-boot.dtsi`).
|
|
306
307
|
|
|
307
|
-
Where a particular
|
|
308
|
-
the SoC file, just as it would for any other
|
|
309
|
-
add
|
|
308
|
+
Where a particular board needs to make changes, it can override properties in
|
|
309
|
+
the SoC file, just as it would for any other devicetree property. It can also
|
|
310
|
+
add an image that is specific to the board.
|
|
310
311
|
|
|
311
312
|
Another way to control the image description to make use of CONFIG options in
|
|
312
313
|
the description. For example, if the start offset of a particular entry varies
|
|
@@ -320,7 +321,7 @@ by board, you can add a Kconfig for that and reference it in the description::
|
|
|
320
321
|
...
|
|
321
322
|
};
|
|
322
323
|
|
|
323
|
-
The SoC can provide a default value but boards can override that as needed and
|
|
324
|
+
The SoC can provide a default value, but boards can override that as needed and
|
|
324
325
|
binman will take care of it.
|
|
325
326
|
|
|
326
327
|
It is even possible to control which entries appear in the image, by using the
|
|
@@ -334,15 +335,15 @@ C preprocessor::
|
|
|
334
335
|
|
|
335
336
|
Only boards which enable `HAVE_MRC` will include this entry.
|
|
336
337
|
|
|
337
|
-
Obviously a similar approach can be used to control which images are produced,
|
|
338
|
-
with a Kconfig option to enable a SPI image, for example. However there is
|
|
339
|
-
|
|
338
|
+
Obviously, a similar approach can be used to control which images are produced,
|
|
339
|
+
with a Kconfig option to enable a SPI image, for example. However, there is
|
|
340
|
+
no general harm in producing an image that is not used. If a board uses MMC
|
|
340
341
|
but not SPI, but the SoC supports booting from both, then both images can be
|
|
341
|
-
produced, with only
|
|
342
|
-
reduce the need for having multiple defconfig targets for
|
|
342
|
+
produced, with only one or other being used by a particular board. This can help
|
|
343
|
+
reduce the need for having multiple defconfig targets, for boards where the
|
|
343
344
|
only difference is the boot media, enabling / disabling secure boot, etc.
|
|
344
345
|
|
|
345
|
-
Of course you can use the
|
|
346
|
+
Of course, you can use the devicetree itself to pass any board-specific
|
|
346
347
|
information that is needed by U-Boot at runtime (see binman_syms_ for how to
|
|
347
348
|
make binman insert these values directly into executables like SPL).
|
|
348
349
|
|
|
@@ -358,14 +359,14 @@ Producing images for multiple boards
|
|
|
358
359
|
When invoked within U-Boot, binman only builds a single set of images, for
|
|
359
360
|
the chosen board. This is set by the `CONFIG_DEFAULT_DEVICE_TREE` option.
|
|
360
361
|
|
|
361
|
-
However, U-Boot
|
|
362
|
-
SoC. These are written
|
|
362
|
+
However, U-Boot builds all the devicetree files associated with an
|
|
363
|
+
SoC. These are written in the (e.g. for ARM) `arch/arm/dts` directory. Each of
|
|
363
364
|
these contains the full binman description for that board. Often the best
|
|
364
|
-
approach is to build a single image that includes all these
|
|
365
|
+
approach is to build a single image that includes all these devicetree binaries
|
|
365
366
|
and allow SPL to select the correct one on boot.
|
|
366
367
|
|
|
367
368
|
However, it is also possible to build separate images for each board, simply by
|
|
368
|
-
invoking binman multiple times, once for each
|
|
369
|
+
invoking binman multiple times, once for each devicetree file, using a
|
|
369
370
|
different output directory. This will produce one set of images for each board.
|
|
370
371
|
|
|
371
372
|
|
|
@@ -446,7 +447,7 @@ build.
|
|
|
446
447
|
|
|
447
448
|
(Future work will make this more configurable)
|
|
448
449
|
|
|
449
|
-
In either case, binman picks up the
|
|
450
|
+
In either case, binman picks up the devicetree file (u-boot.dtb) and looks
|
|
450
451
|
for its instructions in the 'binman' node.
|
|
451
452
|
|
|
452
453
|
Binman has a few other options which you can see by running 'binman -h'.
|
|
@@ -458,11 +459,11 @@ Enabling binman for a board
|
|
|
458
459
|
At present binman is invoked from a rule in the main Makefile. You should be
|
|
459
460
|
able to enable CONFIG_BINMAN to enable this rule.
|
|
460
461
|
|
|
461
|
-
The output file is typically named image.bin and is
|
|
462
|
+
The output file is typically named image.bin and is in the output
|
|
462
463
|
directory. If input files are needed to you add these to INPUTS-y either in the
|
|
463
464
|
main Makefile or in a config.mk file in your arch subdirectory.
|
|
464
465
|
|
|
465
|
-
Once binman is executed it will pick up its instructions from a
|
|
466
|
+
Once binman is executed it will pick up its instructions from a devicetree
|
|
466
467
|
file, typically <soc>-u-boot.dtsi, where <soc> is your CONFIG_SYS_SOC value.
|
|
467
468
|
You can use other, more specific CONFIG options - see 'Automatic .dtsi
|
|
468
469
|
inclusion' below.
|
|
@@ -493,30 +494,36 @@ You can access this value with something like:
|
|
|
493
494
|
ulong u_boot_offset = binman_sym(ulong, u_boot_any, image_pos);
|
|
494
495
|
|
|
495
496
|
Thus u_boot_offset will be set to the image-pos of U-Boot in memory, assuming
|
|
496
|
-
that the whole image has been loaded
|
|
497
|
+
that the whole image has been loaded or is available in flash. You can then
|
|
497
498
|
jump to that address to start U-Boot.
|
|
498
499
|
|
|
499
500
|
At present this feature is only supported in SPL and TPL. In principle it is
|
|
500
501
|
possible to fill in such symbols in U-Boot proper, as well, but a future C
|
|
501
|
-
library is planned for this instead, to read from the
|
|
502
|
+
library is planned for this instead, to read from the devicetree.
|
|
502
503
|
|
|
503
504
|
As well as image-pos, it is possible to read the size of an entry and its
|
|
504
505
|
offset (which is the start position of the entry within its parent).
|
|
505
506
|
|
|
506
507
|
A small technical note: Binman automatically adds the base address of the image
|
|
507
508
|
(i.e. __image_copy_start) to the value of the image-pos symbol, so that when the
|
|
508
|
-
image is loaded to its linked address
|
|
509
|
+
image is loaded to its linked address; the value will be correct and actually
|
|
509
510
|
point into the image.
|
|
510
511
|
|
|
511
512
|
For example, say SPL is at the start of the image and linked to start at address
|
|
512
513
|
80108000. If U-Boot's image-pos is 0x8000 then binman will write an image-pos
|
|
513
514
|
for U-Boot of 80110000 into the SPL binary, since it assumes the image is loaded
|
|
514
|
-
to 80108000, with SPL at 80108000 and U-Boot at 80110000.
|
|
515
|
+
to 80108000, with SPL at 80108000 and U-Boot at 80110000. In other words, the
|
|
516
|
+
positions are calculated relative to the start address of the image to which
|
|
517
|
+
they are being written.
|
|
515
518
|
|
|
516
519
|
For x86 devices (with the end-at-4gb property) this base address is not added
|
|
517
520
|
since it is assumed that images are XIP and the offsets already include the
|
|
518
521
|
address.
|
|
519
522
|
|
|
523
|
+
For non-x86 cases where the symbol is used as a flash offset, the symbols-base
|
|
524
|
+
property can be set to that offset (e.g. 0), so that the unadjusted image-pos
|
|
525
|
+
is written into the image.
|
|
526
|
+
|
|
520
527
|
While U-Boot's symbol updating is handled automatically by the u-boot-spl
|
|
521
528
|
entry type (and others), it is possible to use this feature with any blob. To
|
|
522
529
|
do this, add a `write-symbols` (boolean) property to the node, set the ELF
|
|
@@ -534,7 +541,7 @@ each entry in the images it processes. The option to enable this is -u and it
|
|
|
534
541
|
causes binman to make sure that the 'offset', 'image-pos' and 'size' properties
|
|
535
542
|
are set correctly for every entry. Since it is not necessary to specify these in
|
|
536
543
|
the image definition, binman calculates the final values and writes these to
|
|
537
|
-
the
|
|
544
|
+
the devicetree. These can be used by U-Boot at run-time to find the location
|
|
538
545
|
of each entry.
|
|
539
546
|
|
|
540
547
|
Alternatively, an FDT map entry can be used to add a special FDT containing
|
|
@@ -567,8 +574,8 @@ Passing command-line arguments to entries
|
|
|
567
574
|
-----------------------------------------
|
|
568
575
|
|
|
569
576
|
Sometimes it is useful to pass binman the value of an entry property from the
|
|
570
|
-
command line. For example some entries need access to files and it is not
|
|
571
|
-
always convenient to put these filenames in the image definition (
|
|
577
|
+
command line. For example, some entries need access to files, and it is not
|
|
578
|
+
always convenient to put these filenames in the image definition (devicetree).
|
|
572
579
|
|
|
573
580
|
The -a option supports this::
|
|
574
581
|
|
|
@@ -605,7 +612,7 @@ This requests binman to create an image file called u-boot-sunxi-with-spl.bin
|
|
|
605
612
|
consisting of a specially formatted SPL (spl/sunxi-spl.bin, built by the
|
|
606
613
|
normal U-Boot Makefile), some 0xff padding, and a U-Boot legacy image. The
|
|
607
614
|
padding comes from the fact that the second binary is placed at
|
|
608
|
-
CONFIG_SPL_PAD_TO. If that line were omitted then the U-Boot binary would
|
|
615
|
+
CONFIG_SPL_PAD_TO. If that line were omitted, then the U-Boot binary would
|
|
609
616
|
immediately follow the SPL binary.
|
|
610
617
|
|
|
611
618
|
The binman node describes an image. The sub-nodes describe entries in the
|
|
@@ -617,7 +624,7 @@ Entries are normally placed into the image sequentially, one after the other.
|
|
|
617
624
|
The image size is the total size of all entries. As you can see, you can
|
|
618
625
|
specify the start offset of an entry using the 'offset' property.
|
|
619
626
|
|
|
620
|
-
Note that due to a
|
|
627
|
+
Note that due to a devicetree requirement, all entries must have a unique
|
|
621
628
|
name. If you want to put the same binary in the image multiple times, you can
|
|
622
629
|
use any unique name, with the 'type' property providing the type.
|
|
623
630
|
|
|
@@ -633,7 +640,7 @@ offset:
|
|
|
633
640
|
align:
|
|
634
641
|
This sets the alignment of the entry. The entry offset is adjusted
|
|
635
642
|
so that the entry starts on an aligned boundary within the containing
|
|
636
|
-
section or image. For example 'align = <16>' means that the entry will
|
|
643
|
+
section or image. For example, 'align = <16>' means that the entry will
|
|
637
644
|
start on a 16-byte boundary. This may mean that padding is added before
|
|
638
645
|
the entry. The padding is part of the containing section but is not
|
|
639
646
|
included in the entry, meaning that an empty space may be created before
|
|
@@ -650,7 +657,7 @@ min-size:
|
|
|
650
657
|
('pad-before' and 'pad-after'), but not padding added to meet alignment
|
|
651
658
|
requirements. While this does not affect the contents of the entry within
|
|
652
659
|
binman itself (the padding is performed only when its parent section is
|
|
653
|
-
assembled), the
|
|
660
|
+
assembled), the result will be that the entry ends with the padding
|
|
654
661
|
bytes, so may grow. Defaults to 0.
|
|
655
662
|
|
|
656
663
|
pad-before:
|
|
@@ -658,8 +665,8 @@ pad-before:
|
|
|
658
665
|
that the contents start at the beginning of the entry. This can be used
|
|
659
666
|
to offset the entry contents a little. While this does not affect the
|
|
660
667
|
contents of the entry within binman itself (the padding is performed
|
|
661
|
-
only when its parent section is assembled), the
|
|
662
|
-
the entry starts with the padding bytes, so may grow. Defaults to 0.
|
|
668
|
+
only when its parent section is assembled), the result will be that
|
|
669
|
+
the entry starts with the padding bytes, so it may grow. Defaults to 0.
|
|
663
670
|
|
|
664
671
|
pad-after:
|
|
665
672
|
Padding after the contents of the entry. Normally this is 0, meaning
|
|
@@ -667,7 +674,7 @@ pad-after:
|
|
|
667
674
|
other properties). This allows room to be created in the image for
|
|
668
675
|
this entry to expand later. While this does not affect the contents of
|
|
669
676
|
the entry within binman itself (the padding is performed only when its
|
|
670
|
-
parent section is assembled), the
|
|
677
|
+
parent section is assembled), the result will be that the entry ends
|
|
671
678
|
with the padding bytes, so may grow. Defaults to 0.
|
|
672
679
|
|
|
673
680
|
align-size:
|
|
@@ -675,7 +682,7 @@ align-size:
|
|
|
675
682
|
that the size of an entry is a multiple of 64 bytes, set this to 64.
|
|
676
683
|
While this does not affect the contents of the entry within binman
|
|
677
684
|
itself (the padding is performed only when its parent section is
|
|
678
|
-
assembled), the
|
|
685
|
+
assembled), the result is that the entry ends with the padding
|
|
679
686
|
bytes, so may grow. If 'align-size' is not provided, no alignment is
|
|
680
687
|
performed.
|
|
681
688
|
|
|
@@ -686,7 +693,7 @@ align-end:
|
|
|
686
693
|
of the entry, so the contents of the entry will still start at the
|
|
687
694
|
beginning. But there may be padding at the end. While this does not
|
|
688
695
|
affect the contents of the entry within binman itself (the padding is
|
|
689
|
-
performed only when its parent section is assembled), the
|
|
696
|
+
performed only when its parent section is assembled), the result
|
|
690
697
|
is that the entry ends with the padding bytes, so may grow.
|
|
691
698
|
If 'align-end' is not provided, no alignment is performed.
|
|
692
699
|
|
|
@@ -719,7 +726,7 @@ extend-size:
|
|
|
719
726
|
entry.
|
|
720
727
|
|
|
721
728
|
compress:
|
|
722
|
-
Sets the compression
|
|
729
|
+
Sets the compression algorithm to use (for blobs only). See the entry
|
|
723
730
|
documentation for details.
|
|
724
731
|
|
|
725
732
|
missing-msg:
|
|
@@ -728,38 +735,56 @@ missing-msg:
|
|
|
728
735
|
information about what needs to be fixed. See missing-blob-help for the
|
|
729
736
|
message for each tag.
|
|
730
737
|
|
|
738
|
+
assume-size:
|
|
739
|
+
Sets the assumed size of a blob entry if it is missing. This allows for a
|
|
740
|
+
check that the rest of the image fits into the available space, even when
|
|
741
|
+
the contents are not available. If the entry is missing, Binman will use
|
|
742
|
+
this assumed size for the entry size, including creating a fake file of that
|
|
743
|
+
size if requested.
|
|
744
|
+
|
|
731
745
|
no-expanded:
|
|
732
|
-
By default binman substitutes entries with expanded versions if available,
|
|
746
|
+
By default, binman substitutes entries with expanded versions if available,
|
|
733
747
|
so that a `u-boot` entry type turns into `u-boot-expanded`, for example. The
|
|
734
748
|
`--no-expanded` command-line option disables this globally. The
|
|
735
749
|
`no-expanded` property disables this just for a single entry. Put the
|
|
736
|
-
`no-expanded` boolean property in the node to select this
|
|
750
|
+
`no-expanded` boolean property in the node to select this behavior.
|
|
737
751
|
|
|
738
752
|
optional:
|
|
739
753
|
External blobs are normally required to be present for the image to be
|
|
740
754
|
built (but see `External blobs`_). This properly allows an entry to be
|
|
741
|
-
optional, so that when it
|
|
755
|
+
optional, so that when it cannot be found, this problem is ignored and
|
|
742
756
|
an empty file is used for this blob. This should be used only when the blob
|
|
743
757
|
is entirely optional and is not needed for correct operation of the image.
|
|
744
758
|
Note that missing, optional blobs do not produce a non-zero exit code from
|
|
745
759
|
binman, although it does show a warning about the missing external blob.
|
|
746
760
|
|
|
747
761
|
insert-template:
|
|
748
|
-
This is not
|
|
762
|
+
This is not an entry property, since it is processed early
|
|
749
763
|
in Binman before the entries are read. It is a list of phandles of nodes to
|
|
750
764
|
include in the current (target) node. For each node, its subnodes and their
|
|
751
765
|
properties are brought into the target node. See Templates_ below for
|
|
752
766
|
more information.
|
|
753
767
|
|
|
768
|
+
symbols-base:
|
|
769
|
+
When writing symbols into a binary, the value of that symbol is assumed to
|
|
770
|
+
be relative to the base address of the binary. This allow the binary to be
|
|
771
|
+
loaded in memory at its base address, so that symbols point into the binary
|
|
772
|
+
correctly. In some cases, the binary is in fact not yet in memory, but must
|
|
773
|
+
be read from storage. In this case there is no base address for the symbols.
|
|
774
|
+
This property can be set to 0 to indicate this. Other values for
|
|
775
|
+
symbols-base are allowed, but care must be taken that the code which uses
|
|
776
|
+
the symbol is aware of the base being used. If omitted, the binary's base
|
|
777
|
+
address is used.
|
|
778
|
+
|
|
754
779
|
The attributes supported for images and sections are described below. Several
|
|
755
|
-
are
|
|
780
|
+
of them are like the attributes for entries.
|
|
756
781
|
|
|
757
782
|
size:
|
|
758
783
|
Sets the image size in bytes, for example 'size = <0x100000>' for a
|
|
759
784
|
1MB image.
|
|
760
785
|
|
|
761
786
|
offset:
|
|
762
|
-
This is
|
|
787
|
+
This is like 'offset' in entries, setting the offset of a section
|
|
763
788
|
within the image or section containing it. The first byte of the section
|
|
764
789
|
is normally at offset 0. If 'offset' is not provided, binman sets it to
|
|
765
790
|
the end of the previous region, or the start of the image's entry area
|
|
@@ -792,7 +817,7 @@ sort-by-offset:
|
|
|
792
817
|
the 'offset' properties are set by CONFIG options, so their ordering is
|
|
793
818
|
not known a priori.
|
|
794
819
|
|
|
795
|
-
This is a boolean property so needs no value. To enable it, add a
|
|
820
|
+
This is a boolean property, so it needs no value. To enable it, add a
|
|
796
821
|
line 'sort-by-offset;' to your description.
|
|
797
822
|
|
|
798
823
|
multiple-images:
|
|
@@ -816,26 +841,8 @@ multiple-images:
|
|
|
816
841
|
};
|
|
817
842
|
};
|
|
818
843
|
|
|
819
|
-
end-at-4gb:
|
|
820
|
-
For x86 machines the ROM offsets start just before 4GB and extend
|
|
821
|
-
up so that the image finished at the 4GB boundary. This boolean
|
|
822
|
-
option can be enabled to support this. The image size must be
|
|
823
|
-
provided so that binman knows when the image should start. For an
|
|
824
|
-
8MB ROM, the offset of the first entry would be 0xfff80000 with
|
|
825
|
-
this option, instead of 0 without this option.
|
|
826
|
-
|
|
827
|
-
skip-at-start:
|
|
828
|
-
This property specifies the entry offset of the first entry.
|
|
829
|
-
|
|
830
|
-
For PowerPC mpc85xx based CPU, CONFIG_TEXT_BASE is the entry
|
|
831
|
-
offset of the first entry. It can be 0xeff40000 or 0xfff40000 for
|
|
832
|
-
nor flash boot, 0x201000 for sd boot etc.
|
|
833
|
-
|
|
834
|
-
'end-at-4gb' property is not applicable where CONFIG_TEXT_BASE +
|
|
835
|
-
Image size != 4gb.
|
|
836
|
-
|
|
837
844
|
align-default:
|
|
838
|
-
Specifies the default alignment for entries in this section
|
|
845
|
+
Specifies the default alignment for entries in this section if they do
|
|
839
846
|
not specify an alignment. Note that this only applies to top-level entries
|
|
840
847
|
in the section (direct subentries), not any subentries of those entries.
|
|
841
848
|
This means that each section must specify its own default alignment, if
|
|
@@ -876,7 +883,7 @@ elf-base-sym:
|
|
|
876
883
|
be read correctly. See binman_syms_ for more information.
|
|
877
884
|
|
|
878
885
|
offset-from-elf:
|
|
879
|
-
Sets the offset of an entry based on a symbol value in
|
|
886
|
+
Sets the offset of an entry based on a symbol value in another entry.
|
|
880
887
|
The format is <&phandle>, "sym_name", <offset> where phandle is the entry
|
|
881
888
|
containing the blob (with associated ELF file providing symbols), <sym_name>
|
|
882
889
|
is the symbol to lookup (relative to elf-base-sym) and <offset> is an offset
|
|
@@ -887,7 +894,7 @@ preserve:
|
|
|
887
894
|
flag should be checked by the updater when it is deciding which entries to
|
|
888
895
|
update. This flag is normally attached to sections but can be attached to
|
|
889
896
|
a single entry in a section if the updater supports it. Not that binman
|
|
890
|
-
itself has no control over the updater's
|
|
897
|
+
itself has no control over the updater's behavior, so this is just a
|
|
891
898
|
signal. It is not enforced by binman.
|
|
892
899
|
|
|
893
900
|
Examples of the above options can be found in the tests. See the
|
|
@@ -898,16 +905,16 @@ either by using a unit number suffix (u-boot@0, u-boot@1) or by using a
|
|
|
898
905
|
different name for each and specifying the type with the 'type' attribute.
|
|
899
906
|
|
|
900
907
|
|
|
901
|
-
Sections and
|
|
902
|
-
|
|
908
|
+
Sections and hierarchical images
|
|
909
|
+
--------------------------------
|
|
903
910
|
|
|
904
911
|
Sometimes it is convenient to split an image into several pieces, each of which
|
|
905
912
|
contains its own set of binaries. An example is a flash device where part of
|
|
906
|
-
the image is read-only and part is read-write. We can set up sections for each
|
|
913
|
+
the image is read-only, and part is read-write. We can set up sections for each
|
|
907
914
|
of these, and place binaries in them independently. The image is still produced
|
|
908
915
|
as a single output file.
|
|
909
916
|
|
|
910
|
-
This feature provides a way of creating hierarchical images. For example here
|
|
917
|
+
This feature provides a way of creating hierarchical images. For example, here
|
|
911
918
|
is an example image with two copies of U-Boot. One is read-only (ro), intended
|
|
912
919
|
to be written only in the factory. Another is read-write (rw), so that it can be
|
|
913
920
|
upgraded in the field. The sizes are fixed so that the ro/rw boundary is known
|
|
@@ -940,7 +947,7 @@ read-only:
|
|
|
940
947
|
|
|
941
948
|
name-prefix:
|
|
942
949
|
This string is prepended to all the names of the binaries in the
|
|
943
|
-
section. In the example above, the 'u-boot' binaries
|
|
950
|
+
section. In the example above, the 'u-boot' binaries will be
|
|
944
951
|
renamed to 'ro-u-boot' and 'rw-u-boot'. This can be useful to
|
|
945
952
|
distinguish binaries with otherwise identical names.
|
|
946
953
|
|
|
@@ -948,7 +955,36 @@ filename:
|
|
|
948
955
|
This allows the contents of the section to be written to a file in the
|
|
949
956
|
output directory. This can sometimes be useful to use the data in one
|
|
950
957
|
section in different image, since there is currently no way to share data
|
|
951
|
-
|
|
958
|
+
between images other than through files.
|
|
959
|
+
|
|
960
|
+
end-at-4gb:
|
|
961
|
+
For x86 machines the ROM offsets start just before 4GB and extend
|
|
962
|
+
up so that the image finished at the 4GB boundary. This boolean
|
|
963
|
+
option can be enabled to support this. The image size must be
|
|
964
|
+
provided so that binman knows when the image should start. For an
|
|
965
|
+
8MB ROM, the offset of the first entry would be 0xfff80000 with
|
|
966
|
+
this option, instead of 0 without this option.
|
|
967
|
+
|
|
968
|
+
skip-at-start:
|
|
969
|
+
This property specifies the entry offset of the first entry in the section.
|
|
970
|
+
It is useful when the Binman image is written to a particular offset in the
|
|
971
|
+
media. It allows the offset of the first entry to be the media offset, even
|
|
972
|
+
though it is at the start of the image. It effectively creates a hole at the
|
|
973
|
+
start of the image, an implied, empty area.
|
|
974
|
+
|
|
975
|
+
For example, if the image is written to offset 4K on the media, set
|
|
976
|
+
skip-at-start to 0x1000. At runtime, the Binman image will assume that it
|
|
977
|
+
has be written at offset 4K and all symbols and offsets will take account of
|
|
978
|
+
that. The image-pos values will also be adjusted. The effect is similar to
|
|
979
|
+
adding an empty 4K region at the start, except that Binman does not actually
|
|
980
|
+
output it.
|
|
981
|
+
|
|
982
|
+
For PowerPC mpc85xx based CPU, CONFIG_TEXT_BASE is the entry
|
|
983
|
+
offset of the first entry. It can be 0xeff40000 or 0xfff40000 for
|
|
984
|
+
nor flash boot, 0x201000 for sd boot etc.
|
|
985
|
+
|
|
986
|
+
'end-at-4gb' property is not applicable where CONFIG_TEXT_BASE +
|
|
987
|
+
Image size != 4gb.
|
|
952
988
|
|
|
953
989
|
Image Properties
|
|
954
990
|
----------------
|
|
@@ -963,11 +999,11 @@ filename:
|
|
|
963
999
|
allow-repack:
|
|
964
1000
|
Create an image that can be repacked. With this option it is possible
|
|
965
1001
|
to change anything in the image after it is created, including updating
|
|
966
|
-
the position and size of image components. By default this is not
|
|
967
|
-
permitted since it is not
|
|
968
|
-
constraint in the image description. For example, if a section
|
|
1002
|
+
the position and size of image components. By default, this is not
|
|
1003
|
+
permitted since it is not possible to know whether this might violate a
|
|
1004
|
+
constraint in the image description. For example, if a section must
|
|
969
1005
|
increase in size to hold a larger binary, that might cause the section
|
|
970
|
-
to
|
|
1006
|
+
to exceed its allow-region (e.g. the read-only portion of flash).
|
|
971
1007
|
|
|
972
1008
|
Adding this property causes the original offset and size values in the
|
|
973
1009
|
image description to be stored in the FDT and fdtmap.
|
|
@@ -978,7 +1014,7 @@ Image dependencies
|
|
|
978
1014
|
|
|
979
1015
|
Binman does not currently support images that depend on each other. For example,
|
|
980
1016
|
if one image creates `fred.bin` and then the next uses this `fred.bin` to
|
|
981
|
-
produce a final `image.bin`, then the
|
|
1017
|
+
produce a final `image.bin`, then the behavior is undefined. It may work, or it
|
|
982
1018
|
may produce an error about `fred.bin` being missing, or it may use a version of
|
|
983
1019
|
`fred.bin` from a previous run.
|
|
984
1020
|
|
|
@@ -1026,7 +1062,7 @@ Hashing Entries
|
|
|
1026
1062
|
---------------
|
|
1027
1063
|
|
|
1028
1064
|
It is possible to ask binman to hash the contents of an entry and write that
|
|
1029
|
-
value back to the
|
|
1065
|
+
value back to the devicetree node. For example::
|
|
1030
1066
|
|
|
1031
1067
|
binman {
|
|
1032
1068
|
u-boot {
|
|
@@ -1038,10 +1074,10 @@ value back to the device-tree node. For example::
|
|
|
1038
1074
|
|
|
1039
1075
|
Here, a new 'value' property will be written to the 'hash' node containing
|
|
1040
1076
|
the hash of the 'u-boot' entry. Only SHA256 is supported at present. Whole
|
|
1041
|
-
sections can be
|
|
1077
|
+
sections can be hashed if desired, by adding the 'hash' node to the section.
|
|
1042
1078
|
|
|
1043
|
-
The
|
|
1044
|
-
comparing this
|
|
1079
|
+
The hash value can be checked at runtime by hashing the data read and
|
|
1080
|
+
comparing this hash to the value in the devicetree.
|
|
1045
1081
|
|
|
1046
1082
|
|
|
1047
1083
|
Expanded entries
|
|
@@ -1071,8 +1107,8 @@ which in turn expands to::
|
|
|
1071
1107
|
};
|
|
1072
1108
|
};
|
|
1073
1109
|
|
|
1074
|
-
U-Boot's
|
|
1075
|
-
|
|
1110
|
+
U-Boot's phase binaries comprise two or three pieces. For example, u-boot.bin
|
|
1111
|
+
has the executable followed by a devicetree.
|
|
1076
1112
|
|
|
1077
1113
|
With binman we want to be able to update that devicetree with full image
|
|
1078
1114
|
information so that it is accessible to the executable. This is tricky
|
|
@@ -1110,9 +1146,9 @@ which in turn expands to::
|
|
|
1110
1146
|
};
|
|
1111
1147
|
};
|
|
1112
1148
|
|
|
1113
|
-
Of course we should not expand SPL if it has no devicetree. Also if the BSS
|
|
1149
|
+
Of course, we should not expand SPL if it has no devicetree. Also, if the BSS
|
|
1114
1150
|
padding is not needed (because BSS is in RAM as with CONFIG_SPL_SEPARATE_BSS),
|
|
1115
|
-
the 'u-boot-spl-bss-pad' subnode should not be created. The use of the
|
|
1151
|
+
the 'u-boot-spl-bss-pad' subnode should not be created. The use of the expanded
|
|
1116
1152
|
entry type is controlled by the UseExpanded() method. In the SPL case it checks
|
|
1117
1153
|
the 'spl-dtb' entry arg, which is 'y' or '1' if SPL has a devicetree.
|
|
1118
1154
|
|
|
@@ -1221,7 +1257,7 @@ Templates provide a simple way to handle this::
|
|
|
1221
1257
|
|
|
1222
1258
|
spi-image {
|
|
1223
1259
|
filename = "image-spi.bin";
|
|
1224
|
-
insert-template = <&
|
|
1260
|
+
insert-template = <&common_part>;
|
|
1225
1261
|
|
|
1226
1262
|
/* things specific to SPI follow */
|
|
1227
1263
|
footer {
|
|
@@ -1234,7 +1270,7 @@ Templates provide a simple way to handle this::
|
|
|
1234
1270
|
|
|
1235
1271
|
mmc-image {
|
|
1236
1272
|
filename = "image-mmc.bin";
|
|
1237
|
-
insert-template = <&
|
|
1273
|
+
insert-template = <&common_part>;
|
|
1238
1274
|
|
|
1239
1275
|
/* things specific to MMC follow */
|
|
1240
1276
|
footer {
|
|
@@ -1740,7 +1776,7 @@ Options:
|
|
|
1740
1776
|
Options used only for testing:
|
|
1741
1777
|
|
|
1742
1778
|
--fake-dtb
|
|
1743
|
-
Use fake
|
|
1779
|
+
Use fake devicetree contents
|
|
1744
1780
|
|
|
1745
1781
|
--fake-ext-blobs
|
|
1746
1782
|
Create fake ext blobs with dummy content
|
|
@@ -1780,7 +1816,7 @@ Positional arguments:
|
|
|
1780
1816
|
paths
|
|
1781
1817
|
Paths within file to list (wildcard)
|
|
1782
1818
|
|
|
1783
|
-
|
|
1819
|
+
Options:
|
|
1784
1820
|
|
|
1785
1821
|
-h, --help
|
|
1786
1822
|
show help message and exit
|
|
@@ -1890,7 +1926,7 @@ Options:
|
|
|
1890
1926
|
|
|
1891
1927
|
-P PROCESSES, --processes PROCESSES
|
|
1892
1928
|
set number of processes to use for running tests. This defaults to the
|
|
1893
|
-
|
|
1929
|
+
numbering the CPUs on the machine
|
|
1894
1930
|
|
|
1895
1931
|
-T, --test-coverage
|
|
1896
1932
|
run tests and check for 100% coverage
|
|
@@ -1965,13 +2001,13 @@ Image creation proceeds in the following order, for each entry in the image.
|
|
|
1965
2001
|
1. AddMissingProperties() - binman can add calculated values to the device
|
|
1966
2002
|
tree as part of its processing, for example the offset and size of each
|
|
1967
2003
|
entry. This method adds any properties associated with this, expanding the
|
|
1968
|
-
|
|
1969
|
-
set later by SetCalculatedProperties(). By that stage the size of sections
|
|
2004
|
+
devicetree as needed. These properties can have placeholder values which are
|
|
2005
|
+
set later by SetCalculatedProperties(). By that stage, the size of sections
|
|
1970
2006
|
cannot be changed (since it would cause the images to need to be repacked),
|
|
1971
2007
|
but the correct values can be inserted.
|
|
1972
2008
|
|
|
1973
|
-
2. ProcessFdt() - process the
|
|
1974
|
-
|
|
2009
|
+
2. ProcessFdt() - process the devicetree information as required by the
|
|
2010
|
+
entry. This may involve adding or deleting properties. If the
|
|
1975
2011
|
processing is complete, this method should return True. If the processing
|
|
1976
2012
|
cannot complete because it needs the ProcessFdt() method of another entry to
|
|
1977
2013
|
run first, this method should return False, in which case it will be called
|
|
@@ -1980,7 +2016,7 @@ again later.
|
|
|
1980
2016
|
3. GetEntryContents() - the contents of each entry are obtained, normally by
|
|
1981
2017
|
reading from a file. This calls the Entry.ObtainContents() to read the
|
|
1982
2018
|
contents. The default version of Entry.ObtainContents() calls
|
|
1983
|
-
Entry.GetDefaultFilename() and then reads that file.
|
|
2019
|
+
Entry.GetDefaultFilename() and then reads that file. Thus, a common mechanism
|
|
1984
2020
|
to select a file to read is to override that function in the subclass. The
|
|
1985
2021
|
functions must return True when they have read the contents. Binman will
|
|
1986
2022
|
retry calling the functions a few times if False is returned, allowing
|
|
@@ -2030,7 +2066,7 @@ what happens in this stage.
|
|
|
2030
2066
|
11. BuildImage() - builds the image and writes it to a file
|
|
2031
2067
|
|
|
2032
2068
|
12. WriteMap() - writes a text file containing a map of the image. This is the
|
|
2033
|
-
|
|
2069
|
+
last step.
|
|
2034
2070
|
|
|
2035
2071
|
|
|
2036
2072
|
.. _`External tools`:
|
|
@@ -2040,14 +2076,14 @@ External tools
|
|
|
2040
2076
|
|
|
2041
2077
|
Binman can make use of external command-line tools to handle processing of
|
|
2042
2078
|
entry contents or to generate entry contents. These tools are executed using
|
|
2043
|
-
the 'tools' module's Run() method. The tools
|
|
2079
|
+
the 'tools' module's Run() method. The tools must exist on the PATH,
|
|
2044
2080
|
but the --toolpath option can be used to specify additional search paths to
|
|
2045
2081
|
use. This option can be specified multiple times to add more than one path.
|
|
2046
2082
|
|
|
2047
|
-
For some compile tools binman will use the versions specified by commonly
|
|
2083
|
+
For some compile tools binman will use the versions specified by commonly used
|
|
2048
2084
|
environment variables like CC and HOSTCC for the C compiler, based on whether
|
|
2049
2085
|
the tool's output will be used for the target or for the host machine. If those
|
|
2050
|
-
|
|
2086
|
+
are not given, it will also try to derive target-specific versions from the
|
|
2051
2087
|
CROSS_COMPILE environment variable during a cross-compilation.
|
|
2052
2088
|
|
|
2053
2089
|
If the tool is not available in the path you can use BINMAN_TOOLPATHS to specify
|
|
@@ -2068,14 +2104,14 @@ to build the final image, no matter what steps are needed to get there.
|
|
|
2068
2104
|
|
|
2069
2105
|
Binman also provides a `blob-ext` entry type that pulls in a binary blob from an
|
|
2070
2106
|
external file. If the file is missing, binman can optionally complete the build
|
|
2071
|
-
and just report a warning. Use the `-M/--allow-missing` option to
|
|
2107
|
+
and just report a warning. Use the `-M/--allow-missing` option to enable this.
|
|
2072
2108
|
This is useful in CI systems which want to check that everything is correct but
|
|
2073
2109
|
don't have access to the blobs.
|
|
2074
2110
|
|
|
2075
2111
|
If the blobs are in a different directory, you can specify this with the `-I`
|
|
2076
2112
|
option.
|
|
2077
2113
|
|
|
2078
|
-
For U-Boot, you can
|
|
2114
|
+
For U-Boot, you can set the BINMAN_INDIRS environment variable to provide a
|
|
2079
2115
|
space-separated list of directories to search for binary blobs::
|
|
2080
2116
|
|
|
2081
2117
|
BINMAN_INDIRS="odroid-c4/fip/g12a \
|
|
@@ -2090,12 +2126,15 @@ Code coverage
|
|
|
2090
2126
|
-------------
|
|
2091
2127
|
|
|
2092
2128
|
Binman is a critical tool and is designed to be very testable. Entry
|
|
2093
|
-
implementations target 100% test coverage. Run
|
|
2129
|
+
implementations target 100% test coverage. Run ``binman test -T`` to check this.
|
|
2094
2130
|
|
|
2095
2131
|
To enable Python test coverage on Debian-type distributions (e.g. Ubuntu)::
|
|
2096
2132
|
|
|
2097
2133
|
$ sudo apt-get install python-coverage python3-coverage python-pytest
|
|
2098
2134
|
|
|
2135
|
+
You can also check the coverage provided by a single test, e.g.::
|
|
2136
|
+
|
|
2137
|
+
binman test -T testSimple
|
|
2099
2138
|
|
|
2100
2139
|
Exit status
|
|
2101
2140
|
-----------
|
|
@@ -2160,7 +2199,7 @@ symbol tells binman the size of the BSS region, in bytes. It needs this to be
|
|
|
2160
2199
|
able to pad the image so that the following entries do not overlap the BSS,
|
|
2161
2200
|
which would cause them to be overwritte by variable access in SPL.
|
|
2162
2201
|
|
|
2163
|
-
|
|
2202
|
+
These symbols are normally defined in the linker script, immediately after
|
|
2164
2203
|
_bss_start and __bss_end are defined, like this::
|
|
2165
2204
|
|
|
2166
2205
|
__bss_size = __bss_end - __bss_start;
|
|
@@ -2174,7 +2213,7 @@ Concurrent tests
|
|
|
2174
2213
|
Binman tries to run tests concurrently. This means that the tests make use of
|
|
2175
2214
|
all available CPUs to run.
|
|
2176
2215
|
|
|
2177
|
-
|
|
2216
|
+
Enable this::
|
|
2178
2217
|
|
|
2179
2218
|
$ sudo apt-get install python-subunit python3-subunit
|
|
2180
2219
|
|
|
@@ -2182,10 +2221,15 @@ Use '-P 1' to disable this. It is automatically disabled when code coverage is
|
|
|
2182
2221
|
being used (-T) since they are incompatible.
|
|
2183
2222
|
|
|
2184
2223
|
|
|
2224
|
+
Writing tests
|
|
2225
|
+
-------------
|
|
2226
|
+
|
|
2227
|
+
See .
|
|
2228
|
+
|
|
2185
2229
|
Debugging tests
|
|
2186
2230
|
---------------
|
|
2187
2231
|
|
|
2188
|
-
Sometimes when debugging tests it is useful to keep the input and output
|
|
2232
|
+
Sometimes when debugging tests, it is useful to keep the input and output
|
|
2189
2233
|
directories so they can be examined later. Use -X or --test-preserve-dirs for
|
|
2190
2234
|
this.
|
|
2191
2235
|
|
|
@@ -2232,7 +2276,7 @@ entry contents.
|
|
|
2232
2276
|
Most of the time such essoteric behaviour is not needed, but it can be
|
|
2233
2277
|
essential for complex images.
|
|
2234
2278
|
|
|
2235
|
-
If you need to specify a particular
|
|
2279
|
+
If you need to specify a particular devicetree compiler to use, you can define
|
|
2236
2280
|
the DTC environment variable. This can be useful when the system dtc is too
|
|
2237
2281
|
old.
|
|
2238
2282
|
|
|
@@ -2346,10 +2390,10 @@ blob can come from any suitable place, such as an `Entry_u_boot` or an
|
|
|
2346
2390
|
|
|
2347
2391
|
The `soc-fw` node is a `blob-ext` (i.e. it reads in a named binary file) whereas
|
|
2348
2392
|
`u-boot` is a normal entry type. This works because `Entry_fip` selects the
|
|
2349
|
-
`blob-ext` entry type if the node name (here `soc-fw`) is
|
|
2393
|
+
`blob-ext` entry type if the node name (here `soc-fw`) is recognized as being
|
|
2350
2394
|
a known blob type.
|
|
2351
2395
|
|
|
2352
|
-
When adding new entry types you are encouraged to use subnodes to provide the
|
|
2396
|
+
When adding new entry types, you are encouraged to use subnodes to provide the
|
|
2353
2397
|
data for processing, unless the `content` approach is more suitable. Consider
|
|
2354
2398
|
whether the input entries are contained within (or consumed by) the entry, vs
|
|
2355
2399
|
just being 'referenced' by the entry. In the latter case, the `content` approach
|
|
@@ -2361,8 +2405,8 @@ History / Credits
|
|
|
2361
2405
|
|
|
2362
2406
|
Binman takes a lot of inspiration from a Chrome OS tool called
|
|
2363
2407
|
'cros_bundle_firmware', which I wrote some years ago. That tool was based on
|
|
2364
|
-
a
|
|
2365
|
-
years. In particular its handling of x86 images is convoluted.
|
|
2408
|
+
a simple and sound design but has expanded over the
|
|
2409
|
+
years. In particular, its handling of x86 images is convoluted.
|
|
2366
2410
|
|
|
2367
2411
|
Quite a few lessons have been learned which are hopefully applied here.
|
|
2368
2412
|
|
|
@@ -2370,11 +2414,11 @@ Quite a few lessons have been learned which are hopefully applied here.
|
|
|
2370
2414
|
Design notes
|
|
2371
2415
|
------------
|
|
2372
2416
|
|
|
2373
|
-
On the face of it, a tool to create firmware images should be
|
|
2417
|
+
On the face of it, a tool to create firmware images should be simple:
|
|
2374
2418
|
just find all the input binaries and place them at the right place in the
|
|
2375
2419
|
image. The difficulty comes from the wide variety of input types (simple
|
|
2376
2420
|
flat binaries containing code, packaged data with various headers), packing
|
|
2377
|
-
|
|
2421
|
+
requirements (alignment, spacing, device boundaries) and other required
|
|
2378
2422
|
features such as hierarchical images.
|
|
2379
2423
|
|
|
2380
2424
|
The design challenge is to make it easy to create simple images, while
|
|
@@ -2392,7 +2436,7 @@ To do
|
|
|
2392
2436
|
Some ideas:
|
|
2393
2437
|
|
|
2394
2438
|
- Use of-platdata to make the information available to code that is unable
|
|
2395
|
-
to use
|
|
2439
|
+
to use devicetree (such as a small SPL image). For now, limited info is
|
|
2396
2440
|
available via linker symbols
|
|
2397
2441
|
- Allow easy building of images by specifying just the board name
|
|
2398
2442
|
- Support building an image for a board (-b) more completely, with a
|