Sean Anderson | 785a051 | 2022-06-25 13:12:18 -0400 | [diff] [blame] | 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 |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 7 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 8 | .SH NAME |
Sean Anderson | e9927c2 | 2022-06-25 13:12:14 -0400 | [diff] [blame] | 9 | mkimage \- generate images for U-Boot |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 10 | .SH SYNOPSIS |
Sean Anderson | a568554 | 2022-06-25 13:12:08 -0400 | [diff] [blame] | 11 | .SY mkimage |
| 12 | .OP \-T type |
| 13 | .BI \-l\~ image-file-name |
| 14 | .YS |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 15 | . |
Sean Anderson | a568554 | 2022-06-25 13:12:08 -0400 | [diff] [blame] | 16 | .SY mkimage |
| 17 | .RI [ option\~ .\|.\|.\&] |
| 18 | .OP \-T type |
| 19 | .I image-file-name |
| 20 | .YS |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 21 | . |
Sean Anderson | a568554 | 2022-06-25 13:12:08 -0400 | [diff] [blame] | 22 | .SY mkimage |
| 23 | .RI [ option\~ .\|.\|.\&] |
| 24 | .BI \-f\~ image-tree-source-file\c |
| 25 | .RB | auto |
| 26 | .I image-file-name |
| 27 | .YS |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 28 | . |
Sean Anderson | a568554 | 2022-06-25 13:12:08 -0400 | [diff] [blame] | 29 | .SY mkimage |
| 30 | .RI [ option\~ .\|.\|.\&] |
| 31 | .BI \-F\~ image-file-name |
| 32 | .YS |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 33 | . |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 34 | .SH DESCRIPTION |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 35 | The |
| 36 | .B mkimage |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 40 | .P |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 41 | .B mkimage |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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 |
| 44 | other kernel): |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 45 | .P |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 50 | .P |
Horst Kronstorfer | 7aecfdd | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 51 | The new |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 52 | .I FIT |
| 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. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 56 | . |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 57 | .SH OPTIONS |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 58 | . |
Sean Anderson | a4d0c74 | 2022-06-25 13:12:12 -0400 | [diff] [blame] | 59 | .SS General options |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 60 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 61 | .TP |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 62 | .B \-h |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 63 | .TQ |
| 64 | .B \-\-help |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 65 | Print a help message and exit. |
| 66 | . |
| 67 | .TP |
| 68 | .B \-l |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 69 | .TQ |
| 70 | .B \-\-list |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 71 | .B mkimage |
| 72 | lists the information contained in the header of an existing U-Boot image. |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 73 | . |
| 74 | .TP |
| 75 | .B \-s |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 76 | .TQ |
| 77 | .B \-\-no\-copy |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 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. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 80 | . |
Pali Rohár | 11f29d4 | 2022-02-13 01:09:46 +0100 | [diff] [blame] | 81 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 82 | .BI \-T " image-type" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 83 | .TQ |
| 84 | .BI \-\-type " image-type" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 85 | Parse image file as |
| 86 | .IR image-type . |
| 87 | Pass |
| 88 | .B list |
| 89 | as |
| 90 | .I image-type |
| 91 | to see the list of supported image types. If this option is absent, then it |
| 92 | defaults to |
| 93 | .B kernel |
| 94 | (legacy image). If this option is absent when |
| 95 | .B \-l |
| 96 | is passed, then |
| 97 | .B mkimage |
| 98 | will attempt to automatically detect the image type. Not all image types support |
| 99 | automatic detection, so it may be necessary to pass |
| 100 | .B \-T |
| 101 | explicitly. |
| 102 | .IP |
| 103 | When creating a FIT image with |
| 104 | .BR \-f , |
| 105 | the image type is always set to |
| 106 | .BR flat_dt . |
| 107 | In this case, |
| 108 | .B \-T |
| 109 | specifies the image node's \(oqtype\(cq property. If |
| 110 | .B \-T |
| 111 | is absent, then the \(oqtype\(cq property will default to |
| 112 | .BR kernel . |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 113 | . |
Sean Anderson | deb2638 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 114 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 115 | .B \-q |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 116 | .TQ |
| 117 | .B \-\-quiet |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 118 | Quiet. Don't print the image header. |
| 119 | . |
| 120 | .TP |
| 121 | .B \-v |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 122 | .TQ |
| 123 | .B \-\-verbose |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 124 | Verbose. Print file names as they are added to the image. |
| 125 | . |
| 126 | .TP |
| 127 | .B \-V |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 128 | .TQ |
| 129 | .B \-\-version |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 130 | Print version information and exit. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 131 | . |
Sean Anderson | a4d0c74 | 2022-06-25 13:12:12 -0400 | [diff] [blame] | 132 | .SS General image-creation options |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 133 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 134 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 135 | .BI \-A " architecture" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 136 | .TQ |
| 137 | .BI \-\-architecture " architecture" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 138 | Set the architecture. Pass |
| 139 | .B \-h |
| 140 | as the architecture to see the list of supported architectures. If |
| 141 | .B \-A |
| 142 | is absent, it defaults to |
| 143 | .BR ppc . |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 144 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 145 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 146 | .BI \-O " os" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 147 | .TQ |
| 148 | .BI \-\-os " os" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 149 | Set the operating system. The U-Boot |
| 150 | .I bootm |
| 151 | command changes boot method based on the OS type. |
| 152 | Pass |
| 153 | .B \-h |
| 154 | as the |
| 155 | .I os |
| 156 | to see the list of supported OSs. If |
| 157 | .B \-O |
| 158 | is absent, it defaults to |
| 159 | .BR linux . |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 160 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 161 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 162 | .BI \-C " compression-type" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 163 | .TQ |
| 164 | .BI \-\-compression " compression-type" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 165 | Set the compression type. The image data should have already been compressed |
| 166 | using this compression type. |
| 167 | .B mkimage |
| 168 | will not automatically compress image data. |
| 169 | Pass |
| 170 | .B \-h |
| 171 | as the |
| 172 | .I compression-type |
| 173 | to see the list of supported compression types. If |
| 174 | .B \-C |
| 175 | is absent, it defaults to |
| 176 | .BR gzip . |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 177 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 178 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 179 | .BI \-a " load-address" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 180 | .TQ |
| 181 | .BI \-\-load\-address " load-address" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 182 | Set the absolute address to load the image data to. |
| 183 | .I load-address |
| 184 | will be interpreted as a hexadecimal number. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 185 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 186 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 187 | .BI \-e " entry-point" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 188 | .TQ |
| 189 | .BI \-\-entry\-point " entry-point" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 190 | Set the absolute address of the image entry point. The U-Boot |
| 191 | .I bootm |
| 192 | command will jump to this address after loading the image. |
| 193 | .I entry-point |
| 194 | will be interpreted as a hexadecimal number. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 195 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 196 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 197 | .BI \-n " image-name" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 198 | .TQ |
| 199 | .BI \-\-primary\-image " image-name" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 200 | Set the image name to |
| 201 | .IR image-name . |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 202 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 203 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 204 | .BI \-R " secondary-image-name" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 205 | .TQ |
| 206 | .BI \-\-secondary\-image " image-name" |
Sean Anderson | deb2638 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 207 | Some image types support a second image for additional data. For these types, |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 208 | use |
| 209 | .B \-R |
| 210 | to specify this second image. |
Sean Anderson | 5920e5c | 2022-05-16 16:11:07 -0400 | [diff] [blame] | 211 | .TS |
| 212 | allbox; |
| 213 | lb lbx |
| 214 | l l. |
| 215 | Image Type Secondary Image Description |
| 216 | pblimage Additional RCW-style header, typically used for PBI commands. |
| 217 | zynqimage, zynqmpimage T{ |
| 218 | Initialization parameters, one per line. Each parameter has the form |
| 219 | .sp |
| 220 | .ti 4 |
| 221 | .I address data |
| 222 | .sp |
| 223 | where |
| 224 | .I address |
| 225 | and |
| 226 | .I data |
| 227 | are hexadecimal integers. The boot ROM will write each |
| 228 | .I data |
| 229 | to |
| 230 | .I address |
| 231 | when loading the image. At most 256 parameters may be specified in this |
| 232 | manner. |
| 233 | T} |
| 234 | .TE |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 235 | . |
Sean Anderson | deb2638 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 236 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 237 | .BI \-d " image-data-file" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 238 | .TQ |
| 239 | .BI \-\-image " image-data-file" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 240 | Use image data from |
| 241 | .IR image-data-file . |
| 242 | If the |
| 243 | .I image-type |
| 244 | is |
| 245 | .BR multi , |
| 246 | then multiple images may be specified, separated by colons: |
| 247 | .RS |
| 248 | .IP |
| 249 | .IR image-data-file [\fB:\fP image-data-file .\|.\|.] |
| 250 | .RE |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 251 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 252 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 253 | .B \-x |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 254 | .TQ |
| 255 | .B \-\-xip |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 256 | Set the |
| 257 | .I XIP |
| 258 | (execute in place) flag. The U-Boot |
| 259 | .I bootm |
| 260 | command will not load the image data, and instead will assume it is already |
| 261 | accessible at the load address (such as via memory-mapped flash). |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 262 | . |
Sean Anderson | a4d0c74 | 2022-06-25 13:12:12 -0400 | [diff] [blame] | 263 | .SS Options for creating FIT images |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 264 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 265 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 266 | .BI \-b " device-tree-file" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 267 | .TQ |
| 268 | .BI \-\-device\-tree " device-tree-file" |
Andreas Bießmann | 7a439ca | 2016-05-01 03:01:27 +0200 | [diff] [blame] | 269 | Appends the device tree binary file (.dtb) to the FIT. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 270 | . |
Simon Glass | fb4cce0 | 2016-02-22 22:55:52 -0700 | [diff] [blame] | 271 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 272 | .BI \-c " comment" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 273 | .TQ |
| 274 | .BI \-\-comment " comment" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 275 | Specifies a comment to be added when signing. This is typically a message which |
| 276 | describes how the image was signed or some other useful information. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 277 | . |
Simon Glass | 4f61042 | 2013-06-13 15:10:06 -0700 | [diff] [blame] | 278 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 279 | .BI \-D " dtc-options" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 280 | .TQ |
| 281 | .BI \-\-dtcopts " dtc-options" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 282 | Provide additional options to the device tree compiler when creating the image. |
| 283 | See |
| 284 | .BR dtc (1) |
| 285 | for documentation of possible options. If |
| 286 | .B \-D |
| 287 | is absent, it defaults to |
| 288 | .BR "\-I dts \-O dtb \-p 500" . |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 289 | . |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 290 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 291 | .BI \-E |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 292 | .TQ |
| 293 | .BI \-\-external |
Simon Glass | 722ebc8 | 2016-02-22 22:55:53 -0700 | [diff] [blame] | 294 | After processing, move the image data outside the FIT and store a data offset |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 295 | in the FIT. Images will be placed one after the other immediately after the FIT, |
| 296 | with each one aligned to a 4-byte boundary. The existing \(oqdata\(cq property |
| 297 | in each image will be replaced with \(oqdata-offset\(cq and \(oqdata-size\(cq |
| 298 | properties. A \(oqdata-offset\(cq of 0 indicates that it starts in the first |
| 299 | (4-byte-aligned) byte after the FIT. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 300 | . |
Simon Glass | 722ebc8 | 2016-02-22 22:55:53 -0700 | [diff] [blame] | 301 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 302 | .BI \-B " alignment" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 303 | .TQ |
| 304 | .BI \-\-alignment " alignment" |
Sean Anderson | deb2638 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 305 | The alignment, in hexadecimal, that external data will be aligned to. This |
| 306 | option only has an effect when \-E is specified. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 307 | . |
Sean Anderson | deb2638 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 308 | .TP |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 309 | .BI \-p " external-position" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 310 | .TQ |
| 311 | .BI \-\-position " external-position" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 312 | Place external data at a static external position. Instead of writing a |
| 313 | \(oqdata-offset\(cq property defining the offset from the end of the FIT, |
| 314 | .B \-p |
| 315 | will use \(oqdata-position\(cq as the absolute position from the base of the |
| 316 | FIT. See |
| 317 | .B \-E |
| 318 | for details on using external data. |
Sean Anderson | a5e2b67 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 319 | . |
| 320 | .TP |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 321 | \fB\-f \fIimage-tree-source-file\fR | \fBauto |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 322 | .TQ |
| 323 | \fB\-\-fit \fIimage-tree-source-file\fR | \fBauto |
Horst Kronstorfer | 7aecfdd | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 324 | Image tree source file that describes the structure and contents of the |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 325 | FIT image. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 326 | .IP |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 327 | In some simple cases, the image tree source can be generated automatically. To |
| 328 | use this feature, pass |
| 329 | .BR "\-f auto" . |
| 330 | The |
| 331 | .BR \-d , |
| 332 | .BR \-A , |
| 333 | .BR \-O , |
| 334 | .BR \-T , |
| 335 | .BR \-C , |
| 336 | .BR \-a , |
| 337 | and |
| 338 | .B \-e |
| 339 | options may be used to specify the image to include in the FIT and its |
| 340 | attributes. No |
| 341 | .I image-tree-source-file |
| 342 | is required. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 343 | . |
Simon Glass | 80e4df8 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 344 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 345 | .B \-F |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 346 | .TQ |
| 347 | .B \-\-update |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 348 | Indicates that an existing FIT image should be modified. No dtc compilation will |
| 349 | be performed and |
| 350 | .B \-f |
| 351 | should not be passed. This can be used to sign images with additional keys |
| 352 | after initial image creation. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 353 | . |
Simon Glass | 95d77b4 | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 354 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 355 | .BI \-i " ramdisk-file" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 356 | .TQ |
| 357 | .BI \-\-initramfs " ramdisk-file" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 358 | Append a ramdisk or initramfs file to the image. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 359 | . |
Tomeu Vizoso | 0f7c6cd | 2016-11-04 14:22:15 +0100 | [diff] [blame] | 360 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 361 | .BI \-k " key-directory" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 362 | .TQ |
| 363 | .BI \-\-key\-dir " key-directory" |
Simon Glass | 80e4df8 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 364 | Specifies the directory containing keys to use for signing. This directory |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 365 | should contain a private key file |
| 366 | .IR name .key |
| 367 | for use with signing, and a certificate |
| 368 | .IR name .crt |
| 369 | (containing the public key) for use with verification. The public key is only |
| 370 | necessary when embedding it into another device tree using |
| 371 | .BR \-K . |
| 372 | .I name |
| 373 | defaults to the value of the signature node's \(oqkey-name-hint\(cq property, |
| 374 | but may be overridden using |
| 375 | .BR \-g . |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 376 | . |
Simon Glass | e29495d | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 377 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 378 | .BI \-G " key-file" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 379 | .TQ |
| 380 | .BI \-\-key\-file " key-file" |
Sean Anderson | 5920e5c | 2022-05-16 16:11:07 -0400 | [diff] [blame] | 381 | Specifies the private key file to use when signing. This option may be used |
| 382 | instead of \-k. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 383 | . |
Sean Anderson | 5920e5c | 2022-05-16 16:11:07 -0400 | [diff] [blame] | 384 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 385 | .BI \-K " key-destination" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 386 | .TQ |
| 387 | .BI \-\-key\-dest " key-destination" |
Simon Glass | e29495d | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 388 | Specifies a compiled device tree binary file (typically .dtb) to write |
| 389 | public key information into. When a private key is used to sign an image, |
| 390 | the corresponding public key is written into this file for for run-time |
| 391 | verification. Typically the file here is the device tree binary used by |
| 392 | CONFIG_OF_CONTROL in U-Boot. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 393 | . |
Simon Glass | 399c744 | 2013-06-13 15:10:07 -0700 | [diff] [blame] | 394 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 395 | .BI \-g " key-name-hint" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 396 | .TQ |
| 397 | .BI \-\-key\-name\-hint " key-name-hint" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 398 | Overrides the signature node's \(oqkey-name-hint\(cq property. This is |
| 399 | especially useful when signing an image with |
| 400 | .BR "\-f auto" . |
| 401 | This is the |
| 402 | .I name |
| 403 | part of the key. The directory part is set by |
| 404 | .BR \-k . |
| 405 | This option also indicates that the images included in the FIT should be signed. |
| 406 | If this option is specified, then |
| 407 | .B \-o |
| 408 | must be specified as well. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 409 | . |
Sean Anderson | 87b0af9 | 2022-05-16 16:11:08 -0400 | [diff] [blame] | 410 | .TP |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 411 | .BI \-o " crypto" , checksum |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 412 | .TQ |
| 413 | .BI \-\-algo " crypto" , checksum |
Jan Kiszka | 5902a39 | 2022-01-14 10:21:19 +0100 | [diff] [blame] | 414 | Specifies the algorithm to be used for signing a FIT image. The default is |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 415 | taken from the signature node's \(oqalgo\(cq property. |
| 416 | The valid values for |
| 417 | .I crypto |
| 418 | are: |
| 419 | .RS |
| 420 | .IP |
| 421 | .TS |
| 422 | lb. |
| 423 | rsa2048 |
| 424 | rsa3072 |
| 425 | rsa4096 |
| 426 | ecdsa256 |
| 427 | .TE |
| 428 | .RE |
| 429 | .IP |
| 430 | The valid values for |
| 431 | .I checksum |
| 432 | are |
| 433 | .RS |
| 434 | .IP |
| 435 | .TS |
| 436 | lb. |
| 437 | sha1 |
| 438 | sha256 |
| 439 | sha384 |
| 440 | sha512 |
| 441 | .TE |
| 442 | .RE |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 443 | . |
Jan Kiszka | 5902a39 | 2022-01-14 10:21:19 +0100 | [diff] [blame] | 444 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 445 | .B \-r |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 446 | .TQ |
| 447 | .B \-\-key\-required |
Simon Glass | 399c744 | 2013-06-13 15:10:07 -0700 | [diff] [blame] | 448 | Specifies that keys used to sign the FIT are required. This means that they |
| 449 | must be verified for the image to boot. Without this option, the verification |
| 450 | will be optional (useful for testing but not for release). |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 451 | . |
Simon Glass | 152b246 | 2020-07-09 18:39:43 -0600 | [diff] [blame] | 452 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 453 | .BI \-N " engine" |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 454 | .TQ |
| 455 | .BI \-\-engine " engine" |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 456 | The openssl engine to use when signing and verifying the image. For a complete |
| 457 | list of available engines, refer to |
Sean Anderson | deb2638 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 458 | .BR engine (1). |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 459 | . |
Sean Anderson | deb2638 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 460 | .TP |
Sean Anderson | 1bdf4862 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 461 | .B \-t |
Sean Anderson | dc3a923 | 2022-06-25 13:12:19 -0400 | [diff] [blame^] | 462 | .TQ |
| 463 | .B \-\-touch |
Simon Glass | 152b246 | 2020-07-09 18:39:43 -0600 | [diff] [blame] | 464 | Update the timestamp in the FIT. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 465 | .IP |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 466 | Normally the FIT timestamp is created the first time mkimage runs, |
Simon Glass | 152b246 | 2020-07-09 18:39:43 -0600 | [diff] [blame] | 467 | when converting the source .its to the binary .fit file. This corresponds to |
Sean Anderson | 9cc4000 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 468 | using |
| 469 | .BR -f . |
| 470 | But if the original input to mkimage is a binary file (already compiled), then |
| 471 | the timestamp is assumed to have been set previously. |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 472 | . |
Sean Anderson | d048718 | 2022-06-25 13:12:16 -0400 | [diff] [blame] | 473 | .SH BUGS |
| 474 | Please report bugs to the |
| 475 | .UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues |
| 476 | U-Boot bug tracker |
| 477 | .UE . |
Horst Kronstorfer | 7aecfdd | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 478 | .SH EXAMPLES |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 479 | .\" Reduce the width of the tab stops to something reasonable |
| 480 | .ta T 1i |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 481 | List image information: |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 482 | .RS |
| 483 | .P |
| 484 | .EX |
| 485 | \fBmkimage \-l uImage |
| 486 | .EE |
| 487 | .RE |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 488 | .P |
| 489 | Create legacy image with compressed PowerPC Linux kernel: |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 490 | .RS |
| 491 | .P |
| 492 | .EX |
| 493 | \fBmkimage \-A powerpc \-O linux \-T kernel \-C gzip \\ |
| 494 | \-a 0 \-e 0 \-n Linux \-d vmlinux.gz uImage |
| 495 | .EE |
| 496 | .RE |
Nobuhiro Iwamatsu | cd15355 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 497 | .P |
| 498 | Create FIT image with compressed PowerPC Linux kernel: |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 499 | .RS |
| 500 | .P |
| 501 | .EX |
| 502 | \fBmkimage \-f kernel.its kernel.itb |
| 503 | .EE |
| 504 | .RE |
Simon Glass | e29495d | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 505 | .P |
| 506 | Create FIT image with compressed kernel and sign it with keys in the |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 507 | /public/signing\-keys directory. Add corresponding public keys into u\-boot.dtb, |
Simon Glass | e29495d | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 508 | skipping those for which keys cannot be found. Also add a comment. |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 509 | .RS |
Simon Glass | 95d77b4 | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 510 | .P |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 511 | .EX |
| 512 | \fBmkimage \-f kernel.its \-k /public/signing\-keys \-K u\-boot.dtb \\ |
| 513 | \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb |
| 514 | .EE |
| 515 | .RE |
| 516 | .P |
| 517 | Add public keys to u\-boot.dtb without needing a FIT to sign. This will also |
Sean Anderson | 87b0af9 | 2022-05-16 16:11:08 -0400 | [diff] [blame] | 518 | create a FIT containing an images node with no data named unused.itb. |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 519 | .RS |
| 520 | .P |
| 521 | .EX |
| 522 | \fBmkimage \-f auto \-d /dev/null \-k /public/signing\-keys \-g dev \\ |
| 523 | \-o sha256,rsa2048 \-K u\-boot.dtb unused.itb |
| 524 | .EE |
| 525 | .RE |
Sean Anderson | 87b0af9 | 2022-05-16 16:11:08 -0400 | [diff] [blame] | 526 | .P |
Simon Glass | 95d77b4 | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 527 | Update an existing FIT image, signing it with additional keys. |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 528 | Add corresponding public keys into u\-boot.dtb. This will resign all images |
Simon Glass | 95d77b4 | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 529 | with keys that are available in the new directory. Images that request signing |
| 530 | with unavailable keys are skipped. |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 531 | .RS |
| 532 | .P |
| 533 | .EX |
| 534 | \fBmkimage \-F \-k /secret/signing\-keys \-K u\-boot.dtb \\ |
| 535 | \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb |
| 536 | .EE |
| 537 | .RE |
Simon Glass | 8e35bb0 | 2016-02-22 22:55:51 -0700 | [diff] [blame] | 538 | .P |
| 539 | Create a FIT image containing a kernel, using automatic mode. No .its file |
| 540 | is required. |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 541 | .RS |
| 542 | .P |
| 543 | .EX |
| 544 | \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\ |
| 545 | \-c \(dqKernel 4.4 image for production devices\(dq \-d vmlinuz kernel.itb |
| 546 | .EE |
| 547 | .RE |
Simon Glass | fb4cce0 | 2016-02-22 22:55:52 -0700 | [diff] [blame] | 548 | .P |
| 549 | Create a FIT image containing a kernel and some device tree files, using |
| 550 | automatic mode. No .its file is required. |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 551 | .RS |
| 552 | .P |
| 553 | .EX |
| 554 | \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\ |
| 555 | \-c \(dqKernel 4.4 image for production devices\(dq \-d vmlinuz \\ |
| 556 | \-b /path/to/rk3288\-firefly.dtb \-b /path/to/rk3288\-jerry.dtb kernel.itb |
| 557 | .EE |
| 558 | .RE |
Sean Anderson | 87b0af9 | 2022-05-16 16:11:08 -0400 | [diff] [blame] | 559 | .P |
| 560 | Create a FIT image containing a signed kernel, using automatic mode. No .its |
| 561 | file is required. |
Sean Anderson | 3dc1ff0 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 562 | .RS |
| 563 | .P |
| 564 | .EX |
| 565 | \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\ |
| 566 | \-d vmlinuz \-k /secret/signing\-keys \-g dev \-o sha256,rsa2048 kernel.itb |
| 567 | .EE |
| 568 | .RE |
Sean Anderson | 7ec625f | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 569 | . |
Sean Anderson | 84bd5cd | 2022-06-25 13:12:17 -0400 | [diff] [blame] | 570 | .SH SEE ALSO |
| 571 | .BR dtc (1), |
| 572 | .BR dumpimage (1), |
| 573 | .BR openssl (1), |
| 574 | the\~ |
| 575 | .UR https://\:u-boot\:.readthedocs\:.io/\:en/\:latest/\:index.html |
| 576 | U-Boot documentation |
| 577 | .UE |