blob: a7e5f6ce69abea862713478c9350eb8b1dfbfdd2 [file] [log] [blame]
Simon Glassd1b6b112023-06-23 13:22:13 +01001.. SPDX-License-Identifier: GPL-2.0+
2
Simon Glass35ed5992023-06-23 13:22:14 +01003bootm command
4=============
Simon Glassd1b6b112023-06-23 13:22:13 +01005
Simon Glass35ed5992023-06-23 13:22:14 +01006Synopsis
7--------
Simon Glassd1b6b112023-06-23 13:22:13 +01008
Simon Glass35ed5992023-06-23 13:22:14 +01009::
10
11 bootm [fit_addr]#<conf>[#extra-conf]
12 bootm [[fit_addr]:<os_subimg>] [[<fit_addr2>]:<rd_subimg2>] [[<fit_addr3>]:<fdt_subimg>]
13
14 bootm <addr1> [[<addr2> [<addr3>]] # Legacy boot
15
16Description
17-----------
18
19The *bootm* command is used to boot an Operating System. It has a large number
20of options depending on what needs to be booted.
21
22Note that the second form supports the first and/or second arguments to be
23omitted by using a hyphen '-' instead.
24
25fit_addr / fit_addr2 / fit_addr3
26 address of FIT to boot, defaults to CONFIG_SYS_LOAD_ADDR. See notes below.
27
28conf
29 configuration unit to boot (must be preceded by hash '#')
30
31extra-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.
35
36os_subimg
37 OS sub-image to boot (must be preceded by colon ':')
38
39rd_subimg
40 ramdisk sub-image to boot. Use a hyphen '-' if there is no ramdisk but an
41 FDT is needed.
42
43fdt_subimg
44 FDT sub-image to boot
45
46See below for legacy boot. Booting using :doc:`../fit/index` is recommended.
47
48Note on current image address
49-----------------------------
50
51When bootm is called without arguments, the image at current image address is
52booted. The current image address is the address set most recently by a load
53command, etc, and is by default equal to CONFIG_SYS_LOAD_ADDR. For example,
54consider the following commands::
55
56 tftp 200000 /tftpboot/kernel
57 bootm
58 # Last command is equivalent to:
59 # bootm 200000
60
61As shown above, with FIT the address portion of any argument
62can 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
64image at <addr1> should be used. If <addr1> is omitted, it is assumed that the
65current image address is to be used. For example, consider the following
66commands::
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
Simon Glassd1b6b112023-06-23 13:22:13 +010082
83
Simon Glass35ed5992023-06-23 13:22:14 +010084Legacy boot
85-----------
Simon Glassd1b6b112023-06-23 13:22:13 +010086
Simon Glass35ed5992023-06-23 13:22:14 +010087U-Boot supports a legacy image format, enabled by `CONFIG_LEGACY_IMAGE_FORMAT`.
88This 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
90use it.
Simon Glassd1b6b112023-06-23 13:22:13 +010091
Simon Glass35ed5992023-06-23 13:22:14 +010092Arguments are:
Simon Glassd1b6b112023-06-23 13:22:13 +010093
Simon Glass35ed5992023-06-23 13:22:14 +010094addr1
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 '-'.
Simon Glassd1b6b112023-06-23 13:22:13 +010097
Simon Glass35ed5992023-06-23 13:22:14 +010098addr2
99 address of legacy image to use as ramdisk
Simon Glassd1b6b112023-06-23 13:22:13 +0100100
Simon Glass35ed5992023-06-23 13:22:14 +0100101addr3
102 address of legacy image to use as FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100103
Simon Glassd1b6b112023-06-23 13:22:13 +0100104
Simon Glass35ed5992023-06-23 13:22:14 +0100105Example syntax
106--------------
Simon Glassd1b6b112023-06-23 13:22:13 +0100107
Simon Glass35ed5992023-06-23 13:22:14 +0100108This section provides various examples of possible usage::
109
110 1. bootm /* boot image at the current address, equivalent to 2,3,8 */
111
112This is equivalent to cases 2, 3 or 8, depending on the type of image at
Simon Glassd1b6b112023-06-23 13:22:13 +0100113the current image address.
114
Simon Glass35ed5992023-06-23 13:22:14 +0100115Boot method: see cases 2,3,8
Simon Glassd1b6b112023-06-23 13:22:13 +0100116
Simon Glass35ed5992023-06-23 13:22:14 +0100117Legacy uImage syntax
118~~~~~~~~~~~~~~~~~~~~
Simon Glassd1b6b112023-06-23 13:22:13 +0100119
Simon Glass35ed5992023-06-23 13:22:14 +0100120::
Simon Glassd1b6b112023-06-23 13:22:13 +0100121
Simon Glass35ed5992023-06-23 13:22:14 +0100122 2. bootm <addr1> /* single image at <addr1> */
123
124Boot kernel image located at <addr1>.
125
126Boot method: non-FDT
127
128::
129
130 3. bootm <addr1> /* multi-image at <addr1> */
131
132First and second components of the image at <addr1> are assumed to be a
Simon Glassd1b6b112023-06-23 13:22:13 +0100133kernel and a ramdisk, respectively. The kernel is booted with initrd loaded
134with the ramdisk from the image.
135
Simon Glass35ed5992023-06-23 13:22:14 +0100136Boot method: depends on the number of components at <addr1>, and on whether
137U-Boot is compiled with OF support, which it should be.
Simon Glassd1b6b112023-06-23 13:22:13 +0100138
Simon Glass35ed5992023-06-23 13:22:14 +0100139 ==================== ======================== ========================
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 Glassd1b6b112023-06-23 13:22:13 +0100146
Simon Glass35ed5992023-06-23 13:22:14 +0100147::
148
149 4. bootm <addr1> - /* multi-image at <addr1> */
150
151Similar to case 3, but the kernel is booted without initrd. Second
Simon Glassd1b6b112023-06-23 13:22:13 +0100152component of the multi-image is irrelevant (it can be a dummy, 1-byte file).
153
Simon Glass35ed5992023-06-23 13:22:14 +0100154Boot method: see case 3
Simon Glassd1b6b112023-06-23 13:22:13 +0100155
Simon Glass35ed5992023-06-23 13:22:14 +0100156::
157
158 5. bootm <addr1> <addr2> /* single image at <addr1> */
159
160Boot kernel image located at <addr1> with initrd loaded with ramdisk
Simon Glassd1b6b112023-06-23 13:22:13 +0100161from the image at <addr2>.
162
Simon Glass35ed5992023-06-23 13:22:14 +0100163Boot method: non-FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100164
Simon Glass35ed5992023-06-23 13:22:14 +0100165::
166
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 Glassd1b6b112023-06-23 13:22:13 +0100170ramdisk image, and <addr3> is the address of a FDT binary blob. Kernel is
171booted with initrd loaded with ramdisk from the image at <addr2>.
172
Simon Glass35ed5992023-06-23 13:22:14 +0100173Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100174
Simon Glass35ed5992023-06-23 13:22:14 +0100175::
176
177 7. bootm <addr1> - <addr3> /* single image at <addr1> */
178
179<addr1> is the address of a kernel image and <addr3> is the address of
Simon Glassd1b6b112023-06-23 13:22:13 +0100180a FDT binary blob. Kernel is booted without initrd.
181
Simon Glass35ed5992023-06-23 13:22:14 +0100182Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100183
Simon Glass35ed5992023-06-23 13:22:14 +0100184FIT syntax
185~~~~~~~~~~
186
187::
188
189 8. bootm <addr1>
190
191Image at <addr1> is assumed to contain a default configuration, which
Simon Glassd1b6b112023-06-23 13:22:13 +0100192is booted.
193
Simon Glass35ed5992023-06-23 13:22:14 +0100194Boot method: FDT or non-FDT, depending on whether the default configuration
195defines FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100196
Simon Glass35ed5992023-06-23 13:22:14 +0100197::
198
199 9. bootm [<addr1>]:<subimg1>
200
201Similar to case 2: boot kernel stored in <subimg1> from the image at
Simon Glassd1b6b112023-06-23 13:22:13 +0100202address <addr1>.
203
Simon Glass35ed5992023-06-23 13:22:14 +0100204Boot method: non-FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100205
Simon Glass35ed5992023-06-23 13:22:14 +0100206::
Simon Glassd1b6b112023-06-23 13:22:13 +0100207
Simon Glass35ed5992023-06-23 13:22:14 +0100208 10. bootm [<addr1>]#<conf>[#<extra-conf[#...]]
Simon Glassd1b6b112023-06-23 13:22:13 +0100209
Simon Glass35ed5992023-06-23 13:22:14 +0100210Boot configuration <conf> from the image at <addr1>.
211
212Boot method: FDT or non-FDT, depending on whether the configuration given
213defines FDT
214
215::
216
217 11. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2>
218
219Equivalent to case 5: boot kernel stored in <subimg1> from the image
Simon Glassd1b6b112023-06-23 13:22:13 +0100220at <addr1> with initrd loaded with ramdisk <subimg2> from the image at
221<addr2>.
222
Simon Glass35ed5992023-06-23 13:22:14 +0100223Boot method: non-FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100224
Simon Glass35ed5992023-06-23 13:22:14 +0100225::
226
227 12. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> [<addr3>]:<subimg3>
228
229Equivalent to case 6: boot kernel stored in <subimg1> from the image
Simon Glassd1b6b112023-06-23 13:22:13 +0100230at <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 Glass35ed5992023-06-23 13:22:14 +0100233Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100234
Simon Glass35ed5992023-06-23 13:22:14 +0100235::
236
237 13. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> <addr3>
238
239Similar to case 12, the difference being that <addr3> is the address
Simon Glassd1b6b112023-06-23 13:22:13 +0100240of FDT binary blob that is to be passed to the kernel.
241
Simon Glass35ed5992023-06-23 13:22:14 +0100242Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100243
Simon Glass35ed5992023-06-23 13:22:14 +0100244::
245
246 14. bootm [<addr1>]:<subimg1> - [<addr3>]:<subimg3>
247
248Equivalent to case 7: boot kernel stored in <subimg1> from the image
Simon Glassd1b6b112023-06-23 13:22:13 +0100249at <addr1>, without initrd, and pass FDT blob <subimg3> from the image at
250<addr3>.
251
Simon Glass35ed5992023-06-23 13:22:14 +0100252Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100253
Simon Glass35ed5992023-06-23 13:22:14 +0100254 15. bootm [<addr1>]:<subimg1> - <addr3>
255
256Similar to case 14, the difference being that <addr3> is the address
Simon Glassd1b6b112023-06-23 13:22:13 +0100257of the FDT binary blob that is to be passed to the kernel.
258
Simon Glass35ed5992023-06-23 13:22:14 +0100259Boot method: FDT
Simon Glassd1b6b112023-06-23 13:22:13 +0100260
261
Simon Glassd1b6b112023-06-23 13:22:13 +0100262
Simon Glass35ed5992023-06-23 13:22:14 +0100263Example
264-------
Simon Glassd1b6b112023-06-23 13:22:13 +0100265
266boot kernel "kernel-1" stored in a new uImage located at 200000::
267
268 bootm 200000:kernel-1
269
270boot configuration "cfg-1" from a new uImage located at 200000::
271
272 bootm 200000#cfg-1
273
274boot configuration "cfg-1" with extra "cfg-2" from a new uImage located
275at 200000::
276
277 bootm 200000#cfg-1#cfg-2
278
279boot "kernel-1" from a new uImage at 200000 with initrd "ramdisk-2" found in
280some other new uImage stored at address 800000::
281
282 bootm 200000:kernel-1 800000:ramdisk-2
283
284boot "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
289boot kernel "kernel-2" with initrd "ramdisk-2", both stored in a new uImage
290at address 200000, with a raw FDT blob stored at address 600000::
291
292 bootm 200000:kernel-2 200000:ramdisk-2 600000
293
294boot kernel "kernel-2" from new uImage at 200000 with FDT "fdt-1" from the
295same new uImage::
296
297 bootm 200000:kernel-2 - 200000:fdt-1
298
Simon Glass35ed5992023-06-23 13:22:14 +0100299.. sectionauthor:: Bartlomiej Sieka <tur@semihalf.com>
300.. sectionauthor:: Simon Glass <sjg@chromium.org>