1 .\" SPDX-License-Identifier: GPL-2.0
2 .\" Copyright (C) 2022 Sean Anderson <seanga2@gmail.com>
3 .\" Copyright (C) 2013-20 Simon Glass <sjg@chromium.org>
4 .\" Copyright (C) 2010 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 .\" Copyright (C) 2010 Wolfgang Denk <wd@denx.de>
6 .TH MKIMAGE 1 2022-06-11 U-Boot
9 mkimage \- generate images for U-Boot
13 .BI \-l\~ image-file-name
17 .RI [ option\~ .\|.\|.\&]
23 .RI [ option\~ .\|.\|.\&]
24 .BI \-f\~ image-tree-source-file\c
30 .RI [ option\~ .\|.\|.\&]
31 .BI \-F\~ image-file-name
37 command is used to create images for use with the U-Boot boot loader. These
38 images can contain the Linux kernel, device tree blob, root file system image,
39 firmware images etc., either separate or combined.
42 supports many image formats. Some of these formats may be used by embedded boot
43 firmware to load U-Boot. Others may be used by U-Boot to load Linux (or some
46 The legacy image format concatenates the individual parts (for example, kernel
47 image, device tree blob and ramdisk image) and adds a 64 byte header containing
48 information about the target architecture, operating system, image type,
49 compression method, entry points, time stamp, checksums, etc.
53 (Flattened Image Tree) format allows for more flexibility in handling images of
54 various types and also enhances integrity protection of images with stronger
55 checksums. It also supports verified boot.
65 Print a help message and exit.
72 lists the information contained in the header of an existing U-Boot image.
78 Don't copy in the image data. Depending on the image type, this may create
79 just the header, everything but the image data, or nothing at all.
84 .BI \-\-type " image-type"
91 to see the list of supported image types. If this option is absent, then it
94 (legacy image). If this option is absent when
98 will attempt to automatically detect the image type. Not all image types support
99 automatic detection, so it may be necessary to pass
103 When creating a FIT image with
105 the image type is always set to
109 specifies the image node's \(oqtype\(cq property. If
111 is absent, then the \(oqtype\(cq property will default to
118 Quiet. Don't print the image header.
124 Verbose. Print file names as they are added to the image.
130 Print version information and exit.
132 .SS General image-creation options
135 .BI \-A " architecture"
137 .BI \-\-architecture " architecture"
138 Set the architecture. Pass
140 as the architecture to see the list of supported architectures. If
142 is absent, it defaults to
149 Set the operating system. The U-Boot
151 command changes boot method based on the OS type.
156 to see the list of supported OSs. If
158 is absent, it defaults to
162 .BI \-C " compression-type"
164 .BI \-\-compression " compression-type"
165 Set the compression type. The image data should have already been compressed
166 using this compression type.
168 will not automatically compress image data.
173 to see the list of supported compression types. If
175 is absent, it defaults to
179 .BI \-a " load-address"
181 .BI \-\-load\-address " load-address"
182 Set the absolute address to load the image data to.
184 will be interpreted as a hexadecimal number.
187 .BI \-e " entry-point"
189 .BI \-\-entry\-point " entry-point"
190 Set the absolute address of the image entry point. The U-Boot
192 command will jump to this address after loading the image.
194 will be interpreted as a hexadecimal number.
197 .BI \-n " primary-configuration"
199 .BI \-\-config " primary-configuration"
200 Images may require additional configuration not specified with other options,
201 often in a image-type-specific format. The image types which support this
202 option and the format of their configuration are listed in
206 .BI \-R " secondary-configuration"
208 .BI \-\-secondary\-config " secondary-configuration"
209 Some image types support a second set of configuration data. The image types
210 which support secondary configuration and the formap of their configuration are
215 .BI \-d " image-data-file"
217 .BI \-\-image " image-data-file"
219 .IR image-data-file .
224 then multiple images may be specified, separated by colons:
227 .IR image-data-file [\fB:\fP image-data-file .\|.\|.]
236 (execute in place) flag. The U-Boot
238 command will not load the image data, and instead will assume it is already
239 accessible at the load address (such as via memory-mapped flash).
241 .SS Options for creating FIT images
244 .BI \-b " device-tree-file"
246 .BI \-\-device\-tree " device-tree-file"
247 Appends the device tree binary file (.dtb) to the FIT.
252 .BI \-\-comment " comment"
253 Specifies a comment to be added when signing. This is typically a message which
254 describes how the image was signed or some other useful information.
257 .BI \-D " dtc-options"
259 .BI \-\-dtcopts " dtc-options"
260 Provide additional options to the device tree compiler when creating the image.
263 for documentation of possible options. If
265 is absent, it defaults to
266 .BR "\-I dts \-O dtb \-p 500" .
272 After processing, move the image data outside the FIT and store a data offset
273 in the FIT. Images will be placed one after the other immediately after the FIT,
274 with each one aligned to a 4-byte boundary. The existing \(oqdata\(cq property
275 in each image will be replaced with \(oqdata-offset\(cq and \(oqdata-size\(cq
276 properties. A \(oqdata-offset\(cq of 0 indicates that it starts in the first
277 (4-byte-aligned) byte after the FIT.
282 .BI \-\-alignment " alignment"
283 The alignment, in hexadecimal, that external data will be aligned to. This
284 option only has an effect when \-E is specified.
287 .BI \-p " external-position"
289 .BI \-\-position " external-position"
290 Place external data at a static external position. Instead of writing a
291 \(oqdata-offset\(cq property defining the offset from the end of the FIT,
293 will use \(oqdata-position\(cq as the absolute position from the base of the
296 for details on using external data.
299 \fB\-f \fIimage-tree-source-file\fR | \fBauto
301 \fB\-\-fit \fIimage-tree-source-file\fR | \fBauto
302 Image tree source file that describes the structure and contents of the
305 In some simple cases, the image tree source can be generated automatically. To
306 use this feature, pass
317 options may be used to specify the image to include in the FIT and its
319 .I image-tree-source-file
326 Indicates that an existing FIT image should be modified. No dtc compilation will
329 should not be passed. This can be used to sign images with additional keys
330 after initial image creation.
333 .BI \-i " ramdisk-file"
335 .BI \-\-initramfs " ramdisk-file"
336 Append a ramdisk or initramfs file to the image.
339 .BI \-k " key-directory"
341 .BI \-\-key\-dir " key-directory"
342 Specifies the directory containing keys to use for signing. This directory
343 should contain a private key file
345 for use with signing, and a certificate
347 (containing the public key) for use with verification. The public key is only
348 necessary when embedding it into another device tree using
351 defaults to the value of the signature node's \(oqkey-name-hint\(cq property,
352 but may be overridden using
358 .BI \-\-key\-file " key-file"
359 Specifies the private key file to use when signing. This option may be used
363 .BI \-K " key-destination"
365 .BI \-\-key\-dest " key-destination"
366 Specifies a compiled device tree binary file (typically .dtb) to write
367 public key information into. When a private key is used to sign an image,
368 the corresponding public key is written into this file for for run-time
369 verification. Typically the file here is the device tree binary used by
370 CONFIG_OF_CONTROL in U-Boot.
373 .BI \-g " key-name-hint"
375 .BI \-\-key\-name\-hint " key-name-hint"
376 Overrides the signature node's \(oqkey-name-hint\(cq property. This is
377 especially useful when signing an image with
381 part of the key. The directory part is set by
383 This option also indicates that the images included in the FIT should be signed.
384 If this option is specified, then
386 must be specified as well.
389 .BI \-o " crypto" , checksum
391 .BI \-\-algo " crypto" , checksum
392 Specifies the algorithm to be used for signing a FIT image. The default is
393 taken from the signature node's \(oqalgo\(cq property.
426 Specifies that keys used to sign the FIT are required. This means that they
427 must be verified for the image to boot. Without this option, the verification
428 will be optional (useful for testing but not for release).
433 .BI \-\-engine " engine"
434 The openssl engine to use when signing and verifying the image. For a complete
435 list of available engines, refer to
442 Update the timestamp in the FIT.
444 Normally the FIT timestamp is created the first time mkimage runs,
445 when converting the source .its to the binary .fit file. This corresponds to
448 But if the original input to mkimage is a binary file (already compiled), then
449 the timestamp is assumed to have been set previously.
452 This section documents the formats of the primary and secondary configuration
453 options for each image type which supports them.
456 The primary configuration is a file containing a series of
458 (Application Image Script) commands, one per line. Each command has the form
461 .IR "command argument " .\|.\|.
465 .UR https://\:www\:.ti\:.com/\:lit/\:pdf/\:spraag0
466 TI application report SPRAAG0E
471 The primary configuration is a comma-separated list of NAND Flash parameters of
475 \fIparameter\fB=\fIvalue\fR[\fB,\fIparameter\fB=\fIvalue\fR.\|.\|.\&]
496 are decimal numbers. See section 11.4.4.1 of the SAMA5D3 Series Data Sheet for
497 valid values for each parameter.
500 The primary configuration is a file containing configuration commands, as
501 documented in doc/\:imx/\:mkimage/\:imximage.txt of the U-Boot source.
503 .SS imx8image and imx8mimage
504 The primary configuration is a file containing configuration commands, as
505 documented in doc/\:imx/\:mkimage/\:imx8image.txt of the U-Boot source.
508 The primary configuration is a file containing configuration commands, as
509 documented in doc/\:imx/\:mkimage/\:kwbimage.txt of the U-Boot source.
512 The primary configuration is a semicolon-separated list of header options of the
516 \fIkey\fB=\fIvalue\fR[\fB;\fIkey\fB=\fIvalue\fR.\|.\|.\&]
519 where the valid keys are:
528 If \fB1\fP, then an \fILK\fP (legacy) image header is used. Otherwise, a
529 \fIBootROM\fP image header is used.
532 The name of the LK image header. The maximum length is 32 ASCII characters. If
533 not specified, the default value is \fBU-Boot\fP.
535 media The boot device. See below for valid values.
536 nandinfo The desired NAND device type. See below for valid values.
537 arm64 If \fB1\fP, then this denotes an AArch64 image.
538 hdroffset Increase the reported size of the BRLYT header by this amount.
552 nand Parallel NAND flash
553 snand Serial NAND flash
555 emmc \fIeMMC\fP (Embedded Multi-Media Card)
556 sdmmc \fISD\fP (Secure Digital) card
568 Value NAND type Page size OOB size Total size
570 2k+64 Serial 2KiB 64B
571 2k+120 Serial 2KiB 120B
572 2k+128 Serial 2KiB 128B
573 4k+256 Serial 4KiB 256B
574 1g:2k+64 Parallel 2KiB 64B 1Gbit
575 2g:2k+64 Parallel 2KiB 64B 2Gbit
576 4g:2k+64 Parallel 2KiB 64B 4Gbit
577 2g:2k+128 Parallel 2KiB 128B 2Gbit
578 4g:2k+128 Parallel 2KiB 128B 4Gbit
583 The primary configuration is a file containing configuration commands, as
584 documented in doc/\:imx/\:mkimage/\:mxsimage.txt of the U-Boot source.
587 The primary configuration is the optional value
589 If present, each 32-bit word of the image will have its bytes swapped
590 (converting from little-endian to big-endian, or vice versa).
593 The primary configuration is a file containing the
595 (Pre-Boot Image) header. Each line of the configuration has the format
598 .IR value "[ " value .\|.\|.\&]
603 is a 32-bit hexadecimal integer. Each
605 will, after being converted to raw bytes, be literally prepended to the PBI.
607 The secondary configuration is a file with the same format as the primary
608 configuration file. It will be inserted into the image after the primary
609 configuration data and before the image data.
611 It is traditional to use the primary configuration file for the
613 (Reset Configuration Word), and the secondary configuration file for any
614 additional PBI commands. However, it is also possible to convert an existing PBI
615 to the above format and \(lqchain\(rq additional data onto the end of the
616 image. This may be especially useful for creating secure boot images.
619 The primary configuration is the name of the processor to generate the image
620 for. Valid values are:
642 The primary configuration is the name to use for the device tree.
645 The primary configuration is a file containing configuration commands, as
646 documented in doc/\:README.ublimage of the U-Boot source.
648 .SS zynqimage and zynqmpimage
651 the primary configuration is a file containing the
653 (Power Management Unit Firmware).
655 does not use the primary configuration.
657 For both image types, the secondary configuration is a file containinig
658 initialization parameters, one per line. Each parameter has the form
668 are hexadecimal integers. The boot ROM will write each
672 when loading the image. At most 256 parameters may be specified in this
676 Please report bugs to the
677 .UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues
681 .\" Reduce the width of the tab stops to something reasonable
683 List image information:
687 \fBmkimage \-l uImage
691 Create legacy image with compressed PowerPC Linux kernel:
695 \fBmkimage \-A powerpc \-O linux \-T kernel \-C gzip \\
696 \-a 0 \-e 0 \-n Linux \-d vmlinux.gz uImage
700 Create FIT image with compressed PowerPC Linux kernel:
704 \fBmkimage \-f kernel.its kernel.itb
708 Create FIT image with compressed kernel and sign it with keys in the
709 /public/signing\-keys directory. Add corresponding public keys into u\-boot.dtb,
710 skipping those for which keys cannot be found. Also add a comment.
714 \fBmkimage \-f kernel.its \-k /public/signing\-keys \-K u\-boot.dtb \\
715 \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb
719 Add public keys to u\-boot.dtb without needing a FIT to sign. This will also
720 create a FIT containing an images node with no data named unused.itb.
724 \fBmkimage \-f auto \-d /dev/null \-k /public/signing\-keys \-g dev \\
725 \-o sha256,rsa2048 \-K u\-boot.dtb unused.itb
729 Update an existing FIT image, signing it with additional keys.
730 Add corresponding public keys into u\-boot.dtb. This will resign all images
731 with keys that are available in the new directory. Images that request signing
732 with unavailable keys are skipped.
736 \fBmkimage \-F \-k /secret/signing\-keys \-K u\-boot.dtb \\
737 \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb
741 Create a FIT image containing a kernel, using automatic mode. No .its file
746 \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\
747 \-c \(dqKernel 4.4 image for production devices\(dq \-d vmlinuz kernel.itb
751 Create a FIT image containing a kernel and some device tree files, using
752 automatic mode. No .its file is required.
756 \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\
757 \-c \(dqKernel 4.4 image for production devices\(dq \-d vmlinuz \\
758 \-b /path/to/rk3288\-firefly.dtb \-b /path/to/rk3288\-jerry.dtb kernel.itb
762 Create a FIT image containing a signed kernel, using automatic mode. No .its
767 \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\
768 \-d vmlinuz \-k /secret/signing\-keys \-g dev \-o sha256,rsa2048 kernel.itb
777 .UR https://\:u-boot\:.readthedocs\:.io/\:en/\:latest/\:index.html