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