aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini2022-04-15 14:29:52 -0400
committerTom Rini2022-04-15 14:29:52 -0400
commit9859465bfe838bc8264d45e1a1bed847bba74bad (patch)
treee29b11e0d87344cca7cd88ab17bc2104e0d691cc /include
parent7f418ea59852945eeb9e5d2555d306f09643d555 (diff)
parent8bf5f9af3b4bafbcb2f515cecc1b71c466aff0fa (diff)
Merge tag 'efi-2022-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2022-07-rc1-2 Documentation: * Describe env command UEFI * simplify Unicode string functions * clean up the usage of GUIDs for capsule updates
Diffstat (limited to 'include')
-rw-r--r--include/charset.h26
-rw-r--r--include/configs/imx8mm-cl-iot-gate.h9
-rw-r--r--include/configs/imx8mp_rsb3720.h9
-rw-r--r--include/configs/kontron-sl-mx8mm.h5
-rw-r--r--include/configs/kontron_pitx_imx8m.h5
-rw-r--r--include/configs/kontron_sl28.h5
-rw-r--r--include/configs/qemu-arm.h9
-rw-r--r--include/configs/sandbox.h13
-rw-r--r--include/configs/synquacer.h13
-rw-r--r--include/configs/xilinx_versal.h5
-rw-r--r--include/configs/xilinx_zynqmp.h9
-rw-r--r--include/configs/zynq-common.h9
-rw-r--r--include/efi_api.h8
-rw-r--r--include/efi_loader.h36
14 files changed, 141 insertions, 20 deletions
diff --git a/include/charset.h b/include/charset.h
index b93d0230923..38908e08f0d 100644
--- a/include/charset.h
+++ b/include/charset.h
@@ -201,18 +201,6 @@ int u16_strncmp(const u16 *s1, const u16 *s2, size_t n);
#define u16_strcmp(s1, s2) u16_strncmp((s1), (s2), SIZE_MAX)
/**
- * u16_strlen - count non-zero words
- *
- * This function matches wsclen() if the -fshort-wchar compiler flag is set.
- * In the EFI context we explicitly need a function handling u16 strings.
- *
- * @in: null terminated u16 string
- * Return: number of non-zero words.
- * This is not the number of utf-16 letters!
- */
-size_t u16_strlen(const void *in);
-
-/**
* u16_strsize() - count size of u16 string in bytes including the null
* character
*
@@ -237,6 +225,20 @@ size_t u16_strsize(const void *in);
size_t u16_strnlen(const u16 *in, size_t count);
/**
+ * u16_strlen - count non-zero words
+ *
+ * This function matches wsclen() if the -fshort-wchar compiler flag is set.
+ * In the EFI context we explicitly need a function handling u16 strings.
+ *
+ * @in: null terminated u16 string
+ * Return: number of non-zero words.
+ * This is not the number of utf-16 letters!
+ */
+size_t u16_strlen(const void *in);
+
+#define u16_strlen(in) u16_strnlen(in, SIZE_MAX)
+
+/**
* u16_strcpy() - copy u16 string
*
* Copy u16 string pointed to by src, including terminating null word, to
diff --git a/include/configs/imx8mm-cl-iot-gate.h b/include/configs/imx8mm-cl-iot-gate.h
index 14d3f3cac65..b2cde030732 100644
--- a/include/configs/imx8mm-cl-iot-gate.h
+++ b/include/configs/imx8mm-cl-iot-gate.h
@@ -31,6 +31,15 @@
#endif
+/* GUIDs for capsule updatable firmware images */
+#define IMX8MM_CL_IOT_GATE_FIT_IMAGE_GUID \
+ EFI_GUID(0x7a32a939, 0xab92, 0x467b, 0x91, 0x52, \
+ 0x74, 0x77, 0x1b, 0x95, 0xe6, 0x46)
+
+#define IMX8MM_CL_IOT_GATE_OPTEE_FIT_IMAGE_GUID \
+ EFI_GUID(0x0bf1165c, 0x1831, 0x4864, 0x94, 0x5e, \
+ 0xac, 0x3d, 0x38, 0x48, 0xf4, 0x99)
+
#if CONFIG_IS_ENABLED(CMD_MMC)
# define BOOT_TARGET_MMC(func) \
func(MMC, mmc, 2) \
diff --git a/include/configs/imx8mp_rsb3720.h b/include/configs/imx8mp_rsb3720.h
index 62e06d23034..2553f0dfb5c 100644
--- a/include/configs/imx8mp_rsb3720.h
+++ b/include/configs/imx8mp_rsb3720.h
@@ -18,6 +18,15 @@
#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
#define CONFIG_SYS_UBOOT_BASE (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
+/* GUIDs for capsule updatable firmware images */
+#define IMX8MP_RSB3720A1_4G_FIT_IMAGE_GUID \
+ EFI_GUID(0xb1251e89, 0x384a, 0x4635, 0xa8, 0x06, \
+ 0x3a, 0xa0, 0xb0, 0xe9, 0xf9, 0x65)
+
+#define IMX8MP_RSB3720A1_6G_FIT_IMAGE_GUID \
+ EFI_GUID(0xb5fb6f08, 0xe142, 0x4db1, 0x97, 0xea, \
+ 0x5f, 0xd3, 0x6b, 0x9b, 0xe5, 0xb9)
+
#ifdef CONFIG_SPL_BUILD
#define CONFIG_SPL_STACK 0x960000
#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00
diff --git a/include/configs/kontron-sl-mx8mm.h b/include/configs/kontron-sl-mx8mm.h
index 788ae77cd31..1b429f7dbe2 100644
--- a/include/configs/kontron-sl-mx8mm.h
+++ b/include/configs/kontron-sl-mx8mm.h
@@ -38,6 +38,11 @@
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#endif
+/* GUID for capsule updatable firmware image */
+#define KONTRON_SL_MX8MM_FIT_IMAGE_GUID \
+ EFI_GUID(0xd488e45a, 0x4929, 0x4b55, 0x8c, 0x14, \
+ 0x86, 0xce, 0xa2, 0xcd, 0x66, 0x29)
+
#ifndef CONFIG_SPL_BUILD
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 1) \
diff --git a/include/configs/kontron_pitx_imx8m.h b/include/configs/kontron_pitx_imx8m.h
index f96240cb95d..e8e92920dcb 100644
--- a/include/configs/kontron_pitx_imx8m.h
+++ b/include/configs/kontron_pitx_imx8m.h
@@ -12,6 +12,11 @@
#define CONFIG_SPL_MAX_SIZE (124 * SZ_1K)
#define CONFIG_SYS_MONITOR_LEN (512 * SZ_1K)
+/* GUID for capsule updatable firmware image */
+#define KONTRON_PITX_IMX8M_FIT_IMAGE_GUID \
+ EFI_GUID(0xc898e959, 0x5b1f, 0x4e6d, 0x88, 0xe0, \
+ 0x40, 0xd4, 0x5c, 0xca, 0x13, 0x99)
+
#ifdef CONFIG_SPL_BUILD
#define CONFIG_SPL_STACK 0x187FF0
#define CONFIG_SPL_BSS_START_ADDR 0x00180000
diff --git a/include/configs/kontron_sl28.h b/include/configs/kontron_sl28.h
index 97286b6180a..c3ab049535a 100644
--- a/include/configs/kontron_sl28.h
+++ b/include/configs/kontron_sl28.h
@@ -52,6 +52,11 @@
#define CONFIG_SYS_SPL_MALLOC_START 0x80200000
#define CONFIG_SYS_MONITOR_LEN (1024 * 1024)
+/* GUID for capsule updatable firmware image */
+#define KONTRON_SL28_FIT_IMAGE_GUID \
+ EFI_GUID(0x86ebd44f, 0xfeb8, 0x466f, 0x8b, 0xb8, \
+ 0x89, 0x06, 0x18, 0x45, 0x6d, 0x8b)
+
/* environment */
/* see include/configs/ti_armv7_common.h */
#define ENV_MEM_LAYOUT_SETTINGS \
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
index 3ad1cf3232d..550e26f3f18 100644
--- a/include/configs/qemu-arm.h
+++ b/include/configs/qemu-arm.h
@@ -17,6 +17,15 @@
#define CONFIG_SYS_BOOTM_LEN SZ_64M
+/* GUIDs for capsule updatable firmware images */
+#define QEMU_ARM_UBOOT_IMAGE_GUID \
+ EFI_GUID(0xf885b085, 0x99f8, 0x45af, 0x84, 0x7d, \
+ 0xd5, 0x14, 0x10, 0x7a, 0x4a, 0x2c)
+
+#define QEMU_ARM64_UBOOT_IMAGE_GUID \
+ EFI_GUID(0x058b7d83, 0x50d5, 0x4c47, 0xa1, 0x95, \
+ 0x60, 0xd8, 0x6a, 0xd3, 0x41, 0xc4)
+
/* For timer, QEMU emulates an ARMv7/ARMv8 architected timer */
/* Environment options */
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 71b47996da5..7b6db46ee17 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -14,6 +14,19 @@
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
+/* GUIDs for capsule updatable firmware images */
+#define SANDBOX_UBOOT_IMAGE_GUID \
+ EFI_GUID(0x09d7cf52, 0x0720, 0x4710, 0x91, 0xd1, \
+ 0x08, 0x46, 0x9b, 0x7f, 0xe9, 0xc8)
+
+#define SANDBOX_UBOOT_ENV_IMAGE_GUID \
+ EFI_GUID(0x5a7021f5, 0xfef2, 0x48b4, 0xaa, 0xba, \
+ 0x83, 0x2e, 0x77, 0x74, 0x18, 0xc0)
+
+#define SANDBOX_FIT_IMAGE_GUID \
+ EFI_GUID(0x3673b45d, 0x6a7c, 0x46f3, 0x9e, 0x60, \
+ 0xad, 0xab, 0xb0, 0x3f, 0x79, 0x37)
+
/* Size of our emulated memory */
#define SB_CONCAT(x, y) x ## y
#define SB_TO_UL(s) SB_CONCAT(s, UL)
diff --git a/include/configs/synquacer.h b/include/configs/synquacer.h
index 8dd092fc599..5686a5b9104 100644
--- a/include/configs/synquacer.h
+++ b/include/configs/synquacer.h
@@ -51,6 +51,19 @@
"fip.bin raw 180000 78000;" \
"optee.bin raw 500000 100000\0"
+/* GUIDs for capsule updatable firmware images */
+#define DEVELOPERBOX_UBOOT_IMAGE_GUID \
+ EFI_GUID(0x53a92e83, 0x4ef4, 0x473a, 0x8b, 0x0d, \
+ 0xb5, 0xd8, 0xc7, 0xb2, 0xd6, 0x00)
+
+#define DEVELOPERBOX_FIP_IMAGE_GUID \
+ EFI_GUID(0x880866e9, 0x84ba, 0x4793, 0xa9, 0x08, \
+ 0x33, 0xe0, 0xb9, 0x16, 0xf3, 0x98)
+
+#define DEVELOPERBOX_OPTEE_IMAGE_GUID \
+ EFI_GUID(0xc1b629f1, 0xce0e, 0x4894, 0x82, 0xbf, \
+ 0xf0, 0xa3, 0x83, 0x87, 0xe6, 0x30)
+
/* Distro boot settings */
#ifndef CONFIG_SPL_BUILD
#ifdef CONFIG_CMD_USB
diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
index 80e94113f07..b025d2638d8 100644
--- a/include/configs/xilinx_versal.h
+++ b/include/configs/xilinx_versal.h
@@ -25,6 +25,11 @@
#define CONFIG_SYS_BAUDRATE_TABLE \
{ 4800, 9600, 19200, 38400, 57600, 115200 }
+/* GUID for capsule updatable firmware image */
+#define XILINX_BOOT_IMAGE_GUID \
+ EFI_GUID(0x20c5fba5, 0x0171, 0x457f, 0xb9, 0xcd, \
+ 0xf5, 0x12, 0x9c, 0xd0, 0x72, 0x28)
+
/* Miscellaneous configurable options */
/* Monitor Command Prompt */
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 1985a093256..e5e700d8045 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -25,6 +25,15 @@
#define CONFIG_SYS_BAUDRATE_TABLE \
{ 4800, 9600, 19200, 38400, 57600, 115200 }
+/* GUIDs for capsule updatable firmware images */
+#define XILINX_BOOT_IMAGE_GUID \
+ EFI_GUID(0xde6066e8, 0x0256, 0x4fad, 0x82, 0x38, \
+ 0xe4, 0x06, 0xe2, 0x74, 0xc4, 0xcf)
+
+#define XILINX_UBOOT_IMAGE_GUID \
+ EFI_GUID(0xcf9ecfd4, 0x938b, 0x41c5, 0x85, 0x51, \
+ 0x1f, 0x88, 0x3a, 0xb7, 0xdc, 0x18)
+
#ifdef CONFIG_NAND_ARASAN
# define CONFIG_SYS_MAX_NAND_DEVICE 1
#endif
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index c92f796f8d6..bd88b59f242 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -20,6 +20,15 @@
#define CONFIG_SYS_TIMER_COUNTS_DOWN
#define CONFIG_SYS_TIMER_COUNTER (CONFIG_SYS_TIMERBASE + 0x4)
+/* GUIDs for capsule updatable firmware images */
+#define XILINX_BOOT_IMAGE_GUID \
+ EFI_GUID(0x1ba29a15, 0x9969, 0x40aa, 0xb4, 0x24, \
+ 0xe8, 0x61, 0x21, 0x61, 0x86, 0x64)
+
+#define XILINX_UBOOT_IMAGE_GUID \
+ EFI_GUID(0x1a5178f0, 0x87d3, 0x4f36, 0xac, 0x63, \
+ 0x3b, 0x31, 0xa2, 0x3b, 0xe3, 0x05)
+
/* Serial drivers */
/* The following table includes the supported baudrates */
#define CONFIG_SYS_BAUDRATE_TABLE \
diff --git a/include/efi_api.h b/include/efi_api.h
index 982c2001728..c7f7873b5d4 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -1967,14 +1967,6 @@ struct efi_signature_list {
EFI_GUID(0x86c77a67, 0x0b97, 0x4633, 0xa1, 0x87, \
0x49, 0x10, 0x4d, 0x06, 0x85, 0xc7)
-#define EFI_FIRMWARE_IMAGE_TYPE_UBOOT_FIT_GUID \
- EFI_GUID(0xae13ff2d, 0x9ad4, 0x4e25, 0x9a, 0xc8, \
- 0x6d, 0x80, 0xb3, 0xb2, 0x21, 0x47)
-
-#define EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID \
- EFI_GUID(0xe2bb9c06, 0x70e9, 0x4b14, 0x97, 0xa3, \
- 0x5a, 0x79, 0x13, 0x17, 0x6e, 0x3f)
-
#define IMAGE_ATTRIBUTE_IMAGE_UPDATABLE 0x0000000000000001
#define IMAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002
#define IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004
diff --git a/include/efi_loader.h b/include/efi_loader.h
index af36639ec6a..c52ea59ec7a 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -980,6 +980,42 @@ efi_status_t efi_capsule_authenticate(const void *capsule,
#define EFI_CAPSULE_DIR u"\\EFI\\UpdateCapsule\\"
/**
+ * struct efi_fw_image - Information on firmware images updatable through
+ * capsule update
+ *
+ * This structure gives information about the firmware images on the platform
+ * which can be updated through the capsule update mechanism
+ *
+ * @image_type_id: Image GUID. Same value is to be used in the capsule
+ * @fw_name: Name of the firmware image
+ * @image_index: Image Index, same as value passed to SetImage FMP
+ * function
+ */
+struct efi_fw_image {
+ efi_guid_t image_type_id;
+ u16 *fw_name;
+ u8 image_index;
+};
+
+/**
+ * struct efi_capsule_update_info - Information needed for capsule updates
+ *
+ * This structure provides information needed for performing firmware
+ * updates. The structure needs to be initialised per platform, for all
+ * platforms which enable capsule updates
+ *
+ * @dfu_string: String used to populate dfu_alt_info
+ * @images: Pointer to an array of updatable images
+ */
+struct efi_capsule_update_info {
+ const char *dfu_string;
+ struct efi_fw_image *images;
+};
+
+extern struct efi_capsule_update_info update_info;
+extern u8 num_image_type_guids;
+
+/**
* Install the ESRT system table.
*
* Return: status code