blob: 4dda34ca01f3f70a51f7ef9dc8664bdddbe2413b [file] [log] [blame]
Simon Glass5a5da7c2018-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 Glass228c9b82022-08-07 16:33:25 -060014.. _etype_atf_bl31:
15
Simon Glass96d340e2021-03-18 20:25:16 +130016Entry: atf-bl31: ARM Trusted Firmware (ATF) BL31 blob
17-----------------------------------------------------
Simon Glassdc2f81a2020-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 Glass228c9b82022-08-07 16:33:25 -060030.. _etype_atf_fip:
31
Simon Glass75989722021-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 Glass228c9b82022-08-07 16:33:25 -0600186.. _etype_blob:
187
Simon Glass96d340e2021-03-18 20:25:16 +1300188Entry: blob: Arbitrary binary blob
189----------------------------------
Simon Glass5a5da7c2018-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 Glass83d73c22018-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 Glass5a5da7c2018-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 Glassadc59ea2021-03-18 20:24:54 +1300202example the 'u-boot' entry which provides the filename 'u-boot.bin'.
Simon Glass5a5da7c2018-07-17 13:25:37 -0600203
Simon Glass83d73c22018-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.
207
Simon Glass5a5da7c2018-07-17 13:25:37 -0600208
209
Simon Glass228c9b82022-08-07 16:33:25 -0600210.. _etype_blob_dtb:
211
Simon Glass6ed45ba2018-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
Simon Glass5a5da7c2018-07-17 13:25:37 -0600219
220
Simon Glass228c9b82022-08-07 16:33:25 -0600221.. _etype_blob_ext:
222
Simon Glass96d340e2021-03-18 20:25:16 +1300223Entry: blob-ext: Externally built binary blob
224---------------------------------------------
Simon Glassce867ad2020-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 Glass4f9f1052020-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 Glassce867ad2020-07-09 18:39:36 -0600232See 'blob' for Properties / Entry arguments.
233
234
235
Simon Glass228c9b82022-08-07 16:33:25 -0600236.. _etype_blob_ext_list:
237
Simon Glasscc2c5002021-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
251
Simon Glass228c9b82022-08-07 16:33:25 -0600252.. _etype_blob_named_by_arg:
253
Simon Glassec127af2018-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 Glass3decfa32020-09-01 05:13:54 -0600259 defaults to None)
Simon Glassec127af2018-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 Glass228c9b82022-08-07 16:33:25 -0600272.. _etype_blob_phase:
273
Simon Glass06684922021-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
282
Simon Glass228c9b82022-08-07 16:33:25 -0600283.. _etype_cbfs:
284
Simon Glass96d340e2021-03-18 20:25:16 +1300285Entry: cbfs: Coreboot Filesystem (CBFS)
286---------------------------------------
Simon Glassac62fba2019-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 Glass6bc43092021-03-18 20:25:15 +1300295The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.::
Simon Glassac62fba2019-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 Glass6bc43092021-03-18 20:25:15 +1300311with the second subnode below::
Simon Glassac62fba2019-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 Glasse073d4e2019-07-08 13:18:56 -0600325 cbfs-offset = <0x100000>;
Simon Glassac62fba2019-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 Glass6bc43092021-03-18 20:25:15 +1300357 entry::
Simon Glassac62fba2019-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 Glass6bc43092021-03-18 20:25:15 +1300367 You can use your own ELF file with something like::
Simon Glassac62fba2019-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 Glasse073d4e2019-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 Glassac62fba2019-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 Glass6bc43092021-03-18 20:25:15 +1300400defining these in the binman config::
Simon Glassac62fba2019-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 Glass228c9b82022-08-07 16:33:25 -0600437.. _etype_collection:
438
Simon Glass189f2912021-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
Simon Glassd626e822022-08-13 11:40:50 -0600450The entries can generally be anywhere in the same image, even if they are in
451a different section from this entry.
452
Simon Glass189f2912021-03-21 18:24:31 +1300453
454
Simon Glass228c9b82022-08-07 16:33:25 -0600455.. _etype_cros_ec_rw:
456
Simon Glassec127af2018-07-17 13:25:39 -0600457Entry: cros-ec-rw: A blob entry which contains a Chromium OS read-write EC image
458--------------------------------------------------------------------------------
459
460Properties / Entry arguments:
461 - cros-ec-rw-path: Filename containing the EC image
462
463This entry holds a Chromium OS EC (embedded controller) image, for use in
464updating the EC on startup via software sync.
465
466
467
Simon Glass228c9b82022-08-07 16:33:25 -0600468.. _etype_fdtmap:
469
Simon Glass086cec92019-07-08 14:25:27 -0600470Entry: fdtmap: An entry which contains an FDT map
471-------------------------------------------------
472
473Properties / Entry arguments:
474 None
475
476An FDT map is just a header followed by an FDT containing a list of all the
Simon Glass12bb1a92019-07-20 12:23:51 -0600477entries in the image. The root node corresponds to the image node in the
478original FDT, and an image-name property indicates the image name in that
479original tree.
Simon Glass086cec92019-07-08 14:25:27 -0600480
481The header is the string _FDTMAP_ followed by 8 unused bytes.
482
483When used, this entry will be populated with an FDT map which reflects the
484entries in the current image. Hierarchy is preserved, and all offsets and
485sizes are included.
486
487Note that the -u option must be provided to ensure that binman updates the
488FDT with the position of each entry.
489
Simon Glass6bc43092021-03-18 20:25:15 +1300490Example output for a simple image with U-Boot and an FDT map::
Simon Glass086cec92019-07-08 14:25:27 -0600491
Simon Glass6bc43092021-03-18 20:25:15 +1300492 / {
493 image-name = "binman";
494 size = <0x00000112>;
Simon Glass086cec92019-07-08 14:25:27 -0600495 image-pos = <0x00000000>;
496 offset = <0x00000000>;
Simon Glass6bc43092021-03-18 20:25:15 +1300497 u-boot {
498 size = <0x00000004>;
499 image-pos = <0x00000000>;
500 offset = <0x00000000>;
501 };
502 fdtmap {
503 size = <0x0000010e>;
504 image-pos = <0x00000004>;
505 offset = <0x00000004>;
506 };
Simon Glass086cec92019-07-08 14:25:27 -0600507 };
Simon Glass086cec92019-07-08 14:25:27 -0600508
Simon Glass12bb1a92019-07-20 12:23:51 -0600509If allow-repack is used then 'orig-offset' and 'orig-size' properties are
510added as necessary. See the binman README.
511
Simon Glass943bf782021-11-23 21:09:50 -0700512When extracting files, an alternative 'fdt' format is available for fdtmaps.
513Use `binman extract -F fdt ...` to use this. It will export a devicetree,
514without the fdtmap header, so it can be viewed with `fdtdump`.
515
Simon Glass086cec92019-07-08 14:25:27 -0600516
517
Simon Glass228c9b82022-08-07 16:33:25 -0600518.. _etype_files:
519
Simon Glass96d340e2021-03-18 20:25:16 +1300520Entry: files: A set of files arranged in a section
521--------------------------------------------------
Simon Glass0a98b282018-09-14 04:57:28 -0600522
523Properties / Entry arguments:
524 - pattern: Filename pattern to match the files to include
Simon Glass9248c8d2020-10-26 17:40:07 -0600525 - files-compress: Compression algorithm to use:
Simon Glass0a98b282018-09-14 04:57:28 -0600526 none: No compression
527 lz4: Use lz4 compression (via 'lz4' command-line utility)
Simon Glass4ce40772021-03-18 20:24:53 +1300528 - files-align: Align each file to the given alignment
Simon Glass0a98b282018-09-14 04:57:28 -0600529
530This entry reads a number of files and places each in a separate sub-entry
531within this entry. To access these you need to enable device-tree updates
532at run-time so you can obtain the file positions.
533
534
535
Simon Glass228c9b82022-08-07 16:33:25 -0600536.. _etype_fill:
537
Simon Glass3af8e492018-07-17 13:25:40 -0600538Entry: fill: An entry which is filled to a particular byte value
539----------------------------------------------------------------
540
541Properties / Entry arguments:
542 - fill-byte: Byte to use to fill the entry
543
544Note that the size property must be set since otherwise this entry does not
545know how large it should be.
546
547You can often achieve the same effect using the pad-byte property of the
548overall image, in that the space between entries will then be padded with
549that byte. But this entry is sometimes useful for explicitly setting the
550byte value of a region.
551
552
553
Simon Glass228c9b82022-08-07 16:33:25 -0600554.. _etype_fit:
555
Simon Glass96d340e2021-03-18 20:25:16 +1300556Entry: fit: Flat Image Tree (FIT)
557---------------------------------
Simon Glassfdc34362020-07-09 18:39:45 -0600558
559This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the
560input provided.
561
562Nodes for the FIT should be written out in the binman configuration just as
563they would be in a file passed to mkimage.
564
Simon Glass6bc43092021-03-18 20:25:15 +1300565For example, this creates an image containing a FIT with U-Boot SPL::
Simon Glassfdc34362020-07-09 18:39:45 -0600566
567 binman {
568 fit {
569 description = "Test FIT";
Simon Glass6cf99532020-09-01 05:13:59 -0600570 fit,fdt-list = "of-list";
Simon Glassfdc34362020-07-09 18:39:45 -0600571
572 images {
573 kernel@1 {
574 description = "SPL";
575 os = "u-boot";
576 type = "rkspi";
577 arch = "arm";
578 compression = "none";
579 load = <0>;
580 entry = <0>;
581
582 u-boot-spl {
583 };
584 };
585 };
586 };
587 };
588
Simon Glass6a0b5f82022-02-08 11:50:03 -0700589More complex setups can be created, with generated nodes, as described
590below.
591
592Properties (in the 'fit' node itself)
593~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
594
595Special properties have a `fit,` prefix, indicating that they should be
596processed but not included in the final FIT.
597
598The top-level 'fit' node supports the following special properties:
599
600 fit,external-offset
601 Indicates that the contents of the FIT are external and provides the
602 external offset. This is passed to mkimage via the -E and -p flags.
603
604 fit,fdt-list
605 Indicates the entry argument which provides the list of device tree
606 files for the gen-fdt-nodes operation (as below). This is often
607 `of-list` meaning that `-a of-list="dtb1 dtb2..."` should be passed
608 to binman.
609
610Substitutions
611~~~~~~~~~~~~~
612
613Node names and property values support a basic string-substitution feature.
614Available substitutions for '@' nodes (and property values) are:
615
616SEQ:
617 Sequence number of the generated fdt (1, 2, ...)
618NAME
619 Name of the dtb as provided (i.e. without adding '.dtb')
620
621The `default` property, if present, will be automatically set to the name
622if of configuration whose devicetree matches the `default-dt` entry
623argument, e.g. with `-a default-dt=sun50i-a64-pine64-lts`.
624
625Available substitutions for property values in these nodes are:
626
627DEFAULT-SEQ:
628 Sequence number of the default fdt, as provided by the 'default-dt'
629 entry argument
630
631Available operations
632~~~~~~~~~~~~~~~~~~~~
633
634You can add an operation to an '@' node to indicate which operation is
635required::
636
637 @fdt-SEQ {
638 fit,operation = "gen-fdt-nodes";
639 ...
640 };
641
642Available operations are:
643
644gen-fdt-nodes
645 Generate FDT nodes as above. This is the default if there is no
646 `fit,operation` property.
647
Simon Glass40c8bdd2022-03-05 20:19:12 -0700648split-elf
649 Split an ELF file into a separate node for each segment.
650
Simon Glass6a0b5f82022-02-08 11:50:03 -0700651Generating nodes from an FDT list (gen-fdt-nodes)
652~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
653
Simon Glass6cf99532020-09-01 05:13:59 -0600654U-Boot supports creating fdt and config nodes automatically. To do this,
Simon Glass98e0de32022-02-08 11:50:02 -0700655pass an `of-list` property (e.g. `-a of-list=file1 file2`). This tells
656binman that you want to generates nodes for two files: `file1.dtb` and
657`file2.dtb`. The `fit,fdt-list` property (see above) indicates that
658`of-list` should be used. If the property is missing you will get an error.
Simon Glass6cf99532020-09-01 05:13:59 -0600659
Simon Glass6bc43092021-03-18 20:25:15 +1300660Then add a 'generator node', a node with a name starting with '@'::
Simon Glass6cf99532020-09-01 05:13:59 -0600661
662 images {
663 @fdt-SEQ {
664 description = "fdt-NAME";
665 type = "flat_dt";
666 compression = "none";
667 };
668 };
669
Simon Glass98e0de32022-02-08 11:50:02 -0700670This tells binman to create nodes `fdt-1` and `fdt-2` for each of your two
Simon Glass6cf99532020-09-01 05:13:59 -0600671files. All the properties you specify will be included in the node. This
672node acts like a template to generate the nodes. The generator node itself
673does not appear in the output - it is replaced with what binman generates.
Simon Glass98e0de32022-02-08 11:50:02 -0700674A 'data' property is created with the contents of the FDT file.
Simon Glass6cf99532020-09-01 05:13:59 -0600675
Simon Glass6bc43092021-03-18 20:25:15 +1300676You can create config nodes in a similar way::
Simon Glass6cf99532020-09-01 05:13:59 -0600677
678 configurations {
679 default = "@config-DEFAULT-SEQ";
680 @config-SEQ {
681 description = "NAME";
Samuel Holland68158d52020-10-21 21:12:14 -0500682 firmware = "atf";
683 loadables = "uboot";
Simon Glass6cf99532020-09-01 05:13:59 -0600684 fdt = "fdt-SEQ";
685 };
686 };
687
Simon Glass98e0de32022-02-08 11:50:02 -0700688This tells binman to create nodes `config-1` and `config-2`, i.e. a config
689for each of your two files.
Simon Glass6cf99532020-09-01 05:13:59 -0600690
Simon Glass6cf99532020-09-01 05:13:59 -0600691Note that if no devicetree files are provided (with '-a of-list' as above)
692then no nodes will be generated.
693
Simon Glass40c8bdd2022-03-05 20:19:12 -0700694Generating nodes from an ELF file (split-elf)
695~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
696
697This uses the node as a template to generate multiple nodes. The following
698special properties are available:
699
700split-elf
701 Split an ELF file into a separate node for each segment. This uses the
702 node as a template to generate multiple nodes. The following special
703 properties are available:
704
705 fit,load
706 Generates a `load = <...>` property with the load address of the
707 segment
708
709 fit,entry
710 Generates a `entry = <...>` property with the entry address of the
711 ELF. This is only produced for the first entry
712
713 fit,data
714 Generates a `data = <...>` property with the contents of the segment
715
716 fit,loadables
717 Generates a `loadable = <...>` property with a list of the generated
718 nodes (including all nodes if this operation is used multiple times)
719
720
721Here is an example showing ATF, TEE and a device tree all combined::
722
723 fit {
724 description = "test-desc";
725 #address-cells = <1>;
726 fit,fdt-list = "of-list";
727
728 images {
729 u-boot {
730 description = "U-Boot (64-bit)";
731 type = "standalone";
732 os = "U-Boot";
733 arch = "arm64";
734 compression = "none";
735 load = <CONFIG_SYS_TEXT_BASE>;
736 u-boot-nodtb {
737 };
738 };
739 @fdt-SEQ {
740 description = "fdt-NAME.dtb";
741 type = "flat_dt";
742 compression = "none";
743 };
744 @atf-SEQ {
745 fit,operation = "split-elf";
746 description = "ARM Trusted Firmware";
747 type = "firmware";
748 arch = "arm64";
749 os = "arm-trusted-firmware";
750 compression = "none";
751 fit,load;
752 fit,entry;
753 fit,data;
754
755 atf-bl31 {
756 };
757 };
758
759 @tee-SEQ {
760 fit,operation = "split-elf";
761 description = "TEE";
762 type = "tee";
763 arch = "arm64";
764 os = "tee";
765 compression = "none";
766 fit,load;
767 fit,entry;
768 fit,data;
769
770 tee-os {
771 };
772 };
773 };
774
775 configurations {
776 default = "@config-DEFAULT-SEQ";
777 @config-SEQ {
778 description = "conf-NAME.dtb";
779 fdt = "fdt-SEQ";
780 firmware = "u-boot";
781 fit,loadables;
782 };
783 };
784 };
785
786If ATF-BL31 is available, this generates a node for each segment in the
787ELF file, for example::
788
789 images {
790 atf-1 {
791 data = <...contents of first segment...>;
792 data-offset = <0x00000000>;
793 entry = <0x00040000>;
794 load = <0x00040000>;
795 compression = "none";
796 os = "arm-trusted-firmware";
797 arch = "arm64";
798 type = "firmware";
799 description = "ARM Trusted Firmware";
800 };
801 atf-2 {
802 data = <...contents of second segment...>;
803 load = <0xff3b0000>;
804 compression = "none";
805 os = "arm-trusted-firmware";
806 arch = "arm64";
807 type = "firmware";
808 description = "ARM Trusted Firmware";
809 };
810 };
811
812The same applies for OP-TEE if that is available.
813
814If each binary is not available, the relevant template node (@atf-SEQ or
815@tee-SEQ) is removed from the output.
816
817This also generates a `config-xxx` node for each device tree in `of-list`.
818Note that the U-Boot build system uses `-a of-list=$(CONFIG_OF_LIST)`
819so you can use `CONFIG_OF_LIST` to define that list. In this example it is
820set up for `firefly-rk3399` with a single device tree and the default set
821with `-a default-dt=$(CONFIG_DEFAULT_DEVICE_TREE)`, so the resulting output
822is::
823
824 configurations {
825 default = "config-1";
826 config-1 {
827 loadables = "atf-1", "atf-2", "atf-3", "tee-1", "tee-2";
828 description = "rk3399-firefly.dtb";
829 fdt = "fdt-1";
830 firmware = "u-boot";
831 };
832 };
833
834U-Boot SPL can then load the firmware (U-Boot proper) and all the loadables
835(ATF and TEE), then proceed with the boot.
836
Simon Glassfdc34362020-07-09 18:39:45 -0600837
838
Simon Glass228c9b82022-08-07 16:33:25 -0600839.. _etype_fmap:
840
Simon Glass11e36cc2018-07-17 13:25:38 -0600841Entry: fmap: An entry which contains an Fmap section
842----------------------------------------------------
843
844Properties / Entry arguments:
845 None
846
847FMAP is a simple format used by flashrom, an open-source utility for
848reading and writing the SPI flash, typically on x86 CPUs. The format
849provides flashrom with a list of areas, so it knows what it in the flash.
850It can then read or write just a single area, instead of the whole flash.
851
852The format is defined by the flashrom project, in the file lib/fmap.h -
853see www.flashrom.org/Flashrom for more information.
854
855When used, this entry will be populated with an FMAP which reflects the
856entries in the current image. Note that any hierarchy is squashed, since
Simon Glass17365752021-04-03 11:05:10 +1300857FMAP does not support this. Sections are represented as an area appearing
858before its contents, so that it is possible to reconstruct the hierarchy
859from the FMAP by using the offset information. This convention does not
860seem to be documented, but is used in Chromium OS.
861
862CBFS entries appear as a single entry, i.e. the sub-entries are ignored.
Simon Glass11e36cc2018-07-17 13:25:38 -0600863
864
865
Simon Glass228c9b82022-08-07 16:33:25 -0600866.. _etype_gbb:
867
Simon Glass0ef87aa2018-07-17 13:25:44 -0600868Entry: gbb: An entry which contains a Chromium OS Google Binary Block
869---------------------------------------------------------------------
870
871Properties / Entry arguments:
872 - hardware-id: Hardware ID to use for this build (a string)
873 - keydir: Directory containing the public keys to use
874 - bmpblk: Filename containing images used by recovery
875
876Chromium OS uses a GBB to store various pieces of information, in particular
877the root and recovery keys that are used to verify the boot process. Some
878more details are here:
879
880 https://www.chromium.org/chromium-os/firmware-porting-guide/2-concepts
881
882but note that the page dates from 2013 so is quite out of date. See
883README.chromium for how to obtain the required keys and tools.
884
885
886
Simon Glass228c9b82022-08-07 16:33:25 -0600887.. _etype_image_header:
888
Simon Glasscf228942019-07-08 14:25:28 -0600889Entry: image-header: An entry which contains a pointer to the FDT map
890---------------------------------------------------------------------
891
892Properties / Entry arguments:
893 location: Location of header ("start" or "end" of image). This is
894 optional. If omitted then the entry must have an offset property.
895
896This adds an 8-byte entry to the start or end of the image, pointing to the
897location of the FDT map. The format is a magic number followed by an offset
898from the start or end of the image, in twos-compliment format.
899
900This entry must be in the top-level part of the image.
901
902NOTE: If the location is at the start/end, you will probably need to specify
903sort-by-offset for the image, unless you actually put the image header
904first/last in the entry list.
905
906
907
Simon Glass228c9b82022-08-07 16:33:25 -0600908.. _etype_intel_cmc:
909
Simon Glass96d340e2021-03-18 20:25:16 +1300910Entry: intel-cmc: Intel Chipset Micro Code (CMC) file
911-----------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -0600912
913Properties / Entry arguments:
914 - filename: Filename of file to read into entry
915
916This file contains microcode for some devices in a special format. An
917example filename is 'Microcode/C0_22211.BIN'.
918
919See README.x86 for information about x86 binary blobs.
920
921
922
Simon Glass228c9b82022-08-07 16:33:25 -0600923.. _etype_intel_descriptor:
924
Simon Glass5a5da7c2018-07-17 13:25:37 -0600925Entry: intel-descriptor: Intel flash descriptor block (4KB)
926-----------------------------------------------------------
927
928Properties / Entry arguments:
929 filename: Filename of file containing the descriptor. This is typically
930 a 4KB binary file, sometimes called 'descriptor.bin'
931
932This entry is placed at the start of flash and provides information about
933the SPI flash regions. In particular it provides the base address and
934size of the ME (Management Engine) region, allowing us to place the ME
935binary in the right place.
936
937With this entry in your image, the position of the 'intel-me' entry will be
938fixed in the image, which avoids you needed to specify an offset for that
939region. This is useful, because it is not possible to change the position
940of the ME region without updating the descriptor.
941
942See README.x86 for information about x86 binary blobs.
943
944
945
Simon Glass228c9b82022-08-07 16:33:25 -0600946.. _etype_intel_fit:
947
Simon Glass5af12072019-08-24 07:22:50 -0600948Entry: intel-fit: Intel Firmware Image Table (FIT)
949--------------------------------------------------
950
951This entry contains a dummy FIT as required by recent Intel CPUs. The FIT
952contains information about the firmware and microcode available in the
953image.
954
955At present binman only supports a basic FIT with no microcode.
956
957
958
Simon Glass228c9b82022-08-07 16:33:25 -0600959.. _etype_intel_fit_ptr:
960
Simon Glass5af12072019-08-24 07:22:50 -0600961Entry: intel-fit-ptr: Intel Firmware Image Table (FIT) pointer
962--------------------------------------------------------------
963
964This entry contains a pointer to the FIT. It is required to be at address
9650xffffffc0 in the image.
966
967
968
Simon Glass228c9b82022-08-07 16:33:25 -0600969.. _etype_intel_fsp:
970
Simon Glass96d340e2021-03-18 20:25:16 +1300971Entry: intel-fsp: Intel Firmware Support Package (FSP) file
972-----------------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -0600973
974Properties / Entry arguments:
975 - filename: Filename of file to read into entry
976
977This file contains binary blobs which are used on some devices to make the
978platform work. U-Boot executes this code since it is not possible to set up
979the hardware using U-Boot open-source code. Documentation is typically not
980available in sufficient detail to allow this.
981
982An example filename is 'FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd'
983
984See README.x86 for information about x86 binary blobs.
985
986
987
Simon Glass228c9b82022-08-07 16:33:25 -0600988.. _etype_intel_fsp_m:
989
Simon Glass96d340e2021-03-18 20:25:16 +1300990Entry: intel-fsp-m: Intel Firmware Support Package (FSP) memory init
991--------------------------------------------------------------------
Simon Glassea0fff92019-08-24 07:23:07 -0600992
993Properties / Entry arguments:
994 - filename: Filename of file to read into entry
995
996This file contains a binary blob which is used on some devices to set up
997SDRAM. U-Boot executes this code in SPL so that it can make full use of
998memory. Documentation is typically not available in sufficient detail to
999allow U-Boot do this this itself..
1000
1001An example filename is 'fsp_m.bin'
1002
1003See README.x86 for information about x86 binary blobs.
1004
1005
1006
Simon Glass228c9b82022-08-07 16:33:25 -06001007.. _etype_intel_fsp_s:
1008
Simon Glass96d340e2021-03-18 20:25:16 +13001009Entry: intel-fsp-s: Intel Firmware Support Package (FSP) silicon init
1010---------------------------------------------------------------------
Simon Glassbc6a88f2019-10-20 21:31:35 -06001011
1012Properties / Entry arguments:
1013 - filename: Filename of file to read into entry
1014
1015This file contains a binary blob which is used on some devices to set up
1016the silicon. U-Boot executes this code in U-Boot proper after SDRAM is
1017running, so that it can make full use of memory. Documentation is typically
1018not available in sufficient detail to allow U-Boot do this this itself.
1019
1020An example filename is 'fsp_s.bin'
1021
1022See README.x86 for information about x86 binary blobs.
1023
1024
1025
Simon Glass228c9b82022-08-07 16:33:25 -06001026.. _etype_intel_fsp_t:
1027
Simon Glass96d340e2021-03-18 20:25:16 +13001028Entry: intel-fsp-t: Intel Firmware Support Package (FSP) temp ram init
1029----------------------------------------------------------------------
Simon Glass998d1482019-10-20 21:31:36 -06001030
1031Properties / Entry arguments:
1032 - filename: Filename of file to read into entry
1033
1034This file contains a binary blob which is used on some devices to set up
1035temporary memory (Cache-as-RAM or CAR). U-Boot executes this code in TPL so
1036that it has access to memory for its stack and initial storage.
1037
1038An example filename is 'fsp_t.bin'
1039
1040See README.x86 for information about x86 binary blobs.
1041
1042
1043
Simon Glass228c9b82022-08-07 16:33:25 -06001044.. _etype_intel_ifwi:
1045
Simon Glass96d340e2021-03-18 20:25:16 +13001046Entry: intel-ifwi: Intel Integrated Firmware Image (IFWI) file
1047--------------------------------------------------------------
Simon Glasse073d4e2019-07-08 13:18:56 -06001048
1049Properties / Entry arguments:
1050 - filename: Filename of file to read into entry. This is either the
1051 IFWI file itself, or a file that can be converted into one using a
1052 tool
1053 - convert-fit: If present this indicates that the ifwitool should be
1054 used to convert the provided file into a IFWI.
1055
1056This file contains code and data used by the SoC that is required to make
1057it work. It includes U-Boot TPL, microcode, things related to the CSE
1058(Converged Security Engine, the microcontroller that loads all the firmware)
1059and other items beyond the wit of man.
1060
1061A typical filename is 'ifwi.bin' for an IFWI file, or 'fitimage.bin' for a
1062file that will be converted to an IFWI.
1063
1064The position of this entry is generally set by the intel-descriptor entry.
1065
1066The contents of the IFWI are specified by the subnodes of the IFWI node.
1067Each subnode describes an entry which is placed into the IFWFI with a given
1068sub-partition (and optional entry name).
1069
Simon Glass3da9ce82019-08-24 07:22:47 -06001070Properties for subnodes:
Simon Glass6bc43092021-03-18 20:25:15 +13001071 - ifwi-subpart: sub-parition to put this entry into, e.g. "IBBP"
1072 - ifwi-entry: entry name t use, e.g. "IBBL"
1073 - ifwi-replace: if present, indicates that the item should be replaced
1074 in the IFWI. Otherwise it is added.
Simon Glass3da9ce82019-08-24 07:22:47 -06001075
Simon Glasse073d4e2019-07-08 13:18:56 -06001076See README.x86 for information about x86 binary blobs.
1077
1078
1079
Simon Glass228c9b82022-08-07 16:33:25 -06001080.. _etype_intel_me:
1081
Simon Glass96d340e2021-03-18 20:25:16 +13001082Entry: intel-me: Intel Management Engine (ME) file
1083--------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -06001084
1085Properties / Entry arguments:
1086 - filename: Filename of file to read into entry
1087
1088This file contains code used by the SoC that is required to make it work.
1089The Management Engine is like a background task that runs things that are
Thomas Hebb32f2ca22019-11-13 18:18:03 -08001090not clearly documented, but may include keyboard, display and network
Simon Glass5a5da7c2018-07-17 13:25:37 -06001091access. For platform that use ME it is not possible to disable it. U-Boot
1092does not directly execute code in the ME binary.
1093
1094A typical filename is 'me.bin'.
1095
Simon Glassfa1c9372019-07-08 13:18:38 -06001096The position of this entry is generally set by the intel-descriptor entry.
1097
Simon Glass5a5da7c2018-07-17 13:25:37 -06001098See README.x86 for information about x86 binary blobs.
1099
1100
1101
Simon Glass228c9b82022-08-07 16:33:25 -06001102.. _etype_intel_mrc:
1103
Simon Glass96d340e2021-03-18 20:25:16 +13001104Entry: intel-mrc: Intel Memory Reference Code (MRC) file
1105--------------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -06001106
1107Properties / Entry arguments:
1108 - filename: Filename of file to read into entry
1109
1110This file contains code for setting up the SDRAM on some Intel systems. This
1111is executed by U-Boot when needed early during startup. A typical filename
1112is 'mrc.bin'.
1113
1114See README.x86 for information about x86 binary blobs.
1115
1116
1117
Simon Glass228c9b82022-08-07 16:33:25 -06001118.. _etype_intel_refcode:
1119
Simon Glass96d340e2021-03-18 20:25:16 +13001120Entry: intel-refcode: Intel Reference Code file
1121-----------------------------------------------
Simon Glass5385f5a2019-05-17 22:00:53 -06001122
1123Properties / Entry arguments:
1124 - filename: Filename of file to read into entry
1125
1126This file contains code for setting up the platform on some Intel systems.
1127This is executed by U-Boot when needed early during startup. A typical
1128filename is 'refcode.bin'.
1129
1130See README.x86 for information about x86 binary blobs.
1131
1132
1133
Simon Glass228c9b82022-08-07 16:33:25 -06001134.. _etype_intel_vbt:
1135
Simon Glass96d340e2021-03-18 20:25:16 +13001136Entry: intel-vbt: Intel Video BIOS Table (VBT) file
1137---------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -06001138
1139Properties / Entry arguments:
1140 - filename: Filename of file to read into entry
1141
1142This file contains code that sets up the integrated graphics subsystem on
1143some Intel SoCs. U-Boot executes this when the display is started up.
1144
1145See README.x86 for information about Intel binary blobs.
1146
1147
1148
Simon Glass228c9b82022-08-07 16:33:25 -06001149.. _etype_intel_vga:
1150
Simon Glass96d340e2021-03-18 20:25:16 +13001151Entry: intel-vga: Intel Video Graphics Adaptor (VGA) file
1152---------------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -06001153
1154Properties / Entry arguments:
1155 - filename: Filename of file to read into entry
1156
1157This file contains code that sets up the integrated graphics subsystem on
1158some Intel SoCs. U-Boot executes this when the display is started up.
1159
1160This is similar to the VBT file but in a different format.
1161
1162See README.x86 for information about Intel binary blobs.
1163
1164
1165
Simon Glass228c9b82022-08-07 16:33:25 -06001166.. _etype_mkimage:
1167
Simon Glass96d340e2021-03-18 20:25:16 +13001168Entry: mkimage: Binary produced by mkimage
1169------------------------------------------
Simon Glass0dc706f2020-07-09 18:39:31 -06001170
1171Properties / Entry arguments:
Simon Glasse9b5e312022-08-13 11:40:47 -06001172 - args: Arguments to pass
Simon Glassdfe1db42022-08-13 11:40:48 -06001173 - data-to-imagename: Indicates that the -d data should be passed in as
1174 the image name also (-n)
Simon Glass0dc706f2020-07-09 18:39:31 -06001175
Simon Glasse9b5e312022-08-13 11:40:47 -06001176The data passed to mkimage via the -d flag is collected from subnodes of the
1177mkimage node, e.g.::
Simon Glass0dc706f2020-07-09 18:39:31 -06001178
1179 mkimage {
1180 args = "-n test -T imximage";
1181
1182 u-boot-spl {
1183 };
1184 };
1185
Simon Glasse9b5e312022-08-13 11:40:47 -06001186This calls mkimage to create an imximage with `u-boot-spl.bin` as the data
1187file, which mkimage being called like this::
1188
1189 mkimage -d <data_file> -n test -T imximage <output_file>
1190
1191The output from mkimage then becomes part of the image produced by
1192binman. If you need to put mulitple things in the data file, you can use
1193a section, or just multiple subnodes like this::
1194
1195 mkimage {
1196 args = "-n test -T imximage";
1197
1198 u-boot-spl {
1199 };
1200
1201 u-boot-tpl {
1202 };
1203 };
Simon Glass0dc706f2020-07-09 18:39:31 -06001204
Simon Glass5c044ff2022-02-08 11:49:58 -07001205To use CONFIG options in the arguments, use a string list instead, as in
1206this example which also produces four arguments::
1207
1208 mkimage {
1209 args = "-n", CONFIG_SYS_SOC, "-T imximage";
1210
1211 u-boot-spl {
1212 };
1213 };
1214
Simon Glassdfe1db42022-08-13 11:40:48 -06001215If you need to pass the input data in with the -n argument as well, then use
1216the 'data-to-imagename' property::
1217
1218 mkimage {
1219 args = "-T imximage";
1220 data-to-imagename';
1221
1222 u-boot-spl {
1223 };
1224 };
1225
1226That will pass the data to mkimage both as the data file (with -d) and as
1227the image name (with -n).
Simon Glass5c044ff2022-02-08 11:49:58 -07001228
Simon Glass0dc706f2020-07-09 18:39:31 -06001229
Simon Glass9db9e932022-08-13 11:40:49 -06001230If need to pass different data in with -n, then use an imagename subnode::
1231
1232 mkimage {
1233 args = "-T imximage";
1234
1235 imagename {
1236 blob {
1237 filename = "spl/u-boot-spl.cfgout"
1238 };
1239 };
1240
1241 u-boot-spl {
1242 };
1243 };
1244
1245This will pass in u-boot-spl as the input data and the .cfgout file as the
1246-n data.
1247
Simon Glass0dc706f2020-07-09 18:39:31 -06001248
Simon Glass228c9b82022-08-07 16:33:25 -06001249.. _etype_opensbi:
1250
Bin Meng4c4d6072021-05-10 20:23:33 +08001251Entry: opensbi: RISC-V OpenSBI fw_dynamic blob
1252----------------------------------------------
1253
1254Properties / Entry arguments:
1255 - opensbi-path: Filename of file to read into entry. This is typically
1256 called fw_dynamic.bin
1257
1258This entry holds the run-time firmware, typically started by U-Boot SPL.
1259See the U-Boot README for your architecture or board for how to use it. See
1260https://github.com/riscv/opensbi for more information about OpenSBI.
1261
1262
1263
Simon Glass228c9b82022-08-07 16:33:25 -06001264.. _etype_powerpc_mpc85xx_bootpg_resetvec:
1265
Jagdish Gediya9d368f32018-09-03 21:35:08 +05301266Entry: powerpc-mpc85xx-bootpg-resetvec: PowerPC mpc85xx bootpg + resetvec code for U-Boot
1267-----------------------------------------------------------------------------------------
1268
1269Properties / Entry arguments:
1270 - filename: Filename of u-boot-br.bin (default 'u-boot-br.bin')
1271
Thomas Hebb32f2ca22019-11-13 18:18:03 -08001272This entry is valid for PowerPC mpc85xx cpus. This entry holds
Jagdish Gediya9d368f32018-09-03 21:35:08 +05301273'bootpg + resetvec' code for PowerPC mpc85xx CPUs which needs to be
1274placed at offset 'RESET_VECTOR_ADDRESS - 0xffc'.
1275
1276
1277
Simon Glass228c9b82022-08-07 16:33:25 -06001278.. _etype_pre_load:
1279
Philippe Reynesb1c50932022-03-28 22:57:04 +02001280Entry: pre-load: Pre load image header
1281--------------------------------------
1282
1283Properties / Entry arguments:
Simon Glass24474dc2022-08-13 11:40:43 -06001284 - pre-load-key-path: Path of the directory that store key (provided by
1285 the environment variable PRE_LOAD_KEY_PATH)
Philippe Reynesb1c50932022-03-28 22:57:04 +02001286 - content: List of phandles to entries to sign
1287 - algo-name: Hash and signature algo to use for the signature
1288 - padding-name: Name of the padding (pkcs-1.5 or pss)
1289 - key-name: Filename of the private key to sign
1290 - header-size: Total size of the header
1291 - version: Version of the header
1292
1293This entry creates a pre-load header that contains a global
1294image signature.
1295
1296For example, this creates an image with a pre-load header and a binary::
1297
1298 binman {
1299 image2 {
1300 filename = "sandbox.bin";
1301
1302 pre-load {
1303 content = <&image>;
1304 algo-name = "sha256,rsa2048";
1305 padding-name = "pss";
1306 key-name = "private.pem";
1307 header-size = <4096>;
1308 version = <1>;
1309 };
1310
1311 image: blob-ext {
1312 filename = "sandbox.itb";
1313 };
1314 };
1315 };
1316
1317
1318
Simon Glass228c9b82022-08-07 16:33:25 -06001319.. _etype_scp:
1320
Simon Glass96d340e2021-03-18 20:25:16 +13001321Entry: scp: System Control Processor (SCP) firmware blob
1322--------------------------------------------------------
Simon Glassf3243302020-10-26 17:39:59 -06001323
1324Properties / Entry arguments:
1325 - scp-path: Filename of file to read into the entry, typically scp.bin
1326
1327This entry holds firmware for an external platform-specific coprocessor.
1328
1329
1330
Simon Glass228c9b82022-08-07 16:33:25 -06001331.. _etype_section:
1332
Simon Glass5a5da7c2018-07-17 13:25:37 -06001333Entry: section: Entry that contains other entries
1334-------------------------------------------------
1335
Simon Glass3f495f12021-11-23 11:03:49 -07001336A section is an entry which can contain other entries, thus allowing
1337hierarchical images to be created. See 'Sections and hierarchical images'
1338in the binman README for more information.
Simon Glass6bc43092021-03-18 20:25:15 +13001339
Simon Glass3f495f12021-11-23 11:03:49 -07001340The base implementation simply joins the various entries together, using
1341various rules about alignment, etc.
Simon Glass6bc43092021-03-18 20:25:15 +13001342
Simon Glass3f495f12021-11-23 11:03:49 -07001343Subclassing
1344~~~~~~~~~~~
Simon Glass5a5da7c2018-07-17 13:25:37 -06001345
Simon Glass3f495f12021-11-23 11:03:49 -07001346This class can be subclassed to support other file formats which hold
1347multiple entries, such as CBFS. To do this, override the following
1348functions. The documentation here describes what your function should do.
1349For example code, see etypes which subclass `Entry_section`, or `cbfs.py`
1350for a more involved example::
Simon Glass3decfa32020-09-01 05:13:54 -06001351
Simon Glass3f495f12021-11-23 11:03:49 -07001352 $ grep -l \(Entry_section tools/binman/etype/*.py
1353
1354ReadNode()
1355 Call `super().ReadNode()`, then read any special properties for the
1356 section. Then call `self.ReadEntries()` to read the entries.
1357
1358 Binman calls this at the start when reading the image description.
1359
1360ReadEntries()
1361 Read in the subnodes of the section. This may involve creating entries
1362 of a particular etype automatically, as well as reading any special
1363 properties in the entries. For each entry, entry.ReadNode() should be
1364 called, to read the basic entry properties. The properties should be
1365 added to `self._entries[]`, in the correct order, with a suitable name.
1366
1367 Binman calls this at the start when reading the image description.
1368
1369BuildSectionData(required)
1370 Create the custom file format that you want and return it as bytes.
1371 This likely sets up a file header, then loops through the entries,
1372 adding them to the file. For each entry, call `entry.GetData()` to
1373 obtain the data. If that returns None, and `required` is False, then
1374 this method must give up and return None. But if `required` is True then
1375 it should assume that all data is valid.
1376
1377 Binman calls this when packing the image, to find out the size of
1378 everything. It is called again at the end when building the final image.
1379
1380SetImagePos(image_pos):
1381 Call `super().SetImagePos(image_pos)`, then set the `image_pos` values
1382 for each of the entries. This should use the custom file format to find
1383 the `start offset` (and `image_pos`) of each entry. If the file format
1384 uses compression in such a way that there is no offset available (other
1385 than reading the whole file and decompressing it), then the offsets for
1386 affected entries can remain unset (`None`). The size should also be set
1387 if possible.
1388
1389 Binman calls this after the image has been packed, to update the
1390 location that all the entries ended up at.
1391
Simon Glass943bf782021-11-23 21:09:50 -07001392ReadChildData(child, decomp, alt_format):
Simon Glass3f495f12021-11-23 11:03:49 -07001393 The default version of this may be good enough, if you are able to
1394 implement SetImagePos() correctly. But that is a bit of a bypass, so
1395 you can override this method to read from your custom file format. It
1396 should read the entire entry containing the custom file using
1397 `super().ReadData(True)`, then parse the file to get the data for the
1398 given child, then return that data.
1399
1400 If your file format supports compression, the `decomp` argument tells
1401 you whether to return the compressed data (`decomp` is False) or to
1402 uncompress it first, then return the uncompressed data (`decomp` is
1403 True). This is used by the `binman extract -U` option.
1404
Simon Glass943bf782021-11-23 21:09:50 -07001405 If your entry supports alternative formats, the alt_format provides the
1406 alternative format that the user has selected. Your function should
1407 return data in that format. This is used by the 'binman extract -l'
1408 option.
1409
Simon Glass3f495f12021-11-23 11:03:49 -07001410 Binman calls this when reading in an image, in order to populate all the
1411 entries with the data from that image (`binman ls`).
1412
1413WriteChildData(child):
1414 Binman calls this after `child.data` is updated, to inform the custom
1415 file format about this, in case it needs to do updates.
1416
1417 The default version of this does nothing and probably needs to be
1418 overridden for the 'binman replace' command to work. Your version should
1419 use `child.data` to update the data for that child in the custom file
1420 format.
1421
1422 Binman calls this when updating an image that has been read in and in
1423 particular to update the data for a particular entry (`binman replace`)
1424
1425Properties / Entry arguments
1426~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1427
1428See :ref:`develop/package/binman:Image description format` for more
1429information.
1430
1431align-default
1432 Default alignment for this section, if no alignment is given in the
1433 entry
1434
1435pad-byte
1436 Pad byte to use when padding
1437
1438sort-by-offset
1439 True if entries should be sorted by offset, False if they must be
1440 in-order in the device tree description
1441
1442end-at-4gb
1443 Used to build an x86 ROM which ends at 4GB (2^32)
1444
1445name-prefix
1446 Adds a prefix to the name of every entry in the section when writing out
1447 the map
1448
1449skip-at-start
1450 Number of bytes before the first entry starts. These effectively adjust
1451 the starting offset of entries. For example, if this is 16, then the
1452 first entry would start at 16. An entry with offset = 20 would in fact
1453 be written at offset 4 in the image file, since the first 16 bytes are
1454 skipped when writing.
Simon Glass17365752021-04-03 11:05:10 +13001455
Simon Glass8beb11e2019-07-08 14:25:47 -06001456Since a section is also an entry, it inherits all the properies of entries
1457too.
1458
Simon Glass3f495f12021-11-23 11:03:49 -07001459Note that the `allow_missing` member controls whether this section permits
1460external blobs to be missing their contents. The option will produce an
1461image but of course it will not work. It is useful to make sure that
1462Continuous Integration systems can build without the binaries being
1463available. This is set by the `SetAllowMissing()` method, if
1464`--allow-missing` is passed to binman.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001465
1466
1467
Simon Glass228c9b82022-08-07 16:33:25 -06001468.. _etype_tee_os:
1469
Roger Quadros47f420a2022-02-19 20:50:04 +02001470Entry: tee-os: Entry containing an OP-TEE Trusted OS (TEE) blob
1471---------------------------------------------------------------
1472
1473Properties / Entry arguments:
1474 - tee-os-path: Filename of file to read into entry. This is typically
1475 called tee-pager.bin
1476
1477This entry holds the run-time firmware, typically started by U-Boot SPL.
1478See the U-Boot README for your architecture or board for how to use it. See
1479https://github.com/OP-TEE/optee_os for more information about OP-TEE.
1480
1481
1482
Simon Glass228c9b82022-08-07 16:33:25 -06001483.. _etype_text:
1484
Simon Glass5a5da7c2018-07-17 13:25:37 -06001485Entry: text: An entry which contains text
1486-----------------------------------------
1487
1488The text can be provided either in the node itself or by a command-line
1489argument. There is a level of indirection to allow multiple text strings
1490and sharing of text.
1491
1492Properties / Entry arguments:
1493 text-label: The value of this string indicates the property / entry-arg
1494 that contains the string to place in the entry
1495 <xxx> (actual name is the value of text-label): contains the string to
1496 place in the entry.
Simon Glassaa88b502019-07-08 13:18:40 -06001497 <text>: The text to place in the entry (overrides the above mechanism).
1498 This is useful when the text is constant.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001499
Simon Glass6bc43092021-03-18 20:25:15 +13001500Example node::
Simon Glass5a5da7c2018-07-17 13:25:37 -06001501
1502 text {
1503 size = <50>;
1504 text-label = "message";
1505 };
1506
1507You can then use:
1508
1509 binman -amessage="this is my message"
1510
1511and binman will insert that string into the entry.
1512
Simon Glass6bc43092021-03-18 20:25:15 +13001513It is also possible to put the string directly in the node::
Simon Glass5a5da7c2018-07-17 13:25:37 -06001514
1515 text {
1516 size = <8>;
1517 text-label = "message";
1518 message = "a message directly in the node"
1519 };
1520
Simon Glass6bc43092021-03-18 20:25:15 +13001521or just::
Simon Glassaa88b502019-07-08 13:18:40 -06001522
1523 text {
1524 size = <8>;
1525 text = "some text directly in the node"
1526 };
1527
Simon Glass5a5da7c2018-07-17 13:25:37 -06001528The text is not itself nul-terminated. This can be achieved, if required,
1529by setting the size of the entry to something larger than the text.
1530
1531
1532
Simon Glass228c9b82022-08-07 16:33:25 -06001533.. _etype_u_boot:
1534
Simon Glass5a5da7c2018-07-17 13:25:37 -06001535Entry: u-boot: U-Boot flat binary
1536---------------------------------
1537
1538Properties / Entry arguments:
1539 - filename: Filename of u-boot.bin (default 'u-boot.bin')
1540
1541This is the U-Boot binary, containing relocation information to allow it
1542to relocate itself at runtime. The binary typically includes a device tree
Simon Glass06684922021-03-18 20:25:07 +13001543blob at the end of it.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001544
1545U-Boot can access binman symbols at runtime. See:
1546
1547 'Access to binman entry offsets at run time (fdt)'
1548
1549in the binman README for more information.
1550
Simon Glass06684922021-03-18 20:25:07 +13001551Note that this entry is automatically replaced with u-boot-expanded unless
Simon Glass3d433382021-03-21 18:24:30 +13001552--no-expanded is used or the node has a 'no-expanded' property.
Simon Glass06684922021-03-18 20:25:07 +13001553
Simon Glass5a5da7c2018-07-17 13:25:37 -06001554
1555
Simon Glass228c9b82022-08-07 16:33:25 -06001556.. _etype_u_boot_dtb:
1557
Simon Glass5a5da7c2018-07-17 13:25:37 -06001558Entry: u-boot-dtb: U-Boot device tree
1559-------------------------------------
1560
1561Properties / Entry arguments:
1562 - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
1563
1564This is the U-Boot device tree, containing configuration information for
1565U-Boot. U-Boot needs this to know what devices are present and which drivers
1566to activate.
1567
Simon Glass6ed45ba2018-09-14 04:57:24 -06001568Note: This is mostly an internal entry type, used by others. This allows
1569binman to know which entries contain a device tree.
1570
Simon Glass5a5da7c2018-07-17 13:25:37 -06001571
1572
Simon Glass228c9b82022-08-07 16:33:25 -06001573.. _etype_u_boot_dtb_with_ucode:
1574
Simon Glass5a5da7c2018-07-17 13:25:37 -06001575Entry: u-boot-dtb-with-ucode: A U-Boot device tree file, with the microcode removed
1576-----------------------------------------------------------------------------------
1577
1578Properties / Entry arguments:
1579 - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
1580
1581See Entry_u_boot_ucode for full details of the three entries involved in
1582this process. This entry provides the U-Boot device-tree file, which
1583contains the microcode. If the microcode is not being collated into one
1584place then the offset and size of the microcode is recorded by this entry,
Simon Glassadc59ea2021-03-18 20:24:54 +13001585for use by u-boot-with-ucode_ptr. If it is being collated, then this
Simon Glass5a5da7c2018-07-17 13:25:37 -06001586entry deletes the microcode from the device tree (to save space) and makes
Simon Glassadc59ea2021-03-18 20:24:54 +13001587it available to u-boot-ucode.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001588
1589
1590
Simon Glass228c9b82022-08-07 16:33:25 -06001591.. _etype_u_boot_elf:
1592
Simon Glassfe1ae3e2018-09-14 04:57:35 -06001593Entry: u-boot-elf: U-Boot ELF image
1594-----------------------------------
1595
1596Properties / Entry arguments:
1597 - filename: Filename of u-boot (default 'u-boot')
1598
1599This is the U-Boot ELF image. It does not include a device tree but can be
1600relocated to any address for execution.
1601
1602
1603
Simon Glass228c9b82022-08-07 16:33:25 -06001604.. _etype_u_boot_env:
1605
Simon Glassf3243302020-10-26 17:39:59 -06001606Entry: u-boot-env: An entry which contains a U-Boot environment
1607---------------------------------------------------------------
1608
1609Properties / Entry arguments:
1610 - filename: File containing the environment text, with each line in the
1611 form var=value
1612
1613
1614
Simon Glass228c9b82022-08-07 16:33:25 -06001615.. _etype_u_boot_expanded:
1616
Simon Glass06684922021-03-18 20:25:07 +13001617Entry: u-boot-expanded: U-Boot flat binary broken out into its component parts
1618------------------------------------------------------------------------------
1619
1620This is a section containing the U-Boot binary and a devicetree. Using this
1621entry type automatically creates this section, with the following entries
1622in it:
1623
1624 u-boot-nodtb
1625 u-boot-dtb
1626
1627Having the devicetree separate allows binman to update it in the final
1628image, so that the entries positions are provided to the running U-Boot.
1629
1630
1631
Simon Glass228c9b82022-08-07 16:33:25 -06001632.. _etype_u_boot_img:
1633
Simon Glass5a5da7c2018-07-17 13:25:37 -06001634Entry: u-boot-img: U-Boot legacy image
1635--------------------------------------
1636
1637Properties / Entry arguments:
1638 - filename: Filename of u-boot.img (default 'u-boot.img')
1639
1640This is the U-Boot binary as a packaged image, in legacy format. It has a
1641header which allows it to be loaded at the correct address for execution.
1642
1643You should use FIT (Flat Image Tree) instead of the legacy image for new
1644applications.
1645
1646
1647
Simon Glass228c9b82022-08-07 16:33:25 -06001648.. _etype_u_boot_nodtb:
1649
Simon Glass5a5da7c2018-07-17 13:25:37 -06001650Entry: u-boot-nodtb: U-Boot flat binary without device tree appended
1651--------------------------------------------------------------------
1652
1653Properties / Entry arguments:
Simon Glassadc59ea2021-03-18 20:24:54 +13001654 - filename: Filename to include (default 'u-boot-nodtb.bin')
Simon Glass5a5da7c2018-07-17 13:25:37 -06001655
1656This is the U-Boot binary, containing relocation information to allow it
1657to relocate itself at runtime. It does not include a device tree blob at
Simon Glassadc59ea2021-03-18 20:24:54 +13001658the end of it so normally cannot work without it. You can add a u-boot-dtb
Simon Glass06684922021-03-18 20:25:07 +13001659entry after this one, or use a u-boot entry instead, normally expands to a
1660section containing u-boot and u-boot-dtb
Simon Glass5a5da7c2018-07-17 13:25:37 -06001661
1662
1663
Simon Glass228c9b82022-08-07 16:33:25 -06001664.. _etype_u_boot_spl:
1665
Simon Glass5a5da7c2018-07-17 13:25:37 -06001666Entry: u-boot-spl: U-Boot SPL binary
1667------------------------------------
1668
1669Properties / Entry arguments:
1670 - filename: Filename of u-boot-spl.bin (default 'spl/u-boot-spl.bin')
1671
1672This is the U-Boot SPL (Secondary Program Loader) binary. This is a small
1673binary which loads before U-Boot proper, typically into on-chip SRAM. It is
1674responsible for locating, loading and jumping to U-Boot. Note that SPL is
1675not relocatable so must be loaded to the correct address in SRAM, or written
Simon Glassb8ef5b62018-07-17 13:25:48 -06001676to run from the correct address if direct flash execution is possible (e.g.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001677on x86 devices).
1678
1679SPL can access binman symbols at runtime. See:
1680
1681 'Access to binman entry offsets at run time (symbols)'
1682
1683in the binman README for more information.
1684
1685The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1686binman uses that to look up symbols to write into the SPL binary.
1687
Simon Glass06684922021-03-18 20:25:07 +13001688Note that this entry is automatically replaced with u-boot-spl-expanded
Simon Glass3d433382021-03-21 18:24:30 +13001689unless --no-expanded is used or the node has a 'no-expanded' property.
Simon Glass06684922021-03-18 20:25:07 +13001690
Simon Glass5a5da7c2018-07-17 13:25:37 -06001691
1692
Simon Glass228c9b82022-08-07 16:33:25 -06001693.. _etype_u_boot_spl_bss_pad:
1694
Simon Glass5a5da7c2018-07-17 13:25:37 -06001695Entry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region
1696---------------------------------------------------------------------
1697
1698Properties / Entry arguments:
1699 None
1700
Simon Glassdccdc382021-03-18 20:24:55 +13001701This holds the padding added after the SPL binary to cover the BSS (Block
1702Started by Symbol) region. This region holds the various variables used by
1703SPL. It is set to 0 by SPL when it starts up. If you want to append data to
1704the SPL image (such as a device tree file), you must pad out the BSS region
1705to avoid the data overlapping with U-Boot variables. This entry is useful in
1706that case. It automatically pads out the entry size to cover both the code,
1707data and BSS.
1708
1709The contents of this entry will a certain number of zero bytes, determined
1710by __bss_size
Simon Glass5a5da7c2018-07-17 13:25:37 -06001711
1712The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1713binman uses that to look up the BSS address.
1714
1715
1716
Simon Glass228c9b82022-08-07 16:33:25 -06001717.. _etype_u_boot_spl_dtb:
1718
Simon Glass5a5da7c2018-07-17 13:25:37 -06001719Entry: u-boot-spl-dtb: U-Boot SPL device tree
1720---------------------------------------------
1721
1722Properties / Entry arguments:
1723 - filename: Filename of u-boot.dtb (default 'spl/u-boot-spl.dtb')
1724
1725This is the SPL device tree, containing configuration information for
1726SPL. SPL needs this to know what devices are present and which drivers
1727to activate.
1728
1729
1730
Simon Glass228c9b82022-08-07 16:33:25 -06001731.. _etype_u_boot_spl_elf:
1732
Simon Glassfe1ae3e2018-09-14 04:57:35 -06001733Entry: u-boot-spl-elf: U-Boot SPL ELF image
1734-------------------------------------------
1735
1736Properties / Entry arguments:
Simon Glassa6a520e2019-07-08 13:18:45 -06001737 - filename: Filename of SPL u-boot (default 'spl/u-boot-spl')
Simon Glassfe1ae3e2018-09-14 04:57:35 -06001738
1739This is the U-Boot SPL ELF image. It does not include a device tree but can
1740be relocated to any address for execution.
1741
1742
1743
Simon Glass228c9b82022-08-07 16:33:25 -06001744.. _etype_u_boot_spl_expanded:
1745
Simon Glass06684922021-03-18 20:25:07 +13001746Entry: u-boot-spl-expanded: U-Boot SPL flat binary broken out into its component parts
1747--------------------------------------------------------------------------------------
1748
1749Properties / Entry arguments:
1750 - spl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
1751 select)
1752
1753This is a section containing the U-Boot binary, BSS padding if needed and a
1754devicetree. Using this entry type automatically creates this section, with
1755the following entries in it:
1756
1757 u-boot-spl-nodtb
1758 u-boot-spl-bss-pad
1759 u-boot-dtb
1760
1761Having the devicetree separate allows binman to update it in the final
1762image, so that the entries positions are provided to the running U-Boot.
1763
1764This entry is selected based on the value of the 'spl-dtb' entryarg. If
1765this is non-empty (and not 'n' or '0') then this expanded entry is selected.
1766
1767
1768
Simon Glass228c9b82022-08-07 16:33:25 -06001769.. _etype_u_boot_spl_nodtb:
1770
Simon Glass5a5da7c2018-07-17 13:25:37 -06001771Entry: u-boot-spl-nodtb: SPL binary without device tree appended
1772----------------------------------------------------------------
1773
1774Properties / Entry arguments:
Simon Glassadc59ea2021-03-18 20:24:54 +13001775 - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin')
Simon Glass5a5da7c2018-07-17 13:25:37 -06001776
1777This is the U-Boot SPL binary, It does not include a device tree blob at
1778the end of it so may not be able to work without it, assuming SPL needs
Simon Glassadc59ea2021-03-18 20:24:54 +13001779a device tree to operate on your platform. You can add a u-boot-spl-dtb
Simon Glass06684922021-03-18 20:25:07 +13001780entry after this one, or use a u-boot-spl entry instead' which normally
1781expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
1782u-boot-spl-dtb
Simon Glass5a5da7c2018-07-17 13:25:37 -06001783
Simon Glassf5898822021-03-18 20:24:56 +13001784SPL can access binman symbols at runtime. See:
1785
1786 'Access to binman entry offsets at run time (symbols)'
1787
1788in the binman README for more information.
1789
1790The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1791binman uses that to look up symbols to write into the SPL binary.
1792
Simon Glass5a5da7c2018-07-17 13:25:37 -06001793
1794
Simon Glass228c9b82022-08-07 16:33:25 -06001795.. _etype_u_boot_spl_with_ucode_ptr:
1796
Simon Glass5a5da7c2018-07-17 13:25:37 -06001797Entry: u-boot-spl-with-ucode-ptr: U-Boot SPL with embedded microcode pointer
1798----------------------------------------------------------------------------
1799
Simon Glassf0253632018-09-14 04:57:32 -06001800This is used when SPL must set up the microcode for U-Boot.
1801
Simon Glass5a5da7c2018-07-17 13:25:37 -06001802See Entry_u_boot_ucode for full details of the entries involved in this
1803process.
1804
1805
1806
Simon Glass228c9b82022-08-07 16:33:25 -06001807.. _etype_u_boot_tpl:
1808
Simon Glassb8ef5b62018-07-17 13:25:48 -06001809Entry: u-boot-tpl: U-Boot TPL binary
1810------------------------------------
1811
1812Properties / Entry arguments:
1813 - filename: Filename of u-boot-tpl.bin (default 'tpl/u-boot-tpl.bin')
1814
1815This is the U-Boot TPL (Tertiary Program Loader) binary. This is a small
1816binary which loads before SPL, typically into on-chip SRAM. It is
1817responsible for locating, loading and jumping to SPL, the next-stage
1818loader. Note that SPL is not relocatable so must be loaded to the correct
1819address in SRAM, or written to run from the correct address if direct
1820flash execution is possible (e.g. on x86 devices).
1821
1822SPL can access binman symbols at runtime. See:
1823
1824 'Access to binman entry offsets at run time (symbols)'
1825
1826in the binman README for more information.
1827
1828The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1829binman uses that to look up symbols to write into the TPL binary.
1830
Simon Glass06684922021-03-18 20:25:07 +13001831Note that this entry is automatically replaced with u-boot-tpl-expanded
Simon Glass3d433382021-03-21 18:24:30 +13001832unless --no-expanded is used or the node has a 'no-expanded' property.
Simon Glass06684922021-03-18 20:25:07 +13001833
Simon Glassb8ef5b62018-07-17 13:25:48 -06001834
1835
Simon Glass228c9b82022-08-07 16:33:25 -06001836.. _etype_u_boot_tpl_bss_pad:
1837
Simon Glassd26efc82021-03-18 20:24:58 +13001838Entry: u-boot-tpl-bss-pad: U-Boot TPL binary padded with a BSS region
1839---------------------------------------------------------------------
1840
1841Properties / Entry arguments:
1842 None
1843
1844This holds the padding added after the TPL binary to cover the BSS (Block
1845Started by Symbol) region. This region holds the various variables used by
1846TPL. It is set to 0 by TPL when it starts up. If you want to append data to
1847the TPL image (such as a device tree file), you must pad out the BSS region
1848to avoid the data overlapping with U-Boot variables. This entry is useful in
1849that case. It automatically pads out the entry size to cover both the code,
1850data and BSS.
1851
1852The contents of this entry will a certain number of zero bytes, determined
1853by __bss_size
1854
1855The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1856binman uses that to look up the BSS address.
1857
1858
1859
Simon Glass228c9b82022-08-07 16:33:25 -06001860.. _etype_u_boot_tpl_dtb:
1861
Simon Glassb8ef5b62018-07-17 13:25:48 -06001862Entry: u-boot-tpl-dtb: U-Boot TPL device tree
1863---------------------------------------------
1864
1865Properties / Entry arguments:
1866 - filename: Filename of u-boot.dtb (default 'tpl/u-boot-tpl.dtb')
1867
1868This is the TPL device tree, containing configuration information for
1869TPL. TPL needs this to know what devices are present and which drivers
1870to activate.
1871
1872
1873
Simon Glass228c9b82022-08-07 16:33:25 -06001874.. _etype_u_boot_tpl_dtb_with_ucode:
1875
Simon Glassf0253632018-09-14 04:57:32 -06001876Entry: u-boot-tpl-dtb-with-ucode: U-Boot TPL with embedded microcode pointer
1877----------------------------------------------------------------------------
1878
1879This is used when TPL must set up the microcode for U-Boot.
1880
1881See Entry_u_boot_ucode for full details of the entries involved in this
1882process.
1883
1884
1885
Simon Glass228c9b82022-08-07 16:33:25 -06001886.. _etype_u_boot_tpl_elf:
1887
Simon Glass4c650252019-07-08 13:18:46 -06001888Entry: u-boot-tpl-elf: U-Boot TPL ELF image
1889-------------------------------------------
1890
1891Properties / Entry arguments:
1892 - filename: Filename of TPL u-boot (default 'tpl/u-boot-tpl')
1893
1894This is the U-Boot TPL ELF image. It does not include a device tree but can
1895be relocated to any address for execution.
1896
1897
1898
Simon Glass228c9b82022-08-07 16:33:25 -06001899.. _etype_u_boot_tpl_expanded:
1900
Simon Glass06684922021-03-18 20:25:07 +13001901Entry: u-boot-tpl-expanded: U-Boot TPL flat binary broken out into its component parts
1902--------------------------------------------------------------------------------------
1903
1904Properties / Entry arguments:
1905 - tpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
1906 select)
1907
1908This is a section containing the U-Boot binary, BSS padding if needed and a
1909devicetree. Using this entry type automatically creates this section, with
1910the following entries in it:
1911
1912 u-boot-tpl-nodtb
1913 u-boot-tpl-bss-pad
1914 u-boot-dtb
1915
1916Having the devicetree separate allows binman to update it in the final
1917image, so that the entries positions are provided to the running U-Boot.
1918
1919This entry is selected based on the value of the 'tpl-dtb' entryarg. If
1920this is non-empty (and not 'n' or '0') then this expanded entry is selected.
1921
1922
1923
Simon Glass228c9b82022-08-07 16:33:25 -06001924.. _etype_u_boot_tpl_nodtb:
1925
Simon Glass77a64e02021-03-18 20:24:57 +13001926Entry: u-boot-tpl-nodtb: TPL binary without device tree appended
1927----------------------------------------------------------------
1928
1929Properties / Entry arguments:
1930 - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin')
1931
1932This is the U-Boot TPL binary, It does not include a device tree blob at
1933the end of it so may not be able to work without it, assuming TPL needs
1934a device tree to operate on your platform. You can add a u-boot-tpl-dtb
Simon Glass06684922021-03-18 20:25:07 +13001935entry after this one, or use a u-boot-tpl entry instead, which normally
1936expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and
1937u-boot-tpl-dtb
Simon Glass77a64e02021-03-18 20:24:57 +13001938
1939TPL can access binman symbols at runtime. See:
1940
1941 'Access to binman entry offsets at run time (symbols)'
1942
1943in the binman README for more information.
1944
1945The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1946binman uses that to look up symbols to write into the TPL binary.
1947
1948
1949
Simon Glass228c9b82022-08-07 16:33:25 -06001950.. _etype_u_boot_tpl_with_ucode_ptr:
1951
Simon Glassf0253632018-09-14 04:57:32 -06001952Entry: u-boot-tpl-with-ucode-ptr: U-Boot TPL with embedded microcode pointer
1953----------------------------------------------------------------------------
1954
1955See Entry_u_boot_ucode for full details of the entries involved in this
1956process.
1957
1958
1959
Simon Glass228c9b82022-08-07 16:33:25 -06001960.. _etype_u_boot_ucode:
1961
Simon Glass5a5da7c2018-07-17 13:25:37 -06001962Entry: u-boot-ucode: U-Boot microcode block
1963-------------------------------------------
1964
1965Properties / Entry arguments:
1966 None
1967
1968The contents of this entry are filled in automatically by other entries
1969which must also be in the image.
1970
1971U-Boot on x86 needs a single block of microcode. This is collected from
1972the various microcode update nodes in the device tree. It is also unable
1973to read the microcode from the device tree on platforms that use FSP
1974(Firmware Support Package) binaries, because the API requires that the
1975microcode is supplied before there is any SRAM available to use (i.e.
1976the FSP sets up the SRAM / cache-as-RAM but does so in the call that
1977requires the microcode!). To keep things simple, all x86 platforms handle
1978microcode the same way in U-Boot (even non-FSP platforms). This is that
1979a table is placed at _dt_ucode_base_size containing the base address and
1980size of the microcode. This is either passed to the FSP (for FSP
1981platforms), or used to set up the microcode (for non-FSP platforms).
1982This all happens in the build system since it is the only way to get
1983the microcode into a single blob and accessible without SRAM.
1984
1985There are two cases to handle. If there is only one microcode blob in
1986the device tree, then the ucode pointer it set to point to that. This
1987entry (u-boot-ucode) is empty. If there is more than one update, then
1988this entry holds the concatenation of all updates, and the device tree
1989entry (u-boot-dtb-with-ucode) is updated to remove the microcode. This
1990last step ensures that that the microcode appears in one contiguous
1991block in the image and is not unnecessarily duplicated in the device
1992tree. It is referred to as 'collation' here.
1993
1994Entry types that have a part to play in handling microcode:
1995
1996 Entry_u_boot_with_ucode_ptr:
1997 Contains u-boot-nodtb.bin (i.e. U-Boot without the device tree).
1998 It updates it with the address and size of the microcode so that
1999 U-Boot can find it early on start-up.
2000 Entry_u_boot_dtb_with_ucode:
2001 Contains u-boot.dtb. It stores the microcode in a
2002 'self.ucode_data' property, which is then read by this class to
2003 obtain the microcode if needed. If collation is performed, it
2004 removes the microcode from the device tree.
2005 Entry_u_boot_ucode:
2006 This class. If collation is enabled it reads the microcode from
2007 the Entry_u_boot_dtb_with_ucode entry, and uses it as the
2008 contents of this entry.
2009
2010
2011
Simon Glass228c9b82022-08-07 16:33:25 -06002012.. _etype_u_boot_with_ucode_ptr:
2013
Simon Glass5a5da7c2018-07-17 13:25:37 -06002014Entry: u-boot-with-ucode-ptr: U-Boot with embedded microcode pointer
2015--------------------------------------------------------------------
2016
2017Properties / Entry arguments:
Masahiro Yamadaf6a8c0f2019-12-14 13:47:26 +09002018 - filename: Filename of u-boot-nodtb.bin (default 'u-boot-nodtb.bin')
Simon Glassf0693032018-09-14 04:57:07 -06002019 - optional-ucode: boolean property to make microcode optional. If the
2020 u-boot.bin image does not include microcode, no error will
2021 be generated.
Simon Glass5a5da7c2018-07-17 13:25:37 -06002022
2023See Entry_u_boot_ucode for full details of the three entries involved in
2024this process. This entry updates U-Boot with the offset and size of the
2025microcode, to allow early x86 boot code to find it without doing anything
Simon Glassadc59ea2021-03-18 20:24:54 +13002026complicated. Otherwise it is the same as the u-boot entry.
Simon Glass5a5da7c2018-07-17 13:25:37 -06002027
2028
2029
Simon Glass228c9b82022-08-07 16:33:25 -06002030.. _etype_vblock:
2031
Simon Glass24d0d3c2018-07-17 13:25:47 -06002032Entry: vblock: An entry which contains a Chromium OS verified boot block
2033------------------------------------------------------------------------
2034
2035Properties / Entry arguments:
Simon Glass5385f5a2019-05-17 22:00:53 -06002036 - content: List of phandles to entries to sign
Simon Glass24d0d3c2018-07-17 13:25:47 -06002037 - keydir: Directory containing the public keys to use
2038 - keyblock: Name of the key file to use (inside keydir)
2039 - signprivate: Name of provide key file to use (inside keydir)
2040 - version: Version number of the vblock (typically 1)
2041 - kernelkey: Name of the kernel key to use (inside keydir)
2042 - preamble-flags: Value of the vboot preamble flags (typically 0)
2043
Simon Glassa326b492018-09-14 04:57:11 -06002044Output files:
2045 - input.<unique_name> - input file passed to futility
2046 - vblock.<unique_name> - output file generated by futility (which is
2047 used as the entry contents)
2048
Jagdish Gediya9d368f32018-09-03 21:35:08 +05302049Chromium OS signs the read-write firmware and kernel, writing the signature
Simon Glass24d0d3c2018-07-17 13:25:47 -06002050in this block. This allows U-Boot to verify that the next firmware stage
2051and kernel are genuine.
2052
2053
2054
Simon Glass228c9b82022-08-07 16:33:25 -06002055.. _etype_x86_reset16:
2056
Simon Glass2250ee62019-08-24 07:22:48 -06002057Entry: x86-reset16: x86 16-bit reset code for U-Boot
2058----------------------------------------------------
2059
2060Properties / Entry arguments:
2061 - filename: Filename of u-boot-x86-reset16.bin (default
2062 'u-boot-x86-reset16.bin')
2063
2064x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2065must be placed at a particular address. This entry holds that code. It is
2066typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2067for jumping to the x86-start16 code, which continues execution.
2068
2069For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead.
2070
2071
2072
Simon Glass228c9b82022-08-07 16:33:25 -06002073.. _etype_x86_reset16_spl:
2074
Simon Glass2250ee62019-08-24 07:22:48 -06002075Entry: x86-reset16-spl: x86 16-bit reset code for U-Boot
2076--------------------------------------------------------
2077
2078Properties / Entry arguments:
2079 - filename: Filename of u-boot-x86-reset16.bin (default
2080 'u-boot-x86-reset16.bin')
2081
2082x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2083must be placed at a particular address. This entry holds that code. It is
2084typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2085for jumping to the x86-start16 code, which continues execution.
2086
2087For 32-bit U-Boot, the 'x86_reset_spl' entry type is used instead.
2088
2089
2090
Simon Glass228c9b82022-08-07 16:33:25 -06002091.. _etype_x86_reset16_tpl:
2092
Simon Glass2250ee62019-08-24 07:22:48 -06002093Entry: x86-reset16-tpl: x86 16-bit reset code for U-Boot
2094--------------------------------------------------------
2095
2096Properties / Entry arguments:
2097 - filename: Filename of u-boot-x86-reset16.bin (default
2098 'u-boot-x86-reset16.bin')
2099
2100x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2101must be placed at a particular address. This entry holds that code. It is
2102typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2103for jumping to the x86-start16 code, which continues execution.
2104
2105For 32-bit U-Boot, the 'x86_reset_tpl' entry type is used instead.
2106
2107
2108
Simon Glass228c9b82022-08-07 16:33:25 -06002109.. _etype_x86_start16:
2110
Simon Glass5a5da7c2018-07-17 13:25:37 -06002111Entry: x86-start16: x86 16-bit start-up code for U-Boot
2112-------------------------------------------------------
2113
2114Properties / Entry arguments:
Simon Glass5e239182019-08-24 07:22:49 -06002115 - filename: Filename of u-boot-x86-start16.bin (default
2116 'u-boot-x86-start16.bin')
Simon Glass5a5da7c2018-07-17 13:25:37 -06002117
2118x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
Simon Glass5e239182019-08-24 07:22:49 -06002119must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2120entry holds that code. It is typically placed at offset
2121CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2122and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2123U-Boot).
Simon Glass5a5da7c2018-07-17 13:25:37 -06002124
2125For 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead.
2126
2127
2128
Simon Glass228c9b82022-08-07 16:33:25 -06002129.. _etype_x86_start16_spl:
2130
Simon Glass5a5da7c2018-07-17 13:25:37 -06002131Entry: x86-start16-spl: x86 16-bit start-up code for SPL
2132--------------------------------------------------------
2133
2134Properties / Entry arguments:
Simon Glass5e239182019-08-24 07:22:49 -06002135 - filename: Filename of spl/u-boot-x86-start16-spl.bin (default
2136 'spl/u-boot-x86-start16-spl.bin')
Simon Glass5a5da7c2018-07-17 13:25:37 -06002137
Simon Glass5e239182019-08-24 07:22:49 -06002138x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2139must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2140entry holds that code. It is typically placed at offset
2141CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2142and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2143U-Boot).
Simon Glass5a5da7c2018-07-17 13:25:37 -06002144
Simon Glass5e239182019-08-24 07:22:49 -06002145For 32-bit U-Boot, the 'x86-start16' entry type is used instead.
Simon Glass5a5da7c2018-07-17 13:25:37 -06002146
2147
2148
Simon Glass228c9b82022-08-07 16:33:25 -06002149.. _etype_x86_start16_tpl:
2150
Simon Glass35b384c2018-09-14 04:57:10 -06002151Entry: x86-start16-tpl: x86 16-bit start-up code for TPL
2152--------------------------------------------------------
2153
2154Properties / Entry arguments:
Simon Glass5e239182019-08-24 07:22:49 -06002155 - filename: Filename of tpl/u-boot-x86-start16-tpl.bin (default
2156 'tpl/u-boot-x86-start16-tpl.bin')
Simon Glass35b384c2018-09-14 04:57:10 -06002157
Simon Glass5e239182019-08-24 07:22:49 -06002158x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2159must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2160entry holds that code. It is typically placed at offset
2161CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2162and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2163U-Boot).
Simon Glass35b384c2018-09-14 04:57:10 -06002164
Simon Glass5e239182019-08-24 07:22:49 -06002165If TPL is not being used, the 'x86-start16-spl or 'x86-start16' entry types
Simon Glass35b384c2018-09-14 04:57:10 -06002166may be used instead.
2167
2168
2169