blob: 353ea8b2f761e747daa92a998b12b8fdbf5099e7 [file] [log] [blame]
Sean Anderson785a0512022-06-25 13:12:18 -04001.\" 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
Sean Anderson7ec625f2022-06-25 13:12:09 -04007.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +09008.SH NAME
Sean Andersone9927c22022-06-25 13:12:14 -04009mkimage \- generate images for U-Boot
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090010.SH SYNOPSIS
Sean Andersona5685542022-06-25 13:12:08 -040011.SY mkimage
12.OP \-T type
13.BI \-l\~ image-file-name
14.YS
Sean Anderson7ec625f2022-06-25 13:12:09 -040015.
Sean Andersona5685542022-06-25 13:12:08 -040016.SY mkimage
17.RI [ option\~ .\|.\|.\&]
18.OP \-T type
19.I image-file-name
20.YS
Sean Anderson7ec625f2022-06-25 13:12:09 -040021.
Sean Andersona5685542022-06-25 13:12:08 -040022.SY mkimage
23.RI [ option\~ .\|.\|.\&]
24.BI \-f\~ image-tree-source-file\c
25.RB | auto
26.I image-file-name
27.YS
Sean Anderson7ec625f2022-06-25 13:12:09 -040028.
Sean Andersona5685542022-06-25 13:12:08 -040029.SY mkimage
30.RI [ option\~ .\|.\|.\&]
31.BI \-F\~ image-file-name
32.YS
Sean Anderson7ec625f2022-06-25 13:12:09 -040033.
Sean Anderson1bdf48622022-06-25 13:12:11 -040034.SH DESCRIPTION
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090035The
36.B mkimage
Sean Anderson9cc40002022-06-25 13:12:15 -040037command is used to create images for use with the U-Boot boot loader. These
38images can contain the Linux kernel, device tree blob, root file system image,
39firmware images etc., either separate or combined.
Sean Anderson7ec625f2022-06-25 13:12:09 -040040.P
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090041.B mkimage
Sean Anderson9cc40002022-06-25 13:12:15 -040042supports many image formats. Some of these formats may be used by embedded boot
43firmware to load U-Boot. Others may be used by U-Boot to load Linux (or some
44other kernel):
Sean Anderson7ec625f2022-06-25 13:12:09 -040045.P
Sean Anderson9cc40002022-06-25 13:12:15 -040046The legacy image format concatenates the individual parts (for example, kernel
47image, device tree blob and ramdisk image) and adds a 64 byte header containing
48information about the target architecture, operating system, image type,
49compression method, entry points, time stamp, checksums, etc.
Sean Anderson7ec625f2022-06-25 13:12:09 -040050.P
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +000051The new
Sean Anderson9cc40002022-06-25 13:12:15 -040052.I FIT
53(Flattened Image Tree) format allows for more flexibility in handling images of
54various types and also enhances integrity protection of images with stronger
55checksums. It also supports verified boot.
Sean Anderson7ec625f2022-06-25 13:12:09 -040056.
Sean Anderson1bdf48622022-06-25 13:12:11 -040057.SH OPTIONS
Sean Anderson7ec625f2022-06-25 13:12:09 -040058.
Sean Andersona4d0c742022-06-25 13:12:12 -040059.SS General options
Sean Anderson7ec625f2022-06-25 13:12:09 -040060.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090061.TP
Sean Andersona5e2b672022-06-25 13:12:13 -040062.B \-h
Sean Andersondc3a9232022-06-25 13:12:19 -040063.TQ
64.B \-\-help
Sean Andersona5e2b672022-06-25 13:12:13 -040065Print a help message and exit.
66.
67.TP
68.B \-l
Sean Andersondc3a9232022-06-25 13:12:19 -040069.TQ
70.B \-\-list
Sean Anderson9cc40002022-06-25 13:12:15 -040071.B mkimage
72lists the information contained in the header of an existing U-Boot image.
Sean Andersona5e2b672022-06-25 13:12:13 -040073.
74.TP
75.B \-s
Sean Andersondc3a9232022-06-25 13:12:19 -040076.TQ
77.B \-\-no\-copy
Sean Andersona5e2b672022-06-25 13:12:13 -040078Don't copy in the image data. Depending on the image type, this may create
79just the header, everything but the image data, or nothing at all.
Sean Anderson7ec625f2022-06-25 13:12:09 -040080.
Pali Rohár11f29d42022-02-13 01:09:46 +010081.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -040082.BI \-T " image-type"
Sean Andersondc3a9232022-06-25 13:12:19 -040083.TQ
84.BI \-\-type " image-type"
Sean Anderson9cc40002022-06-25 13:12:15 -040085Parse image file as
86.IR image-type .
87Pass
88.B list
89as
90.I image-type
91to see the list of supported image types. If this option is absent, then it
92defaults to
93.B kernel
94(legacy image). If this option is absent when
95.B \-l
96is passed, then
97.B mkimage
98will attempt to automatically detect the image type. Not all image types support
99automatic detection, so it may be necessary to pass
100.B \-T
101explicitly.
102.IP
103When creating a FIT image with
104.BR \-f ,
105the image type is always set to
106.BR flat_dt .
107In this case,
108.B \-T
109specifies the image node's \(oqtype\(cq property. If
110.B \-T
111is absent, then the \(oqtype\(cq property will default to
112.BR kernel .
Sean Anderson7ec625f2022-06-25 13:12:09 -0400113.
Sean Andersondeb26382022-04-08 16:08:39 -0400114.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400115.B \-q
Sean Andersondc3a9232022-06-25 13:12:19 -0400116.TQ
117.B \-\-quiet
Sean Andersona5e2b672022-06-25 13:12:13 -0400118Quiet. Don't print the image header.
119.
120.TP
121.B \-v
Sean Andersondc3a9232022-06-25 13:12:19 -0400122.TQ
123.B \-\-verbose
Sean Andersona5e2b672022-06-25 13:12:13 -0400124Verbose. Print file names as they are added to the image.
125.
126.TP
127.B \-V
Sean Andersondc3a9232022-06-25 13:12:19 -0400128.TQ
129.B \-\-version
Sean Andersona5e2b672022-06-25 13:12:13 -0400130Print version information and exit.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400131.
Sean Andersona4d0c742022-06-25 13:12:12 -0400132.SS General image-creation options
Sean Anderson7ec625f2022-06-25 13:12:09 -0400133.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900134.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400135.BI \-A " architecture"
Sean Andersondc3a9232022-06-25 13:12:19 -0400136.TQ
137.BI \-\-architecture " architecture"
Sean Anderson9cc40002022-06-25 13:12:15 -0400138Set the architecture. Pass
139.B \-h
140as the architecture to see the list of supported architectures. If
141.B \-A
142is absent, it defaults to
143.BR ppc .
Sean Anderson7ec625f2022-06-25 13:12:09 -0400144.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900145.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400146.BI \-O " os"
Sean Andersondc3a9232022-06-25 13:12:19 -0400147.TQ
148.BI \-\-os " os"
Sean Anderson9cc40002022-06-25 13:12:15 -0400149Set the operating system. The U-Boot
150.I bootm
151command changes boot method based on the OS type.
152Pass
153.B \-h
154as the
155.I os
156to see the list of supported OSs. If
157.B \-O
158is absent, it defaults to
159.BR linux .
Sean Anderson7ec625f2022-06-25 13:12:09 -0400160.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900161.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400162.BI \-C " compression-type"
Sean Andersondc3a9232022-06-25 13:12:19 -0400163.TQ
164.BI \-\-compression " compression-type"
Sean Anderson9cc40002022-06-25 13:12:15 -0400165Set the compression type. The image data should have already been compressed
166using this compression type.
167.B mkimage
168will not automatically compress image data.
169Pass
170.B \-h
171as the
172.I compression-type
173to see the list of supported compression types. If
174.B \-C
175is absent, it defaults to
176.BR gzip .
Sean Anderson7ec625f2022-06-25 13:12:09 -0400177.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900178.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400179.BI \-a " load-address"
Sean Andersondc3a9232022-06-25 13:12:19 -0400180.TQ
181.BI \-\-load\-address " load-address"
Sean Anderson9cc40002022-06-25 13:12:15 -0400182Set the absolute address to load the image data to.
183.I load-address
184will be interpreted as a hexadecimal number.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400185.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900186.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400187.BI \-e " entry-point"
Sean Andersondc3a9232022-06-25 13:12:19 -0400188.TQ
189.BI \-\-entry\-point " entry-point"
Sean Anderson9cc40002022-06-25 13:12:15 -0400190Set the absolute address of the image entry point. The U-Boot
191.I bootm
192command will jump to this address after loading the image.
193.I entry-point
194will be interpreted as a hexadecimal number.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400195.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900196.TP
Sean Andersonb42168c2022-06-25 13:12:20 -0400197.BI \-n " primary-configuration"
Sean Andersondc3a9232022-06-25 13:12:19 -0400198.TQ
Sean Andersonb42168c2022-06-25 13:12:20 -0400199.BI \-\-config " primary-configuration"
200Images may require additional configuration not specified with other options,
201often in a image-type-specific format. The image types which support this
202option and the format of their configuration are listed in
203.BR CONFIGURATION .
Sean Anderson7ec625f2022-06-25 13:12:09 -0400204.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900205.TP
Sean Andersonb42168c2022-06-25 13:12:20 -0400206.BI \-R " secondary-configuration"
Sean Andersondc3a9232022-06-25 13:12:19 -0400207.TQ
Sean Andersonb42168c2022-06-25 13:12:20 -0400208.BI \-\-secondary\-config " secondary-configuration"
209Some image types support a second set of configuration data. The image types
210which support secondary configuration and the formap of their configuration are
211listed in
212.BR CONFIGURATION .
Sean Anderson7ec625f2022-06-25 13:12:09 -0400213.
Sean Andersondeb26382022-04-08 16:08:39 -0400214.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400215.BI \-d " image-data-file"
Sean Andersondc3a9232022-06-25 13:12:19 -0400216.TQ
217.BI \-\-image " image-data-file"
Sean Anderson9cc40002022-06-25 13:12:15 -0400218Use image data from
219.IR image-data-file .
220If the
221.I image-type
222is
223.BR multi ,
224then multiple images may be specified, separated by colons:
225.RS
226.IP
227.IR image-data-file [\fB:\fP image-data-file .\|.\|.]
228.RE
Sean Anderson7ec625f2022-06-25 13:12:09 -0400229.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900230.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400231.B \-x
Sean Andersondc3a9232022-06-25 13:12:19 -0400232.TQ
233.B \-\-xip
Sean Anderson9cc40002022-06-25 13:12:15 -0400234Set the
235.I XIP
236(execute in place) flag. The U-Boot
237.I bootm
238command will not load the image data, and instead will assume it is already
239accessible at the load address (such as via memory-mapped flash).
Sean Anderson7ec625f2022-06-25 13:12:09 -0400240.
Sean Andersona4d0c742022-06-25 13:12:12 -0400241.SS Options for creating FIT images
Sean Anderson7ec625f2022-06-25 13:12:09 -0400242.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900243.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400244.BI \-b " device-tree-file"
Sean Andersondc3a9232022-06-25 13:12:19 -0400245.TQ
246.BI \-\-device\-tree " device-tree-file"
Andreas Bießmann7a439ca2016-05-01 03:01:27 +0200247Appends the device tree binary file (.dtb) to the FIT.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400248.
Simon Glassfb4cce02016-02-22 22:55:52 -0700249.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400250.BI \-c " comment"
Sean Andersondc3a9232022-06-25 13:12:19 -0400251.TQ
252.BI \-\-comment " comment"
Sean Anderson9cc40002022-06-25 13:12:15 -0400253Specifies a comment to be added when signing. This is typically a message which
254describes how the image was signed or some other useful information.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400255.
Simon Glass4f610422013-06-13 15:10:06 -0700256.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400257.BI \-D " dtc-options"
Sean Andersondc3a9232022-06-25 13:12:19 -0400258.TQ
259.BI \-\-dtcopts " dtc-options"
Sean Anderson9cc40002022-06-25 13:12:15 -0400260Provide additional options to the device tree compiler when creating the image.
261See
262.BR dtc (1)
263for documentation of possible options. If
264.B \-D
265is absent, it defaults to
266.BR "\-I dts \-O dtb \-p 500" .
Sean Anderson7ec625f2022-06-25 13:12:09 -0400267.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900268.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400269.BI \-E
Sean Andersondc3a9232022-06-25 13:12:19 -0400270.TQ
271.BI \-\-external
Simon Glass722ebc82016-02-22 22:55:53 -0700272After processing, move the image data outside the FIT and store a data offset
Sean Anderson9cc40002022-06-25 13:12:15 -0400273in the FIT. Images will be placed one after the other immediately after the FIT,
274with each one aligned to a 4-byte boundary. The existing \(oqdata\(cq property
275in each image will be replaced with \(oqdata-offset\(cq and \(oqdata-size\(cq
276properties. A \(oqdata-offset\(cq of 0 indicates that it starts in the first
277(4-byte-aligned) byte after the FIT.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400278.
Simon Glass722ebc82016-02-22 22:55:53 -0700279.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400280.BI \-B " alignment"
Sean Andersondc3a9232022-06-25 13:12:19 -0400281.TQ
282.BI \-\-alignment " alignment"
Sean Andersondeb26382022-04-08 16:08:39 -0400283The alignment, in hexadecimal, that external data will be aligned to. This
284option only has an effect when \-E is specified.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400285.
Sean Andersondeb26382022-04-08 16:08:39 -0400286.TP
Sean Andersona5e2b672022-06-25 13:12:13 -0400287.BI \-p " external-position"
Sean Andersondc3a9232022-06-25 13:12:19 -0400288.TQ
289.BI \-\-position " external-position"
Sean Anderson9cc40002022-06-25 13:12:15 -0400290Place 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,
292.B \-p
293will use \(oqdata-position\(cq as the absolute position from the base of the
294FIT. See
295.B \-E
296for details on using external data.
Sean Andersona5e2b672022-06-25 13:12:13 -0400297.
298.TP
Sean Anderson9cc40002022-06-25 13:12:15 -0400299\fB\-f \fIimage-tree-source-file\fR | \fBauto
Sean Andersondc3a9232022-06-25 13:12:19 -0400300.TQ
301\fB\-\-fit \fIimage-tree-source-file\fR | \fBauto
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +0000302Image tree source file that describes the structure and contents of the
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900303FIT image.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400304.IP
Sean Anderson9cc40002022-06-25 13:12:15 -0400305In some simple cases, the image tree source can be generated automatically. To
306use this feature, pass
307.BR "\-f auto" .
308The
309.BR \-d ,
310.BR \-A ,
311.BR \-O ,
312.BR \-T ,
313.BR \-C ,
314.BR \-a ,
315and
316.B \-e
317options may be used to specify the image to include in the FIT and its
318attributes. No
319.I image-tree-source-file
320is required.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400321.
Simon Glass80e4df82013-06-13 15:10:03 -0700322.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400323.B \-F
Sean Andersondc3a9232022-06-25 13:12:19 -0400324.TQ
325.B \-\-update
Sean Anderson9cc40002022-06-25 13:12:15 -0400326Indicates that an existing FIT image should be modified. No dtc compilation will
327be performed and
328.B \-f
329should not be passed. This can be used to sign images with additional keys
330after initial image creation.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400331.
Simon Glass95d77b42013-06-13 15:10:05 -0700332.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400333.BI \-i " ramdisk-file"
Sean Andersondc3a9232022-06-25 13:12:19 -0400334.TQ
335.BI \-\-initramfs " ramdisk-file"
Sean Anderson9cc40002022-06-25 13:12:15 -0400336Append a ramdisk or initramfs file to the image.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400337.
Tomeu Vizoso0f7c6cd2016-11-04 14:22:15 +0100338.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400339.BI \-k " key-directory"
Sean Andersondc3a9232022-06-25 13:12:19 -0400340.TQ
341.BI \-\-key\-dir " key-directory"
Simon Glass80e4df82013-06-13 15:10:03 -0700342Specifies the directory containing keys to use for signing. This directory
Sean Anderson9cc40002022-06-25 13:12:15 -0400343should contain a private key file
344.IR name .key
345for use with signing, and a certificate
346.IR name .crt
347(containing the public key) for use with verification. The public key is only
348necessary when embedding it into another device tree using
349.BR \-K .
350.I name
351defaults to the value of the signature node's \(oqkey-name-hint\(cq property,
352but may be overridden using
353.BR \-g .
Sean Anderson7ec625f2022-06-25 13:12:09 -0400354.
Simon Glasse29495d2013-06-13 15:10:04 -0700355.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400356.BI \-G " key-file"
Sean Andersondc3a9232022-06-25 13:12:19 -0400357.TQ
358.BI \-\-key\-file " key-file"
Sean Anderson5920e5c2022-05-16 16:11:07 -0400359Specifies the private key file to use when signing. This option may be used
360instead of \-k.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400361.
Sean Anderson5920e5c2022-05-16 16:11:07 -0400362.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400363.BI \-K " key-destination"
Sean Andersondc3a9232022-06-25 13:12:19 -0400364.TQ
365.BI \-\-key\-dest " key-destination"
Simon Glasse29495d2013-06-13 15:10:04 -0700366Specifies a compiled device tree binary file (typically .dtb) to write
367public key information into. When a private key is used to sign an image,
368the corresponding public key is written into this file for for run-time
369verification. Typically the file here is the device tree binary used by
370CONFIG_OF_CONTROL in U-Boot.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400371.
Simon Glass399c7442013-06-13 15:10:07 -0700372.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400373.BI \-g " key-name-hint"
Sean Andersondc3a9232022-06-25 13:12:19 -0400374.TQ
375.BI \-\-key\-name\-hint " key-name-hint"
Sean Anderson9cc40002022-06-25 13:12:15 -0400376Overrides the signature node's \(oqkey-name-hint\(cq property. This is
377especially useful when signing an image with
378.BR "\-f auto" .
379This is the
380.I name
381part of the key. The directory part is set by
382.BR \-k .
383This option also indicates that the images included in the FIT should be signed.
384If this option is specified, then
385.B \-o
386must be specified as well.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400387.
Sean Anderson87b0af92022-05-16 16:11:08 -0400388.TP
Sean Anderson9cc40002022-06-25 13:12:15 -0400389.BI \-o " crypto" , checksum
Sean Andersondc3a9232022-06-25 13:12:19 -0400390.TQ
391.BI \-\-algo " crypto" , checksum
Jan Kiszka5902a392022-01-14 10:21:19 +0100392Specifies the algorithm to be used for signing a FIT image. The default is
Sean Anderson9cc40002022-06-25 13:12:15 -0400393taken from the signature node's \(oqalgo\(cq property.
394The valid values for
395.I crypto
396are:
397.RS
398.IP
399.TS
400lb.
401rsa2048
402rsa3072
403rsa4096
404ecdsa256
405.TE
406.RE
407.IP
408The valid values for
409.I checksum
410are
411.RS
412.IP
413.TS
414lb.
415sha1
416sha256
417sha384
418sha512
419.TE
420.RE
Sean Anderson7ec625f2022-06-25 13:12:09 -0400421.
Jan Kiszka5902a392022-01-14 10:21:19 +0100422.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400423.B \-r
Sean Andersondc3a9232022-06-25 13:12:19 -0400424.TQ
425.B \-\-key\-required
Simon Glass399c7442013-06-13 15:10:07 -0700426Specifies that keys used to sign the FIT are required. This means that they
427must be verified for the image to boot. Without this option, the verification
428will be optional (useful for testing but not for release).
Sean Anderson7ec625f2022-06-25 13:12:09 -0400429.
Simon Glass152b2462020-07-09 18:39:43 -0600430.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400431.BI \-N " engine"
Sean Andersondc3a9232022-06-25 13:12:19 -0400432.TQ
433.BI \-\-engine " engine"
Sean Anderson9cc40002022-06-25 13:12:15 -0400434The openssl engine to use when signing and verifying the image. For a complete
435list of available engines, refer to
Sean Andersondeb26382022-04-08 16:08:39 -0400436.BR engine (1).
Sean Anderson7ec625f2022-06-25 13:12:09 -0400437.
Sean Andersondeb26382022-04-08 16:08:39 -0400438.TP
Sean Anderson1bdf48622022-06-25 13:12:11 -0400439.B \-t
Sean Andersondc3a9232022-06-25 13:12:19 -0400440.TQ
441.B \-\-touch
Simon Glass152b2462020-07-09 18:39:43 -0600442Update the timestamp in the FIT.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400443.IP
Sean Anderson9cc40002022-06-25 13:12:15 -0400444Normally the FIT timestamp is created the first time mkimage runs,
Simon Glass152b2462020-07-09 18:39:43 -0600445when converting the source .its to the binary .fit file. This corresponds to
Sean Anderson9cc40002022-06-25 13:12:15 -0400446using
447.BR -f .
448But if the original input to mkimage is a binary file (already compiled), then
449the timestamp is assumed to have been set previously.
Sean Anderson7ec625f2022-06-25 13:12:09 -0400450.
Sean Andersonb42168c2022-06-25 13:12:20 -0400451.SH CONFIGURATION
452This section documents the formats of the primary and secondary configuration
453options for each image type which supports them.
454.
455.SS aisimage
456The primary configuration is a file containing a series of
457.I AIS
458(Application Image Script) commands, one per line. Each command has the form
459.RS
460.P
461.IR "command argument " .\|.\|.
462.RE
463.P
464See
465.UR https://\:www\:.ti\:.com/\:lit/\:pdf/\:spraag0
466TI application report SPRAAG0E
467.UE
468for details.
469.
470.SS atmelimage
471The primary configuration is a comma-separated list of NAND Flash parameters of
472the form
473.RS
474.P
475\fIparameter\fB=\fIvalue\fR[\fB,\fIparameter\fB=\fIvalue\fR.\|.\|.\&]
476.RE
477.P
478Valid
479.IR parameter s
480are
481.RS
482.P
483.TS
484lb.
485usePmecc
486nbSectorPerPage
487spareSize
488eccBitReq
489sectorSize
490eccOffset
491.TE
492.RE
493.P
494and valid
495.IR value s
496are decimal numbers. See section 11.4.4.1 of the SAMA5D3 Series Data Sheet for
497valid values for each parameter.
498.
499.SS imximage
500The primary configuration is a file containing configuration commands, as
501documented in doc/\:imx/\:mkimage/\:imximage.txt of the U-Boot source.
502.
503.SS imx8image and imx8mimage
504The primary configuration is a file containing configuration commands, as
505documented in doc/\:imx/\:mkimage/\:imx8image.txt of the U-Boot source.
506.
507.SS kwbimage
508The primary configuration is a file containing configuration commands, as
509documented in doc/\:imx/\:mkimage/\:kwbimage.txt of the U-Boot source.
510.
511.SS mtk_image
512The primary configuration is a semicolon-separated list of header options of the
513form
514.RS
515.P
516\fIkey\fB=\fIvalue\fR[\fB;\fIkey\fB=\fIvalue\fR.\|.\|.\&]
517.RE
518.P
519where the valid keys are:
520.RS
521.P
522.TS
523lb lbx
524lb l.
525Key Description
526_
527lk T{
528If \fB1\fP, then an \fILK\fP (legacy) image header is used. Otherwise, a
529\fIBootROM\fP image header is used.
530T}
531lkname T{
532The name of the LK image header. The maximum length is 32 ASCII characters. If
533not specified, the default value is \fBU-Boot\fP.
534T}
535media The boot device. See below for valid values.
536nandinfo The desired NAND device type. See below for valid values.
537arm64 If \fB1\fP, then this denotes an AArch64 image.
538hdroffset Increase the reported size of the BRLYT header by this amount.
539.TE
540.RE
541.P
542Valid values for
543.B media
544are:
545.RS
546.P
547.TS
548lb lb
549lb l.
550Value Description
551_
552nand Parallel NAND flash
553snand Serial NAND flash
554nor Serial NOR flash
555emmc \fIeMMC\fP (Embedded Multi-Media Card)
556sdmmc \fISD\fP (Secure Digital) card
557.TE
558.RE
559.P
560Valid values for
561.B nandinfo
562are:
563.RS
564.P
565.TS
566lb lb lb lb lb
567lb l l l l.
568Value NAND type Page size OOB size Total size
569_
5702k+64 Serial 2KiB 64B
5712k+120 Serial 2KiB 120B
5722k+128 Serial 2KiB 128B
5734k+256 Serial 4KiB 256B
5741g:2k+64 Parallel 2KiB 64B 1Gbit
5752g:2k+64 Parallel 2KiB 64B 2Gbit
5764g:2k+64 Parallel 2KiB 64B 4Gbit
5772g:2k+128 Parallel 2KiB 128B 2Gbit
5784g:2k+128 Parallel 2KiB 128B 4Gbit
579.TE
580.RE
581.
582.SS mxsimage
583The primary configuration is a file containing configuration commands, as
584documented in doc/\:imx/\:mkimage/\:mxsimage.txt of the U-Boot source.
585.
586.SS omapimage
587The primary configuration is the optional value
588.BR byteswap .
589If present, each 32-bit word of the image will have its bytes swapped
590(converting from little-endian to big-endian, or vice versa).
591.
592.SS pblimage
593The primary configuration is a file containing the
594.I PBI
595(Pre-Boot Image) header. Each line of the configuration has the format
596.RS
597.P
598.IR value "[ " value .\|.\|.\&]
599.RE
600.P
601Where
602.I value
603is a 32-bit hexadecimal integer. Each
604.I value
605will, after being converted to raw bytes, be literally prepended to the PBI.
606.P
607The secondary configuration is a file with the same format as the primary
608configuration file. It will be inserted into the image after the primary
609configuration data and before the image data.
610.P
611It is traditional to use the primary configuration file for the
612.I RCW
613(Reset Configuration Word), and the secondary configuration file for any
614additional PBI commands. However, it is also possible to convert an existing PBI
615to the above format and \(lqchain\(rq additional data onto the end of the
616image. This may be especially useful for creating secure boot images.
617.
618.SS rkimage
619The primary configuration is the name of the processor to generate the image
620for. Valid values are:
621.RS
622.P
623.TS
624lb.
625px30
626rk3036
627rk3066
628rk3128
629rk3188
630rk322x
631rk3288
632rk3308
633rk3328
634rk3368
635rk3399
636rv1108
637rk3568
638.TE
639.RE
640.
641.SS sunxi_egon
642The primary configuration is the name to use for the device tree.
643.
644.SS ublimage
645The primary configuration is a file containing configuration commands, as
646documented in doc/\:README.ublimage of the U-Boot source.
647.
648.SS zynqimage and zynqmpimage
649For
650.BR zynqmpimage ,
651the primary configuration is a file containing the
652.I PMUFW
653(Power Management Unit Firmware).
654.B zynqimage
655does not use the primary configuration.
656.P
657For both image types, the secondary configuration is a file containinig
658initialization parameters, one per line. Each parameter has the form
659.RS
660.P
661.I address data
662.RE
663.P
664where
665.I address
666and
667.I data
668are hexadecimal integers. The boot ROM will write each
669.I data
670to
671.I address
672when loading the image. At most 256 parameters may be specified in this
673manner.
674.
Sean Andersond0487182022-06-25 13:12:16 -0400675.SH BUGS
676Please report bugs to the
677.UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues
678U-Boot bug tracker
679.UE .
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +0000680.SH EXAMPLES
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400681.\" Reduce the width of the tab stops to something reasonable
682.ta T 1i
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900683List image information:
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400684.RS
685.P
686.EX
687\fBmkimage \-l uImage
688.EE
689.RE
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900690.P
691Create legacy image with compressed PowerPC Linux kernel:
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400692.RS
693.P
694.EX
695\fBmkimage \-A powerpc \-O linux \-T kernel \-C gzip \\
696 \-a 0 \-e 0 \-n Linux \-d vmlinux.gz uImage
697.EE
698.RE
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900699.P
700Create FIT image with compressed PowerPC Linux kernel:
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400701.RS
702.P
703.EX
704\fBmkimage \-f kernel.its kernel.itb
705.EE
706.RE
Simon Glasse29495d2013-06-13 15:10:04 -0700707.P
708Create FIT image with compressed kernel and sign it with keys in the
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400709/public/signing\-keys directory. Add corresponding public keys into u\-boot.dtb,
Simon Glasse29495d2013-06-13 15:10:04 -0700710skipping those for which keys cannot be found. Also add a comment.
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400711.RS
Simon Glass95d77b42013-06-13 15:10:05 -0700712.P
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400713.EX
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
716.EE
717.RE
718.P
719Add public keys to u\-boot.dtb without needing a FIT to sign. This will also
Sean Anderson87b0af92022-05-16 16:11:08 -0400720create a FIT containing an images node with no data named unused.itb.
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400721.RS
722.P
723.EX
724\fBmkimage \-f auto \-d /dev/null \-k /public/signing\-keys \-g dev \\
725 \-o sha256,rsa2048 \-K u\-boot.dtb unused.itb
726.EE
727.RE
Sean Anderson87b0af92022-05-16 16:11:08 -0400728.P
Simon Glass95d77b42013-06-13 15:10:05 -0700729Update an existing FIT image, signing it with additional keys.
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400730Add corresponding public keys into u\-boot.dtb. This will resign all images
Simon Glass95d77b42013-06-13 15:10:05 -0700731with keys that are available in the new directory. Images that request signing
732with unavailable keys are skipped.
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400733.RS
734.P
735.EX
736\fBmkimage \-F \-k /secret/signing\-keys \-K u\-boot.dtb \\
737 \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb
738.EE
739.RE
Simon Glass8e35bb02016-02-22 22:55:51 -0700740.P
741Create a FIT image containing a kernel, using automatic mode. No .its file
742is required.
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400743.RS
744.P
745.EX
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
748.EE
749.RE
Simon Glassfb4cce02016-02-22 22:55:52 -0700750.P
751Create a FIT image containing a kernel and some device tree files, using
752automatic mode. No .its file is required.
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400753.RS
754.P
755.EX
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
759.EE
760.RE
Sean Anderson87b0af92022-05-16 16:11:08 -0400761.P
762Create a FIT image containing a signed kernel, using automatic mode. No .its
763file is required.
Sean Anderson3dc1ff02022-06-25 13:12:10 -0400764.RS
765.P
766.EX
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
769.EE
770.RE
Sean Anderson7ec625f2022-06-25 13:12:09 -0400771.
Sean Anderson84bd5cd2022-06-25 13:12:17 -0400772.SH SEE ALSO
773.BR dtc (1),
774.BR dumpimage (1),
775.BR openssl (1),
776the\~
777.UR https://\:u-boot\:.readthedocs\:.io/\:en/\:latest/\:index.html
778U-Boot documentation
779.UE