Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eeb5f1a28e | ||
|
|
57cf6f3730 | ||
|
|
18d944716e | ||
|
|
b75d3147ea |
@@ -133,23 +133,34 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
{
|
{
|
||||||
efi_status_t ret;
|
efi_status_t ret;
|
||||||
char *p;
|
char *p;
|
||||||
void *fdt, *image_buf;
|
void *fdt, *ramdisk = NULL, *image_buf;
|
||||||
unsigned long addr, size;
|
unsigned long addr, size, rd_len = 0, fdt_addr = 0;
|
||||||
void *image_addr;
|
void *image_addr;
|
||||||
size_t image_size;
|
size_t image_size;
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
|
|
||||||
if (argc > 2) {
|
if (argc > 3) {
|
||||||
uintptr_t fdt_addr;
|
ulong rd_addr = 0;
|
||||||
|
char *end = NULL;
|
||||||
|
|
||||||
|
rd_addr = hextoul(argv[2], NULL);
|
||||||
|
end = strchr(argv[2], ':');
|
||||||
|
if (!end)
|
||||||
|
return CMD_RET_USAGE;
|
||||||
|
rd_len = hextoul(++end, NULL);
|
||||||
|
ramdisk = map_sysmem(rd_addr, rd_len);
|
||||||
|
fdt_addr = hextoul(argv[3], NULL);
|
||||||
|
} else if (argc > 2) {
|
||||||
fdt_addr = hextoul(argv[2], NULL);
|
fdt_addr = hextoul(argv[2], NULL);
|
||||||
fdt = map_sysmem(fdt_addr, 0);
|
|
||||||
} else {
|
|
||||||
fdt = EFI_FDT_USE_INTERNAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fdt_addr)
|
||||||
|
fdt = map_sysmem(fdt_addr, 0);
|
||||||
|
else
|
||||||
|
fdt = EFI_FDT_USE_INTERNAL;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR) &&
|
if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR) &&
|
||||||
!strcmp(argv[1], "bootmgr")) {
|
!strcmp(argv[1], "bootmgr")) {
|
||||||
ret = efi_bootmgr_run(fdt);
|
ret = efi_bootmgr_run(fdt);
|
||||||
@@ -212,7 +223,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = efi_binary_run(image_buf, size, fdt, NULL, 0);
|
ret = efi_binary_run(image_buf, size, fdt, ramdisk, rd_len);
|
||||||
|
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
@@ -221,7 +232,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
U_BOOT_LONGHELP(bootefi,
|
U_BOOT_LONGHELP(bootefi,
|
||||||
"<image address>[:<image size>] [<fdt address>]\n"
|
"<image address>[:<image size>] [<ramdisk_address>:<size> | -] [<fdt address>]\n"
|
||||||
" - boot EFI payload\n"
|
" - boot EFI payload\n"
|
||||||
#ifdef CONFIG_CMD_BOOTEFI_HELLO
|
#ifdef CONFIG_CMD_BOOTEFI_HELLO
|
||||||
"bootefi hello\n"
|
"bootefi hello\n"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Synopsis
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
bootefi <image_addr>[:<image_size>] [<fdt_addr>]
|
bootefi <image_addr>[:<image_size>] [<ramdisk_addr> | -] [<fdt_addr>]
|
||||||
bootefi bootmgr [<fdt_addr>]
|
bootefi bootmgr [<fdt_addr>]
|
||||||
bootefi hello [<fdt_addr>]
|
bootefi hello [<fdt_addr>]
|
||||||
bootefi selftest [<fdt_addr>]
|
bootefi selftest [<fdt_addr>]
|
||||||
@@ -20,19 +20,19 @@ Synopsis
|
|||||||
Description
|
Description
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
The *bootefi* command is used to launch a UEFI binary which can be either of
|
The *bootefi* command is used to launch a UEFI binary which can be any of
|
||||||
|
|
||||||
* UEFI application
|
* UEFI application
|
||||||
* UEFI boot services driver
|
* UEFI boot services driver
|
||||||
* UEFI run-time services driver
|
* UEFI run-time services driver
|
||||||
|
|
||||||
An operating system requires a hardware description which can either be
|
An operating system requires a hardware description which can either be
|
||||||
presented as ACPI table (CONFIG\_GENERATE\_ACPI\_TABLE=y) or as device-tree.
|
presented as ACPI table (CONFIG_GENERATE_ACPI_TABLE=y) or as device-tree.
|
||||||
The load address of the device-tree may be provided as parameter *fdt\_addr*. If
|
The load address of the device-tree may be provided as parameter *fdt_addr*. If
|
||||||
this address is not specified, the bootefi command will try to fall back in
|
this address is not specified, the bootefi command will try to fall back in
|
||||||
sequence to:
|
sequence to:
|
||||||
|
|
||||||
* the device-tree specified by environment variable *fdt\_addr*
|
* the device-tree specified by environment variable *fdt_addr*
|
||||||
* the device-tree specified by environment variable *fdtcontroladdr*
|
* the device-tree specified by environment variable *fdtcontroladdr*
|
||||||
|
|
||||||
The load address of the binary is specified by parameter *image_address*. A
|
The load address of the binary is specified by parameter *image_address*. A
|
||||||
@@ -51,11 +51,20 @@ The value of the environment variable *bootargs* is converted from UTF-8 to
|
|||||||
UTF-16 and passed as load options in the loaded image protocol to the UEFI
|
UTF-16 and passed as load options in the loaded image protocol to the UEFI
|
||||||
binary.
|
binary.
|
||||||
|
|
||||||
|
Note: The 'bootefi' command accepts one, two or three arguments. When two
|
||||||
|
arguments are provided, the second one is interpreted as `fdt_addr`. When three
|
||||||
|
are provided, the second one is interpreted as `ramdisk_addr` and the third as
|
||||||
|
`fdt_addr`.
|
||||||
|
|
||||||
image_addr
|
image_addr
|
||||||
Address of the UEFI binary.
|
Address of the UEFI binary.
|
||||||
|
|
||||||
|
ramdisk_addr
|
||||||
|
Address of the ramdisk or '-'. If no address is specified, a ramdisk is not
|
||||||
|
used when booting.
|
||||||
|
|
||||||
fdt_addr
|
fdt_addr
|
||||||
Address of the device-tree or '-'. If no address is specifiy, the
|
Address of the device-tree or '-'. If no address is specified, the
|
||||||
environment variable $fdt_addr is used as first fallback, the address of
|
environment variable $fdt_addr is used as first fallback, the address of
|
||||||
U-Boot's internal device-tree $fdtcontroladdr as second fallback.
|
U-Boot's internal device-tree $fdtcontroladdr as second fallback.
|
||||||
When using ACPI no device-tree shall be specified.
|
When using ACPI no device-tree shall be specified.
|
||||||
@@ -110,7 +119,7 @@ U-Boot can be compiled with UEFI unit tests. These unit tests are invoked using
|
|||||||
the *bootefi selftest* sub-command.
|
the *bootefi selftest* sub-command.
|
||||||
|
|
||||||
Which unit test is executed is controlled by the environment variable
|
Which unit test is executed is controlled by the environment variable
|
||||||
*efi\_selftest*. If this variable is not set, all unit tests that are not marked
|
*efi_selftest*. If this variable is not set, all unit tests that are not marked
|
||||||
as 'on request' are executed.
|
as 'on request' are executed.
|
||||||
|
|
||||||
To show a list of the available unit tests the value *list* can be used
|
To show a list of the available unit tests the value *list* can be used
|
||||||
@@ -126,7 +135,7 @@ To show a list of the available unit tests the value *list* can be used
|
|||||||
'configuration tables'
|
'configuration tables'
|
||||||
...
|
...
|
||||||
|
|
||||||
A single test is selected for execution by setting the *efi\_selftest*
|
A single test is selected for execution by setting the *efi_selftest*
|
||||||
environment variable to match one of the listed identifiers
|
environment variable to match one of the listed identifiers
|
||||||
|
|
||||||
::
|
::
|
||||||
@@ -140,10 +149,10 @@ return to the command line but require a board reset.
|
|||||||
Configuration
|
Configuration
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
To use the *bootefi* command you must specify CONFIG\_CMD\_BOOTEFI=y.
|
To use the *bootefi* command you must specify CONFIG_CMD_BOOTEFI=y.
|
||||||
The *bootefi bootmgr* sub-command requries CMD\_BOOTEFI\_BOOTMGR=y.
|
The *bootefi bootmgr* sub-command requries CMD_BOOTEFI_BOOTMGR=y.
|
||||||
The *bootefi hello* sub-command requries CMD\_BOOTEFI\_HELLO=y.
|
The *bootefi hello* sub-command requries CMD_BOOTEFI_HELLO=y.
|
||||||
The *bootefi selftest* sub-command depends on CMD\_BOOTEFI\_SELFTEST=y.
|
The *bootefi selftest* sub-command depends on CMD_BOOTEFI_SELFTEST=y.
|
||||||
|
|
||||||
See also
|
See also
|
||||||
--------
|
--------
|
||||||
|
|||||||
Reference in New Issue
Block a user