All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates
@ 2024-04-19 20:56 Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 01/19] doc: uefi: capsules: Start Capsule Update porting section Jonathan Humphreys
                   ` (18 more replies)
  0 siblings, 19 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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.

Changes from v1:
- Added sysfw.itb capsule definition to beagleboneai64
- removed extra commas in structure definitions

Changes from v2:
- Added documentation on OSPI flash layouts
- Improved comments for capsule GUIDs definitions
- Defined board unique capsule GUIDs and put definitions in board specific files
- Added a Capsule Update porting section to the documentation

Jonathan Humphreys (19):
  doc: uefi: capsules: Start Capsule Update porting section
  board: am64x: Define capsule update firmware info
  configs: am64x: Enable EFI capsule update
  doc: board: ti: am64x: document OSPI layout
  board: j721e: Define capsule update firmware info
  configs: j721e: Enable EFI capsule update
  doc: board: ti: j721e: document OSPI layout
  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
  doc: board: ti: am62px: document OSPI layout
  configs: am62x: Enable serial flash DFU
  board: am62x: Define capsule update firmware info
  configs: am62x: Enable EFI capsule update
  doc: board: ti: am62x: document OSPI layout
  board: beagleboneai64: Define capsule update firmware info
  configs: beagleboneai64: Enable EFI capsule update

 board/beagle/beagleboneai64/Kconfig          |  4 +-
 board/beagle/beagleboneai64/beagleboneai64.c | 38 +++++++++
 board/beagle/beagleplay/Kconfig              |  4 +-
 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 +
 doc/board/ti/am62px_sk.rst                   | 48 +++++++++++
 doc/board/ti/am62x_sk.rst                    | 48 +++++++++++
 doc/board/ti/am64x_evm.rst                   | 48 +++++++++++
 doc/board/ti/j721e_evm.rst                   | 85 +++++++++++++-------
 doc/develop/uefi/uefi.rst                    | 12 +++
 include/configs/am62px_evm.h                 | 24 ++++++
 include/configs/am62x_evm.h                  | 24 ++++++
 include/configs/am64x_evm.h                  | 24 ++++++
 include/configs/beagleboneai64.h             | 55 +++++++++++++
 include/configs/beagleplay.h                 | 41 ++++++++++
 include/configs/j721e_evm.h                  | 29 +++++++
 25 files changed, 635 insertions(+), 33 deletions(-)
 create mode 100644 include/configs/beagleboneai64.h
 create mode 100644 include/configs/beagleplay.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v3 01/19] doc: uefi: capsules: Start Capsule Update porting section
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-24 15:05   ` Ilias Apalodimas
  2024-04-19 20:56 ` [PATCH v3 02/19] board: am64x: Define capsule update firmware info Jonathan Humphreys
                   ` (17 subsequent siblings)
  18 siblings, 1 reply; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Created a capsule update porting section in the documentation that outlines the
steps a board developer must do when porting from an existing reference board
implementation.

In particular, added a big warning that new capsule GUID's need to be defined.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 doc/develop/uefi/uefi.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst
index 0389b269c01..36ac75278fa 100644
--- a/doc/develop/uefi/uefi.rst
+++ b/doc/develop/uefi/uefi.rst
@@ -631,6 +631,18 @@ where version.dtso looks like::
 The properties of image-type-id and image-index must match the value
 defined in the efi_fw_image array as image_type_id and image_index.
 
+Porting Capsule Updates to new boards
+*************************************
+
+It is important, when using a reference board as a starting point for a custom
+board, that certain steps are taken to properly support Capsule Updates.
+
+Capsule GUIDs need to be unique for each firmware and board. That is, if two
+firmwares are built from the same source but result in different binaries
+because they are built for different boards, they should have different GUIDs.
+Therefore it is important when creating support for a new board, new GUIDs are
+defined in the board's header file.  *DO NOT* reuse capsule GUIDs.
+
 Executing the boot manager
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 02/19] board: am64x: Define capsule update firmware info
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 01/19] doc: uefi: capsules: Start Capsule Update porting section Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-23 12:16   ` Roger Quadros
  2024-04-19 20:56 ` [PATCH v3 03/19] configs: am64x: Enable EFI capsule update Jonathan Humphreys
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Define the firmware components updatable via EFI capsule update, including
defining capsule GUIDs for the various firmware components for the AM64x SK.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 board/ti/am64x/evm.c        | 33 +++++++++++++++++++++++++++++++++
 include/configs/am64x_evm.h | 24 ++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c
