blob: a7e5f6ce69abea862713478c9350eb8b1dfbfdd2 [file] [log] [blame]
Simon Glassb02ff862023-06-23 13:22:13 +01001.. SPDX-License-Identifier: GPL-2.0+
2
Simon Glasse940d052023-06-23 13:22:14 +01003bootm command
4=============
Simon Glassb02ff862023-06-23 13:22:13 +01005
Simon Glasse940d052023-06-23 13:22:14 +01006Synopsis
7--------
Simon Glassb02ff862023-06-23 13:22:13 +01008
Simon Glasse940d052023-06-23 13:22:14 +01009::
Simon Glassb02ff862023-06-23 13:22:13 +010010
Simon Glasse940d052023-06-23 13:22:14 +010011 bootm [fit_addr]#<conf>[#extra-conf]
12 bootm [[fit_addr]:<os_subimg>] [[<fit_addr2>]:<rd_subimg2>] [[<fit_addr3>]:<fdt_subimg>]
Simon Glassb02ff862023-06-23 13:22:13 +010013
Simon Glasse940d052023-06-23 13:22:14 +010014 bootm <addr1> [[<addr2> [<addr3>]] # Legacy boot
Simon Glassb02ff862023-06-23 13:22:13 +010015
Simon Glasse940d052023-06-23 13:22:14 +010016Description
17-----------
Simon Glassb02ff862023-06-23 13:22:13 +010018
Simon Glasse940d052023-06-23 13:22:14 +010019The *bootm* command is used to boot an Operating System. It has a large number
20of options depending on what needs to be booted.
Simon Glassb02ff862023-06-23 13:22:13 +010021
Simon Glasse940d052023-06-23 13:22:14 +010022Note that the second form supports the first and/or second arguments to be
23omitted by using a hyphen '-' instead.
Simon Glassb02ff862023-06-23 13:22:13 +010024
Simon Glasse940d052023-06-23 13:22:14 +010025fit_addr / fit_addr2 / fit_addr3
26 address of FIT to boot, defaults to CONFIG_SYS_LOAD_ADDR. See notes below.
Simon Glassb02ff862023-06-23 13:22:13 +010027
Simon Glasse940d052023-06-23 13:22:14 +010028conf
29 configuration unit to boot (must be preceded by hash '#')
Simon Glassb02ff862023-06-23 13:22:13 +010030
Simon Glasse940d052023-06-23 13:22:14 +010031extra-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 Glassb02ff862023-06-23 13:22:13 +010035
Simon Glasse940d052023-06-23 13:22:14 +010036os_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
82
83
84Legacy boot
85-----------
86
87U-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.
91
92Arguments are:
93
94addr1
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
98addr2
99 address of legacy image to use as ramdisk
Simon Glassb02ff862023-06-23 13:22:13 +0100100
Simon Glasse940d052023-06-23 13:22:14 +0100101addr3
102 address of legacy image to use as FDT
103
104
105Example syntax
106--------------
107
108This 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 Glassb02ff862023-06-23 13:22:13 +0100113the current image address.
114
Simon Glasse940d052023-06-23 13:22:14 +0100115Boot method: see cases 2,3,8
116
117Legacy uImage syntax
118~~~~~~~~~~~~~~~~~~~~
Simon Glassb02ff862023-06-23 13:22:13 +0100119
Simon Glasse940d052023-06-23 13:22:14 +0100120::
Simon Glassb02ff862023-06-23 13:22:13 +0100121
Simon Glasse940d052023-06-23 13:22:14 +0100122 2. bootm <addr1> /* single image at <addr1> */
123
124Boot kernel image located at <addr1>.
Simon Glassb02ff862023-06-23 13:22:13 +0100125
Simon Glasse940d052023-06-23 13:22:14 +0100126Boot 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 Glassb02ff862023-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 Glasse940d052023-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 Glassb02ff862023-06-23 13:22:13 +0100138
Simon Glasse940d052023-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 Glassb02ff862023-06-23 13:22:13 +0100146
Simon Glasse940d052023-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 Glassb02ff862023-06-23 13:22:13 +0100152component of the multi-image is irrelevant (it can be a dummy, 1-byte file).
153
Simon Glasse940d052023-06-23 13:22:14 +0100154Boot method: see case 3
Simon Glassb02ff862023-06-23 13:22:13 +0100155
Simon Glasse940d052023-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 Glassb02ff862023-06-23 13:22:13 +0100161from the image at <addr2>.
162
Simon Glasse940d052023-06-23 13:22:14 +0100163Boot method: non-FDT
164
165::
Simon Glassb02ff862023-06-23 13:22:13 +0100166
Simon Glasse940d052023-06-23 13:22:14 +0100167 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 Glassb02ff862023-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 Glasse940d052023-06-23 13:22:14 +0100173Boot method: FDT
174
175::
176
177 7. bootm <addr1> - <addr3> /* single image at <addr1> */
Simon Glassb02ff862023-06-23 13:22:13 +0100178
Simon Glasse940d052023-06-23 13:22:14 +0100179<addr1> is the address of a kernel image and <addr3> is the address of
Simon Glassb02ff862023-06-23 13:22:13 +0100180a FDT binary blob. Kernel is booted without initrd.
181
Simon Glasse940d052023-06-23 13:22:14 +0100182Boot method: FDT
183
184FIT syntax
185~~~~~~~~~~
186
187::
188
189 8. bootm <addr1>
Simon Glassb02ff862023-06-23 13:22:13 +0100190
Simon Glasse940d052023-06-23 13:22:14 +0100191Image at <addr1> is assumed to contain a default configuration, which
Simon Glassb02ff862023-06-23 13:22:13 +0100192is booted.
193
Simon Glasse940d052023-06-23 13:22:14 +0100194Boot method: FDT or non-FDT, depending on whether the default configuration
195defines FDT
196
197::
Simon Glassb02ff862023-06-23 13:22:13 +0100198
Simon Glasse940d052023-06-23 13:22:14 +0100199 9. bootm [<addr1>]:<subimg1>
200
201Similar to case 2: boot kernel stored in <subimg1> from the image at
Simon Glassb02ff862023-06-23 13:22:13 +0100202address <addr1>.
203
Simon Glasse940d052023-06-23 13:22:14 +0100204Boot method: non-FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100205
Simon Glasse940d052023-06-23 13:22:14 +0100206::
Simon Glassb02ff862023-06-23 13:22:13 +0100207
Simon Glasse940d052023-06-23 13:22:14 +0100208 10. bootm [<addr1>]#<conf>[#<extra-conf[#...]]
209
210Boot configuration <conf> from the image at <addr1>.
211
212Boot method: FDT or non-FDT, depending on whether the configuration given
213defines FDT
214
215::
Simon Glassb02ff862023-06-23 13:22:13 +0100216
Simon Glasse940d052023-06-23 13:22:14 +0100217 11. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2>
218
219Equivalent to case 5: boot kernel stored in <subimg1> from the image
Simon Glassb02ff862023-06-23 13:22:13 +0100220at <addr1> with initrd loaded with ramdisk <subimg2> from the image at
221<addr2>.
222
Simon Glasse940d052023-06-23 13:22:14 +0100223Boot method: non-FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100224
Simon Glasse940d052023-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 Glassb02ff862023-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 Glasse940d052023-06-23 13:22:14 +0100233Boot method: FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100234
Simon Glasse940d052023-06-23 13:22:14 +0100235::
Simon Glassb02ff862023-06-23 13:22:13 +0100236
Simon Glasse940d052023-06-23 13:22:14 +0100237 13. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> <addr3>
Simon Glassb02ff862023-06-23 13:22:13 +0100238
Simon Glasse940d052023-06-23 13:22:14 +0100239Similar to case 12, the difference being that <addr3> is the address
240of FDT binary blob that is to be passed to the kernel.
Simon Glassb02ff862023-06-23 13:22:13 +0100241
Simon Glasse940d052023-06-23 13:22:14 +0100242Boot method: FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100243
Simon Glasse940d052023-06-23 13:22:14 +0100244::
Simon Glassb02ff862023-06-23 13:22:13 +0100245
Simon Glasse940d052023-06-23 13:22:14 +0100246 14. bootm [<addr1>]:<subimg1> - [<addr3>]:<subimg3>
Simon Glassb02ff862023-06-23 13:22:13 +0100247
Simon Glasse940d052023-06-23 13:22:14 +0100248Equivalent to case 7: boot kernel stored in <subimg1> from the image
249at <addr1>, without initrd, and pass FDT blob <subimg3> from the image at
250<addr3>.
Simon Glassb02ff862023-06-23 13:22:13 +0100251
Simon Glasse940d052023-06-23 13:22:14 +0100252Boot method: FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100253
Simon Glasse940d052023-06-23 13:22:14 +0100254 15. bootm [<addr1>]:<subimg1> - <addr3>
Simon Glassb02ff862023-06-23 13:22:13 +0100255
Simon Glasse940d052023-06-23 13:22:14 +0100256Similar to case 14, the difference being that <addr3> is the address
257of the FDT binary blob that is to be passed to the kernel.
Simon Glassb02ff862023-06-23 13:22:13 +0100258
Simon Glasse940d052023-06-23 13:22:14 +0100259Boot method: FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100260
Simon Glassb02ff862023-06-23 13:22:13 +0100261
Simon Glassb02ff862023-06-23 13:22:13 +0100262
Simon Glasse940d052023-06-23 13:22:14 +0100263Example
264-------
Simon Glassb02ff862023-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 Glasse940d052023-06-23 13:22:14 +0100299.. sectionauthor:: Bartlomiej Sieka <tur@semihalf.com>
300.. sectionauthor:: Simon Glass <sjg@chromium.org>