binman: ti: create binman nodes for EFI capsules
v2 cover binman: ti: create binman nodes for EFI capsules
Add binman nodes for EFI capsules of firmware components so that capsules are automatically created during the UBoot builds.
This is enabled for several TI SoC based platforms: AM64, AM62, AM62p, BeaglePlay, J7, and BeagleboneAI.
Changes from v1:
- on GP devices, still use signed images in capsules where available
- Insert board specific capsule GUIDs into the capsule node's image-guid.
Jonathan Humphreys (7):
dts: ti: binman: Add base K3 firmware capsule nodes
dts: am64x: binman: Include firmware capsules binman nodes
dts: j721e: binman: Include firmware capsules binman nodes
dts: beagleplay: binman: Include firmware capsules binman nodes
dts: am62px: binman: Include firmware capsules binman nodes
dts: am62x: binman: Include firmware capsules binman nodes
dts: beagleboneai64: binman: Include firmware capsules binman nodes
arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 ++++++ arch/arm/dts/k3-am625-sk-binman.dtsi | 30 ++++++++++++ arch/arm/dts/k3-am62p-sk-binman.dtsi | 29 +++++++++++ arch/arm/dts/k3-am64x-binman.dtsi | 30 ++++++++++++ arch/arm/dts/k3-binman-capsule-r5.dtsi | 21 ++++++++ arch/arm/dts/k3-binman-capsule.dtsi | 38 ++++++++++++++ .../dts/k3-j721e-beagleboneai64-u-boot.dtsi | 23 +++++++++ arch/arm/dts/k3-j721e-binman.dtsi | 49 +++++++++++++++++++ arch/arm/dts/k3-j721e-r5-beagleboneai64.dts | 29 +++++++++++ 10 files changed, 291 insertions(+) create mode 100644 arch/arm/dts/k3-binman-capsule-r5.dtsi create mode 100644 arch/arm/dts/k3-binman-capsule.dtsi
Signature · 1 line
2.34.1
PATCH v2 1/7 dts: ti: binman: Add base K3 firmware capsule nodes
Create capsule files for tiboot3.bin, tispl.bin, and u-boot.img.
--- arch/arm/dts/k3-binman-capsule-r5.dtsi | 21 ++++++++++++++ arch/arm/dts/k3-binman-capsule.dtsi | 38 ++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 arch/arm/dts/k3-binman-capsule-r5.dtsi create mode 100644 arch/arm/dts/k3-binman-capsule.dtsi
arch/arm/dts/k3-binman-capsule-r5.dtsi new file +21 -0
@@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ + */ + +&binman { + capsule_tiboot3: capsule-tiboot3 { + filename = "tiboot3-capsule.bin"; + efi-capsule { + image-index = <0x1>; + image-guid = "00000000-0000-0000-0000-000000000000"; + private-key = "arch/arm/mach-k3/keys/custMpk.pem"; + public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt"; + monotonic-count = <0x1>; + + blob { + filename = "tiboot3.bin"; + }; + }; + }; +};
arch/arm/dts/k3-binman-capsule.dtsi new file +38 -0
@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ + */ + +&binman { + capsule_tispl: capsule-tispl { + filename = "tispl-capsule.bin"; + efi-capsule { + image-index = <0x2>; + image-guid = "00000000-0000-0000-0000-000000000000"; + private-key = "arch/arm/mach-k3/keys/custMpk.pem"; + public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt"; + monotonic-count = <0x1>; + + blob { + filename = "tispl.bin"; + }; + }; + }; +}; + +&binman { + capsule_uboot: capsule-uboot { + filename = "uboot-capsule.bin"; + efi-capsule { + image-index = <0x3>; + image-guid = "00000000-0000-0000-0000-000000000000"; + private-key = "arch/arm/mach-k3/keys/custMpk.pem"; + public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt"; + monotonic-count = <0x1>; + + blob { + filename = "u-boot.img"; + }; + }; + }; +};
Signature · 1 line
2.34.1
PATCH v2 2/7 dts: am64x: binman: Include firmware capsules binman nodes
In reply to Jonathan HumphreysFill in the am64x SK's capsule GUID properties of the base binman capsule nodes.
--- arch/arm/dts/k3-am64x-binman.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm/dts/k3-am64x-binman.dtsi +30 -0
@@ -114,6 +114,17 @@ }; }; +#include "k3-binman-capsule-r5.dtsi" + +// Capsule update GUIDs in string form. See am64x_evm.h +#define AM64X_SK_TIBOOT3_IMAGE_GUID_STR "ede0a0d5-9116-4bfb-aa54-09e97b5afe1a" + +&capsule_tiboot3 { + efi-capsule { + image-guid = AM64X_SK_TIBOOT3_IMAGE_GUID_STR; + }; +}; + #endif #ifdef CONFIG_TARGET_AM642_A53_EVM
@@ -373,4 +384,23 @@ }; }; }; + +#include "k3-binman-capsule.dtsi" + +// Capsule update GUIDs in string form. See am64x_evm.h +#define AM64X_SK_SPL_IMAGE_GUID_STR "77678f5c-64d4-4910-ad75-52c9d95cdb1d" +#define AM64X_SK_UBOOT_IMAGE_GUID_STR "c6ad43a9-7d31-4f5d-83e9-b8efecae05bf" + +&capsule_tispl { + efi-capsule { + image-guid = AM64X_SK_SPL_IMAGE_GUID_STR; + }; +}; + +&capsule_uboot { + efi-capsule { + image-guid = AM64X_SK_UBOOT_IMAGE_GUID_STR; + }; +}; + #endif
Signature · 1 line
2.34.1
PATCH v2 3/7 dts: j721e: binman: Include firmware capsules binman nodes
In reply to Jonathan HumphreysFill in the J721e SK's capsule GUID properties of the base binman capsule nodes.
Also add it's SYSFW binman capsule node.
--- arch/arm/dts/k3-j721e-binman.dtsi | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)
arch/arm/dts/k3-j721e-binman.dtsi +49 -0
@@ -207,6 +207,36 @@ }; }; }; + +#include "k3-binman-capsule-r5.dtsi" + +// Capsule update GUIDs in string form. See j721e_evm.h +#define J721E_SK_TIBOOT3_IMAGE_GUID_STR "e672b518-7cd7-4014-bd8d-40724d0ad4dc" +#define J721E_SK_SYSFW_IMAGE_GUID_STR "6fd10680-361b-431f-80aa-899455819e11" + +&capsule_tiboot3 { + efi-capsule { + image-guid = J721E_SK_TIBOOT3_IMAGE_GUID_STR; + }; +}; + +&binman { + capsule-sysfw { + filename = "sysfw-capsule.bin"; + efi-capsule { + image-index = <0x4>; + image-guid = J721E_SK_SYSFW_IMAGE_GUID_STR; + private-key = "arch/arm/mach-k3/keys/custMpk.pem"; + public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt"; + monotonic-count = <0x1>; + + blob { + filename = "sysfw.itb"; + }; + }; + }; +}; + #endif #ifdef CONFIG_TARGET_J721E_A72_EVM
@@ -585,4 +615,23 @@ }; }; }; + +#include "k3-binman-capsule.dtsi" + +// Capsule update GUIDs in string form. See j721e_evm.h +#define J721E_SK_SPL_IMAGE_GUID_STR "86f710ad-10cf-46ea-ac67-856ae06efad2" +#define J721E_SK_UBOOT_IMAGE_GUID_STR "81b58fb0-3b00-4add-a20a-c185bbaca1ed" + +&capsule_tispl { + efi-capsule { + image-guid = J721E_SK_SPL_IMAGE_GUID_STR; + }; +}; + +&capsule_uboot { + efi-capsule { + image-guid = J721E_SK_UBOOT_IMAGE_GUID_STR; + }; +}; + #endif
Signature · 1 line
2.34.1
PATCH v2 4/7 dts: beagleplay: binman: Include firmware capsules binman nodes
In reply to Jonathan HumphreysFill in the BeaglePlay's capsule GUID properties of the base binman capsule nodes.
--- arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 +++++++++++ 2 files changed, 42 insertions(+)
arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi +27 -0
@@ -205,4 +205,31 @@ }; }; }; + +#include "k3-binman-capsule.dtsi" + +// Capsule update GUIDs in string form. See beagleplay.h +#define BEAGLEPLAY_SPL_IMAGE_GUID_STR "b2e7cc49-1a5a-4036-ae01-3387c3bef657" +#define BEAGLEPLAY_UBOOT_IMAGE_GUID_STR "92c92b11-a7ee-486f-aaa2-713d84425b0e" + +&capsule_tispl { + efi-capsule { + image-guid = BEAGLEPLAY_SPL_IMAGE_GUID_STR; + + blob { + filename = "tispl.bin_unsigned"; + }; + }; +}; + +&capsule_uboot { + efi-capsule { + image-guid = BEAGLEPLAY_UBOOT_IMAGE_GUID_STR; + + blob { + filename = "u-boot.img_unsigned"; + }; + }; +}; + #endif
arch/arm/dts/k3-am625-r5-beagleplay.dts +15 -0
@@ -114,3 +114,18 @@ }; }; + +#include "k3-binman-capsule-r5.dtsi" + +// Capsule update GUIDs in string form. See beagleplay.h +#define BEAGLEPLAY_TIBOOT3_IMAGE_GUID_STR "0e225a09-f720-4d57-9120-e28f737f5a5e" + +&capsule_tiboot3 { + efi-capsule { + image-guid = BEAGLEPLAY_TIBOOT3_IMAGE_GUID_STR; + + blob { + filename = "tiboot3-am62x-gp-evm.bin"; + }; + }; +};
Signature · 1 line
2.34.1
Re: [PATCH v2 4/7] dts: beagleplay: binman: Include firmware capsules binman nodes
Quoted 8 lines · Jonathan Humphreys
Fill in the BeaglePlay's capsule GUID properties of the base binman capsule nodes.
Signed-off-by Jonathan Humphreys <[email protected]>--- arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 +++++++++++ 2 files changed, 42 insertions(+)
This series introduces failure to build in CI, and it's a little tricky to replicate locally, depending on your environment. You first need to NOT have BINMAN_INDIRS set and instead be using fake binaries. Second, it seems python version dependent perhaps? I don't see this on my host, but by:
- Using the CI container
- Setting up a virtualenv inside of it
- pip install -r tools/buildman/requirements.txt
I get:
$ ./tools/buildman/buildman --keep-outputs --reproducible-builds -dvel --force-build -PEWM --output /tmp/am62x_beagleplay_r5 --board am62x_beagleplay_r5
Building current source for 1 boards (1 thread, 12 jobs per thread)
arm: + am62x_beagleplay_r5
+(am62x_beagleplay_r5) Image 'tiboot3-am62x-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin
+(am62x_beagleplay_r5)
+(am62x_beagleplay_r5) /binman/tiboot3-am62x-gp-evm.bin/ti-fs-gp.bin (ti-sysfw/ti-fs-firmware-am62x-gp.bin):
+(am62x_beagleplay_r5) Missing blob
+(am62x_beagleplay_r5) binman: object of type 'NoneType' has no len()
+(am62x_beagleplay_r5) make[1]: *** [Makefile:1126: .binman_stamp] Error 1
+(am62x_beagleplay_r5) make: *** [Makefile:177: sub-make] Error 2
0 0 1 /1 am62x_beagleplay_r5Signature · 1 line
Tom
Re: [PATCH v2 4/7] dts: beagleplay: binman: Include firmware capsules binman nodes
Quoted 23 lines · Tom Rini
Quoted 8 lines · Jonathan Humphreys
Fill in the BeaglePlay's capsule GUID properties of the base binman capsule nodes.
Signed-off-by Jonathan Humphreys <[email protected]>--- arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 +++++++++++ 2 files changed, 42 insertions(+)This series introduces failure to build in CI, and it's a little tricky to replicate locally, depending on your environment. You first need to NOT have
BINMAN_INDIRSset and instead be using fake binaries. Second, it seems python version dependent perhaps? I don't see this on my host, but by:
- Using the CI container
- Setting up a virtualenv inside of it
- pip install -rtools/buildman/requirements.txt
I get:$ ./tools/buildman/buildman --keep-outputs --reproducible-builds -dvel --force-build -PEWM --output /tmp/am62x_beagleplay_r5 --board am62x_beagleplay_r5 Building current source for 1 boards (1 thread, 12 jobs per thread) arm: + am62x_beagleplay_r5
Review
Quoted 8 lines
(quoted diff) +7
-0+(am62x_beagleplay_r5) Image 'tiboot3-am62x-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin +(am62x_beagleplay_r5) +(am62x_beagleplay_r5) /binman/tiboot3-am62x-gp-evm.bin/ti-fs-gp.bin (ti-sysfw/ti-fs-firmware-am62x-gp.bin): +(am62x_beagleplay_r5) Missing blob +(am62x_beagleplay_r5) binman: object of type 'NoneType' has no len() +(am62x_beagleplay_r5) make[1]: *** [Makefile:1126: .binman_stamp] Error 1 +(am62x_beagleplay_r5) make: *** [Makefile:177: sub-make] Error 2 0 0 1 /1 am62x_beagleplay_r5
Tom, this is failing in the CI container because the container is missing the mkeficapsule tool.
To solve this, we just need to add it to the CI container.
My understanding of binman's handling of missing bintools is that it should gracefully continue with fake data, so that buildman can successfully test out builds for boards even when you don't have all the required bintools. If I have that correct, I can also create a patch to properly handle this when using mkeficapsule. But I want to verify this is the desired behavior, since mkeficapsule isn't a unique or vendor specific tool, so shouldn't we require it as part of the U-Boot build environment and err out if it is missing?
thanks
Jon
Quoted 3 lines
Signature · 2 lines
-- Tom
Re: [PATCH v2 4/7] dts: beagleplay: binman: Include firmware capsules binman nodes
Quoted 39 lines · Jon Humphreys
Quoted 23 lines · Tom Rini
Quoted 8 lines · Jonathan Humphreys
Fill in the BeaglePlay's capsule GUID properties of the base binman capsule nodes.
Signed-off-by Jonathan Humphreys <[email protected]>--- arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 +++++++++++ 2 files changed, 42 insertions(+)This series introduces failure to build in CI, and it's a little tricky to replicate locally, depending on your environment. You first need to NOT have
BINMAN_INDIRSset and instead be using fake binaries. Second, it seems python version dependent perhaps? I don't see this on my host, but by:
- Using the CI container
- Setting up a virtualenv inside of it
- pip install -rtools/buildman/requirements.txt
I get:$ ./tools/buildman/buildman --keep-outputs --reproducible-builds -dvel --force-build -PEWM --output /tmp/am62x_beagleplay_r5 --board am62x_beagleplay_r5 Building current source for 1 boards (1 thread, 12 jobs per thread) arm: + am62x_beagleplay_r5Review
Quoted 8 lines
(quoted diff) +7
-0+(am62x_beagleplay_r5) Image 'tiboot3-am62x-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin +(am62x_beagleplay_r5) +(am62x_beagleplay_r5) /binman/tiboot3-am62x-gp-evm.bin/ti-fs-gp.bin (ti-sysfw/ti-fs-firmware-am62x-gp.bin): +(am62x_beagleplay_r5) Missing blob +(am62x_beagleplay_r5) binman: object of type 'NoneType' has no len() +(am62x_beagleplay_r5) make[1]: *** [Makefile:1126: .binman_stamp] Error 1 +(am62x_beagleplay_r5) make: *** [Makefile:177: sub-make] Error 2 0 0 1 /1 am62x_beagleplay_r5Tom, this is failing in the CI container because the container is missing the mkeficapsule tool.
To solve this, we just need to add it to the CI container.
Quoted 8 lines
My understanding of binman's handling of missing bintools is that it should gracefully continue with fake data, so that buildman can successfully test out builds for boards even when you don't have all the required bintools. If I have that correct, I can also create a patch to properly handle this when using mkeficapsule. But I want to verify this is the desired behavior, since mkeficapsule isn't a unique or vendor specific tool, so shouldn't we require it as part of the U-Boot build environment and err out if it is missing?
Perhaps it's a binman issue since we build mkeficapsule or at least should be? Neha?
Signature · 1 line
Tom
Re: [PATCH v2 4/7] dts: beagleplay: binman: Include firmware capsules binman nodes
Quoted 49 lines · Tom Rini
Quoted 39 lines · Jon Humphreys
Quoted 23 lines · Tom Rini
Quoted 8 lines · Jonathan Humphreys
Fill in the BeaglePlay's capsule GUID properties of the base binman capsule nodes.
Signed-off-by Jonathan Humphreys <[email protected]>--- arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 +++++++++++ 2 files changed, 42 insertions(+)This series introduces failure to build in CI, and it's a little tricky to replicate locally, depending on your environment. You first need to NOT have
BINMAN_INDIRSset and instead be using fake binaries. Second, it seems python version dependent perhaps? I don't see this on my host, but by:
- Using the CI container
- Setting up a virtualenv inside of it
- pip install -rtools/buildman/requirements.txt
I get:$ ./tools/buildman/buildman --keep-outputs --reproducible-builds -dvel --force-build -PEWM --output /tmp/am62x_beagleplay_r5 --board am62x_beagleplay_r5 Building current source for 1 boards (1 thread, 12 jobs per thread) arm: + am62x_beagleplay_r5Review
Quoted 8 lines
(quoted diff) +7
-0+(am62x_beagleplay_r5) Image 'tiboot3-am62x-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin +(am62x_beagleplay_r5) +(am62x_beagleplay_r5) /binman/tiboot3-am62x-gp-evm.bin/ti-fs-gp.bin (ti-sysfw/ti-fs-firmware-am62x-gp.bin): +(am62x_beagleplay_r5) Missing blob +(am62x_beagleplay_r5) binman: object of type 'NoneType' has no len() +(am62x_beagleplay_r5) make[1]: *** [Makefile:1126: .binman_stamp] Error 1 +(am62x_beagleplay_r5) make: *** [Makefile:177: sub-make] Error 2 0 0 1 /1 am62x_beagleplay_r5Tom, this is failing in the CI container because the container is missing the mkeficapsule tool.
To solve this, we just need to add it to the CI container.
Quoted 8 lines
My understanding of binman's handling of missing bintools is that it should gracefully continue with fake data, so that buildman can successfully test out builds for boards even when you don't have all the required bintools. If I have that correct, I can also create a patch to properly handle this when using mkeficapsule. But I want to verify this is the desired behavior, since mkeficapsule isn't a unique or vendor specific tool, so shouldn't we require it as part of the U-Boot build environment and err out if it is missing?
Quoted 3 lines
Perhaps it's a binman issue since we build mkeficapsule or at least should be? Neha?
Never mind - I figured it out.
The mkeficapsule tools is built by u-boot if TOOLS_MKEFICAPSULE config is set. I didn't explicitly set it because it is implied by EFI_CAPSULE_ON_DISK config. But this is only set for the A core u-boot, as that is what would apply the capsules. SPL running on the R cores does not need this. But that then means that the R core u-boot builds don't have TOOLS_MKEFICAPSULE set and if that is all that is being built (as in the case of buildman), the mkeficapsule tool isn't built and so is missing.
So I need to explicitly set TOOLS_MKEFICAPSULE in the R core defconfigs. I'll repost the patches.
Thanks for catching the bug,
Jon
Quoted 2 lines
Signature · 1 line
Tom
Re: [PATCH v2 4/7] dts: beagleplay: binman: Include firmware capsules binman nodes
Quoted 65 lines · Jon Humphreys
Quoted 49 lines · Tom Rini
Quoted 39 lines · Jon Humphreys
Quoted 23 lines · Tom Rini
Quoted 8 lines · Jonathan Humphreys
Fill in the BeaglePlay's capsule GUID properties of the base binman capsule nodes.
Signed-off-by Jonathan Humphreys <[email protected]>--- arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 +++++++++++ 2 files changed, 42 insertions(+)This series introduces failure to build in CI, and it's a little tricky to replicate locally, depending on your environment. You first need to NOT have
BINMAN_INDIRSset and instead be using fake binaries. Second, it seems python version dependent perhaps? I don't see this on my host, but by:
- Using the CI container
- Setting up a virtualenv inside of it
- pip install -rtools/buildman/requirements.txt
I get:$ ./tools/buildman/buildman --keep-outputs --reproducible-builds -dvel --force-build -PEWM --output /tmp/am62x_beagleplay_r5 --board am62x_beagleplay_r5 Building current source for 1 boards (1 thread, 12 jobs per thread) arm: + am62x_beagleplay_r5Review
Quoted 8 lines
(quoted diff) +7
-0+(am62x_beagleplay_r5) Image 'tiboot3-am62x-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin +(am62x_beagleplay_r5) +(am62x_beagleplay_r5) /binman/tiboot3-am62x-gp-evm.bin/ti-fs-gp.bin (ti-sysfw/ti-fs-firmware-am62x-gp.bin): +(am62x_beagleplay_r5) Missing blob +(am62x_beagleplay_r5) binman: object of type 'NoneType' has no len() +(am62x_beagleplay_r5) make[1]: *** [Makefile:1126: .binman_stamp] Error 1 +(am62x_beagleplay_r5) make: *** [Makefile:177: sub-make] Error 2 0 0 1 /1 am62x_beagleplay_r5Tom, this is failing in the CI container because the container is missing the mkeficapsule tool.
To solve this, we just need to add it to the CI container.
Quoted 8 lines
My understanding of binman's handling of missing bintools is that it should gracefully continue with fake data, so that buildman can successfully test out builds for boards even when you don't have all the required bintools. If I have that correct, I can also create a patch to properly handle this when using mkeficapsule. But I want to verify this is the desired behavior, since mkeficapsule isn't a unique or vendor specific tool, so shouldn't we require it as part of the U-Boot build environment and err out if it is missing?
Quoted 3 lines
Perhaps it's a binman issue since we build mkeficapsule or at least should be? Neha?
Never mind - I figured it out.
The mkeficapsule tools is built by u-boot if
TOOLS_MKEFICAPSULEconfig is set. I didn't explicitly set it because it is implied byEFI_CAPSULE_ON_DISKconfig. But this is only set for the A core u-boot, as that is what would apply the capsules. SPL running on the R cores does not need this. But that then means that the R core u-boot builds don't haveTOOLS_MKEFICAPSULEset and if that is all that is being built (as in the case of buildman), the mkeficapsule tool isn't built and so is missing.
Quoted 2 lines
So I need to explicitly set
TOOLS_MKEFICAPSULEin the R core defconfigs. I'll repost the patches.
Interesting. My next thought here is that whatever symbol is allowing for "make a capsule" should be select'ing TOOLS_MKEFICAPSULE and so the current logic is a bit flawed. I'm just not sure off-hand where it should be instead, do you have some ideas now? Thanks.
Signature · 1 line
Tom
Re: [PATCH v2 4/7] dts: beagleplay: binman: Include firmware capsules binman nodes
Quoted 66 lines · Tom Rini
Quoted 65 lines · Jon Humphreys
Quoted 49 lines · Tom Rini
Quoted 39 lines · Jon Humphreys
Quoted 23 lines · Tom Rini
Quoted 8 lines · Jonathan Humphreys
Fill in the BeaglePlay's capsule GUID properties of the base binman capsule nodes.
Signed-off-by Jonathan Humphreys <[email protected]>--- arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 +++++++++++ 2 files changed, 42 insertions(+)This series introduces failure to build in CI, and it's a little tricky to replicate locally, depending on your environment. You first need to NOT have
BINMAN_INDIRSset and instead be using fake binaries. Second, it seems python version dependent perhaps? I don't see this on my host, but by:
- Using the CI container
- Setting up a virtualenv inside of it
- pip install -rtools/buildman/requirements.txt
I get:$ ./tools/buildman/buildman --keep-outputs --reproducible-builds -dvel --force-build -PEWM --output /tmp/am62x_beagleplay_r5 --board am62x_beagleplay_r5 Building current source for 1 boards (1 thread, 12 jobs per thread) arm: + am62x_beagleplay_r5Review
Quoted 8 lines
(quoted diff) +7
-0+(am62x_beagleplay_r5) Image 'tiboot3-am62x-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin +(am62x_beagleplay_r5) +(am62x_beagleplay_r5) /binman/tiboot3-am62x-gp-evm.bin/ti-fs-gp.bin (ti-sysfw/ti-fs-firmware-am62x-gp.bin): +(am62x_beagleplay_r5) Missing blob +(am62x_beagleplay_r5) binman: object of type 'NoneType' has no len() +(am62x_beagleplay_r5) make[1]: *** [Makefile:1126: .binman_stamp] Error 1 +(am62x_beagleplay_r5) make: *** [Makefile:177: sub-make] Error 2 0 0 1 /1 am62x_beagleplay_r5Tom, this is failing in the CI container because the container is missing the mkeficapsule tool.
To solve this, we just need to add it to the CI container.
Quoted 8 lines
My understanding of binman's handling of missing bintools is that it should gracefully continue with fake data, so that buildman can successfully test out builds for boards even when you don't have all the required bintools. If I have that correct, I can also create a patch to properly handle this when using mkeficapsule. But I want to verify this is the desired behavior, since mkeficapsule isn't a unique or vendor specific tool, so shouldn't we require it as part of the U-Boot build environment and err out if it is missing?
Quoted 3 lines
Perhaps it's a binman issue since we build mkeficapsule or at least should be? Neha?
Never mind - I figured it out.
The mkeficapsule tools is built by u-boot if
TOOLS_MKEFICAPSULEconfig is set. I didn't explicitly set it because it is implied byEFI_CAPSULE_ON_DISKconfig. But this is only set for the A core u-boot, as that is what would apply the capsules. SPL running on the R cores does not need this. But that then means that the R core u-boot builds don't haveTOOLS_MKEFICAPSULEset and if that is all that is being built (as in the case of buildman), the mkeficapsule tool isn't built and so is missing.
Quoted 8 lines
Quoted 2 lines
So I need to explicitly set
TOOLS_MKEFICAPSULEin the R core defconfigs. I'll repost the patches.Interesting. My next thought here is that whatever symbol is allowing for "make a capsule" should be select'ing
TOOLS_MKEFICAPSULEand so the current logic is a bit flawed. I'm just not sure off-hand where it should be instead, do you have some ideas now? Thanks.
There is no config that indicates that capsules will be generated for the resulting binary. The only thing I can think of is to scan the board's DTB for the presence of a capsule binman node, and then set the TOOLS_MKEFICAPSULE config. But this seems very complicated to do at build time.
Jon
Quoted 2 lines
Signature · 1 line
Tom
Re: [PATCH v2 4/7] dts: beagleplay: binman: Include firmware capsules binman nodes
Quoted 76 lines · Jon Humphreys
Quoted 66 lines · Tom Rini
Quoted 65 lines · Jon Humphreys
Quoted 49 lines · Tom Rini
Quoted 39 lines · Jon Humphreys
Quoted 23 lines · Tom Rini
Quoted 8 lines · Jonathan Humphreys
Fill in the BeaglePlay's capsule GUID properties of the base binman capsule nodes.
Signed-off-by Jonathan Humphreys <[email protected]>--- arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 27 ++++++++++++++++++++ arch/arm/dts/k3-am625-r5-beagleplay.dts | 15 +++++++++++ 2 files changed, 42 insertions(+)This series introduces failure to build in CI, and it's a little tricky to replicate locally, depending on your environment. You first need to NOT have
BINMAN_INDIRSset and instead be using fake binaries. Second, it seems python version dependent perhaps? I don't see this on my host, but by:
- Using the CI container
- Setting up a virtualenv inside of it
- pip install -rtools/buildman/requirements.txt
I get:$ ./tools/buildman/buildman --keep-outputs --reproducible-builds -dvel --force-build -PEWM --output /tmp/am62x_beagleplay_r5 --board am62x_beagleplay_r5 Building current source for 1 boards (1 thread, 12 jobs per thread) arm: + am62x_beagleplay_r5Review
Quoted 8 lines
(quoted diff) +7
-0+(am62x_beagleplay_r5) Image 'tiboot3-am62x-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin +(am62x_beagleplay_r5) +(am62x_beagleplay_r5) /binman/tiboot3-am62x-gp-evm.bin/ti-fs-gp.bin (ti-sysfw/ti-fs-firmware-am62x-gp.bin): +(am62x_beagleplay_r5) Missing blob +(am62x_beagleplay_r5) binman: object of type 'NoneType' has no len() +(am62x_beagleplay_r5) make[1]: *** [Makefile:1126: .binman_stamp] Error 1 +(am62x_beagleplay_r5) make: *** [Makefile:177: sub-make] Error 2 0 0 1 /1 am62x_beagleplay_r5Tom, this is failing in the CI container because the container is missing the mkeficapsule tool.
To solve this, we just need to add it to the CI container.
Quoted 8 lines
My understanding of binman's handling of missing bintools is that it should gracefully continue with fake data, so that buildman can successfully test out builds for boards even when you don't have all the required bintools. If I have that correct, I can also create a patch to properly handle this when using mkeficapsule. But I want to verify this is the desired behavior, since mkeficapsule isn't a unique or vendor specific tool, so shouldn't we require it as part of the U-Boot build environment and err out if it is missing?
Quoted 3 lines
Perhaps it's a binman issue since we build mkeficapsule or at least should be? Neha?
Never mind - I figured it out.
The mkeficapsule tools is built by u-boot if
TOOLS_MKEFICAPSULEconfig is set. I didn't explicitly set it because it is implied byEFI_CAPSULE_ON_DISKconfig. But this is only set for the A core u-boot, as that is what would apply the capsules. SPL running on the R cores does not need this. But that then means that the R core u-boot builds don't haveTOOLS_MKEFICAPSULEset and if that is all that is being built (as in the case of buildman), the mkeficapsule tool isn't built and so is missing.Quoted 7 lines
Quoted 2 lines
So I need to explicitly set
TOOLS_MKEFICAPSULEin the R core defconfigs. I'll repost the patches.Interesting. My next thought here is that whatever symbol is allowing for "make a capsule" should be select'ing
TOOLS_MKEFICAPSULEand so the current logic is a bit flawed. I'm just not sure off-hand where it should be instead, do you have some ideas now? Thanks.
Quoted 5 lines
There is no config that indicates that capsules will be generated for the resulting binary. The only thing I can think of is to scan the board's DTB for the presence of a capsule binman node, and then set the
TOOLS_MKEFICAPSULEconfig. But this seems very complicated to do at build time.
Yeah, that's the wrong direction I think. We should perhaps just make TOOLS_MKEFICAPSULE default y if EFI_LOADER instead.
Signature · 1 line
Tom
PATCH v2 5/7 dts: am62px: binman: Include firmware capsules binman nodes
In reply to Jonathan HumphreysFill in the am62px SK's capsule GUID properties of the base binman capsule nodes.
--- arch/arm/dts/k3-am62p-sk-binman.dtsi | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
arch/arm/dts/k3-am62p-sk-binman.dtsi +29 -0
@@ -59,6 +59,17 @@ }; }; +#include "k3-binman-capsule-r5.dtsi" + +// Capsule update GUIDs in string form. See am62px_evm.h +#define AM62PX_SK_TIBOOT3_IMAGE_GUID_STR "b08471b7-be2d-4489-87a1-cab28a0cf743" + +&capsule_tiboot3 { + efi-capsule { + image-guid = AM62PX_SK_TIBOOT3_IMAGE_GUID_STR; + }; +}; + #endif /* CONFIG_TARGET_AM62P5_R5_EVM */ #if IS_ENABLED(CONFIG_TARGET_AM62P5_A53_EVM)
@@ -170,4 +181,22 @@ }; }; +#include "k3-binman-capsule.dtsi" + +// Capsule update GUIDs in string form. See am62px_evm.h +#define AM62PX_SK_SPL_IMAGE_GUID_STR "d02ed781-6d71-4c1a-a999-3c6a41c36324" +#define AM62PX_SK_UBOOT_IMAGE_GUID_STR "7e6aea51-965c-44ab-b388-daeb03b54f66" + +&capsule_tispl { + efi-capsule { + image-guid = AM62PX_SK_SPL_IMAGE_GUID_STR; + }; +}; + +&capsule_uboot { + efi-capsule { + image-guid = AM62PX_SK_UBOOT_IMAGE_GUID_STR; + }; +}; + #endif /* CONFIG_TARGET_AM62P5_A53_EVM */
Signature · 1 line
2.34.1
PATCH v2 6/7 dts: am62x: binman: Include firmware capsules binman nodes
In reply to Jonathan HumphreysFill in the am62x SK's capsule GUID properties of the base binman capsule nodes.
--- arch/arm/dts/k3-am625-sk-binman.dtsi | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm/dts/k3-am625-sk-binman.dtsi +30 -0
@@ -137,6 +137,17 @@ }; }; +#include "k3-binman-capsule-r5.dtsi" + +// Capsule update GUIDs in string form. See am62x_evm.h +#define AM62X_SK_TIBOOT3_IMAGE_GUID_STR "abcb83d2-9cb6-4351-b8f1-6494bbe3700a" + +&capsule_tiboot3 { + efi-capsule { + image-guid = AM62X_SK_TIBOOT3_IMAGE_GUID_STR; + }; +}; + #endif #ifdef CONFIG_TARGET_AM625_A53_EVM
@@ -452,4 +463,23 @@ }; }; }; + +#include "k3-binman-capsule.dtsi" + +// Capsule update GUIDs in string form. See am62x_evm.h +#define AM62X_SK_SPL_IMAGE_GUID_STR "aee355fc-bf97-4264-8c82-437255efdc1d" +#define AM62X_SK_UBOOT_IMAGE_GUID_STR "28ab8c6c-fca8-41d3-8ea1-5f171b7d2929" + +&capsule_tispl { + efi-capsule { + image-guid = AM62X_SK_SPL_IMAGE_GUID_STR; + }; +}; + +&capsule_uboot { + efi-capsule { + image-guid = AM62X_SK_UBOOT_IMAGE_GUID_STR; + }; +}; + #endif
Signature · 1 line
2.34.1
PATCH v2 7/7 dts: beagleboneai64: binman: Include firmware capsules binman nodes
In reply to Jonathan HumphreysFill in the BeagleBoneAI64's capsule GUID properties of the base binman capsule nodes.
Also add it's SYSFW binman capsule node.
--- .../dts/k3-j721e-beagleboneai64-u-boot.dtsi | 23 +++++++++++++++ arch/arm/dts/k3-j721e-r5-beagleboneai64.dts | 29 +++++++++++++++++++ 2 files changed, 52 insertions(+)
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +23 -0
@@ -351,4 +351,27 @@ }; }; }; + +#include "k3-binman-capsule.dtsi" + +// Capsule update GUIDs in string form. See beagleboneai64.h +#define BEAGLEBONEAI64_SPL_IMAGE_GUID_STR "83447222-1e26-40cd-a395-b7de0957e875" +#define BEAGLEBONEAI64_UBOOT_IMAGE_GUID_STR "4249ff77-c17d-4eb7-a1db-45aa9887d49e" + +&capsule_tispl { + efi-capsule { + image-guid = BEAGLEBONEAI64_SPL_IMAGE_GUID_STR; + + blob { + filename = "tispl.bin_unsigned"; + }; + }; +}; + +&capsule_uboot { + efi-capsule { + image-guid = BEAGLEBONEAI64_UBOOT_IMAGE_GUID_STR; + }; +}; + #endif
arch/arm/dts/k3-j721e-r5-beagleboneai64.dts +29 -0
@@ -183,3 +183,32 @@ }; }; }; + +#include "k3-binman-capsule-r5.dtsi" + +// Capsue update GUIDs. See beagleboneai64.h. +#define BEAGLEBONEAI64_TIBOOT3_IMAGE_GUID_STR "772a4810-2194-4923-8754-0115870ef367" +#define BEAGLEBONEAI64_SYSFW_IMAGE_GUID_STR "dfc9c683-49b7-46bd-b3c1-3a3b2fdb135b" + +&capsule_tiboot3 { + efi-capsule { + image-guid = BEAGLEBONEAI64_TIBOOT3_IMAGE_GUID_STR; + }; +}; + +&binman { + capsule-sysfw { + filename = "sysfw-capsule.bin"; + efi-capsule { + image-index = <0x4>; + image-guid = BEAGLEBONEAI64_SYSFW_IMAGE_GUID_STR; + private-key = "arch/arm/mach-k3/keys/custMpk.pem"; + public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt"; + monotonic-count = <0x1>; + + blob { + filename = "sysfw.itb"; + }; + }; + }; +};
Signature · 1 line
2.34.1