Skip to contentSkip to conversation

conf/machine: k3: cleanup wic files

PATCH Superseded Nishanth Menon 2 participants 11 messages Mar 31, 2021 – Apr 1, 2021

lore
Share & tools
lore
#0 lore raw

v2 cover conf/machine: k3: cleanup wic files

Hi,

V2 of the series.

lets help cleanup the wic files generated for K3 platforms. This includes setting up a reusable boot image pattern that we can use, also generates the bmap file that bmaptool can use and while at it finally generate bootable images for j7200 and am64 which depend on multi-certificate images for boot.

Updates:
- Additional patch to drop the tf-a dependency (review comments)
- Additional documentation where applicable (review comments)
- Picked up reviewed-by from Denys where applicable

V1: https://lists.yoctoproject.org/g/meta-ti/message/13602

Nishanth Menon (8):
conf/machine: k3: Add multi-certificate boot image support conf/machine: am65xx: Document boot images as legacy mode conf/machine: j7: Document boot images as legacy mode conf/machine: am64xx/j7200: Drop trusted-firmware deployment for tar
wic
conf/machine: j7200-evm: Switch to multi-certificate boot images conf/machine: am64xx: Consolidate image configuration to SoC include conf/machine: am64xx: Switch to multi-certificate boot images conf/machine: k3: Lets build bmap files by default

 conf/machine/am64xx-evm.conf    | 8 --------
 conf/machine/am64xx-sk.conf     | 8 --------
 conf/machine/include/am64xx.inc | 6 ++++++
 conf/machine/include/am65xx.inc | 2 ++
 conf/machine/include/j7.inc     | 2 ++
 conf/machine/include/k3.inc     | 8 ++++++--
 conf/machine/j7200-evm.conf     | 6 ++----
 7 files changed, 18 insertions(+), 22 deletions(-)
Signature · 1 line
2.31.0
#1 lore raw

PATCH v2 1/8 conf/machine: k3: Add multi-certificate boot image support

Lets keep things consistent by providing two possibilities for platforms to pick from - legacy boot and multi-certificate boot.

In legacy boot, the base bootloader and system firmware are maintained as separate binaries (tiboot3.bin and sysfw.itb).

In multi-certificate boot that newer K3 devices support, ROM is smarter and can handle multiple x509 certificate based images: so we can strip out the sysfw.itb and integrate it as part of tiboot3.bin itself. This improves authentication and overall system boot times since we are now able to boot both the system controller and the boot processor in parallel.

We do have a scheme currently to identify the images necessary for boot etc, but things are handled on a platform conf file basis. We can improve that by introducing the pattern at the top level include and use the relevant pattern in platforms as needed.

---

Changes since V1:
- picked up reviewed-by
V1: https://lists.yoctoproject.org/g/meta-ti/message/13607

 conf/machine/include/k3.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
conf/machine/include/k3.inc +5 -1
index c727d724ac28..56ad40c3f963 100644
@@ -40,7 +40,11 @@ MACHINE_FEATURES = "kernel26 apm usbgadget usbhost vfat ext2 alsa ethernet pci"
 
 IMAGE_FSTYPES += "tar.xz wic.xz"
 
