blob: e409ebc193b308cd8e186fff741f63fb138a1ba2 [file] [log] [blame]
Simon Glassd1b6b112023-06-23 13:22:13 +01001.. SPDX-License-Identifier: GPL-2.0+
2
Heinrich Schuchardt60971e62024-01-14 14:53:13 +01003.. index::
4 single: bootm (command)
5
Simon Glass35ed5992023-06-23 13:22:14 +01006bootm command
7=============
Simon Glassd1b6b112023-06-23 13:22:13 +01008
Simon Glass35ed5992023-06-23 13:22:14 +01009Synopsis
10--------
Simon Glassd1b6b112023-06-23 13:22:13 +010011
Simon Glass35ed5992023-06-23 13:22:14 +010012::
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
Simon Glassd1b6b112023-06-23 13:22:13 +010085
86
Simon Glass35ed5992023-06-23 13:22:14 +010087Legacy boot
88-----------
Simon Glassd1b6b112023-06-23 13:22:13 +010089
Simon Glass35ed5992023-06-23 13:22:14 +010090U-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.
Simon Glassd1b6b112023-06-23 13:22:13 +010094
Simon Glass35ed5992023-06-23 13:22:14 +010095Arguments are:
Simon Glassd1b6b112023-06-23 13:22:13 +010096
Simon Glass35ed5992023-06-23 13:22:14 +010097addr1
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 '-'.
Simon Glassd1b6b112023-06-23 13:22:13 +0100100
Simon Glass35ed5992023-06-23 13:22:14 +0100101addr2
102 address of legacy image to use as ramdisk
Simon Glassd1b6b112023-06-23 13:22:13 +0100103
Simon Glass35ed5992023-06-23 13:22:14 +0100104addr3
105 address of legacy image to use as FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100106
Simon Glassd1b6b112023-06-23 13:22:13 +0100107
Simon Glass35ed5992023-06-23 13:22:14 +0100108Example syntax
109--------------
Simon Glassd1b6b112023-06-23 13:22:13 +0100110
Simon Glass35ed5992023-06-23 13:22:14 +0100111This 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
Simon Glassd1b6b112023-06-23 13:22:13 +0100116the current image address.
117
Simon Glass35ed5992023-06-23 13:22:14 +0100118Boot method: see cases 2,3,8
Simon Glassd1b6b112023-06-23 13:22:13 +0100119
Simon Glass35ed5992023-06-23 13:22:14 +0100120Legacy uImage syntax
121~~~~~~~~~~~~~~~~~~~~
Simon Glassd1b6b112023-06-23 13:22:13 +0100122
Simon Glass35ed5992023-06-23 13:22:14 +0100123::
Simon Glassd1b6b112023-06-23 13:22:13 +0100124
Simon Glass35ed5992023-06-23 13:22:14 +0100125 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
Simon Glassd1b6b112023-06-23 13:22:13 +0100136kernel and a ramdisk, respectively. The kernel is booted with initrd loaded
137with the ramdisk from the image.
138
Simon Glass35ed5992023-06-23 13:22:14 +0100139Boot method: depends on the number of components at <addr1>, and on whether
140U-Boot is compiled with OF support, which it should be.
Simon Glassd1b6b112023-06-23 13:22:13 +0100141
Simon Glass35ed5992023-06-23 13:22:14 +0100142 ==================== ======================== ========================
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 Glassd1b6b112023-06-23 13:22:13 +0100149
Simon Glass35ed5992023-06-23 13:22:14 +0100150::
151
152 4. bootm <addr1> - /* multi-image at <addr1> */
153
154Similar to case 3, but the kernel is booted without initrd. Second
Simon Glassd1b6b112023-06-23 13:22:13 +0100155component of the multi-image is irrelevant (it can be a dummy, 1-byte file).
156
Simon Glass35ed5992023-06-23 13:22:14 +0100157Boot method: see case 3
Simon Glassd1b6b112023-06-23 13:22:13 +0100158
Simon Glass35ed5992023-06-23 13:22:14 +0100159::
160
161 5. bootm <addr1> <addr2> /* single image at <addr1> */
162
163Boot kernel image located at <addr1> with initrd loaded with ramdisk
Simon Glassd1b6b112023-06-23 13:22:13 +0100164from the image at <addr2>.
165
Simon Glass35ed5992023-06-23 13:22:14 +0100166Boot method: non-FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100167
Simon Glass35ed5992023-06-23 13:22:14 +0100168::
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
Simon Glassd1b6b112023-06-23 13:22:13 +0100173ramdisk 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
Simon Glass35ed5992023-06-23 13:22:14 +0100176Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100177
Simon Glass35ed5992023-06-23 13:22:14 +0100178::
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
Simon Glassd1b6b112023-06-23 13:22:13 +0100183a FDT binary blob. Kernel is booted without initrd.
184
Simon Glass35ed5992023-06-23 13:22:14 +0100185Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100186
Simon Glass35ed5992023-06-23 13:22:14 +0100187FIT syntax
188~~~~~~~~~~
189
190::
191
192 8. bootm <addr1>
193
194Image at <addr1> is assumed to contain a default configuration, which
Simon Glassd1b6b112023-06-23 13:22:13 +0100195is booted.
196
Simon Glass35ed5992023-06-23 13:22:14 +0100197Boot method: FDT or non-FDT, depending on whether the default configuration
198defines FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100199
Simon Glass35ed5992023-06-23 13:22:14 +0100200::
201
202 9. bootm [<addr1>]:<subimg1>
203
204Similar to case 2: boot kernel stored in <subimg1> from the image at
Simon Glassd1b6b112023-06-23 13:22:13 +0100205address <addr1>.
206
Simon Glass35ed5992023-06-23 13:22:14 +0100207Boot method: non-FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100208
Simon Glass35ed5992023-06-23 13:22:14 +0100209::
Simon Glassd1b6b112023-06-23 13:22:13 +0100210
Simon Glass35ed5992023-06-23 13:22:14 +0100211 10. bootm [<addr1>]#<conf>[#<extra-conf[#...]]
Simon Glassd1b6b112023-06-23 13:22:13 +0100212
Simon Glass35ed5992023-06-23 13:22:14 +0100213Boot 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
Simon Glassd1b6b112023-06-23 13:22:13 +0100223at <addr1> with initrd loaded with ramdisk <subimg2> from the image at
224<addr2>.
225
Simon Glass35ed5992023-06-23 13:22:14 +0100226Boot method: non-FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100227
Simon Glass35ed5992023-06-23 13:22:14 +0100228::
229
230 12. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> [<addr3>]:<subimg3>
231
232Equivalent to case 6: boot kernel stored in <subimg1> from the image
Simon Glassd1b6b112023-06-23 13:22:13 +0100233at <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 Glass35ed5992023-06-23 13:22:14 +0100236Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100237
Simon Glass35ed5992023-06-23 13:22:14 +0100238::
239
240 13. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> <addr3>
241
242Similar to case 12, the difference being that <addr3> is the address
Simon Glassd1b6b112023-06-23 13:22:13 +0100243of FDT binary blob that is to be passed to the kernel.
244
Simon Glass35ed5992023-06-23 13:22:14 +0100245Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100246
Simon Glass35ed5992023-06-23 13:22:14 +0100247::
248
249 14. bootm [<addr1>]:<subimg1> - [<addr3>]:<subimg3>
250
251Equivalent to case 7: boot kernel stored in <subimg1> from the image
Simon Glassd1b6b112023-06-23 13:22:13 +0100252at <addr1>, without initrd, and pass FDT blob <subimg3> from the image at
253<addr3>.
254
Simon Glass35ed5992023-06-23 13:22:14 +0100255Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100256
Simon Glass35ed5992023-06-23 13:22:14 +0100257 15. bootm [<addr1>]:<subimg1> - <addr3>
258
259Similar to case 14, the difference being that <addr3> is the address
Simon Glassd1b6b112023-06-23 13:22:13 +0100260of the FDT binary blob that is to be passed to the kernel.
261
Simon Glass35ed5992023-06-23 13:22:14 +0100262Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100263
264
Simon Glassd1b6b112023-06-23 13:22:13 +0100265
Simon Glass35ed5992023-06-23 13:22:14 +0100266Example
267-------
Simon Glassd1b6b112023-06-23 13:22:13 +0100268
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
Simon Glass35ed5992023-06-23 13:22:14 +0100302.. sectionauthor:: Bartlomiej Sieka <tur@semihalf.com>
303.. sectionauthor:: Simon Glass <sjg@chromium.org>