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