index b8de69da06c..83df75a6911 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 = AM64X_SK_TIBOOT3_IMAGE_GUID,
+		.fw_name = u"AM64X_SK_TIBOOT3",
+		.image_index = 1,
+	},
+	{
+		.image_type_id = AM64X_SK_SPL_IMAGE_GUID,
+		.fw_name = u"AM64X_SK_SPL",
+		.image_index = 2,
+	},
+	{
+		.image_type_id = AM64X_SK_UBOOT_IMAGE_GUID,
+		.fw_name = u"AM64X_SK_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;
diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h
index f9f8c7bc2f6..9db83621ea8 100644
--- a/include/configs/am64x_evm.h
+++ b/include/configs/am64x_evm.h
@@ -9,6 +9,30 @@
 #ifndef __CONFIG_AM642_EVM_H
 #define __CONFIG_AM642_EVM_H
 
+/**
+ * define AM64X_SK_TIBOOT3_IMAGE_GUID - firmware GUID for AM64X sk tiboot3.bin
+ * define AM64X_SK_SPL_IMAGE_GUID     - firmware GUID for AM64X sk SPL
+ * define AM64X_SK_UBOOT_IMAGE_GUID   - firmware GUID for AM64X 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 AM64X_SK_TIBOOT3_IMAGE_GUID \
+	EFI_GUID(0xede0a0d5, 0x9116, 0x4bfb, 0xaa, 0x54, \
+		0x09, 0xe9, 0x7b, 0x5a, 0xfe, 0x1a)
+
+#define AM64X_SK_SPL_IMAGE_GUID \
+	EFI_GUID(0x77678f5c, 0x64d4, 0x4910, 0xad, 0x75, \
+		0x52, 0xc9, 0xd9, 0x5c, 0xdb, 0x1d)
+
+#define AM64X_SK_UBOOT_IMAGE_GUID \
+	EFI_GUID(0xc6ad43a9, 0x7d31, 0x4f5d, 0x83, 0xe9, \
+		0xb8, 0xef, 0xec, 0xae, 0x05, 0xbf)
+
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 03/19] configs: am64x: Enable EFI capsule update
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 01/19] doc: uefi: capsules: Start Capsule Update porting section Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 02/19] board: am64x: Define capsule update firmware info Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-23 12:12   ` Roger Quadros
  2024-04-19 20:56 ` [PATCH v3 04/19] doc: board: ti: am64x: document OSPI layout Jonathan Humphreys
                   ` (15 subsequent siblings)
  18 siblings, 1 reply; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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 e000549d6d0..c9bdd7b54cc 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -178,3 +178,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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 04/19] doc: board: ti: am64x: document OSPI layout
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (2 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 03/19] configs: am64x: Enable EFI capsule update Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 21:20   ` Tom Rini
  2024-04-19 20:56 ` [PATCH v3 05/19] board: j721e: Define capsule update firmware info Jonathan Humphreys
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 doc/board/ti/am64x_evm.rst | 48 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/doc/board/ti/am64x_evm.rst b/doc/board/ti/am64x_evm.rst
index 6ae35b3fee3..a7468fbd254 100644
--- a/doc/board/ti/am64x_evm.rst
+++ b/doc/board/ti/am64x_evm.rst
@@ -140,6 +140,54 @@ Image formats:
 .. image:: img/nodm_tispl.bin.svg
   :alt: tispl.bin image format
 
+OSPI:
+-----
+ROM supports booting from OSPI from offset 0x0.
+
+Flashing images to OSPI:
+
+Below commands can be used to download tiboot3.bin, tispl.bin, and u-boot.img,
+over tftp and then flash those to OSPI at their respective addresses.
+
+.. prompt:: bash =>
+
+  sf probe
+  tftp ${loadaddr} tiboot3.bin
+  sf update $loadaddr 0x0 $filesize
+  tftp ${loadaddr} tispl.bin
+  sf update $loadaddr 0x100000 $filesize
+  tftp ${loadaddr} u-boot.img
+  sf update $loadaddr 0x300000 $filesize
+
+Flash layout for OSPI:
+
+    .. code-block:: console
+
+             0x0 +----------------------------+
+                 |     ospi.tiboot3(1m)       |
+                 |                            |
+        0x100000 +----------------------------+
+                 |     ospi.tispl(2m)         |
+                 |                            |
+        0x300000 +----------------------------+
+                 |     ospi.u-boot(4m)        |
+                 |                            |
+        0x700000 +----------------------------+
+                 |     ospi.env(128k)         |
+                 |                            |
+        0x720000 +----------------------------+
+                 |   ospi.env.backup(128k)    |
+                 |                            |
+        0x740000 +----------------------------+
+                 |      padding (768k)        |
+        0x800000 +----------------------------+
+                 |     ospi.rootfs(ubifs)     |
+                 |                            |
+       0x3fc0000 +----------------------------+
+                 |   ospi.phypattern (256k)   |
+                 |                            |
+                 +----------------------------+
+
 Switch Setting for Boot Mode
 ----------------------------
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 05/19] board: j721e: Define capsule update firmware info
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (3 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 04/19] doc: board: ti: am64x: document OSPI layout Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 06/19] configs: j721e: Enable EFI capsule update Jonathan Humphreys
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Define the firmware components updatable via EFI capsule update, including
defining capsule GUIDs for the various firmware components for the SK-TDA4VM.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 board/ti/j721e/evm.c        | 38 +++++++++++++++++++++++++++++++++++++
 include/configs/j721e_evm.h | 29 ++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 9dc3ed6dfff..de70027b2df 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 = J721E_SK_TIBOOT3_IMAGE_GUID,
+		.fw_name = u"J721E_SK_TIBOOT3",
+		.image_index = 1,
+	},
+	{
+		.image_type_id = J721E_SK_SPL_IMAGE_GUID,
+		.fw_name = u"J721E_SK_SPL",
+		.image_index = 2,
+	},
+	{
+		.image_type_id = J721E_SK_UBOOT_IMAGE_GUID,
+		.fw_name = u"J721E_SK_UBOOT",
+		.image_index = 3,
+	},
+	{
+		.image_type_id = J721E_SK_SYSFW_IMAGE_GUID,
+		.fw_name = u"J721E_SK_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;
diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h
index c26438c8684..a5140ea6a11 100644
--- a/include/configs/j721e_evm.h
+++ b/include/configs/j721e_evm.h
@@ -22,6 +22,35 @@
 #define CFG_SYS_UBOOT_BASE		0x50080000
 #endif
 
+/**
+ * define J721E_SK_TIBOOT3_IMAGE_GUID - firmware GUID for J721e sk tiboot3.bin
+ * define J721E_SK_SPL_IMAGE_GUID     - firmware GUID for J721e sk SPL
+ * define J721E_SK_UBOOT_IMAGE_GUID   - firmware GUID for J721e sk UBOOT
+ * define J721E_SK_SYSFW_IMAGE_GUID   - firmware GUID for J721e sk SYSFW
+ *
+ * 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 J721E_SK_TIBOOT3_IMAGE_GUID \
+	EFI_GUID(0xe672b518, 0x7cd7, 0x4014, 0xbd, 0x8d, \
+		 0x40, 0x72, 0x4d, 0x0a, 0xd4, 0xdc)
+
+#define J721E_SK_SPL_IMAGE_GUID \
+	EFI_GUID(0x86f710ad, 0x10cf, 0x46ea, 0xac, 0x67, \
+		 0x85, 0x6a, 0xe0, 0x6e, 0xfa, 0xd2)
+
+#define J721E_SK_UBOOT_IMAGE_GUID \
+	EFI_GUID(0x81b58fb0, 0x3b00, 0x4add, 0xa2, 0x0a, \
+		 0xc1, 0x85, 0xbb, 0xac, 0xa1, 0xed)
+
+#define J721E_SK_SYSFW_IMAGE_GUID \
+	EFI_GUID(0x6fd10680, 0x361b, 0x431f, 0x80, 0xaa, \
+		 0x89, 0x94, 0x55, 0x81, 0x9e, 0x11)
+
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 06/19] configs: j721e: Enable EFI capsule update
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (4 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 05/19] board: j721e: Define capsule update firmware info Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 07/19] doc: board: ti: j721e: document OSPI layout Jonathan Humphreys
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 07/19] doc: board: ti: j721e: document OSPI layout
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (5 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 06/19] configs: j721e: Enable EFI capsule update Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 08/19] board: beagleplay: Define capsule update firmware info Jonathan Humphreys
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 doc/board/ti/j721e_evm.rst | 85 +++++++++++++++++++++++++-------------
 1 file changed, 56 insertions(+), 29 deletions(-)

diff --git a/doc/board/ti/j721e_evm.rst b/doc/board/ti/j721e_evm.rst
index a422a9bf1a0..a0fc37ab6d7 100644
--- a/doc/board/ti/j721e_evm.rst
+++ b/doc/board/ti/j721e_evm.rst
@@ -150,6 +150,60 @@ Image formats:
 .. image:: img/sysfw.itb.svg
   :alt: sysfw.itb image format
 
+OSPI:
+-----
+ROM supports booting from OSPI from offset 0x0.
+
+Flashing images to OSPI:
+
+Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img,
+and sysfw.itb over tftp and then flash those to OSPI at their respective
+addresses.
+
+.. prompt:: bash =>
+
+  sf probe
+  tftp ${loadaddr} tiboot3.bin
+  sf update $loadaddr 0x0 $filesize
+  tftp ${loadaddr} tispl.bin
+  sf update $loadaddr 0x80000 $filesize
+  tftp ${loadaddr} u-boot.img
+  sf update $loadaddr 0x280000 $filesize
+  tftp ${loadaddr} sysfw.itb
+  sf update $loadaddr 0x6C0000 $filesize
+
+Flash layout for OSPI:
+
+    .. code-block:: console
+
+             0x0 +----------------------------+
+                 |     ospi.tiboot3(512K)     |
+                 |                            |
+         0x80000 +----------------------------+
+                 |     ospi.tispl(2M)         |
+                 |                            |
+        0x280000 +----------------------------+
+                 |     ospi.u-boot(4M)        |
+                 |                            |
+        0x680000 +----------------------------+
+                 |     ospi.env(128K)         |
+                 |                            |
+        0x6A0000 +----------------------------+
+                 |   ospi.env.backup (128K)   |
+                 |                            |
+        0x6C0000 +----------------------------+
+                 |      ospi.sysfw(1M)        |
+                 |                            |
+        0x7C0000 +----------------------------+
+                 |      padding (256k)        |
+        0x800000 +----------------------------+
+                 |     ospi.rootfs(UBIFS)     |
+                 |                            |
+       0x3FE0000 +----------------------------+
+                 |   ospi.phypattern (128k)   |
+                 |                            |
+                 +----------------------------+
+
 R5 Memory Map:
 --------------
 
@@ -193,35 +247,8 @@ R5 Memory Map:
      - 0x41cffbfc
      - 0x41cfffff
 
-OSPI:
------
-ROM supports booting from OSPI from offset 0x0.
-
-Flashing images to OSPI:
-
-Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img,
-and sysfw.itb over tftp and then flash those to OSPI at their respective
-addresses.
-
-.. prompt:: bash =>
-
-  sf probe
-  tftp ${loadaddr} tiboot3.bin
-  sf update $loadaddr 0x0 $filesize
-  tftp ${loadaddr} tispl.bin
-  sf update $loadaddr 0x80000 $filesize
-  tftp ${loadaddr} u-boot.img
-  sf update $loadaddr 0x280000 $filesize
-  tftp ${loadaddr} sysfw.itb
-  sf update $loadaddr 0x6C0000 $filesize
-
-Flash layout for OSPI:
-
-.. image:: img/ospi_sysfw.svg
-  :alt: OSPI flash partition layout
-
-Firmwares:
-----------
+Firmware:
+---------
 
 The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem.
 The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 08/19] board: beagleplay: Define capsule update firmware info
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (6 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 07/19] doc: board: ti: j721e: document OSPI layout Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 09/19] configs: beagleplay: Enable DFU for MMC Jonathan Humphreys
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Define the firmware components updatable via EFI capsule update, including
defining capsule GUIDs for the various firmware components for the BeaglePlay.

Note this involved creating BeaglePlay's own beagleplay.h board header file
instead of reusing am62_evm's.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 board/beagle/beagleplay/Kconfig      |  4 +--
 board/beagle/beagleplay/beagleplay.c | 33 ++++++++++++++++++++++
 include/configs/beagleplay.h         | 41 ++++++++++++++++++++++++++++
 3 files changed, 76 insertions(+), 2 deletions(-)
 create mode 100644 include/configs/beagleplay.h

diff --git a/board/beagle/beagleplay/Kconfig b/board/beagle/beagleplay/Kconfig
index 7dbd833acb4..b0e67dc8ef3 100644
--- a/board/beagle/beagleplay/Kconfig
+++ b/board/beagle/beagleplay/Kconfig
@@ -35,7 +35,7 @@ config SYS_VENDOR
        default "beagle"
 
 config SYS_CONFIG_NAME
-       default "am62x_evm"
+       default "beagleplay"
 
 source "board/ti/common/Kconfig"
 
@@ -50,7 +50,7 @@ config SYS_VENDOR
        default "beagle"
 
 config SYS_CONFIG_NAME
-       default "am62x_evm"
+       default "beagleplay"
 
 config SPL_LDSCRIPT
 	default "arch/arm/mach-omap2/u-boot-spl.lds"
diff --git a/board/beagle/beagleplay/beagleplay.c b/board/beagle/beagleplay/beagleplay.c
index af36439e2e2..fe873e9f2b8 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 = BEAGLEPLAY_TIBOOT3_IMAGE_GUID,
+		.fw_name = u"BEAGLEPLAY_TIBOOT3",
+		.image_index = 1,
+	},
+	{
+		.image_type_id = BEAGLEPLAY_SPL_IMAGE_GUID,
+		.fw_name = u"BEAGLEPLAY_SPL",
+		.image_index = 2,
+	},
+	{
+		.image_type_id = BEAGLEPLAY_UBOOT_IMAGE_GUID,
+		.fw_name = u"BEAGLEPLAY_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;
diff --git a/include/configs/beagleplay.h b/include/configs/beagleplay.h
new file mode 100644
index 00000000000..a1e196f10f5
--- /dev/null
+++ b/include/configs/beagleplay.h
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Configuration header file for BeaglePlay
+ *
+ * https://beagleplay.org/
+ *
+ * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+#ifndef __CONFIG_BEAGLEPLAY_H
+#define __CONFIG_BEAGLEPLAY_H
+
+/**
+ * define BEAGLEPLAY_TIBOOT3_IMAGE_GUID - firmware GUID for BeaglePlay
+ *                                        tiboot3.bin
+ * define BEAGLEPLAY_SPL_IMAGE_GUID     - firmware GUID for BeaglePlay SPL
+ * define BEAGLEPLAY_UBOOT_IMAGE_GUID   - firmware GUID for BeaglePlay 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 BEAGLEPLAY_TIBOOT3_IMAGE_GUID \
+	EFI_GUID(0x0e225a09, 0xf720, 0x4d57, 0x91, 0x20, \
+		0xe2, 0x8f, 0x73, 0x7f, 0x5a, 0x5e)
+
+#define BEAGLEPLAY_SPL_IMAGE_GUID \
+	EFI_GUID(0xb2e7cc49, 0x1a5a, 0x4036, 0xae, 0x01, \
+		0x33, 0x87, 0xc3, 0xbe, 0xf6, 0x57)
+
+#define BEAGLEPLAY_UBOOT_IMAGE_GUID \
+	EFI_GUID(0x92c92b11, 0xa7ee, 0x486f, 0xaa, 0xa2, \
+		0x71, 0x3d, 0x84, 0x42, 0x5b, 0x0e)
+
+/* Now for the remaining common defines */
+#include <configs/ti_armv7_common.h>
+
+#endif /* __CONFIG_BEAGLEPLAY_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 09/19] configs: beagleplay: Enable DFU for MMC
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (7 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 08/19] board: beagleplay: Define capsule update firmware info Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 10/19] configs: beagleplay: Enable EFI capsule update Jonathan Humphreys
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 10/19] configs: beagleplay: Enable EFI capsule update
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (8 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 09/19] configs: beagleplay: Enable DFU for MMC Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 11/19] board: am62px: Define capsule update firmware info Jonathan Humphreys
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 11/19] board: am62px: Define capsule update firmware info
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (9 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 10/19] configs: beagleplay: Enable EFI capsule update Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 12/19] configs: am62px: Enable EFI capsule update Jonathan Humphreys
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Define the firmware components updatable via EFI capsule update, including
defining capsule GUIDs for the various firmware components for the AM62px SK.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 board/ti/am62px/evm.c        | 32 ++++++++++++++++++++++++++++++++
 include/configs/am62px_evm.h | 24 ++++++++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c
