]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: sk-am69: Define capsule update firmware info
authorJonathan Humphreys <j-humphreys@ti.com>
Fri, 14 Jun 2024 16:35:49 +0000 (11:35 -0500)
committerTom Rini <trini@konsulko.com>
Tue, 18 Jun 2024 16:43:29 +0000 (10:43 -0600)
Define the firmware components updatable via EFI capsule update, including
defining capsule GUIDs for the various firmware components for the AM69
SK.

TODO: possibly make the struct's sk specific.
TODO: add doc commit (and make sure doc is sk/NOR specific, and add OSIP
boot mode)
TODO: update doc to show sk defconfig when building

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
board/ti/j784s4/evm.c
include/configs/j784s4_evm.h

index aed0ea5b94959b322abcae2270f155e733b9aab6..548dbd5925dfac4475e9e0a00fadbf3d48f36fb2 100644 (file)
@@ -7,12 +7,46 @@
  *
  */
 
+#include <efi_loader.h>
 #include <init.h>
 #include <spl.h>
 #include "../common/fdt_ops.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
+struct efi_fw_image fw_images[] = {
+       {
+               .image_type_id = AM69_SK_TIBOOT3_IMAGE_GUID,
+               .fw_name = u"AM69_SK_TIBOOT3",
+               .image_index = 1,
+       },
+       {
+               .image_type_id = AM69_SK_SPL_IMAGE_GUID,
+               .fw_name = u"AM69_SK_SPL",
+               .image_index = 2,
+       },
+       {
+               .image_type_id = AM69_SK_UBOOT_IMAGE_GUID,
+               .fw_name = u"AM69_SK_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,
+};
+
+#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+       if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
+               env_set("dfu_alt_info", update_info.dfu_string);
+}
+#endif
+
 int board_init(void)
 {
        return 0;
index 4a2ccdce1442280b1e4ef9c63e96ef299efa967f..53eb2bff2212a727c507055098bc17e72d3a7c14 100644 (file)
@@ -9,6 +9,30 @@
 #ifndef __CONFIG_J784S4_EVM_H
 #define __CONFIG_J784S4_EVM_H
 
+/**
+ * define AM69_SK_TIBOOT3_IMAGE_GUID - firmware GUID for AM69 SK tiboot3.bin
+ * define AM69_SK_SPL_IMAGE_GUID     - firmware GUID for AM69 SK SPL
+ * define AM69_SK_UBOOT_IMAGE_GUID   - firmware GUID for AM69 SK UBOOT
+ *
+ * These GUIDs are used in capsules updates to identify the corresponding
+ * firmware object.
+ *
+ * Board developers using this as a starting reference should
+ * define their own GUIDs to ensure that firmware repositories (like
+ * LVFS) do not confuse them.
+ */
+#define AM69_SK_TIBOOT3_IMAGE_GUID \
+       EFI_GUID(0xadf49ec5, 0x61bb, 0x4dbe, 0x8b, 0x8d,        \
+                0x39, 0xdf, 0x4d, 0x7e, 0xbf, 0x46)
+
+#define AM69_SK_SPL_IMAGE_GUID \
+       EFI_GUID(0x787f0059, 0x63a1, 0x461c, 0xa1, 0x8e, \
+                0x9d, 0x83, 0x83, 0x45, 0xfe, 0x8e)
+
+#define AM69_SK_UBOOT_IMAGE_GUID \
+       EFI_GUID(0x9300505d, 0x6ec5, 0x4ff8, 0x99, 0xe4, \
+                0x54, 0x59, 0xa0, 0x4b, 0xe6, 0x17)
+
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>