blob: 4f05aa0a32362894e1afcb32b707998a0b99e976 [file] [log] [blame]
Simon Glass7a61c6b2018-07-17 13:25:37 -06001Binman Entry Documentation
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +02002==========================
Simon Glass7a61c6b2018-07-17 13:25:37 -06003
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 Glassf3598922024-07-20 11:49:45 +010014.. _etype_alternates_fdt:
15
16Entry: alternates-fdt: Entry that generates alternative sections for each devicetree provided
17---------------------------------------------------------------------------------------------
18
19When creating an image designed to boot on multiple models, each model
20requires its own devicetree. This entry deals with selecting the correct
21devicetree from a directory containing them. Each one is read in turn, then
22used to produce section contents which are written to a file. This results
23in a number of images, one for each model.
24
25For example this produces images for each .dtb file in the 'dtb' directory::
26
27 alternates-fdt {
28 fdt-list-dir = "dtb";
29 filename-pattern = "NAME.bin";
30 fdt-phase = "tpl";
31
32 section {
33 u-boot-tpl {
34 };
35 };
36 };
37
38Each output file is named based on its input file, so an input file of
39`model1.dtb` results in an output file of `model1.bin` (i.e. the `NAME` in
40the `filename-pattern` property is replaced with the .dtb basename).
41
42Note that this entry type still produces contents for the 'main' image, in
43that case using the normal dtb provided to Binman, e.g. `u-boot-tpl.dtb`.
44But that image is unlikely to be useful, since it relates to whatever dtb
45happened to be the default when U-Boot builds
46(i.e. `CONFIG_DEFAULT_DEVICE_TREE`). However, Binman ensures that the size
47of each of the alternates is the same as the 'default' one, so they can in
48principle be 'slotted in' to the appropriate place in the main image.
49
50The optional `fdt-phase` property indicates the phase to build. In this
51case, it etype runs fdtgrep to obtain the devicetree subset for that phase,
52respecting the `bootph-xxx` tags in the devicetree.
53
54
55
Simon Glassa7c97782022-08-07 16:33:25 -060056.. _etype_atf_bl31:
57
Simon Glass8911fa12021-03-18 20:25:16 +130058Entry: atf-bl31: ARM Trusted Firmware (ATF) BL31 blob
59-----------------------------------------------------
Simon Glass559c4de2020-09-01 05:13:58 -060060
61Properties / Entry arguments:
62 - atf-bl31-path: Filename of file to read into entry. This is typically
63 called bl31.bin or bl31.elf
64
65This entry holds the run-time firmware, typically started by U-Boot SPL.
66See the U-Boot README for your architecture or board for how to use it. See
Peter Robinson32d26c72024-10-02 19:08:49 +010067https://github.com/TrustedFirmware-A/trusted-firmware-a for more information
Simon Glass559c4de2020-09-01 05:13:58 -060068about ATF.
69
70
71
Simon Glassa7c97782022-08-07 16:33:25 -060072.. _etype_atf_fip:
73
Simon Glass3efb2972021-11-23 21:08:59 -070074Entry: atf-fip: ARM Trusted Firmware's Firmware Image Package (FIP)
75-------------------------------------------------------------------
76
77A FIP_ provides a way to group binaries in a firmware image, used by ARM's
78Trusted Firmware A (TF-A) code. It is a simple format consisting of a
79table of contents with information about the type, offset and size of the
80binaries in the FIP. It is quite similar to FMAP, with the major difference
81that it uses UUIDs to indicate the type of each entry.
82
83Note: It is recommended to always add an fdtmap to every image, as well as
84any FIPs so that binman and other tools can access the entire image
85correctly.
86
87The UUIDs correspond to useful names in `fiptool`, provided by ATF to
88operate on FIPs. Binman uses these names to make it easier to understand
89what is going on, although it is possible to provide a UUID if needed.
90
91The contents of the FIP are defined by subnodes of the atf-fip entry, e.g.::
92
93 atf-fip {
94 soc-fw {
95 filename = "bl31.bin";
96 };
97
98 scp-fwu-cfg {
99 filename = "bl2u.bin";
100 };
101
102 u-boot {
103 fip-type = "nt-fw";
104 };
105 };
106
107This describes a FIP with three entries: soc-fw, scp-fwu-cfg and nt-fw.
108You can use normal (non-external) binaries like U-Boot simply by adding a
109FIP type, with the `fip-type` property, as above.
110
111Since FIP exists to bring blobs together, Binman assumes that all FIP
112entries are external binaries. If a binary may not exist, you can use the
113`--allow-missing` flag to Binman, in which case the image is still created,
114even though it will not actually work.
115
116The size of the FIP depends on the size of the binaries. There is currently
117no way to specify a fixed size. If the `atf-fip` node has a `size` entry,
118this affects the space taken up by the `atf-fip` entry, but the FIP itself
119does not expand to use that space.
120
121Some other FIP features are available with Binman. The header and the
122entries have 64-bit flag works. The flag flags do not seem to be defined
123anywhere, but you can use `fip-hdr-flags` and fip-flags` to set the values
124of the header and entries respectively.
125
126FIP entries can be aligned to a particular power-of-two boundary. Use
127fip-align for this.
128
129Binman only understands the entry types that are included in its
130implementation. It is possible to specify a 16-byte UUID instead, using the
131fip-uuid property. In this case Binman doesn't know what its type is, so
132just uses the UUID. See the `u-boot` node in this example::
133
134 binman {
135 atf-fip {
136 fip-hdr-flags = /bits/ 64 <0x123>;
137 fip-align = <16>;
138 soc-fw {
139 fip-flags = /bits/ 64 <0x456>;
140 filename = "bl31.bin";
141 };
142
143 scp-fwu-cfg {
144 filename = "bl2u.bin";
145 };
146
147 u-boot {
148 fip-uuid = [fc 65 13 92 4a 5b 11 ec
149 94 35 ff 2d 1c fc 79 9c];
150 };
151 };
152 fdtmap {
153 };
154 };
155
156Binman allows reading and updating FIP entries after the image is created,
157provided that an FDPMAP is present too. Updates which change the size of a
158FIP entry will cause it to be expanded or contracted as needed.
159
160Properties for top-level atf-fip node
161~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162
163fip-hdr-flags (64 bits)
164 Sets the flags for the FIP header.
165
166Properties for subnodes
167~~~~~~~~~~~~~~~~~~~~~~~
168
169fip-type (str)
170 FIP type to use for this entry. This is needed if the entry
171 name is not a valid type. Value types are defined in `fip_util.py`.
172 The FIP type defines the UUID that is used (they map 1:1).
173
174fip-uuid (16 bytes)
175 If there is no FIP-type name defined, or it is not supported by Binman,
176 this property sets the UUID. It should be a 16-byte value, following the
177 hex digits of the UUID.
178
179fip-flags (64 bits)
180 Set the flags for a FIP entry. Use in one of the subnodes of the
181 7atf-fip entry.
182
183fip-align
184 Set the alignment for a FIP entry, FIP entries can be aligned to a
185 particular power-of-two boundary. The default is 1.
186
187Adding new FIP-entry types
188~~~~~~~~~~~~~~~~~~~~~~~~~~
189
190When new FIP entries are defined by TF-A they appear in the
191`TF-A source tree`_. You can use `fip_util.py` to update Binman to support
192new types, then `send a patch`_ to the U-Boot mailing list. There are two
193source files that the tool examples:
194
195- `include/tools_share/firmware_image_package.h` has the UUIDs
196- `tools/fiptool/tbbr_config.c` has the name and descripion for each UUID
197
198To run the tool::
199
Tom Rinif06de772024-12-19 10:19:57 -0600200 $ tools/binman/fip_util.py -s /path/to/arm-trusted-firmware
Simon Glass3efb2972021-11-23 21:08:59 -0700201 Warning: UUID 'UUID_NON_TRUSTED_WORLD_KEY_CERT' is not mentioned in tbbr_config.c file
202 Existing code in 'tools/binman/fip_util.py' is up-to-date
203
204If it shows there is an update, it writes a new version of `fip_util.py`
205to `fip_util.py.out`. You can change the output file using the `-i` flag.
206If you have a problem, use `-D` to enable traceback debugging.
207
208FIP commentary
209~~~~~~~~~~~~~~
210
211As a side effect of use of UUIDs, FIP does not support multiple
212entries of the same type, such as might be used to store fonts or graphics
213icons, for example. For verified boot it could be used for each part of the
214image (e.g. separate FIPs for A and B) but cannot describe the whole
215firmware image. As with FMAP there is no hierarchy defined, although FMAP
216works around this by having 'section' areas which encompass others. A
217similar workaround would be possible with FIP but is not currently defined.
218
219It is recommended to always add an fdtmap to every image, as well as any
220FIPs so that binman and other tools can access the entire image correctly.
221
222.. _FIP: https://trustedfirmware-a.readthedocs.io/en/latest/design/firmware-design.html#firmware-image-package-fip
223.. _`TF-A source tree`: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
Tom Rinibc31e3a2024-08-26 10:49:57 -0600224.. _`send a patch`: https://docs.u-boot.org/en/latest/develop/sending_patches.html
Simon Glass3efb2972021-11-23 21:08:59 -0700225
226
227
Simon Glassa7c97782022-08-07 16:33:25 -0600228.. _etype_blob:
229
Simon Glass8911fa12021-03-18 20:25:16 +1300230Entry: blob: Arbitrary binary blob
231----------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -0600232
233Note: This should not be used by itself. It is normally used as a parent
234class by other entry types.
235
236Properties / Entry arguments:
237 - filename: Filename of file to read into entry
Simon Glass7ba33592018-09-14 04:57:26 -0600238 - compress: Compression algorithm to use:
239 none: No compression
240 lz4: Use lz4 compression (via 'lz4' command-line utility)
Simon Glass7a61c6b2018-07-17 13:25:37 -0600241
242This entry reads data from a file and places it in the entry. The
243default filename is often specified specified by the subclass. See for
Simon Glass537e0062021-03-18 20:24:54 +1300244example the 'u-boot' entry which provides the filename 'u-boot.bin'.
Simon Glass7a61c6b2018-07-17 13:25:37 -0600245
Simon Glass7ba33592018-09-14 04:57:26 -0600246If compression is enabled, an extra 'uncomp-size' property is written to
247the node (if enabled with -u) which provides the uncompressed size of the
248data.
Simon Glass7a61c6b2018-07-17 13:25:37 -0600249
250
Simon Glass7a61c6b2018-07-17 13:25:37 -0600251
Simon Glassa7c97782022-08-07 16:33:25 -0600252.. _etype_blob_dtb:
253
Simon Glasse219aa42018-09-14 04:57:24 -0600254Entry: blob-dtb: A blob that holds a device tree
255------------------------------------------------
256
257This is a blob containing a device tree. The contents of the blob are
258obtained from the list of available device-tree files, managed by the
259'state' module.
260
Simon Glassda6a9082023-01-07 14:07:10 -0700261Additional attributes:
262 prepend: Header used (e.g. 'length')
Simon Glasse219aa42018-09-14 04:57:24 -0600263
264
Simon Glassda6a9082023-01-07 14:07:10 -0700265
Simon Glassa7c97782022-08-07 16:33:25 -0600266.. _etype_blob_ext:
267
Simon Glass8911fa12021-03-18 20:25:16 +1300268Entry: blob-ext: Externally built binary blob
269---------------------------------------------
Simon Glass5e560182020-07-09 18:39:36 -0600270
271Note: This should not be used by itself. It is normally used as a parent
272class by other entry types.
273
Simon Glass5d94cc62020-07-09 18:39:38 -0600274If the file providing this blob is missing, binman can optionally ignore it
275and produce a broken image with a warning.
276
Simon Glass5e560182020-07-09 18:39:36 -0600277See 'blob' for Properties / Entry arguments.
278
279
280
Simon Glassa7c97782022-08-07 16:33:25 -0600281.. _etype_blob_ext_list:
282
Simon Glass0b00ae62021-11-23 21:09:52 -0700283Entry: blob-ext-list: List of externally built binary blobs
284-----------------------------------------------------------
285
286This is like blob-ext except that a number of blobs can be provided,
287typically with some sort of relationship, e.g. all are DDC parameters.
288
289If any of the external files needed by this llist is missing, binman can
290optionally ignore it and produce a broken image with a warning.
291
292Args:
293 filenames: List of filenames to read and include
294
295
Simon Glassa7c97782022-08-07 16:33:25 -0600296
297.. _etype_blob_named_by_arg:
Simon Glass0b00ae62021-11-23 21:09:52 -0700298
Simon Glassdb168d42018-07-17 13:25:39 -0600299Entry: blob-named-by-arg: A blob entry which gets its filename property from its subclass
300-----------------------------------------------------------------------------------------
301
302Properties / Entry arguments:
303 - <xxx>-path: Filename containing the contents of this entry (optional,
Simon Glass21db0ff2020-09-01 05:13:54 -0600304 defaults to None)
Simon Glassdb168d42018-07-17 13:25:39 -0600305
306where <xxx> is the blob_fname argument to the constructor.
307
308This entry cannot be used directly. Instead, it is used as a parent class
309for another entry, which defined blob_fname. This parameter is used to
310set the entry-arg or property containing the filename. The entry-arg or
311property is in turn used to set the actual filename.
312
313See cros_ec_rw for an example of this.
314
315
316
Simon Glassa7c97782022-08-07 16:33:25 -0600317.. _etype_blob_phase:
318
Simon Glass718b5292021-03-18 20:25:07 +1300319Entry: blob-phase: Section that holds a phase binary
320----------------------------------------------------
321
322This is a base class that should not normally be used directly. It is used
323when converting a 'u-boot' entry automatically into a 'u-boot-expanded'
324entry; similarly for SPL.
325
326
Simon Glassa7c97782022-08-07 16:33:25 -0600327
328.. _etype_cbfs:
Simon Glass718b5292021-03-18 20:25:07 +1300329
Simon Glass8911fa12021-03-18 20:25:16 +1300330Entry: cbfs: Coreboot Filesystem (CBFS)
331---------------------------------------
Simon Glass1de34482019-07-08 13:18:53 -0600332
333A CBFS provides a way to group files into a group. It has a simple directory
334structure and allows the position of individual files to be set, since it is
335designed to support execute-in-place in an x86 SPI-flash device. Where XIP
336is not used, it supports compression and storing ELF files.
337
338CBFS is used by coreboot as its way of orgnanising SPI-flash contents.
339
Simon Glass0ac96b62021-03-18 20:25:15 +1300340The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.::
Simon Glass1de34482019-07-08 13:18:53 -0600341
342 cbfs {
343 size = <0x100000>;
344 u-boot {
345 cbfs-type = "raw";
346 };
347 u-boot-dtb {
348 cbfs-type = "raw";
349 };
350 };
351
352This creates a CBFS 1MB in size two files in it: u-boot.bin and u-boot.dtb.
353Note that the size is required since binman does not support calculating it.
354The contents of each entry is just what binman would normally provide if it
355were not a CBFS node. A blob type can be used to import arbitrary files as
Simon Glass0ac96b62021-03-18 20:25:15 +1300356with the second subnode below::
Simon Glass1de34482019-07-08 13:18:53 -0600357
358 cbfs {
359 size = <0x100000>;
360 u-boot {
361 cbfs-name = "BOOT";
362 cbfs-type = "raw";
363 };
364
365 dtb {
366 type = "blob";
367 filename = "u-boot.dtb";
368 cbfs-type = "raw";
369 cbfs-compress = "lz4";
Simon Glassc2f1aed2019-07-08 13:18:56 -0600370 cbfs-offset = <0x100000>;
Simon Glass1de34482019-07-08 13:18:53 -0600371 };
372 };
373
374This creates a CBFS 1MB in size with u-boot.bin (named "BOOT") and
375u-boot.dtb (named "dtb") and compressed with the lz4 algorithm.
376
377
378Properties supported in the top-level CBFS node:
379
380cbfs-arch:
381 Defaults to "x86", but you can specify the architecture if needed.
382
383
384Properties supported in the CBFS entry subnodes:
385
386cbfs-name:
387 This is the name of the file created in CBFS. It defaults to the entry
388 name (which is the node name), but you can override it with this
389 property.
390
391cbfs-type:
392 This is the CBFS file type. The following are supported:
393
394 raw:
395 This is a 'raw' file, although compression is supported. It can be
396 used to store any file in CBFS.
397
398 stage:
399 This is an ELF file that has been loaded (i.e. mapped to memory), so
400 appears in the CBFS as a flat binary. The input file must be an ELF
401 image, for example this puts "u-boot" (the ELF image) into a 'stage'
Simon Glass0ac96b62021-03-18 20:25:15 +1300402 entry::
Simon Glass1de34482019-07-08 13:18:53 -0600403
404 cbfs {
405 size = <0x100000>;
406 u-boot-elf {
407 cbfs-name = "BOOT";
408 cbfs-type = "stage";
409 };
410 };
411
Simon Glass0ac96b62021-03-18 20:25:15 +1300412 You can use your own ELF file with something like::
Simon Glass1de34482019-07-08 13:18:53 -0600413
414 cbfs {
415 size = <0x100000>;
416 something {
417 type = "blob";
418 filename = "cbfs-stage.elf";
419 cbfs-type = "stage";
420 };
421 };
422
423 As mentioned, the file is converted to a flat binary, so it is
424 equivalent to adding "u-boot.bin", for example, but with the load and
425 start addresses specified by the ELF. At present there is no option
426 to add a flat binary with a load/start address, similar to the
427 'add-flat-binary' option in cbfstool.
428
Simon Glassc2f1aed2019-07-08 13:18:56 -0600429cbfs-offset:
430 This is the offset of the file's data within the CBFS. It is used to
431 specify where the file should be placed in cases where a fixed position
432 is needed. Typical uses are for code which is not relocatable and must
433 execute in-place from a particular address. This works because SPI flash
434 is generally mapped into memory on x86 devices. The file header is
435 placed before this offset so that the data start lines up exactly with
436 the chosen offset. If this property is not provided, then the file is
437 placed in the next available spot.
Simon Glass1de34482019-07-08 13:18:53 -0600438
439The current implementation supports only a subset of CBFS features. It does
440not support other file types (e.g. payload), adding multiple files (like the
441'files' entry with a pattern supported by binman), putting files at a
442particular offset in the CBFS and a few other things.
443
444Of course binman can create images containing multiple CBFSs, simply by
Simon Glass0ac96b62021-03-18 20:25:15 +1300445defining these in the binman config::
Simon Glass1de34482019-07-08 13:18:53 -0600446
447
448 binman {
449 size = <0x800000>;
450 cbfs {
451 offset = <0x100000>;
452 size = <0x100000>;
453 u-boot {
454 cbfs-type = "raw";
455 };
456 u-boot-dtb {
457 cbfs-type = "raw";
458 };
459 };
460
461 cbfs2 {
462 offset = <0x700000>;
463 size = <0x100000>;
464 u-boot {
465 cbfs-type = "raw";
466 };
467 u-boot-dtb {
468 cbfs-type = "raw";
469 };
470 image {
471 type = "blob";
472 filename = "image.jpg";
473 };
474 };
475 };
476
477This creates an 8MB image with two CBFSs, one at offset 1MB, one at 7MB,
478both of size 1MB.
479
480
481
Simon Glassa7c97782022-08-07 16:33:25 -0600482.. _etype_collection:
483
Simon Glasse1915782021-03-21 18:24:31 +1300484Entry: collection: An entry which contains a collection of other entries
485------------------------------------------------------------------------
486
487Properties / Entry arguments:
488 - content: List of phandles to entries to include
489
490This allows reusing the contents of other entries. The contents of the
491listed entries are combined to form this entry. This serves as a useful
492base class for entry types which need to process data from elsewhere in
493the image, not necessarily child entries.
494
Simon Glassbd5cd882022-08-13 11:40:50 -0600495The entries can generally be anywhere in the same image, even if they are in
496a different section from this entry.
497
Simon Glasse1915782021-03-21 18:24:31 +1300498
499
Simon Glassa7c97782022-08-07 16:33:25 -0600500.. _etype_cros_ec_rw:
501
Simon Glassdb168d42018-07-17 13:25:39 -0600502Entry: cros-ec-rw: A blob entry which contains a Chromium OS read-write EC image
503--------------------------------------------------------------------------------
504
505Properties / Entry arguments:
506 - cros-ec-rw-path: Filename containing the EC image
507
508This entry holds a Chromium OS EC (embedded controller) image, for use in
509updating the EC on startup via software sync.
510
511
512
Sughosh Ganu269ee6d2023-08-22 23:09:59 +0530513.. _etype_efi_capsule:
514
Simon Glass86e1b822024-06-23 11:55:02 -0600515Entry: efi-capsule: Generate EFI capsules
516-----------------------------------------
Sughosh Ganu269ee6d2023-08-22 23:09:59 +0530517
Simon Glass86e1b822024-06-23 11:55:02 -0600518The parameters needed for generation of the capsules can
519be provided as properties in the entry.
Sughosh Ganu269ee6d2023-08-22 23:09:59 +0530520
521Properties / Entry arguments:
522 - image-index: Unique number for identifying corresponding
523 payload image. Number between 1 and descriptor count, i.e.
524 the total number of firmware images that can be updated. Mandatory
525 property.
526 - image-guid: Image GUID which will be used for identifying the
527 updatable image on the board. Mandatory property.
528 - hardware-instance: Optional number for identifying unique
529 hardware instance of a device in the system. Default value of 0
530 for images where value is not to be used.
531 - fw-version: Value of image version that can be put on the capsule
532 through the Firmware Management Protocol(FMP) header.
533 - monotonic-count: Count used when signing an image.
534 - private-key: Path to PEM formatted .key private key file. Mandatory
535 property for generating signed capsules.
536 - public-key-cert: Path to PEM formatted .crt public key certificate
537 file. Mandatory property for generating signed capsules.
538 - oem-flags - OEM flags to be passed through capsule header.
539
Simon Glass86e1b822024-06-23 11:55:02 -0600540Since this is a subclass of Entry_section, all properties of the parent
541class also apply here. Except for the properties stated as mandatory, the
542rest of the properties are optional.
Sughosh Ganu269ee6d2023-08-22 23:09:59 +0530543
544For more details on the description of the capsule format, and the capsule
545update functionality, refer Section 8.5 and Chapter 23 in the `UEFI
546specification`_.
547
548The capsule parameters like image index and image GUID are passed as
549properties in the entry. The payload to be used in the capsule is to be
550provided as a subnode of the capsule entry.
551
552A typical capsule entry node would then look something like this::
553
554 capsule {
Simon Glass86e1b822024-06-23 11:55:02 -0600555 type = "efi-capsule";
556 image-index = <0x1>;
557 /* Image GUID for testing capsule update */
558 image-guid = SANDBOX_UBOOT_IMAGE_GUID;
559 hardware-instance = <0x0>;
560 private-key = "path/to/the/private/key";
561 public-key-cert = "path/to/the/public-key-cert";
562 oem-flags = <0x8000>;
Sughosh Ganu269ee6d2023-08-22 23:09:59 +0530563
Simon Glass86e1b822024-06-23 11:55:02 -0600564 u-boot {
565 };
Sughosh Ganu269ee6d2023-08-22 23:09:59 +0530566 };
567
568In the above example, the capsule payload is the U-Boot image. The
569capsule entry would read the contents of the payload and put them
570into the capsule. Any external file can also be specified as the
571payload using the blob-ext subnode.
572
573.. _`UEFI specification`: https://uefi.org/sites/default/files/resources/UEFI_Spec_2_10_Aug29.pdf
574
575
576
Sughosh Ganu6b2d18a2023-10-10 14:40:59 +0530577.. _etype_efi_empty_capsule:
578
Simon Glass86e1b822024-06-23 11:55:02 -0600579Entry: efi-empty-capsule: Generate EFI empty capsules
580-----------------------------------------------------
Sughosh Ganu6b2d18a2023-10-10 14:40:59 +0530581
582The parameters needed for generation of the empty capsules can
583be provided as properties in the entry.
584
585Properties / Entry arguments:
586 - image-guid: Image GUID which will be used for identifying the
587 updatable image on the board. Mandatory for accept capsule.
588 - capsule-type - String to indicate type of capsule to generate. Valid
589 values are 'accept' and 'revert'.
590
591For more details on the description of the capsule format, and the capsule
592update functionality, refer Section 8.5 and Chapter 23 in the `UEFI
593specification`_. For more information on the empty capsule, refer the
594sections 2.3.2 and 2.3.3 in the `Dependable Boot specification`_.
595
Simon Glass86e1b822024-06-23 11:55:02 -0600596A typical accept empty capsule entry node would then look something like
597this::
Sughosh Ganu6b2d18a2023-10-10 14:40:59 +0530598
599 empty-capsule {
Simon Glass86e1b822024-06-23 11:55:02 -0600600 type = "efi-empty-capsule";
601 /* GUID of image being accepted */
602 image-type-id = SANDBOX_UBOOT_IMAGE_GUID;
603 capsule-type = "accept";
Sughosh Ganu6b2d18a2023-10-10 14:40:59 +0530604 };
605
Simon Glass86e1b822024-06-23 11:55:02 -0600606A typical revert empty capsule entry node would then look something like
607this::
Sughosh Ganu6b2d18a2023-10-10 14:40:59 +0530608
609 empty-capsule {
Simon Glass86e1b822024-06-23 11:55:02 -0600610 type = "efi-empty-capsule";
611 capsule-type = "revert";
Sughosh Ganu6b2d18a2023-10-10 14:40:59 +0530612 };
613
614The empty capsules do not have any input payload image.
615
616.. _`UEFI specification`: https://uefi.org/sites/default/files/resources/UEFI_Spec_2_10_Aug29.pdf
617.. _`Dependable Boot specification`: https://git.codelinaro.org/linaro/dependable-boot/mbfw/uploads/6f7ddfe3be24e18d4319e108a758d02e/mbfw.pdf
618
619
620
Christian Taedckebc454362023-07-17 09:05:52 +0200621.. _etype_encrypted:
622
623Entry: encrypted: Externally built encrypted binary blob
624--------------------------------------------------------
625
626This entry provides the functionality to include information about how to
627decrypt an encrypted binary. This information is added to the
628resulting device tree by adding a new cipher node in the entry's parent
629node (i.e. the binary).
630
631The key that must be used to decrypt the binary is either directly embedded
632in the device tree or indirectly by specifying a key source. The key source
633can be used as an id of a key that is stored in an external device.
634
635Using an embedded key
636~~~~~~~~~~~~~~~~~~~~~
637
638This is an example using an embedded key::
639
640 blob-ext {
641 filename = "encrypted-blob.bin";
642 };
643
644 encrypted {
645 algo = "aes256-gcm";
646 iv-filename = "encrypted-blob.bin.iv";
647 key-filename = "encrypted-blob.bin.key";
648 };
649
650This entry generates the following device tree structure form the example
651above::
652
653 data = [...]
654 cipher {
655 algo = "aes256-gcm";
656 key = <0x...>;
657 iv = <0x...>;
658 };
659
660The data property is generated by the blob-ext etype, the cipher node and
661its content is generated by this etype.
662
663Using an external key
664~~~~~~~~~~~~~~~~~~~~~
665
666Instead of embedding the key itself into the device tree, it is also
667possible to address an externally stored key by specifying a 'key-source'
668instead of the 'key'::
669
670 blob-ext {
671 filename = "encrypted-blob.bin";
672 };
673
674 encrypted {
675 algo = "aes256-gcm";
676 iv-filename = "encrypted-blob.bin.iv";
677 key-source = "external-key-id";
678 };
679
680This entry generates the following device tree structure form the example
681above::
682
683 data = [...]
684 cipher {
685 algo = "aes256-gcm";
686 key-source = "external-key-id";
687 iv = <0x...>;
688 };
689
690Properties
691~~~~~~~~~~
692
693Properties / Entry arguments:
694 - algo: The encryption algorithm. Currently no algorithm is supported
695 out-of-the-box. Certain algorithms will be added in future
696 patches.
697 - iv-filename: The name of the file containing the initialization
698 vector (in short iv). See
699 https://en.wikipedia.org/wiki/Initialization_vector
700 - key-filename: The name of the file containing the key. Either
701 key-filename or key-source must be provided.
702 - key-source: The key that should be used. Either key-filename or
703 key-source must be provided.
704
705
706
Simon Glassa7c97782022-08-07 16:33:25 -0600707.. _etype_fdtmap:
708
Simon Glass0f621332019-07-08 14:25:27 -0600709Entry: fdtmap: An entry which contains an FDT map
710-------------------------------------------------
711
712Properties / Entry arguments:
713 None
714
715An FDT map is just a header followed by an FDT containing a list of all the
Simon Glassfb30e292019-07-20 12:23:51 -0600716entries in the image. The root node corresponds to the image node in the
717original FDT, and an image-name property indicates the image name in that
718original tree.
Simon Glass0f621332019-07-08 14:25:27 -0600719
720The header is the string _FDTMAP_ followed by 8 unused bytes.
721
722When used, this entry will be populated with an FDT map which reflects the
723entries in the current image. Hierarchy is preserved, and all offsets and
724sizes are included.
725
726Note that the -u option must be provided to ensure that binman updates the
727FDT with the position of each entry.
728
Simon Glass0ac96b62021-03-18 20:25:15 +1300729Example output for a simple image with U-Boot and an FDT map::
Simon Glass0f621332019-07-08 14:25:27 -0600730
Simon Glass0ac96b62021-03-18 20:25:15 +1300731 / {
732 image-name = "binman";
733 size = <0x00000112>;
Simon Glass0f621332019-07-08 14:25:27 -0600734 image-pos = <0x00000000>;
735 offset = <0x00000000>;
Simon Glass0ac96b62021-03-18 20:25:15 +1300736 u-boot {
737 size = <0x00000004>;
738 image-pos = <0x00000000>;
739 offset = <0x00000000>;
740 };
741 fdtmap {
742 size = <0x0000010e>;
743 image-pos = <0x00000004>;
744 offset = <0x00000004>;
745 };
Simon Glass0f621332019-07-08 14:25:27 -0600746 };
Simon Glass0f621332019-07-08 14:25:27 -0600747
Simon Glassfb30e292019-07-20 12:23:51 -0600748If allow-repack is used then 'orig-offset' and 'orig-size' properties are
749added as necessary. See the binman README.
750
Simon Glass637958f2021-11-23 21:09:50 -0700751When extracting files, an alternative 'fdt' format is available for fdtmaps.
752Use `binman extract -F fdt ...` to use this. It will export a devicetree,
753without the fdtmap header, so it can be viewed with `fdtdump`.
Simon Glass0f621332019-07-08 14:25:27 -0600754
755
Simon Glass637958f2021-11-23 21:09:50 -0700756
Simon Glassa7c97782022-08-07 16:33:25 -0600757.. _etype_files:
758
Simon Glass8911fa12021-03-18 20:25:16 +1300759Entry: files: A set of files arranged in a section
760--------------------------------------------------
Simon Glassac6328c2018-09-14 04:57:28 -0600761
762Properties / Entry arguments:
763 - pattern: Filename pattern to match the files to include
Simon Glass51d02ad2020-10-26 17:40:07 -0600764 - files-compress: Compression algorithm to use:
Simon Glassac6328c2018-09-14 04:57:28 -0600765 none: No compression
766 lz4: Use lz4 compression (via 'lz4' command-line utility)
Simon Glass3f093a32021-03-18 20:24:53 +1300767 - files-align: Align each file to the given alignment
Simon Glassac6328c2018-09-14 04:57:28 -0600768
769This entry reads a number of files and places each in a separate sub-entry
770within this entry. To access these you need to enable device-tree updates
771at run-time so you can obtain the file positions.
Simon Glass7a61c6b2018-07-17 13:25:37 -0600772
773
Simon Glassac6328c2018-09-14 04:57:28 -0600774
Simon Glassa7c97782022-08-07 16:33:25 -0600775.. _etype_fill:
776
Simon Glass53f53992018-07-17 13:25:40 -0600777Entry: fill: An entry which is filled to a particular byte value
778----------------------------------------------------------------
779
780Properties / Entry arguments:
781 - fill-byte: Byte to use to fill the entry
782
783Note that the size property must be set since otherwise this entry does not
784know how large it should be.
785
786You can often achieve the same effect using the pad-byte property of the
787overall image, in that the space between entries will then be padded with
788that byte. But this entry is sometimes useful for explicitly setting the
789byte value of a region.
790
791
Simon Glassc7b010d2020-07-09 18:39:45 -0600792
Simon Glassa7c97782022-08-07 16:33:25 -0600793.. _etype_fit:
794
Simon Glass8911fa12021-03-18 20:25:16 +1300795Entry: fit: Flat Image Tree (FIT)
796---------------------------------
Simon Glass45d556d2020-07-09 18:39:45 -0600797
798This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the
799input provided.
800
801Nodes for the FIT should be written out in the binman configuration just as
802they would be in a file passed to mkimage.
803
Simon Glass0ac96b62021-03-18 20:25:15 +1300804For example, this creates an image containing a FIT with U-Boot SPL::
Simon Glass45d556d2020-07-09 18:39:45 -0600805
806 binman {
807 fit {
808 description = "Test FIT";
Simon Glassa435cd12020-09-01 05:13:59 -0600809 fit,fdt-list = "of-list";
Simon Glass45d556d2020-07-09 18:39:45 -0600810
811 images {
812 kernel@1 {
813 description = "SPL";
814 os = "u-boot";
815 type = "rkspi";
816 arch = "arm";
817 compression = "none";
818 load = <0>;
819 entry = <0>;
820
821 u-boot-spl {
822 };
823 };
824 };
825 };
826 };
827
Simon Glass912339f2022-02-08 11:50:03 -0700828More complex setups can be created, with generated nodes, as described
829below.
830
831Properties (in the 'fit' node itself)
832~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
833
834Special properties have a `fit,` prefix, indicating that they should be
835processed but not included in the final FIT.
836
837The top-level 'fit' node supports the following special properties:
838
839 fit,external-offset
840 Indicates that the contents of the FIT are external and provides the
841 external offset. This is passed to mkimage via the -E and -p flags.
842
Jonas Karlmanc59ea892023-01-21 19:01:39 +0000843 fit,align
844 Indicates what alignment to use for the FIT and its external data,
845 and provides the alignment to use. This is passed to mkimage via
846 the -B flag.
847
Simon Glass912339f2022-02-08 11:50:03 -0700848 fit,fdt-list
849 Indicates the entry argument which provides the list of device tree
850 files for the gen-fdt-nodes operation (as below). This is often
851 `of-list` meaning that `-a of-list="dtb1 dtb2..."` should be passed
852 to binman.
853
Simon Glass2d94c422023-07-18 07:23:59 -0600854 fit,fdt-list-val
855 As an alternative to fit,fdt-list the list of device tree files
856 can be provided in this property as a string list, e.g.::
857
858 fit,fdt-list-val = "dtb1", "dtb2";
859
Simon Glasscd2783e2024-07-20 11:49:46 +0100860 fit,fdt-list-dir
861 As an alternative to fit,fdt-list the list of device tree files
862 can be provided as a directory. Each .dtb file in the directory is
863 processed, , e.g.::
864
Tom Rinif06de772024-12-19 10:19:57 -0600865 fit,fdt-list-dir = "arch/arm/dts";
866
867 In this case the input directories are ignored and all devicetree
868 files must be in that directory.
Simon Glasscd2783e2024-07-20 11:49:46 +0100869
Alexander Kochetkova730a282024-09-16 11:24:46 +0300870 fit,sign
871 Enable signing FIT images via mkimage as described in
Tom Rinif06de772024-12-19 10:19:57 -0600872 verified-boot.rst. If the property is found, the private keys path
873 is detected among binman include directories and passed to mkimage
874 via -k flag. All the keys required for signing FIT must be
875 available at time of signing and must be located in single include
876 directory.
Alexander Kochetkova730a282024-09-16 11:24:46 +0300877
Paul HENRYS65cea562024-11-25 18:47:16 +0100878 fit,encrypt
879 Enable data encryption in FIT images via mkimage. If the property
880 is found, the keys path is detected among binman include
881 directories and passed to mkimage via -k flag. All the keys
882 required for encrypting the FIT must be available at the time of
883 encrypting and must be located in a single include directory.
884
Simon Glass912339f2022-02-08 11:50:03 -0700885Substitutions
886~~~~~~~~~~~~~
887
888Node names and property values support a basic string-substitution feature.
889Available substitutions for '@' nodes (and property values) are:
890
891SEQ:
892 Sequence number of the generated fdt (1, 2, ...)
893NAME
894 Name of the dtb as provided (i.e. without adding '.dtb')
895
896The `default` property, if present, will be automatically set to the name
897if of configuration whose devicetree matches the `default-dt` entry
898argument, e.g. with `-a default-dt=sun50i-a64-pine64-lts`.
899
900Available substitutions for property values in these nodes are:
901
902DEFAULT-SEQ:
903 Sequence number of the default fdt, as provided by the 'default-dt'
904 entry argument
905
Paul HENRYS1b4bedb2024-11-25 18:54:21 +0100906DEFAULT-NAME:
907 Name of the default fdt, as provided by the 'default-dt' entry argument
908
Simon Glass912339f2022-02-08 11:50:03 -0700909Available operations
910~~~~~~~~~~~~~~~~~~~~
911
912You can add an operation to an '@' node to indicate which operation is
913required::
914
915 @fdt-SEQ {
916 fit,operation = "gen-fdt-nodes";
917 ...
918 };
919
920Available operations are:
921
922gen-fdt-nodes
923 Generate FDT nodes as above. This is the default if there is no
924 `fit,operation` property.
925
Simon Glass5f423422022-03-05 20:19:12 -0700926split-elf
927 Split an ELF file into a separate node for each segment.
928
Simon Glass912339f2022-02-08 11:50:03 -0700929Generating nodes from an FDT list (gen-fdt-nodes)
930~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
931
Simon Glassa435cd12020-09-01 05:13:59 -0600932U-Boot supports creating fdt and config nodes automatically. To do this,
Simon Glass9f1c6b92022-02-08 11:50:02 -0700933pass an `of-list` property (e.g. `-a of-list=file1 file2`). This tells
934binman that you want to generates nodes for two files: `file1.dtb` and
935`file2.dtb`. The `fit,fdt-list` property (see above) indicates that
936`of-list` should be used. If the property is missing you will get an error.
Simon Glassa435cd12020-09-01 05:13:59 -0600937
Simon Glass0ac96b62021-03-18 20:25:15 +1300938Then add a 'generator node', a node with a name starting with '@'::
Simon Glassa435cd12020-09-01 05:13:59 -0600939
940 images {
941 @fdt-SEQ {
942 description = "fdt-NAME";
943 type = "flat_dt";
944 compression = "none";
945 };
946 };
947
Simon Glass9f1c6b92022-02-08 11:50:02 -0700948This tells binman to create nodes `fdt-1` and `fdt-2` for each of your two
Simon Glassa435cd12020-09-01 05:13:59 -0600949files. All the properties you specify will be included in the node. This
950node acts like a template to generate the nodes. The generator node itself
951does not appear in the output - it is replaced with what binman generates.
Simon Glass9f1c6b92022-02-08 11:50:02 -0700952A 'data' property is created with the contents of the FDT file.
Simon Glassa435cd12020-09-01 05:13:59 -0600953
Simon Glass0ac96b62021-03-18 20:25:15 +1300954You can create config nodes in a similar way::
Simon Glassa435cd12020-09-01 05:13:59 -0600955
956 configurations {
957 default = "@config-DEFAULT-SEQ";
958 @config-SEQ {
959 description = "NAME";
Samuel Holland91079ac2020-10-21 21:12:14 -0500960 firmware = "atf";
961 loadables = "uboot";
Simon Glassa435cd12020-09-01 05:13:59 -0600962 fdt = "fdt-SEQ";
Simon Glass5f7aadf2024-07-20 11:49:47 +0100963 fit,compatible; // optional
Simon Glassa435cd12020-09-01 05:13:59 -0600964 };
965 };
966
Simon Glass9f1c6b92022-02-08 11:50:02 -0700967This tells binman to create nodes `config-1` and `config-2`, i.e. a config
968for each of your two files.
Simon Glassa435cd12020-09-01 05:13:59 -0600969
Paul HENRYS1b4bedb2024-11-25 18:54:21 +0100970It is also possible to use NAME in the node names so that the FDT files name
971will be used instead of the sequence number. This can be useful to identify
972easily at runtime in U-Boot, the config to be used::
973
974 configurations {
975 default = "@config-DEFAULT-NAME";
976 @config-NAME {
977 description = "NAME";
978 firmware = "atf";
979 loadables = "uboot";
980 fdt = "fdt-NAME";
981 fit,compatible; // optional
982 };
983 };
984
Simon Glassa435cd12020-09-01 05:13:59 -0600985Note that if no devicetree files are provided (with '-a of-list' as above)
986then no nodes will be generated.
987
Simon Glass5f7aadf2024-07-20 11:49:47 +0100988The 'fit,compatible' property (if present) is replaced with the compatible
989string from the root node of the devicetree, so that things work correctly
990with FIT's configuration-matching algortihm.
991
Simon Glassa04b9942024-07-20 11:49:48 +0100992Dealing with phases
993~~~~~~~~~~~~~~~~~~~
994
995FIT can be used to load firmware. In this case it may be necessary to run
996the devicetree for each model through fdtgrep to remove unwanted properties.
997The 'fit,fdt-phase' property can be provided to indicate the phase for which
998the devicetree is intended.
999
1000For example this indicates that the FDT should be processed for VPL::
1001
1002 images {
1003 @fdt-SEQ {
1004 description = "fdt-NAME";
1005 type = "flat_dt";
1006 compression = "none";
1007 fit,fdt-phase = "vpl";
1008 };
1009 };
1010
1011Using this mechanism, it is possible to generate a FIT which can provide VPL
1012images for multiple models, with TPL selecting the correct model to use. The
1013same approach can of course be used for SPL images.
1014
1015Note that the `of-spl-remove-props` entryarg can be used to indicate
1016additional properties to remove. It is often used to remove properties like
Tom Rinif06de772024-12-19 10:19:57 -06001017`clock-names` and `pinctrl-names` which are not needed in SPL builds. This
1018value is automatically passed to binman by the U-Boot build.
Simon Glassa04b9942024-07-20 11:49:48 +01001019
1020See :ref:`fdtgrep_filter` for more information.
1021
Simon Glass5f423422022-03-05 20:19:12 -07001022Generating nodes from an ELF file (split-elf)
1023~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1024
1025This uses the node as a template to generate multiple nodes. The following
1026special properties are available:
1027
1028split-elf
1029 Split an ELF file into a separate node for each segment. This uses the
1030 node as a template to generate multiple nodes. The following special
1031 properties are available:
1032
1033 fit,load
1034 Generates a `load = <...>` property with the load address of the
1035 segment
1036
1037 fit,entry
1038 Generates a `entry = <...>` property with the entry address of the
1039 ELF. This is only produced for the first entry
1040
1041 fit,data
1042 Generates a `data = <...>` property with the contents of the segment
1043
Jonas Karlman490f73c2023-01-21 19:02:12 +00001044 fit,firmware
1045 Generates a `firmware = <...>` property. Provides a list of possible
1046 nodes to be used as the `firmware` property value. The first valid
1047 node is picked as the firmware. Any remaining valid nodes is
1048 prepended to the `loadable` property generated by `fit,loadables`
1049
Simon Glass5f423422022-03-05 20:19:12 -07001050 fit,loadables
1051 Generates a `loadable = <...>` property with a list of the generated
1052 nodes (including all nodes if this operation is used multiple times)
1053
1054
1055Here is an example showing ATF, TEE and a device tree all combined::
1056
1057 fit {
1058 description = "test-desc";
1059 #address-cells = <1>;
1060 fit,fdt-list = "of-list";
1061
1062 images {
1063 u-boot {
1064 description = "U-Boot (64-bit)";
1065 type = "standalone";
1066 os = "U-Boot";
1067 arch = "arm64";
1068 compression = "none";
Simon Glass72cc5382022-10-20 18:22:39 -06001069 load = <CONFIG_TEXT_BASE>;
Simon Glass5f423422022-03-05 20:19:12 -07001070 u-boot-nodtb {
1071 };
1072 };
1073 @fdt-SEQ {
1074 description = "fdt-NAME.dtb";
1075 type = "flat_dt";
1076 compression = "none";
1077 };
1078 @atf-SEQ {
1079 fit,operation = "split-elf";
1080 description = "ARM Trusted Firmware";
1081 type = "firmware";
1082 arch = "arm64";
1083 os = "arm-trusted-firmware";
1084 compression = "none";
1085 fit,load;
1086 fit,entry;
1087 fit,data;
1088
1089 atf-bl31 {
1090 };
Jonas Karlmand2c7d902023-01-21 19:01:48 +00001091 hash {
1092 algo = "sha256";
1093 };
Simon Glass5f423422022-03-05 20:19:12 -07001094 };
1095
1096 @tee-SEQ {
1097 fit,operation = "split-elf";
1098 description = "TEE";
1099 type = "tee";
1100 arch = "arm64";
1101 os = "tee";
1102 compression = "none";
1103 fit,load;
1104 fit,entry;
1105 fit,data;
1106
1107 tee-os {
1108 };
Jonas Karlmand2c7d902023-01-21 19:01:48 +00001109 hash {
1110 algo = "sha256";
1111 };
Simon Glass5f423422022-03-05 20:19:12 -07001112 };
1113 };
1114
1115 configurations {
1116 default = "@config-DEFAULT-SEQ";
1117 @config-SEQ {
1118 description = "conf-NAME.dtb";
1119 fdt = "fdt-SEQ";
Jonas Karlman490f73c2023-01-21 19:02:12 +00001120 fit,firmware = "atf-1", "u-boot";
Simon Glass5f423422022-03-05 20:19:12 -07001121 fit,loadables;
1122 };
1123 };
1124 };
1125
1126If ATF-BL31 is available, this generates a node for each segment in the
1127ELF file, for example::
1128
1129 images {
1130 atf-1 {
1131 data = <...contents of first segment...>;
1132 data-offset = <0x00000000>;
1133 entry = <0x00040000>;
1134 load = <0x00040000>;
1135 compression = "none";
1136 os = "arm-trusted-firmware";
1137 arch = "arm64";
1138 type = "firmware";
1139 description = "ARM Trusted Firmware";
Jonas Karlmand2c7d902023-01-21 19:01:48 +00001140 hash {
1141 algo = "sha256";
1142 value = <...hash of first segment...>;
1143 };
Simon Glass5f423422022-03-05 20:19:12 -07001144 };
1145 atf-2 {
1146 data = <...contents of second segment...>;
1147 load = <0xff3b0000>;
1148 compression = "none";
1149 os = "arm-trusted-firmware";
1150 arch = "arm64";
1151 type = "firmware";
1152 description = "ARM Trusted Firmware";
Jonas Karlmand2c7d902023-01-21 19:01:48 +00001153 hash {
1154 algo = "sha256";
1155 value = <...hash of second segment...>;
1156 };
Simon Glass5f423422022-03-05 20:19:12 -07001157 };
1158 };
1159
1160The same applies for OP-TEE if that is available.
1161
1162If each binary is not available, the relevant template node (@atf-SEQ or
1163@tee-SEQ) is removed from the output.
1164
1165This also generates a `config-xxx` node for each device tree in `of-list`.
1166Note that the U-Boot build system uses `-a of-list=$(CONFIG_OF_LIST)`
1167so you can use `CONFIG_OF_LIST` to define that list. In this example it is
1168set up for `firefly-rk3399` with a single device tree and the default set
1169with `-a default-dt=$(CONFIG_DEFAULT_DEVICE_TREE)`, so the resulting output
1170is::
1171
1172 configurations {
1173 default = "config-1";
1174 config-1 {
Jonas Karlman490f73c2023-01-21 19:02:12 +00001175 loadables = "u-boot", "atf-2", "atf-3", "tee-1", "tee-2";
Simon Glass5f423422022-03-05 20:19:12 -07001176 description = "rk3399-firefly.dtb";
1177 fdt = "fdt-1";
Jonas Karlman490f73c2023-01-21 19:02:12 +00001178 firmware = "atf-1";
Simon Glass5f423422022-03-05 20:19:12 -07001179 };
1180 };
1181
Jonas Karlman490f73c2023-01-21 19:02:12 +00001182U-Boot SPL can then load the firmware (ATF) and all the loadables (U-Boot
1183proper, ATF and TEE), then proceed with the boot.
Simon Glass5f423422022-03-05 20:19:12 -07001184
Simon Glass45d556d2020-07-09 18:39:45 -06001185
Simon Glassa7c97782022-08-07 16:33:25 -06001186
1187.. _etype_fmap:
Simon Glass45d556d2020-07-09 18:39:45 -06001188
Simon Glass7a61c6b2018-07-17 13:25:37 -06001189Entry: fmap: An entry which contains an Fmap section
1190----------------------------------------------------
1191
1192Properties / Entry arguments:
1193 None
1194
1195FMAP is a simple format used by flashrom, an open-source utility for
1196reading and writing the SPI flash, typically on x86 CPUs. The format
1197provides flashrom with a list of areas, so it knows what it in the flash.
1198It can then read or write just a single area, instead of the whole flash.
1199
1200The format is defined by the flashrom project, in the file lib/fmap.h -
1201see www.flashrom.org/Flashrom for more information.
1202
1203When used, this entry will be populated with an FMAP which reflects the
1204entries in the current image. Note that any hierarchy is squashed, since
Simon Glassb1d414c2021-04-03 11:05:10 +13001205FMAP does not support this. Sections are represented as an area appearing
1206before its contents, so that it is possible to reconstruct the hierarchy
1207from the FMAP by using the offset information. This convention does not
1208seem to be documented, but is used in Chromium OS.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001209
Simon Glasscda991e2023-02-12 17:11:15 -07001210To mark an area as preserved, use the normal 'preserved' flag in the entry.
1211This will result in the corresponding FMAP area having the
1212FMAP_AREA_PRESERVE flag. This flag does not automatically propagate down to
1213child entries.
1214
Simon Glassb1d414c2021-04-03 11:05:10 +13001215CBFS entries appear as a single entry, i.e. the sub-entries are ignored.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001216
1217
Simon Glassb1d414c2021-04-03 11:05:10 +13001218
Simon Glassa7c97782022-08-07 16:33:25 -06001219.. _etype_gbb:
1220
Simon Glassc1ae83c2018-07-17 13:25:44 -06001221Entry: gbb: An entry which contains a Chromium OS Google Binary Block
1222---------------------------------------------------------------------
1223
1224Properties / Entry arguments:
1225 - hardware-id: Hardware ID to use for this build (a string)
1226 - keydir: Directory containing the public keys to use
1227 - bmpblk: Filename containing images used by recovery
1228
1229Chromium OS uses a GBB to store various pieces of information, in particular
1230the root and recovery keys that are used to verify the boot process. Some
1231more details are here:
1232
1233 https://www.chromium.org/chromium-os/firmware-porting-guide/2-concepts
1234
1235but note that the page dates from 2013 so is quite out of date. See
1236README.chromium for how to obtain the required keys and tools.
1237
1238
Simon Glassa7c97782022-08-07 16:33:25 -06001239
1240.. _etype_image_header:
Simon Glassc1ae83c2018-07-17 13:25:44 -06001241
Simon Glasscec34ba2019-07-08 14:25:28 -06001242Entry: image-header: An entry which contains a pointer to the FDT map
1243---------------------------------------------------------------------
1244
1245Properties / Entry arguments:
1246 location: Location of header ("start" or "end" of image). This is
1247 optional. If omitted then the entry must have an offset property.
1248
1249This adds an 8-byte entry to the start or end of the image, pointing to the
1250location of the FDT map. The format is a magic number followed by an offset
1251from the start or end of the image, in twos-compliment format.
1252
1253This entry must be in the top-level part of the image.
1254
1255NOTE: If the location is at the start/end, you will probably need to specify
1256sort-by-offset for the image, unless you actually put the image header
1257first/last in the entry list.
1258
1259
1260
Simon Glassa7c97782022-08-07 16:33:25 -06001261.. _etype_intel_cmc:
1262
Simon Glass8911fa12021-03-18 20:25:16 +13001263Entry: intel-cmc: Intel Chipset Micro Code (CMC) file
1264-----------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001265
1266Properties / Entry arguments:
1267 - filename: Filename of file to read into entry
1268
1269This file contains microcode for some devices in a special format. An
1270example filename is 'Microcode/C0_22211.BIN'.
1271
1272See README.x86 for information about x86 binary blobs.
1273
1274
1275
Simon Glassa7c97782022-08-07 16:33:25 -06001276.. _etype_intel_descriptor:
1277
Simon Glass7a61c6b2018-07-17 13:25:37 -06001278Entry: intel-descriptor: Intel flash descriptor block (4KB)
1279-----------------------------------------------------------
1280
1281Properties / Entry arguments:
1282 filename: Filename of file containing the descriptor. This is typically
1283 a 4KB binary file, sometimes called 'descriptor.bin'
1284
1285This entry is placed at the start of flash and provides information about
1286the SPI flash regions. In particular it provides the base address and
1287size of the ME (Management Engine) region, allowing us to place the ME
1288binary in the right place.
1289
1290With this entry in your image, the position of the 'intel-me' entry will be
1291fixed in the image, which avoids you needed to specify an offset for that
1292region. This is useful, because it is not possible to change the position
1293of the ME region without updating the descriptor.
1294
1295See README.x86 for information about x86 binary blobs.
1296
1297
1298
Simon Glassa7c97782022-08-07 16:33:25 -06001299.. _etype_intel_fit:
1300
Simon Glass232f90c2019-08-24 07:22:50 -06001301Entry: intel-fit: Intel Firmware Image Table (FIT)
1302--------------------------------------------------
1303
1304This entry contains a dummy FIT as required by recent Intel CPUs. The FIT
1305contains information about the firmware and microcode available in the
1306image.
1307
1308At present binman only supports a basic FIT with no microcode.
1309
1310
1311
Simon Glassa7c97782022-08-07 16:33:25 -06001312.. _etype_intel_fit_ptr:
1313
Simon Glass232f90c2019-08-24 07:22:50 -06001314Entry: intel-fit-ptr: Intel Firmware Image Table (FIT) pointer
1315--------------------------------------------------------------
1316
1317This entry contains a pointer to the FIT. It is required to be at address
13180xffffffc0 in the image.
1319
1320
1321
Simon Glassa7c97782022-08-07 16:33:25 -06001322.. _etype_intel_fsp:
1323
Simon Glass8911fa12021-03-18 20:25:16 +13001324Entry: intel-fsp: Intel Firmware Support Package (FSP) file
1325-----------------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001326
1327Properties / Entry arguments:
1328 - filename: Filename of file to read into entry
1329
1330This file contains binary blobs which are used on some devices to make the
1331platform work. U-Boot executes this code since it is not possible to set up
1332the hardware using U-Boot open-source code. Documentation is typically not
1333available in sufficient detail to allow this.
1334
1335An example filename is 'FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd'
1336
1337See README.x86 for information about x86 binary blobs.
1338
1339
1340
Simon Glassa7c97782022-08-07 16:33:25 -06001341.. _etype_intel_fsp_m:
1342
Simon Glass8911fa12021-03-18 20:25:16 +13001343Entry: intel-fsp-m: Intel Firmware Support Package (FSP) memory init
1344--------------------------------------------------------------------
Simon Glassba7985d2019-08-24 07:23:07 -06001345
1346Properties / Entry arguments:
1347 - filename: Filename of file to read into entry
1348
1349This file contains a binary blob which is used on some devices to set up
1350SDRAM. U-Boot executes this code in SPL so that it can make full use of
1351memory. Documentation is typically not available in sufficient detail to
1352allow U-Boot do this this itself..
1353
1354An example filename is 'fsp_m.bin'
1355
1356See README.x86 for information about x86 binary blobs.
1357
1358
Simon Glassa7c97782022-08-07 16:33:25 -06001359
1360.. _etype_intel_fsp_s:
Simon Glassba7985d2019-08-24 07:23:07 -06001361
Simon Glass8911fa12021-03-18 20:25:16 +13001362Entry: intel-fsp-s: Intel Firmware Support Package (FSP) silicon init
1363---------------------------------------------------------------------
Simon Glass4d9086d2019-10-20 21:31:35 -06001364
1365Properties / Entry arguments:
1366 - filename: Filename of file to read into entry
1367
1368This file contains a binary blob which is used on some devices to set up
1369the silicon. U-Boot executes this code in U-Boot proper after SDRAM is
1370running, so that it can make full use of memory. Documentation is typically
1371not available in sufficient detail to allow U-Boot do this this itself.
1372
1373An example filename is 'fsp_s.bin'
1374
1375See README.x86 for information about x86 binary blobs.
1376
1377
1378
Simon Glassa7c97782022-08-07 16:33:25 -06001379.. _etype_intel_fsp_t:
1380
Simon Glass8911fa12021-03-18 20:25:16 +13001381Entry: intel-fsp-t: Intel Firmware Support Package (FSP) temp ram init
1382----------------------------------------------------------------------
Simon Glass9ea87b22019-10-20 21:31:36 -06001383
1384Properties / Entry arguments:
1385 - filename: Filename of file to read into entry
1386
1387This file contains a binary blob which is used on some devices to set up
1388temporary memory (Cache-as-RAM or CAR). U-Boot executes this code in TPL so
1389that it has access to memory for its stack and initial storage.
1390
1391An example filename is 'fsp_t.bin'
1392
1393See README.x86 for information about x86 binary blobs.
1394
1395
Simon Glassa7c97782022-08-07 16:33:25 -06001396
1397.. _etype_intel_ifwi:
Simon Glass9ea87b22019-10-20 21:31:36 -06001398
Simon Glass8911fa12021-03-18 20:25:16 +13001399Entry: intel-ifwi: Intel Integrated Firmware Image (IFWI) file
1400--------------------------------------------------------------
Simon Glassc2f1aed2019-07-08 13:18:56 -06001401
1402Properties / Entry arguments:
1403 - filename: Filename of file to read into entry. This is either the
1404 IFWI file itself, or a file that can be converted into one using a
1405 tool
1406 - convert-fit: If present this indicates that the ifwitool should be
1407 used to convert the provided file into a IFWI.
1408
1409This file contains code and data used by the SoC that is required to make
1410it work. It includes U-Boot TPL, microcode, things related to the CSE
1411(Converged Security Engine, the microcontroller that loads all the firmware)
1412and other items beyond the wit of man.
1413
1414A typical filename is 'ifwi.bin' for an IFWI file, or 'fitimage.bin' for a
1415file that will be converted to an IFWI.
1416
1417The position of this entry is generally set by the intel-descriptor entry.
1418
1419The contents of the IFWI are specified by the subnodes of the IFWI node.
1420Each subnode describes an entry which is placed into the IFWFI with a given
1421sub-partition (and optional entry name).
1422
Simon Glass8a5e2492019-08-24 07:22:47 -06001423Properties for subnodes:
Simon Glass0ac96b62021-03-18 20:25:15 +13001424 - ifwi-subpart: sub-parition to put this entry into, e.g. "IBBP"
1425 - ifwi-entry: entry name t use, e.g. "IBBL"
1426 - ifwi-replace: if present, indicates that the item should be replaced
1427 in the IFWI. Otherwise it is added.
Simon Glass8a5e2492019-08-24 07:22:47 -06001428
Simon Glassc2f1aed2019-07-08 13:18:56 -06001429See README.x86 for information about x86 binary blobs.
1430
1431
1432
Simon Glassa7c97782022-08-07 16:33:25 -06001433.. _etype_intel_me:
1434
Simon Glass8911fa12021-03-18 20:25:16 +13001435Entry: intel-me: Intel Management Engine (ME) file
1436--------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001437
1438Properties / Entry arguments:
1439 - filename: Filename of file to read into entry
1440
1441This file contains code used by the SoC that is required to make it work.
1442The Management Engine is like a background task that runs things that are
Thomas Hebbfd37f242019-11-13 18:18:03 -08001443not clearly documented, but may include keyboard, display and network
Simon Glass7a61c6b2018-07-17 13:25:37 -06001444access. For platform that use ME it is not possible to disable it. U-Boot
1445does not directly execute code in the ME binary.
1446
1447A typical filename is 'me.bin'.
1448
Simon Glassc4056b82019-07-08 13:18:38 -06001449The position of this entry is generally set by the intel-descriptor entry.
1450
Simon Glass7a61c6b2018-07-17 13:25:37 -06001451See README.x86 for information about x86 binary blobs.
1452
1453
1454
Simon Glassa7c97782022-08-07 16:33:25 -06001455.. _etype_intel_mrc:
1456
Simon Glass8911fa12021-03-18 20:25:16 +13001457Entry: intel-mrc: Intel Memory Reference Code (MRC) file
1458--------------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001459
1460Properties / Entry arguments:
1461 - filename: Filename of file to read into entry
1462
1463This file contains code for setting up the SDRAM on some Intel systems. This
1464is executed by U-Boot when needed early during startup. A typical filename
1465is 'mrc.bin'.
1466
1467See README.x86 for information about x86 binary blobs.
1468
1469
1470
Simon Glassa7c97782022-08-07 16:33:25 -06001471.. _etype_intel_refcode:
1472
Simon Glass8911fa12021-03-18 20:25:16 +13001473Entry: intel-refcode: Intel Reference Code file
1474-----------------------------------------------
Simon Glass17b84eb2019-05-17 22:00:53 -06001475
1476Properties / Entry arguments:
1477 - filename: Filename of file to read into entry
1478
1479This file contains code for setting up the platform on some Intel systems.
1480This is executed by U-Boot when needed early during startup. A typical
1481filename is 'refcode.bin'.
1482
1483See README.x86 for information about x86 binary blobs.
1484
1485
1486
Simon Glassa7c97782022-08-07 16:33:25 -06001487.. _etype_intel_vbt:
1488
Simon Glass8911fa12021-03-18 20:25:16 +13001489Entry: intel-vbt: Intel Video BIOS Table (VBT) file
1490---------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001491
1492Properties / Entry arguments:
1493 - filename: Filename of file to read into entry
1494
1495This file contains code that sets up the integrated graphics subsystem on
1496some Intel SoCs. U-Boot executes this when the display is started up.
1497
1498See README.x86 for information about Intel binary blobs.
1499
1500
1501
Simon Glassa7c97782022-08-07 16:33:25 -06001502.. _etype_intel_vga:
1503
Simon Glass8911fa12021-03-18 20:25:16 +13001504Entry: intel-vga: Intel Video Graphics Adaptor (VGA) file
1505---------------------------------------------------------
Simon Glass7a61c6b2018-07-17 13:25:37 -06001506
1507Properties / Entry arguments:
1508 - filename: Filename of file to read into entry
1509
1510This file contains code that sets up the integrated graphics subsystem on
1511some Intel SoCs. U-Boot executes this when the display is started up.
1512
1513This is similar to the VBT file but in a different format.
1514
1515See README.x86 for information about Intel binary blobs.
1516
1517
1518
Simon Glassa7c97782022-08-07 16:33:25 -06001519.. _etype_mkimage:
1520
Simon Glass8911fa12021-03-18 20:25:16 +13001521Entry: mkimage: Binary produced by mkimage
1522------------------------------------------
Simon Glass48f3aad2020-07-09 18:39:31 -06001523
1524Properties / Entry arguments:
Simon Glass42074dc2022-08-13 11:40:47 -06001525 - args: Arguments to pass
Simon Glass8fbca772022-08-13 11:40:48 -06001526 - data-to-imagename: Indicates that the -d data should be passed in as
1527 the image name also (-n)
Quentin Schulz9b5c6482022-09-02 15:10:48 +02001528 - multiple-data-files: boolean to tell binman to pass all files as
1529 datafiles to mkimage instead of creating a temporary file the result
1530 of datafiles concatenation
Simon Glassda6a9082023-01-07 14:07:10 -07001531 - filename: filename of output binary generated by mkimage
Simon Glass48f3aad2020-07-09 18:39:31 -06001532
Simon Glass42074dc2022-08-13 11:40:47 -06001533The data passed to mkimage via the -d flag is collected from subnodes of the
1534mkimage node, e.g.::
Simon Glass48f3aad2020-07-09 18:39:31 -06001535
1536 mkimage {
Simon Glassda6a9082023-01-07 14:07:10 -07001537 filename = "imximage.bin";
Simon Glass48f3aad2020-07-09 18:39:31 -06001538 args = "-n test -T imximage";
1539
1540 u-boot-spl {
1541 };
1542 };
1543
Simon Glass42074dc2022-08-13 11:40:47 -06001544This calls mkimage to create an imximage with `u-boot-spl.bin` as the data
Simon Glassda6a9082023-01-07 14:07:10 -07001545file, with mkimage being called like this::
Simon Glass42074dc2022-08-13 11:40:47 -06001546
1547 mkimage -d <data_file> -n test -T imximage <output_file>
1548
1549The output from mkimage then becomes part of the image produced by
Simon Glassda6a9082023-01-07 14:07:10 -07001550binman but also is written into `imximage.bin` file. If you need to put
1551multiple things in the data file, you can use a section, or just multiple
1552subnodes like this::
Simon Glass42074dc2022-08-13 11:40:47 -06001553
1554 mkimage {
1555 args = "-n test -T imximage";
1556
1557 u-boot-spl {
1558 };
1559
1560 u-boot-tpl {
1561 };
1562 };
Simon Glass48f3aad2020-07-09 18:39:31 -06001563
Simon Glassda6a9082023-01-07 14:07:10 -07001564Note that binman places the contents (here SPL and TPL) into a single file
1565and passes that to mkimage using the -d option.
1566
Quentin Schulz9b5c6482022-09-02 15:10:48 +02001567To pass all datafiles untouched to mkimage::
1568
1569 mkimage {
Simon Glassda6a9082023-01-07 14:07:10 -07001570 args = "-n rk3399 -T rkspi";
1571 multiple-data-files;
Quentin Schulz9b5c6482022-09-02 15:10:48 +02001572
Simon Glassda6a9082023-01-07 14:07:10 -07001573 u-boot-tpl {
1574 };
Quentin Schulz9b5c6482022-09-02 15:10:48 +02001575
Simon Glassda6a9082023-01-07 14:07:10 -07001576 u-boot-spl {
1577 };
Quentin Schulz9b5c6482022-09-02 15:10:48 +02001578 };
1579
1580This calls mkimage to create a Rockchip RK3399-specific first stage
1581bootloader, made of TPL+SPL. Since this first stage bootloader requires to
1582align the TPL and SPL but also some weird hacks that is handled by mkimage
1583directly, binman is told to not perform the concatenation of datafiles prior
1584to passing the data to mkimage.
1585
Simon Glass948dd3a2022-02-08 11:49:58 -07001586To use CONFIG options in the arguments, use a string list instead, as in
1587this example which also produces four arguments::
1588
1589 mkimage {
1590 args = "-n", CONFIG_SYS_SOC, "-T imximage";
1591
1592 u-boot-spl {
1593 };
1594 };
1595
Simon Glass8fbca772022-08-13 11:40:48 -06001596If you need to pass the input data in with the -n argument as well, then use
1597the 'data-to-imagename' property::
1598
1599 mkimage {
1600 args = "-T imximage";
Simon Glassda6a9082023-01-07 14:07:10 -07001601 data-to-imagename;
Simon Glass8fbca772022-08-13 11:40:48 -06001602
1603 u-boot-spl {
1604 };
1605 };
1606
1607That will pass the data to mkimage both as the data file (with -d) and as
Simon Glassda6a9082023-01-07 14:07:10 -07001608the image name (with -n). In both cases, a filename is passed as the
1609argument, with the actual data being in that file.
Simon Glass948dd3a2022-02-08 11:49:58 -07001610
Simon Glassda6a9082023-01-07 14:07:10 -07001611If need to pass different data in with -n, then use an `imagename` subnode::
Simon Glassb1669752022-08-13 11:40:49 -06001612
1613 mkimage {
1614 args = "-T imximage";
1615
1616 imagename {
1617 blob {
1618 filename = "spl/u-boot-spl.cfgout"
1619 };
1620 };
1621
1622 u-boot-spl {
1623 };
1624 };
1625
1626This will pass in u-boot-spl as the input data and the .cfgout file as the
1627-n data.
1628
Simon Glassa7c97782022-08-07 16:33:25 -06001629
Simon Glassda6a9082023-01-07 14:07:10 -07001630
Simon Glassa4948b22023-01-11 16:10:14 -07001631.. _etype_null:
1632
1633Entry: null: An entry which has no contents of its own
1634------------------------------------------------------
1635
1636Note that the size property must be set since otherwise this entry does not
1637know how large it should be.
1638
1639The contents are set by the containing section, e.g. the section's pad
1640byte.
1641
1642
1643
Simon Glass4d972362024-06-23 11:55:03 -06001644.. _etype_nxp_imx8mcst:
1645
1646Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
1647-----------------------------------------------------------------------
1648
1649Properties / Entry arguments:
1650 - nxp,loader-address - loader address (SPL text base)
1651
1652
1653
1654.. _etype_nxp_imx8mimage:
1655
1656Entry: nxp-imx8mimage: NXP i.MX8M imx8mimage .cfg file generator and mkimage invoker
1657------------------------------------------------------------------------------------
1658
1659Properties / Entry arguments:
1660 - nxp,boot-from - device to boot from (e.g. 'sd')
1661 - nxp,loader-address - loader address (SPL text base)
1662 - nxp,rom-version - BootROM version ('2' for i.MX8M Nano and Plus)
1663
1664
1665
Alice Guo1d334022025-04-28 18:37:39 +08001666.. _etype_nxp_header_ddrfw:
1667
1668Entry: nxp-header-ddrfw: add a header to DDR PHY firmware images
1669----------------------------------------------------------------
1670
1671This entry is used to combine DDR PHY firmware images and their byte counts
1672together. See imx95_evk.rst for how to get DDR PHY Firmware Images.
1673
1674
1675
Simon Glassa7c97782022-08-07 16:33:25 -06001676.. _etype_opensbi:
Simon Glass48f3aad2020-07-09 18:39:31 -06001677
Bin Mengc0b15742021-05-10 20:23:33 +08001678Entry: opensbi: RISC-V OpenSBI fw_dynamic blob
1679----------------------------------------------
1680
1681Properties / Entry arguments:
1682 - opensbi-path: Filename of file to read into entry. This is typically
1683 called fw_dynamic.bin
1684
1685This entry holds the run-time firmware, typically started by U-Boot SPL.
1686See the U-Boot README for your architecture or board for how to use it. See
1687https://github.com/riscv/opensbi for more information about OpenSBI.
1688
1689
1690
Simon Glassa7c97782022-08-07 16:33:25 -06001691.. _etype_powerpc_mpc85xx_bootpg_resetvec:
1692
Jagdish Gediya311d4842018-09-03 21:35:08 +05301693Entry: powerpc-mpc85xx-bootpg-resetvec: PowerPC mpc85xx bootpg + resetvec code for U-Boot
1694-----------------------------------------------------------------------------------------
1695
1696Properties / Entry arguments:
1697 - filename: Filename of u-boot-br.bin (default 'u-boot-br.bin')
1698
Thomas Hebbfd37f242019-11-13 18:18:03 -08001699This entry is valid for PowerPC mpc85xx cpus. This entry holds
Jagdish Gediya311d4842018-09-03 21:35:08 +05301700'bootpg + resetvec' code for PowerPC mpc85xx CPUs which needs to be
1701placed at offset 'RESET_VECTOR_ADDRESS - 0xffc'.
1702
Simon Glass136dd352020-10-26 17:39:59 -06001703
Simon Glassa7c97782022-08-07 16:33:25 -06001704
1705.. _etype_pre_load:
Simon Glass136dd352020-10-26 17:39:59 -06001706
Philippe Reynesebe96cb2022-03-28 22:57:04 +02001707Entry: pre-load: Pre load image header
1708--------------------------------------
1709
1710Properties / Entry arguments:
Simon Glass9f571582022-08-13 11:40:43 -06001711 - pre-load-key-path: Path of the directory that store key (provided by
1712 the environment variable PRE_LOAD_KEY_PATH)
Philippe Reynesebe96cb2022-03-28 22:57:04 +02001713 - content: List of phandles to entries to sign
1714 - algo-name: Hash and signature algo to use for the signature
1715 - padding-name: Name of the padding (pkcs-1.5 or pss)
1716 - key-name: Filename of the private key to sign
1717 - header-size: Total size of the header
1718 - version: Version of the header
1719
1720This entry creates a pre-load header that contains a global
1721image signature.
1722
1723For example, this creates an image with a pre-load header and a binary::
1724
1725 binman {
1726 image2 {
1727 filename = "sandbox.bin";
1728
1729 pre-load {
1730 content = <&image>;
1731 algo-name = "sha256,rsa2048";
1732 padding-name = "pss";
1733 key-name = "private.pem";
1734 header-size = <4096>;
1735 version = <1>;
1736 };
1737
1738 image: blob-ext {
1739 filename = "sandbox.itb";
1740 };
1741 };
1742 };
1743
1744
1745
Jonas Karlman35305492023-02-25 19:01:33 +00001746.. _etype_rockchip_tpl:
1747
1748Entry: rockchip-tpl: Rockchip TPL binary
1749----------------------------------------
1750
1751Properties / Entry arguments:
1752 - rockchip-tpl-path: Filename of file to read into the entry,
1753 typically <soc>_ddr_<version>.bin
1754
1755This entry holds an external TPL binary used by some Rockchip SoCs
1756instead of normal U-Boot TPL, typically to initialize DRAM.
1757
1758
1759
Simon Glassa7c97782022-08-07 16:33:25 -06001760.. _etype_scp:
1761
Simon Glass8911fa12021-03-18 20:25:16 +13001762Entry: scp: System Control Processor (SCP) firmware blob
1763--------------------------------------------------------
Simon Glass136dd352020-10-26 17:39:59 -06001764
1765Properties / Entry arguments:
1766 - scp-path: Filename of file to read into the entry, typically scp.bin
1767
1768This entry holds firmware for an external platform-specific coprocessor.
Jagdish Gediya311d4842018-09-03 21:35:08 +05301769
1770
Simon Glass136dd352020-10-26 17:39:59 -06001771
Simon Glassa7c97782022-08-07 16:33:25 -06001772.. _etype_section:
1773
Simon Glass7a61c6b2018-07-17 13:25:37 -06001774Entry: section: Entry that contains other entries
1775-------------------------------------------------
1776
Simon Glasscc9a41c2021-11-23 11:03:49 -07001777A section is an entry which can contain other entries, thus allowing
1778hierarchical images to be created. See 'Sections and hierarchical images'
1779in the binman README for more information.
1780
1781The base implementation simply joins the various entries together, using
1782various rules about alignment, etc.
1783
1784Subclassing
1785~~~~~~~~~~~
1786
1787This class can be subclassed to support other file formats which hold
1788multiple entries, such as CBFS. To do this, override the following
1789functions. The documentation here describes what your function should do.
1790For example code, see etypes which subclass `Entry_section`, or `cbfs.py`
1791for a more involved example::
1792
1793 $ grep -l \(Entry_section tools/binman/etype/*.py
1794
1795ReadNode()
1796 Call `super().ReadNode()`, then read any special properties for the
1797 section. Then call `self.ReadEntries()` to read the entries.
1798
1799 Binman calls this at the start when reading the image description.
1800
1801ReadEntries()
1802 Read in the subnodes of the section. This may involve creating entries
1803 of a particular etype automatically, as well as reading any special
1804 properties in the entries. For each entry, entry.ReadNode() should be
1805 called, to read the basic entry properties. The properties should be
1806 added to `self._entries[]`, in the correct order, with a suitable name.
1807
1808 Binman calls this at the start when reading the image description.
1809
1810BuildSectionData(required)
1811 Create the custom file format that you want and return it as bytes.
1812 This likely sets up a file header, then loops through the entries,
1813 adding them to the file. For each entry, call `entry.GetData()` to
1814 obtain the data. If that returns None, and `required` is False, then
1815 this method must give up and return None. But if `required` is True then
1816 it should assume that all data is valid.
1817
1818 Binman calls this when packing the image, to find out the size of
1819 everything. It is called again at the end when building the final image.
1820
1821SetImagePos(image_pos):
1822 Call `super().SetImagePos(image_pos)`, then set the `image_pos` values
1823 for each of the entries. This should use the custom file format to find
1824 the `start offset` (and `image_pos`) of each entry. If the file format
1825 uses compression in such a way that there is no offset available (other
1826 than reading the whole file and decompressing it), then the offsets for
1827 affected entries can remain unset (`None`). The size should also be set
1828 if possible.
Simon Glass0ac96b62021-03-18 20:25:15 +13001829
Simon Glasscc9a41c2021-11-23 11:03:49 -07001830 Binman calls this after the image has been packed, to update the
1831 location that all the entries ended up at.
Simon Glass0ac96b62021-03-18 20:25:15 +13001832
Simon Glass637958f2021-11-23 21:09:50 -07001833ReadChildData(child, decomp, alt_format):
Simon Glasscc9a41c2021-11-23 11:03:49 -07001834 The default version of this may be good enough, if you are able to
1835 implement SetImagePos() correctly. But that is a bit of a bypass, so
1836 you can override this method to read from your custom file format. It
1837 should read the entire entry containing the custom file using
1838 `super().ReadData(True)`, then parse the file to get the data for the
1839 given child, then return that data.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001840
Simon Glasscc9a41c2021-11-23 11:03:49 -07001841 If your file format supports compression, the `decomp` argument tells
1842 you whether to return the compressed data (`decomp` is False) or to
1843 uncompress it first, then return the uncompressed data (`decomp` is
1844 True). This is used by the `binman extract -U` option.
Simon Glass21db0ff2020-09-01 05:13:54 -06001845
Simon Glass637958f2021-11-23 21:09:50 -07001846 If your entry supports alternative formats, the alt_format provides the
1847 alternative format that the user has selected. Your function should
1848 return data in that format. This is used by the 'binman extract -l'
1849 option.
1850
Simon Glasscc9a41c2021-11-23 11:03:49 -07001851 Binman calls this when reading in an image, in order to populate all the
1852 entries with the data from that image (`binman ls`).
1853
1854WriteChildData(child):
1855 Binman calls this after `child.data` is updated, to inform the custom
1856 file format about this, in case it needs to do updates.
1857
1858 The default version of this does nothing and probably needs to be
1859 overridden for the 'binman replace' command to work. Your version should
1860 use `child.data` to update the data for that child in the custom file
1861 format.
1862
1863 Binman calls this when updating an image that has been read in and in
1864 particular to update the data for a particular entry (`binman replace`)
1865
1866Properties / Entry arguments
1867~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1868
1869See :ref:`develop/package/binman:Image description format` for more
1870information.
1871
1872align-default
1873 Default alignment for this section, if no alignment is given in the
1874 entry
1875
1876pad-byte
1877 Pad byte to use when padding
1878
1879sort-by-offset
1880 True if entries should be sorted by offset, False if they must be
1881 in-order in the device tree description
1882
1883end-at-4gb
1884 Used to build an x86 ROM which ends at 4GB (2^32)
1885
1886name-prefix
1887 Adds a prefix to the name of every entry in the section when writing out
1888 the map
1889
1890skip-at-start
1891 Number of bytes before the first entry starts. These effectively adjust
1892 the starting offset of entries. For example, if this is 16, then the
1893 first entry would start at 16. An entry with offset = 20 would in fact
1894 be written at offset 4 in the image file, since the first 16 bytes are
1895 skipped when writing.
Simon Glassb1d414c2021-04-03 11:05:10 +13001896
Simon Glassda6a9082023-01-07 14:07:10 -07001897filename
1898 filename to write the unpadded section contents to within the output
1899 directory (None to skip this).
1900
Simon Glass39dd2152019-07-08 14:25:47 -06001901Since a section is also an entry, it inherits all the properies of entries
1902too.
1903
Simon Glasscc9a41c2021-11-23 11:03:49 -07001904Note that the `allow_missing` member controls whether this section permits
1905external blobs to be missing their contents. The option will produce an
1906image but of course it will not work. It is useful to make sure that
1907Continuous Integration systems can build without the binaries being
1908available. This is set by the `SetAllowMissing()` method, if
1909`--allow-missing` is passed to binman.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001910
1911
1912
Simon Glassa7c97782022-08-07 16:33:25 -06001913.. _etype_tee_os:
1914
Roger Quadros5cdcea02022-02-19 20:50:04 +02001915Entry: tee-os: Entry containing an OP-TEE Trusted OS (TEE) blob
1916---------------------------------------------------------------
1917
1918Properties / Entry arguments:
1919 - tee-os-path: Filename of file to read into entry. This is typically
Simon Glassad5cfe12023-01-07 14:07:14 -07001920 called tee.bin or tee.elf
Roger Quadros5cdcea02022-02-19 20:50:04 +02001921
1922This entry holds the run-time firmware, typically started by U-Boot SPL.
1923See the U-Boot README for your architecture or board for how to use it. See
1924https://github.com/OP-TEE/optee_os for more information about OP-TEE.
1925
Simon Glassad5cfe12023-01-07 14:07:14 -07001926Note that if the file is in ELF format, it must go in a FIT. In that case,
1927this entry will mark itself as absent, providing the data only through the
1928read_elf_segments() method.
1929
1930Marking this entry as absent means that it if is used in the wrong context
1931it can be automatically dropped. Thus it is possible to add an OP-TEE entry
1932like this::
1933
1934 binman {
1935 tee-os {
1936 };
1937 };
1938
1939and pass either an ELF or plain binary in with -a tee-os-path <filename>
1940and have binman do the right thing:
1941
1942 - include the entry if tee.bin is provided and it does NOT have the v1
1943 header
1944 - drop it otherwise
1945
1946When used within a FIT, we can do::
1947
1948 binman {
1949 fit {
1950 tee-os {
1951 };
1952 };
1953 };
1954
1955which will split the ELF into separate nodes for each segment, if an ELF
1956file is provided (see :ref:`etype_fit`), or produce a single node if the
1957OP-TEE binary v1 format is provided (see optee_doc_) .
1958
1959.. _optee_doc: https://optee.readthedocs.io/en/latest/architecture/core.html#partitioning-of-the-binary
1960
Roger Quadros5cdcea02022-02-19 20:50:04 +02001961
1962
Simon Glassa7c97782022-08-07 16:33:25 -06001963.. _etype_text:
1964
Simon Glass7a61c6b2018-07-17 13:25:37 -06001965Entry: text: An entry which contains text
1966-----------------------------------------
1967
1968The text can be provided either in the node itself or by a command-line
1969argument. There is a level of indirection to allow multiple text strings
1970and sharing of text.
1971
1972Properties / Entry arguments:
1973 text-label: The value of this string indicates the property / entry-arg
1974 that contains the string to place in the entry
1975 <xxx> (actual name is the value of text-label): contains the string to
1976 place in the entry.
Simon Glass47f6a622019-07-08 13:18:40 -06001977 <text>: The text to place in the entry (overrides the above mechanism).
1978 This is useful when the text is constant.
Simon Glass7a61c6b2018-07-17 13:25:37 -06001979
Simon Glass0ac96b62021-03-18 20:25:15 +13001980Example node::
Simon Glass7a61c6b2018-07-17 13:25:37 -06001981
1982 text {
1983 size = <50>;
1984 text-label = "message";
1985 };
1986
1987You can then use:
1988
1989 binman -amessage="this is my message"
1990
1991and binman will insert that string into the entry.
1992
Simon Glass0ac96b62021-03-18 20:25:15 +13001993It is also possible to put the string directly in the node::
Simon Glass7a61c6b2018-07-17 13:25:37 -06001994
1995 text {
1996 size = <8>;
1997 text-label = "message";
1998 message = "a message directly in the node"
1999 };
2000
Simon Glass0ac96b62021-03-18 20:25:15 +13002001or just::
Simon Glass47f6a622019-07-08 13:18:40 -06002002
2003 text {
2004 size = <8>;
2005 text = "some text directly in the node"
2006 };
2007
Simon Glass7a61c6b2018-07-17 13:25:37 -06002008The text is not itself nul-terminated. This can be achieved, if required,
2009by setting the size of the entry to something larger than the text.
2010
2011
2012
Neha Malcom Francis3b788942023-07-22 00:14:24 +05302013.. _etype_ti_board_config:
2014
2015Entry: ti-board-config: An entry containing a TI schema validated board config binary
2016-------------------------------------------------------------------------------------
2017
2018This etype supports generation of two kinds of board configuration
2019binaries: singular board config binary as well as combined board config
2020binary.
2021
2022Properties / Entry arguments:
2023 - config-file: File containing board configuration data in YAML
2024 - schema-file: File containing board configuration YAML schema against
2025 which the config file is validated
2026
2027Output files:
2028 - board config binary: File containing board configuration binary
2029
2030These above parameters are used only when the generated binary is
2031intended to be a single board configuration binary. Example::
2032
2033 my-ti-board-config {
2034 ti-board-config {
2035 config = "board-config.yaml";
2036 schema = "schema.yaml";
2037 };
2038 };
2039
2040To generate a combined board configuration binary, we pack the
2041needed individual binaries into a ti-board-config binary. In this case,
2042the available supported subnode names are board-cfg, pm-cfg, sec-cfg and
2043rm-cfg. The final binary is prepended with a header containing details about
2044the included board config binaries. Example::
2045
2046 my-combined-ti-board-config {
2047 ti-board-config {
2048 board-cfg {
2049 config = "board-cfg.yaml";
2050 schema = "schema.yaml";
2051 };
2052 sec-cfg {
2053 config = "sec-cfg.yaml";
2054 schema = "schema.yaml";
2055 };
2056 }
2057 }
2058
2059
2060
Neha Malcom Francis59be2552023-12-05 15:12:18 +05302061.. _etype_ti_dm:
2062
2063Entry: ti-dm: TI Device Manager (DM) blob
2064-----------------------------------------
2065
2066Properties / Entry arguments:
2067 - ti-dm-path: Filename of file to read into the entry, typically ti-dm.bin
2068
2069This entry holds the device manager responsible for resource and power management
2070in K3 devices. See https://software-dl.ti.com/tisci/esd/latest/ for more information
2071about TI DM.
2072
2073
2074
Neha Malcom Francis5f5f0a62023-07-22 00:14:25 +05302075.. _etype_ti_secure:
2076
2077Entry: ti-secure: Entry containing a TI x509 certificate binary
2078---------------------------------------------------------------
2079
2080Properties / Entry arguments:
2081 - content: List of phandles to entries to sign
2082 - keyfile: Filename of file containing key to sign binary with
2083 - sha: Hash function to be used for signing
Simon Glass0acb07f2024-06-23 11:55:04 -06002084 - auth-in-place: This is an integer field that contains two pieces
2085 of information:
2086
2087 - Lower Byte - Remains 0x02 as per our use case
2088 ( 0x02: Move the authenticated binary back to the header )
2089 - Upper Byte - The Host ID of the core owning the firewall
Neha Malcom Francis5f5f0a62023-07-22 00:14:25 +05302090
2091Output files:
2092 - input.<unique_name> - input file passed to openssl
2093 - config.<unique_name> - input file generated for openssl (which is
2094 used as the config file)
2095 - cert.<unique_name> - output file generated by openssl (which is
2096 used as the entry contents)
2097
Simon Glass0acb07f2024-06-23 11:55:04 -06002098Depending on auth-in-place information in the inputs, we read the
2099firewall nodes that describe the configurations of firewall that TIFS
2100will be doing after reading the certificate.
2101
2102The syntax of the firewall nodes are as such::
2103
2104 firewall-257-0 {
2105 id = <257>; /* The ID of the firewall being configured */
2106 region = <0>; /* Region number to configure */
2107
2108 control = /* The control register */
2109 <(FWCTRL_EN | FWCTRL_LOCK | FWCTRL_BG | FWCTRL_CACHE)>;
2110
2111 permissions = /* The permission registers */
2112 <((FWPRIVID_ALL << FWPRIVID_SHIFT) |
2113 FWPERM_SECURE_PRIV_RWCD |
2114 FWPERM_SECURE_USER_RWCD |
2115 FWPERM_NON_SECURE_PRIV_RWCD |
2116 FWPERM_NON_SECURE_USER_RWCD)>;
2117
2118 /* More defines can be found in k3-security.h */
2119
2120 start_address = /* The Start Address of the firewall */
2121 <0x0 0x0>;
2122 end_address = /* The End Address of the firewall */
2123 <0xff 0xffffffff>;
2124 };
2125
2126
Neha Malcom Francis5f5f0a62023-07-22 00:14:25 +05302127openssl signs the provided data, using the TI templated config file and
2128writes the signature in this entry. This allows verification that the
2129data is genuine.
2130
2131
2132
2133.. _etype_ti_secure_rom:
2134
2135Entry: ti-secure-rom: Entry containing a TI x509 certificate binary for images booted by ROM
2136--------------------------------------------------------------------------------------------
2137
2138Properties / Entry arguments:
2139 - keyfile: Filename of file containing key to sign binary with
2140 - combined: boolean if device follows combined boot flow
2141 - countersign: boolean if device contains countersigned system firmware
2142 - load: load address of SPL
2143 - sw-rev: software revision
2144 - sha: Hash function to be used for signing
2145 - core: core on which bootloader runs, valid cores are 'secure' and 'public'
2146 - content: phandle of SPL in case of legacy bootflow or phandles of component binaries
2147 in case of combined bootflow
Neha Malcom Francis14e93422023-10-23 13:31:02 +05302148 - core-opts (optional): lockstep (0) or split (2) mode set to 0 by default
Neha Malcom Francis5f5f0a62023-07-22 00:14:25 +05302149
2150The following properties are only for generating a combined bootflow binary:
2151 - sysfw-inner-cert: boolean if binary contains sysfw inner certificate
2152 - dm-data: boolean if binary contains dm-data binary
2153 - content-sbl: phandle of SPL binary
2154 - content-sysfw: phandle of sysfw binary
2155 - content-sysfw-data: phandle of sysfw-data or tifs-data binary
2156 - content-sysfw-inner-cert (optional): phandle of sysfw inner certificate binary
2157 - content-dm-data (optional): phandle of dm-data binary
2158 - load-sysfw: load address of sysfw binary
2159 - load-sysfw-data: load address of sysfw-data or tifs-data binary
2160 - load-sysfw-inner-cert (optional): load address of sysfw inner certificate binary
2161 - load-dm-data (optional): load address of dm-data binary
2162
2163Output files:
2164 - input.<unique_name> - input file passed to openssl
2165 - config.<unique_name> - input file generated for openssl (which is
2166 used as the config file)
2167 - cert.<unique_name> - output file generated by openssl (which is
2168 used as the entry contents)
2169
2170openssl signs the provided data, using the TI templated config file and
2171writes the signature in this entry. This allows verification that the
2172data is genuine.
2173
2174
2175
Simon Glassa7c97782022-08-07 16:33:25 -06002176.. _etype_u_boot:
2177
Simon Glass7a61c6b2018-07-17 13:25:37 -06002178Entry: u-boot: U-Boot flat binary
2179---------------------------------
2180
2181Properties / Entry arguments:
2182 - filename: Filename of u-boot.bin (default 'u-boot.bin')
2183
2184This is the U-Boot binary, containing relocation information to allow it
2185to relocate itself at runtime. The binary typically includes a device tree
Simon Glass718b5292021-03-18 20:25:07 +13002186blob at the end of it.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002187
Simon Glass18ed9962023-01-07 14:07:11 -07002188U-Boot can access binman symbols at runtime. See :ref:`binman_fdt`.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002189
Simon Glass718b5292021-03-18 20:25:07 +13002190Note that this entry is automatically replaced with u-boot-expanded unless
Simon Glass7098b7f2021-03-21 18:24:30 +13002191--no-expanded is used or the node has a 'no-expanded' property.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002192
2193
Simon Glass718b5292021-03-18 20:25:07 +13002194
Simon Glassa7c97782022-08-07 16:33:25 -06002195.. _etype_u_boot_dtb:
2196
Simon Glass7a61c6b2018-07-17 13:25:37 -06002197Entry: u-boot-dtb: U-Boot device tree
2198-------------------------------------
2199
2200Properties / Entry arguments:
2201 - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
2202
2203This is the U-Boot device tree, containing configuration information for
2204U-Boot. U-Boot needs this to know what devices are present and which drivers
2205to activate.
2206
Simon Glasse219aa42018-09-14 04:57:24 -06002207Note: This is mostly an internal entry type, used by others. This allows
2208binman to know which entries contain a device tree.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002209
2210
Simon Glassa7c97782022-08-07 16:33:25 -06002211
2212.. _etype_u_boot_dtb_with_ucode:
Simon Glass7a61c6b2018-07-17 13:25:37 -06002213
2214Entry: u-boot-dtb-with-ucode: A U-Boot device tree file, with the microcode removed
2215-----------------------------------------------------------------------------------
2216
2217Properties / Entry arguments:
2218 - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
2219
2220See Entry_u_boot_ucode for full details of the three entries involved in
2221this process. This entry provides the U-Boot device-tree file, which
2222contains the microcode. If the microcode is not being collated into one
2223place then the offset and size of the microcode is recorded by this entry,
Simon Glass537e0062021-03-18 20:24:54 +13002224for use by u-boot-with-ucode_ptr. If it is being collated, then this
Simon Glass7a61c6b2018-07-17 13:25:37 -06002225entry deletes the microcode from the device tree (to save space) and makes
Simon Glass537e0062021-03-18 20:24:54 +13002226it available to u-boot-ucode.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002227
2228
2229
Simon Glassa7c97782022-08-07 16:33:25 -06002230.. _etype_u_boot_elf:
2231
Simon Glassb1714232018-09-14 04:57:35 -06002232Entry: u-boot-elf: U-Boot ELF image
2233-----------------------------------
2234
2235Properties / Entry arguments:
2236 - filename: Filename of u-boot (default 'u-boot')
2237
2238This is the U-Boot ELF image. It does not include a device tree but can be
2239relocated to any address for execution.
2240
2241
Simon Glassa7c97782022-08-07 16:33:25 -06002242
2243.. _etype_u_boot_env:
Simon Glassb1714232018-09-14 04:57:35 -06002244
Simon Glass136dd352020-10-26 17:39:59 -06002245Entry: u-boot-env: An entry which contains a U-Boot environment
2246---------------------------------------------------------------
2247
2248Properties / Entry arguments:
2249 - filename: File containing the environment text, with each line in the
2250 form var=value
2251
2252
Simon Glass718b5292021-03-18 20:25:07 +13002253
Simon Glassa7c97782022-08-07 16:33:25 -06002254.. _etype_u_boot_expanded:
2255
Simon Glass718b5292021-03-18 20:25:07 +13002256Entry: u-boot-expanded: U-Boot flat binary broken out into its component parts
2257------------------------------------------------------------------------------
2258
2259This is a section containing the U-Boot binary and a devicetree. Using this
2260entry type automatically creates this section, with the following entries
2261in it:
2262
2263 u-boot-nodtb
2264 u-boot-dtb
2265
2266Having the devicetree separate allows binman to update it in the final
2267image, so that the entries positions are provided to the running U-Boot.
2268
2269
Simon Glass136dd352020-10-26 17:39:59 -06002270
Simon Glassa7c97782022-08-07 16:33:25 -06002271.. _etype_u_boot_img:
2272
Simon Glass7a61c6b2018-07-17 13:25:37 -06002273Entry: u-boot-img: U-Boot legacy image
2274--------------------------------------
2275
2276Properties / Entry arguments:
2277 - filename: Filename of u-boot.img (default 'u-boot.img')
2278
2279This is the U-Boot binary as a packaged image, in legacy format. It has a
2280header which allows it to be loaded at the correct address for execution.
2281
2282You should use FIT (Flat Image Tree) instead of the legacy image for new
2283applications.
2284
2285
2286
Simon Glassa7c97782022-08-07 16:33:25 -06002287.. _etype_u_boot_nodtb:
2288
Simon Glass7a61c6b2018-07-17 13:25:37 -06002289Entry: u-boot-nodtb: U-Boot flat binary without device tree appended
2290--------------------------------------------------------------------
2291
2292Properties / Entry arguments:
Simon Glass537e0062021-03-18 20:24:54 +13002293 - filename: Filename to include (default 'u-boot-nodtb.bin')
Simon Glass7a61c6b2018-07-17 13:25:37 -06002294
2295This is the U-Boot binary, containing relocation information to allow it
2296to relocate itself at runtime. It does not include a device tree blob at
Simon Glass537e0062021-03-18 20:24:54 +13002297the end of it so normally cannot work without it. You can add a u-boot-dtb
Simon Glass718b5292021-03-18 20:25:07 +13002298entry after this one, or use a u-boot entry instead, normally expands to a
2299section containing u-boot and u-boot-dtb
Simon Glass7a61c6b2018-07-17 13:25:37 -06002300
2301
2302
Simon Glassa7c97782022-08-07 16:33:25 -06002303.. _etype_u_boot_spl:
2304
Simon Glass7a61c6b2018-07-17 13:25:37 -06002305Entry: u-boot-spl: U-Boot SPL binary
2306------------------------------------
2307
2308Properties / Entry arguments:
2309 - filename: Filename of u-boot-spl.bin (default 'spl/u-boot-spl.bin')
2310
2311This is the U-Boot SPL (Secondary Program Loader) binary. This is a small
2312binary which loads before U-Boot proper, typically into on-chip SRAM. It is
2313responsible for locating, loading and jumping to U-Boot. Note that SPL is
2314not relocatable so must be loaded to the correct address in SRAM, or written
Simon Glass8425a1f2018-07-17 13:25:48 -06002315to run from the correct address if direct flash execution is possible (e.g.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002316on x86 devices).
2317
Simon Glass18ed9962023-01-07 14:07:11 -07002318SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002319
2320in the binman README for more information.
2321
2322The ELF file 'spl/u-boot-spl' must also be available for this to work, since
2323binman uses that to look up symbols to write into the SPL binary.
2324
Simon Glass718b5292021-03-18 20:25:07 +13002325Note that this entry is automatically replaced with u-boot-spl-expanded
Simon Glass7098b7f2021-03-21 18:24:30 +13002326unless --no-expanded is used or the node has a 'no-expanded' property.
Simon Glass718b5292021-03-18 20:25:07 +13002327
Simon Glass7a61c6b2018-07-17 13:25:37 -06002328
2329
Simon Glassa7c97782022-08-07 16:33:25 -06002330.. _etype_u_boot_spl_bss_pad:
2331
Simon Glass7a61c6b2018-07-17 13:25:37 -06002332Entry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region
2333---------------------------------------------------------------------
2334
2335Properties / Entry arguments:
2336 None
2337
Simon Glass308939b2021-03-18 20:24:55 +13002338This holds the padding added after the SPL binary to cover the BSS (Block
2339Started by Symbol) region. This region holds the various variables used by
2340SPL. It is set to 0 by SPL when it starts up. If you want to append data to
2341the SPL image (such as a device tree file), you must pad out the BSS region
2342to avoid the data overlapping with U-Boot variables. This entry is useful in
2343that case. It automatically pads out the entry size to cover both the code,
2344data and BSS.
2345
2346The contents of this entry will a certain number of zero bytes, determined
2347by __bss_size
Simon Glass7a61c6b2018-07-17 13:25:37 -06002348
2349The ELF file 'spl/u-boot-spl' must also be available for this to work, since
2350binman uses that to look up the BSS address.
2351
2352
2353
Simon Glassa7c97782022-08-07 16:33:25 -06002354.. _etype_u_boot_spl_dtb:
2355
Simon Glass7a61c6b2018-07-17 13:25:37 -06002356Entry: u-boot-spl-dtb: U-Boot SPL device tree
2357---------------------------------------------
2358
2359Properties / Entry arguments:
2360 - filename: Filename of u-boot.dtb (default 'spl/u-boot-spl.dtb')
2361
2362This is the SPL device tree, containing configuration information for
2363SPL. SPL needs this to know what devices are present and which drivers
2364to activate.
2365
2366
Simon Glassa7c97782022-08-07 16:33:25 -06002367
2368.. _etype_u_boot_spl_elf:
Simon Glass7a61c6b2018-07-17 13:25:37 -06002369
Simon Glassb1714232018-09-14 04:57:35 -06002370Entry: u-boot-spl-elf: U-Boot SPL ELF image
2371-------------------------------------------
2372
2373Properties / Entry arguments:
Simon Glass5dcc21d2019-07-08 13:18:45 -06002374 - filename: Filename of SPL u-boot (default 'spl/u-boot-spl')
Simon Glassb1714232018-09-14 04:57:35 -06002375
2376This is the U-Boot SPL ELF image. It does not include a device tree but can
2377be relocated to any address for execution.
2378
Simon Glass718b5292021-03-18 20:25:07 +13002379
2380
Simon Glassa7c97782022-08-07 16:33:25 -06002381.. _etype_u_boot_spl_expanded:
2382
Simon Glass718b5292021-03-18 20:25:07 +13002383Entry: u-boot-spl-expanded: U-Boot SPL flat binary broken out into its component parts
2384--------------------------------------------------------------------------------------
2385
2386Properties / Entry arguments:
2387 - spl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
2388 select)
2389
2390This is a section containing the U-Boot binary, BSS padding if needed and a
2391devicetree. Using this entry type automatically creates this section, with
2392the following entries in it:
2393
2394 u-boot-spl-nodtb
2395 u-boot-spl-bss-pad
2396 u-boot-dtb
2397
2398Having the devicetree separate allows binman to update it in the final
2399image, so that the entries positions are provided to the running U-Boot.
2400
2401This entry is selected based on the value of the 'spl-dtb' entryarg. If
2402this is non-empty (and not 'n' or '0') then this expanded entry is selected.
Simon Glassb1714232018-09-14 04:57:35 -06002403
2404
Simon Glassa7c97782022-08-07 16:33:25 -06002405
2406.. _etype_u_boot_spl_nodtb:
Simon Glass718b5292021-03-18 20:25:07 +13002407
Simon Glass7a61c6b2018-07-17 13:25:37 -06002408Entry: u-boot-spl-nodtb: SPL binary without device tree appended
2409----------------------------------------------------------------
2410
2411Properties / Entry arguments:
Simon Glass537e0062021-03-18 20:24:54 +13002412 - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin')
Simon Glass7a61c6b2018-07-17 13:25:37 -06002413
2414This is the U-Boot SPL binary, It does not include a device tree blob at
2415the end of it so may not be able to work without it, assuming SPL needs
Simon Glass537e0062021-03-18 20:24:54 +13002416a device tree to operate on your platform. You can add a u-boot-spl-dtb
Simon Glass718b5292021-03-18 20:25:07 +13002417entry after this one, or use a u-boot-spl entry instead' which normally
2418expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
2419u-boot-spl-dtb
Simon Glass7a61c6b2018-07-17 13:25:37 -06002420
Simon Glass18ed9962023-01-07 14:07:11 -07002421SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
Simon Glass31e04cb2021-03-18 20:24:56 +13002422
Simon Glass31e04cb2021-03-18 20:24:56 +13002423The ELF file 'spl/u-boot-spl' must also be available for this to work, since
2424binman uses that to look up symbols to write into the SPL binary.
2425
Simon Glass7a61c6b2018-07-17 13:25:37 -06002426
2427
Lukas Funkeb4937da2023-07-18 13:53:15 +02002428.. _etype_u_boot_spl_pubkey_dtb:
2429
2430Entry: u-boot-spl-pubkey-dtb: U-Boot SPL device tree including public key
2431-------------------------------------------------------------------------
2432
2433Properties / Entry arguments:
2434 - key-name-hint: Public key name without extension (.crt).
2435 Default is determined by underlying
2436 bintool (fdt_add_pubkey), usually 'key'.
2437 - algo: (Optional) Algorithm used for signing. Default is determined by
2438 underlying bintool (fdt_add_pubkey), usually 'sha1,rsa2048'
2439 - required: (Optional) If present this indicates that the key must be
2440 verified for the image / configuration to be
2441 considered valid
2442
2443The following example shows an image containing an SPL which
2444is packed together with the dtb. Binman will add a signature
2445node to the dtb.
2446
2447Example node::
2448
2449 image {
2450 ...
2451 spl {
2452 filename = "spl.bin"
2453
2454 u-boot-spl-nodtb {
2455 };
2456 u-boot-spl-pubkey-dtb {
2457 algo = "sha384,rsa4096";
2458 required = "conf";
2459 key-name-hint = "dev";
2460 };
2461 };
2462 ...
2463 }
2464
2465
2466
Simon Glassa7c97782022-08-07 16:33:25 -06002467.. _etype_u_boot_spl_with_ucode_ptr:
2468
Simon Glass7a61c6b2018-07-17 13:25:37 -06002469Entry: u-boot-spl-with-ucode-ptr: U-Boot SPL with embedded microcode pointer
2470----------------------------------------------------------------------------
2471
Simon Glass3fb4f422018-09-14 04:57:32 -06002472This is used when SPL must set up the microcode for U-Boot.
2473
Simon Glass7a61c6b2018-07-17 13:25:37 -06002474See Entry_u_boot_ucode for full details of the entries involved in this
2475process.
2476
2477
2478
Simon Glassa7c97782022-08-07 16:33:25 -06002479.. _etype_u_boot_tpl:
2480
Simon Glass8425a1f2018-07-17 13:25:48 -06002481Entry: u-boot-tpl: U-Boot TPL binary
2482------------------------------------
2483
2484Properties / Entry arguments:
2485 - filename: Filename of u-boot-tpl.bin (default 'tpl/u-boot-tpl.bin')
2486
2487This is the U-Boot TPL (Tertiary Program Loader) binary. This is a small
2488binary which loads before SPL, typically into on-chip SRAM. It is
2489responsible for locating, loading and jumping to SPL, the next-stage
2490loader. Note that SPL is not relocatable so must be loaded to the correct
2491address in SRAM, or written to run from the correct address if direct
2492flash execution is possible (e.g. on x86 devices).
2493
Simon Glass18ed9962023-01-07 14:07:11 -07002494SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
Simon Glass8425a1f2018-07-17 13:25:48 -06002495
2496in the binman README for more information.
2497
2498The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
2499binman uses that to look up symbols to write into the TPL binary.
2500
Simon Glass718b5292021-03-18 20:25:07 +13002501Note that this entry is automatically replaced with u-boot-tpl-expanded
Simon Glass7098b7f2021-03-21 18:24:30 +13002502unless --no-expanded is used or the node has a 'no-expanded' property.
Simon Glass718b5292021-03-18 20:25:07 +13002503
Simon Glass8425a1f2018-07-17 13:25:48 -06002504
2505
Simon Glassa7c97782022-08-07 16:33:25 -06002506.. _etype_u_boot_tpl_bss_pad:
2507
Simon Glass63f41d42021-03-18 20:24:58 +13002508Entry: u-boot-tpl-bss-pad: U-Boot TPL binary padded with a BSS region
2509---------------------------------------------------------------------
2510
2511Properties / Entry arguments:
2512 None
2513
2514This holds the padding added after the TPL binary to cover the BSS (Block
2515Started by Symbol) region. This region holds the various variables used by
2516TPL. It is set to 0 by TPL when it starts up. If you want to append data to
2517the TPL image (such as a device tree file), you must pad out the BSS region
2518to avoid the data overlapping with U-Boot variables. This entry is useful in
2519that case. It automatically pads out the entry size to cover both the code,
2520data and BSS.
2521
2522The contents of this entry will a certain number of zero bytes, determined
2523by __bss_size
2524
2525The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
2526binman uses that to look up the BSS address.
2527
2528
2529
Simon Glassa7c97782022-08-07 16:33:25 -06002530.. _etype_u_boot_tpl_dtb:
2531
Simon Glass8425a1f2018-07-17 13:25:48 -06002532Entry: u-boot-tpl-dtb: U-Boot TPL device tree
2533---------------------------------------------
2534
2535Properties / Entry arguments:
2536 - filename: Filename of u-boot.dtb (default 'tpl/u-boot-tpl.dtb')
2537
2538This is the TPL device tree, containing configuration information for
2539TPL. TPL needs this to know what devices are present and which drivers
2540to activate.
2541
2542
2543
Simon Glassa7c97782022-08-07 16:33:25 -06002544.. _etype_u_boot_tpl_dtb_with_ucode:
2545
Simon Glass3fb4f422018-09-14 04:57:32 -06002546Entry: u-boot-tpl-dtb-with-ucode: U-Boot TPL with embedded microcode pointer
2547----------------------------------------------------------------------------
2548
2549This is used when TPL must set up the microcode for U-Boot.
2550
2551See Entry_u_boot_ucode for full details of the entries involved in this
2552process.
2553
2554
2555
Simon Glassa7c97782022-08-07 16:33:25 -06002556.. _etype_u_boot_tpl_elf:
2557
Simon Glassa899f712019-07-08 13:18:46 -06002558Entry: u-boot-tpl-elf: U-Boot TPL ELF image
2559-------------------------------------------
2560
2561Properties / Entry arguments:
2562 - filename: Filename of TPL u-boot (default 'tpl/u-boot-tpl')
2563
2564This is the U-Boot TPL ELF image. It does not include a device tree but can
2565be relocated to any address for execution.
2566
2567
Simon Glassa7c97782022-08-07 16:33:25 -06002568
2569.. _etype_u_boot_tpl_expanded:
Simon Glassa899f712019-07-08 13:18:46 -06002570
Simon Glass718b5292021-03-18 20:25:07 +13002571Entry: u-boot-tpl-expanded: U-Boot TPL flat binary broken out into its component parts
2572--------------------------------------------------------------------------------------
2573
2574Properties / Entry arguments:
2575 - tpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
2576 select)
2577
2578This is a section containing the U-Boot binary, BSS padding if needed and a
2579devicetree. Using this entry type automatically creates this section, with
2580the following entries in it:
2581
2582 u-boot-tpl-nodtb
2583 u-boot-tpl-bss-pad
2584 u-boot-dtb
2585
2586Having the devicetree separate allows binman to update it in the final
2587image, so that the entries positions are provided to the running U-Boot.
2588
2589This entry is selected based on the value of the 'tpl-dtb' entryarg. If
2590this is non-empty (and not 'n' or '0') then this expanded entry is selected.
2591
2592
2593
Simon Glassa7c97782022-08-07 16:33:25 -06002594.. _etype_u_boot_tpl_nodtb:
2595
Simon Glassc98de972021-03-18 20:24:57 +13002596Entry: u-boot-tpl-nodtb: TPL binary without device tree appended
2597----------------------------------------------------------------
2598
2599Properties / Entry arguments:
2600 - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin')
2601
2602This is the U-Boot TPL binary, It does not include a device tree blob at
2603the end of it so may not be able to work without it, assuming TPL needs
2604a device tree to operate on your platform. You can add a u-boot-tpl-dtb
Simon Glass718b5292021-03-18 20:25:07 +13002605entry after this one, or use a u-boot-tpl entry instead, which normally
2606expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and
2607u-boot-tpl-dtb
Simon Glassc98de972021-03-18 20:24:57 +13002608
Simon Glass18ed9962023-01-07 14:07:11 -07002609TPL can access binman symbols at runtime. See :ref:`binman_fdt`.
Simon Glassc98de972021-03-18 20:24:57 +13002610
Simon Glassc98de972021-03-18 20:24:57 +13002611The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
2612binman uses that to look up symbols to write into the TPL binary.
2613
2614
Simon Glassa7c97782022-08-07 16:33:25 -06002615
2616.. _etype_u_boot_tpl_with_ucode_ptr:
Simon Glassc98de972021-03-18 20:24:57 +13002617
Simon Glass3fb4f422018-09-14 04:57:32 -06002618Entry: u-boot-tpl-with-ucode-ptr: U-Boot TPL with embedded microcode pointer
2619----------------------------------------------------------------------------
2620
2621See Entry_u_boot_ucode for full details of the entries involved in this
2622process.
2623
2624
2625
Simon Glassa7c97782022-08-07 16:33:25 -06002626.. _etype_u_boot_ucode:
2627
Simon Glass7a61c6b2018-07-17 13:25:37 -06002628Entry: u-boot-ucode: U-Boot microcode block
2629-------------------------------------------
2630
2631Properties / Entry arguments:
2632 None
2633
2634The contents of this entry are filled in automatically by other entries
2635which must also be in the image.
2636
2637U-Boot on x86 needs a single block of microcode. This is collected from
2638the various microcode update nodes in the device tree. It is also unable
2639to read the microcode from the device tree on platforms that use FSP
2640(Firmware Support Package) binaries, because the API requires that the
2641microcode is supplied before there is any SRAM available to use (i.e.
2642the FSP sets up the SRAM / cache-as-RAM but does so in the call that
2643requires the microcode!). To keep things simple, all x86 platforms handle
2644microcode the same way in U-Boot (even non-FSP platforms). This is that
2645a table is placed at _dt_ucode_base_size containing the base address and
2646size of the microcode. This is either passed to the FSP (for FSP
2647platforms), or used to set up the microcode (for non-FSP platforms).
2648This all happens in the build system since it is the only way to get
2649the microcode into a single blob and accessible without SRAM.
2650
2651There are two cases to handle. If there is only one microcode blob in
2652the device tree, then the ucode pointer it set to point to that. This
2653entry (u-boot-ucode) is empty. If there is more than one update, then
2654this entry holds the concatenation of all updates, and the device tree
2655entry (u-boot-dtb-with-ucode) is updated to remove the microcode. This
2656last step ensures that that the microcode appears in one contiguous
2657block in the image and is not unnecessarily duplicated in the device
2658tree. It is referred to as 'collation' here.
2659
2660Entry types that have a part to play in handling microcode:
2661
2662 Entry_u_boot_with_ucode_ptr:
2663 Contains u-boot-nodtb.bin (i.e. U-Boot without the device tree).
2664 It updates it with the address and size of the microcode so that
2665 U-Boot can find it early on start-up.
2666 Entry_u_boot_dtb_with_ucode:
2667 Contains u-boot.dtb. It stores the microcode in a
2668 'self.ucode_data' property, which is then read by this class to
2669 obtain the microcode if needed. If collation is performed, it
2670 removes the microcode from the device tree.
2671 Entry_u_boot_ucode:
2672 This class. If collation is enabled it reads the microcode from
2673 the Entry_u_boot_dtb_with_ucode entry, and uses it as the
2674 contents of this entry.
2675
2676
2677
Simon Glassda6a9082023-01-07 14:07:10 -07002678.. _etype_u_boot_vpl:
2679
2680Entry: u-boot-vpl: U-Boot VPL binary
2681------------------------------------
2682
2683Properties / Entry arguments:
2684 - filename: Filename of u-boot-vpl.bin (default 'vpl/u-boot-vpl.bin')
2685
2686This is the U-Boot VPL (Verifying Program Loader) binary. This is a small
2687binary which loads before SPL, typically into on-chip SRAM. It is
2688responsible for locating, loading and jumping to SPL, the next-stage
2689loader. Note that VPL is not relocatable so must be loaded to the correct
2690address in SRAM, or written to run from the correct address if direct
2691flash execution is possible (e.g. on x86 devices).
2692
Simon Glass18ed9962023-01-07 14:07:11 -07002693SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
Simon Glassda6a9082023-01-07 14:07:10 -07002694
2695in the binman README for more information.
2696
2697The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
2698binman uses that to look up symbols to write into the VPL binary.
2699
Simon Glass6b5110b2024-07-20 11:49:39 +01002700Note that this entry is automatically replaced with u-boot-vpl-expanded
2701unless --no-expanded is used or the node has a 'no-expanded' property.
2702
Simon Glassda6a9082023-01-07 14:07:10 -07002703
2704
2705.. _etype_u_boot_vpl_bss_pad:
2706
2707Entry: u-boot-vpl-bss-pad: U-Boot VPL binary padded with a BSS region
2708---------------------------------------------------------------------
2709
2710Properties / Entry arguments:
2711 None
2712
2713This holds the padding added after the VPL binary to cover the BSS (Block
2714Started by Symbol) region. This region holds the various variables used by
2715VPL. It is set to 0 by VPL when it starts up. If you want to append data to
2716the VPL image (such as a device tree file), you must pad out the BSS region
2717to avoid the data overlapping with U-Boot variables. This entry is useful in
2718that case. It automatically pads out the entry size to cover both the code,
2719data and BSS.
2720
2721The contents of this entry will a certain number of zero bytes, determined
2722by __bss_size
2723
2724The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
2725binman uses that to look up the BSS address.
2726
2727
2728
2729.. _etype_u_boot_vpl_dtb:
2730
2731Entry: u-boot-vpl-dtb: U-Boot VPL device tree
2732---------------------------------------------
2733
2734Properties / Entry arguments:
2735 - filename: Filename of u-boot.dtb (default 'vpl/u-boot-vpl.dtb')
2736
2737This is the VPL device tree, containing configuration information for
2738VPL. VPL needs this to know what devices are present and which drivers
2739to activate.
2740
2741
2742
2743.. _etype_u_boot_vpl_elf:
2744
2745Entry: u-boot-vpl-elf: U-Boot VPL ELF image
2746-------------------------------------------
2747
2748Properties / Entry arguments:
2749 - filename: Filename of VPL u-boot (default 'vpl/u-boot-vpl')
2750
2751This is the U-Boot VPL ELF image. It does not include a device tree but can
2752be relocated to any address for execution.
2753
2754
2755
2756.. _etype_u_boot_vpl_expanded:
2757
2758Entry: u-boot-vpl-expanded: U-Boot VPL flat binary broken out into its component parts
2759--------------------------------------------------------------------------------------
2760
2761Properties / Entry arguments:
2762 - vpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
2763 select)
2764
2765This is a section containing the U-Boot binary, BSS padding if needed and a
2766devicetree. Using this entry type automatically creates this section, with
2767the following entries in it:
2768
2769 u-boot-vpl-nodtb
2770 u-boot-vpl-bss-pad
2771 u-boot-dtb
2772
2773Having the devicetree separate allows binman to update it in the final
2774image, so that the entries positions are provided to the running U-Boot.
2775
2776This entry is selected based on the value of the 'vpl-dtb' entryarg. If
2777this is non-empty (and not 'n' or '0') then this expanded entry is selected.
2778
2779
2780
2781.. _etype_u_boot_vpl_nodtb:
2782
2783Entry: u-boot-vpl-nodtb: VPL binary without device tree appended
2784----------------------------------------------------------------
2785
2786Properties / Entry arguments:
2787 - filename: Filename to include (default 'vpl/u-boot-vpl-nodtb.bin')
2788
2789This is the U-Boot VPL binary, It does not include a device tree blob at
2790the end of it so may not be able to work without it, assuming VPL needs
Simon Glass6b5110b2024-07-20 11:49:39 +01002791a device tree to operate on your platform. You can add a u-boot-vpl-dtb
2792entry after this one, or use a u-boot-vpl entry instead, which normally
Simon Glassda6a9082023-01-07 14:07:10 -07002793expands to a section containing u-boot-vpl-dtb, u-boot-vpl-bss-pad and
2794u-boot-vpl-dtb
2795
Simon Glass18ed9962023-01-07 14:07:11 -07002796VPL can access binman symbols at runtime. See :ref:`binman_fdt`.
Simon Glassda6a9082023-01-07 14:07:10 -07002797
2798The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
2799binman uses that to look up symbols to write into the VPL binary.
2800
2801
2802
Simon Glassa7c97782022-08-07 16:33:25 -06002803.. _etype_u_boot_with_ucode_ptr:
2804
Simon Glass7a61c6b2018-07-17 13:25:37 -06002805Entry: u-boot-with-ucode-ptr: U-Boot with embedded microcode pointer
2806--------------------------------------------------------------------
2807
2808Properties / Entry arguments:
Masahiro Yamadaa7a0ca42019-12-14 13:47:26 +09002809 - filename: Filename of u-boot-nodtb.bin (default 'u-boot-nodtb.bin')
Simon Glassee21d3a2018-09-14 04:57:07 -06002810 - optional-ucode: boolean property to make microcode optional. If the
2811 u-boot.bin image does not include microcode, no error will
2812 be generated.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002813
2814See Entry_u_boot_ucode for full details of the three entries involved in
2815this process. This entry updates U-Boot with the offset and size of the
2816microcode, to allow early x86 boot code to find it without doing anything
Simon Glass537e0062021-03-18 20:24:54 +13002817complicated. Otherwise it is the same as the u-boot entry.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002818
2819
2820
Simon Glassa7c97782022-08-07 16:33:25 -06002821.. _etype_vblock:
2822
Simon Glass5c350162018-07-17 13:25:47 -06002823Entry: vblock: An entry which contains a Chromium OS verified boot block
2824------------------------------------------------------------------------
2825
2826Properties / Entry arguments:
Simon Glass17b84eb2019-05-17 22:00:53 -06002827 - content: List of phandles to entries to sign
Simon Glass5c350162018-07-17 13:25:47 -06002828 - keydir: Directory containing the public keys to use
2829 - keyblock: Name of the key file to use (inside keydir)
2830 - signprivate: Name of provide key file to use (inside keydir)
2831 - version: Version number of the vblock (typically 1)
2832 - kernelkey: Name of the kernel key to use (inside keydir)
2833 - preamble-flags: Value of the vboot preamble flags (typically 0)
2834
Simon Glass639505b2018-09-14 04:57:11 -06002835Output files:
2836 - input.<unique_name> - input file passed to futility
2837 - vblock.<unique_name> - output file generated by futility (which is
2838 used as the entry contents)
2839
Jagdish Gediya311d4842018-09-03 21:35:08 +05302840Chromium OS signs the read-write firmware and kernel, writing the signature
Simon Glass5c350162018-07-17 13:25:47 -06002841in this block. This allows U-Boot to verify that the next firmware stage
2842and kernel are genuine.
2843
2844
2845
Simon Glassc3fe97f2023-03-02 17:02:45 -07002846.. _etype_x509_cert:
2847
2848Entry: x509-cert: An entry which contains an X509 certificate
2849-------------------------------------------------------------
2850
2851Properties / Entry arguments:
2852 - content: List of phandles to entries to sign
2853
2854Output files:
2855 - input.<unique_name> - input file passed to openssl
2856 - cert.<unique_name> - output file generated by openssl (which is
2857 used as the entry contents)
2858
2859openssl signs the provided data, writing the signature in this entry. This
2860allows verification that the data is genuine
2861
2862
2863
Simon Glassa7c97782022-08-07 16:33:25 -06002864.. _etype_x86_reset16:
2865
Simon Glass0b074d62019-08-24 07:22:48 -06002866Entry: x86-reset16: x86 16-bit reset code for U-Boot
2867----------------------------------------------------
2868
2869Properties / Entry arguments:
2870 - filename: Filename of u-boot-x86-reset16.bin (default
2871 'u-boot-x86-reset16.bin')
2872
2873x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2874must be placed at a particular address. This entry holds that code. It is
2875typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2876for jumping to the x86-start16 code, which continues execution.
2877
2878For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead.
2879
2880
2881
Simon Glassa7c97782022-08-07 16:33:25 -06002882.. _etype_x86_reset16_spl:
2883
Simon Glass0b074d62019-08-24 07:22:48 -06002884Entry: x86-reset16-spl: x86 16-bit reset code for U-Boot
2885--------------------------------------------------------
2886
2887Properties / Entry arguments:
2888 - filename: Filename of u-boot-x86-reset16.bin (default
2889 'u-boot-x86-reset16.bin')
2890
2891x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2892must be placed at a particular address. This entry holds that code. It is
2893typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2894for jumping to the x86-start16 code, which continues execution.
2895
2896For 32-bit U-Boot, the 'x86_reset_spl' entry type is used instead.
2897
2898
2899
Simon Glassa7c97782022-08-07 16:33:25 -06002900.. _etype_x86_reset16_tpl:
2901
Simon Glass0b074d62019-08-24 07:22:48 -06002902Entry: x86-reset16-tpl: x86 16-bit reset code for U-Boot
2903--------------------------------------------------------
2904
2905Properties / Entry arguments:
2906 - filename: Filename of u-boot-x86-reset16.bin (default
2907 'u-boot-x86-reset16.bin')
2908
2909x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2910must be placed at a particular address. This entry holds that code. It is
2911typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2912for jumping to the x86-start16 code, which continues execution.
2913
2914For 32-bit U-Boot, the 'x86_reset_tpl' entry type is used instead.
2915
2916
Simon Glassa7c97782022-08-07 16:33:25 -06002917
2918.. _etype_x86_start16:
Simon Glass0b074d62019-08-24 07:22:48 -06002919
Simon Glass7a61c6b2018-07-17 13:25:37 -06002920Entry: x86-start16: x86 16-bit start-up code for U-Boot
2921-------------------------------------------------------
2922
2923Properties / Entry arguments:
Simon Glassabab18c2019-08-24 07:22:49 -06002924 - filename: Filename of u-boot-x86-start16.bin (default
2925 'u-boot-x86-start16.bin')
Simon Glass7a61c6b2018-07-17 13:25:37 -06002926
2927x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
Simon Glassabab18c2019-08-24 07:22:49 -06002928must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2929entry holds that code. It is typically placed at offset
2930CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2931and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2932U-Boot).
Simon Glass7a61c6b2018-07-17 13:25:37 -06002933
2934For 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead.
2935
2936
2937
Simon Glassa7c97782022-08-07 16:33:25 -06002938.. _etype_x86_start16_spl:
2939
Simon Glass7a61c6b2018-07-17 13:25:37 -06002940Entry: x86-start16-spl: x86 16-bit start-up code for SPL
2941--------------------------------------------------------
2942
2943Properties / Entry arguments:
Simon Glassabab18c2019-08-24 07:22:49 -06002944 - filename: Filename of spl/u-boot-x86-start16-spl.bin (default
2945 'spl/u-boot-x86-start16-spl.bin')
Simon Glass7a61c6b2018-07-17 13:25:37 -06002946
Simon Glassabab18c2019-08-24 07:22:49 -06002947x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2948must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2949entry holds that code. It is typically placed at offset
2950CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2951and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2952U-Boot).
Simon Glass7a61c6b2018-07-17 13:25:37 -06002953
Simon Glassabab18c2019-08-24 07:22:49 -06002954For 32-bit U-Boot, the 'x86-start16' entry type is used instead.
Simon Glass7a61c6b2018-07-17 13:25:37 -06002955
2956
2957
Simon Glassa7c97782022-08-07 16:33:25 -06002958.. _etype_x86_start16_tpl:
2959
Simon Glassed40e962018-09-14 04:57:10 -06002960Entry: x86-start16-tpl: x86 16-bit start-up code for TPL
2961--------------------------------------------------------
2962
2963Properties / Entry arguments:
Simon Glassabab18c2019-08-24 07:22:49 -06002964 - filename: Filename of tpl/u-boot-x86-start16-tpl.bin (default
2965 'tpl/u-boot-x86-start16-tpl.bin')
Simon Glassed40e962018-09-14 04:57:10 -06002966
Simon Glassabab18c2019-08-24 07:22:49 -06002967x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2968must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2969entry holds that code. It is typically placed at offset
2970CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2971and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2972U-Boot).
Simon Glassed40e962018-09-14 04:57:10 -06002973
Simon Glassabab18c2019-08-24 07:22:49 -06002974If TPL is not being used, the 'x86-start16-spl or 'x86-start16' entry types
Simon Glassed40e962018-09-14 04:57:10 -06002975may be used instead.
2976
2977
2978
Lukas Funkefebfc6d2023-08-03 17:22:15 +02002979.. _etype_xilinx_bootgen:
2980
2981Entry: xilinx-bootgen: Signed SPL boot image for Xilinx ZynqMP devices
2982----------------------------------------------------------------------
2983
2984Properties / Entry arguments:
2985 - auth-params: (Optional) Authentication parameters passed to bootgen
2986 - fsbl-config: (Optional) FSBL parameters passed to bootgen
2987 - keysrc-enc: (Optional) Key source when using decryption engine
2988 - pmufw-filename: Filename of PMU firmware. Default: pmu-firmware.elf
2989 - psk-key-name-hint: Name of primary secret key to use for signing the
2990 secondardy public key. Format: .pem file
2991 - ssk-key-name-hint: Name of secondardy secret key to use for signing
2992 the boot image. Format: .pem file
2993
2994The etype is used to create a boot image for Xilinx ZynqMP
2995devices.
2996
2997Information for signed images:
2998
2999In AMD/Xilinx SoCs, two pairs of public and secret keys are used
3000- primary and secondary. The function of the primary public/secret key pair
3001is to authenticate the secondary public/secret key pair.
3002The function of the secondary key is to sign/verify the boot image. [1]
3003
3004AMD/Xilinx uses the following terms for private/public keys [1]:
3005
3006 PSK = Primary Secret Key (Used to sign Secondary Public Key)
3007 PPK = Primary Public Key (Used to verify Secondary Public Key)
3008 SSK = Secondary Secret Key (Used to sign the boot image/partitions)
3009 SPK = Used to verify the actual boot image
3010
3011The following example builds a signed boot image. The fuses of
3012the primary public key (ppk) should be fused together with the RSA_EN flag.
3013
3014Example node::
3015
3016 spl {
3017 filename = "boot.signed.bin";
3018
3019 xilinx-bootgen {
3020 psk-key-name-hint = "psk0";
3021 ssk-key-name-hint = "ssk0";
3022 auth-params = "ppk_select=0", "spk_id=0x00000000";
3023
3024 u-boot-spl-nodtb {
3025 };
3026 u-boot-spl-pubkey-dtb {
3027 algo = "sha384,rsa4096";
3028 required = "conf";
3029 key-name-hint = "dev";
3030 };
3031 };
3032 };
3033
3034For testing purposes, e.g. if no RSA_EN should be fused, one could add
3035the "bh_auth_enable" flag in the fsbl-config field. This will skip the
3036verification of the ppk fuses and boot the image, even if ppk hash is
3037invalid.
3038
3039Example node::
3040
3041 xilinx-bootgen {
3042 psk-key-name-hint = "psk0";
3043 psk-key-name-hint = "ssk0";
3044 ...
3045 fsbl-config = "bh_auth_enable";
3046 ...
3047 };
3048
3049[1] https://docs.xilinx.com/r/en-US/ug1283-bootgen-user-guide/Using-Authentication
3050
3051
3052
3053