index 97a95ce8cc2..4caf3d5b3ba 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 = AM62PX_SK_TIBOOT3_IMAGE_GUID,
+		.fw_name = u"AM62PX_SK_TIBOOT3",
+		.image_index = 1,
+	},
+	{
+		.image_type_id = AM62PX_SK_SPL_IMAGE_GUID,
+		.fw_name = u"AM62PX_SK_SPL",
+		.image_index = 2,
+	},
+	{
+		.image_type_id = AM62PX_SK_UBOOT_IMAGE_GUID,
+		.fw_name = u"AM62PX_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,
+};
+
+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;
diff --git a/include/configs/am62px_evm.h b/include/configs/am62px_evm.h
index 06b12860e21..57a1ba9dc3c 100644
--- a/include/configs/am62px_evm.h
+++ b/include/configs/am62px_evm.h
@@ -8,6 +8,30 @@
 #ifndef __CONFIG_AM62PX_EVM_H
 #define __CONFIG_AM62PX_EVM_H
 
+/**
+ * define AM62PX_SK_TIBOOT3_IMAGE_GUID - firmware GUID for AM62PX sk tiboot3.bin
+ * define AM62PX_SK_SPL_IMAGE_GUID     - firmware GUID for AM62PX sk SPL
+ * define AM62PX_SK_UBOOT_IMAGE_GUID   - firmware GUID for AM62PX 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 AM62PX_SK_TIBOOT3_IMAGE_GUID \
+	EFI_GUID(0xb08471b7, 0xbe2d, 0x4489, 0x87, 0xa1, \
+		0xca, 0xb2, 0x8a, 0x0c, 0xf7, 0x43)
+
+#define AM62PX_SK_SPL_IMAGE_GUID \
+	EFI_GUID(0xd02ed781, 0x6d71, 0x4c1a, 0xa9, 0x99, \
+		0x3c, 0x6a, 0x41, 0xc3, 0x63, 0x24)
+
+#define AM62PX_SK_UBOOT_IMAGE_GUID \
+	EFI_GUID(0x7e6aea51, 0x965c, 0x44ab, 0xb3, 0x88, \
+		0xda, 0xeb, 0x03, 0xb5, 0x4f, 0x66)
+
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 12/19] configs: am62px: Enable EFI capsule update
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (10 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 11/19] board: am62px: Define capsule update firmware info Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 13/19] doc: board: ti: am62px: document OSPI layout Jonathan Humphreys
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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 638d2e90a6b..02500e205d1 100644
--- a/configs/am62px_evm_a53_defconfig
+++ b/configs/am62px_evm_a53_defconfig
@@ -177,3 +177,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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 13/19] doc: board: ti: am62px: document OSPI layout
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (11 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 12/19] configs: am62px: Enable EFI capsule update Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 14/19] configs: am62x: Enable serial flash DFU Jonathan Humphreys
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 doc/board/ti/am62px_sk.rst | 48 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/doc/board/ti/am62px_sk.rst b/doc/board/ti/am62px_sk.rst
index 1f2982c36f9..7ff20fbf8e6 100644
--- a/doc/board/ti/am62px_sk.rst
+++ b/doc/board/ti/am62px_sk.rst
@@ -156,6 +156,54 @@ Image formats:
 .. image:: img/dm_tispl.bin.svg
   :alt: tispl.bin image format
 
+OSPI:
+-----
+ROM supports booting from OSPI from offset 0x0.
+
+Flashing images to OSPI:
+
+Below commands can be used to download tiboot3.bin, tispl.bin, and u-boot.img,
+over tftp and then flash those to OSPI at their respective addresses.
+
+.. prompt:: bash =>
+
+  sf probe
+  tftp ${loadaddr} tiboot3.bin
+  sf update $loadaddr 0x0 $filesize
+  tftp ${loadaddr} tispl.bin
+  sf update $loadaddr 0x80000 $filesize
+  tftp ${loadaddr} u-boot.img
+  sf update $loadaddr 0x280000 $filesize
+
+Flash layout for OSPI:
+
+    .. code-block:: console
+
+             0x0 +----------------------------+
+                 |     ospi.tiboot3(512k)     |
+                 |                            |
+         0x80000 +----------------------------+
+                 |     ospi.tispl(2m)         |
+                 |                            |
+        0x280000 +----------------------------+
+                 |     ospi.u-boot(4m)        |
+                 |                            |
+        0x680000 +----------------------------+
+                 |     ospi.env(128k)         |
+                 |                            |
+        0x6c0000 +----------------------------+
+                 |   ospi.env.backup(128k)    |
+                 |                            |
+        0x740000 +----------------------------+
+                 |      padding (768k)        |
+        0x800000 +----------------------------+
+                 |     ospi.rootfs(ubifs)     |
+                 |                            |
+       0x3fc0000 +----------------------------+
+                 |   ospi.phypattern (256k)   |
+                 |                            |
+                 +----------------------------+
+
 A53 SPL DDR Memory Layout
 -------------------------
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 14/19] configs: am62x: Enable serial flash DFU
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (12 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 13/19] doc: board: ti: am62px: document OSPI layout Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 15/19] board: am62x: Define capsule update firmware info Jonathan Humphreys
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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 6b37f8b4791..cc397f72d2c 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -68,6 +68,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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 15/19] board: am62x: Define capsule update firmware info
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (13 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 14/19] configs: am62x: Enable serial flash DFU Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 16/19] configs: am62x: Enable EFI capsule update Jonathan Humphreys
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Define the firmware components updatable via EFI capsule update, including
defining capsule GUIDs for the various firmware components for the AM62x SK.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 board/ti/am62x/evm.c        | 32 ++++++++++++++++++++++++++++++++
 include/configs/am62x_evm.h | 24 ++++++++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index b3e8680dfab..cfcfe6add77 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 = AM62X_SK_TIBOOT3_IMAGE_GUID,
+		.fw_name = u"AM62X_SK_TIBOOT3",
+		.image_index = 1,
+	},
+	{
+		.image_type_id = AM62X_SK_SPL_IMAGE_GUID,
+		.fw_name = u"AM62X_SK_SPL",
+		.image_index = 2,
+	},
+	{
+		.image_type_id = AM62X_SK_UBOOT_IMAGE_GUID,
+		.fw_name = u"AM62X_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,
+};
+
+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;
diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h
index c8fe59b7531..0d98f14a4bc 100644
--- a/include/configs/am62x_evm.h
+++ b/include/configs/am62x_evm.h
@@ -9,6 +9,30 @@
 #ifndef __CONFIG_AM625_EVM_H
 #define __CONFIG_AM625_EVM_H
 
+/**
+ * define AM62X_SK_TIBOOT3_IMAGE_GUID - firmware GUID for AM62X sk tiboot3.bin
+ * define AM62X_SK_SPL_IMAGE_GUID     - firmware GUID for AM62X sk SPL
+ * define AM62X_SK_UBOOT_IMAGE_GUID   - firmware GUID for AM62X 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 AM62X_SK_TIBOOT3_IMAGE_GUID \
+	EFI_GUID(0xabcb83d2, 0x9cb6, 0x4351, 0xb8, 0xf1, \
+		0x64, 0x94, 0xbb, 0xe3, 0x70, 0x0a)
+
+#define AM62X_SK_SPL_IMAGE_GUID \
+	EFI_GUID(0xaee355fc, 0xbf97, 0x4264, 0x8c, 0x82, \
+		0x43, 0x72, 0x55, 0xef, 0xdc, 0x1d)
+
+#define AM62X_SK_UBOOT_IMAGE_GUID \
+	EFI_GUID(0x28ab8c6c, 0xfca8, 0x41d3, 0x8e, 0xa1, \
+		0x5f, 0x17, 0x1b, 0x7d, 0x29, 0x29)
+
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 16/19] configs: am62x: Enable EFI capsule update
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (14 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 15/19] board: am62x: Define capsule update firmware info Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:56 ` [PATCH v3 17/19] doc: board: ti: am62x: document OSPI layout Jonathan Humphreys
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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 cc397f72d2c..d628535a4ed 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -112,3 +112,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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 17/19] doc: board: ti: am62x: document OSPI layout
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (15 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 16/19] configs: am62x: Enable EFI capsule update Jonathan Humphreys
@ 2024-04-19 20:56 ` Jonathan Humphreys
  2024-04-19 20:57 ` [PATCH v3 18/19] board: beagleboneai64: Define capsule update firmware info Jonathan Humphreys
  2024-04-19 20:57 ` [PATCH v3 19/19] configs: beagleboneai64: Enable EFI capsule update Jonathan Humphreys
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:56 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 doc/board/ti/am62x_sk.rst | 48 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
index b12dc85f06b..bf7ea754e32 100644
--- a/doc/board/ti/am62x_sk.rst
+++ b/doc/board/ti/am62x_sk.rst
@@ -150,6 +150,54 @@ Image formats:
 .. image:: img/dm_tispl.bin.svg
   :alt: tispl.bin image format
 
+OSPI:
+-----
+ROM supports booting from OSPI from offset 0x0.
+
+Flashing images to OSPI:
+
+Below commands can be used to download tiboot3.bin, tispl.bin, and u-boot.img,
+over tftp and then flash those to OSPI at their respective addresses.
+
+.. prompt:: bash =>
+
+  sf probe
+  tftp ${loadaddr} tiboot3.bin
+  sf update $loadaddr 0x0 $filesize
+  tftp ${loadaddr} tispl.bin
+  sf update $loadaddr 0x80000 $filesize
+  tftp ${loadaddr} u-boot.img
+  sf update $loadaddr 0x280000 $filesize
+
+Flash layout for OSPI:
+
+    .. code-block:: console
+
+             0x0 +----------------------------+
+                 |     ospi.tiboot3(512k)     |
+                 |                            |
+         0x80000 +----------------------------+
+                 |     ospi.tispl(2m)         |
+                 |                            |
+        0x280000 +----------------------------+
+                 |     ospi.u-boot(4m)        |
+                 |                            |
+        0x680000 +----------------------------+
+                 |     ospi.env(128k)         |
+                 |                            |
+        0x6c0000 +----------------------------+
+                 |   ospi.env.backup(128k)    |
+                 |                            |
+        0x740000 +----------------------------+
+                 |      padding (768k)        |
+        0x800000 +----------------------------+
+                 |     ospi.rootfs(ubifs)     |
+                 |                            |
+       0x3fc0000 +----------------------------+
+                 |   ospi.phypattern (256k)   |
+                 |                            |
+                 +----------------------------+
+
 A53 SPL DDR Memory Layout
 -------------------------
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 18/19] board: beagleboneai64: Define capsule update firmware info
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (16 preceding siblings ...)
  2024-04-19 20:56 ` [PATCH v3 17/19] doc: board: ti: am62x: document OSPI layout Jonathan Humphreys
@ 2024-04-19 20:57 ` Jonathan Humphreys
  2024-04-19 20:57 ` [PATCH v3 19/19] configs: beagleboneai64: Enable EFI capsule update Jonathan Humphreys
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:57 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

Define the firmware components updatable via EFI capsule update, including
defining capsule GUIDs for the various firmware components for the
BeagleBoneAI64.

Note this involved creating BeagleBoneAI64's own beagleboneai64.h board header
file instead of reusing j721e_evm's.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
---
 board/beagle/beagleboneai64/Kconfig          |  4 +-
 board/beagle/beagleboneai64/beagleboneai64.c | 38 ++++++++++++++
 include/configs/beagleboneai64.h             | 55 ++++++++++++++++++++
 3 files changed, 95 insertions(+), 2 deletions(-)
 create mode 100644 include/configs/beagleboneai64.h

diff --git a/board/beagle/beagleboneai64/Kconfig b/board/beagle/beagleboneai64/Kconfig
index 7cfccf9baf0..0f21582614d 100644
--- a/board/beagle/beagleboneai64/Kconfig
+++ b/board/beagle/beagleboneai64/Kconfig
@@ -37,7 +37,7 @@ config SYS_VENDOR
        default "beagle"
 
 config SYS_CONFIG_NAME
-       default "j721e_evm"
+       default "beagleboneai64"
 
 source "board/ti/common/Kconfig"
 
@@ -52,7 +52,7 @@ config SYS_VENDOR
        default "beagle"
 
 config SYS_CONFIG_NAME
-       default "j721e_evm"
+       default "beagleboneai64"
 
 source "board/ti/common/Kconfig"
 
diff --git a/board/beagle/beagleboneai64/beagleboneai64.c b/board/beagle/beagleboneai64/beagleboneai64.c
index c5b4ff7df47..05dec405b81 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,43 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+	{
+		.image_type_id = BEAGLEBONEAI64_TIBOOT3_IMAGE_GUID,
+		.fw_name = u"BEAGLEBONEAI64_TIBOOT3",
+		.image_index = 1,
+	},
+	{
+		.image_type_id = BEAGLEBONEAI64_SPL_IMAGE_GUID,
+		.fw_name = u"BEAGLEBONEAI64_SPL",
+		.image_index = 2,
+	},
+	{
+		.image_type_id = BEAGLEBONEAI64_UBOOT_IMAGE_GUID,
+		.fw_name = u"BEAGLEBONEAI64_UBOOT",
+		.image_index = 3,
+	},
+	{
+		.image_type_id = BEAGLEBONEAI64_SYSFW_IMAGE_GUID,
+		.fw_name = u"BEAGLEBONEAI64_SYSFW",
+		.image_index = 4,
+	}
+};
+
+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; sysfw.itb 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;
diff --git a/include/configs/beagleboneai64.h b/include/configs/beagleboneai64.h
new file mode 100644
index 00000000000..0fcf403c1c4
--- /dev/null
+++ b/include/configs/beagleboneai64.h
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Configuration header file for BeagleBoneAI64
+ *
+ * https://beagleboard.org/ai-64
+ *
+ * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+#ifndef __CONFIG_BEAGLEBONEAI64_H
+#define __CONFIG_BEAGLEBONEAI64_H
+
+/* FLASH Configuration */
+#define CFG_SYS_FLASH_BASE		0x000000000
+
+/* SPL Loader Configuration */
+#define CFG_SYS_UBOOT_BASE		0x50080000
+
+/**
+ * define BEAGLEBONEAI64_TIBOOT3_IMAGE_GUID - firmware GUID for BeagleBoneAI64
+ *                                            tiboot3.bin
+ * define BEAGLEBONEAI64_SPL_IMAGE_GUID     - firmware GUID for BeagleBoneAI64
+ *                                            SPL
+ * define BEAGLEBONEAI64_UBOOT_IMAGE_GUID   - firmware GUID for BeagleBoneAI64
+ *                                            UBOOT
+ * define BEAGLEBONEAI64_SYSFW_IMAGE_GUID   - firmware GUID for BeagleBoneAI64
+ *                                            SYSFW
+ *
+ * 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 BEAGLEBONEAI64_TIBOOT3_IMAGE_GUID \
+	EFI_GUID(0x772a4810, 0x2194, 0x4923, 0x87, 0x54, \
+		0x01, 0x15, 0x87, 0x0e, 0xf3, 0x67)
+
+#define BEAGLEBONEAI64_SPL_IMAGE_GUID \
+	EFI_GUID(0x83447222, 0x1e26, 0x40cd, 0xa3, 0x95, \
+		0xb7, 0xde, 0x09, 0x57, 0xe8, 0x75)
+
+#define BEAGLEBONEAI64_UBOOT_IMAGE_GUID \
+	EFI_GUID(0x4249ff77, 0xc17d, 0x4eb7, 0xa1, 0xdb, \
+		0x45, 0xaa, 0x98, 0x87, 0xd4, 0x9e)
+
+#define BEAGLEBONEAI64_SYSFW_IMAGE_GUID \
+	EFI_GUID(0xdfc9c683, 0x49b7, 0x46bd, 0xb3, 0xc1, \
+		0x3a, 0x3b, 0x2f, 0xdb, 0x13, 0x5b)
+
+/* Now for the remaining common defines */
+#include <configs/ti_armv7_common.h>
+
+#endif /* __CONFIG_BEAGLEBONEAI64_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v3 19/19] configs: beagleboneai64: Enable EFI capsule update
  2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
                   ` (17 preceding siblings ...)
  2024-04-19 20:57 ` [PATCH v3 18/19] board: beagleboneai64: Define capsule update firmware info Jonathan Humphreys
