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 | |
| 11 | bootdev list [-p] - list all available bootdevs (-p to probe)\n" |
| 12 | bootdev select <bm> - select a bootdev by name\n" |
| 13 | bootdev info [-p] - show information about a bootdev"; |
| 14 | |
| 15 | Description |
| 16 | ----------- |
| 17 | |
| 18 | The `bootdev` command is used to manage bootdevs. It can list available |
| 19 | bootdevs, select one and obtain information about it. |
| 20 | |
| 21 | See :doc:`../../develop/bootstd` for more information about bootdevs in general. |
| 22 | |
| 23 | |
| 24 | bootdev list |
| 25 | ~~~~~~~~~~~~ |
| 26 | |
| 27 | This lists available bootdevs |
| 28 | |
| 29 | Scanning with `-p` causes the bootdevs to be probed. This happens automatically |
| 30 | when they are used. |
| 31 | |
| 32 | The list looks something like this: |
| 33 | |
| 34 | === ====== ====== ======== ========================= |
| 35 | Seq Probed Status Uclass Name |
| 36 | === ====== ====== ======== ========================= |
| 37 | 0 [ + ] OK mmc mmc@7e202000.bootdev |
| 38 | 1 [ ] OK mmc sdhci@7e300000.bootdev |
| 39 | 2 [ ] OK ethernet smsc95xx_eth.bootdev |
| 40 | === ====== ====== ======== ========================= |
| 41 | |
| 42 | |
| 43 | The fields are as follows: |
| 44 | |
| 45 | Seq: |
| 46 | Sequence number in the scan, used to reference the bootflow later |
| 47 | |
| 48 | Probed: |
| 49 | Shows a plus (+) if the device is probed, empty if not. |
| 50 | |
| 51 | Status: |
| 52 | Shows the status of the device. Typically this is `OK` meaning that there is |
| 53 | no error. If you use -p and an error occurs when probing, then this shows |
| 54 | the error number. You can look up Linux error codes to find the meaning of |
| 55 | the number. |
| 56 | |
| 57 | Uclass: |
| 58 | Name of the media device's Uclass. This indicates the type of the parent |
| 59 | device (e.g. MMC, Ethernet). |
| 60 | |
| 61 | Name: |
| 62 | Name of the bootdev. This is generated from the media device appended |
| 63 | with `.bootdev` |
| 64 | |
| 65 | |
| 66 | bootdev select |
| 67 | ~~~~~~~~~~~~~~~~~ |
| 68 | |
| 69 | Use this to select a particular bootdev. You can select it by the sequence |
| 70 | number or name, as shown in `bootdev list`. |
| 71 | |
| 72 | Once a bootdev is selected, you can use `bootdev info` to look at it or |
| 73 | `bootflow scan` to scan it. |
| 74 | |
| 75 | If no bootdev name or number is provided, then any existing bootdev is |
| 76 | unselected. |
| 77 | |
| 78 | |
| 79 | bootdev info |
| 80 | ~~~~~~~~~~~~~~~ |
| 81 | |
| 82 | This shows information on the current bootdev, with the format looking like |
| 83 | this: |
| 84 | |
| 85 | ========= ======================= |
| 86 | Name mmc@7e202000.bootdev |
| 87 | Sequence 0 |
| 88 | Status Probed |
| 89 | Uclass mmc |
| 90 | Bootflows 1 (1 valid) |
| 91 | ========= ======================= |
| 92 | |
| 93 | Most of the information is the same as `bootdev list` above. The new fields |
| 94 | are: |
| 95 | |
| 96 | Device |
| 97 | Name of the bootdev |
| 98 | |
| 99 | Status |
| 100 | Shows `Probed` if the device is probed, `OK` if not. If `-p` is used and the |
| 101 | device fails to probe, an error code is shown. |
| 102 | |
| 103 | Bootflows |
| 104 | Indicates the number of bootflows attached to the bootdev. This is 0 |
| 105 | unless you have used 'bootflow scan' on the bootflow, or on all bootflows. |
| 106 | |
| 107 | |
| 108 | Example |
| 109 | ------- |
| 110 | |
| 111 | This example shows listing available bootdev and getting information about |
| 112 | one of them:: |
| 113 | |
| 114 | U-Boot> bootdev list |
| 115 | Seq Probed Status Uclass Name |
| 116 | --- ------ ------ -------- ------------------ |
| 117 | 0 [ + ] OK mmc mmc@7e202000.bootdev |
| 118 | 1 [ ] OK mmc sdhci@7e300000.bootdev |
| 119 | 2 [ ] OK ethernet smsc95xx_eth.bootdev |
| 120 | --- ------ ------ -------- ------------------ |
| 121 | (3 devices) |
| 122 | U-Boot> bootdev sel 0 |
| 123 | U-Boot> bootflow scan |
| 124 | U-Boot> bootdev info |
| 125 | Name: mmc@7e202000.bootdev |
| 126 | Sequence: 0 |
| 127 | Status: Probed |
| 128 | Uclass: mmc |
| 129 | Bootflows: 1 (1 valid) |
| 130 | |
| 131 | |
| 132 | Return value |
| 133 | ------------ |
| 134 | |
| 135 | The return value $? is always 0 (true). |