1Binman Entry Documentation
2===========================
3
4This file describes the entry types supported by binman. These entry types can
5be placed in an image one by one to build up a final firmware image. It is
6fairly easy to create new entry types. Just add a new file to the 'etype'
7directory. You can use the existing entries as examples.
8
9Note that some entries are subclasses of others, using and extending their
10features to produce new behaviours.
11
12
13
14.. _etype_atf_bl31:
15
16Entry: atf-bl31: ARM Trusted Firmware (ATF) BL31 blob
17-----------------------------------------------------
18
19Properties / Entry arguments:
20    - atf-bl31-path: Filename of file to read into entry. This is typically
21        called bl31.bin or bl31.elf
22
23This entry holds the run-time firmware, typically started by U-Boot SPL.
24See the U-Boot README for your architecture or board for how to use it. See
25https://github.com/ARM-software/arm-trusted-firmware for more information
26about ATF.
27
28
29
30.. _etype_atf_fip:
31
32Entry: atf-fip: ARM Trusted Firmware's Firmware Image Package (FIP)
33-------------------------------------------------------------------
34
35A FIP_ provides a way to group binaries in a firmware image, used by ARM's
36Trusted Firmware A (TF-A) code. It is a simple format consisting of a
37table of contents with information about the type, offset and size of the
38binaries in the FIP. It is quite similar to FMAP, with the major difference
39that it uses UUIDs to indicate the type of each entry.
40
41Note: It is recommended to always add an fdtmap to every image, as well as
42any FIPs so that binman and other tools can access the entire image
43correctly.
44
45The UUIDs correspond to useful names in `fiptool`, provided by ATF to
46operate on FIPs. Binman uses these names to make it easier to understand
47what is going on, although it is possible to provide a UUID if needed.
48
49The contents of the FIP are defined by subnodes of the atf-fip entry, e.g.::
50
51    atf-fip {
52        soc-fw {
53            filename = "bl31.bin";
54        };
55
56        scp-fwu-cfg {
57            filename = "bl2u.bin";
58        };
59
60        u-boot {
61            fip-type = "nt-fw";
62        };
63    };
64
65This describes a FIP with three entries: soc-fw, scp-fwu-cfg and nt-fw.
66You can use normal (non-external) binaries like U-Boot simply by adding a
67FIP type, with the `fip-type` property, as above.
68
69Since FIP exists to bring blobs together, Binman assumes that all FIP
70entries are external binaries. If a binary may not exist, you can use the
71`--allow-missing` flag to Binman, in which case the image is still created,
72even though it will not actually work.
73
74The size of the FIP depends on the size of the binaries. There is currently
75no way to specify a fixed size. If the `atf-fip` node has a `size` entry,
76this affects the space taken up by the `atf-fip` entry, but the FIP itself
77does not expand to use that space.
78
79Some other FIP features are available with Binman. The header and the
80entries have 64-bit flag works. The flag flags do not seem to be defined
81anywhere, but you can use `fip-hdr-flags` and fip-flags` to set the values
82of the header and entries respectively.
83
84FIP entries can be aligned to a particular power-of-two boundary. Use
85fip-align for this.
86
87Binman only understands the entry types that are included in its
88implementation. It is possible to specify a 16-byte UUID instead, using the
89fip-uuid property. In this case Binman doesn't know what its type is, so
90just uses the UUID. See the `u-boot` node in this example::
91
92    binman {
93        atf-fip {
94            fip-hdr-flags = /bits/ 64 <0x123>;
95            fip-align = <16>;
96            soc-fw {
97                fip-flags = /bits/ 64 <0x456>;
98                filename = "bl31.bin";
99            };
100
101            scp-fwu-cfg {
102                filename = "bl2u.bin";
103            };
104
105            u-boot {
106                fip-uuid = [fc 65 13 92 4a 5b 11 ec
107                            94 35 ff 2d 1c fc 79 9c];
108            };
109        };
110        fdtmap {
111        };
112    };
113
114Binman allows reading and updating FIP entries after the image is created,
115provided that an FDPMAP is present too. Updates which change the size of a
116FIP entry will cause it to be expanded or contracted as needed.
117
118Properties for top-level atf-fip node
119~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120
121fip-hdr-flags (64 bits)
122    Sets the flags for the FIP header.
123
124Properties for subnodes
125~~~~~~~~~~~~~~~~~~~~~~~
126
127fip-type (str)
128    FIP type to use for this entry. This is needed if the entry
129    name is not a valid type. Value types are defined in `fip_util.py`.
130    The FIP type defines the UUID that is used (they map 1:1).
131
132fip-uuid (16 bytes)
133    If there is no FIP-type name defined, or it is not supported by Binman,
134    this property sets the UUID. It should be a 16-byte value, following the
135    hex digits of the UUID.
136
137fip-flags (64 bits)
138    Set the flags for a FIP entry. Use in one of the subnodes of the
139    7atf-fip entry.
140
141fip-align
142    Set the alignment for a FIP entry, FIP entries can be aligned to a
143    particular power-of-two boundary. The default is 1.
144
145Adding new FIP-entry types
146~~~~~~~~~~~~~~~~~~~~~~~~~~
147
148When new FIP entries are defined by TF-A they appear in the
149`TF-A source tree`_. You can use `fip_util.py` to update Binman to support
150new types, then `send a patch`_ to the U-Boot mailing list. There are two
151source files that the tool examples:
152
153- `include/tools_share/firmware_image_package.h` has the UUIDs
154- `tools/fiptool/tbbr_config.c` has the name and descripion for each UUID
155
156To run the tool::
157
158    $ tools/binman/fip_util.py  -s /path/to/arm-trusted-firmware
159    Warning: UUID 'UUID_NON_TRUSTED_WORLD_KEY_CERT' is not mentioned in tbbr_config.c file
160    Existing code in 'tools/binman/fip_util.py' is up-to-date
161
162If it shows there is an update, it writes a new version of `fip_util.py`
163to `fip_util.py.out`. You can change the output file using the `-i` flag.
164If you have a problem, use `-D` to enable traceback debugging.
165
166FIP commentary
167~~~~~~~~~~~~~~
168
169As a side effect of use of UUIDs, FIP does not support multiple
170entries of the same type, such as might be used to store fonts or graphics
171icons, for example. For verified boot it could be used for each part of the
172image (e.g. separate FIPs for A and B) but cannot describe the whole
173firmware image. As with FMAP there is no hierarchy defined, although FMAP
174works around this by having 'section' areas which encompass others. A
175similar workaround would be possible with FIP but is not currently defined.
176
177It is recommended to always add an fdtmap to every image, as well as any
178FIPs so that binman and other tools can access the entire image correctly.
179
180.. _FIP: https://trustedfirmware-a.readthedocs.io/en/latest/design/firmware-design.html#firmware-image-package-fip
181.. _`TF-A source tree`: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
182.. _`send a patch`: https://www.denx.de/wiki/U-Boot/Patches
183
184
185
186.. _etype_blob:
187
188Entry: blob: Arbitrary binary blob
189----------------------------------
190
191Note: This should not be used by itself. It is normally used as a parent
192class by other entry types.
193
194Properties / Entry arguments:
195    - filename: Filename of file to read into entry
196    - compress: Compression algorithm to use:
197        none: No compression
198        lz4: Use lz4 compression (via 'lz4' command-line utility)
199
200This entry reads data from a file and places it in the entry. The
201default filename is often specified specified by the subclass. See for
202example the 'u-boot' entry which provides the filename 'u-boot.bin'.
203
204If compression is enabled, an extra 'uncomp-size' property is written to
205the node (if enabled with -u) which provides the uncompressed size of the
206data.
207
208
209
210.. _etype_blob_dtb:
211
212Entry: blob-dtb: A blob that holds a device tree
213------------------------------------------------
214
215This is a blob containing a device tree. The contents of the blob are
216obtained from the list of available device-tree files, managed by the
217'state' module.
218
219Additional attributes:
220    prepend: Header used (e.g. 'length')
221
222
223
224.. _etype_blob_ext:
225
226Entry: blob-ext: Externally built binary blob
227---------------------------------------------
228
229Note: This should not be used by itself. It is normally used as a parent
230class by other entry types.
231
232If the file providing this blob is missing, binman can optionally ignore it
233and produce a broken image with a warning.
234
235See 'blob' for Properties / Entry arguments.
236
237
238
239.. _etype_blob_ext_list:
240
241Entry: blob-ext-list: List of externally built binary blobs
242-----------------------------------------------------------
243
244This is like blob-ext except that a number of blobs can be provided,
245typically with some sort of relationship, e.g. all are DDC parameters.
246
247If any of the external files needed by this llist is missing, binman can
248optionally ignore it and produce a broken image with a warning.
249
250Args:
251    filenames: List of filenames to read and include
252
253
254
255.. _etype_blob_named_by_arg:
256
257Entry: blob-named-by-arg: A blob entry which gets its filename property from its subclass
258-----------------------------------------------------------------------------------------
259
260Properties / Entry arguments:
261    - <xxx>-path: Filename containing the contents of this entry (optional,
262        defaults to None)
263
264where <xxx> is the blob_fname argument to the constructor.
265
266This entry cannot be used directly. Instead, it is used as a parent class
267for another entry, which defined blob_fname. This parameter is used to
268set the entry-arg or property containing the filename. The entry-arg or
269property is in turn used to set the actual filename.
270
271See cros_ec_rw for an example of this.
272
273
274
275.. _etype_blob_phase:
276
277Entry: blob-phase: Section that holds a phase binary
278----------------------------------------------------
279
280This is a base class that should not normally be used directly. It is used
281when converting a 'u-boot' entry automatically into a 'u-boot-expanded'
282entry; similarly for SPL.
283
284
285
286.. _etype_cbfs:
287
288Entry: cbfs: Coreboot Filesystem (CBFS)
289---------------------------------------
290
291A CBFS provides a way to group files into a group. It has a simple directory
292structure and allows the position of individual files to be set, since it is
293designed to support execute-in-place in an x86 SPI-flash device. Where XIP
294is not used, it supports compression and storing ELF files.
295
296CBFS is used by coreboot as its way of orgnanising SPI-flash contents.
297
298The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.::
299
300    cbfs {
301        size = <0x100000>;
302        u-boot {
303            cbfs-type = "raw";
304        };
305        u-boot-dtb {
306            cbfs-type = "raw";
307        };
308    };
309
310This creates a CBFS 1MB in size two files in it: u-boot.bin and u-boot.dtb.
311Note that the size is required since binman does not support calculating it.
312The contents of each entry is just what binman would normally provide if it
313were not a CBFS node. A blob type can be used to import arbitrary files as
314with the second subnode below::
315
316    cbfs {
317        size = <0x100000>;
318        u-boot {
319            cbfs-name = "BOOT";
320            cbfs-type = "raw";
321        };
322
323        dtb {
324            type = "blob";
325            filename = "u-boot.dtb";
326            cbfs-type = "raw";
327            cbfs-compress = "lz4";
328            cbfs-offset = <0x100000>;
329        };
330    };
331
332This creates a CBFS 1MB in size with u-boot.bin (named "BOOT") and
333u-boot.dtb (named "dtb") and compressed with the lz4 algorithm.
334
335
336Properties supported in the top-level CBFS node:
337
338cbfs-arch:
339    Defaults to "x86", but you can specify the architecture if needed.
340
341
342Properties supported in the CBFS entry subnodes:
343
344cbfs-name:
345    This is the name of the file created in CBFS. It defaults to the entry
346    name (which is the node name), but you can override it with this
347    property.
348
349cbfs-type:
350    This is the CBFS file type. The following are supported:
351
352    raw:
353        This is a 'raw' file, although compression is supported. It can be
354        used to store any file in CBFS.
355
356    stage:
357        This is an ELF file that has been loaded (i.e. mapped to memory), so
358        appears in the CBFS as a flat binary. The input file must be an ELF
359        image, for example this puts "u-boot" (the ELF image) into a 'stage'
360        entry::
361
362            cbfs {
363                size = <0x100000>;
364                u-boot-elf {
365                    cbfs-name = "BOOT";
366                    cbfs-type = "stage";
367                };
368            };
369
370        You can use your own ELF file with something like::
371
372            cbfs {
373                size = <0x100000>;
374                something {
375                    type = "blob";
376                    filename = "cbfs-stage.elf";
377                    cbfs-type = "stage";
378                };
379            };
380
381        As mentioned, the file is converted to a flat binary, so it is
382        equivalent to adding "u-boot.bin", for example, but with the load and
383        start addresses specified by the ELF. At present there is no option
384        to add a flat binary with a load/start address, similar to the
385        'add-flat-binary' option in cbfstool.
386
387cbfs-offset:
388    This is the offset of the file's data within the CBFS. It is used to
389    specify where the file should be placed in cases where a fixed position
390    is needed. Typical uses are for code which is not relocatable and must
391    execute in-place from a particular address. This works because SPI flash
392    is generally mapped into memory on x86 devices. The file header is
393    placed before this offset so that the data start lines up exactly with
394    the chosen offset. If this property is not provided, then the file is
395    placed in the next available spot.
396
397The current implementation supports only a subset of CBFS features. It does
398not support other file types (e.g. payload), adding multiple files (like the
399'files' entry with a pattern supported by binman), putting files at a
400particular offset in the CBFS and a few other things.
401
402Of course binman can create images containing multiple CBFSs, simply by
403defining these in the binman config::
404
405
406    binman {
407        size = <0x800000>;
408        cbfs {
409            offset = <0x100000>;
410            size = <0x100000>;
411            u-boot {
412                cbfs-type = "raw";
413            };
414            u-boot-dtb {
415                cbfs-type = "raw";
416            };
417        };
418
419        cbfs2 {
420            offset = <0x700000>;
421            size = <0x100000>;
422            u-boot {
423                cbfs-type = "raw";
424            };
425            u-boot-dtb {
426                cbfs-type = "raw";
427            };
428            image {
429                type = "blob";
430                filename = "image.jpg";
431            };
432        };
433    };
434
435This creates an 8MB image with two CBFSs, one at offset 1MB, one at 7MB,
436both of size 1MB.
437
438
439
440.. _etype_collection:
441
442Entry: collection: An entry which contains a collection of other entries
443------------------------------------------------------------------------
444
445Properties / Entry arguments:
446    - content: List of phandles to entries to include
447
448This allows reusing the contents of other entries. The contents of the
449listed entries are combined to form this entry. This serves as a useful
450base class for entry types which need to process data from elsewhere in
451the image, not necessarily child entries.
452
453The entries can generally be anywhere in the same image, even if they are in
454a different section from this entry.
455
456
457
458.. _etype_cros_ec_rw:
459
460Entry: cros-ec-rw: A blob entry which contains a Chromium OS read-write EC image
461--------------------------------------------------------------------------------
462
463Properties / Entry arguments:
464    - cros-ec-rw-path: Filename containing the EC image
465
466This entry holds a Chromium OS EC (embedded controller) image, for use in
467updating the EC on startup via software sync.
468
469
470
471.. _etype_fdtmap:
472
473Entry: fdtmap: An entry which contains an FDT map
474-------------------------------------------------
475
476Properties / Entry arguments:
477    None
478
479An FDT map is just a header followed by an FDT containing a list of all the
480entries in the image. The root node corresponds to the image node in the
481original FDT, and an image-name property indicates the image name in that
482original tree.
483
484The header is the string _FDTMAP_ followed by 8 unused bytes.
485
486When used, this entry will be populated with an FDT map which reflects the
487entries in the current image. Hierarchy is preserved, and all offsets and
488sizes are included.
489
490Note that the -u option must be provided to ensure that binman updates the
491FDT with the position of each entry.
492
493Example output for a simple image with U-Boot and an FDT map::
494
495    / {
496        image-name = "binman";
497        size = <0x00000112>;
498        image-pos = <0x00000000>;
499        offset = <0x00000000>;
500        u-boot {
501            size = <0x00000004>;
502            image-pos = <0x00000000>;
503            offset = <0x00000000>;
504        };
505        fdtmap {
506            size = <0x0000010e>;
507            image-pos = <0x00000004>;
508            offset = <0x00000004>;
509        };
510    };
511
512If allow-repack is used then 'orig-offset' and 'orig-size' properties are
513added as necessary. See the binman README.
514
515When extracting files, an alternative 'fdt' format is available for fdtmaps.
516Use `binman extract -F fdt ...` to use this. It will export a devicetree,
517without the fdtmap header, so it can be viewed with `fdtdump`.
518
519
520
521.. _etype_files:
522
523Entry: files: A set of files arranged in a section
524--------------------------------------------------
525
526Properties / Entry arguments:
527    - pattern: Filename pattern to match the files to include
528    - files-compress: Compression algorithm to use:
529        none: No compression
530        lz4: Use lz4 compression (via 'lz4' command-line utility)
531    - files-align: Align each file to the given alignment
532
533This entry reads a number of files and places each in a separate sub-entry
534within this entry. To access these you need to enable device-tree updates
535at run-time so you can obtain the file positions.
536
537
538
539.. _etype_fill:
540
541Entry: fill: An entry which is filled to a particular byte value
542----------------------------------------------------------------
543
544Properties / Entry arguments:
545    - fill-byte: Byte to use to fill the entry
546
547Note that the size property must be set since otherwise this entry does not
548know how large it should be.
549
550You can often achieve the same effect using the pad-byte property of the
551overall image, in that the space between entries will then be padded with
552that byte. But this entry is sometimes useful for explicitly setting the
553byte value of a region.
554
555
556
557.. _etype_fit:
558
559Entry: fit: Flat Image Tree (FIT)
560---------------------------------
561
562This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the
563input provided.
564
565Nodes for the FIT should be written out in the binman configuration just as
566they would be in a file passed to mkimage.
567
568For example, this creates an image containing a FIT with U-Boot SPL::
569
570    binman {
571        fit {
572            description = "Test FIT";
573            fit,fdt-list = "of-list";
574
575            images {
576                kernel@1 {
577                    description = "SPL";
578                    os = "u-boot";
579                    type = "rkspi";
580                    arch = "arm";
581                    compression = "none";
582                    load = <0>;
583                    entry = <0>;
584
585                    u-boot-spl {
586                    };
587                };
588            };
589        };
590    };
591
592More complex setups can be created, with generated nodes, as described
593below.
594
595Properties (in the 'fit' node itself)
596~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
597
598Special properties have a `fit,` prefix, indicating that they should be
599processed but not included in the final FIT.
600
601The top-level 'fit' node supports the following special properties:
602
603    fit,external-offset
604        Indicates that the contents of the FIT are external and provides the
605        external offset. This is passed to mkimage via the -E and -p flags.
606
607    fit,align
608        Indicates what alignment to use for the FIT and its external data,
609        and provides the alignment to use. This is passed to mkimage via
610        the -B flag.
611
612    fit,fdt-list
613        Indicates the entry argument which provides the list of device tree
614        files for the gen-fdt-nodes operation (as below). This is often
615        `of-list` meaning that `-a of-list="dtb1 dtb2..."` should be passed
616        to binman.
617
618Substitutions
619~~~~~~~~~~~~~
620
621Node names and property values support a basic string-substitution feature.
622Available substitutions for '@' nodes (and property values) are:
623
624SEQ:
625    Sequence number of the generated fdt (1, 2, ...)
626NAME
627    Name of the dtb as provided (i.e. without adding '.dtb')
628
629The `default` property, if present, will be automatically set to the name
630if of configuration whose devicetree matches the `default-dt` entry
631argument, e.g. with `-a default-dt=sun50i-a64-pine64-lts`.
632
633Available substitutions for property values in these nodes are:
634
635DEFAULT-SEQ:
636    Sequence number of the default fdt, as provided by the 'default-dt'
637    entry argument
638
639Available operations
640~~~~~~~~~~~~~~~~~~~~
641
642You can add an operation to an '@' node to indicate which operation is
643required::
644
645    @fdt-SEQ {
646        fit,operation = "gen-fdt-nodes";
647        ...
648    };
649
650Available operations are:
651
652gen-fdt-nodes
653    Generate FDT nodes as above. This is the default if there is no
654    `fit,operation` property.
655
656split-elf
657    Split an ELF file into a separate node for each segment.
658
659Generating nodes from an FDT list (gen-fdt-nodes)
660~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
661
662U-Boot supports creating fdt and config nodes automatically. To do this,
663pass an `of-list` property (e.g. `-a of-list=file1 file2`). This tells
664binman that you want to generates nodes for two files: `file1.dtb` and
665`file2.dtb`. The `fit,fdt-list` property (see above) indicates that
666`of-list` should be used. If the property is missing you will get an error.
667
668Then add a 'generator node', a node with a name starting with '@'::
669
670    images {
671        @fdt-SEQ {
672            description = "fdt-NAME";
673            type = "flat_dt";
674            compression = "none";
675        };
676    };
677
678This tells binman to create nodes `fdt-1` and `fdt-2` for each of your two
679files. All the properties you specify will be included in the node. This
680node acts like a template to generate the nodes. The generator node itself
681does not appear in the output - it is replaced with what binman generates.
682A 'data' property is created with the contents of the FDT file.
683
684You can create config nodes in a similar way::
685
686    configurations {
687        default = "@config-DEFAULT-SEQ";
688        @config-SEQ {
689            description = "NAME";
690            firmware = "atf";
691            loadables = "uboot";
692            fdt = "fdt-SEQ";
693        };
694    };
695
696This tells binman to create nodes `config-1` and `config-2`, i.e. a config
697for each of your two files.
698
699Note that if no devicetree files are provided (with '-a of-list' as above)
700then no nodes will be generated.
701
702Generating nodes from an ELF file (split-elf)
703~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
704
705This uses the node as a template to generate multiple nodes. The following
706special properties are available:
707
708split-elf
709    Split an ELF file into a separate node for each segment. This uses the
710    node as a template to generate multiple nodes. The following special
711    properties are available:
712
713    fit,load
714        Generates a `load = <...>` property with the load address of the
715        segment
716
717    fit,entry
718        Generates a `entry = <...>` property with the entry address of the
719        ELF. This is only produced for the first entry
720
721    fit,data
722        Generates a `data = <...>` property with the contents of the segment
723
724    fit,firmware
725        Generates a `firmware = <...>` property. Provides a list of possible
726        nodes to be used as the `firmware` property value. The first valid
727        node is picked as the firmware. Any remaining valid nodes is
728        prepended to the `loadable` property generated by `fit,loadables`
729
730    fit,loadables
731        Generates a `loadable = <...>` property with a list of the generated
732        nodes (including all nodes if this operation is used multiple times)
733
734
735Here is an example showing ATF, TEE and a device tree all combined::
736
737    fit {
738        description = "test-desc";
739        #address-cells = <1>;
740        fit,fdt-list = "of-list";
741
742        images {
743            u-boot {
744                description = "U-Boot (64-bit)";
745                type = "standalone";
746                os = "U-Boot";
747                arch = "arm64";
748                compression = "none";
749                load = <CONFIG_TEXT_BASE>;
750                u-boot-nodtb {
751                };
752            };
753            @fdt-SEQ {
754                description = "fdt-NAME.dtb";
755                type = "flat_dt";
756                compression = "none";
757            };
758            @atf-SEQ {
759                fit,operation = "split-elf";
760                description = "ARM Trusted Firmware";
761                type = "firmware";
762                arch = "arm64";
763                os = "arm-trusted-firmware";
764                compression = "none";
765                fit,load;
766                fit,entry;
767                fit,data;
768
769                atf-bl31 {
770                };
771                hash {
772                    algo = "sha256";
773                };
774            };
775
776            @tee-SEQ {
777                fit,operation = "split-elf";
778                description = "TEE";
779                type = "tee";
780                arch = "arm64";
781                os = "tee";
782                compression = "none";
783                fit,load;
784                fit,entry;
785                fit,data;
786
787                tee-os {
788                };
789                hash {
790                    algo = "sha256";
791                };
792            };
793        };
794
795        configurations {
796            default = "@config-DEFAULT-SEQ";
797            @config-SEQ {
798                description = "conf-NAME.dtb";
799                fdt = "fdt-SEQ";
800                fit,firmware = "atf-1", "u-boot";
801                fit,loadables;
802            };
803        };
804    };
805
806If ATF-BL31 is available, this generates a node for each segment in the
807ELF file, for example::
808
809    images {
810        atf-1 {
811            data = <...contents of first segment...>;
812            data-offset = <0x00000000>;
813            entry = <0x00040000>;
814            load = <0x00040000>;
815            compression = "none";
816            os = "arm-trusted-firmware";
817            arch = "arm64";
818            type = "firmware";
819            description = "ARM Trusted Firmware";
820            hash {
821                algo = "sha256";
822                value = <...hash of first segment...>;
823            };
824        };
825        atf-2 {
826            data = <...contents of second segment...>;
827            load = <0xff3b0000>;
828            compression = "none";
829            os = "arm-trusted-firmware";
830            arch = "arm64";
831            type = "firmware";
832            description = "ARM Trusted Firmware";
833            hash {
834                algo = "sha256";
835                value = <...hash of second segment...>;
836            };
837        };
838    };
839
840The same applies for OP-TEE if that is available.
841
842If each binary is not available, the relevant template node (@atf-SEQ or
843@tee-SEQ) is removed from the output.
844
845This also generates a `config-xxx` node for each device tree in `of-list`.
846Note that the U-Boot build system uses `-a of-list=$(CONFIG_OF_LIST)`
847so you can use `CONFIG_OF_LIST` to define that list. In this example it is
848set up for `firefly-rk3399` with a single device tree and the default set
849with `-a default-dt=$(CONFIG_DEFAULT_DEVICE_TREE)`, so the resulting output
850is::
851
852    configurations {
853        default = "config-1";
854        config-1 {
855            loadables = "u-boot", "atf-2", "atf-3", "tee-1", "tee-2";
856            description = "rk3399-firefly.dtb";
857            fdt = "fdt-1";
858            firmware = "atf-1";
859        };
860    };
861
862U-Boot SPL can then load the firmware (ATF) and all the loadables (U-Boot
863proper, ATF and TEE), then proceed with the boot.
864
865
866
867.. _etype_fmap:
868
869Entry: fmap: An entry which contains an Fmap section
870----------------------------------------------------
871
872Properties / Entry arguments:
873    None
874
875FMAP is a simple format used by flashrom, an open-source utility for
876reading and writing the SPI flash, typically on x86 CPUs. The format
877provides flashrom with a list of areas, so it knows what it in the flash.
878It can then read or write just a single area, instead of the whole flash.
879
880The format is defined by the flashrom project, in the file lib/fmap.h -
881see www.flashrom.org/Flashrom for more information.
882
883When used, this entry will be populated with an FMAP which reflects the
884entries in the current image. Note that any hierarchy is squashed, since
885FMAP does not support this. Sections are represented as an area appearing
886before its contents, so that it is possible to reconstruct the hierarchy
887from the FMAP by using the offset information. This convention does not
888seem to be documented, but is used in Chromium OS.
889
890To mark an area as preserved, use the normal 'preserved' flag in the entry.
891This will result in the corresponding FMAP area having the
892FMAP_AREA_PRESERVE flag. This flag does not automatically propagate down to
893child entries.
894
895CBFS entries appear as a single entry, i.e. the sub-entries are ignored.
896
897
898
899.. _etype_gbb:
900
901Entry: gbb: An entry which contains a Chromium OS Google Binary Block
902---------------------------------------------------------------------
903
904Properties / Entry arguments:
905    - hardware-id: Hardware ID to use for this build (a string)
906    - keydir: Directory containing the public keys to use
907    - bmpblk: Filename containing images used by recovery
908
909Chromium OS uses a GBB to store various pieces of information, in particular
910the root and recovery keys that are used to verify the boot process. Some
911more details are here:
912
913    https://www.chromium.org/chromium-os/firmware-porting-guide/2-concepts
914
915but note that the page dates from 2013 so is quite out of date. See
916README.chromium for how to obtain the required keys and tools.
917
918
919
920.. _etype_image_header:
921
922Entry: image-header: An entry which contains a pointer to the FDT map
923---------------------------------------------------------------------
924
925Properties / Entry arguments:
926    location: Location of header ("start" or "end" of image). This is
927        optional. If omitted then the entry must have an offset property.
928
929This adds an 8-byte entry to the start or end of the image, pointing to the
930location of the FDT map. The format is a magic number followed by an offset
931from the start or end of the image, in twos-compliment format.
932
933This entry must be in the top-level part of the image.
934
935NOTE: If the location is at the start/end, you will probably need to specify
936sort-by-offset for the image, unless you actually put the image header
937first/last in the entry list.
938
939
940
941.. _etype_intel_cmc:
942
943Entry: intel-cmc: Intel Chipset Micro Code (CMC) file
944-----------------------------------------------------
945
946Properties / Entry arguments:
947    - filename: Filename of file to read into entry
948
949This file contains microcode for some devices in a special format. An
950example filename is 'Microcode/C0_22211.BIN'.
951
952See README.x86 for information about x86 binary blobs.
953
954
955
956.. _etype_intel_descriptor:
957
958Entry: intel-descriptor: Intel flash descriptor block (4KB)
959-----------------------------------------------------------
960
961Properties / Entry arguments:
962    filename: Filename of file containing the descriptor. This is typically
963        a 4KB binary file, sometimes called 'descriptor.bin'
964
965This entry is placed at the start of flash and provides information about
966the SPI flash regions. In particular it provides the base address and
967size of the ME (Management Engine) region, allowing us to place the ME
968binary in the right place.
969
970With this entry in your image, the position of the 'intel-me' entry will be
971fixed in the image, which avoids you needed to specify an offset for that
972region. This is useful, because it is not possible to change the position
973of the ME region without updating the descriptor.
974
975See README.x86 for information about x86 binary blobs.
976
977
978
979.. _etype_intel_fit:
980
981Entry: intel-fit: Intel Firmware Image Table (FIT)
982--------------------------------------------------
983
984This entry contains a dummy FIT as required by recent Intel CPUs. The FIT
985contains information about the firmware and microcode available in the
986image.
987
988At present binman only supports a basic FIT with no microcode.
989
990
991
992.. _etype_intel_fit_ptr:
993
994Entry: intel-fit-ptr: Intel Firmware Image Table (FIT) pointer
995--------------------------------------------------------------
996
997This entry contains a pointer to the FIT. It is required to be at address
9980xffffffc0 in the image.
999
1000
1001
1002.. _etype_intel_fsp:
1003
1004Entry: intel-fsp: Intel Firmware Support Package (FSP) file
1005-----------------------------------------------------------
1006
1007Properties / Entry arguments:
1008    - filename: Filename of file to read into entry
1009
1010This file contains binary blobs which are used on some devices to make the
1011platform work. U-Boot executes this code since it is not possible to set up
1012the hardware using U-Boot open-source code. Documentation is typically not
1013available in sufficient detail to allow this.
1014
1015An example filename is 'FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd'
1016
1017See README.x86 for information about x86 binary blobs.
1018
1019
1020
1021.. _etype_intel_fsp_m:
1022
1023Entry: intel-fsp-m: Intel Firmware Support Package (FSP) memory init
1024--------------------------------------------------------------------
1025
1026Properties / Entry arguments:
1027    - filename: Filename of file to read into entry
1028
1029This file contains a binary blob which is used on some devices to set up
1030SDRAM. U-Boot executes this code in SPL so that it can make full use of
1031memory. Documentation is typically not available in sufficient detail to
1032allow U-Boot do this this itself..
1033
1034An example filename is 'fsp_m.bin'
1035
1036See README.x86 for information about x86 binary blobs.
1037
1038
1039
1040.. _etype_intel_fsp_s:
1041
1042Entry: intel-fsp-s: Intel Firmware Support Package (FSP) silicon init
1043---------------------------------------------------------------------
1044
1045Properties / Entry arguments:
1046    - filename: Filename of file to read into entry
1047
1048This file contains a binary blob which is used on some devices to set up
1049the silicon. U-Boot executes this code in U-Boot proper after SDRAM is
1050running, so that it can make full use of memory. Documentation is typically
1051not available in sufficient detail to allow U-Boot do this this itself.
1052
1053An example filename is 'fsp_s.bin'
1054
1055See README.x86 for information about x86 binary blobs.
1056
1057
1058
1059.. _etype_intel_fsp_t:
1060
1061Entry: intel-fsp-t: Intel Firmware Support Package (FSP) temp ram init
1062----------------------------------------------------------------------
1063
1064Properties / Entry arguments:
1065    - filename: Filename of file to read into entry
1066
1067This file contains a binary blob which is used on some devices to set up
1068temporary memory (Cache-as-RAM or CAR). U-Boot executes this code in TPL so
1069that it has access to memory for its stack and initial storage.
1070
1071An example filename is 'fsp_t.bin'
1072
1073See README.x86 for information about x86 binary blobs.
1074
1075
1076
1077.. _etype_intel_ifwi:
1078
1079Entry: intel-ifwi: Intel Integrated Firmware Image (IFWI) file
1080--------------------------------------------------------------
1081
1082Properties / Entry arguments:
1083    - filename: Filename of file to read into entry. This is either the
1084        IFWI file itself, or a file that can be converted into one using a
1085        tool
1086    - convert-fit: If present this indicates that the ifwitool should be
1087        used to convert the provided file into a IFWI.
1088
1089This file contains code and data used by the SoC that is required to make
1090it work. It includes U-Boot TPL, microcode, things related to the CSE
1091(Converged Security Engine, the microcontroller that loads all the firmware)
1092and other items beyond the wit of man.
1093
1094A typical filename is 'ifwi.bin' for an IFWI file, or 'fitimage.bin' for a
1095file that will be converted to an IFWI.
1096
1097The position of this entry is generally set by the intel-descriptor entry.
1098
1099The contents of the IFWI are specified by the subnodes of the IFWI node.
1100Each subnode describes an entry which is placed into the IFWFI with a given
1101sub-partition (and optional entry name).
1102
1103Properties for subnodes:
1104    - ifwi-subpart: sub-parition to put this entry into, e.g. "IBBP"
1105    - ifwi-entry: entry name t use, e.g. "IBBL"
1106    - ifwi-replace: if present, indicates that the item should be replaced
1107      in the IFWI. Otherwise it is added.
1108
1109See README.x86 for information about x86 binary blobs.
1110
1111
1112
1113.. _etype_intel_me:
1114
1115Entry: intel-me: Intel Management Engine (ME) file
1116--------------------------------------------------
1117
1118Properties / Entry arguments:
1119    - filename: Filename of file to read into entry
1120
1121This file contains code used by the SoC that is required to make it work.
1122The Management Engine is like a background task that runs things that are
1123not clearly documented, but may include keyboard, display and network
1124access. For platform that use ME it is not possible to disable it. U-Boot
1125does not directly execute code in the ME binary.
1126
1127A typical filename is 'me.bin'.
1128
1129The position of this entry is generally set by the intel-descriptor entry.
1130
1131See README.x86 for information about x86 binary blobs.
1132
1133
1134
1135.. _etype_intel_mrc:
1136
1137Entry: intel-mrc: Intel Memory Reference Code (MRC) file
1138--------------------------------------------------------
1139
1140Properties / Entry arguments:
1141    - filename: Filename of file to read into entry
1142
1143This file contains code for setting up the SDRAM on some Intel systems. This
1144is executed by U-Boot when needed early during startup. A typical filename
1145is 'mrc.bin'.
1146
1147See README.x86 for information about x86 binary blobs.
1148
1149
1150
1151.. _etype_intel_refcode:
1152
1153Entry: intel-refcode: Intel Reference Code file
1154-----------------------------------------------
1155
1156Properties / Entry arguments:
1157    - filename: Filename of file to read into entry
1158
1159This file contains code for setting up the platform on some Intel systems.
1160This is executed by U-Boot when needed early during startup. A typical
1161filename is 'refcode.bin'.
1162
1163See README.x86 for information about x86 binary blobs.
1164
1165
1166
1167.. _etype_intel_vbt:
1168
1169Entry: intel-vbt: Intel Video BIOS Table (VBT) file
1170---------------------------------------------------
1171
1172Properties / Entry arguments:
1173    - filename: Filename of file to read into entry
1174
1175This file contains code that sets up the integrated graphics subsystem on
1176some Intel SoCs. U-Boot executes this when the display is started up.
1177
1178See README.x86 for information about Intel binary blobs.
1179
1180
1181
1182.. _etype_intel_vga:
1183
1184Entry: intel-vga: Intel Video Graphics Adaptor (VGA) file
1185---------------------------------------------------------
1186
1187Properties / Entry arguments:
1188    - filename: Filename of file to read into entry
1189
1190This file contains code that sets up the integrated graphics subsystem on
1191some Intel SoCs. U-Boot executes this when the display is started up.
1192
1193This is similar to the VBT file but in a different format.
1194
1195See README.x86 for information about Intel binary blobs.
1196
1197
1198
1199.. _etype_mkimage:
1200
1201Entry: mkimage: Binary produced by mkimage
1202------------------------------------------
1203
1204Properties / Entry arguments:
1205    - args: Arguments to pass
1206    - data-to-imagename: Indicates that the -d data should be passed in as
1207      the image name also (-n)
1208    - multiple-data-files: boolean to tell binman to pass all files as
1209      datafiles to mkimage instead of creating a temporary file the result
1210      of datafiles concatenation
1211    - filename: filename of output binary generated by mkimage
1212
1213The data passed to mkimage via the -d flag is collected from subnodes of the
1214mkimage node, e.g.::
1215
1216    mkimage {
1217        filename = "imximage.bin";
1218        args = "-n test -T imximage";
1219
1220        u-boot-spl {
1221        };
1222    };
1223
1224This calls mkimage to create an imximage with `u-boot-spl.bin` as the data
1225file, with mkimage being called like this::
1226
1227    mkimage -d <data_file> -n test -T imximage <output_file>
1228
1229The output from mkimage then becomes part of the image produced by
1230binman but also is written into `imximage.bin` file. If you need to put
1231multiple things in the data file, you can use a section, or just multiple
1232subnodes like this::
1233
1234    mkimage {
1235        args = "-n test -T imximage";
1236
1237        u-boot-spl {
1238        };
1239
1240        u-boot-tpl {
1241        };
1242    };
1243
1244Note that binman places the contents (here SPL and TPL) into a single file
1245and passes that to mkimage using the -d option.
1246
1247To pass all datafiles untouched to mkimage::
1248
1249    mkimage {
1250            args = "-n rk3399 -T rkspi";
1251            multiple-data-files;
1252
1253            u-boot-tpl {
1254            };
1255
1256            u-boot-spl {
1257            };
1258    };
1259
1260This calls mkimage to create a Rockchip RK3399-specific first stage
1261bootloader, made of TPL+SPL. Since this first stage bootloader requires to
1262align the TPL and SPL but also some weird hacks that is handled by mkimage
1263directly, binman is told to not perform the concatenation of datafiles prior
1264to passing the data to mkimage.
1265
1266To use CONFIG options in the arguments, use a string list instead, as in
1267this example which also produces four arguments::
1268
1269    mkimage {
1270        args = "-n", CONFIG_SYS_SOC, "-T imximage";
1271
1272        u-boot-spl {
1273        };
1274    };
1275
1276If you need to pass the input data in with the -n argument as well, then use
1277the 'data-to-imagename' property::
1278
1279    mkimage {
1280        args = "-T imximage";
1281        data-to-imagename;
1282
1283        u-boot-spl {
1284        };
1285    };
1286
1287That will pass the data to mkimage both as the data file (with -d) and as
1288the image name (with -n). In both cases, a filename is passed as the
1289argument, with the actual data being in that file.
1290
1291If need to pass different data in with -n, then use an `imagename` subnode::
1292
1293    mkimage {
1294        args = "-T imximage";
1295
1296        imagename {
1297            blob {
1298                filename = "spl/u-boot-spl.cfgout"
1299            };
1300        };
1301
1302        u-boot-spl {
1303        };
1304    };
1305
1306This will pass in u-boot-spl as the input data and the .cfgout file as the
1307-n data.
1308
1309
1310
1311.. _etype_null:
1312
1313Entry: null: An entry which has no contents of its own
1314------------------------------------------------------
1315
1316Note that the size property must be set since otherwise this entry does not
1317know how large it should be.
1318
1319The contents are set by the containing section, e.g. the section's pad
1320byte.
1321
1322
1323
1324.. _etype_opensbi:
1325
1326Entry: opensbi: RISC-V OpenSBI fw_dynamic blob
1327----------------------------------------------
1328
1329Properties / Entry arguments:
1330    - opensbi-path: Filename of file to read into entry. This is typically
1331        called fw_dynamic.bin
1332
1333This entry holds the run-time firmware, typically started by U-Boot SPL.
1334See the U-Boot README for your architecture or board for how to use it. See
1335https://github.com/riscv/opensbi for more information about OpenSBI.
1336
1337
1338
1339.. _etype_powerpc_mpc85xx_bootpg_resetvec:
1340
1341Entry: powerpc-mpc85xx-bootpg-resetvec: PowerPC mpc85xx bootpg + resetvec code for U-Boot
1342-----------------------------------------------------------------------------------------
1343
1344Properties / Entry arguments:
1345    - filename: Filename of u-boot-br.bin (default 'u-boot-br.bin')
1346
1347This entry is valid for PowerPC mpc85xx cpus. This entry holds
1348'bootpg + resetvec' code for PowerPC mpc85xx CPUs which needs to be
1349placed at offset 'RESET_VECTOR_ADDRESS - 0xffc'.
1350
1351
1352
1353.. _etype_pre_load:
1354
1355Entry: pre-load: Pre load image header
1356--------------------------------------
1357
1358Properties / Entry arguments:
1359    - pre-load-key-path: Path of the directory that store key (provided by
1360      the environment variable PRE_LOAD_KEY_PATH)
1361    - content: List of phandles to entries to sign
1362    - algo-name: Hash and signature algo to use for the signature
1363    - padding-name: Name of the padding (pkcs-1.5 or pss)
1364    - key-name: Filename of the private key to sign
1365    - header-size: Total size of the header
1366    - version: Version of the header
1367
1368This entry creates a pre-load header that contains a global
1369image signature.
1370
1371For example, this creates an image with a pre-load header and a binary::
1372
1373    binman {
1374        image2 {
1375            filename = "sandbox.bin";
1376
1377            pre-load {
1378                content = <&image>;
1379                algo-name = "sha256,rsa2048";
1380                padding-name = "pss";
1381                key-name = "private.pem";
1382                header-size = <4096>;
1383                version = <1>;
1384            };
1385
1386            image: blob-ext {
1387                filename = "sandbox.itb";
1388            };
1389        };
1390    };
1391
1392
1393
1394.. _etype_rockchip_tpl:
1395
1396Entry: rockchip-tpl: Rockchip TPL binary
1397----------------------------------------
1398
1399Properties / Entry arguments:
1400    - rockchip-tpl-path: Filename of file to read into the entry,
1401                         typically <soc>_ddr_<version>.bin
1402
1403This entry holds an external TPL binary used by some Rockchip SoCs
1404instead of normal U-Boot TPL, typically to initialize DRAM.
1405
1406
1407
1408.. _etype_scp:
1409
1410Entry: scp: System Control Processor (SCP) firmware blob
1411--------------------------------------------------------
1412
1413Properties / Entry arguments:
1414    - scp-path: Filename of file to read into the entry, typically scp.bin
1415
1416This entry holds firmware for an external platform-specific coprocessor.
1417
1418
1419
1420.. _etype_section:
1421
1422Entry: section: Entry that contains other entries
1423-------------------------------------------------
1424
1425A section is an entry which can contain other entries, thus allowing
1426hierarchical images to be created. See 'Sections and hierarchical images'
1427in the binman README for more information.
1428
1429The base implementation simply joins the various entries together, using
1430various rules about alignment, etc.
1431
1432Subclassing
1433~~~~~~~~~~~
1434
1435This class can be subclassed to support other file formats which hold
1436multiple entries, such as CBFS. To do this, override the following
1437functions. The documentation here describes what your function should do.
1438For example code, see etypes which subclass `Entry_section`, or `cbfs.py`
1439for a more involved example::
1440
1441   $ grep -l \(Entry_section tools/binman/etype/*.py
1442
1443ReadNode()
1444    Call `super().ReadNode()`, then read any special properties for the
1445    section. Then call `self.ReadEntries()` to read the entries.
1446
1447    Binman calls this at the start when reading the image description.
1448
1449ReadEntries()
1450    Read in the subnodes of the section. This may involve creating entries
1451    of a particular etype automatically, as well as reading any special
1452    properties in the entries. For each entry, entry.ReadNode() should be
1453    called, to read the basic entry properties. The properties should be
1454    added to `self._entries[]`, in the correct order, with a suitable name.
1455
1456    Binman calls this at the start when reading the image description.
1457
1458BuildSectionData(required)
1459    Create the custom file format that you want and return it as bytes.
1460    This likely sets up a file header, then loops through the entries,
1461    adding them to the file. For each entry, call `entry.GetData()` to
1462    obtain the data. If that returns None, and `required` is False, then
1463    this method must give up and return None. But if `required` is True then
1464    it should assume that all data is valid.
1465
1466    Binman calls this when packing the image, to find out the size of
1467    everything. It is called again at the end when building the final image.
1468
1469SetImagePos(image_pos):
1470    Call `super().SetImagePos(image_pos)`, then set the `image_pos` values
1471    for each of the entries. This should use the custom file format to find
1472    the `start offset` (and `image_pos`) of each entry. If the file format
1473    uses compression in such a way that there is no offset available (other
1474    than reading the whole file and decompressing it), then the offsets for
1475    affected entries can remain unset (`None`). The size should also be set
1476    if possible.
1477
1478    Binman calls this after the image has been packed, to update the
1479    location that all the entries ended up at.
1480
1481ReadChildData(child, decomp, alt_format):
1482    The default version of this may be good enough, if you are able to
1483    implement SetImagePos() correctly. But that is a bit of a bypass, so
1484    you can override this method to read from your custom file format. It
1485    should read the entire entry containing the custom file using
1486    `super().ReadData(True)`, then parse the file to get the data for the
1487    given child, then return that data.
1488
1489    If your file format supports compression, the `decomp` argument tells
1490    you whether to return the compressed data (`decomp` is False) or to
1491    uncompress it first, then return the uncompressed data (`decomp` is
1492    True). This is used by the `binman extract -U` option.
1493
1494    If your entry supports alternative formats, the alt_format provides the
1495    alternative format that the user has selected. Your function should
1496    return data in that format. This is used by the 'binman extract -l'
1497    option.
1498
1499    Binman calls this when reading in an image, in order to populate all the
1500    entries with the data from that image (`binman ls`).
1501
1502WriteChildData(child):
1503    Binman calls this after `child.data` is updated, to inform the custom
1504    file format about this, in case it needs to do updates.
1505
1506    The default version of this does nothing and probably needs to be
1507    overridden for the 'binman replace' command to work. Your version should
1508    use `child.data` to update the data for that child in the custom file
1509    format.
1510
1511    Binman calls this when updating an image that has been read in and in
1512    particular to update the data for a particular entry (`binman replace`)
1513
1514Properties / Entry arguments
1515~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1516
1517See :ref:`develop/package/binman:Image description format` for more
1518information.
1519
1520align-default
1521    Default alignment for this section, if no alignment is given in the
1522    entry
1523
1524pad-byte
1525    Pad byte to use when padding
1526
1527sort-by-offset
1528    True if entries should be sorted by offset, False if they must be
1529    in-order in the device tree description
1530
1531end-at-4gb
1532    Used to build an x86 ROM which ends at 4GB (2^32)
1533
1534name-prefix
1535    Adds a prefix to the name of every entry in the section when writing out
1536    the map
1537
1538skip-at-start
1539    Number of bytes before the first entry starts. These effectively adjust
1540    the starting offset of entries. For example, if this is 16, then the
1541    first entry would start at 16. An entry with offset = 20 would in fact
1542    be written at offset 4 in the image file, since the first 16 bytes are
1543    skipped when writing.
1544
1545filename
1546    filename to write the unpadded section contents to within the output
1547    directory (None to skip this).
1548
1549Since a section is also an entry, it inherits all the properies of entries
1550too.
1551
1552Note that the `allow_missing` member controls whether this section permits
1553external blobs to be missing their contents. The option will produce an
1554image but of course it will not work. It is useful to make sure that
1555Continuous Integration systems can build without the binaries being
1556available. This is set by the `SetAllowMissing()` method, if
1557`--allow-missing` is passed to binman.
1558
1559
1560
1561.. _etype_tee_os:
1562
1563Entry: tee-os: Entry containing an OP-TEE Trusted OS (TEE) blob
1564---------------------------------------------------------------
1565
1566Properties / Entry arguments:
1567    - tee-os-path: Filename of file to read into entry. This is typically
1568        called tee.bin or tee.elf
1569
1570This entry holds the run-time firmware, typically started by U-Boot SPL.
1571See the U-Boot README for your architecture or board for how to use it. See
1572https://github.com/OP-TEE/optee_os for more information about OP-TEE.
1573
1574Note that if the file is in ELF format, it must go in a FIT. In that case,
1575this entry will mark itself as absent, providing the data only through the
1576read_elf_segments() method.
1577
1578Marking this entry as absent means that it if is used in the wrong context
1579it can be automatically dropped. Thus it is possible to add an OP-TEE entry
1580like this::
1581
1582    binman {
1583        tee-os {
1584        };
1585    };
1586
1587and pass either an ELF or plain binary in with -a tee-os-path <filename>
1588and have binman do the right thing:
1589
1590   - include the entry if tee.bin is provided and it does NOT have the v1
1591     header
1592   - drop it otherwise
1593
1594When used within a FIT, we can do::
1595
1596    binman {
1597        fit {
1598            tee-os {
1599            };
1600        };
1601    };
1602
1603which will split the ELF into separate nodes for each segment, if an ELF
1604file is provided (see :ref:`etype_fit`), or produce a single node if the
1605OP-TEE binary v1 format is provided (see optee_doc_) .
1606
1607.. _optee_doc: https://optee.readthedocs.io/en/latest/architecture/core.html#partitioning-of-the-binary
1608
1609
1610
1611.. _etype_text:
1612
1613Entry: text: An entry which contains text
1614-----------------------------------------
1615
1616The text can be provided either in the node itself or by a command-line
1617argument. There is a level of indirection to allow multiple text strings
1618and sharing of text.
1619
1620Properties / Entry arguments:
1621    text-label: The value of this string indicates the property / entry-arg
1622        that contains the string to place in the entry
1623    <xxx> (actual name is the value of text-label): contains the string to
1624        place in the entry.
1625    <text>: The text to place in the entry (overrides the above mechanism).
1626        This is useful when the text is constant.
1627
1628Example node::
1629
1630    text {
1631        size = <50>;
1632        text-label = "message";
1633    };
1634
1635You can then use:
1636
1637    binman -amessage="this is my message"
1638
1639and binman will insert that string into the entry.
1640
1641It is also possible to put the string directly in the node::
1642
1643    text {
1644        size = <8>;
1645        text-label = "message";
1646        message = "a message directly in the node"
1647    };
1648
1649or just::
1650
1651    text {
1652        size = <8>;
1653        text = "some text directly in the node"
1654    };
1655
1656The text is not itself nul-terminated. This can be achieved, if required,
1657by setting the size of the entry to something larger than the text.
1658
1659
1660
1661.. _etype_u_boot:
1662
1663Entry: u-boot: U-Boot flat binary
1664---------------------------------
1665
1666Properties / Entry arguments:
1667    - filename: Filename of u-boot.bin (default 'u-boot.bin')
1668
1669This is the U-Boot binary, containing relocation information to allow it
1670to relocate itself at runtime. The binary typically includes a device tree
1671blob at the end of it.
1672
1673U-Boot can access binman symbols at runtime. See :ref:`binman_fdt`.
1674
1675Note that this entry is automatically replaced with u-boot-expanded unless
1676--no-expanded is used or the node has a 'no-expanded' property.
1677
1678
1679
1680.. _etype_u_boot_dtb:
1681
1682Entry: u-boot-dtb: U-Boot device tree
1683-------------------------------------
1684
1685Properties / Entry arguments:
1686    - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
1687
1688This is the U-Boot device tree, containing configuration information for
1689U-Boot. U-Boot needs this to know what devices are present and which drivers
1690to activate.
1691
1692Note: This is mostly an internal entry type, used by others. This allows
1693binman to know which entries contain a device tree.
1694
1695
1696
1697.. _etype_u_boot_dtb_with_ucode:
1698
1699Entry: u-boot-dtb-with-ucode: A U-Boot device tree file, with the microcode removed
1700-----------------------------------------------------------------------------------
1701
1702Properties / Entry arguments:
1703    - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
1704
1705See Entry_u_boot_ucode for full details of the three entries involved in
1706this process. This entry provides the U-Boot device-tree file, which
1707contains the microcode. If the microcode is not being collated into one
1708place then the offset and size of the microcode is recorded by this entry,
1709for use by u-boot-with-ucode_ptr. If it is being collated, then this
1710entry deletes the microcode from the device tree (to save space) and makes
1711it available to u-boot-ucode.
1712
1713
1714
1715.. _etype_u_boot_elf:
1716
1717Entry: u-boot-elf: U-Boot ELF image
1718-----------------------------------
1719
1720Properties / Entry arguments:
1721    - filename: Filename of u-boot (default 'u-boot')
1722
1723This is the U-Boot ELF image. It does not include a device tree but can be
1724relocated to any address for execution.
1725
1726
1727
1728.. _etype_u_boot_env:
1729
1730Entry: u-boot-env: An entry which contains a U-Boot environment
1731---------------------------------------------------------------
1732
1733Properties / Entry arguments:
1734    - filename: File containing the environment text, with each line in the
1735        form var=value
1736
1737
1738
1739.. _etype_u_boot_expanded:
1740
1741Entry: u-boot-expanded: U-Boot flat binary broken out into its component parts
1742------------------------------------------------------------------------------
1743
1744This is a section containing the U-Boot binary and a devicetree. Using this
1745entry type automatically creates this section, with the following entries
1746in it:
1747
1748   u-boot-nodtb
1749   u-boot-dtb
1750
1751Having the devicetree separate allows binman to update it in the final
1752image, so that the entries positions are provided to the running U-Boot.
1753
1754
1755
1756.. _etype_u_boot_img:
1757
1758Entry: u-boot-img: U-Boot legacy image
1759--------------------------------------
1760
1761Properties / Entry arguments:
1762    - filename: Filename of u-boot.img (default 'u-boot.img')
1763
1764This is the U-Boot binary as a packaged image, in legacy format. It has a
1765header which allows it to be loaded at the correct address for execution.
1766
1767You should use FIT (Flat Image Tree) instead of the legacy image for new
1768applications.
1769
1770
1771
1772.. _etype_u_boot_nodtb:
1773
1774Entry: u-boot-nodtb: U-Boot flat binary without device tree appended
1775--------------------------------------------------------------------
1776
1777Properties / Entry arguments:
1778    - filename: Filename to include (default 'u-boot-nodtb.bin')
1779
1780This is the U-Boot binary, containing relocation information to allow it
1781to relocate itself at runtime. It does not include a device tree blob at
1782the end of it so normally cannot work without it. You can add a u-boot-dtb
1783entry after this one, or use a u-boot entry instead, normally expands to a
1784section containing u-boot and u-boot-dtb
1785
1786
1787
1788.. _etype_u_boot_spl:
1789
1790Entry: u-boot-spl: U-Boot SPL binary
1791------------------------------------
1792
1793Properties / Entry arguments:
1794    - filename: Filename of u-boot-spl.bin (default 'spl/u-boot-spl.bin')
1795
1796This is the U-Boot SPL (Secondary Program Loader) binary. This is a small
1797binary which loads before U-Boot proper, typically into on-chip SRAM. It is
1798responsible for locating, loading and jumping to U-Boot. Note that SPL is
1799not relocatable so must be loaded to the correct address in SRAM, or written
1800to run from the correct address if direct flash execution is possible (e.g.
1801on x86 devices).
1802
1803SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
1804
1805in the binman README for more information.
1806
1807The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1808binman uses that to look up symbols to write into the SPL binary.
1809
1810Note that this entry is automatically replaced with u-boot-spl-expanded
1811unless --no-expanded is used or the node has a 'no-expanded' property.
1812
1813
1814
1815.. _etype_u_boot_spl_bss_pad:
1816
1817Entry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region
1818---------------------------------------------------------------------
1819
1820Properties / Entry arguments:
1821    None
1822
1823This holds the padding added after the SPL binary to cover the BSS (Block
1824Started by Symbol) region. This region holds the various variables used by
1825SPL. It is set to 0 by SPL when it starts up. If you want to append data to
1826the SPL image (such as a device tree file), you must pad out the BSS region
1827to avoid the data overlapping with U-Boot variables. This entry is useful in
1828that case. It automatically pads out the entry size to cover both the code,
1829data and BSS.
1830
1831The contents of this entry will a certain number of zero bytes, determined
1832by __bss_size
1833
1834The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1835binman uses that to look up the BSS address.
1836
1837
1838
1839.. _etype_u_boot_spl_dtb:
1840
1841Entry: u-boot-spl-dtb: U-Boot SPL device tree
1842---------------------------------------------
1843
1844Properties / Entry arguments:
1845    - filename: Filename of u-boot.dtb (default 'spl/u-boot-spl.dtb')
1846
1847This is the SPL device tree, containing configuration information for
1848SPL. SPL needs this to know what devices are present and which drivers
1849to activate.
1850
1851
1852
1853.. _etype_u_boot_spl_elf:
1854
1855Entry: u-boot-spl-elf: U-Boot SPL ELF image
1856-------------------------------------------
1857
1858Properties / Entry arguments:
1859    - filename: Filename of SPL u-boot (default 'spl/u-boot-spl')
1860
1861This is the U-Boot SPL ELF image. It does not include a device tree but can
1862be relocated to any address for execution.
1863
1864
1865
1866.. _etype_u_boot_spl_expanded:
1867
1868Entry: u-boot-spl-expanded: U-Boot SPL flat binary broken out into its component parts
1869--------------------------------------------------------------------------------------
1870
1871Properties / Entry arguments:
1872    - spl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
1873        select)
1874
1875This is a section containing the U-Boot binary, BSS padding if needed and a
1876devicetree. Using this entry type automatically creates this section, with
1877the following entries in it:
1878
1879   u-boot-spl-nodtb
1880   u-boot-spl-bss-pad
1881   u-boot-dtb
1882
1883Having the devicetree separate allows binman to update it in the final
1884image, so that the entries positions are provided to the running U-Boot.
1885
1886This entry is selected based on the value of the 'spl-dtb' entryarg. If
1887this is non-empty (and not 'n' or '0') then this expanded entry is selected.
1888
1889
1890
1891.. _etype_u_boot_spl_nodtb:
1892
1893Entry: u-boot-spl-nodtb: SPL binary without device tree appended
1894----------------------------------------------------------------
1895
1896Properties / Entry arguments:
1897    - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin')
1898
1899This is the U-Boot SPL binary, It does not include a device tree blob at
1900the end of it so may not be able to work without it, assuming SPL needs
1901a device tree to operate on your platform. You can add a u-boot-spl-dtb
1902entry after this one, or use a u-boot-spl entry instead' which normally
1903expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
1904u-boot-spl-dtb
1905
1906SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
1907
1908in the binman README for more information.
1909
1910The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1911binman uses that to look up symbols to write into the SPL binary.
1912
1913
1914
1915.. _etype_u_boot_spl_with_ucode_ptr:
1916
1917Entry: u-boot-spl-with-ucode-ptr: U-Boot SPL with embedded microcode pointer
1918----------------------------------------------------------------------------
1919
1920This is used when SPL must set up the microcode for U-Boot.
1921
1922See Entry_u_boot_ucode for full details of the entries involved in this
1923process.
1924
1925
1926
1927.. _etype_u_boot_tpl:
1928
1929Entry: u-boot-tpl: U-Boot TPL binary
1930------------------------------------
1931
1932Properties / Entry arguments:
1933    - filename: Filename of u-boot-tpl.bin (default 'tpl/u-boot-tpl.bin')
1934
1935This is the U-Boot TPL (Tertiary Program Loader) binary. This is a small
1936binary which loads before SPL, typically into on-chip SRAM. It is
1937responsible for locating, loading and jumping to SPL, the next-stage
1938loader. Note that SPL is not relocatable so must be loaded to the correct
1939address in SRAM, or written to run from the correct address if direct
1940flash execution is possible (e.g. on x86 devices).
1941
1942SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
1943
1944in the binman README for more information.
1945
1946The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1947binman uses that to look up symbols to write into the TPL binary.
1948
1949Note that this entry is automatically replaced with u-boot-tpl-expanded
1950unless --no-expanded is used or the node has a 'no-expanded' property.
1951
1952
1953
1954.. _etype_u_boot_tpl_bss_pad:
1955
1956Entry: u-boot-tpl-bss-pad: U-Boot TPL binary padded with a BSS region
1957---------------------------------------------------------------------
1958
1959Properties / Entry arguments:
1960    None
1961
1962This holds the padding added after the TPL binary to cover the BSS (Block
1963Started by Symbol) region. This region holds the various variables used by
1964TPL. It is set to 0 by TPL when it starts up. If you want to append data to
1965the TPL image (such as a device tree file), you must pad out the BSS region
1966to avoid the data overlapping with U-Boot variables. This entry is useful in
1967that case. It automatically pads out the entry size to cover both the code,
1968data and BSS.
1969
1970The contents of this entry will a certain number of zero bytes, determined
1971by __bss_size
1972
1973The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1974binman uses that to look up the BSS address.
1975
1976
1977
1978.. _etype_u_boot_tpl_dtb:
1979
1980Entry: u-boot-tpl-dtb: U-Boot TPL device tree
1981---------------------------------------------
1982
1983Properties / Entry arguments:
1984    - filename: Filename of u-boot.dtb (default 'tpl/u-boot-tpl.dtb')
1985
1986This is the TPL device tree, containing configuration information for
1987TPL. TPL needs this to know what devices are present and which drivers
1988to activate.
1989
1990
1991
1992.. _etype_u_boot_tpl_dtb_with_ucode:
1993
1994Entry: u-boot-tpl-dtb-with-ucode: U-Boot TPL with embedded microcode pointer
1995----------------------------------------------------------------------------
1996
1997This is used when TPL must set up the microcode for U-Boot.
1998
1999See Entry_u_boot_ucode for full details of the entries involved in this
2000process.
2001
2002
2003
2004.. _etype_u_boot_tpl_elf:
2005
2006Entry: u-boot-tpl-elf: U-Boot TPL ELF image
2007-------------------------------------------
2008
2009Properties / Entry arguments:
2010    - filename: Filename of TPL u-boot (default 'tpl/u-boot-tpl')
2011
2012This is the U-Boot TPL ELF image. It does not include a device tree but can
2013be relocated to any address for execution.
2014
2015
2016
2017.. _etype_u_boot_tpl_expanded:
2018
2019Entry: u-boot-tpl-expanded: U-Boot TPL flat binary broken out into its component parts
2020--------------------------------------------------------------------------------------
2021
2022Properties / Entry arguments:
2023    - tpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
2024        select)
2025
2026This is a section containing the U-Boot binary, BSS padding if needed and a
2027devicetree. Using this entry type automatically creates this section, with
2028the following entries in it:
2029
2030   u-boot-tpl-nodtb
2031   u-boot-tpl-bss-pad
2032   u-boot-dtb
2033
2034Having the devicetree separate allows binman to update it in the final
2035image, so that the entries positions are provided to the running U-Boot.
2036
2037This entry is selected based on the value of the 'tpl-dtb' entryarg. If
2038this is non-empty (and not 'n' or '0') then this expanded entry is selected.
2039
2040
2041
2042.. _etype_u_boot_tpl_nodtb:
2043
2044Entry: u-boot-tpl-nodtb: TPL binary without device tree appended
2045----------------------------------------------------------------
2046
2047Properties / Entry arguments:
2048    - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin')
2049
2050This is the U-Boot TPL binary, It does not include a device tree blob at
2051the end of it so may not be able to work without it, assuming TPL needs
2052a device tree to operate on your platform. You can add a u-boot-tpl-dtb
2053entry after this one, or use a u-boot-tpl entry instead, which normally
2054expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and
2055u-boot-tpl-dtb
2056
2057TPL can access binman symbols at runtime. See :ref:`binman_fdt`.
2058
2059in the binman README for more information.
2060
2061The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
2062binman uses that to look up symbols to write into the TPL binary.
2063
2064
2065
2066.. _etype_u_boot_tpl_with_ucode_ptr:
2067
2068Entry: u-boot-tpl-with-ucode-ptr: U-Boot TPL with embedded microcode pointer
2069----------------------------------------------------------------------------
2070
2071See Entry_u_boot_ucode for full details of the entries involved in this
2072process.
2073
2074
2075
2076.. _etype_u_boot_ucode:
2077
2078Entry: u-boot-ucode: U-Boot microcode block
2079-------------------------------------------
2080
2081Properties / Entry arguments:
2082    None
2083
2084The contents of this entry are filled in automatically by other entries
2085which must also be in the image.
2086
2087U-Boot on x86 needs a single block of microcode. This is collected from
2088the various microcode update nodes in the device tree. It is also unable
2089to read the microcode from the device tree on platforms that use FSP
2090(Firmware Support Package) binaries, because the API requires that the
2091microcode is supplied before there is any SRAM available to use (i.e.
2092the FSP sets up the SRAM / cache-as-RAM but does so in the call that
2093requires the microcode!). To keep things simple, all x86 platforms handle
2094microcode the same way in U-Boot (even non-FSP platforms). This is that
2095a table is placed at _dt_ucode_base_size containing the base address and
2096size of the microcode. This is either passed to the FSP (for FSP
2097platforms), or used to set up the microcode (for non-FSP platforms).
2098This all happens in the build system since it is the only way to get
2099the microcode into a single blob and accessible without SRAM.
2100
2101There are two cases to handle. If there is only one microcode blob in
2102the device tree, then the ucode pointer it set to point to that. This
2103entry (u-boot-ucode) is empty. If there is more than one update, then
2104this entry holds the concatenation of all updates, and the device tree
2105entry (u-boot-dtb-with-ucode) is updated to remove the microcode. This
2106last step ensures that that the microcode appears in one contiguous
2107block in the image and is not unnecessarily duplicated in the device
2108tree. It is referred to as 'collation' here.
2109
2110Entry types that have a part to play in handling microcode:
2111
2112    Entry_u_boot_with_ucode_ptr:
2113        Contains u-boot-nodtb.bin (i.e. U-Boot without the device tree).
2114        It updates it with the address and size of the microcode so that
2115        U-Boot can find it early on start-up.
2116    Entry_u_boot_dtb_with_ucode:
2117        Contains u-boot.dtb. It stores the microcode in a
2118        'self.ucode_data' property, which is then read by this class to
2119        obtain the microcode if needed. If collation is performed, it
2120        removes the microcode from the device tree.
2121    Entry_u_boot_ucode:
2122        This class. If collation is enabled it reads the microcode from
2123        the Entry_u_boot_dtb_with_ucode entry, and uses it as the
2124        contents of this entry.
2125
2126
2127
2128.. _etype_u_boot_vpl:
2129
2130Entry: u-boot-vpl: U-Boot VPL binary
2131------------------------------------
2132
2133Properties / Entry arguments:
2134    - filename: Filename of u-boot-vpl.bin (default 'vpl/u-boot-vpl.bin')
2135
2136This is the U-Boot VPL (Verifying Program Loader) binary. This is a small
2137binary which loads before SPL, typically into on-chip SRAM. It is
2138responsible for locating, loading and jumping to SPL, the next-stage
2139loader. Note that VPL is not relocatable so must be loaded to the correct
2140address in SRAM, or written to run from the correct address if direct
2141flash execution is possible (e.g. on x86 devices).
2142
2143SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
2144
2145in the binman README for more information.
2146
2147The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
2148binman uses that to look up symbols to write into the VPL binary.
2149
2150
2151
2152.. _etype_u_boot_vpl_bss_pad:
2153
2154Entry: u-boot-vpl-bss-pad: U-Boot VPL binary padded with a BSS region
2155---------------------------------------------------------------------
2156
2157Properties / Entry arguments:
2158    None
2159
2160This holds the padding added after the VPL binary to cover the BSS (Block
2161Started by Symbol) region. This region holds the various variables used by
2162VPL. It is set to 0 by VPL when it starts up. If you want to append data to
2163the VPL image (such as a device tree file), you must pad out the BSS region
2164to avoid the data overlapping with U-Boot variables. This entry is useful in
2165that case. It automatically pads out the entry size to cover both the code,
2166data and BSS.
2167
2168The contents of this entry will a certain number of zero bytes, determined
2169by __bss_size
2170
2171The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
2172binman uses that to look up the BSS address.
2173
2174
2175
2176.. _etype_u_boot_vpl_dtb:
2177
2178Entry: u-boot-vpl-dtb: U-Boot VPL device tree
2179---------------------------------------------
2180
2181Properties / Entry arguments:
2182    - filename: Filename of u-boot.dtb (default 'vpl/u-boot-vpl.dtb')
2183
2184This is the VPL device tree, containing configuration information for
2185VPL. VPL needs this to know what devices are present and which drivers
2186to activate.
2187
2188
2189
2190.. _etype_u_boot_vpl_elf:
2191
2192Entry: u-boot-vpl-elf: U-Boot VPL ELF image
2193-------------------------------------------
2194
2195Properties / Entry arguments:
2196    - filename: Filename of VPL u-boot (default 'vpl/u-boot-vpl')
2197
2198This is the U-Boot VPL ELF image. It does not include a device tree but can
2199be relocated to any address for execution.
2200
2201
2202
2203.. _etype_u_boot_vpl_expanded:
2204
2205Entry: u-boot-vpl-expanded: U-Boot VPL flat binary broken out into its component parts
2206--------------------------------------------------------------------------------------
2207
2208Properties / Entry arguments:
2209    - vpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
2210        select)
2211
2212This is a section containing the U-Boot binary, BSS padding if needed and a
2213devicetree. Using this entry type automatically creates this section, with
2214the following entries in it:
2215
2216   u-boot-vpl-nodtb
2217   u-boot-vpl-bss-pad
2218   u-boot-dtb
2219
2220Having the devicetree separate allows binman to update it in the final
2221image, so that the entries positions are provided to the running U-Boot.
2222
2223This entry is selected based on the value of the 'vpl-dtb' entryarg. If
2224this is non-empty (and not 'n' or '0') then this expanded entry is selected.
2225
2226
2227
2228.. _etype_u_boot_vpl_nodtb:
2229
2230Entry: u-boot-vpl-nodtb: VPL binary without device tree appended
2231----------------------------------------------------------------
2232
2233Properties / Entry arguments:
2234    - filename: Filename to include (default 'vpl/u-boot-vpl-nodtb.bin')
2235
2236This is the U-Boot VPL binary, It does not include a device tree blob at
2237the end of it so may not be able to work without it, assuming VPL needs
2238a device tree to operate on your platform. You can add a u_boot_vpl_dtb
2239entry after this one, or use a u_boot_vpl entry instead, which normally
2240expands to a section containing u-boot-vpl-dtb, u-boot-vpl-bss-pad and
2241u-boot-vpl-dtb
2242
2243VPL can access binman symbols at runtime. See :ref:`binman_fdt`.
2244
2245The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
2246binman uses that to look up symbols to write into the VPL binary.
2247
2248
2249
2250.. _etype_u_boot_with_ucode_ptr:
2251
2252Entry: u-boot-with-ucode-ptr: U-Boot with embedded microcode pointer
2253--------------------------------------------------------------------
2254
2255Properties / Entry arguments:
2256    - filename: Filename of u-boot-nodtb.bin (default 'u-boot-nodtb.bin')
2257    - optional-ucode: boolean property to make microcode optional. If the
2258        u-boot.bin image does not include microcode, no error will
2259        be generated.
2260
2261See Entry_u_boot_ucode for full details of the three entries involved in
2262this process. This entry updates U-Boot with the offset and size of the
2263microcode, to allow early x86 boot code to find it without doing anything
2264complicated. Otherwise it is the same as the u-boot entry.
2265
2266
2267
2268.. _etype_vblock:
2269
2270Entry: vblock: An entry which contains a Chromium OS verified boot block
2271------------------------------------------------------------------------
2272
2273Properties / Entry arguments:
2274    - content: List of phandles to entries to sign
2275    - keydir: Directory containing the public keys to use
2276    - keyblock: Name of the key file to use (inside keydir)
2277    - signprivate: Name of provide key file to use (inside keydir)
2278    - version: Version number of the vblock (typically 1)
2279    - kernelkey: Name of the kernel key to use (inside keydir)
2280    - preamble-flags: Value of the vboot preamble flags (typically 0)
2281
2282Output files:
2283    - input.<unique_name> - input file passed to futility
2284    - vblock.<unique_name> - output file generated by futility (which is
2285        used as the entry contents)
2286
2287Chromium OS signs the read-write firmware and kernel, writing the signature
2288in this block. This allows U-Boot to verify that the next firmware stage
2289and kernel are genuine.
2290
2291
2292
2293.. _etype_x509_cert:
2294
2295Entry: x509-cert: An entry which contains an X509 certificate
2296-------------------------------------------------------------
2297
2298Properties / Entry arguments:
2299    - content: List of phandles to entries to sign
2300
2301Output files:
2302    - input.<unique_name> - input file passed to openssl
2303    - cert.<unique_name> - output file generated by openssl (which is
2304        used as the entry contents)
2305
2306openssl signs the provided data, writing the signature in this entry. This
2307allows verification that the data is genuine
2308
2309
2310
2311.. _etype_x86_reset16:
2312
2313Entry: x86-reset16: x86 16-bit reset code for U-Boot
2314----------------------------------------------------
2315
2316Properties / Entry arguments:
2317    - filename: Filename of u-boot-x86-reset16.bin (default
2318        'u-boot-x86-reset16.bin')
2319
2320x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2321must be placed at a particular address. This entry holds that code. It is
2322typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2323for jumping to the x86-start16 code, which continues execution.
2324
2325For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead.
2326
2327
2328
2329.. _etype_x86_reset16_spl:
2330
2331Entry: x86-reset16-spl: x86 16-bit reset code for U-Boot
2332--------------------------------------------------------
2333
2334Properties / Entry arguments:
2335    - filename: Filename of u-boot-x86-reset16.bin (default
2336        'u-boot-x86-reset16.bin')
2337
2338x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2339must be placed at a particular address. This entry holds that code. It is
2340typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2341for jumping to the x86-start16 code, which continues execution.
2342
2343For 32-bit U-Boot, the 'x86_reset_spl' entry type is used instead.
2344
2345
2346
2347.. _etype_x86_reset16_tpl:
2348
2349Entry: x86-reset16-tpl: x86 16-bit reset code for U-Boot
2350--------------------------------------------------------
2351
2352Properties / Entry arguments:
2353    - filename: Filename of u-boot-x86-reset16.bin (default
2354        'u-boot-x86-reset16.bin')
2355
2356x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2357must be placed at a particular address. This entry holds that code. It is
2358typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
2359for jumping to the x86-start16 code, which continues execution.
2360
2361For 32-bit U-Boot, the 'x86_reset_tpl' entry type is used instead.
2362
2363
2364
2365.. _etype_x86_start16:
2366
2367Entry: x86-start16: x86 16-bit start-up code for U-Boot
2368-------------------------------------------------------
2369
2370Properties / Entry arguments:
2371    - filename: Filename of u-boot-x86-start16.bin (default
2372        'u-boot-x86-start16.bin')
2373
2374x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2375must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2376entry holds that code. It is typically placed at offset
2377CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2378and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2379U-Boot).
2380
2381For 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead.
2382
2383
2384
2385.. _etype_x86_start16_spl:
2386
2387Entry: x86-start16-spl: x86 16-bit start-up code for SPL
2388--------------------------------------------------------
2389
2390Properties / Entry arguments:
2391    - filename: Filename of spl/u-boot-x86-start16-spl.bin (default
2392        'spl/u-boot-x86-start16-spl.bin')
2393
2394x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2395must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2396entry holds that code. It is typically placed at offset
2397CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2398and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2399U-Boot).
2400
2401For 32-bit U-Boot, the 'x86-start16' entry type is used instead.
2402
2403
2404
2405.. _etype_x86_start16_tpl:
2406
2407Entry: x86-start16-tpl: x86 16-bit start-up code for TPL
2408--------------------------------------------------------
2409
2410Properties / Entry arguments:
2411    - filename: Filename of tpl/u-boot-x86-start16-tpl.bin (default
2412        'tpl/u-boot-x86-start16-tpl.bin')
2413
2414x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
2415must be placed in the top 64KB of the ROM. The reset code jumps to it. This
2416entry holds that code. It is typically placed at offset
2417CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
2418and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
2419U-Boot).
2420
2421If TPL is not being used, the 'x86-start16-spl or 'x86-start16' entry types
2422may be used instead.
2423
2424
2425
2426