mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
Pull request for UEFI sub-system for efi-2020-10-rc6
The following UEFI related issues are fixed: * restore the global data pointer in the RISC-V trap handler * install EFI_RNG_PROTOCOL only if we have a random number generator * display human readable string for EFI_RNG_PROTOCOL in efidebug command -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl9xufEACgkQxIHbvCwF GsTvDQ//WJbnQOKYH85f8ycQQlUcEshIkln7EckK+YoffolS9WXEFzJWvJcilk1F PEEom8o2yZUphkk1h/No1mlj8sv0vDetQ95F6lgpaViFyqsdHVr7FZsu2klMHWfw 0KQCGMFk9NNc8VdCrLw4yFDomyEwaeshHH39vMZhPsrnxYJdxea+8rR+u6DiFxvP AAC2nhOXOZpoq7+TXyQU+S3Mr6qzmLa/+dFFfDKX83SYCSjDqG6wxUSNODsne7aO us77CLI4HxOvtKN8XpxQPfQIAU88V71konnj3HgTX1OhP3ExnX9V5gY2q3yI8MOE /tCTnEqwUF+EiAo5btJRUh4LOZ1UxDVUpUaN662YRNszcc0sJ5RZ6P66yG/8riqj W2FkbhjpM12m0P0acovujpH3uMKq1eWf9HyK4NAraHGDBUssmk8+fPO+AaIBz0B0 EuCZCCsUlbnJv/4SOKfJgamTyOr1QSs8PO2LJcDS13nJyNHmEkhDO4CLkVgoQCdn WgI1MK4L+wPoAknel1K/1EP569o2rSvj4mIGCqzSTGq9EAdYvUF7EVmGXwDbSn6v z4KFL9I8KZpEk9rDvaaPoVsEUunznZ6fLXj0VeSE8q6hVjvm6CHx+xOpY+kfkC/x nfBilI17jvVOn5b4Lnb/rlCYEclxQ86SI5O9I4au/fHkIgDou74= =W9Wz -----END PGP SIGNATURE----- Merge tag 'efi-2020-10-rc6' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-10-rc6 The following UEFI related issues are fixed: * restore the global data pointer in the RISC-V trap handler * install EFI_RNG_PROTOCOL only if we have a random number generator * display human readable string for EFI_RNG_PROTOCOL in efidebug command
This commit is contained in:
commit
d44d46e9fa
6 changed files with 44 additions and 6 deletions
|
@ -111,6 +111,9 @@ ulong handle_trap(ulong cause, ulong epc, ulong tval, struct pt_regs *regs)
|
|||
{
|
||||
ulong is_irq, irq;
|
||||
|
||||
/* An UEFI application may have changed gd. Restore U-Boot's gd. */
|
||||
efi_restore_gd();
|
||||
|
||||
is_irq = (cause & MCAUSE_INT);
|
||||
irq = (cause & ~MCAUSE_INT);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <efi_loader.h>
|
||||
#include <efi_rng.h>
|
||||
#include <exports.h>
|
||||
#include <hexdump.h>
|
||||
#include <log.h>
|
||||
|
@ -248,6 +249,10 @@ static const struct {
|
|||
"Load File2",
|
||||
EFI_LOAD_FILE2_PROTOCOL_GUID,
|
||||
},
|
||||
{
|
||||
"Random Number Generator",
|
||||
EFI_RNG_PROTOCOL_GUID,
|
||||
},
|
||||
{
|
||||
"Simple Network",
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL_GUID,
|
||||
|
|
|
@ -154,7 +154,6 @@ extern const struct efi_hii_config_routing_protocol efi_hii_config_routing;
|
|||
extern const struct efi_hii_config_access_protocol efi_hii_config_access;
|
||||
extern const struct efi_hii_database_protocol efi_hii_database;
|
||||
extern const struct efi_hii_string_protocol efi_hii_string;
|
||||
extern const struct efi_rng_protocol efi_rng_protocol;
|
||||
|
||||
uint16_t *efi_dp_str(struct efi_device_path *dp);
|
||||
|
||||
|
@ -404,6 +403,8 @@ efi_status_t EFIAPI efi_convert_pointer(efi_uintn_t debug_disposition,
|
|||
efi_status_t efi_console_register(void);
|
||||
/* Called by bootefi to make all disk storage accessible as EFI objects */
|
||||
efi_status_t efi_disk_register(void);
|
||||
/* Called by efi_init_obj_list() to install EFI_RNG_PROTOCOL */
|
||||
efi_status_t efi_rng_register(void);
|
||||
/* Create handles and protocols for the partitions of a block device */
|
||||
int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc,
|
||||
const char *if_typename, int diskid,
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* Copyright (c) 2019, Linaro Limited
|
||||
*/
|
||||
|
||||
#define LOG_CATEGORY LOGC_EFI
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <efi_loader.h>
|
||||
|
@ -144,7 +146,33 @@ back:
|
|||
return EFI_EXIT(status);
|
||||
}
|
||||
|
||||
const struct efi_rng_protocol efi_rng_protocol = {
|
||||
static const struct efi_rng_protocol efi_rng_protocol = {
|
||||
.get_info = rng_getinfo,
|
||||
.get_rng = getrng,
|
||||
};
|
||||
|
||||
/**
|
||||
* efi_rng_register() - register EFI_RNG_PROTOCOL
|
||||
*
|
||||
* If a RNG device is available, the Random Number Generator Protocol is
|
||||
* registered.
|
||||
*
|
||||
* Return: An error status is only returned if adding the protocol fails.
|
||||
*/
|
||||
efi_status_t efi_rng_register(void)
|
||||
{
|
||||
efi_status_t ret;
|
||||
struct udevice *dev;
|
||||
|
||||
ret = platform_get_rng_device(&dev);
|
||||
if (ret != EFI_SUCCESS) {
|
||||
log_warning("Missing RNG device for EFI_RNG_PROTOCOL");
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
ret = efi_add_protocol(efi_root, &efi_guid_rng_protocol,
|
||||
(void *)&efi_rng_protocol);
|
||||
if (ret != EFI_SUCCESS)
|
||||
log_err("Cannot install EFI_RNG_PROTOCOL");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -80,10 +80,6 @@ efi_status_t efi_root_node_register(void)
|
|||
/* HII configuration routing protocol */
|
||||
&efi_guid_hii_config_routing_protocol,
|
||||
(void *)&efi_hii_config_routing,
|
||||
#endif
|
||||
#if CONFIG_IS_ENABLED(EFI_RNG_PROTOCOL)
|
||||
&efi_guid_rng_protocol,
|
||||
(void *)&efi_rng_protocol,
|
||||
#endif
|
||||
NULL));
|
||||
efi_root->type = EFI_OBJECT_TYPE_U_BOOT_FIRMWARE;
|
||||
|
|
|
@ -151,6 +151,11 @@ efi_status_t efi_init_obj_list(void)
|
|||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
#endif
|
||||
if (IS_ENABLED(CONFIG_EFI_RNG_PROTOCOL)) {
|
||||
ret = efi_rng_register();
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
}
|
||||
/* Initialize variable services */
|
||||
ret = efi_init_variables();
|
||||
if (ret != EFI_SUCCESS)
|
||||
|
|
Loading…
Add table
Reference in a new issue