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