@ 2024-04-19 20:57 ` Jonathan Humphreys
  18 siblings, 0 replies; 24+ messages in thread
From: Jonathan Humphreys @ 2024-04-19 20:57 UTC (permalink / raw
  To: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot, Jonathan Humphreys

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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH v3 04/19] doc: board: ti: am64x: document OSPI layout
  2024-04-19 20:56 ` [PATCH v3 04/19] doc: board: ti: am64x: document OSPI layout Jonathan Humphreys
@ 2024-04-19 21:20   ` Tom Rini
  0 siblings, 0 replies; 24+ messages in thread
From: Tom Rini @ 2024-04-19 21:20 UTC (permalink / raw
  To: Jonathan Humphreys
  Cc: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Sughosh Ganu, Masahisa Kojima, Marcel Ziswiler,
	Ilias Apalodimas, u-boot

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

On Fri, Apr 19, 2024 at 03:56:46PM -0500, Jonathan Humphreys wrote:

> Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
> ---
>  doc/board/ti/am64x_evm.rst | 48 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
[snip]
> +Flash layout for OSPI:
> +
> +    .. code-block:: console
> +
> +             0x0 +----------------------------+
> +                 |     ospi.tiboot3(1m)       |
> +                 |                            |
> +        0x100000 +----------------------------+
> +                 |     ospi.tispl(2m)         |
> +                 |                            |
> +        0x300000 +----------------------------+
> +                 |     ospi.u-boot(4m)        |
> +                 |                            |
> +        0x700000 +----------------------------+
> +                 |     ospi.env(128k)         |
> +                 |                            |
> +        0x720000 +----------------------------+
> +                 |   ospi.env.backup(128k)    |
> +                 |                            |
> +        0x740000 +----------------------------+
> +                 |      padding (768k)        |
> +        0x800000 +----------------------------+
> +                 |     ospi.rootfs(ubifs)     |
> +                 |                            |
> +       0x3fc0000 +----------------------------+
> +                 |   ospi.phypattern (256k)   |
> +                 |                            |
> +                 +----------------------------+

This should be in an SVG see doc/board/ti/j7200_evm.rst for example (and
I'll set aside some non-SVG examples in doc/board/ti that should be
converted). Thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v3 03/19] configs: am64x: Enable EFI capsule update
  2024-04-19 20:56 ` [PATCH v3 03/19] configs: am64x: Enable EFI capsule update Jonathan Humphreys
