summaryrefslogtreecommitdiff
path: root/cmd/efidebug.c
AgeCommit message (Collapse)AuthorFilesLines
2019-08-11env: Drop environment.h header file where not neededSimon Glass1-1/+0
This header file is now only used by files that access internal environment features. Drop it from various places where it is not needed. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-30efi_loader: efidebug.c function documentationHeinrich Schuchardt1-3/+2
make htmldocs produces a warning: ./cmd/efidebug.c:733: WARNING: Unexpected indentation. Correct the indentation. Remove 'See above for details of sub-commands.' which is not helpful in the Sphinx generated documentation. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-17efi_loader: function comments cmd/efi_debug.cHeinrich Schuchardt1-6/+10
Adjust comments for Sphinx. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-21efi_loader: consistent error handling in efidebug.cHeinrich Schuchardt1-7/+16
If a variable cannot be set, always show an information message. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-21efi_loader: consistent types in efidebug.cHeinrich Schuchardt1-11/+14
efi_status_t and int are of different size. Use separate variables for return codes of different type. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-05cmd: efidebug: make some boot variables non-volatileAKASHI Takahiro1-0/+3
Boot####, BootOrder and BootNext should be non-volatile. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-05-02efi_loader: optional data in load options are binaryHeinrich Schuchardt1-10/+17
The field boot OptionalData in structure _EFI_LOAD_OPTIONS is for binary data. When we use `efidebug boot add` we should convert the 5th argument from UTF-8 to UTF-16 before putting it into the BootXXXX variable. When printing boot variables with `efidebug boot dump` we should support the OptionalData being arbitrary binary data. So let's dump the data as hexadecimal values. Here is an example session protocol: => efidebug boot add 00a1 label1 scsi 0:1 doit1 'my option' => efidebug boot add 00a2 label2 scsi 0:1 doit2 => efidebug boot dump Boot00A0: attributes: A-- (0x00000001) label: label1 file_path: .../HD(1,MBR,0xeac4e18b,0x800,0x3fffe)/doit1 data: 00000000: 6d 00 79 00 20 00 6f 00 70 00 74 00 69 00 6f 00 m.y. .o.p.t.i.o. 00000010: 6e 00 00 00 n... Boot00A1: attributes: A-- (0x00000001) label: label2 file_path: .../HD(1,MBR,0xeac4e18b,0x800,0x3fffe)/doit2 data: Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-05-02cmd: efidebug: rework "boot dump" sub-command using GetNextVariableName()AKASHI Takahiro1-24/+55
Currently in do_efi_boot_dump(), we directly read EFI variables from related environment variables. To accommodate alternative storage backends, we should switch to using the UEFI API instead. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-23efi_loader: more short texts for protocols in efidebugHeinrich Schuchardt1-0/+20
The `efidebug dh` command shows handles and the installed protocols. For most of the protocols implemented by U-Boot a short text was shown. But for some only the GUID was displayed. Provide the missing short texts for the following protocols: HII String, HII Database, HII Config Routing, Simple Network, PXE Base Code. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-23efi_loader: consistent naming of protocol GUIDsHeinrich Schuchardt1-5/+5
We should consistently use the same name for protocol GUIDs as defined in the UEFI specification. Not adhering to this rule has led to duplicate definitions for the EFI_LOADED_IMAGE_PROTOCOL_GUID. Adjust misnamed protocol GUIDs. Adjust the text for the graphics output protocol in the output of the `efidebug dh` command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-03-03efi_loader: error handling for `efidebug boot add`Heinrich Schuchardt1-1/+1
In `efidebug boot add iPXE scsi 0:1 snp-arm64.efi --foo` a parameter is missing. Hence the command should not silently return as if everything were ok but should display the usage info. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@csgraf.de>
2019-02-25cmd: efidebug: add memmap commandAKASHI Takahiro1-1/+126
"memmap" command prints uefi-specific memory map information. => efi memmap Type Start End Attributes ================ ================ ================ ========== CONVENTIONAL 0000000040000000-000000007de27000 WB RUNTIME DATA 000000007de27000-000000007de28000 WB|RT RESERVED 000000007de28000-000000007de2a000 WB RUNTIME DATA 000000007de2a000-000000007de2b000 WB|RT RESERVED 000000007de2b000-000000007de2c000 WB RUNTIME DATA 000000007de2c000-000000007de2d000 WB|RT LOADER DATA 000000007de2d000-000000007ff37000 WB RUNTIME CODE 000000007ff37000-000000007ff38000 WB|RT LOADER DATA 000000007ff38000-0000000080000000 WB Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: efidebug: add images commandAKASHI Takahiro1-1/+25
"images" command prints loaded images-related information. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: efidebug: add dh commandAKASHI Takahiro1-1/+141
"dh" command prints all the uefi handles used in the system. => efi dh 7ef3bfa0: Device Path, Device Path To Text, Device Path Utilities, Unicode Collation 2 7ef31d30: Driver Binding 7ef31da0: Simple Text Output 7ef31e10: Simple Text Input, Simple Text Input Ex 7ef3cca0: Block IO, Device Path 7ef3d070: Block IO, Device Path 7ef3d1b0: Block IO, Device Path, Simple File System 7ef3d3e0: Block IO, Device Path, Simple File System Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: efidebug: add drivers commandAKASHI Takahiro1-1/+94
"drivers" command prints all the uefi drivers on the system. => efi drivers Driver Name Image Path ================ ==================== ==================== 000000007ef003d0 <NULL> <built-in> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: efidebug: add devices commandAKASHI Takahiro1-1/+78
"devices" command prints all the uefi variables on the system. => efi devices Scanning disk ahci_scsi.id0lun0... Scanning disk ahci_scsi.id1lun0... Found 4 disks Device Device Path ================ ==================== 000000007ef07ea0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b) 000000007ef00c10 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0) 000000007ef00dd0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0) 000000007ef07be0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)/HD(1,MBR,0x086246ba,0x800,0x40000) 000000007ef07510 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)/HD(2,MBR,0x086246ba,0x40800,0x3f800) Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: add efidebug commandAKASHI Takahiro1-0/+587
Currently, there is no easy way to add or modify UEFI variables. In particular, bootmgr supports BootOrder/BootXXXX variables, it is quite hard to define them as u-boot variables because they are represented in a complicated and encoded format. The new command, efidebug, helps address these issues and give us more friendly interfaces: * efidebug boot add: add BootXXXX variable * efidebug boot rm: remove BootXXXX variable * efidebug boot dump: display all BootXXXX variables * efidebug boot next: set BootNext variable * efidebug boot order: set/display a boot order (BootOrder) Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>