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