]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_rng_protocol: Install the efi_rng_protocol on the root node
authorSughosh Ganu <sughosh.ganu@linaro.org>
Sat, 28 Dec 2019 18:31:06 +0000 (00:01 +0530)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 7 Jan 2020 17:08:22 +0000 (18:08 +0100)
Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/efi_loader.h
lib/efi_loader/efi_rng.c
lib/efi_loader/efi_root_node.c

index e1c9b1fd6a959a5bc8ba8941932c7fae6d8d4a7a..d4c59b54c48b4e53a456aed05b06ad0cf056bd55 100644 (file)
@@ -133,6 +133,7 @@ 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);
 
@@ -178,6 +179,9 @@ extern const efi_guid_t efi_guid_hii_config_access_protocol;
 extern const efi_guid_t efi_guid_hii_database_protocol;
 extern const efi_guid_t efi_guid_hii_string_protocol;
 
+/* GUID of RNG protocol */
+extern const efi_guid_t efi_guid_rng_protocol;
+
 extern unsigned int __efi_runtime_start, __efi_runtime_stop;
 extern unsigned int __efi_runtime_rel_start, __efi_runtime_rel_stop;
 
index 47aaa6adca8102c0de3224ede365ccd267439a88..432c9862046044eaa88c88102736c9bd9d96a32b 100644 (file)
@@ -11,6 +11,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+const efi_guid_t efi_guid_rng_protocol = EFI_RNG_PROTOCOL_GUID;
+
 __weak efi_status_t platform_get_rng_device(struct udevice **dev)
 {
        int ret;
index f68b0fdc610fc9577923c305cfb70cca3b8f0035..76d18fb1a4adeeefe3f14684c5644c11347feda4 100644 (file)
@@ -80,6 +80,10 @@ 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;