1.. SPDX-License-Identifier: GPL-2.0+
2.. Copyright 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
3
4efi command
5===========
6
7Synopsis
8--------
9
10::
11
12    efi mem [all]
13    efi tables
14
15Description
16-----------
17
18The *efi* command provides information about the EFI environment U-Boot is
19running in, when it is started from EFI.
20
21When running as an EFI app, this command queries EFI boot services for the
22information. When running as an EFI payload, EFI boot services have been
23stopped, so it uses the information collected by the boot stub before that
24happened.
25
26efi mem
27~~~~~~~
28
29This shows the EFI memory map, sorted in order of physical address.
30
31This is normally a very large table. To help reduce the amount of detritus,
32boot-time memory is normally merged with conventional memory. Use the 'all'
33argument to show everything.
34
35The fields are as follows:
36
37#
38    Entry number (sequentially from 0)
39
40Type
41    Memory type. EFI has a large number of memory types. The type is shown in
42    the format <n>:<name> where in is the format number in hex and <name> is the
43    name.
44
45Physical
46    Physical address
47
48Virtual
49    Virtual address
50
51Size
52    Size of memory area in bytes
53
54Attributes
55    Shows a code for memory attributes. The key for this is shown below the
56    table.
57
58efi tables
59~~~~~~~~~~
60
61This shows a list of the EFI tables provided in the system table. These use
62GUIDs so it is not possible in general to show the name of a table. But some
63effort is made to provide a useful table, where the GUID is known by U-Boot.
64
65
66Example
67-------
68
69::
70
71    => efi mem
72    EFI table at 0, memory map 000000001ad38b60, size 1260, key a79, version 1, descr. size 0x30
73     #  Type              Physical     Virtual        Size  Attributes
74     0  7:conv          0000000000  0000000000  00000a0000  f
75        <gap>           00000a0000              0000060000
76     1  7:conv          0000100000  0000000000  0000700000  f
77     2  a:acpi_nvs      0000800000  0000000000  0000008000  f
78     3  7:conv          0000808000  0000000000  0000008000  f
79     4  a:acpi_nvs      0000810000  0000000000  00000f0000  f
80     5  7:conv          0000900000  0000000000  001efef000  f
81     6  6:rt_data       001f8ef000  0000000000  0000100000  rf
82     7  5:rt_code       001f9ef000  0000000000  0000100000  rf
83     8  0:reserved      001faef000  0000000000  0000080000  f
84     9  9:acpi_reclaim  001fb6f000  0000000000  0000010000  f
85    10  a:acpi_nvs      001fb7f000  0000000000  0000080000  f
86    11  7:conv          001fbff000  0000000000  0000359000  f
87    12  6:rt_data       001ff58000  0000000000  0000020000  rf
88    13  a:acpi_nvs      001ff78000  0000000000  0000088000  f
89        <gap>           0020000000              0090000000
90    14  0:reserved      00b0000000  0000000000  0010000000  1
91
92    Attributes key:
93     f: uncached, write-coalescing, write-through, write-back
94    rf: uncached, write-coalescing, write-through, write-back, needs runtime mapping
95     1: uncached
96    *Some areas are merged (use 'all' to see)
97
98
99    => efi mem  all
100    EFI table at 0, memory map 000000001ad38bb0, size 1260, key a79, version 1, descr. size 0x30
101     #  Type              Physical     Virtual        Size  Attributes
102     0  3:bs_code       0000000000  0000000000  0000001000  f
103     1  7:conv          0000001000  0000000000  000009f000  f
104        <gap>           00000a0000              0000060000
105     2  7:conv          0000100000  0000000000  0000700000  f
106     3  a:acpi_nvs      0000800000  0000000000  0000008000  f
107     4  7:conv          0000808000  0000000000  0000008000  f
108     5  a:acpi_nvs      0000810000  0000000000  00000f0000  f
109     6  4:bs_data       0000900000  0000000000  0000c00000  f
110     7  7:conv          0001500000  0000000000  000aa36000  f
111     8  2:loader_data   000bf36000  0000000000  0010000000  f
112     9  4:bs_data       001bf36000  0000000000  0000020000  f
113    10  7:conv          001bf56000  0000000000  00021e1000  f
114    11  1:loader_code   001e137000  0000000000  00000c4000  f
115    12  7:conv          001e1fb000  0000000000  000009b000  f
116    13  1:loader_code   001e296000  0000000000  00000e2000  f
117    14  7:conv          001e378000  0000000000  000005b000  f
118    15  4:bs_data       001e3d3000  0000000000  000001e000  f
119    16  7:conv          001e3f1000  0000000000  0000016000  f
120    17  4:bs_data       001e407000  0000000000  0000016000  f
121    18  2:loader_data   001e41d000  0000000000  0000002000  f
122    19  4:bs_data       001e41f000  0000000000  0000828000  f
123    20  3:bs_code       001ec47000  0000000000  0000045000  f
124    21  4:bs_data       001ec8c000  0000000000  0000001000  f
125    22  3:bs_code       001ec8d000  0000000000  000000e000  f
126    23  4:bs_data       001ec9b000  0000000000  0000001000  f
127    24  3:bs_code       001ec9c000  0000000000  000002c000  f
128    25  4:bs_data       001ecc8000  0000000000  0000001000  f
129    26  3:bs_code       001ecc9000  0000000000  000000c000  f
130    27  4:bs_data       001ecd5000  0000000000  0000006000  f
131    28  3:bs_code       001ecdb000  0000000000  0000014000  f
132    29  4:bs_data       001ecef000  0000000000  0000001000  f
133    30  3:bs_code       001ecf0000  0000000000  000005b000  f
134    31  4:bs_data       001ed4b000  0000000000  000000b000  f
135    32  3:bs_code       001ed56000  0000000000  0000024000  f
136    33  4:bs_data       001ed7a000  0000000000  0000006000  f
137    34  3:bs_code       001ed80000  0000000000  0000010000  f
138    35  4:bs_data       001ed90000  0000000000  0000002000  f
139    36  3:bs_code       001ed92000  0000000000  0000025000  f
140    37  4:bs_data       001edb7000  0000000000  0000003000  f
141    38  3:bs_code       001edba000  0000000000  0000011000  f
142    39  4:bs_data       001edcb000  0000000000  0000008000  f
143    40  3:bs_code       001edd3000  0000000000  000002d000  f
144    41  4:bs_data       001ee00000  0000000000  0000201000  f
145    42  3:bs_code       001f001000  0000000000  0000024000  f
146    43  4:bs_data       001f025000  0000000000  0000002000  f
147    44  3:bs_code       001f027000  0000000000  0000009000  f
148    45  4:bs_data       001f030000  0000000000  0000005000  f
149    46  3:bs_code       001f035000  0000000000  000002f000  f
150    47  4:bs_data       001f064000  0000000000  0000001000  f
151    48  3:bs_code       001f065000  0000000000  0000005000  f
152    49  4:bs_data       001f06a000  0000000000  0000005000  f
153    50  3:bs_code       001f06f000  0000000000  0000007000  f
154    51  4:bs_data       001f076000  0000000000  0000007000  f
155    52  3:bs_code       001f07d000  0000000000  000000d000  f
156    53  4:bs_data       001f08a000  0000000000  0000001000  f
157    54  3:bs_code       001f08b000  0000000000  0000006000  f
158    55  4:bs_data       001f091000  0000000000  0000004000  f
159    56  3:bs_code       001f095000  0000000000  000000d000  f
160    57  4:bs_data       001f0a2000  0000000000  0000003000  f
161    58  3:bs_code       001f0a5000  0000000000  0000026000  f
162    59  4:bs_data       001f0cb000  0000000000  0000005000  f
163    60  3:bs_code       001f0d0000  0000000000  0000019000  f
164    61  4:bs_data       001f0e9000  0000000000  0000004000  f
165    62  3:bs_code       001f0ed000  0000000000  0000024000  f
166    63  4:bs_data       001f111000  0000000000  0000008000  f
167    64  3:bs_code       001f119000  0000000000  000000b000  f
168    65  4:bs_data       001f124000  0000000000  0000001000  f
169    66  3:bs_code       001f125000  0000000000  0000002000  f
170    67  4:bs_data       001f127000  0000000000  0000002000  f
171    68  3:bs_code       001f129000  0000000000  0000009000  f
172    69  4:bs_data       001f132000  0000000000  0000003000  f
173    70  3:bs_code       001f135000  0000000000  0000005000  f
174    71  4:bs_data       001f13a000  0000000000  0000003000  f
175    72  3:bs_code       001f13d000  0000000000  0000005000  f
176    73  4:bs_data       001f142000  0000000000  0000003000  f
177    74  3:bs_code       001f145000  0000000000  0000011000  f
178    75  4:bs_data       001f156000  0000000000  000000b000  f
179    76  3:bs_code       001f161000  0000000000  0000009000  f
180    77  4:bs_data       001f16a000  0000000000  0000400000  f
181    78  3:bs_code       001f56a000  0000000000  0000006000  f
182    79  4:bs_data       001f570000  0000000000  0000001000  f
183    80  3:bs_code       001f571000  0000000000  0000001000  f
184    81  4:bs_data       001f572000  0000000000  0000002000  f
185    82  3:bs_code       001f574000  0000000000  0000017000  f
186    83  4:bs_data       001f58b000  0000000000  0000364000  f
187    84  6:rt_data       001f8ef000  0000000000  0000100000  rf
188    85  5:rt_code       001f9ef000  0000000000  0000100000  rf
189    86  0:reserved      001faef000  0000000000  0000080000  f
190    87  9:acpi_reclaim  001fb6f000  0000000000  0000010000  f
191    88  a:acpi_nvs      001fb7f000  0000000000  0000080000  f
192    89  4:bs_data       001fbff000  0000000000  0000201000  f
193    90  7:conv          001fe00000  0000000000  00000e8000  f
194    91  4:bs_data       001fee8000  0000000000  0000020000  f
195    92  3:bs_code       001ff08000  0000000000  0000026000  f
196    93  4:bs_data       001ff2e000  0000000000  0000009000  f
197    94  3:bs_code       001ff37000  0000000000  0000021000  f
198    95  6:rt_data       001ff58000  0000000000  0000020000  rf
199    96  a:acpi_nvs      001ff78000  0000000000  0000088000  f
200        <gap>           0020000000              0090000000
201    97  0:reserved      00b0000000  0000000000  0010000000  1
202
203    Attributes key:
204     f: uncached, write-coalescing, write-through, write-back
205    rf: uncached, write-coalescing, write-through, write-back, needs runtime mapping
206     1: uncached
207
208
209    => efi tables
210    000000001f8edf98  ee4e5898-3914-4259-9d6e-dc7bd79403cf  EFI_LZMA_COMPRESSED
211    000000001ff2ace0  05ad34ba-6f02-4214-952e-4da0398e2bb9  EFI_DXE_SERVICES
212    000000001f8ea018  7739f24c-93d7-11d4-9a3a-0090273fc14d  EFI_HOB_LIST
213    000000001ff2bac0  4c19049f-4137-4dd3-9c10-8b97a83ffdfa  EFI_MEMORY_TYPE
214    000000001ff2cb10  49152e77-1ada-4764-b7a2-7afefed95e8b  (unknown)
215    000000001f9ac018  060cc026-4c0d-4dda-8f41-595fef00a502  EFI_MEM_STATUS_CODE_REC
216    000000001f9ab000  eb9d2d31-2d88-11d3-9a16-0090273fc14d  SMBIOS table
217    000000001fb7e000  eb9d2d30-2d88-11d3-9a16-0090273fc14d  EFI_GUID_EFI_ACPI1
218    000000001fb7e014  8868e871-e4f1-11d3-bc22-0080c73c8881  ACPI table
219    000000001e654018  dcfa911d-26eb-469f-a220-38b7dc461220  (unknown)
220