@ 2024-04-23 12:12   ` Roger Quadros
  0 siblings, 0 replies; 24+ messages in thread
From: Roger Quadros @ 2024-04-23 12:12 UTC (permalink / raw
  To: Jonathan Humphreys, Mattijs Korpershoek, Kamlesh Gurudasani,
	Manorit Chawdhry, Heinrich Schuchardt, Judith Mendez,
	Christian Gmeiner, Devarsh Thakkar, Simon Glass, Nikhil M Jain,
	Neha Malcom Francis, Andrew Davis, Maxime Ripard,
	Siddharth Vadapalli, Bryan Brattlof, Vignesh Raghavendra,
	Robert Nelson, Nishanth Menon, Tom Rini, Sughosh Ganu,
	Masahisa Kojima, Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot

Checkpatch warns:

WARNING: Missing commit description - Add an appropriate one


On 19/04/2024 23:56, Jonathan Humphreys wrote:
> 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 e000549d6d0..c9bdd7b54cc 100644
> --- a/configs/am64x_evm_a53_defconfig
> +++ b/configs/am64x_evm_a53_defconfig
> @@ -178,3 +178,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

-- 
cheers,
-roger

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v3 02/19] board: am64x: Define capsule update firmware info
  2024-04-19 20:56 ` [PATCH v3 02/19] board: am64x: Define capsule update firmware info Jonathan Humphreys
