aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-09-13 08:20:25 -0600
committerTom Rini <trini@konsulko.com>2024-09-13 08:20:25 -0600
commit35394e1ea77ba0ad971d9115bd965a2403c0e031 (patch)
treec42dec5a1ecdcbae74a7b62603dadf874542ee68 /include
parent9eb0d731d800b4fbc8e9ed0178fec0d6f201d911 (diff)
parent7de51622a2cf901e888d703a7bea33ad16645d3b (diff)
downloadu-boot-35394e1ea77ba0ad971d9115bd965a2403c0e031.tar.gz
Merge tag 'efi-next-20241024' of https://source.denx.de/u-boot/custodians/u-boot-efi into next
Pull request efi-next-20241024 UEFI: * Use generated UUIDs in UEFI capsules: - efi: define struct efi_guid - lib: uuid: add UUID v5 support - efi: add a helper to generate dynamic UUIDs - doc: uefi: document dynamic UUID generation - sandbox: switch to dynamic UUIDs - lib: uuid: supporting building as part of host tools - include: export uuid.h - tools: mkeficapsule: use u-boot UUID library - tools: mkeficapsule: support generating dynamic GUIDs - test: lib/uuid: add unit tests for dynamic UUIDs - test: lib/uuid: add tests for UUID version/variant bits * Minor code clean-up - shorten efi_bootmgr_release_uridp_resource() - rename efi_bootmgr_image_return_notify - return the correct error in efi_bootmgr_release_uridp() - Kconfig: clean up the efi configuration status - Use puts() in cout so that console recording works - Put back copyright message in helloworld.c
Diffstat (limited to 'include')
-rw-r--r--include/efi.h2
-rw-r--r--include/fwu.h2
-rw-r--r--include/part.h2
-rw-r--r--include/rkmtd.h2
-rw-r--r--include/sandbox_efi_capsule.h6
-rw-r--r--include/u-boot/uuid.h (renamed from include/uuid.h)21
6 files changed, 24 insertions, 11 deletions
diff --git a/include/efi.h b/include/efi.h
index d5af2139946..84640cf7b25 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -74,7 +74,7 @@ struct efi_device_path {
* struct { u32 a; u16; b; u16 c; u8 d[8]; }; which is 4-byte
* aligned.
*/
-typedef struct {
+typedef struct efi_guid {
u8 b[16];
} efi_guid_t __attribute__((aligned(4)));
diff --git a/include/fwu.h b/include/fwu.h
index 77ec65e6180..c317613eaaa 100644
--- a/include/fwu.h
+++ b/include/fwu.h
@@ -10,7 +10,7 @@
#include <efi.h>
#include <fwu_mdata.h>
#include <mtd.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
#include <linux/types.h>
diff --git a/include/part.h b/include/part.h
index 54b986cee63..797b542ef1f 100644
--- a/include/part.h
+++ b/include/part.h
@@ -8,7 +8,7 @@
#include <blk.h>
#include <ide.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
#include <linker_lists.h>
#include <linux/errno.h>
#include <linux/list.h>
diff --git a/include/rkmtd.h b/include/rkmtd.h
index 145fede6c84..b7479036b39 100644
--- a/include/rkmtd.h
+++ b/include/rkmtd.h
@@ -11,7 +11,7 @@
#define __RKMTD__
#include <part_efi.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
#define LBA 64 + 512 + 33
diff --git a/include/sandbox_efi_capsule.h b/include/sandbox_efi_capsule.h
index 3e288e8a84a..84d45ec5cfd 100644
--- a/include/sandbox_efi_capsule.h
+++ b/include/sandbox_efi_capsule.h
@@ -6,9 +6,9 @@
#if !defined(_SANDBOX_EFI_CAPSULE_H_)
#define _SANDBOX_EFI_CAPSULE_H_
-#define SANDBOX_UBOOT_IMAGE_GUID "09d7cf52-0720-4710-91d1-08469b7fe9c8"
-#define SANDBOX_UBOOT_ENV_IMAGE_GUID "5a7021f5-fef2-48b4-aaba-832e777418c0"
-#define SANDBOX_FIT_IMAGE_GUID "3673b45d-6a7c-46f3-9e60-adabb03f7937"
+#define SANDBOX_UBOOT_IMAGE_GUID "985f2937-7c2e-5e9a-8a5e-8e063312964b"
+#define SANDBOX_UBOOT_ENV_IMAGE_GUID "9e339473-c2eb-530a-a69b-0cd6bbbed40e"
+#define SANDBOX_FIT_IMAGE_GUID "46610520-469e-59dc-a8dd-c11832b877ea"
#define SANDBOX_INCORRECT_GUID "058b7d83-50d5-4c47-a195-60d86ad341c4"
#define UBOOT_FIT_IMAGE "u-boot_bin_env.itb"
diff --git a/include/uuid.h b/include/u-boot/uuid.h
index f5a941250f4..7f8414dc906 100644
--- a/include/uuid.h
+++ b/include/u-boot/uuid.h
@@ -11,6 +11,7 @@
#define __UUID_H__
#include <linux/bitops.h>
+#include <linux/kconfig.h>
/*
* UUID - Universally Unique IDentifier - 128 bits unique number.
@@ -46,8 +47,8 @@
* When converting to a binary UUID, le means the field should be converted
* to little endian and be means it should be converted to big endian.
*
- * UUID is also used as GUID (Globally Unique Identifier) with the same binary
- * format but it differs in string format like below.
+ * UUID is also used as GUID (Globally Unique Identifier) with the same format
+ * but with some fields stored in little endian.
*
* GUID:
* 0 9 14 19 24
@@ -69,8 +70,8 @@ struct uuid {
/* Bits of a bitmask specifying the output format for GUIDs */
#define UUID_STR_FORMAT_STD 0
-#define UUID_STR_FORMAT_GUID BIT(0)
-#define UUID_STR_UPPER_CASE BIT(1)
+#define UUID_STR_FORMAT_GUID 0x1
+#define UUID_STR_UPPER_CASE 0x2
/* Use UUID_STR_LEN + 1 for string space */
#define UUID_STR_LEN 36
@@ -143,6 +144,18 @@ void gen_rand_uuid(unsigned char *uuid_bin);
*/
void gen_rand_uuid_str(char *uuid_str, int str_format);
+struct efi_guid;
+
+/**
+ * gen_v5_guid() - generate little endian v5 GUID from namespace and other seed data.
+ *
+ * @namespace: pointer to UUID namespace salt
+ * @guid: pointer to allocated GUID output
+ * @...: NULL terminated list of seed data as pairs of pointers
+ * to data and their lengths
+ */
+void gen_v5_guid(const struct uuid *namespace, struct efi_guid *guid, ...);
+
/**
* uuid_str_to_le_bin() - Convert string UUID to little endian binary data.
* @uuid_str: pointer to UUID string