[PATCH 00/16] EFI: ti: Enable EFI capsule updates

Enable on disk capsule updates, which includes defining the firmware components (tiboot3, spl, u-boot) and enabling processing of raw capsule updates.
This is enabled for several TI SoC based platforms: AM64, AM62, AM62p, BeaglePlay, J7, and BeagleboneAI.
This series also includes enabling seral flash DFU for AM62 and MMC DFU for beagleplay, and adding the sysreset controller node for AM62 to enable system reset.
Jonathan Humphreys (16): board: Define GUIDs for firmware images board: am64x: Define capsule update firmware info configs: am64x: Enable EFI capsule update board: j721e: Define capsule update firmware info configs: j721e: Enable EFI capsule update board: beagleplay: Define capsule update firmware info configs: beagleplay: Enable DFU for MMC configs: beagleplay: Enable EFI capsule update board: am62px: Define capsule update firmware info configs: am62px: Enable EFI capsule update configs: am62x: Enable serial flash DFU arm: dts: k3-am625-sk-u-boot: Add sysreset-controller node board: am62x: Define capsule update firmware info configs: am62x: Enable EFI capsule update board: beagleboneai64: Define capsule update firmware info configs: beagleboneai64: Enable EFI capsule update
arch/arm/dts/k3-am625-sk-u-boot.dtsi | 9 +++++ board/beagle/beagleboneai64/beagleboneai64.c | 33 +++++++++++++++++ board/beagle/beagleplay/beagleplay.c | 33 +++++++++++++++++ board/ti/am62px/evm.c | 32 +++++++++++++++++ board/ti/am62x/evm.c | 32 +++++++++++++++++ board/ti/am64x/evm.c | 33 +++++++++++++++++ board/ti/j721e/evm.c | 38 ++++++++++++++++++++ configs/am62px_evm_a53_defconfig | 2 ++ configs/am62x_beagleplay_a53_defconfig | 5 +++ configs/am62x_evm_a53_defconfig | 3 ++ configs/am64x_evm_a53_defconfig | 2 ++ configs/j721e_beagleboneai64_a72_defconfig | 2 ++ configs/j721e_evm_a72_defconfig | 2 ++ include/configs/ti_armv7_common.h | 17 +++++++++ 14 files changed, 243 insertions(+)

Define GUIDs for the different firmware images (tiboot3.bin, tispl.bin, u-boot.img, sysfw).
Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- include/configs/ti_armv7_common.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index 3def7b1027e..4ce14a9b84c 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -16,6 +16,23 @@ #ifndef __CONFIG_TI_ARMV7_COMMON_H__ #define __CONFIG_TI_ARMV7_COMMON_H__
+/* GUIDs for capsule updatable firmware images */ +#define K3_TIBOOT3_IMAGE_GUID \ + EFI_GUID(0xe672b518, 0x7cd7, 0x4014, 0xbd, 0x8d, \ + 0x40, 0x72, 0x4d, 0x0a, 0xd4, 0xdc) + +#define K3_SPL_IMAGE_GUID \ + EFI_GUID(0x86f710ad, 0x10cf, 0x46ea, 0xac, 0x67, \ + 0x85, 0x6a, 0xe0, 0x6e, 0xfa, 0xd2) + +#define K3_UBOOT_IMAGE_GUID \ + EFI_GUID(0x81b58fb0, 0x3b00, 0x4add, 0xa2, 0x0a, \ + 0xc1, 0x85, 0xbb, 0xac, 0xa1, 0xed) + +#define K3_SYSFW_IMAGE_GUID \ + EFI_GUID(0x6fd10680, 0x361b, 0x431f, 0x80, 0xaa, \ + 0x89, 0x94, 0x55, 0x81, 0x9e, 0x11) + /* * We setup defaults based on constraints from the Linux kernel, which should * also be safe elsewhere. We have the default load at 32MB into DDR (for

