blob: 782bff1f8d983e77fe270ad8354cf5c7d1a0de01 [file] [log] [blame]
Simon Glass7a61c6b2018-07-17 13:25:37 -06001Binman Entry Documentation
2===========================
3
4This file describes the entry types supported by binman. These entry types can
5be placed in an image one by one to build up a final firmware image. It is
6fairly easy to create new entry types. Just add a new file to the 'etype'
7directory. You can use the existing entries as examples.
8
9Note that some entries are subclasses of others, using and extending their
10features to produce new behaviours.
11
12
13
Simon Glassa7c97782022-08-07 16:33:25 -060014.. _etype_atf_bl31:
15
Simon Glass8911fa12021-03-18 20:25:16 +130016Entry: atf-bl31: ARM Trusted Firmware (ATF) BL31 blob
17-----------------------------------------------------
Simon Glass559c4de2020-09-01 05:13:58 -060018
19Properties / Entry arguments:
20 - atf-bl31-path: Filename of file to read into entry. This is typically
21 called bl31.bin or bl31.elf
22
23This entry holds the run-time firmware, typically started by U-Boot SPL.
24See the U-Boot README for your architecture or board for how to use it. See
25https://github.com/ARM-software/arm-trusted-firmware for more information
26about ATF.
27
28
29
Simon Glassa7c97782022-08-07 16:33:25 -060030.. _etype_atf_fip:
31
Simon Glass3efb2972021-11-23 21:08:59 -070032Entry: atf-fip: ARM Trusted Firmware's Firmware Image Package (FIP)
33-------------------------------------------------------------------
34
35A FIP_ provides a way to group binaries in a firmware image, used by ARM's
36Trusted Firmware A (TF-A) code. It is a simple format consisting of a
37table of contents with information about the type, offset and size of the
38binaries in the FIP. It is quite similar to FMAP, with the major difference
39that it uses UUIDs to indicate the type of each entry.
40
41Note: It is recommended to always add an fdtmap to every image, as well as
42any FIPs so that binman and other tools can access the entire image
43correctly.
44
45The UUIDs correspond to useful names in `fiptool`, provided by ATF to
46operate on FIPs. Binman uses these names to make it easier to understand
47what is going on, although it is possible to provide a UUID if needed.
48
49The contents of the FIP are defined by subnodes of the atf-fip entry, e.g.::
50
51 atf-fip {
52 soc-fw {
53 filename = "bl31.bin";
54 };
55
56 scp-fwu-cfg {
57 filename = "bl2u.bin";
58 };
59
60 u-boot {
61 fip-type = "nt-fw";
62 };
63 };
64
65This describes a FIP with three entries: soc-fw, scp-fwu-cfg and nt-fw.
66You can use normal (non-external) binaries like U-Boot simply by adding a
67FIP type, with the `fip-type` property, as above.
68
69Since FIP exists to bring blobs together, Binman assumes that all FIP
70entries are external binaries. If a binary may not exist, you can use the
71`--allow-missing` flag to Binman, in which case the image is still created,
72even though it will not actually work.
73
74The size of the FIP depends on the size of the binaries. There is currently
75no way to specify a fixed size. If the `atf-fip` node has a `size` entry,
76this affects the space taken up by the `atf-fip` entry, but the FIP itself
77does not expand to use that space.
78
79Some other FIP features are available with Binman. The header and the
80entries have 64-bit flag works. The flag flags do not seem to be defined
81anywhere, but you can use `fip-hdr-flags` and fip-flags` to set the values
82of the header and entries respectively.
83
84FIP entries can be aligned to a particular power-of-two boundary. Use
85fip-align for this.
86
87Binman only understands the entry types that are included in its
88implementation. It is possible to specify a 16-byte UUID instead, using the
89fip-uuid property. In this case Binman doesn't know what its type is, so
90just uses the UUID. See the `u-boot` node in this example::
91
92 binman {
93 atf-fip {
94 fip-hdr-flags = /bits/ 64 <0x123>;
95 fip-align = <16>;
96 soc-fw {
97 fip-flags = /bits/ 64 <0x456>;
98 filename = "bl31.bin";
99 };
100
101 scp-fwu-cfg {
102 filename = "bl2u.bin";
103 };
104
105 u-boot {
106 fip-uuid = [fc 65 13 92 4a 5b 11 ec
107 94 35 ff 2d 1c fc 79 9c];
108 };
109 };
110 fdtmap {
111 };
112 };
113
114Binman allows reading and updating FIP entries after the image is created,
115provided that an FDPMAP is present too. Updates which change the size of a
116FIP entry will cause it to be expanded or contracted as needed.
117
118Properties for top-level atf-fip node
119~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120
121fip-hdr-flags (64 bits)
122 Sets the flags for the FIP header.
123
124Properties for subnodes
125~~~~~~~~~~~~~~~~~~~~~~~
126
127fip-type (str)
128 FIP type to use for this entry. This is needed if the entry
129 name is not a valid type. Value types are defined in `fip_util.py`.
130 The FIP type defines the UUID that is used (they map 1:1).
131
132fip-uuid (16 bytes)
133 If there is no FIP-type name defined, or it is not supported by Binman,
134 this property sets the UUID. It should be a 16-byte value, following the
135 hex digits of the UUID.
136
137fip-flags (64 bits)
138 Set the flags for a FIP entry. Use in one of the subnodes of the
139 7atf-fip entry.
140
141fip-align
142 Set the alignment for a FIP entry, FIP entries can be aligned to a
143 particular power-of-two boundary. The default is 1.
144
145Adding new FIP-entry types
146~~~~~~~~~~~~~~~~~~~~~~~~~~
147
148When new FIP entries are defined by TF-A they appear in the
149`TF-A source tree`_. You can use `fip_util.py` to update Binman to support
150new types, then `send a patch`_ to the U-Boot mailing list. There are two
151source files that the tool examples:
152
153- `include/tools_share/firmware_image_package.h` has the UUIDs
154- `tools/fiptool/tbbr_config.c` has the name and descripion for each UUID
155
156To run the tool::
157
158 $ tools/binman/fip_util.py -s /path/to/arm-trusted-firmware
159 Warning: UUID 'UUID_NON_TRUSTED_WORLD_KEY_CERT' is not mentioned in tbbr_config.c file
160 Existing code in 'tools/binman/fip_util.py' is up-to-date
161
162If it shows there is an update, it writes a new version of `fip_util.py`
163to `fip_util.py.out`. You can change the output file using the `-i` flag.
164If you have a problem, use `-D` to enable traceback debugging.
165
166FIP commentary
167~~~~~~~~~~~~~~
168
169As a side effect of use of UUIDs, FIP does not support multiple
170entries of the same type, such as might be used to store fonts or graphics
171icons, for example. For verified boot it could be used for each part of the
172image (e.g. separate FIPs for A and B) but cannot describe the whole
173firmware image. As with FMAP there is no hierarchy defined, although FMAP
174works around this by having 'section' areas which encompass others. A
175similar workaround would be possible with FIP but is not currently defined.
176
177It is recommended to always add an fdtmap to every image, as well as any
178FIPs so that binman and other tools can access the entire image correctly.
179
180.. _FIP: https://trustedfirmware-a.readthedocs.io/en/latest/design/firmware-design.html#firmware-image-package-fip
181.. _`TF-A source tree`: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
182.. _`send a patch`: https://www.denx.de/wiki/U-Boot/Patches
183
184
185
Simon Glassa7c97782022-08-07 16:33:25 -0600186.. _etype_blob:
187
Simon Glass8911fa12021-03-18 20:25:16 +1300188Entry: blob: Arbitrary binary blob
189----------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -0600190
191Note: This should not be used by itself. It is normally used as a parent
192class by other entry types.
193
194Properties / Entry arguments:
195 - filename: Filename of file to read into entry
Simon Glass7ba33592018-09-14 04:57:26 -0600196 - compress: Compression algorithm to use:
197 none: No compression
198 lz4: Use lz4 compression (via 'lz4' command-line utility)
Simon Glass7a61c6b2018-07-17 13:25:37 -0600199
200This entry reads data from a file and places it in the entry. The
201default filename is often specified specified by the subclass. See for
Simon Glass537e0062021-03-18 20:24:54 +1300202example the 'u-boot' entry which provides the filename 'u-boot.bin'.
Simon Glass7a61c6b2018-07-17 13:25:37 -0600203
Simon Glass7ba33592018-09-14 04:57:26 -0600204If compression is enabled, an extra 'uncomp-size' property is written to
205the node (if enabled with -u) which provides the uncompressed size of the
206data.
Simon Glass7a61c6b2018-07-17 13:25:37 -0600207
208
Simon Glass7a61c6b2018-07-17 13:25:37 -0600209
Simon Glassa7c97782022-08-07 16:33:25 -0600210.. _etype_blob_dtb:
211
Simon Glasse219aa42018-09-14 04:57:24 -0600212Entry: blob-dtb: A blob that holds a device tree
213------------------------------------------------
214
215This is a blob containing a device tree. The contents of the blob are
216obtained from the list of available device-tree files, managed by the
217'state' module.
218
219
220
Simon Glassa7c97782022-08-07 16:33:25 -0600221.. _etype_blob_ext:
222
Simon Glass8911fa12021-03-18 20:25:16 +1300223Entry: blob-ext: Externally built binary blob
224---------------------------------------------
Simon Glass5e560182020-07-09 18:39:36 -0600225
226Note: This should not be used by itself. It is normally used as a parent
227class by other entry types.
228
Simon Glass5d94cc62020-07-09 18:39:38 -0600229If the file providing this blob is missing, binman can optionally ignore it
230and produce a broken image with a warning.
231
Simon Glass5e560182020-07-09 18:39:36 -0600232See 'blob' for Properties / Entry arguments.
233
234
235
Simon Glassa7c97782022-08-07 16:33:25 -0600236.. _etype_blob_ext_list:
237
Simon Glass0b00ae62021-11-23 21:09:52 -0700238Entry: blob-ext-list: List of externally built binary blobs
239-----------------------------------------------------------
240
241This is like blob-ext except that a number of blobs can be provided,
242typically with some sort of relationship, e.g. all are DDC parameters.
243
244If any of the external files needed by this llist is missing, binman can
245optionally ignore it and produce a broken image with a warning.
246
247Args:
248 filenames: List of filenames to read and include
249
250
Simon Glassa7c97782022-08-07 16:33:25 -0600251
252.. _etype_blob_named_by_arg:
Simon Glass0b00ae62021-11-23 21:09:52 -0700253
Simon Glassdb168d42018-07-17 13:25:39 -0600254Entry: blob-named-by-arg: A blob entry which gets its filename property from its subclass
255-----------------------------------------------------------------------------------------
256
257Properties / Entry arguments:
258 - <xxx>-path: Filename containing the contents of this entry (optional,
Simon Glass21db0ff2020-09-01 05:13:54 -0600259 defaults to None)
Simon Glassdb168d42018-07-17 13:25:39 -0600260
261where <xxx> is the blob_fname argument to the constructor.
262
263This entry cannot be used directly. Instead, it is used as a parent class
264for another entry, which defined blob_fname. This parameter is used to
265set the entry-arg or property containing the filename. The entry-arg or
266property is in turn used to set the actual filename.
267
268See cros_ec_rw for an example of this.
269
270
271
Simon Glassa7c97782022-08-07 16:33:25 -0600272.. _etype_blob_phase:
273
Simon Glass718b5292021-03-18 20:25:07 +1300274Entry: blob-phase: Section that holds a phase binary
275----------------------------------------------------
276
277This is a base class that should not normally be used directly. It is used
278when converting a 'u-boot' entry automatically into a 'u-boot-expanded'
279entry; similarly for SPL.
280
281
Simon Glassa7c97782022-08-07 16:33:25 -0600282
283.. _etype_cbfs:
Simon Glass718b5292021-03-18 20:25:07 +1300284
Simon Glass8911fa12021-03-18 20:25:16 +1300285Entry: cbfs: Coreboot Filesystem (CBFS)
286---------------------------------------
Simon Glass1de34482019-07-08 13:18:53 -0600287
288A CBFS provides a way to group files into a group. It has a simple directory
289structure and allows the position of individual files to be set, since it is
290designed to support execute-in-place in an x86 SPI-flash device. Where XIP
291is not used, it supports compression and storing ELF files.
292
293CBFS is used by coreboot as its way of orgnanising SPI-flash contents.
294
Simon Glass0ac96b62021-03-18 20:25:15 +1300295The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.::
Simon Glass1de34482019-07-08 13:18:53 -0600296
297 cbfs {
298 size = <0x100000>;
299 u-boot {
300 cbfs-type = "raw";
301 };
302 u-boot-dtb {
303 cbfs-type = "raw";
304 };
305 };
306
307This creates a CBFS 1MB in size two files in it: u-boot.bin and u-boot.dtb.
308Note that the size is required since binman does not support calculating it.
309The contents of each entry is just what binman would normally provide if it
310were not a CBFS node. A blob type can be used to import arbitrary files as
Simon Glass0ac96b62021-03-18 20:25:15 +1300311with the second subnode below::
Simon Glass1de34482019-07-08 13:18:53 -0600312
313 cbfs {
314 size = <0x100000>;
315 u-boot {
316 cbfs-name = "BOOT";
317 cbfs-type = "raw";
318 };
319
320 dtb {
321 type = "blob";
322 filename = "u-boot.dtb";
323 cbfs-type = "raw";
324 cbfs-compress = "lz4";
Simon Glassc2f1aed2019-07-08 13:18:56 -0600325 cbfs-offset = <0x100000>;
Simon Glass1de34482019-07-08 13:18:53 -0600326 };
327 };
328
329This creates a CBFS 1MB in size with u-boot.bin (named "BOOT") and
330u-boot.dtb (named "dtb") and compressed with the lz4 algorithm.
331
332
333Properties supported in the top-level CBFS node:
334
335cbfs-arch:
336 Defaults to "x86", but you can specify the architecture if needed.
337
338
339Properties supported in the CBFS entry subnodes:
340
341cbfs-name:
342 This is the name of the file created in CBFS. It defaults to the entry
343 name (which is the node name), but you can override it with this
344 property.
345
346cbfs-type:
347 This is the CBFS file type. The following are supported:
348
349 raw:
350 This is a 'raw' file, although compression is supported. It can be
351 used to store any file in CBFS.
352
353 stage:
354 This is an ELF file that has been loaded (i.e. mapped to memory), so
355 appears in the CBFS as a flat binary. The input file must be an ELF
356 image, for example this puts "u-boot" (the ELF image) into a 'stage'
Simon Glass0ac96b62021-03-18 20:25:15 +1300357 entry::
Simon Glass1de34482019-07-08 13:18:53 -0600358
359 cbfs {
360 size = <0x100000>;
361 u-boot-elf {
362 cbfs-name = "BOOT";
363 cbfs-type = "stage";
364 };
365 };
366
Simon Glass0ac96b62021-03-18 20:25:15 +1300367 You can use your own ELF file with something like::
Simon Glass1de34482019-07-08 13:18:53 -0600368
369 cbfs {
370 size = <0x100000>;
371 something {
372 type = "blob";
373 filename = "cbfs-stage.elf";
374 cbfs-type = "stage";
375 };
376 };
377
378 As mentioned, the file is converted to a flat binary, so it is
379 equivalent to adding "u-boot.bin", for example, but with the load and
380 start addresses specified by the ELF. At present there is no option
381 to add a flat binary with a load/start address, similar to the
382 'add-flat-binary' option in cbfstool.
383
Simon Glassc2f1aed2019-07-08 13:18:56 -0600384cbfs-offset:
385 This is the offset of the file's data within the CBFS. It is used to
386 specify where the file should be placed in cases where a fixed position
387 is needed. Typical uses are for code which is not relocatable and must
388 execute in-place from a particular address. This works because SPI flash
389 is generally mapped into memory on x86 devices. The file header is
390 placed before this offset so that the data start lines up exactly with
391 the chosen offset. If this property is not provided, then the file is
392 placed in the next available spot.
Simon Glass1de34482019-07-08 13:18:53 -0600393
394The current implementation supports only a subset of CBFS features. It does
395not support other file types (e.g. payload), adding multiple files (like the
396'files' entry with a pattern supported by binman), putting files at a
397particular offset in the CBFS and a few other things.
398
399Of course binman can create images containing multiple CBFSs, simply by
Simon Glass0ac96b62021-03-18 20:25:15 +1300400defining these in the binman config::
Simon Glass1de34482019-07-08 13:18:53 -0600401
402
403 binman {
404 size = <0x800000>;
405 cbfs {
406 offset = <0x100000>;
407 size = <0x100000>;
408 u-boot {
409 cbfs-type = "raw";
410 };
411 u-boot-dtb {
412 cbfs-type = "raw";
413 };
414 };
415
416 cbfs2 {
417 offset = <0x700000>;
418 size = <0x100000>;
419 u-boot {
420 cbfs-type = "raw";
421 };
422 u-boot-dtb {
423 cbfs-type = "raw";
424 };
425 image {
426 type = "blob";
427 filename = "image.jpg";
428 };
429 };
430 };
431
432This creates an 8MB image with two CBFSs, one at offset 1MB, one at 7MB,
433both of size 1MB.
434
435
436
Simon Glassa7c97782022-08-07 16:33:25 -0600437.. _etype_collection:
438
Simon Glasse1915782021-03-21 18:24:31 +1300439Entry: collection: An entry which contains a collection of other entries
440------------------------------------------------------------------------
441
442Properties / Entry arguments:
443 - content: List of phandles to entries to include
444
445This allows reusing the contents of other entries. The contents of the
446listed entries are combined to form this entry. This serves as a useful
447base class for entry types which need to process data from elsewhere in
448the image, not necessarily child entries.
449
450
451
Simon Glassa7c97782022-08-07 16:33:25 -0600452.. _etype_cros_ec_rw:
453
Simon Glassdb168d42018-07-17 13:25:39 -0600454Entry: cros-ec-rw: A blob entry which contains a Chromium OS read-write EC image
455--------------------------------------------------------------------------------
456
457Properties / Entry arguments:
458 - cros-ec-rw-path: Filename containing the EC image
459
460This entry holds a Chromium OS EC (embedded controller) image, for use in
461updating the EC on startup via software sync.
462
463
464
Simon Glassa7c97782022-08-07 16:33:25 -0600465.. _etype_fdtmap:
466
Simon Glass0f621332019-07-08 14:25:27 -0600467Entry: fdtmap: An entry which contains an FDT map
468-------------------------------------------------
469
470Properties / Entry arguments:
471 None
472
473An FDT map is just a header followed by an FDT containing a list of all the
Simon Glassfb30e292019-07-20 12:23:51 -0600474entries in the image. The root node corresponds to the image node in the
475original FDT, and an image-name property indicates the image name in that
476original tree.
Simon Glass0f621332019-07-08 14:25:27 -0600477
478The header is the string _FDTMAP_ followed by 8 unused bytes.
479
480When used, this entry will be populated with an FDT map which reflects the
481entries in the current image. Hierarchy is preserved, and all offsets and
482sizes are included.
483
484Note that the -u option must be provided to ensure that binman updates the
485FDT with the position of each entry.
486
Simon Glass0ac96b62021-03-18 20:25:15 +1300487Example output for a simple image with U-Boot and an FDT map::
Simon Glass0f621332019-07-08 14:25:27 -0600488
Simon Glass0ac96b62021-03-18 20:25:15 +1300489 / {
490 image-name = "binman";
491 size = <0x00000112>;
Simon Glass0f621332019-07-08 14:25:27 -0600492 image-pos = <0x00000000>;
493 offset = <0x00000000>;
Simon Glass0ac96b62021-03-18 20:25:15 +1300494 u-boot {
495 size = <0x00000004>;
496 image-pos = <0x00000000>;
497 offset = <0x00000000>;
498 };
499 fdtmap {
500 size = <0x0000010e>;
501 image-pos = <0x00000004>;
502 offset = <0x00000004>;
503 };
Simon Glass0f621332019-07-08 14:25:27 -0600504 };
Simon Glass0f621332019-07-08 14:25:27 -0600505
Simon Glassfb30e292019-07-20 12:23:51 -0600506If allow-repack is used then 'orig-offset' and 'orig-size' properties are
507added as necessary. See the binman README.
508
Simon Glass637958f2021-11-23 21:09:50 -0700509When extracting files, an alternative 'fdt' format is available for fdtmaps.
510Use `binman extract -F fdt ...` to use this. It will export a devicetree,
511without the fdtmap header, so it can be viewed with `fdtdump`.
Simon Glass0f621332019-07-08 14:25:27 -0600512
513
Simon Glass637958f2021-11-23 21:09:50 -0700514
Simon Glassa7c97782022-08-07 16:33:25 -0600515.. _etype_files:
516
Simon Glass8911fa12021-03-18 20:25:16 +1300517Entry: files: A set of files arranged in a section
518--------------------------------------------------
Simon Glassac6328c2018-09-14 04:57:28 -0600519
520Properties / Entry arguments:
521 - pattern: Filename pattern to match the files to include
Simon Glass51d02ad2020-10-26 17:40:07 -0600522 - files-compress: Compression algorithm to use:
Simon Glassac6328c2018-09-14 04:57:28 -0600523 none: No compression
524 lz4: Use lz4 compression (via 'lz4' command-line utility)
Simon Glass3f093a32021-03-18 20:24:53 +1300525 - files-align: Align each file to the given alignment
Simon Glassac6328c2018-09-14 04:57:28 -0600526
527This entry reads a number of files and places each in a separate sub-entry
528within this entry. To access these you need to enable device-tree updates
529at run-time so you can obtain the file positions.
Simon Glass7a61c6b2018-07-17 13:25:37 -0600530
531
Simon Glassac6328c2018-09-14 04:57:28 -0600532
Simon Glassa7c97782022-08-07 16:33:25 -0600533.. _etype_fill:
534
Simon Glass53f53992018-07-17 13:25:40 -0600535Entry: fill: An entry which is filled to a particular byte value
536----------------------------------------------------------------
537
538Properties / Entry arguments:
539 - fill-byte: Byte to use to fill the entry
540
541Note that the size property must be set since otherwise this entry does not
542know how large it should be.
543
544You can often achieve the same effect using the pad-byte property of the
545overall image, in that the space between entries will then be padded with
546that byte. But this entry is sometimes useful for explicitly setting the
547byte value of a region.
548
549
Simon Glassc7b010d2020-07-09 18:39:45 -0600550
Simon Glassa7c97782022-08-07 16:33:25 -0600551.. _etype_fit:
552
Simon Glass8911fa12021-03-18 20:25:16 +1300553Entry: fit: Flat Image Tree (FIT)
554---------------------------------
Simon Glass45d556d2020-07-09 18:39:45 -0600555
556This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the
557input provided.
558
559Nodes for the FIT should be written out in the binman configuration just as
560they would be in a file passed to mkimage.
561
Simon Glass0ac96b62021-03-18 20:25:15 +1300562For example, this creates an image containing a FIT with U-Boot SPL::
Simon Glass45d556d2020-07-09 18:39:45 -0600563
564 binman {
565 fit {
566 description = "Test FIT";
Simon Glassa435cd12020-09-01 05:13:59 -0600567 fit,fdt-list = "of-list";
Simon Glass45d556d2020-07-09 18:39:45 -0600568
569 images {
570 kernel@1 {
571 description = "SPL";
572 os = "u-boot";
573 type = "rkspi";
574 arch = "arm";
575 compression = "none";
576 load = <0>;
577 entry = <0>;
578
579 u-boot-spl {
580 };
581 };
582 };
583 };
584 };
585
Simon Glass912339f2022-02-08 11:50:03 -0700586More complex setups can be created, with generated nodes, as described
587below.
588
589Properties (in the 'fit' node itself)
590~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
591
592Special properties have a `fit,` prefix, indicating that they should be
593processed but not included in the final FIT.
594
595The top-level 'fit' node supports the following special properties:
596
597 fit,external-offset
598 Indicates that the contents of the FIT are external and provides the
599 external offset. This is passed to mkimage via the -E and -p flags.
600
601 fit,fdt-list
602 Indicates the entry argument which provides the list of device tree
603 files for the gen-fdt-nodes operation (as below). This is often
604 `of-list` meaning that `-a of-list="dtb1 dtb2..."` should be passed
605 to binman.
606
607Substitutions
608~~~~~~~~~~~~~
609
610Node names and property values support a basic string-substitution feature.
611Available substitutions for '@' nodes (and property values) are:
612
613SEQ:
614 Sequence number of the generated fdt (1, 2, ...)
615NAME
616 Name of the dtb as provided (i.e. without adding '.dtb')
617
618The `default` property, if present, will be automatically set to the name
619if of configuration whose devicetree matches the `default-dt` entry
620argument, e.g. with `-a default-dt=sun50i-a64-pine64-lts`.
621
622Available substitutions for property values in these nodes are:
623
624DEFAULT-SEQ:
625 Sequence number of the default fdt, as provided by the 'default-dt'
626 entry argument
627
628Available operations
629~~~~~~~~~~~~~~~~~~~~
630
631You can add an operation to an '@' node to indicate which operation is
632required::
633
634 @fdt-SEQ {
635 fit,operation = "gen-fdt-nodes";
636 ...
637 };
638
639Available operations are:
640
641gen-fdt-nodes
642 Generate FDT nodes as above. This is the default if there is no
643 `fit,operation` property.
644
Simon Glass5f423422022-03-05 20:19:12 -0700645split-elf
646 Split an ELF file into a separate node for each segment.
647
Simon Glass912339f2022-02-08 11:50:03 -0700648Generating nodes from an FDT list (gen-fdt-nodes)
649~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
650
Simon Glassa435cd12020-09-01 05:13:59 -0600651U-Boot supports creating fdt and config nodes automatically. To do this,
Simon Glass9f1c6b92022-02-08 11:50:02 -0700652pass an `of-list` property (e.g. `-a of-list=file1 file2`). This tells
653binman that you want to generates nodes for two files: `file1.dtb` and
654`file2.dtb`. The `fit,fdt-list` property (see above) indicates that
655`of-list` should be used. If the property is missing you will get an error.
Simon Glassa435cd12020-09-01 05:13:59 -0600656
Simon Glass0ac96b62021-03-18 20:25:15 +1300657Then add a 'generator node', a node with a name starting with '@'::
Simon Glassa435cd12020-09-01 05:13:59 -0600658
659 images {
660 @fdt-SEQ {
661 description = "fdt-NAME";
662 type = "flat_dt";
663 compression = "none";
664 };
665 };
666
Simon Glass9f1c6b92022-02-08 11:50:02 -0700667This tells binman to create nodes `fdt-1` and `fdt-2` for each of your two
Simon Glassa435cd12020-09-01 05:13:59 -0600668files. All the properties you specify will be included in the node. This
669node acts like a template to generate the nodes. The generator node itself
670does not appear in the output - it is replaced with what binman generates.
Simon Glass9f1c6b92022-02-08 11:50:02 -0700671A 'data' property is created with the contents of the FDT file.
Simon Glassa435cd12020-09-01 05:13:59 -0600672
Simon Glass0ac96b62021-03-18 20:25:15 +1300673You can create config nodes in a similar way::
Simon Glassa435cd12020-09-01 05:13:59 -0600674
675 configurations {
676 default = "@config-DEFAULT-SEQ";
677 @config-SEQ {
678 description = "NAME";
Samuel Holland91079ac2020-10-21 21:12:14 -0500679 firmware = "atf";
680 loadables = "uboot";
Simon Glassa435cd12020-09-01 05:13:59 -0600681 fdt = "fdt-SEQ";
682 };
683 };
684
Simon Glass9f1c6b92022-02-08 11:50:02 -0700685This tells binman to create nodes `config-1` and `config-2`, i.e. a config
686for each of your two files.
Simon Glassa435cd12020-09-01 05:13:59 -0600687
Simon Glassa435cd12020-09-01 05:13:59 -0600688Note that if no devicetree files are provided (with '-a of-list' as above)
689then no nodes will be generated.
690
Simon Glass5f423422022-03-05 20:19:12 -0700691Generating nodes from an ELF file (split-elf)
692~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
693
694This uses the node as a template to generate multiple nodes. The following
695special properties are available:
696
697split-elf
698 Split an ELF file into a separate node for each segment. This uses the
699 node as a template to generate multiple nodes. The following special
700 properties are available:
701
702 fit,load
703 Generates a `load = <...>` property with the load address of the
704 segment
705
706 fit,entry
707 Generates a `entry = <...>` property with the entry address of the
708 ELF. This is only produced for the first entry
709
710 fit,data
711 Generates a `data = <...>` property with the contents of the segment
712
713 fit,loadables
714 Generates a `loadable = <...>` property with a list of the generated
715 nodes (including all nodes if this operation is used multiple times)
716
717
718Here is an example showing ATF, TEE and a device tree all combined::
719
720 fit {
721 description = "test-desc";
722 #address-cells = <1>;
723 fit,fdt-list = "of-list";
724
725 images {
726 u-boot {
727 description = "U-Boot (64-bit)";
728 type = "standalone";
729 os = "U-Boot";
730 arch = "arm64";
731 compression = "none";
732 load = <CONFIG_SYS_TEXT_BASE>;
733 u-boot-nodtb {
734 };
735 };
736 @fdt-SEQ {
737 description = "fdt-NAME.dtb";
738 type = "flat_dt";
739 compression = "none";
740 };
741 @atf-SEQ {
742 fit,operation = "split-elf";
743 description = "ARM Trusted Firmware";
744 type = "firmware";
745 arch = "arm64";
746 os = "arm-trusted-firmware";
747 compression = "none";
748 fit,load;
749 fit,entry;
750 fit,data;
751
752 atf-bl31 {
753 };
754 };
755
756 @tee-SEQ {
757 fit,operation = "split-elf";
758 description = "TEE";
759 type = "tee";
760 arch = "arm64";
761 os = "tee";
762 compression = "none";
763 fit,load;
764 fit,entry;
765 fit,data;
766
767 tee-os {
768 };
769 };
770 };
771
772 configurations {
773 default = "@config-DEFAULT-SEQ";
774 @config-SEQ {
775 description = "conf-NAME.dtb";
776 fdt = "fdt-SEQ";
777 firmware = "u-boot";
778 fit,loadables;
779 };
780 };
781 };
782
783If ATF-BL31 is available, this generates a node for each segment in the
784ELF file, for example::
785
786 images {
787 atf-1 {
788 data = <...contents of first segment...>;
789 data-offset = <0x00000000>;
790 entry = <0x00040000>;
791 load = <0x00040000>;
792 compression = "none";
793 os = "arm-trusted-firmware";
794 arch = "arm64";
795 type = "firmware";
796 description = "ARM Trusted Firmware";
797 };
798 atf-2 {
799 data = <...contents of second segment...>;
800 load = <0xff3b0000>;
801 compression = "none";
802 os = "arm-trusted-firmware";
803 arch = "arm64";
804 type = "firmware";
805 description = "ARM Trusted Firmware";
806 };
807 };
808
809The same applies for OP-TEE if that is available.
810
811If each binary is not available, the relevant template node (@atf-SEQ or
812@tee-SEQ) is removed from the output.
813
814This also generates a `config-xxx` node for each device tree in `of-list`.
815Note that the U-Boot build system uses `-a of-list=$(CONFIG_OF_LIST)`
816so you can use `CONFIG_OF_LIST` to define that list. In this example it is
817set up for `firefly-rk3399` with a single device tree and the default set
818with `-a default-dt=$(CONFIG_DEFAULT_DEVICE_TREE)`, so the resulting output
819is::
820
821 configurations {
822 default = "config-1";
823 config-1 {
824 loadables = "atf-1", "atf-2", "atf-3", "tee-1", "tee-2";
825 description = "rk3399-firefly.dtb";
826 fdt = "fdt-1";
827 firmware = "u-boot";
828 };
829 };
830
831U-Boot SPL can then load the firmware (U-Boot proper) and all the loadables
832(ATF and TEE), then proceed with the boot.
833
Simon Glass45d556d2020-07-09 18:39:45 -0600834
Simon Glassa7c97782022-08-07 16:33:25 -0600835
836.. _etype_fmap:
Simon Glass45d556d2020-07-09 18:39:45 -0600837
Simon Glass7a61c6b2018-07-17 13:25:37 -0600838Entry: fmap: An entry which contains an Fmap section
839----------------------------------------------------
840
841Properties / Entry arguments:
842 None
843
844FMAP is a simple format used by flashrom, an open-source utility for
845reading and writing the SPI flash, typically on x86 CPUs. The format
846provides flashrom with a list of areas, so it knows what it in the flash.
847It can then read or write just a single area, instead of the whole flash.
848
849The format is defined by the flashrom project, in the file lib/fmap.h -
850see www.flashrom.org/Flashrom for more information.
851
852When used, this entry will be populated with an FMAP which reflects the
853entries in the current image. Note that any hierarchy is squashed, since
Simon Glassb1d414c2021-04-03 11:05:10 +1300854FMAP does not support this. Sections are represented as an area appearing
855before its contents, so that it is possible to reconstruct the hierarchy
856from the FMAP by using the offset information. This convention does not
857seem to be documented, but is used in Chromium OS.
Simon Glass7a61c6b2018-07-17 13:25:37 -0600858
Simon Glassb1d414c2021-04-03 11:05:10 +1300859CBFS entries appear as a single entry, i.e. the sub-entries are ignored.
Simon Glass7a61c6b2018-07-17 13:25:37 -0600860
861
Simon Glassb1d414c2021-04-03 11:05:10 +1300862
Simon Glassa7c97782022-08-07 16:33:25 -0600863.. _etype_gbb:
864
Simon Glassc1ae83c2018-07-17 13:25:44 -0600865Entry: gbb: An entry which contains a Chromium OS Google Binary Block
866---------------------------------------------------------------------
867
868Properties / Entry arguments:
869 - hardware-id: Hardware ID to use for this build (a string)
870 - keydir: Directory containing the public keys to use
871 - bmpblk: Filename containing images used by recovery
872
873Chromium OS uses a GBB to store various pieces of information, in particular
874the root and recovery keys that are used to verify the boot process. Some
875more details are here:
876
877 https://www.chromium.org/chromium-os/firmware-porting-guide/2-concepts
878
879but note that the page dates from 2013 so is quite out of date. See
880README.chromium for how to obtain the required keys and tools.
881
882
Simon Glassa7c97782022-08-07 16:33:25 -0600883
884.. _etype_image_header:
Simon Glassc1ae83c2018-07-17 13:25:44 -0600885
Simon Glasscec34ba2019-07-08 14:25:28 -0600886Entry: image-header: An entry which contains a pointer to the FDT map
887---------------------------------------------------------------------
888
889Properties / Entry arguments:
890 location: Location of header ("start" or "end" of image). This is
891 optional. If omitted then the entry must have an offset property.
892
893This adds an 8-byte entry to the start or end of the image, pointing to the
894location of the FDT map. The format is a magic number followed by an offset
895from the start or end of the image, in twos-compliment format.
896
897This entry must be in the top-level part of the image.
898
899NOTE: If the location is at the start/end, you will probably need to specify
900sort-by-offset for the image, unless you actually put the image header
901first/last in the entry list.
902
903
904
Simon Glassa7c97782022-08-07 16:33:25 -0600905.. _etype_intel_cmc:
906
Simon Glass8911fa12021-03-18 20:25:16 +1300907Entry: intel-cmc: Intel Chipset Micro Code (CMC) file
908-----------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -0600909
910Properties / Entry arguments:
911 - filename: Filename of file to read into entry
912
913This file contains microcode for some devices in a special format. An
914example filename is 'Microcode/C0_22211.BIN'.
915
916See README.x86 for information about x86 binary blobs.
917
918
919
Simon Glassa7c97782022-08-07 16:33:25 -0600920.. _etype_intel_descriptor:
921
Simon Glass7a61c6b2018-07-17 13:25:37 -0600922Entry: intel-descriptor: Intel flash descriptor block (4KB)
923-----------------------------------------------------------
924
925Properties / Entry arguments:
926 filename: Filename of file containing the descriptor. This is typically
927 a 4KB binary file, sometimes called 'descriptor.bin'
928
929This entry is placed at the start of flash and provides information about
930the SPI flash regions. In particular it provides the base address and
931size of the ME (Management Engine) region, allowing us to place the ME
932binary in the right place.
933
934With this entry in your image, the position of the 'intel-me' entry will be
935fixed in the image, which avoids you needed to specify an offset for that
936region. This is useful, because it is not possible to change the position
937of the ME region without updating the descriptor.
938
939See README.x86 for information about x86 binary blobs.
940
941
942
Simon Glassa7c97782022-08-07 16:33:25 -0600943.. _etype_intel_fit:
944
Simon Glass232f90c2019-08-24 07:22:50 -0600945Entry: intel-fit: Intel Firmware Image Table (FIT)
946--------------------------------------------------
947
948This entry contains a dummy FIT as required by recent Intel CPUs. The FIT
949contains information about the firmware and microcode available in the
950image.
951
952At present binman only supports a basic FIT with no microcode.
953
954
955
Simon Glassa7c97782022-08-07 16:33:25 -0600956.. _etype_intel_fit_ptr:
957
Simon Glass232f90c2019-08-24 07:22:50 -0600958Entry: intel-fit-ptr: Intel Firmware Image Table (FIT) pointer
959--------------------------------------------------------------
960
961This entry contains a pointer to the FIT. It is required to be at address
9620xffffffc0 in the image.
963
964
965
Simon Glassa7c97782022-08-07 16:33:25 -0600966.. _etype_intel_fsp:
967
Simon Glass8911fa12021-03-18 20:25:16 +1300968Entry: intel-fsp: Intel Firmware Support Package (FSP) file
969-----------------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -0600970
971Properties / Entry arguments:
972 - filename: Filename of file to read into entry
973
974This file contains binary blobs which are used on some devices to make the
975platform work. U-Boot executes this code since it is not possible to set up
976the hardware using U-Boot open-source code. Documentation is typically not
977available in sufficient detail to allow this.
978
979An example filename is 'FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd'
980
981See README.x86 for information about x86 binary blobs.
982
983
984
Simon Glassa7c97782022-08-07 16:33:25 -0600985.. _etype_intel_fsp_m:
986
Simon Glass8911fa12021-03-18 20:25:16 +1300987Entry: intel-fsp-m: Intel Firmware Support Package (FSP) memory init
988--------------------------------------------------------------------
Simon Glassba7985d2019-08-24 07:23:07 -0600989
990Properties / Entry arguments:
991 - filename: Filename of file to read into entry
992
993This file contains a binary blob which is used on some devices to set up
994SDRAM. U-Boot executes this code in SPL so that it can make full use of
995memory. Documentation is typically not available in sufficient detail to
996allow U-Boot do this this itself..
997
998An example filename is 'fsp_m.bin'
999
1000See README.x86 for information about x86 binary blobs.
1001
1002
Simon Glassa7c97782022-08-07 16:33:25 -06001003
1004.. _etype_intel_fsp_s:
Simon Glassba7985d2019-08-24 07:23:07 -06001005
Simon Glass8911fa12021-03-18 20:25:16 +13001006Entry: intel-fsp-s: Intel Firmware Support Package (FSP) silicon init
1007---------------------------------------------------------------------
Simon Glass4d9086d2019-10-20 21:31:35 -06001008
1009Properties / Entry arguments:
1010 - filename: Filename of file to read into entry
1011
1012This file contains a binary blob which is used on some devices to set up
1013the silicon. U-Boot executes this code in U-Boot proper after SDRAM is
1014running, so that it can make full use of memory. Documentation is typically
1015not available in sufficient detail to allow U-Boot do this this itself.
1016
1017An example filename is 'fsp_s.bin'
1018
1019See README.x86 for information about x86 binary blobs.
1020
1021
1022
Simon Glassa7c97782022-08-07 16:33:25 -06001023.. _etype_intel_fsp_t:
1024
Simon Glass8911fa12021-03-18 20:25:16 +13001025Entry: intel-fsp-t: Intel Firmware Support Package (FSP) temp ram init
1026----------------------------------------------------------------------
Simon Glass9ea87b22019-10-20 21:31:36 -06001027
1028Properties / Entry arguments:
1029 - filename: Filename of file to read into entry
1030
1031This file contains a binary blob which is used on some devices to set up
1032temporary memory (Cache-as-RAM or CAR). U-Boot executes this code in TPL so
1033that it has access to memory for its stack and initial storage.
1034
1035An example filename is 'fsp_t.bin'
1036
1037See README.x86 for information about x86 binary blobs.
1038
1039
Simon Glassa7c97782022-08-07 16:33:25 -06001040
1041.. _etype_intel_ifwi:
Simon Glass9ea87b22019-10-20 21:31:36 -06001042
Simon Glass8911fa12021-03-18 20:25:16 +13001043Entry: intel-ifwi: Intel Integrated Firmware Image (IFWI) file
1044--------------------------------------------------------------
Simon Glassc2f1aed2019-07-08 13:18:56 -06001045
1046Properties / Entry arguments:
1047 - filename: Filename of file to read into entry. This is either the
1048 IFWI file itself, or a file that can be converted into one using a
1049 tool
1050 - convert-fit: If present this indicates that the ifwitool should be
1051 used to convert the provided file into a IFWI.
1052
1053This file contains code and data used by the SoC that is required to make
1054it work. It includes U-Boot TPL, microcode, things related to the CSE
1055(Converged Security Engine, the microcontroller that loads all the firmware)
1056and other items beyond the wit of man.
1057
1058A typical filename is 'ifwi.bin' for an IFWI file, or 'fitimage.bin' for a
1059file that will be converted to an IFWI.
1060
1061The position of this entry is generally set by the intel-descriptor entry.
1062
1063The contents of the IFWI are specified by the subnodes of the IFWI node.
1064Each subnode describes an entry which is placed into the IFWFI with a given
1065sub-partition (and optional entry name).
1066
Simon Glass8a5e2492019-08-24 07:22:47 -06001067Properties for subnodes:
Simon Glass0ac96b62021-03-18 20:25:15 +13001068 - ifwi-subpart: sub-parition to put this entry into, e.g. "IBBP"
1069 - ifwi-entry: entry name t use, e.g. "IBBL"
1070 - ifwi-replace: if present, indicates that the item should be replaced
1071 in the IFWI. Otherwise it is added.
Simon Glass8a5e2492019-08-24 07:22:47 -06001072
Simon Glassc2f1aed2019-07-08 13:18:56 -06001073See README.x86 for information about x86 binary blobs.
1074
1075
1076
Simon Glassa7c97782022-08-07 16:33:25 -06001077.. _etype_intel_me:
1078
Simon Glass8911fa12021-03-18 20:25:16 +13001079Entry: intel-me: Intel Management Engine (ME) file
1080--------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001081
1082Properties / Entry arguments:
1083 - filename: Filename of file to read into entry
1084
1085This file contains code used by the SoC that is required to make it work.
1086The Management Engine is like a background task that runs things that are
Thomas Hebbfd37f242019-11-13 18:18:03 -08001087not clearly documented, but may include keyboard, display and network
Simon Glass7a61c6b2018-07-17 13:25:37 -06001088access. For platform that use ME it is not possible to disable it. U-Boot
1089does not directly execute code in the ME binary.
1090
1091A typical filename is 'me.bin'.
1092
Simon Glassc4056b82019-07-08 13:18:38 -06001093The position of this entry is generally set by the intel-descriptor entry.
1094
Simon Glass7a61c6b2018-07-17 13:25:37 -06001095See README.x86 for information about x86 binary blobs.
1096
1097
1098
Simon Glassa7c97782022-08-07 16:33:25 -06001099.. _etype_intel_mrc:
1100
Simon Glass8911fa12021-03-18 20:25:16 +13001101Entry: intel-mrc: Intel Memory Reference Code (MRC) file
1102--------------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001103
1104Properties / Entry arguments:
1105 - filename: Filename of file to read into entry
1106
1107This file contains code for setting up the SDRAM on some Intel systems. This
1108is executed by U-Boot when needed early during startup. A typical filename
1109is 'mrc.bin'.
1110
1111See README.x86 for information about x86 binary blobs.
1112
1113
1114
Simon Glassa7c97782022-08-07 16:33:25 -06001115.. _etype_intel_refcode:
1116
Simon Glass8911fa12021-03-18 20:25:16 +13001117Entry: intel-refcode: Intel Reference Code file
1118-----------------------------------------------
Simon Glass17b84eb2019-05-17 22:00:53 -06001119
1120Properties / Entry arguments:
1121 - filename: Filename of file to read into entry
1122
1123This file contains code for setting up the platform on some Intel systems.
1124This is executed by U-Boot when needed early during startup. A typical
1125filename is 'refcode.bin'.
1126
1127See README.x86 for information about x86 binary blobs.
1128
1129
1130
Simon Glassa7c97782022-08-07 16:33:25 -06001131.. _etype_intel_vbt:
1132
Simon Glass8911fa12021-03-18 20:25:16 +13001133Entry: intel-vbt: Intel Video BIOS Table (VBT) file
1134---------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001135
1136Properties / Entry arguments:
1137 - filename: Filename of file to read into entry
1138
1139This file contains code that sets up the integrated graphics subsystem on
1140some Intel SoCs. U-Boot executes this when the display is started up.
1141
1142See README.x86 for information about Intel binary blobs.
1143
1144
1145
Simon Glassa7c97782022-08-07 16:33:25 -06001146.. _etype_intel_vga:
1147
Simon Glass8911fa12021-03-18 20:25:16 +13001148Entry: intel-vga: Intel Video Graphics Adaptor (VGA) file
1149---------------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001150
1151Properties / Entry arguments:
1152 - filename: Filename of file to read into entry
1153
1154This file contains code that sets up the integrated graphics subsystem on
1155some Intel SoCs. U-Boot executes this when the display is started up.
1156
1157This is similar to the VBT file but in a different format.
1158
1159See README.x86 for information about Intel binary blobs.
1160
1161
1162
Simon Glassa7c97782022-08-07 16:33:25 -06001163.. _etype_mkimage:
1164
Simon Glass8911fa12021-03-18 20:25:16 +13001165Entry: mkimage: Binary produced by mkimage
1166------------------------------------------
Simon Glass48f3aad2020-07-09 18:39:31 -06001167
1168Properties / Entry arguments:
1169 - datafile: Filename for -d argument
1170 - args: Other arguments to pass
1171
1172The data passed to mkimage is collected from subnodes of the mkimage node,
Simon Glass0ac96b62021-03-18 20:25:15 +13001173e.g.::
Simon Glass48f3aad2020-07-09 18:39:31 -06001174
1175 mkimage {
1176 args = "-n test -T imximage";
1177
1178 u-boot-spl {
1179 };
1180 };
1181
1182This calls mkimage to create an imximage with u-boot-spl.bin as the input
1183file. The output from mkimage then becomes part of the image produced by
1184binman.
1185
Simon Glass948dd3a2022-02-08 11:49:58 -07001186To use CONFIG options in the arguments, use a string list instead, as in
1187this example which also produces four arguments::
1188
1189 mkimage {
1190 args = "-n", CONFIG_SYS_SOC, "-T imximage";
1191
1192 u-boot-spl {
1193 };
1194 };
1195
1196
Simon Glass48f3aad2020-07-09 18:39:31 -06001197
Simon Glassa7c97782022-08-07 16:33:25 -06001198
1199.. _etype_opensbi:
Simon Glass48f3aad2020-07-09 18:39:31 -06001200
Bin Mengc0b15742021-05-10 20:23:33 +08001201Entry: opensbi: RISC-V OpenSBI fw_dynamic blob
1202----------------------------------------------
1203
1204Properties / Entry arguments:
1205 - opensbi-path: Filename of file to read into entry. This is typically
1206 called fw_dynamic.bin
1207
1208This entry holds the run-time firmware, typically started by U-Boot SPL.
1209See the U-Boot README for your architecture or board for how to use it. See
1210https://github.com/riscv/opensbi for more information about OpenSBI.
1211
1212
1213
Simon Glassa7c97782022-08-07 16:33:25 -06001214.. _etype_powerpc_mpc85xx_bootpg_resetvec:
1215
Jagdish Gediya311d4842018-09-03 21:35:08 +05301216Entry: powerpc-mpc85xx-bootpg-resetvec: PowerPC mpc85xx bootpg + resetvec code for U-Boot
1217-----------------------------------------------------------------------------------------
1218
1219Properties / Entry arguments:
1220 - filename: Filename of u-boot-br.bin (default 'u-boot-br.bin')
1221
Thomas Hebbfd37f242019-11-13 18:18:03 -08001222This entry is valid for PowerPC mpc85xx cpus. This entry holds
Jagdish Gediya311d4842018-09-03 21:35:08 +05301223'bootpg + resetvec' code for PowerPC mpc85xx CPUs which needs to be
1224placed at offset 'RESET_VECTOR_ADDRESS - 0xffc'.
1225
Simon Glass136dd352020-10-26 17:39:59 -06001226
Simon Glassa7c97782022-08-07 16:33:25 -06001227
1228.. _etype_pre_load:
Simon Glass136dd352020-10-26 17:39:59 -06001229
Philippe Reynesebe96cb2022-03-28 22:57:04 +02001230Entry: pre-load: Pre load image header
1231--------------------------------------
1232
1233Properties / Entry arguments:
Simon Glassa7c97782022-08-07 16:33:25 -06001234 - pre-load-key-path: Path of the directory that store key (provided by the environment variable PRE_LOAD_KEY_PATH)
Philippe Reynesebe96cb2022-03-28 22:57:04 +02001235 - content: List of phandles to entries to sign
1236 - algo-name: Hash and signature algo to use for the signature
1237 - padding-name: Name of the padding (pkcs-1.5 or pss)
1238 - key-name: Filename of the private key to sign
1239 - header-size: Total size of the header
1240 - version: Version of the header
1241
1242This entry creates a pre-load header that contains a global
1243image signature.
1244
1245For example, this creates an image with a pre-load header and a binary::
1246
1247 binman {
1248 image2 {
1249 filename = "sandbox.bin";
1250
1251 pre-load {
1252 content = <&image>;
1253 algo-name = "sha256,rsa2048";
1254 padding-name = "pss";
1255 key-name = "private.pem";
1256 header-size = <4096>;
1257 version = <1>;
1258 };
1259
1260 image: blob-ext {
1261 filename = "sandbox.itb";
1262 };
1263 };
1264 };
1265
1266
1267
Simon Glassa7c97782022-08-07 16:33:25 -06001268.. _etype_scp:
1269
Simon Glass8911fa12021-03-18 20:25:16 +13001270Entry: scp: System Control Processor (SCP) firmware blob
1271--------------------------------------------------------
Simon Glass136dd352020-10-26 17:39:59 -06001272
1273Properties / Entry arguments:
1274 - scp-path: Filename of file to read into the entry, typically scp.bin
1275
1276This entry holds firmware for an external platform-specific coprocessor.
Jagdish Gediya311d4842018-09-03 21:35:08 +05301277
1278
Simon Glass136dd352020-10-26 17:39:59 -06001279
Simon Glassa7c97782022-08-07 16:33:25 -06001280.. _etype_section:
1281
Simon Glass7a61c6b2018-07-17 13:25:37 -06001282Entry: section: Entry that contains other entries
1283-------------------------------------------------
1284
Simon Glasscc9a41c2021-11-23 11:03:49 -07001285A section is an entry which can contain other entries, thus allowing
1286hierarchical images to be created. See 'Sections and hierarchical images'
1287in the binman README for more information.
1288
1289The base implementation simply joins the various entries together, using
1290various rules about alignment, etc.
1291
1292Subclassing
1293~~~~~~~~~~~
1294
1295This class can be subclassed to support other file formats which hold
1296multiple entries, such as CBFS. To do this, override the following
1297functions. The documentation here describes what your function should do.
1298For example code, see etypes which subclass `Entry_section`, or `cbfs.py`
1299for a more involved example::
1300
1301 $ grep -l \(Entry_section tools/binman/etype/*.py
1302
1303ReadNode()
1304 Call `super().ReadNode()`, then read any special properties for the
1305 section. Then call `self.ReadEntries()` to read the entries.
1306
1307 Binman calls this at the start when reading the image description.
1308
1309ReadEntries()
1310 Read in the subnodes of the section. This may involve creating entries
1311 of a particular etype automatically, as well as reading any special
1312 properties in the entries. For each entry, entry.ReadNode() should be
1313 called, to read the basic entry properties. The properties should be
1314 added to `self._entries[]`, in the correct order, with a suitable name.
1315
1316 Binman calls this at the start when reading the image description.
1317
1318BuildSectionData(required)
1319 Create the custom file format that you want and return it as bytes.
1320 This likely sets up a file header, then loops through the entries,
1321 adding them to the file. For each entry, call `entry.GetData()` to
1322 obtain the data. If that returns None, and `required` is False, then
1323 this method must give up and return None. But if `required` is True then
1324 it should assume that all data is valid.
1325
1326 Binman calls this when packing the image, to find out the size of
1327 everything. It is called again at the end when building the final image.
1328
1329SetImagePos(image_pos):
1330 Call `super().SetImagePos(image_pos)`, then set the `image_pos` values
1331 for each of the entries. This should use the custom file format to find
1332 the `start offset` (and `image_pos`) of each entry. If the file format
1333 uses compression in such a way that there is no offset available (other
1334 than reading the whole file and decompressing it), then the offsets for
1335 affected entries can remain unset (`None`). The size should also be set
1336 if possible.
Simon Glass0ac96b62021-03-18 20:25:15 +13001337
Simon Glasscc9a41c2021-11-23 11:03:49 -07001338 Binman calls this after the image has been packed, to update the
1339 location that all the entries ended up at.
Simon Glass0ac96b62021-03-18 20:25:15 +13001340
Simon Glass637958f2021-11-23 21:09:50 -07001341ReadChildData(child, decomp, alt_format):
Simon Glasscc9a41c2021-11-23 11:03:49 -07001342 The default version of this may be good enough, if you are able to
1343 implement SetImagePos() correctly. But that is a bit of a bypass, so
1344 you can override this method to read from your custom file format. It
1345 should read the entire entry containing the custom file using
1346 `super().ReadData(True)`, then parse the file to get the data for the
1347 given child, then return that data.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001348
Simon Glasscc9a41c2021-11-23 11:03:49 -07001349 If your file format supports compression, the `decomp` argument tells
1350 you whether to return the compressed data (`decomp` is False) or to
1351 uncompress it first, then return the uncompressed data (`decomp` is
1352 True). This is used by the `binman extract -U` option.
Simon Glass21db0ff2020-09-01 05:13:54 -06001353
Simon Glass637958f2021-11-23 21:09:50 -07001354 If your entry supports alternative formats, the alt_format provides the
1355 alternative format that the user has selected. Your function should
1356 return data in that format. This is used by the 'binman extract -l'
1357 option.
1358
Simon Glasscc9a41c2021-11-23 11:03:49 -07001359 Binman calls this when reading in an image, in order to populate all the
1360 entries with the data from that image (`binman ls`).
1361
1362WriteChildData(child):
1363 Binman calls this after `child.data` is updated, to inform the custom
1364 file format about this, in case it needs to do updates.
1365
1366 The default version of this does nothing and probably needs to be
1367 overridden for the 'binman replace' command to work. Your version should
1368 use `child.data` to update the data for that child in the custom file
1369 format.
1370
1371 Binman calls this when updating an image that has been read in and in
1372 particular to update the data for a particular entry (`binman replace`)
1373
1374Properties / Entry arguments
1375~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1376
1377See :ref:`develop/package/binman:Image description format` for more
1378information.
1379
1380align-default
1381 Default alignment for this section, if no alignment is given in the
1382 entry
1383
1384pad-byte
1385 Pad byte to use when padding
1386
1387sort-by-offset
1388 True if entries should be sorted by offset, False if they must be
1389 in-order in the device tree description
1390
1391end-at-4gb
1392 Used to build an x86 ROM which ends at 4GB (2^32)
1393
1394name-prefix
1395 Adds a prefix to the name of every entry in the section when writing out
1396 the map
1397
1398skip-at-start
1399 Number of bytes before the first entry starts. These effectively adjust
1400 the starting offset of entries. For example, if this is 16, then the
1401 first entry would start at 16. An entry with offset = 20 would in fact
1402 be written at offset 4 in the image file, since the first 16 bytes are
1403 skipped when writing.
Simon Glassb1d414c2021-04-03 11:05:10 +13001404
Simon Glass39dd2152019-07-08 14:25:47 -06001405Since a section is also an entry, it inherits all the properies of entries
1406too.
1407
Simon Glasscc9a41c2021-11-23 11:03:49 -07001408Note that the `allow_missing` member controls whether this section permits
1409external blobs to be missing their contents. The option will produce an
1410image but of course it will not work. It is useful to make sure that
1411Continuous Integration systems can build without the binaries being
1412available. This is set by the `SetAllowMissing()` method, if
1413`--allow-missing` is passed to binman.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001414
1415
1416
Simon Glassa7c97782022-08-07 16:33:25 -06001417.. _etype_tee_os:
1418
Roger Quadros5cdcea02022-02-19 20:50:04 +02001419Entry: tee-os: Entry containing an OP-TEE Trusted OS (TEE) blob
1420---------------------------------------------------------------
1421
1422Properties / Entry arguments:
1423 - tee-os-path: Filename of file to read into entry. This is typically
1424 called tee-pager.bin
1425
1426This entry holds the run-time firmware, typically started by U-Boot SPL.
1427See the U-Boot README for your architecture or board for how to use it. See
1428https://github.com/OP-TEE/optee_os for more information about OP-TEE.
1429
1430
1431
Simon Glassa7c97782022-08-07 16:33:25 -06001432.. _etype_text:
1433
Simon Glass7a61c6b2018-07-17 13:25:37 -06001434Entry: text: An entry which contains text
1435-----------------------------------------
1436
1437The text can be provided either in the node itself or by a command-line
1438argument. There is a level of indirection to allow multiple text strings
1439and sharing of text.
1440
1441Properties / Entry arguments:
1442 text-label: The value of this string indicates the property / entry-arg
1443 that contains the string to place in the entry
1444 <xxx> (actual name is the value of text-label): contains the string to
1445 place in the entry.
Simon Glass47f6a622019-07-08 13:18:40 -06001446 <text>: The text to place in the entry (overrides the above mechanism).
1447 This is useful when the text is constant.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001448
Simon Glass0ac96b62021-03-18 20:25:15 +13001449Example node::
Simon Glass7a61c6b2018-07-17 13:25:37 -06001450
1451 text {
1452 size = <50>;
1453 text-label = "message";
1454 };
1455
1456You can then use:
1457
1458 binman -amessage="this is my message"
1459
1460and binman will insert that string into the entry.
1461
Simon Glass0ac96b62021-03-18 20:25:15 +13001462It is also possible to put the string directly in the node::
Simon Glass7a61c6b2018-07-17 13:25:37 -06001463
1464 text {
1465 size = <8>;
1466 text-label = "message";
1467 message = "a message directly in the node"
1468 };
1469
Simon Glass0ac96b62021-03-18 20:25:15 +13001470or just::
Simon Glass47f6a622019-07-08 13:18:40 -06001471
1472 text {
1473 size = <8>;
1474 text = "some text directly in the node"
1475 };
1476
Simon Glass7a61c6b2018-07-17 13:25:37 -06001477The text is not itself nul-terminated. This can be achieved, if required,
1478by setting the size of the entry to something larger than the text.
1479
1480
1481
Simon Glassa7c97782022-08-07 16:33:25 -06001482.. _etype_u_boot:
1483
Simon Glass7a61c6b2018-07-17 13:25:37 -06001484Entry: u-boot: U-Boot flat binary
1485---------------------------------
1486
1487Properties / Entry arguments:
1488 - filename: Filename of u-boot.bin (default 'u-boot.bin')
1489
1490This is the U-Boot binary, containing relocation information to allow it
1491to relocate itself at runtime. The binary typically includes a device tree
Simon Glass718b5292021-03-18 20:25:07 +13001492blob at the end of it.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001493
1494U-Boot can access binman symbols at runtime. See:
1495
1496 'Access to binman entry offsets at run time (fdt)'
1497
1498in the binman README for more information.
1499
Simon Glass718b5292021-03-18 20:25:07 +13001500Note that this entry is automatically replaced with u-boot-expanded unless
Simon Glass7098b7f2021-03-21 18:24:30 +13001501--no-expanded is used or the node has a 'no-expanded' property.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001502
1503
Simon Glass718b5292021-03-18 20:25:07 +13001504
Simon Glassa7c97782022-08-07 16:33:25 -06001505.. _etype_u_boot_dtb:
1506
Simon Glass7a61c6b2018-07-17 13:25:37 -06001507Entry: u-boot-dtb: U-Boot device tree
1508-------------------------------------
1509
1510Properties / Entry arguments:
1511 - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
1512
1513This is the U-Boot device tree, containing configuration information for
1514U-Boot. U-Boot needs this to know what devices are present and which drivers
1515to activate.
1516
Simon Glasse219aa42018-09-14 04:57:24 -06001517Note: This is mostly an internal entry type, used by others. This allows
1518binman to know which entries contain a device tree.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001519
1520
Simon Glassa7c97782022-08-07 16:33:25 -06001521
1522.. _etype_u_boot_dtb_with_ucode:
Simon Glass7a61c6b2018-07-17 13:25:37 -06001523
1524Entry: u-boot-dtb-with-ucode: A U-Boot device tree file, with the microcode removed
1525-----------------------------------------------------------------------------------
1526
1527Properties / Entry arguments:
1528 - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
1529
1530See Entry_u_boot_ucode for full details of the three entries involved in
1531this process. This entry provides the U-Boot device-tree file, which
1532contains the microcode. If the microcode is not being collated into one
1533place then the offset and size of the microcode is recorded by this entry,
Simon Glass537e0062021-03-18 20:24:54 +13001534for use by u-boot-with-ucode_ptr. If it is being collated, then this
Simon Glass7a61c6b2018-07-17 13:25:37 -06001535entry deletes the microcode from the device tree (to save space) and makes
Simon Glass537e0062021-03-18 20:24:54 +13001536it available to u-boot-ucode.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001537
1538
1539
Simon Glassa7c97782022-08-07 16:33:25 -06001540.. _etype_u_boot_elf:
1541
Simon Glassb1714232018-09-14 04:57:35 -06001542Entry: u-boot-elf: U-Boot ELF image
1543-----------------------------------
1544
1545Properties / Entry arguments:
1546 - filename: Filename of u-boot (default 'u-boot')
1547
1548This is the U-Boot ELF image. It does not include a device tree but can be
1549relocated to any address for execution.
1550
1551
Simon Glassa7c97782022-08-07 16:33:25 -06001552
1553.. _etype_u_boot_env:
Simon Glassb1714232018-09-14 04:57:35 -06001554
Simon Glass136dd352020-10-26 17:39:59 -06001555Entry: u-boot-env: An entry which contains a U-Boot environment
1556---------------------------------------------------------------
1557
1558Properties / Entry arguments:
1559 - filename: File containing the environment text, with each line in the
1560 form var=value
1561
1562
Simon Glass718b5292021-03-18 20:25:07 +13001563
Simon Glassa7c97782022-08-07 16:33:25 -06001564.. _etype_u_boot_expanded:
1565
Simon Glass718b5292021-03-18 20:25:07 +13001566Entry: u-boot-expanded: U-Boot flat binary broken out into its component parts
1567------------------------------------------------------------------------------
1568
1569This is a section containing the U-Boot binary and a devicetree. Using this
1570entry type automatically creates this section, with the following entries
1571in it:
1572
1573 u-boot-nodtb
1574 u-boot-dtb
1575
1576Having the devicetree separate allows binman to update it in the final
1577image, so that the entries positions are provided to the running U-Boot.
1578
1579
Simon Glass136dd352020-10-26 17:39:59 -06001580
Simon Glassa7c97782022-08-07 16:33:25 -06001581.. _etype_u_boot_img:
1582
Simon Glass7a61c6b2018-07-17 13:25:37 -06001583Entry: u-boot-img: U-Boot legacy image
1584--------------------------------------
1585
1586Properties / Entry arguments:
1587 - filename: Filename of u-boot.img (default 'u-boot.img')
1588
1589This is the U-Boot binary as a packaged image, in legacy format. It has a
1590header which allows it to be loaded at the correct address for execution.
1591
1592You should use FIT (Flat Image Tree) instead of the legacy image for new
1593applications.
1594
1595
1596
Simon Glassa7c97782022-08-07 16:33:25 -06001597.. _etype_u_boot_nodtb:
1598
Simon Glass7a61c6b2018-07-17 13:25:37 -06001599Entry: u-boot-nodtb: U-Boot flat binary without device tree appended
1600--------------------------------------------------------------------
1601
1602Properties / Entry arguments:
Simon Glass537e0062021-03-18 20:24:54 +13001603 - filename: Filename to include (default 'u-boot-nodtb.bin')
Simon Glass7a61c6b2018-07-17 13:25:37 -06001604
1605This is the U-Boot binary, containing relocation information to allow it
1606to relocate itself at runtime. It does not include a device tree blob at
Simon Glass537e0062021-03-18 20:24:54 +13001607the end of it so normally cannot work without it. You can add a u-boot-dtb
Simon Glass718b5292021-03-18 20:25:07 +13001608entry after this one, or use a u-boot entry instead, normally expands to a
1609section containing u-boot and u-boot-dtb
Simon Glass7a61c6b2018-07-17 13:25:37 -06001610
1611
1612
Simon Glassa7c97782022-08-07 16:33:25 -06001613.. _etype_u_boot_spl:
1614
Simon Glass7a61c6b2018-07-17 13:25:37 -06001615Entry: u-boot-spl: U-Boot SPL binary
1616------------------------------------
1617
1618Properties / Entry arguments:
1619 - filename: Filename of u-boot-spl.bin (default 'spl/u-boot-spl.bin')
1620
1621This is the U-Boot SPL (Secondary Program Loader) binary. This is a small
1622binary which loads before U-Boot proper, typically into on-chip SRAM. It is
1623responsible for locating, loading and jumping to U-Boot. Note that SPL is
1624not relocatable so must be loaded to the correct address in SRAM, or written
Simon Glass8425a1f2018-07-17 13:25:48 -06001625to run from the correct address if direct flash execution is possible (e.g.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001626on x86 devices).
1627
1628SPL can access binman symbols at runtime. See:
1629
1630 'Access to binman entry offsets at run time (symbols)'
1631
1632in the binman README for more information.
1633
1634The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1635binman uses that to look up symbols to write into the SPL binary.
1636
Simon Glass718b5292021-03-18 20:25:07 +13001637Note that this entry is automatically replaced with u-boot-spl-expanded
Simon Glass7098b7f2021-03-21 18:24:30 +13001638unless --no-expanded is used or the node has a 'no-expanded' property.
Simon Glass718b5292021-03-18 20:25:07 +13001639
Simon Glass7a61c6b2018-07-17 13:25:37 -06001640
1641
Simon Glassa7c97782022-08-07 16:33:25 -06001642.. _etype_u_boot_spl_bss_pad:
1643
Simon Glass7a61c6b2018-07-17 13:25:37 -06001644Entry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region
1645---------------------------------------------------------------------
1646
1647Properties / Entry arguments:
1648 None
1649
Simon Glass308939b2021-03-18 20:24:55 +13001650This holds the padding added after the SPL binary to cover the BSS (Block
1651Started by Symbol) region. This region holds the various variables used by
1652SPL. It is set to 0 by SPL when it starts up. If you want to append data to
1653the SPL image (such as a device tree file), you must pad out the BSS region
1654to avoid the data overlapping with U-Boot variables. This entry is useful in
1655that case. It automatically pads out the entry size to cover both the code,
1656data and BSS.
1657
1658The contents of this entry will a certain number of zero bytes, determined
1659by __bss_size
Simon Glass7a61c6b2018-07-17 13:25:37 -06001660
1661The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1662binman uses that to look up the BSS address.
1663
1664
1665
Simon Glassa7c97782022-08-07 16:33:25 -06001666.. _etype_u_boot_spl_dtb:
1667
Simon Glass7a61c6b2018-07-17 13:25:37 -06001668Entry: u-boot-spl-dtb: U-Boot SPL device tree
1669---------------------------------------------
1670
1671Properties / Entry arguments:
1672 - filename: Filename of u-boot.dtb (default 'spl/u-boot-spl.dtb')
1673
1674This is the SPL device tree, containing configuration information for
1675SPL. SPL needs this to know what devices are present and which drivers
1676to activate.
1677
1678
Simon Glassa7c97782022-08-07 16:33:25 -06001679
1680.. _etype_u_boot_spl_elf:
Simon Glass7a61c6b2018-07-17 13:25:37 -06001681
Simon Glassb1714232018-09-14 04:57:35 -06001682Entry: u-boot-spl-elf: U-Boot SPL ELF image
1683-------------------------------------------
1684
1685Properties / Entry arguments:
Simon Glass5dcc21d2019-07-08 13:18:45 -06001686 - filename: Filename of SPL u-boot (default 'spl/u-boot-spl')
Simon Glassb1714232018-09-14 04:57:35 -06001687
1688This is the U-Boot SPL ELF image. It does not include a device tree but can
1689be relocated to any address for execution.
1690
Simon Glass718b5292021-03-18 20:25:07 +13001691
1692
Simon Glassa7c97782022-08-07 16:33:25 -06001693.. _etype_u_boot_spl_expanded:
1694
Simon Glass718b5292021-03-18 20:25:07 +13001695Entry: u-boot-spl-expanded: U-Boot SPL flat binary broken out into its component parts
1696--------------------------------------------------------------------------------------
1697
1698Properties / Entry arguments:
1699 - spl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
1700 select)
1701
1702This is a section containing the U-Boot binary, BSS padding if needed and a
1703devicetree. Using this entry type automatically creates this section, with
1704the following entries in it:
1705
1706 u-boot-spl-nodtb
1707 u-boot-spl-bss-pad
1708 u-boot-dtb
1709
1710Having the devicetree separate allows binman to update it in the final
1711image, so that the entries positions are provided to the running U-Boot.
1712
1713This entry is selected based on the value of the 'spl-dtb' entryarg. If
1714this is non-empty (and not 'n' or '0') then this expanded entry is selected.
Simon Glassb1714232018-09-14 04:57:35 -06001715
1716
Simon Glassa7c97782022-08-07 16:33:25 -06001717
1718.. _etype_u_boot_spl_nodtb:
Simon Glass718b5292021-03-18 20:25:07 +13001719
Simon Glass7a61c6b2018-07-17 13:25:37 -06001720Entry: u-boot-spl-nodtb: SPL binary without device tree appended
1721----------------------------------------------------------------
1722
1723Properties / Entry arguments:
Simon Glass537e0062021-03-18 20:24:54 +13001724 - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin')
Simon Glass7a61c6b2018-07-17 13:25:37 -06001725
1726This is the U-Boot SPL binary, It does not include a device tree blob at
1727the end of it so may not be able to work without it, assuming SPL needs
Simon Glass537e0062021-03-18 20:24:54 +13001728a device tree to operate on your platform. You can add a u-boot-spl-dtb
Simon Glass718b5292021-03-18 20:25:07 +13001729entry after this one, or use a u-boot-spl entry instead' which normally
1730expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
1731u-boot-spl-dtb
Simon Glass7a61c6b2018-07-17 13:25:37 -06001732
Simon Glass31e04cb2021-03-18 20:24:56 +13001733SPL can access binman symbols at runtime. See:
1734
1735 'Access to binman entry offsets at run time (symbols)'
1736
1737in the binman README for more information.
1738
1739The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1740binman uses that to look up symbols to write into the SPL binary.
1741
Simon Glass7a61c6b2018-07-17 13:25:37 -06001742
1743
Simon Glassa7c97782022-08-07 16:33:25 -06001744.. _etype_u_boot_spl_with_ucode_ptr:
1745
Simon Glass7a61c6b2018-07-17 13:25:37 -06001746Entry: u-boot-spl-with-ucode-ptr: U-Boot SPL with embedded microcode pointer
1747----------------------------------------------------------------------------
1748
Simon Glass3fb4f422018-09-14 04:57:32 -06001749This is used when SPL must set up the microcode for U-Boot.
1750
Simon Glass7a61c6b2018-07-17 13:25:37 -06001751See Entry_u_boot_ucode for full details of the entries involved in this
1752process.
1753
1754
1755
Simon Glassa7c97782022-08-07 16:33:25 -06001756.. _etype_u_boot_tpl:
1757
Simon Glass8425a1f2018-07-17 13:25:48 -06001758Entry: u-boot-tpl: U-Boot TPL binary
1759------------------------------------
1760
1761Properties / Entry arguments:
1762 - filename: Filename of u-boot-tpl.bin (default 'tpl/u-boot-tpl.bin')
1763
1764This is the U-Boot TPL (Tertiary Program Loader) binary. This is a small
1765binary which loads before SPL, typically into on-chip SRAM. It is
1766responsible for locating, loading and jumping to SPL, the next-stage
1767loader. Note that SPL is not relocatable so must be loaded to the correct
1768address in SRAM, or written to run from the correct address if direct
1769flash execution is possible (e.g. on x86 devices).
1770
1771SPL can access binman symbols at runtime. See:
1772
1773 'Access to binman entry offsets at run time (symbols)'
1774
1775in the binman README for more information.
1776
1777The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1778binman uses that to look up symbols to write into the TPL binary.
1779
Simon Glass718b5292021-03-18 20:25:07 +13001780Note that this entry is automatically replaced with u-boot-tpl-expanded
Simon Glass7098b7f2021-03-21 18:24:30 +13001781unless --no-expanded is used or the node has a 'no-expanded' property.
Simon Glass718b5292021-03-18 20:25:07 +13001782
Simon Glass8425a1f2018-07-17 13:25:48 -06001783
1784
Simon Glassa7c97782022-08-07 16:33:25 -06001785.. _etype_u_boot_tpl_bss_pad:
1786
Simon Glass63f41d42021-03-18 20:24:58 +13001787Entry: u-boot-tpl-bss-pad: U-Boot TPL binary padded with a BSS region
1788---------------------------------------------------------------------
1789
1790Properties / Entry arguments:
1791 None
1792
1793This holds the padding added after the TPL binary to cover the BSS (Block
1794Started by Symbol) region. This region holds the various variables used by
1795TPL. It is set to 0 by TPL when it starts up. If you want to append data to
1796the TPL image (such as a device tree file), you must pad out the BSS region
1797to avoid the data overlapping with U-Boot variables. This entry is useful in
1798that case. It automatically pads out the entry size to cover both the code,
1799data and BSS.
1800
1801The contents of this entry will a certain number of zero bytes, determined
1802by __bss_size
1803
1804The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1805binman uses that to look up the BSS address.
1806
1807
1808
Simon Glassa7c97782022-08-07 16:33:25 -06001809.. _etype_u_boot_tpl_dtb:
1810
Simon Glass8425a1f2018-07-17 13:25:48 -06001811Entry: u-boot-tpl-dtb: U-Boot TPL device tree
1812---------------------------------------------
1813
1814Properties / Entry arguments:
1815 - filename: Filename of u-boot.dtb (default 'tpl/u-boot-tpl.dtb')
1816
1817This is the TPL device tree, containing configuration information for
1818TPL. TPL needs this to know what devices are present and which drivers
1819to activate.
1820
1821
1822
Simon Glassa7c97782022-08-07 16:33:25 -06001823.. _etype_u_boot_tpl_dtb_with_ucode:
1824
Simon Glass3fb4f422018-09-14 04:57:32 -06001825Entry: u-boot-tpl-dtb-with-ucode: U-Boot TPL with embedded microcode pointer
1826----------------------------------------------------------------------------
1827
1828This is used when TPL must set up the microcode for U-Boot.
1829
1830See Entry_u_boot_ucode for full details of the entries involved in this
1831process.
1832
1833
1834
Simon Glassa7c97782022-08-07 16:33:25 -06001835.. _etype_u_boot_tpl_elf:
1836
Simon Glassa899f712019-07-08 13:18:46 -06001837Entry: u-boot-tpl-elf: U-Boot TPL ELF image
1838-------------------------------------------
1839
1840Properties / Entry arguments:
1841 - filename: Filename of TPL u-boot (default 'tpl/u-boot-tpl')
1842
1843This is the U-Boot TPL ELF image. It does not include a device tree but can
1844be relocated to any address for execution.
1845
1846
Simon Glassa7c97782022-08-07 16:33:25 -06001847
1848.. _etype_u_boot_tpl_expanded:
Simon Glassa899f712019-07-08 13:18:46 -06001849
Simon Glass718b5292021-03-18 20:25:07 +13001850Entry: u-boot-tpl-expanded: U-Boot TPL flat binary broken out into its component parts
1851--------------------------------------------------------------------------------------
1852
1853Properties / Entry arguments:
1854 - tpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
1855 select)
1856
1857This is a section containing the U-Boot binary, BSS padding if needed and a
1858devicetree. Using this entry type automatically creates this section, with
1859the following entries in it:
1860
1861 u-boot-tpl-nodtb
1862 u-boot-tpl-bss-pad
1863 u-boot-dtb
1864
1865Having the devicetree separate allows binman to update it in the final
1866image, so that the entries positions are provided to the running U-Boot.
1867
1868This entry is selected based on the value of the 'tpl-dtb' entryarg. If
1869this is non-empty (and not 'n' or '0') then this expanded entry is selected.
1870
1871
1872
Simon Glassa7c97782022-08-07 16:33:25 -06001873.. _etype_u_boot_tpl_nodtb:
1874
Simon Glassc98de972021-03-18 20:24:57 +13001875Entry: u-boot-tpl-nodtb: TPL binary without device tree appended
1876----------------------------------------------------------------
1877
1878Properties / Entry arguments:
1879 - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin')
1880
1881This is the U-Boot TPL binary, It does not include a device tree blob at
1882the end of it so may not be able to work without it, assuming TPL needs
1883a device tree to operate on your platform. You can add a u-boot-tpl-dtb
Simon Glass718b5292021-03-18 20:25:07 +13001884entry after this one, or use a u-boot-tpl entry instead, which normally
1885expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and
1886u-boot-tpl-dtb
Simon Glassc98de972021-03-18 20:24:57 +13001887
1888TPL can access binman symbols at runtime. See:
1889
1890 'Access to binman entry offsets at run time (symbols)'
1891
1892in the binman README for more information.
1893
1894The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1895binman uses that to look up symbols to write into the TPL binary.
1896
1897
Simon Glassa7c97782022-08-07 16:33:25 -06001898
1899.. _etype_u_boot_tpl_with_ucode_ptr:
Simon Glassc98de972021-03-18 20:24:57 +13001900
Simon Glass3fb4f422018-09-14 04:57:32 -06001901Entry: u-boot-tpl-with-ucode-ptr: U-Boot TPL with embedded microcode pointer
1902----------------------------------------------------------------------------
1903
1904See Entry_u_boot_ucode for full details of the entries involved in this
1905process.
1906
1907
1908
Simon Glassa7c97782022-08-07 16:33:25 -06001909.. _etype_u_boot_ucode:
1910
Simon Glass7a61c6b2018-07-17 13:25:37 -06001911Entry: u-boot-ucode: U-Boot microcode block
1912-------------------------------------------
1913
1914Properties / Entry arguments:
1915 None
1916
1917The contents of this entry are filled in automatically by other entries
1918which must also be in the image.
1919
1920U-Boot on x86 needs a single block of microcode. This is collected from
1921the various microcode update nodes in the device tree. It is also unable
1922to read the microcode from the device tree on platforms that use FSP
1923(Firmware Support Package) binaries, because the API requires that the
1924microcode is supplied before there is any SRAM available to use (i.e.
1925the FSP sets up the SRAM / cache-as-RAM but does so in the call that
1926requires the microcode!). To keep things simple, all x86 platforms handle
1927microcode the same way in U-Boot (even non-FSP platforms). This is that
1928a table is placed at _dt_ucode_base_size containing the base address and
1929size of the microcode. This is either passed to the FSP (for FSP
1930platforms), or used to set up the microcode (for non-FSP platforms).
1931This all happens in the build system since it is the only way to get
1932the microcode into a single blob and accessible without SRAM.
1933
1934There are two cases to handle. If there is only one microcode blob in
1935the device tree, then the ucode pointer it set to point to that. This
1936entry (u-boot-ucode) is empty. If there is more than one update, then
1937this entry holds the concatenation of all updates, and the device tree
1938entry (u-boot-dtb-with-ucode) is updated to remove the microcode. This
1939last step ensures that that the microcode appears in one contiguous
1940block in the image and is not unnecessarily duplicated in the device
1941tree. It is referred to as 'collation' here.
1942
1943Entry types that have a part to play in handling microcode:
1944
1945 Entry_u_boot_with_ucode_ptr:
1946 Contains u-boot-nodtb.bin (i.e. U-Boot without the device tree).
1947 It updates it with the address and size of the microcode so that
1948 U-Boot can find it early on start-up.
1949 Entry_u_boot_dtb_with_ucode:
1950 Contains u-boot.dtb. It stores the microcode in a
1951 'self.ucode_data' property, which is then read by this class to
1952 obtain the microcode if needed. If collation is performed, it
1953 removes the microcode from the device tree.
1954 Entry_u_boot_ucode:
1955 This class. If collation is enabled it reads the microcode from
1956 the Entry_u_boot_dtb_with_ucode entry, and uses it as the
1957 contents of this entry.
1958
1959
1960
Simon Glassa7c97782022-08-07 16:33:25 -06001961.. _etype_u_boot_with_ucode_ptr:
1962
Simon Glass7a61c6b2018-07-17 13:25:37 -06001963Entry: u-boot-with-ucode-ptr: U-Boot with embedded microcode pointer
1964--------------------------------------------------------------------
1965
1966Properties / Entry arguments:
Masahiro Yamadaa7a0ca42019-12-14 13:47:26 +09001967 - filename: Filename of u-boot-nodtb.bin (default 'u-boot-nodtb.bin')
Simon Glassee21d3a2018-09-14 04:57:07 -06001968 - optional-ucode: boolean property to make microcode optional. If the
1969 u-boot.bin image does not include microcode, no error will
1970 be generated.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001971
1972See Entry_u_boot_ucode for full details of the three entries involved in
1973this process. This entry updates U-Boot with the offset and size of the
1974microcode, to allow early x86 boot code to find it without doing anything
Simon Glass537e0062021-03-18 20:24:54 +13001975complicated. Otherwise it is the same as the u-boot entry.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001976
1977
1978
Simon Glassa7c97782022-08-07 16:33:25 -06001979.. _etype_vblock:
1980
Simon Glass5c350162018-07-17 13:25:47 -06001981Entry: vblock: An entry which contains a Chromium OS verified boot block
1982------------------------------------------------------------------------
1983
1984Properties / Entry arguments:
Simon Glass17b84eb2019-05-17 22:00:53 -06001985 - content: List of phandles to entries to sign
Simon Glass5c350162018-07-17 13:25:47 -06001986 - keydir: Directory containing the public keys to use
1987 - keyblock: Name of the key file to use (inside keydir)
1988 - signprivate: Name of provide key file to use (inside keydir)
1989 - version: Version number of the vblock (typically 1)
1990 - kernelkey: Name of the kernel key to use (inside keydir)
1991 - preamble-flags: Value of the vboot preamble flags (typically 0)
1992
Simon Glass639505b2018-09-14 04:57:11 -06001993Output files:
1994 - input.<unique_name> - input file passed to futility
1995 - vblock.<unique_name> - output file generated by futility (which is
1996 used as the entry contents)
1997
Jagdish Gediya311d4842018-09-03 21:35:08 +05301998Chromium OS signs the read-write firmware and kernel, writing the signature
Simon Glass5c350162018-07-17 13:25:47 -06001999in this block. This allows U-Boot to verify that the next firmware stage
2000and kernel are genuine.
2001
2002
2003
Simon Glassa7c97782022-08-07 16:33:25 -06002004.. _etype_x86_reset16:
2005
Simon Glass0b074d62019-08-24 07:22:48 -06002006Entry: x86-reset16: x86 16-bit reset code for U-Boot
2007----------------------------------------------------
2008
2009Properties / Entry arguments:
2010 - filename: Filename of u-boot-x86-reset16.bin (default
2011 'u-boot-x86-reset16.bin')
2012
2013x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2014must be placed at a particular address. This entry holds that code. It is
2015typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2016for jumping to the x86-start16 code, which continues execution.
2017
2018For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead.
2019
2020
2021
Simon Glassa7c97782022-08-07 16:33:25 -06002022.. _etype_x86_reset16_spl:
2023
Simon Glass0b074d62019-08-24 07:22:48 -06002024Entry: x86-reset16-spl: x86 16-bit reset code for U-Boot
2025--------------------------------------------------------
2026
2027Properties / Entry arguments:
2028 - filename: Filename of u-boot-x86-reset16.bin (default
2029 'u-boot-x86-reset16.bin')
2030
2031x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2032must be placed at a particular address. This entry holds that code. It is
2033typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2034for jumping to the x86-start16 code, which continues execution.
2035
2036For 32-bit U-Boot, the 'x86_reset_spl' entry type is used instead.
2037
2038
2039
Simon Glassa7c97782022-08-07 16:33:25 -06002040.. _etype_x86_reset16_tpl:
2041
Simon Glass0b074d62019-08-24 07:22:48 -06002042Entry: x86-reset16-tpl: x86 16-bit reset code for U-Boot
2043--------------------------------------------------------
2044
2045Properties / Entry arguments:
2046 - filename: Filename of u-boot-x86-reset16.bin (default
2047 'u-boot-x86-reset16.bin')
2048
2049x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2050must be placed at a particular address. This entry holds that code. It is
2051typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2052for jumping to the x86-start16 code, which continues execution.
2053
2054For 32-bit U-Boot, the 'x86_reset_tpl' entry type is used instead.
2055
2056
Simon Glassa7c97782022-08-07 16:33:25 -06002057
2058.. _etype_x86_start16:
Simon Glass0b074d62019-08-24 07:22:48 -06002059
Simon Glass7a61c6b2018-07-17 13:25:37 -06002060Entry: x86-start16: x86 16-bit start-up code for U-Boot
2061-------------------------------------------------------
2062
2063Properties / Entry arguments:
Simon Glassabab18c2019-08-24 07:22:49 -06002064 - filename: Filename of u-boot-x86-start16.bin (default
2065 'u-boot-x86-start16.bin')
Simon Glass7a61c6b2018-07-17 13:25:37 -06002066
2067x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
Simon Glassabab18c2019-08-24 07:22:49 -06002068must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2069entry holds that code. It is typically placed at offset
2070CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2071and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2072U-Boot).
Simon Glass7a61c6b2018-07-17 13:25:37 -06002073
2074For 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead.
2075
2076
2077
Simon Glassa7c97782022-08-07 16:33:25 -06002078.. _etype_x86_start16_spl:
2079
Simon Glass7a61c6b2018-07-17 13:25:37 -06002080Entry: x86-start16-spl: x86 16-bit start-up code for SPL
2081--------------------------------------------------------
2082
2083Properties / Entry arguments:
Simon Glassabab18c2019-08-24 07:22:49 -06002084 - filename: Filename of spl/u-boot-x86-start16-spl.bin (default
2085 'spl/u-boot-x86-start16-spl.bin')
Simon Glass7a61c6b2018-07-17 13:25:37 -06002086
Simon Glassabab18c2019-08-24 07:22:49 -06002087x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2088must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2089entry holds that code. It is typically placed at offset
2090CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2091and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2092U-Boot).
Simon Glass7a61c6b2018-07-17 13:25:37 -06002093
Simon Glassabab18c2019-08-24 07:22:49 -06002094For 32-bit U-Boot, the 'x86-start16' entry type is used instead.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002095
2096
2097
Simon Glassa7c97782022-08-07 16:33:25 -06002098.. _etype_x86_start16_tpl:
2099
Simon Glassed40e962018-09-14 04:57:10 -06002100Entry: x86-start16-tpl: x86 16-bit start-up code for TPL
2101--------------------------------------------------------
2102
2103Properties / Entry arguments:
Simon Glassabab18c2019-08-24 07:22:49 -06002104 - filename: Filename of tpl/u-boot-x86-start16-tpl.bin (default
2105 'tpl/u-boot-x86-start16-tpl.bin')
Simon Glassed40e962018-09-14 04:57:10 -06002106
Simon Glassabab18c2019-08-24 07:22:49 -06002107x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2108must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2109entry holds that code. It is typically placed at offset
2110CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2111and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2112U-Boot).
Simon Glassed40e962018-09-14 04:57:10 -06002113
Simon Glassabab18c2019-08-24 07:22:49 -06002114If TPL is not being used, the 'x86-start16-spl or 'x86-start16' entry types
Simon Glassed40e962018-09-14 04:57:10 -06002115may be used instead.
2116
2117
2118