@ 2024-04-23 12:16   ` Roger Quadros
  0 siblings, 0 replies; 24+ messages in thread
From: Roger Quadros @ 2024-04-23 12:16 UTC (permalink / raw
  To: Jonathan Humphreys, Mattijs Korpershoek, Kamlesh Gurudasani,
	Manorit Chawdhry, Heinrich Schuchardt, Judith Mendez,
	Christian Gmeiner, Devarsh Thakkar, Simon Glass, Nikhil M Jain,
	Neha Malcom Francis, Andrew Davis, Maxime Ripard,
	Siddharth Vadapalli, Bryan Brattlof, Vignesh Raghavendra,
	Robert Nelson, Nishanth Menon, Tom Rini, Sughosh Ganu,
	Masahisa Kojima, Marcel Ziswiler, Ilias Apalodimas
  Cc: u-boot



On 19/04/2024 23:56, Jonathan Humphreys wrote:
> Define the firmware components updatable via EFI capsule update, including
> defining capsule GUIDs for the various firmware components for the AM64x SK.
> 
> Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
> ---
>  board/ti/am64x/evm.c        | 33 +++++++++++++++++++++++++++++++++
>  include/configs/am64x_evm.h | 24 ++++++++++++++++++++++++
>  2 files changed, 57 insertions(+)
> 
> diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c
> index b8de69da06c..83df75a6911 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)

Checkpatch warns:

WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible
#31: FILE: board/ti/am64x/evm.c:31:
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)


How about we drop the #if here and instead see possible solution below.

> +struct efi_fw_image fw_images[] = {
> +	{
> +		.image_type_id = AM64X_SK_TIBOOT3_IMAGE_GUID,
> +		.fw_name = u"AM64X_SK_TIBOOT3",
> +		.image_index = 1,
> +	},
> +	{
> +		.image_type_id = AM64X_SK_SPL_IMAGE_GUID,
> +		.fw_name = u"AM64X_SK_SPL",
> +		.image_index = 2,
> +	},
> +	{
> +		.image_type_id = AM64X_SK_UBOOT_IMAGE_GUID,
> +		.fw_name = u"AM64X_SK_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)
> +{

set the environment variable only if relevant config is enabled.

if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))

> +	env_set("dfu_alt_info", update_info.dfu_string);

> +}
> +
> +#endif /* EFI_HAVE_CAPSULE_SUPPORT */
> +
>  int board_init(void)
>  {
>  	return 0;
> diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h
> index f9f8c7bc2f6..9db83621ea8 100644
> --- a/include/configs/am64x_evm.h
> +++ b/include/configs/am64x_evm.h
> @@ -9,6 +9,30 @@
>  #ifndef __CONFIG_AM642_EVM_H
>  #define __CONFIG_AM642_EVM_H
>  
> +/**
> + * define AM64X_SK_TIBOOT3_IMAGE_GUID - firmware GUID for AM64X sk tiboot3.bin
> + * define AM64X_SK_SPL_IMAGE_GUID     - firmware GUID for AM64X sk SPL
> + * define AM64X_SK_UBOOT_IMAGE_GUID   - firmware GUID for AM64X 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 AM64X_SK_TIBOOT3_IMAGE_GUID \
> +	EFI_GUID(0xede0a0d5, 0x9116, 0x4bfb, 0xaa, 0x54, \
> +		0x09, 0xe9, 0x7b, 0x5a, 0xfe, 0x1a)
> +
> +#define AM64X_SK_SPL_IMAGE_GUID \
> +	EFI_GUID(0x77678f5c, 0x64d4, 0x4910, 0xad, 0x75, \
> +		0x52, 0xc9, 0xd9, 0x5c, 0xdb, 0x1d)
> +
> +#define AM64X_SK_UBOOT_IMAGE_GUID \
> +	EFI_GUID(0xc6ad43a9, 0x7d31, 0x4f5d, 0x83, 0xe9, \
> +		0xb8, 0xef, 0xec, 0xae, 0x05, 0xbf)
> +
>  /* Now for the remaining common defines */
>  #include <configs/ti_armv7_common.h>
>  

-- 
cheers,
-roger

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v3 01/19] doc: uefi: capsules: Start Capsule Update porting section
  2024-04-19 20:56 ` [PATCH v3 01/19] doc: uefi: capsules: Start Capsule Update porting section Jonathan Humphreys