-IMAGE_BOOT_FILES ?= "${SPL_BINARY} u-boot.${UBOOT_SUFFIX} tiboot3.bin sysfw.itb"
+IMAGE_BOOT_FILES_LEGACY = "${SPL_BINARY} u-boot.${UBOOT_SUFFIX} tiboot3.bin sysfw.itb"
+IMAGE_BOOT_FILES_MULTI_CERT = "${SPL_BINARY} u-boot.${UBOOT_SUFFIX} tiboot3.bin"
+
+IMAGE_BOOT_FILES ?= "${IMAGE_BOOT_FILES_LEGACY}"
+
 WKS_FILE ?= "sdimage-2part.wks"
 do_image_wic[depends] += "virtual/bootloader:do_deploy"
 do_image_wic[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy mc::k3r5:ti-sci-fw:do_deploy"
Signature · 1 line
2.31.0
#2 lore raw

PATCH v2 2/8 conf/machine: am65xx: Document boot images as legacy mode

In reply to Nishanth Menon

We use the default IMAGE_BOOT_FILES configuration which matches up with legacy boot configuration. Document the same to allow folks to understand by just looking at the SoC include file.

---
Changes since V1:
- picked up reviewed-by
- Added additional documentation for SR revision.

V1: https://lists.yoctoproject.org/g/meta-ti/message/13608

 conf/machine/include/am65xx.inc | 2 ++
 1 file changed, 2 insertions(+)
conf/machine/include/am65xx.inc +2 -0
index 684fea45b6d7..547c2e8707ce 100644
@@ -23,6 +23,8 @@ KERNEL_DEVICETREE = " \
 
 BBMULTICONFIG += "k3r5-sr2"
 
+# Use default IMAGE_BOOT_FILES_LEGACY files
+# Since default sysfw.itb on AM65x is for SR2.0, add a version for SR1.0
 IMAGE_BOOT_FILES += "sysfw-am65x-evm.itb"
 do_image_wic[mcdepends] += "mc::k3r5-sr2:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] += "mc::k3r5-sr2:ti-sci-fw:do_deploy"
Signature · 1 line
2.31.0
#3 lore raw

PATCH v2 3/8 conf/machine: j7: Document boot images as legacy mode

In reply to Nishanth Menon

We use the default IMAGE_BOOT_FILES configuration which matches up with legacy boot configuration. Document the same to allow folks to understand by just looking at the SoC include file.

---
Changes since V1:
- picked up reviewed-by
V1: https://lists.yoctoproject.org/g/meta-ti/message/13609

 conf/machine/include/j7.inc | 2 ++
 1 file changed, 2 insertions(+)
conf/machine/include/j7.inc +2 -0
index c187f299f470..d3eda1a828aa 100644
@@ -4,6 +4,8 @@ SOC_FAMILY_append = ":j7"
 OPTEEMACHINE = "k3-j721e"
 OPTEEOUTPUTMACHINE = "k3"
 
+# Use default IMAGE_BOOT_FILES_LEGACY files
+
 # Set the list of device targets for ti-pdk class recipes
 TI_PDK_LIMIT_SOCS = "j721e j7200"
 TI_PDK_LIMIT_BOARDS = "j721e_evm j7200_evm"
Signature · 1 line
2.31.0
#4 lore raw

PATCH v2 4/8 conf/machine: am64xx/j7200: Drop trusted-firmware deployment for tar wic

In reply to Nishanth Menon

wic and tar dependency on trusted firmware is wrong. It is u-boot build that depends on trusted firmware deployment and is correctly handled by u-boot recipe. No point in duplicating that dependency, so just clean it all up.

---
New patch
- triggered from https://lists.yoctoproject.org/g/meta-ti/message/13610

 conf/machine/am64xx-evm.conf | 3 ---
 conf/machine/am64xx-sk.conf  | 3 ---
 conf/machine/j7200-evm.conf  | 3 ---
 3 files changed, 9 deletions(-)
conf/machine/am64xx-evm.conf +0 -3
index eda310a32b14..788b15abab21 100644
@@ -8,8 +8,5 @@ IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
 
 UBOOT_MACHINE = "am64x_evm_a53_defconfig"
 
-do_image_wic[depends] += "trusted-firmware-a:do_deploy"
-do_image_tar[depends] += "trusted-firmware-a:do_deploy"
-
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
conf/machine/am64xx-sk.conf +0 -3
index 4cad8adcf1df..70c9c4f6ae7c 100644
@@ -8,9 +8,6 @@ IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
 
 UBOOT_MACHINE = "am64x_sk_a53_defconfig"
 
-do_image_wic[depends] += "trusted-firmware-a:do_deploy"
-do_image_tar[depends] += "trusted-firmware-a:do_deploy"
-
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 
conf/machine/j7200-evm.conf +0 -3
index dab6d8cb0cd8..5a589f305c7c 100644
@@ -16,8 +16,5 @@ UBOOT_MACHINE = "j7200_evm_a72_config"
 
 IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
 
-do_image_wic[depends] += "trusted-firmware-a:do_deploy"
-do_image_tar[depends] += "trusted-firmware-a:do_deploy"
-
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
Signature · 1 line
2.31.0
Reviewed-by on v2 4/8
#5 lore raw

Re: [dunfell/master][PATCH V2 4/8] conf/machine: am64xx/j7200: Drop trusted-firmware deployment for tar wic

Quoted 7 lines · Nishanth Menon

wic and tar dependency on trusted firmware is wrong. It is u-boot build that depends on trusted firmware deployment and is correctly handled by u-boot recipe. No point in duplicating that dependency, so just clean it all up.

Quoted 52 lines

---
New patch
- triggered from https://lists.yoctoproject.org/g/meta-ti/message/13610

 conf/machine/am64xx-evm.conf | 3 ---
 conf/machine/am64xx-sk.conf  | 3 ---
 conf/machine/j7200-evm.conf  | 3 ---
 3 files changed, 9 deletions(-)
conf/machine/am64xx-evm.conf +0 -3
index eda310a32b14..788b15abab21 100644
@@ -8,8 +8,5 @@ IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
 
 UBOOT_MACHINE = "am64x_evm_a53_defconfig"
 
-do_image_wic[depends] += "trusted-firmware-a:do_deploy"
-do_image_tar[depends] += "trusted-firmware-a:do_deploy"
-
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
conf/machine/am64xx-sk.conf +0 -3
index 4cad8adcf1df..70c9c4f6ae7c 100644
@@ -8,9 +8,6 @@ IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
 
 UBOOT_MACHINE = "am64x_sk_a53_defconfig"
 
-do_image_wic[depends] += "trusted-firmware-a:do_deploy"
-do_image_tar[depends] += "trusted-firmware-a:do_deploy"
-
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 
conf/machine/j7200-evm.conf +0 -3
index dab6d8cb0cd8..5a589f305c7c 100644
@@ -16,8 +16,5 @@ UBOOT_MACHINE = "j7200_evm_a72_config"
 
 IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
 
-do_image_wic[depends] += "trusted-firmware-a:do_deploy"
-do_image_tar[depends] += "trusted-firmware-a:do_deploy"
-
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
Signature · 1 line
2.31.0
Signature · 4 lines
Regards,
Denys Dmytriyenko <[email protected]>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186  6D76 4209 0272 9A92 C964
#6 lore raw

PATCH v2 5/8 conf/machine: j7200-evm: Switch to multi-certificate boot images

In reply to Nishanth Menon

Switch to using all of multi-certificate boot images. This allows us to create bootable images - in this case, we are missing tiboot3.bin

---
Changes since V1:
- Updated patch by dropping the tf-a dependency

V1: https://lists.yoctoproject.org/g/meta-ti/message/13610

 conf/machine/j7200-evm.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
conf/machine/j7200-evm.conf +2 -1
index 5a589f305c7c..5ee6c89c080e 100644
@@ -14,7 +14,8 @@ KERNEL_DEVICETREE = " \
 
 UBOOT_MACHINE = "j7200_evm_a72_config"
 
-IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
+# J7200 supports multi-certificate images, use the same
+IMAGE_BOOT_FILES = "${IMAGE_BOOT_FILES_MULTI_CERT}"
 
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
Signature · 1 line
2.31.0
Reviewed-by on v2 5/8
#7 lore raw

Re: [dunfell/master][PATCH V2 5/8] conf/machine: j7200-evm: Switch to multi-certificate boot images

Quoted 4 lines · Nishanth Menon

Switch to using all of multi-certificate boot images. This allows us to create bootable images - in this case, we are missing tiboot3.bin

Quoted 26 lines

---
Changes since V1:
- Updated patch by dropping the tf-a dependency

V1: https://lists.yoctoproject.org/g/meta-ti/message/13610

 conf/machine/j7200-evm.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
conf/machine/j7200-evm.conf +2 -1
index 5a589f305c7c..5ee6c89c080e 100644
@@ -14,7 +14,8 @@ KERNEL_DEVICETREE = " \
 
 UBOOT_MACHINE = "j7200_evm_a72_config"
 
-IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
+# J7200 supports multi-certificate images, use the same
+IMAGE_BOOT_FILES = "${IMAGE_BOOT_FILES_MULTI_CERT}"
 
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
Signature · 1 line
2.31.0
#8 lore raw

PATCH v2 6/8 conf/machine: am64xx: Consolidate image configuration to SoC include

In reply to Nishanth Menon

IMAGE type and dependencies can easily be centralized to SoC include file. This is necessary to make sure that we don't do the duplication and having multiple places to fix up.

---
Changes since V1:
- picked up reviewed-by
- rebased on cleanups for tf-a

NOTE: merge of sk and evm is still pending, hopefully we can do that in a follow on series later on.

V1: https://lists.yoctoproject.org/g/meta-ti/message/13611

 conf/machine/am64xx-evm.conf    | 5 -----
 conf/machine/am64xx-sk.conf     | 5 -----
 conf/machine/include/am64xx.inc | 4 ++++
 3 files changed, 4 insertions(+), 10 deletions(-)
conf/machine/am64xx-evm.conf +0 -5
index 788b15abab21..c6ba2a8735f3 100644
@@ -4,9 +4,4 @@
 
 require conf/machine/include/am64xx.inc
 
-IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
-
 UBOOT_MACHINE = "am64x_evm_a53_defconfig"
-
-do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
-do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
conf/machine/am64xx-sk.conf +0 -5
index 70c9c4f6ae7c..445ff72339d9 100644
@@ -4,13 +4,8 @@
 
 require conf/machine/include/am64xx.inc
 
-IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
-
 UBOOT_MACHINE = "am64x_sk_a53_defconfig"
 
-do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
-do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
-
 KERNEL_DEVICETREE = " \
     ti/k3-am642-sk.dtb \
 "
conf/machine/include/am64xx.inc +4 -0
index 20441d8a757f..56d015023f5e 100644
@@ -10,6 +10,10 @@ KERNEL_DEVICETREE = " \
     ti/k3-am642-evm.dtb \
 "
 
+IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
+do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
+do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
+
 TFA_BOARD = "lite"
 OPTEEMACHINE = "k3-am65x"
 OPTEEOUTPUTMACHINE = "k3"
Signature · 1 line
2.31.0
#9 lore raw

PATCH v2 7/8 conf/machine: am64xx: Switch to multi-certificate boot images

In reply to Nishanth Menon

Switch to using all of multi-certificate boot images. This allows us to create bootable images - in this case, we are missing tiboot3.bin

---
Changes since V1:
- picked up reviewed-by
- rebase based on cleanup of tf-a
V1: https://lists.yoctoproject.org/g/meta-ti/message/13613

 conf/machine/include/am64xx.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
conf/machine/include/am64xx.inc +3 -1
index 56d015023f5e..641bddd00b0a 100644
@@ -10,7 +10,9 @@ KERNEL_DEVICETREE = " \
     ti/k3-am642-evm.dtb \
 "
 
-IMAGE_BOOT_FILES = "tispl.bin u-boot.img"
+# AM64 supports multi-certificate images, use the same
+IMAGE_BOOT_FILES = "${IMAGE_BOOT_FILES_MULTI_CERT}"
+
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
 
Signature · 1 line
2.31.0
#10 lore raw

PATCH v2 8/8 conf/machine: k3: Lets build bmap files by default

In reply to Nishanth Menon

Lets generate bmap files for bmaptool to use as well as default to use with wic files.

NOTE: bmaptool can speed up flashing SD cards by 2x-3x by skipping empty blocks of the image.

https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#flashing-images-using-bmaptool

---
Changes since V1:
- picked up reviewed-by
- Minor updates in commit message from Deny's comments :D

V1: https://lists.yoctoproject.org/g/meta-ti/message/13614

 conf/machine/include/k3.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
conf/machine/include/k3.inc +1 -1
index 56ad40c3f963..e0970698b33d 100644
@@ -38,7 +38,7 @@ UBI_VOLNAME = "rootfs"
 # List common SoC features, may need to add touchscreen for specific machines
 MACHINE_FEATURES = "kernel26 apm usbgadget usbhost vfat ext2 alsa ethernet pci"
 
-IMAGE_FSTYPES += "tar.xz wic.xz"
+IMAGE_FSTYPES += "tar.xz wic.xz wic.bmap"
 
 IMAGE_BOOT_FILES_LEGACY = "${SPL_BINARY} u-boot.${UBOOT_SUFFIX} tiboot3.bin sysfw.itb"
 IMAGE_BOOT_FILES_MULTI_CERT = "${SPL_BINARY} u-boot.${UBOOT_SUFFIX} tiboot3.bin"
Signature · 1 line
2.31.0