Compare commits

...

4 Commits
vbi6-ci ... rd2

Author SHA1 Message Date
Simon Glass
40716ecf7e efi_loader: Support loading a ramdisk with bootefi
It is sometimes useful to be able to boot via EFI using a ramdisk. Add
support for this.

Fix a 'specifiy' typo while here.

Series-to: heinrich
Series-version: 1
Series-changes: 1
- Drop mention of the '-' argument-value as it is not needed

Fixes: #8
2025-06-10 08:53:13 -06:00
Simon Glass
57cf6f3730 Merge branch 'ci' into 'master'
doc: efi_loader: Tidy up the bootefi-command docs

See merge request u-boot/u-boot!105
2025-06-09 23:29:24 +00:00
Simon Glass
18d944716e doc: efi_loader: Tidy up the bootefi-command docs
There are backslashes in some of the tags which seems to be unnecessary.
Remove then.

Change the word 'either' to 'any' since there are three options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-06-09 23:27:37 +00:00
Simon Glass
b75d3147ea Merge branch 'ci' into 'master'
VBE serial part H: Implement VBE on Rockchip RK3399

See merge request u-boot/u-boot!104
2025-06-09 23:22:25 +00:00
2 changed files with 41 additions and 21 deletions

View File

@@ -133,23 +133,34 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
{
efi_status_t ret;
char *p;
void *fdt, *image_buf;
unsigned long addr, size;
void *fdt, *ramdisk = NULL, *image_buf;
unsigned long addr, size, rd_len = 0, fdt_addr = 0;
void *image_addr;
size_t image_size;
if (argc < 2)
return CMD_RET_USAGE;
if (argc > 2) {
uintptr_t fdt_addr;
if (argc > 3) {
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 = 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) &&
!strcmp(argv[1], "bootmgr")) {
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)
return CMD_RET_FAILURE;
@@ -221,7 +232,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
}
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"
#ifdef CONFIG_CMD_BOOTEFI_HELLO
"bootefi hello\n"

View File

@@ -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 hello [<fdt_addr>]
bootefi selftest [<fdt_addr>]
@@ -20,19 +20,19 @@ Synopsis
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 boot services driver
* UEFI run-time services driver
An operating system requires a hardware description which can either be
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
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
this address is not specified, the bootefi command will try to fall back in
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 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
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
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
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
U-Boot's internal device-tree $fdtcontroladdr as second fallback.
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.
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.
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'
...
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
::
@@ -140,10 +149,10 @@ return to the command line but require a board reset.
Configuration
-------------
To use the *bootefi* command you must specify CONFIG\_CMD\_BOOTEFI=y.
The *bootefi bootmgr* sub-command requries CMD\_BOOTEFI\_BOOTMGR=y.
The *bootefi hello* sub-command requries CMD\_BOOTEFI\_HELLO=y.
The *bootefi selftest* sub-command depends on CMD\_BOOTEFI\_SELFTEST=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 hello* sub-command requries CMD_BOOTEFI_HELLO=y.
The *bootefi selftest* sub-command depends on CMD_BOOTEFI_SELFTEST=y.
See also
--------