blob: 5e02e32c51417b0610856a7c0522909d82e66265 [file] [log] [blame]
Simon Glass83b9be62022-04-24 23:31:26 -06001.. SPDX-License-Identifier: GPL-2.0+:
2
3bootdev command
4===============
5
6Synopis
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
15Description
16-----------
17
18The `bootdev` command is used to manage bootdevs. It can list available
19bootdevs, select one and obtain information about it.
20
21See :doc:`../../develop/bootstd` for more information about bootdevs in general.
22
23
24bootdev list
25~~~~~~~~~~~~
26
27This lists available bootdevs
28
29Scanning with `-p` causes the bootdevs to be probed. This happens automatically
30when they are used.
31
32The list looks something like this:
33
34=== ====== ====== ======== =========================
35Seq 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
43The fields are as follows:
44
45Seq:
46 Sequence number in the scan, used to reference the bootflow later
47
48Probed:
49 Shows a plus (+) if the device is probed, empty if not.
50
51Status:
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
57Uclass:
58 Name of the media device's Uclass. This indicates the type of the parent
59 device (e.g. MMC, Ethernet).
60
61Name:
62 Name of the bootdev. This is generated from the media device appended
63 with `.bootdev`
64
65
66bootdev select
67~~~~~~~~~~~~~~~~~
68
69Use this to select a particular bootdev. You can select it by the sequence
70number or name, as shown in `bootdev list`.
71
72Once a bootdev is selected, you can use `bootdev info` to look at it or
73`bootflow scan` to scan it.
74
75If no bootdev name or number is provided, then any existing bootdev is
76unselected.
77
78
79bootdev info
80~~~~~~~~~~~~~~~
81
82This shows information on the current bootdev, with the format looking like
83this:
84
85========= =======================
86Name mmc@7e202000.bootdev
87Sequence 0
88Status Probed
89Uclass mmc
90Bootflows 1 (1 valid)
91========= =======================
92
93Most of the information is the same as `bootdev list` above. The new fields
94are:
95
96Device
97 Name of the bootdev
98
99Status
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
103Bootflows
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
108Example
109-------
110
111This example shows listing available bootdev and getting information about
112one 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
132Return value
133------------
134
135The return value $? is always 0 (true).