bootdev.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. .. SPDX-License-Identifier: GPL-2.0+:
  2. bootdev command
  3. ===============
  4. Synopis
  5. -------
  6. ::
  7. bootdev list [-p] - list all available bootdevs (-p to probe)
  8. bootdev hunt [-l|<spec>] - use hunt drivers to find bootdevs
  9. bootdev select <bm> - select a bootdev by name
  10. bootdev info [-p] - show information about a bootdev
  11. Description
  12. -----------
  13. The `bootdev` command is used to manage bootdevs. It can list available
  14. bootdevs, select one and obtain information about it.
  15. See :doc:`../../develop/bootstd` for more information about bootdevs in general.
  16. bootdev list
  17. ~~~~~~~~~~~~
  18. This lists available bootdevs
  19. Scanning with `-p` causes the bootdevs to be probed. This happens automatically
  20. when they are used.
  21. The list looks something like this:
  22. === ====== ====== ======== =========================
  23. Seq Probed Status Uclass Name
  24. === ====== ====== ======== =========================
  25. 0 [ + ] OK mmc mmc@7e202000.bootdev
  26. 1 [ ] OK mmc sdhci@7e300000.bootdev
  27. 2 [ ] OK ethernet smsc95xx_eth.bootdev
  28. === ====== ====== ======== =========================
  29. The fields are as follows:
  30. Seq:
  31. Sequence number in the scan, used to reference the bootflow later
  32. Probed:
  33. Shows a plus (+) if the device is probed, empty if not.
  34. Status:
  35. Shows the status of the device. Typically this is `OK` meaning that there is
  36. no error. If you use -p and an error occurs when probing, then this shows
  37. the error number. You can look up Linux error codes to find the meaning of
  38. the number.
  39. Uclass:
  40. Name of the media device's Uclass. This indicates the type of the parent
  41. device (e.g. MMC, Ethernet).
  42. Name:
  43. Name of the bootdev. This is generated from the media device appended
  44. with `.bootdev`
  45. bootdev hunt
  46. ~~~~~~~~~~~~
  47. This hunts for new bootdevs, or shows a list of hunters.
  48. Use `-l` to list the available bootdev hunters.
  49. To run hunters, specify the name of the hunter to run, e.g. "mmc". If no
  50. name is provided, all hunters are run.
  51. bootdev select
  52. ~~~~~~~~~~~~~~~~~
  53. Use this to select a particular bootdev. You can select it by the sequence
  54. number or name, as shown in `bootdev list`.
  55. Once a bootdev is selected, you can use `bootdev info` to look at it or
  56. `bootflow scan` to scan it.
  57. If no bootdev name or number is provided, then any existing bootdev is
  58. unselected.
  59. bootdev info
  60. ~~~~~~~~~~~~~~~
  61. This shows information on the current bootdev, with the format looking like
  62. this:
  63. ========= =======================
  64. Name `mmc@7e202000.bootdev`
  65. Sequence 0
  66. Status Probed
  67. Uclass mmc
  68. Bootflows 1 (1 valid)
  69. ========= =======================
  70. Most of the information is the same as `bootdev list` above. The new fields
  71. are:
  72. Device
  73. Name of the bootdev
  74. Status
  75. Shows `Probed` if the device is probed, `OK` if not. If `-p` is used and the
  76. device fails to probe, an error code is shown.
  77. Bootflows
  78. Indicates the number of bootflows attached to the bootdev. This is 0
  79. unless you have used 'bootflow scan' on the bootflow, or on all bootflows.
  80. Example
  81. -------
  82. This example shows listing available bootdev and getting information about
  83. one of them::
  84. U-Boot> bootdev list
  85. Seq Probed Status Uclass Name
  86. --- ------ ------ -------- ------------------
  87. 0 [ + ] OK mmc mmc@7e202000.bootdev
  88. 1 [ ] OK mmc sdhci@7e300000.bootdev
  89. 2 [ ] OK ethernet smsc95xx_eth.bootdev
  90. --- ------ ------ -------- ------------------
  91. (3 devices)
  92. U-Boot> bootdev sel 0
  93. U-Boot> bootflow scan
  94. U-Boot> bootdev info
  95. Name: mmc@7e202000.bootdev
  96. Sequence: 0
  97. Status: Probed
  98. Uclass: mmc
  99. Bootflows: 1 (1 valid)
  100. This shows using one of the available hunters, then listing them::
  101. => bootdev hunt usb
  102. Hunting with: usb
  103. Bus usb@1: scanning bus usb@1 for devices...
  104. 3 USB Device(s) found
  105. => bootdev hunt -l
  106. Prio Used Uclass Hunter
  107. ---- ---- --------------- ---------------
  108. 6 ethernet eth_bootdev
  109. 1 simple_bus (none)
  110. 5 ide ide_bootdev
  111. 2 mmc mmc_bootdev
  112. 4 nvme nvme_bootdev
  113. 4 scsi scsi_bootdev
  114. 4 spi_flash sf_bootdev
  115. 5 * usb usb_bootdev
  116. 4 virtio virtio_bootdev
  117. (total hunters: 9)
  118. => usb stor
  119. Device 0: Vendor: sandbox Rev: 1.0 Prod: flash
  120. Type: Hard Disk
  121. Capacity: 4.0 MB = 0.0 GB (8192 x 512)
  122. Device 1: Vendor: sandbox Rev: 1.0 Prod: flash
  123. Type: Hard Disk
  124. Capacity: 0.0 MB = 0.0 GB (1 x 512)
  125. =>
  126. Return value
  127. ------------
  128. The return value $? is always 0 (true).