Define the firmwares updatable via EFI capsule update.
Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- board/ti/am64x/evm.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c index b8de69da06c..a151023bb7e 100644 --- a/board/ti/am64x/evm.c +++ b/board/ti/am64x/evm.c @@ -7,6 +7,7 @@ * */
+#include <efi_loader.h> #include <asm/io.h> #include <dm/uclass.h> #include <k3-ddrss.h> @@ -27,6 +28,38 @@
DECLARE_GLOBAL_DATA_PTR;
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = K3_TIBOOT3_IMAGE_GUID, + .fw_name = u"K3_TIBOOT3", + .image_index = 1, + }, + { + .image_type_id = K3_SPL_IMAGE_GUID, + .fw_name = u"K3_SPL", + .image_index = 2, + }, + { + .image_type_id = K3_UBOOT_IMAGE_GUID, + .fw_name = u"K3_UBOOT", + .image_index = 3, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "sf 0:0=tiboot3.bin raw 0 100000;tispl.bin raw 100000 200000;u-boot.img raw 300000 400000", + .num_images = ARRAY_SIZE(fw_images), + .images = fw_images, +}; + +void set_dfu_alt_info(char *interface, char *devstr) +{ + env_set("dfu_alt_info", update_info.dfu_string); +} + +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_init(void) { return 0;

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- configs/am64x_evm_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig index 61b498b49a6..8ba17ea89f9 100644 --- a/configs/am64x_evm_a53_defconfig +++ b/configs/am64x_evm_a53_defconfig @@ -177,3 +177,5 @@ CONFIG_USB_FUNCTION_MASS_STORAGE=y CONFIG_SPL_DFU=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 CONFIG_EFI_SET_TIME=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- board/ti/j721e/evm.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 9dc3ed6dfff..b8702b83547 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -7,6 +7,7 @@ * */
+#include <efi_loader.h> #include <generic-phy.h> #include <image.h> #include <net.h> @@ -32,6 +33,43 @@
DECLARE_GLOBAL_DATA_PTR;
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = K3_TIBOOT3_IMAGE_GUID, + .fw_name = u"K3_TIBOOT3", + .image_index = 1, + }, + { + .image_type_id = K3_SPL_IMAGE_GUID, + .fw_name = u"K3_SPL", + .image_index = 2, + }, + { + .image_type_id = K3_UBOOT_IMAGE_GUID, + .fw_name = u"K3_UBOOT", + .image_index = 3, + }, + { + .image_type_id = K3_SYSFW_IMAGE_GUID, + .fw_name = u"K3_SYSFW", + .image_index = 4, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "sf 0:0=tiboot3.bin raw 0 80000;tispl.bin raw 80000 200000;u-boot.img raw 280000 400000;sysfw.itb raw 6C0000 100000", + .num_images = ARRAY_SIZE(fw_images), + .images = fw_images, +}; + +void set_dfu_alt_info(char *interface, char *devstr) +{ + env_set("dfu_alt_info", update_info.dfu_string); +} + +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_init(void) { return 0;

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- configs/j721e_evm_a72_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig index 077bf508328..b8840a556e1 100644 --- a/configs/j721e_evm_a72_defconfig +++ b/configs/j721e_evm_a72_defconfig @@ -210,3 +210,5 @@ CONFIG_UFS=y CONFIG_CADENCE_UFS=y CONFIG_TI_J721E_UFS=y CONFIG_EFI_SET_TIME=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- board/beagle/beagleplay/beagleplay.c | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
diff --git a/board/beagle/beagleplay/beagleplay.c b/board/beagle/beagleplay/beagleplay.c index af36439e2e2..1d19a78305b 100644 --- a/board/beagle/beagleplay/beagleplay.c +++ b/board/beagle/beagleplay/beagleplay.c @@ -6,6 +6,7 @@ * Copyright (C) 2022-2023 Robert Nelson, BeagleBoard.org Foundation */
+#include <efi_loader.h> #include <cpu_func.h> #include <env.h> #include <fdt_support.h> @@ -15,6 +16,38 @@
DECLARE_GLOBAL_DATA_PTR;
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = K3_TIBOOT3_IMAGE_GUID, + .fw_name = u"K3_TIBOOT3", + .image_index = 1, + }, + { + .image_type_id = K3_SPL_IMAGE_GUID, + .fw_name = u"K3_SPL", + .image_index = 2, + }, + { + .image_type_id = K3_UBOOT_IMAGE_GUID, + .fw_name = u"K3_UBOOT", + .image_index = 3, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "mmc 0=tiboot3.bin raw 0 2000 mmcpart 1;tispl.bin fat 0 1;u-boot.img fat 0 1", + .num_images = ARRAY_SIZE(fw_images), + .images = fw_images, +}; + +void set_dfu_alt_info(char *interface, char *devstr) +{ + env_set("dfu_alt_info", update_info.dfu_string); +} + +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_init(void) { return 0;

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- configs/am62x_beagleplay_a53_defconfig | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/configs/am62x_beagleplay_a53_defconfig b/configs/am62x_beagleplay_a53_defconfig index 147967d3c11..68e103f58dc 100644 --- a/configs/am62x_beagleplay_a53_defconfig +++ b/configs/am62x_beagleplay_a53_defconfig @@ -70,6 +70,9 @@ CONFIG_SPL_OF_TRANSLATE=y CONFIG_CLK=y CONFIG_SPL_CLK=y CONFIG_CLK_TI_SCI=y +CONFIG_DFU_MMC=y +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000 +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x180000 CONFIG_DMA_CHANNELS=y CONFIG_TI_K3_NAVSS_UDMA=y CONFIG_TI_SCI_PROTOCOL=y

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- configs/am62x_beagleplay_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/am62x_beagleplay_a53_defconfig b/configs/am62x_beagleplay_a53_defconfig index 68e103f58dc..23b9c466248 100644 --- a/configs/am62x_beagleplay_a53_defconfig +++ b/configs/am62x_beagleplay_a53_defconfig @@ -124,3 +124,5 @@ CONFIG_EXT4_WRITE=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 CONFIG_LZO=y CONFIG_EFI_SET_TIME=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y

Define the firmwares updatable via EFI capsule update.
Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- board/ti/am62px/evm.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c index 97a95ce8cc2..980cc172b2f 100644 --- a/board/ti/am62px/evm.c +++ b/board/ti/am62px/evm.c @@ -6,6 +6,7 @@ * */
+#include <efi_loader.h> #include <asm/arch/hardware.h> #include <asm/io.h> #include <dm/uclass.h> @@ -13,6 +14,37 @@ #include <fdt_support.h> #include <spl.h>
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = K3_TIBOOT3_IMAGE_GUID, + .fw_name = u"K3_TIBOOT3", + .image_index = 1, + }, + { + .image_type_id = K3_SPL_IMAGE_GUID, + .fw_name = u"K3_SPL", + .image_index = 2, + }, + { + .image_type_id = K3_UBOOT_IMAGE_GUID, + .fw_name = u"K3_UBOOT", + .image_index = 3, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "sf 0:0=tiboot3.bin raw 0 80000;tispl.bin raw 80000 200000;u-boot.img raw 280000 400000", + .num_images = ARRAY_SIZE(fw_images), + .images = fw_images, +}; + +void set_dfu_alt_info(char *interface, char *devstr) +{ + env_set("dfu_alt_info", update_info.dfu_string); +} +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_init(void) { return 0;

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- configs/am62px_evm_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig index 65dfda19f18..15ba1079760 100644 --- a/configs/am62px_evm_a53_defconfig +++ b/configs/am62px_evm_a53_defconfig @@ -176,3 +176,5 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6165 CONFIG_SPL_DFU=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 CONFIG_EFI_SET_TIME=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- configs/am62x_evm_a53_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig index d650b8575b6..0e6c94de538 100644 --- a/configs/am62x_evm_a53_defconfig +++ b/configs/am62x_evm_a53_defconfig @@ -67,6 +67,7 @@ CONFIG_SPL_OF_TRANSLATE=y CONFIG_CLK=y CONFIG_SPL_CLK=y CONFIG_CLK_TI_SCI=y +CONFIG_DFU_SF=y CONFIG_DMA_CHANNELS=y CONFIG_TI_K3_NAVSS_UDMA=y CONFIG_TI_SCI_PROTOCOL=y

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- arch/arm/dts/k3-am625-sk-u-boot.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/arch/arm/dts/k3-am625-sk-u-boot.dtsi b/arch/arm/dts/k3-am625-sk-u-boot.dtsi index fa778b0ff4c..35bfeae75a0 100644 --- a/arch/arm/dts/k3-am625-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am625-sk-u-boot.dtsi @@ -46,3 +46,12 @@ &cpsw_port2 { status = "disabled"; }; + +&dmsc { + bootph-pre-ram; + + k3_sysreset: sysreset-controller { + compatible = "ti,sci-sysreset"; + bootph-pre-ram; + }; +};

Hi Jonathan,
On 09-Apr-24 2:52 AM, Jonathan Humphreys wrote:
Signed-off-by: Jonathan Humphreys j-humphreys@ti.com
Maybe this requires a commit message? It's not as self-explanatory to this series as the rest of the patches.
arch/arm/dts/k3-am625-sk-u-boot.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/arch/arm/dts/k3-am625-sk-u-boot.dtsi b/arch/arm/dts/k3-am625-sk-u-boot.dtsi index fa778b0ff4c..35bfeae75a0 100644 --- a/arch/arm/dts/k3-am625-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am625-sk-u-boot.dtsi @@ -46,3 +46,12 @@ &cpsw_port2 { status = "disabled"; };
+&dmsc {
- bootph-pre-ram;
- k3_sysreset: sysreset-controller {
compatible = "ti,sci-sysreset";
bootph-pre-ram;
- };
+};

Define the firmwares updatable via EFI capsule update.
Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- board/ti/am62x/evm.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c index b3e8680dfab..595c98982bb 100644 --- a/board/ti/am62x/evm.c +++ b/board/ti/am62x/evm.c @@ -7,6 +7,7 @@ * */
+#include <efi_loader.h> #include <env.h> #include <spl.h> #include <init.h> @@ -46,6 +47,37 @@ int splash_screen_prepare(void) } #endif
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = K3_TIBOOT3_IMAGE_GUID, + .fw_name = u"K3_TIBOOT3", + .image_index = 1, + }, + { + .image_type_id = K3_SPL_IMAGE_GUID, + .fw_name = u"K3_SPL", + .image_index = 2, + }, + { + .image_type_id = K3_UBOOT_IMAGE_GUID, + .fw_name = u"K3_UBOOT", + .image_index = 3, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "sf 0:0=tiboot3.bin raw 0 80000;tispl.bin raw 80000 200000;u-boot.img raw 280000 480000", + .num_images = ARRAY_SIZE(fw_images), + .images = fw_images, +}; + +void set_dfu_alt_info(char *interface, char *devstr) +{ + env_set("dfu_alt_info", update_info.dfu_string); +} +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_init(void) { return 0;

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- configs/am62x_evm_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig index 0e6c94de538..11af7b517d1 100644 --- a/configs/am62x_evm_a53_defconfig +++ b/configs/am62x_evm_a53_defconfig @@ -111,3 +111,5 @@ CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_TI_SCI=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 CONFIG_EFI_SET_TIME=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- board/beagle/beagleboneai64/beagleboneai64.c | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+)
diff --git a/board/beagle/beagleboneai64/beagleboneai64.c b/board/beagle/beagleboneai64/beagleboneai64.c index c5b4ff7df47..9caf63b9834 100644 --- a/board/beagle/beagleboneai64/beagleboneai64.c +++ b/board/beagle/beagleboneai64/beagleboneai64.c @@ -7,6 +7,7 @@ * Copyright (C) 2022-2023 Robert Nelson, BeagleBoard.org Foundation */
+#include <efi_loader.h> #include <cpu_func.h> #include <env.h> #include <fdt_support.h> @@ -14,6 +15,38 @@
DECLARE_GLOBAL_DATA_PTR;
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = K3_TIBOOT3_IMAGE_GUID, + .fw_name = u"K3_TIBOOT3", + .image_index = 1, + }, + { + .image_type_id = K3_SPL_IMAGE_GUID, + .fw_name = u"K3_SPL", + .image_index = 2, + }, + { + .image_type_id = K3_UBOOT_IMAGE_GUID, + .fw_name = u"K3_UBOOT", + .image_index = 3, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "mmc 0=tiboot3.bin raw 0 2000 mmcpart 1;tispl.bin fat 0 1;u-boot.img fat 0 1", + .num_images = ARRAY_SIZE(fw_images), + .images = fw_images, +}; + +void set_dfu_alt_info(char *interface, char *devstr) +{ + env_set("dfu_alt_info", update_info.dfu_string); +} + +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_init(void) { return 0;

Signed-off-by: Jonathan Humphreys j-humphreys@ti.com --- configs/j721e_beagleboneai64_a72_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/j721e_beagleboneai64_a72_defconfig b/configs/j721e_beagleboneai64_a72_defconfig index 3d234bc1a8f..e74ee68e23e 100644 --- a/configs/j721e_beagleboneai64_a72_defconfig +++ b/configs/j721e_beagleboneai64_a72_defconfig @@ -172,3 +172,5 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6163 CONFIG_SPL_DFU=y CONFIG_LZO=y CONFIG_EFI_SET_TIME=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
participants (2)
-
Jonathan Humphreys
-
Neha Malcom Francis