blob: d5aa3b0f4a485bc848642e9a9d0a839987b8c0c2 [file] [log] [blame]
Simon Glass5a5da7c2018-07-17 13:25:37 -06001Binman Entry Documentation
2===========================
3
4This file describes the entry types supported by binman. These entry types can
5be placed in an image one by one to build up a final firmware image. It is
6fairly easy to create new entry types. Just add a new file to the 'etype'
7directory. You can use the existing entries as examples.
8
9Note that some entries are subclasses of others, using and extending their
10features to produce new behaviours.
11
12
13
Simon Glass96d340e2021-03-18 20:25:16 +130014Entry: atf-bl31: ARM Trusted Firmware (ATF) BL31 blob
15-----------------------------------------------------
Simon Glassdc2f81a2020-09-01 05:13:58 -060016
17Properties / Entry arguments:
18 - atf-bl31-path: Filename of file to read into entry. This is typically
19 called bl31.bin or bl31.elf
20
21This entry holds the run-time firmware, typically started by U-Boot SPL.
22See the U-Boot README for your architecture or board for how to use it. See
23https://github.com/ARM-software/arm-trusted-firmware for more information
24about ATF.
25
26
27
Simon Glass96d340e2021-03-18 20:25:16 +130028Entry: blob: Arbitrary binary blob
29----------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -060030
31Note: This should not be used by itself. It is normally used as a parent
32class by other entry types.
33
34Properties / Entry arguments:
35 - filename: Filename of file to read into entry
Simon Glass83d73c22018-09-14 04:57:26 -060036 - compress: Compression algorithm to use:
37 none: No compression
38 lz4: Use lz4 compression (via 'lz4' command-line utility)
Simon Glass5a5da7c2018-07-17 13:25:37 -060039
40This entry reads data from a file and places it in the entry. The
41default filename is often specified specified by the subclass. See for
Simon Glassadc59ea2021-03-18 20:24:54 +130042example the 'u-boot' entry which provides the filename 'u-boot.bin'.
Simon Glass5a5da7c2018-07-17 13:25:37 -060043
Simon Glass83d73c22018-09-14 04:57:26 -060044If compression is enabled, an extra 'uncomp-size' property is written to
45the node (if enabled with -u) which provides the uncompressed size of the
46data.
47
Simon Glass5a5da7c2018-07-17 13:25:37 -060048
49
Simon Glass6ed45ba2018-09-14 04:57:24 -060050Entry: blob-dtb: A blob that holds a device tree
51------------------------------------------------
52
53This is a blob containing a device tree. The contents of the blob are
54obtained from the list of available device-tree files, managed by the
55'state' module.
56
Simon Glass5a5da7c2018-07-17 13:25:37 -060057
58
Simon Glass96d340e2021-03-18 20:25:16 +130059Entry: blob-ext: Externally built binary blob
60---------------------------------------------
Simon Glassce867ad2020-07-09 18:39:36 -060061
62Note: This should not be used by itself. It is normally used as a parent
63class by other entry types.
64
Simon Glass4f9f1052020-07-09 18:39:38 -060065If the file providing this blob is missing, binman can optionally ignore it
66and produce a broken image with a warning.
67
Simon Glassce867ad2020-07-09 18:39:36 -060068See 'blob' for Properties / Entry arguments.
69
70
71
Simon Glasscc2c5002021-11-23 21:09:52 -070072Entry: blob-ext-list: List of externally built binary blobs
73-----------------------------------------------------------
74
75This is like blob-ext except that a number of blobs can be provided,
76typically with some sort of relationship, e.g. all are DDC parameters.
77
78If any of the external files needed by this llist is missing, binman can
79optionally ignore it and produce a broken image with a warning.
80
81Args:
82 filenames: List of filenames to read and include
83
84
85
Simon Glassec127af2018-07-17 13:25:39 -060086Entry: blob-named-by-arg: A blob entry which gets its filename property from its subclass
87-----------------------------------------------------------------------------------------
88
89Properties / Entry arguments:
90 - <xxx>-path: Filename containing the contents of this entry (optional,
Simon Glass3decfa32020-09-01 05:13:54 -060091 defaults to None)
Simon Glassec127af2018-07-17 13:25:39 -060092
93where <xxx> is the blob_fname argument to the constructor.
94
95This entry cannot be used directly. Instead, it is used as a parent class
96for another entry, which defined blob_fname. This parameter is used to
97set the entry-arg or property containing the filename. The entry-arg or
98property is in turn used to set the actual filename.
99
100See cros_ec_rw for an example of this.
101
102
103
Simon Glass06684922021-03-18 20:25:07 +1300104Entry: blob-phase: Section that holds a phase binary
105----------------------------------------------------
106
107This is a base class that should not normally be used directly. It is used
108when converting a 'u-boot' entry automatically into a 'u-boot-expanded'
109entry; similarly for SPL.
110
111
112
Simon Glass96d340e2021-03-18 20:25:16 +1300113Entry: cbfs: Coreboot Filesystem (CBFS)
114---------------------------------------
Simon Glassac62fba2019-07-08 13:18:53 -0600115
116A CBFS provides a way to group files into a group. It has a simple directory
117structure and allows the position of individual files to be set, since it is
118designed to support execute-in-place in an x86 SPI-flash device. Where XIP
119is not used, it supports compression and storing ELF files.
120
121CBFS is used by coreboot as its way of orgnanising SPI-flash contents.
122
Simon Glass6bc43092021-03-18 20:25:15 +1300123The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.::
Simon Glassac62fba2019-07-08 13:18:53 -0600124
125 cbfs {
126 size = <0x100000>;
127 u-boot {
128 cbfs-type = "raw";
129 };
130 u-boot-dtb {
131 cbfs-type = "raw";
132 };
133 };
134
135This creates a CBFS 1MB in size two files in it: u-boot.bin and u-boot.dtb.
136Note that the size is required since binman does not support calculating it.
137The contents of each entry is just what binman would normally provide if it
138were not a CBFS node. A blob type can be used to import arbitrary files as
Simon Glass6bc43092021-03-18 20:25:15 +1300139with the second subnode below::
Simon Glassac62fba2019-07-08 13:18:53 -0600140
141 cbfs {
142 size = <0x100000>;
143 u-boot {
144 cbfs-name = "BOOT";
145 cbfs-type = "raw";
146 };
147
148 dtb {
149 type = "blob";
150 filename = "u-boot.dtb";
151 cbfs-type = "raw";
152 cbfs-compress = "lz4";
Simon Glasse073d4e2019-07-08 13:18:56 -0600153 cbfs-offset = <0x100000>;
Simon Glassac62fba2019-07-08 13:18:53 -0600154 };
155 };
156
157This creates a CBFS 1MB in size with u-boot.bin (named "BOOT") and
158u-boot.dtb (named "dtb") and compressed with the lz4 algorithm.
159
160
161Properties supported in the top-level CBFS node:
162
163cbfs-arch:
164 Defaults to "x86", but you can specify the architecture if needed.
165
166
167Properties supported in the CBFS entry subnodes:
168
169cbfs-name:
170 This is the name of the file created in CBFS. It defaults to the entry
171 name (which is the node name), but you can override it with this
172 property.
173
174cbfs-type:
175 This is the CBFS file type. The following are supported:
176
177 raw:
178 This is a 'raw' file, although compression is supported. It can be
179 used to store any file in CBFS.
180
181 stage:
182 This is an ELF file that has been loaded (i.e. mapped to memory), so
183 appears in the CBFS as a flat binary. The input file must be an ELF
184 image, for example this puts "u-boot" (the ELF image) into a 'stage'
Simon Glass6bc43092021-03-18 20:25:15 +1300185 entry::
Simon Glassac62fba2019-07-08 13:18:53 -0600186
187 cbfs {
188 size = <0x100000>;
189 u-boot-elf {
190 cbfs-name = "BOOT";
191 cbfs-type = "stage";
192 };
193 };
194
Simon Glass6bc43092021-03-18 20:25:15 +1300195 You can use your own ELF file with something like::
Simon Glassac62fba2019-07-08 13:18:53 -0600196
197 cbfs {
198 size = <0x100000>;
199 something {
200 type = "blob";
201 filename = "cbfs-stage.elf";
202 cbfs-type = "stage";
203 };
204 };
205
206 As mentioned, the file is converted to a flat binary, so it is
207 equivalent to adding "u-boot.bin", for example, but with the load and
208 start addresses specified by the ELF. At present there is no option
209 to add a flat binary with a load/start address, similar to the
210 'add-flat-binary' option in cbfstool.
211
Simon Glasse073d4e2019-07-08 13:18:56 -0600212cbfs-offset:
213 This is the offset of the file's data within the CBFS. It is used to
214 specify where the file should be placed in cases where a fixed position
215 is needed. Typical uses are for code which is not relocatable and must
216 execute in-place from a particular address. This works because SPI flash
217 is generally mapped into memory on x86 devices. The file header is
218 placed before this offset so that the data start lines up exactly with
219 the chosen offset. If this property is not provided, then the file is
220 placed in the next available spot.
Simon Glassac62fba2019-07-08 13:18:53 -0600221
222The current implementation supports only a subset of CBFS features. It does
223not support other file types (e.g. payload), adding multiple files (like the
224'files' entry with a pattern supported by binman), putting files at a
225particular offset in the CBFS and a few other things.
226
227Of course binman can create images containing multiple CBFSs, simply by
Simon Glass6bc43092021-03-18 20:25:15 +1300228defining these in the binman config::
Simon Glassac62fba2019-07-08 13:18:53 -0600229
230
231 binman {
232 size = <0x800000>;
233 cbfs {
234 offset = <0x100000>;
235 size = <0x100000>;
236 u-boot {
237 cbfs-type = "raw";
238 };
239 u-boot-dtb {
240 cbfs-type = "raw";
241 };
242 };
243
244 cbfs2 {
245 offset = <0x700000>;
246 size = <0x100000>;
247 u-boot {
248 cbfs-type = "raw";
249 };
250 u-boot-dtb {
251 cbfs-type = "raw";
252 };
253 image {
254 type = "blob";
255 filename = "image.jpg";
256 };
257 };
258 };
259
260This creates an 8MB image with two CBFSs, one at offset 1MB, one at 7MB,
261both of size 1MB.
262
263
264
Simon Glass189f2912021-03-21 18:24:31 +1300265Entry: collection: An entry which contains a collection of other entries
266------------------------------------------------------------------------
267
268Properties / Entry arguments:
269 - content: List of phandles to entries to include
270
271This allows reusing the contents of other entries. The contents of the
272listed entries are combined to form this entry. This serves as a useful
273base class for entry types which need to process data from elsewhere in
274the image, not necessarily child entries.
275
276
277
Simon Glassec127af2018-07-17 13:25:39 -0600278Entry: cros-ec-rw: A blob entry which contains a Chromium OS read-write EC image
279--------------------------------------------------------------------------------
280
281Properties / Entry arguments:
282 - cros-ec-rw-path: Filename containing the EC image
283
284This entry holds a Chromium OS EC (embedded controller) image, for use in
285updating the EC on startup via software sync.
286
287
288
Simon Glass086cec92019-07-08 14:25:27 -0600289Entry: fdtmap: An entry which contains an FDT map
290-------------------------------------------------
291
292Properties / Entry arguments:
293 None
294
295An FDT map is just a header followed by an FDT containing a list of all the
Simon Glass12bb1a92019-07-20 12:23:51 -0600296entries in the image. The root node corresponds to the image node in the
297original FDT, and an image-name property indicates the image name in that
298original tree.
Simon Glass086cec92019-07-08 14:25:27 -0600299
300The header is the string _FDTMAP_ followed by 8 unused bytes.
301
302When used, this entry will be populated with an FDT map which reflects the
303entries in the current image. Hierarchy is preserved, and all offsets and
304sizes are included.
305
306Note that the -u option must be provided to ensure that binman updates the
307FDT with the position of each entry.
308
Simon Glass6bc43092021-03-18 20:25:15 +1300309Example output for a simple image with U-Boot and an FDT map::
Simon Glass086cec92019-07-08 14:25:27 -0600310
Simon Glass6bc43092021-03-18 20:25:15 +1300311 / {
312 image-name = "binman";
313 size = <0x00000112>;
Simon Glass086cec92019-07-08 14:25:27 -0600314 image-pos = <0x00000000>;
315 offset = <0x00000000>;
Simon Glass6bc43092021-03-18 20:25:15 +1300316 u-boot {
317 size = <0x00000004>;
318 image-pos = <0x00000000>;
319 offset = <0x00000000>;
320 };
321 fdtmap {
322 size = <0x0000010e>;
323 image-pos = <0x00000004>;
324 offset = <0x00000004>;
325 };
Simon Glass086cec92019-07-08 14:25:27 -0600326 };
Simon Glass086cec92019-07-08 14:25:27 -0600327
Simon Glass12bb1a92019-07-20 12:23:51 -0600328If allow-repack is used then 'orig-offset' and 'orig-size' properties are
329added as necessary. See the binman README.
330
Simon Glass943bf782021-11-23 21:09:50 -0700331When extracting files, an alternative 'fdt' format is available for fdtmaps.
332Use `binman extract -F fdt ...` to use this. It will export a devicetree,
333without the fdtmap header, so it can be viewed with `fdtdump`.
334
Simon Glass086cec92019-07-08 14:25:27 -0600335
336
Simon Glass96d340e2021-03-18 20:25:16 +1300337Entry: files: A set of files arranged in a section
338--------------------------------------------------
Simon Glass0a98b282018-09-14 04:57:28 -0600339
340Properties / Entry arguments:
341 - pattern: Filename pattern to match the files to include
Simon Glass9248c8d2020-10-26 17:40:07 -0600342 - files-compress: Compression algorithm to use:
Simon Glass0a98b282018-09-14 04:57:28 -0600343 none: No compression
344 lz4: Use lz4 compression (via 'lz4' command-line utility)
Simon Glass4ce40772021-03-18 20:24:53 +1300345 - files-align: Align each file to the given alignment
Simon Glass0a98b282018-09-14 04:57:28 -0600346
347This entry reads a number of files and places each in a separate sub-entry
348within this entry. To access these you need to enable device-tree updates
349at run-time so you can obtain the file positions.
350
351
352
Simon Glass3af8e492018-07-17 13:25:40 -0600353Entry: fill: An entry which is filled to a particular byte value
354----------------------------------------------------------------
355
356Properties / Entry arguments:
357 - fill-byte: Byte to use to fill the entry
358
359Note that the size property must be set since otherwise this entry does not
360know how large it should be.
361
362You can often achieve the same effect using the pad-byte property of the
363overall image, in that the space between entries will then be padded with
364that byte. But this entry is sometimes useful for explicitly setting the
365byte value of a region.
366
367
368
Simon Glass96d340e2021-03-18 20:25:16 +1300369Entry: fit: Flat Image Tree (FIT)
370---------------------------------
Simon Glassfdc34362020-07-09 18:39:45 -0600371
372This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the
373input provided.
374
375Nodes for the FIT should be written out in the binman configuration just as
376they would be in a file passed to mkimage.
377
Simon Glass6bc43092021-03-18 20:25:15 +1300378For example, this creates an image containing a FIT with U-Boot SPL::
Simon Glassfdc34362020-07-09 18:39:45 -0600379
380 binman {
381 fit {
382 description = "Test FIT";
Simon Glass6cf99532020-09-01 05:13:59 -0600383 fit,fdt-list = "of-list";
Simon Glassfdc34362020-07-09 18:39:45 -0600384
385 images {
386 kernel@1 {
387 description = "SPL";
388 os = "u-boot";
389 type = "rkspi";
390 arch = "arm";
391 compression = "none";
392 load = <0>;
393 entry = <0>;
394
395 u-boot-spl {
396 };
397 };
398 };
399 };
400 };
401
Simon Glass6cf99532020-09-01 05:13:59 -0600402U-Boot supports creating fdt and config nodes automatically. To do this,
403pass an of-list property (e.g. -a of-list=file1 file2). This tells binman
404that you want to generates nodes for two files: file1.dtb and file2.dtb
405The fit,fdt-list property (see above) indicates that of-list should be used.
406If the property is missing you will get an error.
407
Simon Glass6bc43092021-03-18 20:25:15 +1300408Then add a 'generator node', a node with a name starting with '@'::
Simon Glass6cf99532020-09-01 05:13:59 -0600409
410 images {
411 @fdt-SEQ {
412 description = "fdt-NAME";
413 type = "flat_dt";
414 compression = "none";
415 };
416 };
417
418This tells binman to create nodes fdt-1 and fdt-2 for each of your two
419files. All the properties you specify will be included in the node. This
420node acts like a template to generate the nodes. The generator node itself
421does not appear in the output - it is replaced with what binman generates.
422
Simon Glass6bc43092021-03-18 20:25:15 +1300423You can create config nodes in a similar way::
Simon Glass6cf99532020-09-01 05:13:59 -0600424
425 configurations {
426 default = "@config-DEFAULT-SEQ";
427 @config-SEQ {
428 description = "NAME";
Samuel Holland68158d52020-10-21 21:12:14 -0500429 firmware = "atf";
430 loadables = "uboot";
Simon Glass6cf99532020-09-01 05:13:59 -0600431 fdt = "fdt-SEQ";
432 };
433 };
434
435This tells binman to create nodes config-1 and config-2, i.e. a config for
436each of your two files.
437
438Available substitutions for '@' nodes are:
439
Simon Glass6bc43092021-03-18 20:25:15 +1300440SEQ:
441 Sequence number of the generated fdt (1, 2, ...)
442NAME
443 Name of the dtb as provided (i.e. without adding '.dtb')
Simon Glass6cf99532020-09-01 05:13:59 -0600444
445Note that if no devicetree files are provided (with '-a of-list' as above)
446then no nodes will be generated.
447
Simon Glassc0f1ebe2020-09-06 10:39:08 -0600448The 'default' property, if present, will be automatically set to the name
449if of configuration whose devicetree matches the 'default-dt' entry
450argument, e.g. with '-a default-dt=sun50i-a64-pine64-lts'.
451
Simon Glass6bc43092021-03-18 20:25:15 +1300452Available substitutions for '@' property values are
Simon Glassf3243302020-10-26 17:39:59 -0600453
Simon Glass6bc43092021-03-18 20:25:15 +1300454DEFAULT-SEQ:
455 Sequence number of the default fdt,as provided by the 'default-dt' entry
456 argument
Simon Glass6cf99532020-09-01 05:13:59 -0600457
458Properties (in the 'fit' node itself):
Simon Glassfdc34362020-07-09 18:39:45 -0600459 fit,external-offset: Indicates that the contents of the FIT are external
460 and provides the external offset. This is passsed to mkimage via
461 the -E and -p flags.
462
463
464
465
Simon Glass11e36cc2018-07-17 13:25:38 -0600466Entry: fmap: An entry which contains an Fmap section
467----------------------------------------------------
468
469Properties / Entry arguments:
470 None
471
472FMAP is a simple format used by flashrom, an open-source utility for
473reading and writing the SPI flash, typically on x86 CPUs. The format
474provides flashrom with a list of areas, so it knows what it in the flash.
475It can then read or write just a single area, instead of the whole flash.
476
477The format is defined by the flashrom project, in the file lib/fmap.h -
478see www.flashrom.org/Flashrom for more information.
479
480When used, this entry will be populated with an FMAP which reflects the
481entries in the current image. Note that any hierarchy is squashed, since
Simon Glass17365752021-04-03 11:05:10 +1300482FMAP does not support this. Sections are represented as an area appearing
483before its contents, so that it is possible to reconstruct the hierarchy
484from the FMAP by using the offset information. This convention does not
485seem to be documented, but is used in Chromium OS.
486
487CBFS entries appear as a single entry, i.e. the sub-entries are ignored.
Simon Glass11e36cc2018-07-17 13:25:38 -0600488
489
490
Simon Glass0ef87aa2018-07-17 13:25:44 -0600491Entry: gbb: An entry which contains a Chromium OS Google Binary Block
492---------------------------------------------------------------------
493
494Properties / Entry arguments:
495 - hardware-id: Hardware ID to use for this build (a string)
496 - keydir: Directory containing the public keys to use
497 - bmpblk: Filename containing images used by recovery
498
499Chromium OS uses a GBB to store various pieces of information, in particular
500the root and recovery keys that are used to verify the boot process. Some
501more details are here:
502
503 https://www.chromium.org/chromium-os/firmware-porting-guide/2-concepts
504
505but note that the page dates from 2013 so is quite out of date. See
506README.chromium for how to obtain the required keys and tools.
507
508
509
Simon Glasscf228942019-07-08 14:25:28 -0600510Entry: image-header: An entry which contains a pointer to the FDT map
511---------------------------------------------------------------------
512
513Properties / Entry arguments:
514 location: Location of header ("start" or "end" of image). This is
515 optional. If omitted then the entry must have an offset property.
516
517This adds an 8-byte entry to the start or end of the image, pointing to the
518location of the FDT map. The format is a magic number followed by an offset
519from the start or end of the image, in twos-compliment format.
520
521This entry must be in the top-level part of the image.
522
523NOTE: If the location is at the start/end, you will probably need to specify
524sort-by-offset for the image, unless you actually put the image header
525first/last in the entry list.
526
527
528
Simon Glass96d340e2021-03-18 20:25:16 +1300529Entry: intel-cmc: Intel Chipset Micro Code (CMC) file
530-----------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -0600531
532Properties / Entry arguments:
533 - filename: Filename of file to read into entry
534
535This file contains microcode for some devices in a special format. An
536example filename is 'Microcode/C0_22211.BIN'.
537
538See README.x86 for information about x86 binary blobs.
539
540
541
542Entry: intel-descriptor: Intel flash descriptor block (4KB)
543-----------------------------------------------------------
544
545Properties / Entry arguments:
546 filename: Filename of file containing the descriptor. This is typically
547 a 4KB binary file, sometimes called 'descriptor.bin'
548
549This entry is placed at the start of flash and provides information about
550the SPI flash regions. In particular it provides the base address and
551size of the ME (Management Engine) region, allowing us to place the ME
552binary in the right place.
553
554With this entry in your image, the position of the 'intel-me' entry will be
555fixed in the image, which avoids you needed to specify an offset for that
556region. This is useful, because it is not possible to change the position
557of the ME region without updating the descriptor.
558
559See README.x86 for information about x86 binary blobs.
560
561
562
Simon Glass5af12072019-08-24 07:22:50 -0600563Entry: intel-fit: Intel Firmware Image Table (FIT)
564--------------------------------------------------
565
566This entry contains a dummy FIT as required by recent Intel CPUs. The FIT
567contains information about the firmware and microcode available in the
568image.
569
570At present binman only supports a basic FIT with no microcode.
571
572
573
574Entry: intel-fit-ptr: Intel Firmware Image Table (FIT) pointer
575--------------------------------------------------------------
576
577This entry contains a pointer to the FIT. It is required to be at address
5780xffffffc0 in the image.
579
580
581
Simon Glass96d340e2021-03-18 20:25:16 +1300582Entry: intel-fsp: Intel Firmware Support Package (FSP) file
583-----------------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -0600584
585Properties / Entry arguments:
586 - filename: Filename of file to read into entry
587
588This file contains binary blobs which are used on some devices to make the
589platform work. U-Boot executes this code since it is not possible to set up
590the hardware using U-Boot open-source code. Documentation is typically not
591available in sufficient detail to allow this.
592
593An example filename is 'FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd'
594
595See README.x86 for information about x86 binary blobs.
596
597
598
Simon Glass96d340e2021-03-18 20:25:16 +1300599Entry: intel-fsp-m: Intel Firmware Support Package (FSP) memory init
600--------------------------------------------------------------------
Simon Glassea0fff92019-08-24 07:23:07 -0600601
602Properties / Entry arguments:
603 - filename: Filename of file to read into entry
604
605This file contains a binary blob which is used on some devices to set up
606SDRAM. U-Boot executes this code in SPL so that it can make full use of
607memory. Documentation is typically not available in sufficient detail to
608allow U-Boot do this this itself..
609
610An example filename is 'fsp_m.bin'
611
612See README.x86 for information about x86 binary blobs.
613
614
615
Simon Glass96d340e2021-03-18 20:25:16 +1300616Entry: intel-fsp-s: Intel Firmware Support Package (FSP) silicon init
617---------------------------------------------------------------------
Simon Glassbc6a88f2019-10-20 21:31:35 -0600618
619Properties / Entry arguments:
620 - filename: Filename of file to read into entry
621
622This file contains a binary blob which is used on some devices to set up
623the silicon. U-Boot executes this code in U-Boot proper after SDRAM is
624running, so that it can make full use of memory. Documentation is typically
625not available in sufficient detail to allow U-Boot do this this itself.
626
627An example filename is 'fsp_s.bin'
628
629See README.x86 for information about x86 binary blobs.
630
631
632
Simon Glass96d340e2021-03-18 20:25:16 +1300633Entry: intel-fsp-t: Intel Firmware Support Package (FSP) temp ram init
634----------------------------------------------------------------------
Simon Glass998d1482019-10-20 21:31:36 -0600635
636Properties / Entry arguments:
637 - filename: Filename of file to read into entry
638
639This file contains a binary blob which is used on some devices to set up
640temporary memory (Cache-as-RAM or CAR). U-Boot executes this code in TPL so
641that it has access to memory for its stack and initial storage.
642
643An example filename is 'fsp_t.bin'
644
645See README.x86 for information about x86 binary blobs.
646
647
648
Simon Glass96d340e2021-03-18 20:25:16 +1300649Entry: intel-ifwi: Intel Integrated Firmware Image (IFWI) file
650--------------------------------------------------------------
Simon Glasse073d4e2019-07-08 13:18:56 -0600651
652Properties / Entry arguments:
653 - filename: Filename of file to read into entry. This is either the
654 IFWI file itself, or a file that can be converted into one using a
655 tool
656 - convert-fit: If present this indicates that the ifwitool should be
657 used to convert the provided file into a IFWI.
658
659This file contains code and data used by the SoC that is required to make
660it work. It includes U-Boot TPL, microcode, things related to the CSE
661(Converged Security Engine, the microcontroller that loads all the firmware)
662and other items beyond the wit of man.
663
664A typical filename is 'ifwi.bin' for an IFWI file, or 'fitimage.bin' for a
665file that will be converted to an IFWI.
666
667The position of this entry is generally set by the intel-descriptor entry.
668
669The contents of the IFWI are specified by the subnodes of the IFWI node.
670Each subnode describes an entry which is placed into the IFWFI with a given
671sub-partition (and optional entry name).
672
Simon Glass3da9ce82019-08-24 07:22:47 -0600673Properties for subnodes:
Simon Glass6bc43092021-03-18 20:25:15 +1300674 - ifwi-subpart: sub-parition to put this entry into, e.g. "IBBP"
675 - ifwi-entry: entry name t use, e.g. "IBBL"
676 - ifwi-replace: if present, indicates that the item should be replaced
677 in the IFWI. Otherwise it is added.
Simon Glass3da9ce82019-08-24 07:22:47 -0600678
Simon Glasse073d4e2019-07-08 13:18:56 -0600679See README.x86 for information about x86 binary blobs.
680
681
682
Simon Glass96d340e2021-03-18 20:25:16 +1300683Entry: intel-me: Intel Management Engine (ME) file
684--------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -0600685
686Properties / Entry arguments:
687 - filename: Filename of file to read into entry
688
689This file contains code used by the SoC that is required to make it work.
690The Management Engine is like a background task that runs things that are
Thomas Hebb32f2ca22019-11-13 18:18:03 -0800691not clearly documented, but may include keyboard, display and network
Simon Glass5a5da7c2018-07-17 13:25:37 -0600692access. For platform that use ME it is not possible to disable it. U-Boot
693does not directly execute code in the ME binary.
694
695A typical filename is 'me.bin'.
696
Simon Glassfa1c9372019-07-08 13:18:38 -0600697The position of this entry is generally set by the intel-descriptor entry.
698
Simon Glass5a5da7c2018-07-17 13:25:37 -0600699See README.x86 for information about x86 binary blobs.
700
701
702
Simon Glass96d340e2021-03-18 20:25:16 +1300703Entry: intel-mrc: Intel Memory Reference Code (MRC) file
704--------------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -0600705
706Properties / Entry arguments:
707 - filename: Filename of file to read into entry
708
709This file contains code for setting up the SDRAM on some Intel systems. This
710is executed by U-Boot when needed early during startup. A typical filename
711is 'mrc.bin'.
712
713See README.x86 for information about x86 binary blobs.
714
715
716
Simon Glass96d340e2021-03-18 20:25:16 +1300717Entry: intel-refcode: Intel Reference Code file
718-----------------------------------------------
Simon Glass5385f5a2019-05-17 22:00:53 -0600719
720Properties / Entry arguments:
721 - filename: Filename of file to read into entry
722
723This file contains code for setting up the platform on some Intel systems.
724This is executed by U-Boot when needed early during startup. A typical
725filename is 'refcode.bin'.
726
727See README.x86 for information about x86 binary blobs.
728
729
730
Simon Glass96d340e2021-03-18 20:25:16 +1300731Entry: intel-vbt: Intel Video BIOS Table (VBT) file
732---------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -0600733
734Properties / Entry arguments:
735 - filename: Filename of file to read into entry
736
737This file contains code that sets up the integrated graphics subsystem on
738some Intel SoCs. U-Boot executes this when the display is started up.
739
740See README.x86 for information about Intel binary blobs.
741
742
743
Simon Glass96d340e2021-03-18 20:25:16 +1300744Entry: intel-vga: Intel Video Graphics Adaptor (VGA) file
745---------------------------------------------------------
Simon Glass5a5da7c2018-07-17 13:25:37 -0600746
747Properties / Entry arguments:
748 - filename: Filename of file to read into entry
749
750This file contains code that sets up the integrated graphics subsystem on
751some Intel SoCs. U-Boot executes this when the display is started up.
752
753This is similar to the VBT file but in a different format.
754
755See README.x86 for information about Intel binary blobs.
756
757
758
Simon Glass96d340e2021-03-18 20:25:16 +1300759Entry: mkimage: Binary produced by mkimage
760------------------------------------------
Simon Glass0dc706f2020-07-09 18:39:31 -0600761
762Properties / Entry arguments:
763 - datafile: Filename for -d argument
764 - args: Other arguments to pass
765
766The data passed to mkimage is collected from subnodes of the mkimage node,
Simon Glass6bc43092021-03-18 20:25:15 +1300767e.g.::
Simon Glass0dc706f2020-07-09 18:39:31 -0600768
769 mkimage {
770 args = "-n test -T imximage";
771
772 u-boot-spl {
773 };
774 };
775
776This calls mkimage to create an imximage with u-boot-spl.bin as the input
777file. The output from mkimage then becomes part of the image produced by
778binman.
779
780
781
Bin Meng4c4d6072021-05-10 20:23:33 +0800782Entry: opensbi: RISC-V OpenSBI fw_dynamic blob
783----------------------------------------------
784
785Properties / Entry arguments:
786 - opensbi-path: Filename of file to read into entry. This is typically
787 called fw_dynamic.bin
788
789This entry holds the run-time firmware, typically started by U-Boot SPL.
790See the U-Boot README for your architecture or board for how to use it. See
791https://github.com/riscv/opensbi for more information about OpenSBI.
792
793
794
Jagdish Gediya9d368f32018-09-03 21:35:08 +0530795Entry: powerpc-mpc85xx-bootpg-resetvec: PowerPC mpc85xx bootpg + resetvec code for U-Boot
796-----------------------------------------------------------------------------------------
797
798Properties / Entry arguments:
799 - filename: Filename of u-boot-br.bin (default 'u-boot-br.bin')
800
Thomas Hebb32f2ca22019-11-13 18:18:03 -0800801This entry is valid for PowerPC mpc85xx cpus. This entry holds
Jagdish Gediya9d368f32018-09-03 21:35:08 +0530802'bootpg + resetvec' code for PowerPC mpc85xx CPUs which needs to be
803placed at offset 'RESET_VECTOR_ADDRESS - 0xffc'.
804
805
806
Simon Glass96d340e2021-03-18 20:25:16 +1300807Entry: scp: System Control Processor (SCP) firmware blob
808--------------------------------------------------------
Simon Glassf3243302020-10-26 17:39:59 -0600809
810Properties / Entry arguments:
811 - scp-path: Filename of file to read into the entry, typically scp.bin
812
813This entry holds firmware for an external platform-specific coprocessor.
814
815
816
Simon Glass5a5da7c2018-07-17 13:25:37 -0600817Entry: section: Entry that contains other entries
818-------------------------------------------------
819
Simon Glass3f495f12021-11-23 11:03:49 -0700820A section is an entry which can contain other entries, thus allowing
821hierarchical images to be created. See 'Sections and hierarchical images'
822in the binman README for more information.
Simon Glass6bc43092021-03-18 20:25:15 +1300823
Simon Glass3f495f12021-11-23 11:03:49 -0700824The base implementation simply joins the various entries together, using
825various rules about alignment, etc.
Simon Glass6bc43092021-03-18 20:25:15 +1300826
Simon Glass3f495f12021-11-23 11:03:49 -0700827Subclassing
828~~~~~~~~~~~
Simon Glass5a5da7c2018-07-17 13:25:37 -0600829
Simon Glass3f495f12021-11-23 11:03:49 -0700830This class can be subclassed to support other file formats which hold
831multiple entries, such as CBFS. To do this, override the following
832functions. The documentation here describes what your function should do.
833For example code, see etypes which subclass `Entry_section`, or `cbfs.py`
834for a more involved example::
Simon Glass3decfa32020-09-01 05:13:54 -0600835
Simon Glass3f495f12021-11-23 11:03:49 -0700836 $ grep -l \(Entry_section tools/binman/etype/*.py
837
838ReadNode()
839 Call `super().ReadNode()`, then read any special properties for the
840 section. Then call `self.ReadEntries()` to read the entries.
841
842 Binman calls this at the start when reading the image description.
843
844ReadEntries()
845 Read in the subnodes of the section. This may involve creating entries
846 of a particular etype automatically, as well as reading any special
847 properties in the entries. For each entry, entry.ReadNode() should be
848 called, to read the basic entry properties. The properties should be
849 added to `self._entries[]`, in the correct order, with a suitable name.
850
851 Binman calls this at the start when reading the image description.
852
853BuildSectionData(required)
854 Create the custom file format that you want and return it as bytes.
855 This likely sets up a file header, then loops through the entries,
856 adding them to the file. For each entry, call `entry.GetData()` to
857 obtain the data. If that returns None, and `required` is False, then
858 this method must give up and return None. But if `required` is True then
859 it should assume that all data is valid.
860
861 Binman calls this when packing the image, to find out the size of
862 everything. It is called again at the end when building the final image.
863
864SetImagePos(image_pos):
865 Call `super().SetImagePos(image_pos)`, then set the `image_pos` values
866 for each of the entries. This should use the custom file format to find
867 the `start offset` (and `image_pos`) of each entry. If the file format
868 uses compression in such a way that there is no offset available (other
869 than reading the whole file and decompressing it), then the offsets for
870 affected entries can remain unset (`None`). The size should also be set
871 if possible.
872
873 Binman calls this after the image has been packed, to update the
874 location that all the entries ended up at.
875
Simon Glass943bf782021-11-23 21:09:50 -0700876ReadChildData(child, decomp, alt_format):
Simon Glass3f495f12021-11-23 11:03:49 -0700877 The default version of this may be good enough, if you are able to
878 implement SetImagePos() correctly. But that is a bit of a bypass, so
879 you can override this method to read from your custom file format. It
880 should read the entire entry containing the custom file using
881 `super().ReadData(True)`, then parse the file to get the data for the
882 given child, then return that data.
883
884 If your file format supports compression, the `decomp` argument tells
885 you whether to return the compressed data (`decomp` is False) or to
886 uncompress it first, then return the uncompressed data (`decomp` is
887 True). This is used by the `binman extract -U` option.
888
Simon Glass943bf782021-11-23 21:09:50 -0700889 If your entry supports alternative formats, the alt_format provides the
890 alternative format that the user has selected. Your function should
891 return data in that format. This is used by the 'binman extract -l'
892 option.
893
Simon Glass3f495f12021-11-23 11:03:49 -0700894 Binman calls this when reading in an image, in order to populate all the
895 entries with the data from that image (`binman ls`).
896
897WriteChildData(child):
898 Binman calls this after `child.data` is updated, to inform the custom
899 file format about this, in case it needs to do updates.
900
901 The default version of this does nothing and probably needs to be
902 overridden for the 'binman replace' command to work. Your version should
903 use `child.data` to update the data for that child in the custom file
904 format.
905
906 Binman calls this when updating an image that has been read in and in
907 particular to update the data for a particular entry (`binman replace`)
908
909Properties / Entry arguments
910~~~~~~~~~~~~~~~~~~~~~~~~~~~~
911
912See :ref:`develop/package/binman:Image description format` for more
913information.
914
915align-default
916 Default alignment for this section, if no alignment is given in the
917 entry
918
919pad-byte
920 Pad byte to use when padding
921
922sort-by-offset
923 True if entries should be sorted by offset, False if they must be
924 in-order in the device tree description
925
926end-at-4gb
927 Used to build an x86 ROM which ends at 4GB (2^32)
928
929name-prefix
930 Adds a prefix to the name of every entry in the section when writing out
931 the map
932
933skip-at-start
934 Number of bytes before the first entry starts. These effectively adjust
935 the starting offset of entries. For example, if this is 16, then the
936 first entry would start at 16. An entry with offset = 20 would in fact
937 be written at offset 4 in the image file, since the first 16 bytes are
938 skipped when writing.
Simon Glass17365752021-04-03 11:05:10 +1300939
Simon Glass8beb11e2019-07-08 14:25:47 -0600940Since a section is also an entry, it inherits all the properies of entries
941too.
942
Simon Glass3f495f12021-11-23 11:03:49 -0700943Note that the `allow_missing` member controls whether this section permits
944external blobs to be missing their contents. The option will produce an
945image but of course it will not work. It is useful to make sure that
946Continuous Integration systems can build without the binaries being
947available. This is set by the `SetAllowMissing()` method, if
948`--allow-missing` is passed to binman.
Simon Glass5a5da7c2018-07-17 13:25:37 -0600949
950
951
952Entry: text: An entry which contains text
953-----------------------------------------
954
955The text can be provided either in the node itself or by a command-line
956argument. There is a level of indirection to allow multiple text strings
957and sharing of text.
958
959Properties / Entry arguments:
960 text-label: The value of this string indicates the property / entry-arg
961 that contains the string to place in the entry
962 <xxx> (actual name is the value of text-label): contains the string to
963 place in the entry.
Simon Glassaa88b502019-07-08 13:18:40 -0600964 <text>: The text to place in the entry (overrides the above mechanism).
965 This is useful when the text is constant.
Simon Glass5a5da7c2018-07-17 13:25:37 -0600966
Simon Glass6bc43092021-03-18 20:25:15 +1300967Example node::
Simon Glass5a5da7c2018-07-17 13:25:37 -0600968
969 text {
970 size = <50>;
971 text-label = "message";
972 };
973
974You can then use:
975
976 binman -amessage="this is my message"
977
978and binman will insert that string into the entry.
979
Simon Glass6bc43092021-03-18 20:25:15 +1300980It is also possible to put the string directly in the node::
Simon Glass5a5da7c2018-07-17 13:25:37 -0600981
982 text {
983 size = <8>;
984 text-label = "message";
985 message = "a message directly in the node"
986 };
987
Simon Glass6bc43092021-03-18 20:25:15 +1300988or just::
Simon Glassaa88b502019-07-08 13:18:40 -0600989
990 text {
991 size = <8>;
992 text = "some text directly in the node"
993 };
994
Simon Glass5a5da7c2018-07-17 13:25:37 -0600995The text is not itself nul-terminated. This can be achieved, if required,
996by setting the size of the entry to something larger than the text.
997
998
999
1000Entry: u-boot: U-Boot flat binary
1001---------------------------------
1002
1003Properties / Entry arguments:
1004 - filename: Filename of u-boot.bin (default 'u-boot.bin')
1005
1006This is the U-Boot binary, containing relocation information to allow it
1007to relocate itself at runtime. The binary typically includes a device tree
Simon Glass06684922021-03-18 20:25:07 +13001008blob at the end of it.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001009
1010U-Boot can access binman symbols at runtime. See:
1011
1012 'Access to binman entry offsets at run time (fdt)'
1013
1014in the binman README for more information.
1015
Simon Glass06684922021-03-18 20:25:07 +13001016Note that this entry is automatically replaced with u-boot-expanded unless
Simon Glass3d433382021-03-21 18:24:30 +13001017--no-expanded is used or the node has a 'no-expanded' property.
Simon Glass06684922021-03-18 20:25:07 +13001018
Simon Glass5a5da7c2018-07-17 13:25:37 -06001019
1020
1021Entry: u-boot-dtb: U-Boot device tree
1022-------------------------------------
1023
1024Properties / Entry arguments:
1025 - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
1026
1027This is the U-Boot device tree, containing configuration information for
1028U-Boot. U-Boot needs this to know what devices are present and which drivers
1029to activate.
1030
Simon Glass6ed45ba2018-09-14 04:57:24 -06001031Note: This is mostly an internal entry type, used by others. This allows
1032binman to know which entries contain a device tree.
1033
Simon Glass5a5da7c2018-07-17 13:25:37 -06001034
1035
1036Entry: u-boot-dtb-with-ucode: A U-Boot device tree file, with the microcode removed
1037-----------------------------------------------------------------------------------
1038
1039Properties / Entry arguments:
1040 - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
1041
1042See Entry_u_boot_ucode for full details of the three entries involved in
1043this process. This entry provides the U-Boot device-tree file, which
1044contains the microcode. If the microcode is not being collated into one
1045place then the offset and size of the microcode is recorded by this entry,
Simon Glassadc59ea2021-03-18 20:24:54 +13001046for use by u-boot-with-ucode_ptr. If it is being collated, then this
Simon Glass5a5da7c2018-07-17 13:25:37 -06001047entry deletes the microcode from the device tree (to save space) and makes
Simon Glassadc59ea2021-03-18 20:24:54 +13001048it available to u-boot-ucode.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001049
1050
1051
Simon Glassfe1ae3e2018-09-14 04:57:35 -06001052Entry: u-boot-elf: U-Boot ELF image
1053-----------------------------------
1054
1055Properties / Entry arguments:
1056 - filename: Filename of u-boot (default 'u-boot')
1057
1058This is the U-Boot ELF image. It does not include a device tree but can be
1059relocated to any address for execution.
1060
1061
1062
Simon Glassf3243302020-10-26 17:39:59 -06001063Entry: u-boot-env: An entry which contains a U-Boot environment
1064---------------------------------------------------------------
1065
1066Properties / Entry arguments:
1067 - filename: File containing the environment text, with each line in the
1068 form var=value
1069
1070
1071
Simon Glass06684922021-03-18 20:25:07 +13001072Entry: u-boot-expanded: U-Boot flat binary broken out into its component parts
1073------------------------------------------------------------------------------
1074
1075This is a section containing the U-Boot binary and a devicetree. Using this
1076entry type automatically creates this section, with the following entries
1077in it:
1078
1079 u-boot-nodtb
1080 u-boot-dtb
1081
1082Having the devicetree separate allows binman to update it in the final
1083image, so that the entries positions are provided to the running U-Boot.
1084
1085
1086
Simon Glass5a5da7c2018-07-17 13:25:37 -06001087Entry: u-boot-img: U-Boot legacy image
1088--------------------------------------
1089
1090Properties / Entry arguments:
1091 - filename: Filename of u-boot.img (default 'u-boot.img')
1092
1093This is the U-Boot binary as a packaged image, in legacy format. It has a
1094header which allows it to be loaded at the correct address for execution.
1095
1096You should use FIT (Flat Image Tree) instead of the legacy image for new
1097applications.
1098
1099
1100
1101Entry: u-boot-nodtb: U-Boot flat binary without device tree appended
1102--------------------------------------------------------------------
1103
1104Properties / Entry arguments:
Simon Glassadc59ea2021-03-18 20:24:54 +13001105 - filename: Filename to include (default 'u-boot-nodtb.bin')
Simon Glass5a5da7c2018-07-17 13:25:37 -06001106
1107This is the U-Boot binary, containing relocation information to allow it
1108to relocate itself at runtime. It does not include a device tree blob at
Simon Glassadc59ea2021-03-18 20:24:54 +13001109the end of it so normally cannot work without it. You can add a u-boot-dtb
Simon Glass06684922021-03-18 20:25:07 +13001110entry after this one, or use a u-boot entry instead, normally expands to a
1111section containing u-boot and u-boot-dtb
Simon Glass5a5da7c2018-07-17 13:25:37 -06001112
1113
1114
1115Entry: u-boot-spl: U-Boot SPL binary
1116------------------------------------
1117
1118Properties / Entry arguments:
1119 - filename: Filename of u-boot-spl.bin (default 'spl/u-boot-spl.bin')
1120
1121This is the U-Boot SPL (Secondary Program Loader) binary. This is a small
1122binary which loads before U-Boot proper, typically into on-chip SRAM. It is
1123responsible for locating, loading and jumping to U-Boot. Note that SPL is
1124not relocatable so must be loaded to the correct address in SRAM, or written
Simon Glassb8ef5b62018-07-17 13:25:48 -06001125to run from the correct address if direct flash execution is possible (e.g.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001126on x86 devices).
1127
1128SPL can access binman symbols at runtime. See:
1129
1130 'Access to binman entry offsets at run time (symbols)'
1131
1132in the binman README for more information.
1133
1134The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1135binman uses that to look up symbols to write into the SPL binary.
1136
Simon Glass06684922021-03-18 20:25:07 +13001137Note that this entry is automatically replaced with u-boot-spl-expanded
Simon Glass3d433382021-03-21 18:24:30 +13001138unless --no-expanded is used or the node has a 'no-expanded' property.
Simon Glass06684922021-03-18 20:25:07 +13001139
Simon Glass5a5da7c2018-07-17 13:25:37 -06001140
1141
1142Entry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region
1143---------------------------------------------------------------------
1144
1145Properties / Entry arguments:
1146 None
1147
Simon Glassdccdc382021-03-18 20:24:55 +13001148This holds the padding added after the SPL binary to cover the BSS (Block
1149Started by Symbol) region. This region holds the various variables used by
1150SPL. It is set to 0 by SPL when it starts up. If you want to append data to
1151the SPL image (such as a device tree file), you must pad out the BSS region
1152to avoid the data overlapping with U-Boot variables. This entry is useful in
1153that case. It automatically pads out the entry size to cover both the code,
1154data and BSS.
1155
1156The contents of this entry will a certain number of zero bytes, determined
1157by __bss_size
Simon Glass5a5da7c2018-07-17 13:25:37 -06001158
1159The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1160binman uses that to look up the BSS address.
1161
1162
1163
1164Entry: u-boot-spl-dtb: U-Boot SPL device tree
1165---------------------------------------------
1166
1167Properties / Entry arguments:
1168 - filename: Filename of u-boot.dtb (default 'spl/u-boot-spl.dtb')
1169
1170This is the SPL device tree, containing configuration information for
1171SPL. SPL needs this to know what devices are present and which drivers
1172to activate.
1173
1174
1175
Simon Glassfe1ae3e2018-09-14 04:57:35 -06001176Entry: u-boot-spl-elf: U-Boot SPL ELF image
1177-------------------------------------------
1178
1179Properties / Entry arguments:
Simon Glassa6a520e2019-07-08 13:18:45 -06001180 - filename: Filename of SPL u-boot (default 'spl/u-boot-spl')
Simon Glassfe1ae3e2018-09-14 04:57:35 -06001181
1182This is the U-Boot SPL ELF image. It does not include a device tree but can
1183be relocated to any address for execution.
1184
1185
1186
Simon Glass06684922021-03-18 20:25:07 +13001187Entry: u-boot-spl-expanded: U-Boot SPL flat binary broken out into its component parts
1188--------------------------------------------------------------------------------------
1189
1190Properties / Entry arguments:
1191 - spl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
1192 select)
1193
1194This is a section containing the U-Boot binary, BSS padding if needed and a
1195devicetree. Using this entry type automatically creates this section, with
1196the following entries in it:
1197
1198 u-boot-spl-nodtb
1199 u-boot-spl-bss-pad
1200 u-boot-dtb
1201
1202Having the devicetree separate allows binman to update it in the final
1203image, so that the entries positions are provided to the running U-Boot.
1204
1205This entry is selected based on the value of the 'spl-dtb' entryarg. If
1206this is non-empty (and not 'n' or '0') then this expanded entry is selected.
1207
1208
1209
Simon Glass5a5da7c2018-07-17 13:25:37 -06001210Entry: u-boot-spl-nodtb: SPL binary without device tree appended
1211----------------------------------------------------------------
1212
1213Properties / Entry arguments:
Simon Glassadc59ea2021-03-18 20:24:54 +13001214 - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin')
Simon Glass5a5da7c2018-07-17 13:25:37 -06001215
1216This is the U-Boot SPL binary, It does not include a device tree blob at
1217the end of it so may not be able to work without it, assuming SPL needs
Simon Glassadc59ea2021-03-18 20:24:54 +13001218a device tree to operate on your platform. You can add a u-boot-spl-dtb
Simon Glass06684922021-03-18 20:25:07 +13001219entry after this one, or use a u-boot-spl entry instead' which normally
1220expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
1221u-boot-spl-dtb
Simon Glass5a5da7c2018-07-17 13:25:37 -06001222
Simon Glassf5898822021-03-18 20:24:56 +13001223SPL can access binman symbols at runtime. See:
1224
1225 'Access to binman entry offsets at run time (symbols)'
1226
1227in the binman README for more information.
1228
1229The ELF file 'spl/u-boot-spl' must also be available for this to work, since
1230binman uses that to look up symbols to write into the SPL binary.
1231
Simon Glass5a5da7c2018-07-17 13:25:37 -06001232
1233
1234Entry: u-boot-spl-with-ucode-ptr: U-Boot SPL with embedded microcode pointer
1235----------------------------------------------------------------------------
1236
Simon Glassf0253632018-09-14 04:57:32 -06001237This is used when SPL must set up the microcode for U-Boot.
1238
Simon Glass5a5da7c2018-07-17 13:25:37 -06001239See Entry_u_boot_ucode for full details of the entries involved in this
1240process.
1241
1242
1243
Simon Glassb8ef5b62018-07-17 13:25:48 -06001244Entry: u-boot-tpl: U-Boot TPL binary
1245------------------------------------
1246
1247Properties / Entry arguments:
1248 - filename: Filename of u-boot-tpl.bin (default 'tpl/u-boot-tpl.bin')
1249
1250This is the U-Boot TPL (Tertiary Program Loader) binary. This is a small
1251binary which loads before SPL, typically into on-chip SRAM. It is
1252responsible for locating, loading and jumping to SPL, the next-stage
1253loader. Note that SPL is not relocatable so must be loaded to the correct
1254address in SRAM, or written to run from the correct address if direct
1255flash execution is possible (e.g. on x86 devices).
1256
1257SPL can access binman symbols at runtime. See:
1258
1259 'Access to binman entry offsets at run time (symbols)'
1260
1261in the binman README for more information.
1262
1263The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1264binman uses that to look up symbols to write into the TPL binary.
1265
Simon Glass06684922021-03-18 20:25:07 +13001266Note that this entry is automatically replaced with u-boot-tpl-expanded
Simon Glass3d433382021-03-21 18:24:30 +13001267unless --no-expanded is used or the node has a 'no-expanded' property.
Simon Glass06684922021-03-18 20:25:07 +13001268
Simon Glassb8ef5b62018-07-17 13:25:48 -06001269
1270
Simon Glassd26efc82021-03-18 20:24:58 +13001271Entry: u-boot-tpl-bss-pad: U-Boot TPL binary padded with a BSS region
1272---------------------------------------------------------------------
1273
1274Properties / Entry arguments:
1275 None
1276
1277This holds the padding added after the TPL binary to cover the BSS (Block
1278Started by Symbol) region. This region holds the various variables used by
1279TPL. It is set to 0 by TPL when it starts up. If you want to append data to
1280the TPL image (such as a device tree file), you must pad out the BSS region
1281to avoid the data overlapping with U-Boot variables. This entry is useful in
1282that case. It automatically pads out the entry size to cover both the code,
1283data and BSS.
1284
1285The contents of this entry will a certain number of zero bytes, determined
1286by __bss_size
1287
1288The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1289binman uses that to look up the BSS address.
1290
1291
1292
Simon Glassb8ef5b62018-07-17 13:25:48 -06001293Entry: u-boot-tpl-dtb: U-Boot TPL device tree
1294---------------------------------------------
1295
1296Properties / Entry arguments:
1297 - filename: Filename of u-boot.dtb (default 'tpl/u-boot-tpl.dtb')
1298
1299This is the TPL device tree, containing configuration information for
1300TPL. TPL needs this to know what devices are present and which drivers
1301to activate.
1302
1303
1304
Simon Glassf0253632018-09-14 04:57:32 -06001305Entry: u-boot-tpl-dtb-with-ucode: U-Boot TPL with embedded microcode pointer
1306----------------------------------------------------------------------------
1307
1308This is used when TPL must set up the microcode for U-Boot.
1309
1310See Entry_u_boot_ucode for full details of the entries involved in this
1311process.
1312
1313
1314
Simon Glass4c650252019-07-08 13:18:46 -06001315Entry: u-boot-tpl-elf: U-Boot TPL ELF image
1316-------------------------------------------
1317
1318Properties / Entry arguments:
1319 - filename: Filename of TPL u-boot (default 'tpl/u-boot-tpl')
1320
1321This is the U-Boot TPL ELF image. It does not include a device tree but can
1322be relocated to any address for execution.
1323
1324
1325
Simon Glass06684922021-03-18 20:25:07 +13001326Entry: u-boot-tpl-expanded: U-Boot TPL flat binary broken out into its component parts
1327--------------------------------------------------------------------------------------
1328
1329Properties / Entry arguments:
1330 - tpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
1331 select)
1332
1333This is a section containing the U-Boot binary, BSS padding if needed and a
1334devicetree. Using this entry type automatically creates this section, with
1335the following entries in it:
1336
1337 u-boot-tpl-nodtb
1338 u-boot-tpl-bss-pad
1339 u-boot-dtb
1340
1341Having the devicetree separate allows binman to update it in the final
1342image, so that the entries positions are provided to the running U-Boot.
1343
1344This entry is selected based on the value of the 'tpl-dtb' entryarg. If
1345this is non-empty (and not 'n' or '0') then this expanded entry is selected.
1346
1347
1348
Simon Glass77a64e02021-03-18 20:24:57 +13001349Entry: u-boot-tpl-nodtb: TPL binary without device tree appended
1350----------------------------------------------------------------
1351
1352Properties / Entry arguments:
1353 - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin')
1354
1355This is the U-Boot TPL binary, It does not include a device tree blob at
1356the end of it so may not be able to work without it, assuming TPL needs
1357a device tree to operate on your platform. You can add a u-boot-tpl-dtb
Simon Glass06684922021-03-18 20:25:07 +13001358entry after this one, or use a u-boot-tpl entry instead, which normally
1359expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and
1360u-boot-tpl-dtb
Simon Glass77a64e02021-03-18 20:24:57 +13001361
1362TPL can access binman symbols at runtime. See:
1363
1364 'Access to binman entry offsets at run time (symbols)'
1365
1366in the binman README for more information.
1367
1368The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since
1369binman uses that to look up symbols to write into the TPL binary.
1370
1371
1372
Simon Glassf0253632018-09-14 04:57:32 -06001373Entry: u-boot-tpl-with-ucode-ptr: U-Boot TPL with embedded microcode pointer
1374----------------------------------------------------------------------------
1375
1376See Entry_u_boot_ucode for full details of the entries involved in this
1377process.
1378
1379
1380
Simon Glass5a5da7c2018-07-17 13:25:37 -06001381Entry: u-boot-ucode: U-Boot microcode block
1382-------------------------------------------
1383
1384Properties / Entry arguments:
1385 None
1386
1387The contents of this entry are filled in automatically by other entries
1388which must also be in the image.
1389
1390U-Boot on x86 needs a single block of microcode. This is collected from
1391the various microcode update nodes in the device tree. It is also unable
1392to read the microcode from the device tree on platforms that use FSP
1393(Firmware Support Package) binaries, because the API requires that the
1394microcode is supplied before there is any SRAM available to use (i.e.
1395the FSP sets up the SRAM / cache-as-RAM but does so in the call that
1396requires the microcode!). To keep things simple, all x86 platforms handle
1397microcode the same way in U-Boot (even non-FSP platforms). This is that
1398a table is placed at _dt_ucode_base_size containing the base address and
1399size of the microcode. This is either passed to the FSP (for FSP
1400platforms), or used to set up the microcode (for non-FSP platforms).
1401This all happens in the build system since it is the only way to get
1402the microcode into a single blob and accessible without SRAM.
1403
1404There are two cases to handle. If there is only one microcode blob in
1405the device tree, then the ucode pointer it set to point to that. This
1406entry (u-boot-ucode) is empty. If there is more than one update, then
1407this entry holds the concatenation of all updates, and the device tree
1408entry (u-boot-dtb-with-ucode) is updated to remove the microcode. This
1409last step ensures that that the microcode appears in one contiguous
1410block in the image and is not unnecessarily duplicated in the device
1411tree. It is referred to as 'collation' here.
1412
1413Entry types that have a part to play in handling microcode:
1414
1415 Entry_u_boot_with_ucode_ptr:
1416 Contains u-boot-nodtb.bin (i.e. U-Boot without the device tree).
1417 It updates it with the address and size of the microcode so that
1418 U-Boot can find it early on start-up.
1419 Entry_u_boot_dtb_with_ucode:
1420 Contains u-boot.dtb. It stores the microcode in a
1421 'self.ucode_data' property, which is then read by this class to
1422 obtain the microcode if needed. If collation is performed, it
1423 removes the microcode from the device tree.
1424 Entry_u_boot_ucode:
1425 This class. If collation is enabled it reads the microcode from
1426 the Entry_u_boot_dtb_with_ucode entry, and uses it as the
1427 contents of this entry.
1428
1429
1430
1431Entry: u-boot-with-ucode-ptr: U-Boot with embedded microcode pointer
1432--------------------------------------------------------------------
1433
1434Properties / Entry arguments:
Masahiro Yamadaf6a8c0f2019-12-14 13:47:26 +09001435 - filename: Filename of u-boot-nodtb.bin (default 'u-boot-nodtb.bin')
Simon Glassf0693032018-09-14 04:57:07 -06001436 - optional-ucode: boolean property to make microcode optional. If the
1437 u-boot.bin image does not include microcode, no error will
1438 be generated.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001439
1440See Entry_u_boot_ucode for full details of the three entries involved in
1441this process. This entry updates U-Boot with the offset and size of the
1442microcode, to allow early x86 boot code to find it without doing anything
Simon Glassadc59ea2021-03-18 20:24:54 +13001443complicated. Otherwise it is the same as the u-boot entry.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001444
1445
1446
Simon Glass24d0d3c2018-07-17 13:25:47 -06001447Entry: vblock: An entry which contains a Chromium OS verified boot block
1448------------------------------------------------------------------------
1449
1450Properties / Entry arguments:
Simon Glass5385f5a2019-05-17 22:00:53 -06001451 - content: List of phandles to entries to sign
Simon Glass24d0d3c2018-07-17 13:25:47 -06001452 - keydir: Directory containing the public keys to use
1453 - keyblock: Name of the key file to use (inside keydir)
1454 - signprivate: Name of provide key file to use (inside keydir)
1455 - version: Version number of the vblock (typically 1)
1456 - kernelkey: Name of the kernel key to use (inside keydir)
1457 - preamble-flags: Value of the vboot preamble flags (typically 0)
1458
Simon Glassa326b492018-09-14 04:57:11 -06001459Output files:
1460 - input.<unique_name> - input file passed to futility
1461 - vblock.<unique_name> - output file generated by futility (which is
1462 used as the entry contents)
1463
Jagdish Gediya9d368f32018-09-03 21:35:08 +05301464Chromium OS signs the read-write firmware and kernel, writing the signature
Simon Glass24d0d3c2018-07-17 13:25:47 -06001465in this block. This allows U-Boot to verify that the next firmware stage
1466and kernel are genuine.
1467
1468
1469
Simon Glass2250ee62019-08-24 07:22:48 -06001470Entry: x86-reset16: x86 16-bit reset code for U-Boot
1471----------------------------------------------------
1472
1473Properties / Entry arguments:
1474 - filename: Filename of u-boot-x86-reset16.bin (default
1475 'u-boot-x86-reset16.bin')
1476
1477x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
1478must be placed at a particular address. This entry holds that code. It is
1479typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
1480for jumping to the x86-start16 code, which continues execution.
1481
1482For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead.
1483
1484
1485
1486Entry: x86-reset16-spl: x86 16-bit reset code for U-Boot
1487--------------------------------------------------------
1488
1489Properties / Entry arguments:
1490 - filename: Filename of u-boot-x86-reset16.bin (default
1491 'u-boot-x86-reset16.bin')
1492
1493x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
1494must be placed at a particular address. This entry holds that code. It is
1495typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
1496for jumping to the x86-start16 code, which continues execution.
1497
1498For 32-bit U-Boot, the 'x86_reset_spl' entry type is used instead.
1499
1500
1501
1502Entry: x86-reset16-tpl: x86 16-bit reset code for U-Boot
1503--------------------------------------------------------
1504
1505Properties / Entry arguments:
1506 - filename: Filename of u-boot-x86-reset16.bin (default
1507 'u-boot-x86-reset16.bin')
1508
1509x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
1510must be placed at a particular address. This entry holds that code. It is
1511typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
1512for jumping to the x86-start16 code, which continues execution.
1513
1514For 32-bit U-Boot, the 'x86_reset_tpl' entry type is used instead.
1515
1516
1517
Simon Glass5a5da7c2018-07-17 13:25:37 -06001518Entry: x86-start16: x86 16-bit start-up code for U-Boot
1519-------------------------------------------------------
1520
1521Properties / Entry arguments:
Simon Glass5e239182019-08-24 07:22:49 -06001522 - filename: Filename of u-boot-x86-start16.bin (default
1523 'u-boot-x86-start16.bin')
Simon Glass5a5da7c2018-07-17 13:25:37 -06001524
1525x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
Simon Glass5e239182019-08-24 07:22:49 -06001526must be placed in the top 64KB of the ROM. The reset code jumps to it. This
1527entry holds that code. It is typically placed at offset
1528CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
1529and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
1530U-Boot).
Simon Glass5a5da7c2018-07-17 13:25:37 -06001531
1532For 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead.
1533
1534
1535
1536Entry: x86-start16-spl: x86 16-bit start-up code for SPL
1537--------------------------------------------------------
1538
1539Properties / Entry arguments:
Simon Glass5e239182019-08-24 07:22:49 -06001540 - filename: Filename of spl/u-boot-x86-start16-spl.bin (default
1541 'spl/u-boot-x86-start16-spl.bin')
Simon Glass5a5da7c2018-07-17 13:25:37 -06001542
Simon Glass5e239182019-08-24 07:22:49 -06001543x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
1544must be placed in the top 64KB of the ROM. The reset code jumps to it. This
1545entry holds that code. It is typically placed at offset
1546CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
1547and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
1548U-Boot).
Simon Glass5a5da7c2018-07-17 13:25:37 -06001549
Simon Glass5e239182019-08-24 07:22:49 -06001550For 32-bit U-Boot, the 'x86-start16' entry type is used instead.
Simon Glass5a5da7c2018-07-17 13:25:37 -06001551
1552
1553
Simon Glass35b384c2018-09-14 04:57:10 -06001554Entry: x86-start16-tpl: x86 16-bit start-up code for TPL
1555--------------------------------------------------------
1556
1557Properties / Entry arguments:
Simon Glass5e239182019-08-24 07:22:49 -06001558 - filename: Filename of tpl/u-boot-x86-start16-tpl.bin (default
1559 'tpl/u-boot-x86-start16-tpl.bin')
Simon Glass35b384c2018-09-14 04:57:10 -06001560
Simon Glass5e239182019-08-24 07:22:49 -06001561x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
1562must be placed in the top 64KB of the ROM. The reset code jumps to it. This
1563entry holds that code. It is typically placed at offset
1564CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode
1565and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit
1566U-Boot).
Simon Glass35b384c2018-09-14 04:57:10 -06001567
Simon Glass5e239182019-08-24 07:22:49 -06001568If TPL is not being used, the 'x86-start16-spl or 'x86-start16' entry types
Simon Glass35b384c2018-09-14 04:57:10 -06001569may be used instead.
1570
1571
1572