blob: e409ebc193b308cd8e186fff741f63fb138a1ba2 [file] [log] [blame]
Simon Glassb02ff862023-06-23 13:22:13 +01001.. SPDX-License-Identifier: GPL-2.0+
2
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01003.. index::
4 single: bootm (command)
5
Simon Glasse940d052023-06-23 13:22:14 +01006bootm command
7=============
Simon Glassb02ff862023-06-23 13:22:13 +01008
Simon Glasse940d052023-06-23 13:22:14 +01009Synopsis
10--------
Simon Glassb02ff862023-06-23 13:22:13 +010011
Simon Glasse940d052023-06-23 13:22:14 +010012::
Simon Glassb02ff862023-06-23 13:22:13 +010013
Simon Glasse940d052023-06-23 13:22:14 +010014 bootm [fit_addr]#<conf>[#extra-conf]
15 bootm [[fit_addr]:<os_subimg>] [[<fit_addr2>]:<rd_subimg2>] [[<fit_addr3>]:<fdt_subimg>]
Simon Glassb02ff862023-06-23 13:22:13 +010016
Simon Glasse940d052023-06-23 13:22:14 +010017 bootm <addr1> [[<addr2> [<addr3>]] # Legacy boot
Simon Glassb02ff862023-06-23 13:22:13 +010018
Simon Glasse940d052023-06-23 13:22:14 +010019Description
20-----------
Simon Glassb02ff862023-06-23 13:22:13 +010021
Simon Glasse940d052023-06-23 13:22:14 +010022The *bootm* command is used to boot an Operating System. It has a large number
23of options depending on what needs to be booted.
Simon Glassb02ff862023-06-23 13:22:13 +010024
Simon Glasse940d052023-06-23 13:22:14 +010025Note that the second form supports the first and/or second arguments to be
26omitted by using a hyphen '-' instead.
Simon Glassb02ff862023-06-23 13:22:13 +010027
Simon Glasse940d052023-06-23 13:22:14 +010028fit_addr / fit_addr2 / fit_addr3
29 address of FIT to boot, defaults to CONFIG_SYS_LOAD_ADDR. See notes below.
Simon Glassb02ff862023-06-23 13:22:13 +010030
Simon Glasse940d052023-06-23 13:22:14 +010031conf
32 configuration unit to boot (must be preceded by hash '#')
Simon Glassb02ff862023-06-23 13:22:13 +010033
Simon Glasse940d052023-06-23 13:22:14 +010034extra-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 Glassb02ff862023-06-23 13:22:13 +010038
Simon Glasse940d052023-06-23 13:22:14 +010039os_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
Simon Glassb02ff862023-06-23 13:22:13 +0100103
Simon Glasse940d052023-06-23 13:22:14 +0100104addr3
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
Simon Glassb02ff862023-06-23 13:22:13 +0100116the current image address.
117
Simon Glasse940d052023-06-23 13:22:14 +0100118Boot method: see cases 2,3,8
119
120Legacy uImage syntax
121~~~~~~~~~~~~~~~~~~~~
Simon Glassb02ff862023-06-23 13:22:13 +0100122
Simon Glasse940d052023-06-23 13:22:14 +0100123::
Simon Glassb02ff862023-06-23 13:22:13 +0100124
Simon Glasse940d052023-06-23 13:22:14 +0100125 2. bootm <addr1> /* single image at <addr1> */
126
127Boot kernel image located at <addr1>.
Simon Glassb02ff862023-06-23 13:22:13 +0100128
Simon Glasse940d052023-06-23 13:22:14 +0100129Boot 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 Glassb02ff862023-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 Glasse940d052023-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 Glassb02ff862023-06-23 13:22:13 +0100141
Simon Glasse940d052023-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 Glassb02ff862023-06-23 13:22:13 +0100149
Simon Glasse940d052023-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 Glassb02ff862023-06-23 13:22:13 +0100155component of the multi-image is irrelevant (it can be a dummy, 1-byte file).
156
Simon Glasse940d052023-06-23 13:22:14 +0100157Boot method: see case 3
Simon Glassb02ff862023-06-23 13:22:13 +0100158
Simon Glasse940d052023-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 Glassb02ff862023-06-23 13:22:13 +0100164from the image at <addr2>.
165
Simon Glasse940d052023-06-23 13:22:14 +0100166Boot method: non-FDT
167
168::
Simon Glassb02ff862023-06-23 13:22:13 +0100169
Simon Glasse940d052023-06-23 13:22:14 +0100170 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 Glassb02ff862023-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 Glasse940d052023-06-23 13:22:14 +0100176Boot method: FDT
177
178::
179
180 7. bootm <addr1> - <addr3> /* single image at <addr1> */
Simon Glassb02ff862023-06-23 13:22:13 +0100181
Simon Glasse940d052023-06-23 13:22:14 +0100182<addr1> is the address of a kernel image and <addr3> is the address of
Simon Glassb02ff862023-06-23 13:22:13 +0100183a FDT binary blob. Kernel is booted without initrd.
184
Simon Glasse940d052023-06-23 13:22:14 +0100185Boot method: FDT
186
187FIT syntax
188~~~~~~~~~~
189
190::
191
192 8. bootm <addr1>
Simon Glassb02ff862023-06-23 13:22:13 +0100193
Simon Glasse940d052023-06-23 13:22:14 +0100194Image at <addr1> is assumed to contain a default configuration, which
Simon Glassb02ff862023-06-23 13:22:13 +0100195is booted.
196
Simon Glasse940d052023-06-23 13:22:14 +0100197Boot method: FDT or non-FDT, depending on whether the default configuration
198defines FDT
199
200::
Simon Glassb02ff862023-06-23 13:22:13 +0100201
Simon Glasse940d052023-06-23 13:22:14 +0100202 9. bootm [<addr1>]:<subimg1>
203
204Similar to case 2: boot kernel stored in <subimg1> from the image at
Simon Glassb02ff862023-06-23 13:22:13 +0100205address <addr1>.
206
Simon Glasse940d052023-06-23 13:22:14 +0100207Boot method: non-FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100208
Simon Glasse940d052023-06-23 13:22:14 +0100209::
Simon Glassb02ff862023-06-23 13:22:13 +0100210
Simon Glasse940d052023-06-23 13:22:14 +0100211 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::
Simon Glassb02ff862023-06-23 13:22:13 +0100219
Simon Glasse940d052023-06-23 13:22:14 +0100220 11. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2>
221
222Equivalent to case 5: boot kernel stored in <subimg1> from the image
Simon Glassb02ff862023-06-23 13:22:13 +0100223at <addr1> with initrd loaded with ramdisk <subimg2> from the image at
224<addr2>.
225
Simon Glasse940d052023-06-23 13:22:14 +0100226Boot method: non-FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100227
Simon Glasse940d052023-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 Glassb02ff862023-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 Glasse940d052023-06-23 13:22:14 +0100236Boot method: FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100237
Simon Glasse940d052023-06-23 13:22:14 +0100238::
Simon Glassb02ff862023-06-23 13:22:13 +0100239
Simon Glasse940d052023-06-23 13:22:14 +0100240 13. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> <addr3>
Simon Glassb02ff862023-06-23 13:22:13 +0100241
Simon Glasse940d052023-06-23 13:22:14 +0100242Similar to case 12, the difference being that <addr3> is the address
243of FDT binary blob that is to be passed to the kernel.
Simon Glassb02ff862023-06-23 13:22:13 +0100244
Simon Glasse940d052023-06-23 13:22:14 +0100245Boot method: FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100246
Simon Glasse940d052023-06-23 13:22:14 +0100247::
Simon Glassb02ff862023-06-23 13:22:13 +0100248
Simon Glasse940d052023-06-23 13:22:14 +0100249 14. bootm [<addr1>]:<subimg1> - [<addr3>]:<subimg3>
Simon Glassb02ff862023-06-23 13:22:13 +0100250
Simon Glasse940d052023-06-23 13:22:14 +0100251Equivalent 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>.
Simon Glassb02ff862023-06-23 13:22:13 +0100254
Simon Glasse940d052023-06-23 13:22:14 +0100255Boot method: FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100256
Simon Glasse940d052023-06-23 13:22:14 +0100257 15. bootm [<addr1>]:<subimg1> - <addr3>
Simon Glassb02ff862023-06-23 13:22:13 +0100258
Simon Glasse940d052023-06-23 13:22:14 +0100259Similar to case 14, the difference being that <addr3> is the address
260of the FDT binary blob that is to be passed to the kernel.
Simon Glassb02ff862023-06-23 13:22:13 +0100261
Simon Glasse940d052023-06-23 13:22:14 +0100262Boot method: FDT
Simon Glassb02ff862023-06-23 13:22:13 +0100263
Simon Glassb02ff862023-06-23 13:22:13 +0100264
Simon Glassb02ff862023-06-23 13:22:13 +0100265
Simon Glasse940d052023-06-23 13:22:14 +0100266Example
267-------
Simon Glassb02ff862023-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 Glasse940d052023-06-23 13:22:14 +0100302.. sectionauthor:: Bartlomiej Sieka <tur@semihalf.com>
303.. sectionauthor:: Simon Glass <sjg@chromium.org>