Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 3 | bootm command |
| 4 | ============= |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 5 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 6 | Synopsis |
| 7 | -------- |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 8 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 9 | :: |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 10 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 11 | bootm [fit_addr]#<conf>[#extra-conf] |
| 12 | bootm [[fit_addr]:<os_subimg>] [[<fit_addr2>]:<rd_subimg2>] [[<fit_addr3>]:<fdt_subimg>] |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 13 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 14 | bootm <addr1> [[<addr2> [<addr3>]] # Legacy boot |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 15 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 16 | Description |
| 17 | ----------- |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 18 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 19 | The *bootm* command is used to boot an Operating System. It has a large number |
| 20 | of options depending on what needs to be booted. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 21 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 22 | Note that the second form supports the first and/or second arguments to be |
| 23 | omitted by using a hyphen '-' instead. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 24 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 25 | fit_addr / fit_addr2 / fit_addr3 |
| 26 | address of FIT to boot, defaults to CONFIG_SYS_LOAD_ADDR. See notes below. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 27 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 28 | conf |
| 29 | configuration unit to boot (must be preceded by hash '#') |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 30 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 31 | extra-conf |
| 32 | extra configuration to boot. This is supported only for additional |
| 33 | devicetree overlays to apply on the base device tree supplied by the first |
| 34 | configuration unit. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 35 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 36 | os_subimg |
| 37 | OS sub-image to boot (must be preceded by colon ':') |
| 38 | |
| 39 | rd_subimg |
| 40 | ramdisk sub-image to boot. Use a hyphen '-' if there is no ramdisk but an |
| 41 | FDT is needed. |
| 42 | |
| 43 | fdt_subimg |
| 44 | FDT sub-image to boot |
| 45 | |
| 46 | See below for legacy boot. Booting using :doc:`../fit/index` is recommended. |
| 47 | |
| 48 | Note on current image address |
| 49 | ----------------------------- |
| 50 | |
| 51 | When bootm is called without arguments, the image at current image address is |
| 52 | booted. The current image address is the address set most recently by a load |
| 53 | command, etc, and is by default equal to CONFIG_SYS_LOAD_ADDR. For example, |
| 54 | consider the following commands:: |
| 55 | |
| 56 | tftp 200000 /tftpboot/kernel |
| 57 | bootm |
| 58 | # Last command is equivalent to: |
| 59 | # bootm 200000 |
| 60 | |
| 61 | As shown above, with FIT the address portion of any argument |
| 62 | can be omitted. If <addr3> is omitted, then it is assumed that image at |
| 63 | <addr2> should be used. Similarly, when <addr2> is omitted, it is assumed that |
| 64 | image at <addr1> should be used. If <addr1> is omitted, it is assumed that the |
| 65 | current image address is to be used. For example, consider the following |
| 66 | commands:: |
| 67 | |
| 68 | tftp 200000 /tftpboot/uImage |
| 69 | bootm :kernel-1 |
| 70 | # Last command is equivalent to: |
| 71 | # bootm 200000:kernel-1 |
| 72 | |
| 73 | tftp 200000 /tftpboot/uImage |
| 74 | bootm 400000:kernel-1 :ramdisk-1 |
| 75 | # Last command is equivalent to: |
| 76 | # bootm 400000:kernel-1 400000:ramdisk-1 |
| 77 | |
| 78 | tftp 200000 /tftpboot/uImage |
| 79 | bootm :kernel-1 400000:ramdisk-1 :fdt-1 |
| 80 | # Last command is equivalent to: |
| 81 | # bootm 200000:kernel-1 400000:ramdisk-1 400000:fdt-1 |
| 82 | |
| 83 | |
| 84 | Legacy boot |
| 85 | ----------- |
| 86 | |
| 87 | U-Boot supports a legacy image format, enabled by `CONFIG_LEGACY_IMAGE_FORMAT`. |
| 88 | This is not recommended as it is quite limited and insecure. Use |
| 89 | :doc:`../fit/index` instead. It is documented here for old boards which still |
| 90 | use it. |
| 91 | |
| 92 | Arguments are: |
| 93 | |
| 94 | addr1 |
| 95 | address of legacy image to boot. If the image includes a second component |
| 96 | (ramdisk) it is used as well, unless the second parameter is hyphen '-'. |
| 97 | |
| 98 | addr2 |
| 99 | address of legacy image to use as ramdisk |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 100 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 101 | addr3 |
| 102 | address of legacy image to use as FDT |
| 103 | |
| 104 | |
| 105 | Example syntax |
| 106 | -------------- |
| 107 | |
| 108 | This section provides various examples of possible usage:: |
| 109 | |
| 110 | 1. bootm /* boot image at the current address, equivalent to 2,3,8 */ |
| 111 | |
| 112 | This is equivalent to cases 2, 3 or 8, depending on the type of image at |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 113 | the current image address. |
| 114 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 115 | Boot method: see cases 2,3,8 |
| 116 | |
| 117 | Legacy uImage syntax |
| 118 | ~~~~~~~~~~~~~~~~~~~~ |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 119 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 120 | :: |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 121 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 122 | 2. bootm <addr1> /* single image at <addr1> */ |
| 123 | |
| 124 | Boot kernel image located at <addr1>. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 125 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 126 | Boot method: non-FDT |
| 127 | |
| 128 | :: |
| 129 | |
| 130 | 3. bootm <addr1> /* multi-image at <addr1> */ |
| 131 | |
| 132 | First and second components of the image at <addr1> are assumed to be a |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 133 | kernel and a ramdisk, respectively. The kernel is booted with initrd loaded |
| 134 | with the ramdisk from the image. |
| 135 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 136 | Boot method: depends on the number of components at <addr1>, and on whether |
| 137 | U-Boot is compiled with OF support, which it should be. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 138 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 139 | ==================== ======================== ======================== |
| 140 | Configuration 2 components 3 components |
| 141 | (kernel, initrd) (kernel, initrd, fdt) |
| 142 | ==================== ======================== ======================== |
| 143 | #ifdef CONFIG_OF_* non-FDT FDT |
| 144 | #ifndef CONFIG_OF_* non-FDT non-FDT |
| 145 | ==================== ======================== ======================== |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 146 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 147 | :: |
| 148 | |
| 149 | 4. bootm <addr1> - /* multi-image at <addr1> */ |
| 150 | |
| 151 | Similar to case 3, but the kernel is booted without initrd. Second |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 152 | component of the multi-image is irrelevant (it can be a dummy, 1-byte file). |
| 153 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 154 | Boot method: see case 3 |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 155 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 156 | :: |
| 157 | |
| 158 | 5. bootm <addr1> <addr2> /* single image at <addr1> */ |
| 159 | |
| 160 | Boot kernel image located at <addr1> with initrd loaded with ramdisk |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 161 | from the image at <addr2>. |
| 162 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 163 | Boot method: non-FDT |
| 164 | |
| 165 | :: |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 166 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 167 | 6. bootm <addr1> <addr2> <addr3> /* single image at <addr1> */ |
| 168 | |
| 169 | <addr1> is the address of a kernel image, <addr2> is the address of a |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 170 | ramdisk image, and <addr3> is the address of a FDT binary blob. Kernel is |
| 171 | booted with initrd loaded with ramdisk from the image at <addr2>. |
| 172 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 173 | Boot method: FDT |
| 174 | |
| 175 | :: |
| 176 | |
| 177 | 7. bootm <addr1> - <addr3> /* single image at <addr1> */ |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 178 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 179 | <addr1> is the address of a kernel image and <addr3> is the address of |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 180 | a FDT binary blob. Kernel is booted without initrd. |
| 181 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 182 | Boot method: FDT |
| 183 | |
| 184 | FIT syntax |
| 185 | ~~~~~~~~~~ |
| 186 | |
| 187 | :: |
| 188 | |
| 189 | 8. bootm <addr1> |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 190 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 191 | Image at <addr1> is assumed to contain a default configuration, which |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 192 | is booted. |
| 193 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 194 | Boot method: FDT or non-FDT, depending on whether the default configuration |
| 195 | defines FDT |
| 196 | |
| 197 | :: |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 198 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 199 | 9. bootm [<addr1>]:<subimg1> |
| 200 | |
| 201 | Similar to case 2: boot kernel stored in <subimg1> from the image at |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 202 | address <addr1>. |
| 203 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 204 | Boot method: non-FDT |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 205 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 206 | :: |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 207 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 208 | 10. bootm [<addr1>]#<conf>[#<extra-conf[#...]] |
| 209 | |
| 210 | Boot configuration <conf> from the image at <addr1>. |
| 211 | |
| 212 | Boot method: FDT or non-FDT, depending on whether the configuration given |
| 213 | defines FDT |
| 214 | |
| 215 | :: |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 216 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 217 | 11. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> |
| 218 | |
| 219 | Equivalent to case 5: boot kernel stored in <subimg1> from the image |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 220 | at <addr1> with initrd loaded with ramdisk <subimg2> from the image at |
| 221 | <addr2>. |
| 222 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 223 | Boot method: non-FDT |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 224 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 225 | :: |
| 226 | |
| 227 | 12. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> [<addr3>]:<subimg3> |
| 228 | |
| 229 | Equivalent to case 6: boot kernel stored in <subimg1> from the image |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 230 | at <addr1> with initrd loaded with ramdisk <subimg2> from the image at |
| 231 | <addr2>, and pass FDT blob <subimg3> from the image at <addr3>. |
| 232 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 233 | Boot method: FDT |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 234 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 235 | :: |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 236 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 237 | 13. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> <addr3> |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 238 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 239 | Similar to case 12, the difference being that <addr3> is the address |
| 240 | of FDT binary blob that is to be passed to the kernel. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 241 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 242 | Boot method: FDT |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 243 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 244 | :: |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 245 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 246 | 14. bootm [<addr1>]:<subimg1> - [<addr3>]:<subimg3> |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 247 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 248 | Equivalent to case 7: boot kernel stored in <subimg1> from the image |
| 249 | at <addr1>, without initrd, and pass FDT blob <subimg3> from the image at |
| 250 | <addr3>. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 251 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 252 | Boot method: FDT |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 253 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 254 | 15. bootm [<addr1>]:<subimg1> - <addr3> |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 255 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 256 | Similar to case 14, the difference being that <addr3> is the address |
| 257 | of the FDT binary blob that is to be passed to the kernel. |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 258 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 259 | Boot method: FDT |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 260 | |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 261 | |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 262 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 263 | Example |
| 264 | ------- |
Simon Glass | b02ff86 | 2023-06-23 13:22:13 +0100 | [diff] [blame] | 265 | |
| 266 | boot kernel "kernel-1" stored in a new uImage located at 200000:: |
| 267 | |
| 268 | bootm 200000:kernel-1 |
| 269 | |
| 270 | boot configuration "cfg-1" from a new uImage located at 200000:: |
| 271 | |
| 272 | bootm 200000#cfg-1 |
| 273 | |
| 274 | boot configuration "cfg-1" with extra "cfg-2" from a new uImage located |
| 275 | at 200000:: |
| 276 | |
| 277 | bootm 200000#cfg-1#cfg-2 |
| 278 | |
| 279 | boot "kernel-1" from a new uImage at 200000 with initrd "ramdisk-2" found in |
| 280 | some other new uImage stored at address 800000:: |
| 281 | |
| 282 | bootm 200000:kernel-1 800000:ramdisk-2 |
| 283 | |
| 284 | boot "kernel-2" from a new uImage at 200000, with initrd "ramdisk-1" and FDT |
| 285 | "fdt-1", both stored in some other new uImage located at 800000:: |
| 286 | |
| 287 | bootm 200000:kernel-1 800000:ramdisk-1 800000:fdt-1 |
| 288 | |
| 289 | boot kernel "kernel-2" with initrd "ramdisk-2", both stored in a new uImage |
| 290 | at address 200000, with a raw FDT blob stored at address 600000:: |
| 291 | |
| 292 | bootm 200000:kernel-2 200000:ramdisk-2 600000 |
| 293 | |
| 294 | boot kernel "kernel-2" from new uImage at 200000 with FDT "fdt-1" from the |
| 295 | same new uImage:: |
| 296 | |
| 297 | bootm 200000:kernel-2 - 200000:fdt-1 |
| 298 | |
Simon Glass | e940d05 | 2023-06-23 13:22:14 +0100 | [diff] [blame] | 299 | .. sectionauthor:: Bartlomiej Sieka <tur@semihalf.com> |
| 300 | .. sectionauthor:: Simon Glass <sjg@chromium.org> |