bootm.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. bootm command
  3. =============
  4. Synopsis
  5. --------
  6. ::
  7. bootm [fit_addr]#<conf>[#extra-conf]
  8. bootm [[fit_addr]:<os_subimg>] [[<fit_addr2>]:<rd_subimg2>] [[<fit_addr3>]:<fdt_subimg>]
  9. bootm <addr1> [[<addr2> [<addr3>]] # Legacy boot
  10. Description
  11. -----------
  12. The *bootm* command is used to boot an Operating System. It has a large number
  13. of options depending on what needs to be booted.
  14. Note that the second form supports the first and/or second arguments to be
  15. omitted by using a hyphen '-' instead.
  16. fit_addr / fit_addr2 / fit_addr3
  17. address of FIT to boot, defaults to CONFIG_SYS_LOAD_ADDR. See notes below.
  18. conf
  19. configuration unit to boot (must be preceded by hash '#')
  20. extra-conf
  21. extra configuration to boot. This is supported only for additional
  22. devicetree overlays to apply on the base device tree supplied by the first
  23. configuration unit.
  24. os_subimg
  25. OS sub-image to boot (must be preceded by colon ':')
  26. rd_subimg
  27. ramdisk sub-image to boot. Use a hyphen '-' if there is no ramdisk but an
  28. FDT is needed.
  29. fdt_subimg
  30. FDT sub-image to boot
  31. See below for legacy boot. Booting using :doc:`../fit/index` is recommended.
  32. Note on current image address
  33. -----------------------------
  34. When bootm is called without arguments, the image at current image address is
  35. booted. The current image address is the address set most recently by a load
  36. command, etc, and is by default equal to CONFIG_SYS_LOAD_ADDR. For example,
  37. consider the following commands::
  38. tftp 200000 /tftpboot/kernel
  39. bootm
  40. # Last command is equivalent to:
  41. # bootm 200000
  42. As shown above, with FIT the address portion of any argument
  43. can be omitted. If <addr3> is omitted, then it is assumed that image at
  44. <addr2> should be used. Similarly, when <addr2> is omitted, it is assumed that
  45. image at <addr1> should be used. If <addr1> is omitted, it is assumed that the
  46. current image address is to be used. For example, consider the following
  47. commands::
  48. tftp 200000 /tftpboot/uImage
  49. bootm :kernel-1
  50. # Last command is equivalent to:
  51. # bootm 200000:kernel-1
  52. tftp 200000 /tftpboot/uImage
  53. bootm 400000:kernel-1 :ramdisk-1
  54. # Last command is equivalent to:
  55. # bootm 400000:kernel-1 400000:ramdisk-1
  56. tftp 200000 /tftpboot/uImage
  57. bootm :kernel-1 400000:ramdisk-1 :fdt-1
  58. # Last command is equivalent to:
  59. # bootm 200000:kernel-1 400000:ramdisk-1 400000:fdt-1
  60. Legacy boot
  61. -----------
  62. U-Boot supports a legacy image format, enabled by `CONFIG_LEGACY_IMAGE_FORMAT`.
  63. This is not recommended as it is quite limited and insecure. Use
  64. :doc:`../fit/index` instead. It is documented here for old boards which still
  65. use it.
  66. Arguments are:
  67. addr1
  68. address of legacy image to boot. If the image includes a second component
  69. (ramdisk) it is used as well, unless the second parameter is hyphen '-'.
  70. addr2
  71. address of legacy image to use as ramdisk
  72. addr3
  73. address of legacy image to use as FDT
  74. Example syntax
  75. --------------
  76. This section provides various examples of possible usage::
  77. 1. bootm /* boot image at the current address, equivalent to 2,3,8 */
  78. This is equivalent to cases 2, 3 or 8, depending on the type of image at
  79. the current image address.
  80. Boot method: see cases 2,3,8
  81. Legacy uImage syntax
  82. ~~~~~~~~~~~~~~~~~~~~
  83. ::
  84. 2. bootm <addr1> /* single image at <addr1> */
  85. Boot kernel image located at <addr1>.
  86. Boot method: non-FDT
  87. ::
  88. 3. bootm <addr1> /* multi-image at <addr1> */
  89. First and second components of the image at <addr1> are assumed to be a
  90. kernel and a ramdisk, respectively. The kernel is booted with initrd loaded
  91. with the ramdisk from the image.
  92. Boot method: depends on the number of components at <addr1>, and on whether
  93. U-Boot is compiled with OF support, which it should be.
  94. ==================== ======================== ========================
  95. Configuration 2 components 3 components
  96. (kernel, initrd) (kernel, initrd, fdt)
  97. ==================== ======================== ========================
  98. #ifdef CONFIG_OF_* non-FDT FDT
  99. #ifndef CONFIG_OF_* non-FDT non-FDT
  100. ==================== ======================== ========================
  101. ::
  102. 4. bootm <addr1> - /* multi-image at <addr1> */
  103. Similar to case 3, but the kernel is booted without initrd. Second
  104. component of the multi-image is irrelevant (it can be a dummy, 1-byte file).
  105. Boot method: see case 3
  106. ::
  107. 5. bootm <addr1> <addr2> /* single image at <addr1> */
  108. Boot kernel image located at <addr1> with initrd loaded with ramdisk
  109. from the image at <addr2>.
  110. Boot method: non-FDT
  111. ::
  112. 6. bootm <addr1> <addr2> <addr3> /* single image at <addr1> */
  113. <addr1> is the address of a kernel image, <addr2> is the address of a
  114. ramdisk image, and <addr3> is the address of a FDT binary blob. Kernel is
  115. booted with initrd loaded with ramdisk from the image at <addr2>.
  116. Boot method: FDT
  117. ::
  118. 7. bootm <addr1> - <addr3> /* single image at <addr1> */
  119. <addr1> is the address of a kernel image and <addr3> is the address of
  120. a FDT binary blob. Kernel is booted without initrd.
  121. Boot method: FDT
  122. FIT syntax
  123. ~~~~~~~~~~
  124. ::
  125. 8. bootm <addr1>
  126. Image at <addr1> is assumed to contain a default configuration, which
  127. is booted.
  128. Boot method: FDT or non-FDT, depending on whether the default configuration
  129. defines FDT
  130. ::
  131. 9. bootm [<addr1>]:<subimg1>
  132. Similar to case 2: boot kernel stored in <subimg1> from the image at
  133. address <addr1>.
  134. Boot method: non-FDT
  135. ::
  136. 10. bootm [<addr1>]#<conf>[#<extra-conf[#...]]
  137. Boot configuration <conf> from the image at <addr1>.
  138. Boot method: FDT or non-FDT, depending on whether the configuration given
  139. defines FDT
  140. ::
  141. 11. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2>
  142. Equivalent to case 5: boot kernel stored in <subimg1> from the image
  143. at <addr1> with initrd loaded with ramdisk <subimg2> from the image at
  144. <addr2>.
  145. Boot method: non-FDT
  146. ::
  147. 12. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> [<addr3>]:<subimg3>
  148. Equivalent to case 6: boot kernel stored in <subimg1> from the image
  149. at <addr1> with initrd loaded with ramdisk <subimg2> from the image at
  150. <addr2>, and pass FDT blob <subimg3> from the image at <addr3>.
  151. Boot method: FDT
  152. ::
  153. 13. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> <addr3>
  154. Similar to case 12, the difference being that <addr3> is the address
  155. of FDT binary blob that is to be passed to the kernel.
  156. Boot method: FDT
  157. ::
  158. 14. bootm [<addr1>]:<subimg1> - [<addr3>]:<subimg3>
  159. Equivalent to case 7: boot kernel stored in <subimg1> from the image
  160. at <addr1>, without initrd, and pass FDT blob <subimg3> from the image at
  161. <addr3>.
  162. Boot method: FDT
  163. 15. bootm [<addr1>]:<subimg1> - <addr3>
  164. Similar to case 14, the difference being that <addr3> is the address
  165. of the FDT binary blob that is to be passed to the kernel.
  166. Boot method: FDT
  167. Example
  168. -------
  169. boot kernel "kernel-1" stored in a new uImage located at 200000::
  170. bootm 200000:kernel-1
  171. boot configuration "cfg-1" from a new uImage located at 200000::
  172. bootm 200000#cfg-1
  173. boot configuration "cfg-1" with extra "cfg-2" from a new uImage located
  174. at 200000::
  175. bootm 200000#cfg-1#cfg-2
  176. boot "kernel-1" from a new uImage at 200000 with initrd "ramdisk-2" found in
  177. some other new uImage stored at address 800000::
  178. bootm 200000:kernel-1 800000:ramdisk-2
  179. boot "kernel-2" from a new uImage at 200000, with initrd "ramdisk-1" and FDT
  180. "fdt-1", both stored in some other new uImage located at 800000::
  181. bootm 200000:kernel-1 800000:ramdisk-1 800000:fdt-1
  182. boot kernel "kernel-2" with initrd "ramdisk-2", both stored in a new uImage
  183. at address 200000, with a raw FDT blob stored at address 600000::
  184. bootm 200000:kernel-2 200000:ramdisk-2 600000
  185. boot kernel "kernel-2" from new uImage at 200000 with FDT "fdt-1" from the
  186. same new uImage::
  187. bootm 200000:kernel-2 - 200000:fdt-1
  188. .. sectionauthor:: Bartlomiej Sieka <tur@semihalf.com>
  189. .. sectionauthor:: Simon Glass <sjg@chromium.org>