"Das U-Boot" Source Tree
at master 178 lines 4.9 kB view raw
1.. SPDX-License-Identifier: GPL-2.0+: 2 3.. index:: 4 single: bootdev (command) 5 6bootdev command 7=============== 8 9Synopsis 10-------- 11 12:: 13 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 18 19Description 20----------- 21 22The `bootdev` command is used to manage bootdevs. It can list available 23bootdevs, select one and obtain information about it. 24 25See :doc:`/develop/bootstd/index` for more information about bootdevs in general. 26 27 28bootdev list 29~~~~~~~~~~~~ 30 31This lists available bootdevs 32 33Scanning with `-p` causes the bootdevs to be probed. This happens automatically 34when they are used. 35 36The list looks something like this: 37 38=== ====== ====== ======== ========================= 39Seq 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 47The fields are as follows: 48 49Seq: 50 Sequence number in the scan, used to reference the bootflow later 51 52Probed: 53 Shows a plus (+) if the device is probed, empty if not. 54 55Status: 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 61Uclass: 62 Name of the media device's Uclass. This indicates the type of the parent 63 device (e.g. MMC, Ethernet). 64 65Name: 66 Name of the bootdev. This is generated from the media device appended 67 with `.bootdev` 68 69 70bootdev hunt 71~~~~~~~~~~~~ 72 73This hunts for new bootdevs, or shows a list of hunters. 74 75Use `-l` to list the available bootdev hunters. 76 77To run hunters, specify the name of the hunter to run, e.g. "mmc". If no 78name is provided, all hunters are run. 79 80 81bootdev select 82~~~~~~~~~~~~~~ 83 84Use this to select a particular bootdev. You can select it by the sequence 85number or name, as shown in `bootdev list`. 86 87Once a bootdev is selected, you can use `bootdev info` to look at it or 88`bootflow scan` to scan it. 89 90If no bootdev name or number is provided, then any existing bootdev is 91unselected. 92 93 94bootdev info 95~~~~~~~~~~~~ 96 97This shows information on the current bootdev, with the format looking like 98this: 99 100========= ======================= 101Name `mmc@7e202000.bootdev` 102Sequence 0 103Status Probed 104Uclass mmc 105Bootflows 1 (1 valid) 106========= ======================= 107 108Most of the information is the same as `bootdev list` above. The new fields 109are: 110 111Device 112 Name of the bootdev 113 114Status 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 118Bootflows 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 123Example 124------- 125 126This example shows listing available bootdev and getting information about 127one 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 146This 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 174 175Return value 176------------ 177 178The return value $? is always 0 (true).