Commit 9d5d74c3 authored by Tom Rini's avatar Tom Rini

Merge tag 'efi-2020-04-rc1-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc1-2

Bug fixes for the UEFI sub-system are provided:

* imply VIDEO_ANSI for correct cursor positioning and colors
* fix issues in the UEFI block device driver
* add missing documentation
parents fb537657 faadc041
Pipeline #1867 passed with stages
in 139 minutes and 13 seconds
......@@ -131,6 +131,12 @@ Network protocols
.. kernel-doc:: lib/efi_loader/efi_net.c
:internal:
Random number generator protocol
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. kernel-doc:: lib/efi_loader/efi_rng.c
:internal:
Text IO protocols
~~~~~~~~~~~~~~~~~
......
......@@ -112,7 +112,7 @@ static efi_status_t EFIAPI efi_uc_start(
struct efi_driver_binding_extended_protocol *bp =
(struct efi_driver_binding_extended_protocol *)this;
EFI_ENTRY("%p, %pUl, %ls", this, controller_handle,
EFI_ENTRY("%p, %p, %ls", this, controller_handle,
efi_dp_str(remaining_device_path));
/* Attach driver to controller */
......@@ -197,9 +197,10 @@ static efi_status_t EFIAPI efi_uc_stop(
efi_status_t ret;
efi_uintn_t count;
struct efi_open_protocol_info_entry *entry_buffer;
efi_guid_t *guid_controller = NULL;
struct efi_driver_binding_extended_protocol *bp =
(struct efi_driver_binding_extended_protocol *)this;
EFI_ENTRY("%p, %pUl, %zu, %p", this, controller_handle,
EFI_ENTRY("%p, %p, %zu, %p", this, controller_handle,
number_of_children, child_handle_buffer);
/* Destroy provided child controllers */
......@@ -217,7 +218,7 @@ static efi_status_t EFIAPI efi_uc_stop(
/* Destroy all children */
ret = EFI_CALL(systab.boottime->open_protocol_information(
controller_handle, guid_controller,
controller_handle, bp->ops->protocol,
&entry_buffer, &count));
if (ret != EFI_SUCCESS)
goto out;
......@@ -237,7 +238,7 @@ static efi_status_t EFIAPI efi_uc_stop(
/* Detach driver from controller */
ret = EFI_CALL(systab.boottime->close_protocol(
controller_handle, guid_controller,
controller_handle, bp->ops->protocol,
this->driver_binding_handle, controller_handle));
out:
return EFI_EXIT(ret);
......
......@@ -16,6 +16,7 @@ config EFI_LOADER
select REGEX
imply CFB_CONSOLE_ANSI
imply USB_KEYBOARD_FN_KEYS
imply VIDEO_ANSI
help
Select this option if you want to run UEFI applications (like GNU
GRUB or iPXE) on top of U-Boot. If this option is enabled, U-Boot
......
......@@ -2933,10 +2933,10 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
ret = EFI_CALL(image_obj->entry(image_handle, &systab));
/*
* Usually UEFI applications call Exit() instead of returning.
* But because the world doesn't consist of ponies and unicorns,
* we're happy to emulate that behavior on behalf of a payload
* that forgot.
* Control is returned from a started UEFI image either by calling
* Exit() (where exit data can be provided) or by simply returning from
* the entry point. In the latter case call Exit() on behalf of the
* image.
*/
return EFI_CALL(systab.boottime->exit(image_handle, ret, 0, NULL));
}
......
......@@ -13,6 +13,17 @@ DECLARE_GLOBAL_DATA_PTR;
const efi_guid_t efi_guid_rng_protocol = EFI_RNG_PROTOCOL_GUID;
/**
* platform_get_rng_device() - retrieve random number generator
*
* This function retrieves the udevice implementing a hardware random
* number generator.
*
* This function may be overridden if special initialization is needed.
*
* @dev: udevice
* Return: status code
*/
__weak efi_status_t platform_get_rng_device(struct udevice **dev)
{
int ret;
......@@ -29,6 +40,18 @@ __weak efi_status_t platform_get_rng_device(struct udevice **dev)
return EFI_SUCCESS;
}
/**
* rng_getinfo() - get information about random number generation
*
* This function implement the GetInfo() service of the EFI random number
* generator protocol. See the UEFI spec for details.
*
* @this: random number generator protocol instance
* @rng_algorithm_list_size: number of random number generation algorithms
* @rng_algorithm_list: descriptions of random number generation
* algorithms
* Return: status code
*/
static efi_status_t EFIAPI rng_getinfo(struct efi_rng_protocol *this,
efi_uintn_t *rng_algorithm_list_size,
efi_guid_t *rng_algorithm_list)
......@@ -64,6 +87,18 @@ back:
return EFI_EXIT(ret);
}
/**
* rng_getrng() - get random value
*
* This function implement the GetRng() service of the EFI random number
* generator protocol. See the UEFI spec for details.
*
* @this: random number generator protocol instance
* @rng_algorithm: random number generation algorithm
* @rng_value_length: number of random bytes to generate, buffer length
* @rng_value: buffer to receive random bytes
* Return: status code
*/
static efi_status_t EFIAPI getrng(struct efi_rng_protocol *this,
efi_guid_t *rng_algorithm,
efi_uintn_t rng_value_length,
......
......@@ -3,6 +3,7 @@ config CMD_BOOTEFI_SELFTEST
depends on CMD_BOOTEFI
imply FAT
imply FAT_WRITE
imply CMD_POWEROFF if PSCI_RESET || SYSRESET_PSCI
help
This adds a UEFI test application to U-Boot that can be executed
via the 'bootefi selftest' command. It provides extended tests of
......
......@@ -257,9 +257,9 @@ static int teardown(void)
disk_handle, &block_io_protocol_guid,
&block_io);
if (r != EFI_SUCCESS) {
efi_st_todo(
efi_st_error(
"Failed to uninstall block I/O protocol\n");
return EFI_ST_SUCCESS;
return EFI_ST_FAILURE;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment