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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl4euFgACgkQxIHbvCwF
 GsT91A//dfwvY4UGUvb8Yl/fkMPFPyFRXyMNUWZoJflC44Q/8BouSnuAm7fH2l/H
 Ryb7ZEoczg6bmhHCv+4iheXfzES2qD9I18Rs1sC0p1AGiQWXGIYQQeqWORr6+rx/
 iWJ6GzShaV/a9RdMXwWP/qLEFS8qYkpVGaNZxH4+a2y/oEUdkgGTuQkj43YwU/zS
 83z5aSkqpklZF/mI7R/qAZaNFjthKlnMD/DRcyqIGUDhFNY+QyUE7elddQSS64gZ
 pFLudILZWzfE+/KWjyFRyqTAmVZOhsgMtEaIhfi/DUMzbGWo7j5jX5jvvBqP3ykG
 Hx7sN3zpWs5HQXZyXoURCif8YhfrYemlHnXbmbuN3T+kcyD8LWEjcD8FC0qwkjmU
 ov9wtEW5yOvBWYqChaT7c4D3BCTlsoA+Iw3j+xsRtGSF/ix/z1Bbvc97Bja5N/Bs
 SVE4LvjRmpTn2QuOyQXkPOYpfYdDvacb/+Q9OSo3QnPXgoQwRf5U2oHvSzilRZfY
 p/hK0VopvRJ/KFzZZ+ysTP0Gvcd73ZoR4MhVCOsNJeIw/x8Qlshok7GAT3G/jRK9
 mDENC/IUu3LNhL835UwCSEULaRndz46OCyskMm70fmHfEDofh7NTQAcEKOw/q3Yf
 vTs+vPDKeBecMM5JDvsbsX2gm/9eJkWOqdwA/kaLOJVIj13LwYE=
 =11uD
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Tom Rini 2020-01-15 12:29:23 -05:00
commit 9d5d74c3cc
7 changed files with 55 additions and 11 deletions

View File

@ -131,6 +131,12 @@ Network protocols
.. kernel-doc:: lib/efi_loader/efi_net.c .. kernel-doc:: lib/efi_loader/efi_net.c
:internal: :internal:
Random number generator protocol
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. kernel-doc:: lib/efi_loader/efi_rng.c
:internal:
Text IO protocols Text IO protocols
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~

View File

@ -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 *bp =
(struct efi_driver_binding_extended_protocol *)this; (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)); efi_dp_str(remaining_device_path));
/* Attach driver to controller */ /* Attach driver to controller */
@ -197,9 +197,10 @@ static efi_status_t EFIAPI efi_uc_stop(
efi_status_t ret; efi_status_t ret;
efi_uintn_t count; efi_uintn_t count;
struct efi_open_protocol_info_entry *entry_buffer; 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); number_of_children, child_handle_buffer);
/* Destroy provided child controllers */ /* Destroy provided child controllers */
@ -217,7 +218,7 @@ static efi_status_t EFIAPI efi_uc_stop(
/* Destroy all children */ /* Destroy all children */
ret = EFI_CALL(systab.boottime->open_protocol_information( ret = EFI_CALL(systab.boottime->open_protocol_information(
controller_handle, guid_controller, controller_handle, bp->ops->protocol,
&entry_buffer, &count)); &entry_buffer, &count));
if (ret != EFI_SUCCESS) if (ret != EFI_SUCCESS)
goto out; goto out;
@ -237,7 +238,7 @@ static efi_status_t EFIAPI efi_uc_stop(
/* Detach driver from controller */ /* Detach driver from controller */
ret = EFI_CALL(systab.boottime->close_protocol( ret = EFI_CALL(systab.boottime->close_protocol(
controller_handle, guid_controller, controller_handle, bp->ops->protocol,
this->driver_binding_handle, controller_handle)); this->driver_binding_handle, controller_handle));
out: out:
return EFI_EXIT(ret); return EFI_EXIT(ret);

View File

@ -16,6 +16,7 @@ config EFI_LOADER
select REGEX select REGEX
imply CFB_CONSOLE_ANSI imply CFB_CONSOLE_ANSI
imply USB_KEYBOARD_FN_KEYS imply USB_KEYBOARD_FN_KEYS
imply VIDEO_ANSI
help help
Select this option if you want to run UEFI applications (like GNU 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 GRUB or iPXE) on top of U-Boot. If this option is enabled, U-Boot

View File

@ -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)); ret = EFI_CALL(image_obj->entry(image_handle, &systab));
/* /*
* Usually UEFI applications call Exit() instead of returning. * Control is returned from a started UEFI image either by calling
* But because the world doesn't consist of ponies and unicorns, * Exit() (where exit data can be provided) or by simply returning from
* we're happy to emulate that behavior on behalf of a payload * the entry point. In the latter case call Exit() on behalf of the
* that forgot. * image.
*/ */
return EFI_CALL(systab.boottime->exit(image_handle, ret, 0, NULL)); return EFI_CALL(systab.boottime->exit(image_handle, ret, 0, NULL));
} }

View File

@ -13,6 +13,17 @@ DECLARE_GLOBAL_DATA_PTR;
const efi_guid_t efi_guid_rng_protocol = EFI_RNG_PROTOCOL_GUID; 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) __weak efi_status_t platform_get_rng_device(struct udevice **dev)
{ {
int ret; int ret;
@ -29,6 +40,18 @@ __weak efi_status_t platform_get_rng_device(struct udevice **dev)
return EFI_SUCCESS; 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, static efi_status_t EFIAPI rng_getinfo(struct efi_rng_protocol *this,
efi_uintn_t *rng_algorithm_list_size, efi_uintn_t *rng_algorithm_list_size,
efi_guid_t *rng_algorithm_list) efi_guid_t *rng_algorithm_list)
@ -64,6 +87,18 @@ back:
return EFI_EXIT(ret); 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, static efi_status_t EFIAPI getrng(struct efi_rng_protocol *this,
efi_guid_t *rng_algorithm, efi_guid_t *rng_algorithm,
efi_uintn_t rng_value_length, efi_uintn_t rng_value_length,

View File

@ -3,6 +3,7 @@ config CMD_BOOTEFI_SELFTEST
depends on CMD_BOOTEFI depends on CMD_BOOTEFI
imply FAT imply FAT
imply FAT_WRITE imply FAT_WRITE
imply CMD_POWEROFF if PSCI_RESET || SYSRESET_PSCI
help help
This adds a UEFI test application to U-Boot that can be executed This adds a UEFI test application to U-Boot that can be executed
via the 'bootefi selftest' command. It provides extended tests of via the 'bootefi selftest' command. It provides extended tests of

View File

@ -257,9 +257,9 @@ static int teardown(void)
disk_handle, &block_io_protocol_guid, disk_handle, &block_io_protocol_guid,
&block_io); &block_io);
if (r != EFI_SUCCESS) { if (r != EFI_SUCCESS) {
efi_st_todo( efi_st_error(
"Failed to uninstall block I/O protocol\n"); "Failed to uninstall block I/O protocol\n");
return EFI_ST_SUCCESS; return EFI_ST_FAILURE;
} }
} }