EFI: ti: Enable EFI capsule updates
v3 cover 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.
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
Signature · 1 line
2.34.1
PATCH v3 1/19 doc: uefi: capsules: Start Capsule Update porting section
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.
--- doc/develop/uefi/uefi.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+)
doc/develop/uefi/uefi.rst +12 -0
@@ -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 ~~~~~~~~~~~~~~~~~~~~~~~~~~
Signature · 1 line
2.34.1
Re: [PATCH v3 01/19] doc: uefi: capsules: Start Capsule Update porting section
Thanks, Jonathan
We also plan on adding a Kconfig option that will autogenerate GUIDs for such cases, but this is useful
Quoted 36 lines · 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 <[email protected]>--- doc/develop/uefi/uefi.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+)doc/develop/uefi/uefi.rst +12
-1@@ -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 ~~~~~~~~~~~~~~~~~~~~~~~~~~ --
Quoted 2 lines
2.34.1
PATCH v3 2/19 board: am64x: Define capsule update firmware info
In reply to Jonathan HumphreysDefine the firmware components updatable via EFI capsule update, including defining capsule GUIDs for the various firmware components for the AM64x SK.
--- board/ti/am64x/evm.c | 33 +++++++++++++++++++++++++++++++++ include/configs/am64x_evm.h | 24 ++++++++++++++++++++++++ 2 files changed, 57 insertions(+)
board/ti/am64x/evm.c +33 -0
@@ -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 ;
include/configs/am64x_evm.h +24 -0
@@ -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>
Signature · 1 line
2.34.1
Re: [PATCH v3 02/19] board: am64x: Define capsule update firmware info
Quoted 22 lines · 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 <[email protected]>--- board/ti/am64x/evm.c | 33 +++++++++++++++++++++++++++++++++ include/configs/am64x_evm.h | 24 ++++++++++++++++++++++++ 2 files changed, 57 insertions(+)board/ti/am64x/evm.c +1
-0@@ -7,6 +7,7 @@* */ +#include <efi_loader.h> #include <asm/io.h> #include <dm/uclass.h> #include <k3-ddrss.h>
board/ti/am64x/evm.c line 31
Quoted 4 lines
board/ti/am64x/evm.c +1
-0@@ -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.
Quoted 16 lines
board/ti/am64x/evm.c +16
-0+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 , + }
board/ti/am64x/evm.c line 57
Quoted 10 lines
board/ti/am64x/evm.c +10
-0+}; + +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))
Quoted 44 lines
board/ti/am64x/evm.c +5
-0+ env_set("dfu_alt_info", update_info.dfu_string); +} + +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ +int board_init (void ) {board/ti/am64x/evm.c +0
-0return 0 ;include/configs/am64x_evm.h +24
-0@@ -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>
Signature · 2 lines
cheers, -roger
PATCH v3 3/19 configs: am64x: Enable EFI capsule update
In reply to Jonathan Humphreys--- configs/am64x_evm_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/am64x_evm_a53_defconfig +2 -0
@@ -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
Signature · 1 line
2.34.1
Re: [PATCH v3 03/19] configs: am64x: Enable EFI capsule update
Checkpatch warns:
WARNING: Missing commit description - Add an appropriate one
Quoted 15 lines · Jonathan Humphreys
Signed-off-by Jonathan Humphreys <[email protected]>--- configs/am64x_evm_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)configs/am64x_evm_a53_defconfig +2
-0@@ -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
Signature · 2 lines
cheers, -roger
PATCH v3 4/19 doc: board: ti: am64x: document OSPI layout
In reply to Jonathan Humphreys--- doc/board/ti/am64x_evm.rst | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
doc/board/ti/am64x_evm.rst +48 -0
@@ -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 ----------------------------
Signature · 1 line
2.34.1
Re: [PATCH v3 04/19] doc: board: ti: am64x: document OSPI layout
Quoted 4 lines · Jonathan Humphreys
Signed-off-by Jonathan Humphreys <[email protected]>--- doc/board/ti/am64x_evm.rst | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
[snip]
Quoted 18 lines
doc/board/ti/am64x_evm.rst +18
-0+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) |
doc/board/ti/am64x_evm.rst Image formats: · line 189
Quoted 10 lines
doc/board/ti/am64x_evm.rst +10
-0+ | | + 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.
Signature · 1 line
Tom
PATCH v3 5/19 board: j721e: Define capsule update firmware info
In reply to Jonathan HumphreysDefine the firmware components updatable via EFI capsule update, including defining capsule GUIDs for the various firmware components for the SK-TDA4VM.
--- board/ti/j721e/evm.c | 38 +++++++++++++++++++++++++++++++++++++ include/configs/j721e_evm.h | 29 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+)
board/ti/j721e/evm.c +38 -0
@@ -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 ;
include/configs/j721e_evm.h +29 -0
@@ -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>
Signature · 1 line
2.34.1
PATCH v3 6/19 configs: j721e: Enable EFI capsule update
In reply to Jonathan Humphreys--- configs/j721e_evm_a72_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/j721e_evm_a72_defconfig +2 -0
@@ -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
Signature · 1 line
2.34.1
PATCH v3 7/19 doc: board: ti: j721e: document OSPI layout
In reply to Jonathan Humphreys--- doc/board/ti/j721e_evm.rst | 85 +++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 29 deletions(-)
doc/board/ti/j721e_evm.rst +56 -29
@@ -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
Signature · 1 line
2.34.1
PATCH v3 8/19 board: beagleplay: Define capsule update firmware info
In reply to Jonathan HumphreysDefine 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.
--- 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
board/beagle/beagleplay/Kconfig +2 -2
@@ -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"
board/beagle/beagleplay/beagleplay.c +33 -0
@@ -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 ;
include/configs/beagleplay.h new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v3 9/19 configs: beagleplay: Enable DFU for MMC
In reply to Jonathan Humphreys--- configs/am62x_beagleplay_a53_defconfig | 3 +++ 1 file changed, 3 insertions(+)
configs/am62x_beagleplay_a53_defconfig +3 -0
@@ -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
Signature · 1 line
2.34.1
PATCH v3 10/19 configs: beagleplay: Enable EFI capsule update
In reply to Jonathan Humphreys--- configs/am62x_beagleplay_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/am62x_beagleplay_a53_defconfig +2 -0
@@ -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
Signature · 1 line
2.34.1
PATCH v3 11/19 board: am62px: Define capsule update firmware info
In reply to Jonathan HumphreysDefine the firmware components updatable via EFI capsule update, including defining capsule GUIDs for the various firmware components for the AM62px SK.
--- board/ti/am62px/evm.c | 32 ++++++++++++++++++++++++++++++++ include/configs/am62px_evm.h | 24 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+)
board/ti/am62px/evm.c +32 -0
@@ -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 ;
include/configs/am62px_evm.h +24 -0
@@ -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>
Signature · 1 line
2.34.1
PATCH v3 12/19 configs: am62px: Enable EFI capsule update
In reply to Jonathan Humphreys--- configs/am62px_evm_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/am62px_evm_a53_defconfig +2 -0
@@ -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
Signature · 1 line
2.34.1
PATCH v3 13/19 doc: board: ti: am62px: document OSPI layout
In reply to Jonathan Humphreys--- doc/board/ti/am62px_sk.rst | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
doc/board/ti/am62px_sk.rst +48 -0
@@ -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 -------------------------
Signature · 1 line
2.34.1
PATCH v3 14/19 configs: am62x: Enable serial flash DFU
In reply to Jonathan Humphreys--- configs/am62x_evm_a53_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/am62x_evm_a53_defconfig +1 -0
@@ -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
Signature · 1 line
2.34.1
PATCH v3 15/19 board: am62x: Define capsule update firmware info
In reply to Jonathan HumphreysDefine the firmware components updatable via EFI capsule update, including defining capsule GUIDs for the various firmware components for the AM62x SK.
--- board/ti/am62x/evm.c | 32 ++++++++++++++++++++++++++++++++ include/configs/am62x_evm.h | 24 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+)
board/ti/am62x/evm.c +32 -0
@@ -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 ;
include/configs/am62x_evm.h +24 -0
@@ -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>
Signature · 1 line
2.34.1
PATCH v3 16/19 configs: am62x: Enable EFI capsule update
In reply to Jonathan Humphreys--- configs/am62x_evm_a53_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/am62x_evm_a53_defconfig +2 -0
@@ -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
Signature · 1 line
2.34.1
PATCH v3 17/19 doc: board: ti: am62x: document OSPI layout
In reply to Jonathan Humphreys--- doc/board/ti/am62x_sk.rst | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
doc/board/ti/am62x_sk.rst +48 -0
@@ -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 -------------------------
Signature · 1 line
2.34.1
PATCH v3 18/19 board: beagleboneai64: Define capsule update firmware info
In reply to Jonathan HumphreysDefine 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.
--- 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
board/beagle/beagleboneai64/Kconfig +2 -2
@@ -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"
board/beagle/beagleboneai64/beagleboneai64.c +38 -0
@@ -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 ;
include/configs/beagleboneai64.h new file +55 -0
55 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v3 19/19 configs: beagleboneai64: Enable EFI capsule update
In reply to Jonathan Humphreys--- configs/j721e_beagleboneai64_a72_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/j721e_beagleboneai64_a72_defconfig +2 -0
@@ -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
Signature · 1 line
2.34.1