@ 2024-04-24 15:05   ` Ilias Apalodimas
  0 siblings, 0 replies; 24+ messages in thread
From: Ilias Apalodimas @ 2024-04-24 15:05 UTC (permalink / raw
  To: Jonathan Humphreys
  Cc: Mattijs Korpershoek, Kamlesh Gurudasani, Manorit Chawdhry,
	Heinrich Schuchardt, Judith Mendez, Christian Gmeiner,
	Devarsh Thakkar, Simon Glass, Nikhil M Jain, Neha Malcom Francis,
	Andrew Davis, Maxime Ripard, Siddharth Vadapalli, Roger Quadros,
	Bryan Brattlof, Vignesh Raghavendra, Robert Nelson,
	Nishanth Menon, Tom Rini, Sughosh Ganu, Masahisa Kojima,
	Marcel Ziswiler, u-boot

Thanks, Jonathan

We also plan on adding a Kconfig option that will autogenerate GUIDs
for such cases, but this is useful

On Fri, 19 Apr 2024 at 23:57, Jonathan Humphreys <j-humphreys@ti.com> wrote:
>
> Created a capsule update porting section in the documentation that outlines the
> steps a board developer must do when porting from an existing reference board
> implementation.
>
> In particular, added a big warning that new capsule GUID's need to be defined.
>
> Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
> ---
>  doc/develop/uefi/uefi.rst | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst
> index 0389b269c01..36ac75278fa 100644
> --- a/doc/develop/uefi/uefi.rst
> +++ b/doc/develop/uefi/uefi.rst
> @@ -631,6 +631,18 @@ where version.dtso looks like::
>  The properties of image-type-id and image-index must match the value
>  defined in the efi_fw_image array as image_type_id and image_index.
>
> +Porting Capsule Updates to new boards
> +*************************************
> +
> +It is important, when using a reference board as a starting point for a custom
> +board, that certain steps are taken to properly support Capsule Updates.
> +
> +Capsule GUIDs need to be unique for each firmware and board. >That is, if two
> +firmwares are built from the same source but result in different binaries
> +because they are built for different boards, they should have different GUIDs.
> +Therefore it is important when creating support for a new board, new GUIDs are
> +defined in the board's header file.  *DO NOT* reuse capsule GUIDs.
> +
>  Executing the boot manager
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> --
> 2.34.1
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-04-24 15:06 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-19 20:56 [PATCH v3 00/19] EFI: ti: Enable EFI capsule updates Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 01/19] doc: uefi: capsules: Start Capsule Update porting section Jonathan Humphreys
2024-04-24 15:05   ` Ilias Apalodimas
2024-04-19 20:56 ` [PATCH v3 02/19] board: am64x: Define capsule update firmware info Jonathan Humphreys
2024-04-23 12:16   ` Roger Quadros
2024-04-19 20:56 ` [PATCH v3 03/19] configs: am64x: Enable EFI capsule update Jonathan Humphreys
2024-04-23 12:12   ` Roger Quadros
2024-04-19 20:56 ` [PATCH v3 04/19] doc: board: ti: am64x: document OSPI layout Jonathan Humphreys
2024-04-19 21:20   ` Tom Rini
2024-04-19 20:56 ` [PATCH v3 05/19] board: j721e: Define capsule update firmware info Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 06/19] configs: j721e: Enable EFI capsule update Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 07/19] doc: board: ti: j721e: document OSPI layout Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 08/19] board: beagleplay: Define capsule update firmware info Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 09/19] configs: beagleplay: Enable DFU for MMC Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 10/19] configs: beagleplay: Enable EFI capsule update Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 11/19] board: am62px: Define capsule update firmware info Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 12/19] configs: am62px: Enable EFI capsule update Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 13/19] doc: board: ti: am62px: document OSPI layout Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 14/19] configs: am62x: Enable serial flash DFU Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 15/19] board: am62x: Define capsule update firmware info Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 16/19] configs: am62x: Enable EFI capsule update Jonathan Humphreys
2024-04-19 20:56 ` [PATCH v3 17/19] doc: board: ti: am62x: document OSPI layout Jonathan Humphreys
2024-04-19 20:57 ` [PATCH v3 18/19] board: beagleboneai64: Define capsule update firmware info Jonathan Humphreys
2024-04-19 20:57 ` [PATCH v3 19/19] configs: beagleboneai64: Enable EFI capsule update Jonathan Humphreys

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.