Commit Graph

271 Commits

Author SHA1 Message Date
Arturo Buzarra 3fdb245765 trustfence: add encrypted boot artifact support for CCMP13 platform
This commit updates the secure boot support for STM platforms based on the
STM32 MPU Ecosystem v6.1.1. It introduces support for encrypted boot artifacts,
including TF-A and FIP for the ConnectCore MP13 platform.

https://onedigi.atlassian.net/browse/DEL-8535

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2026-03-05 13:56:25 +01:00
Hector Palacios c7c63e3f28 mca-tool: build the recipe for cc95
The ConnectCore 95 SMARC module has an MCA so we need to
build the mca-tool for this platform.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2026-02-18 11:25:06 +01:00
Arturo Buzarra 263d9a2baa trustfence: add support to generate Cortex-M4 signing keys
Add RSA key generation support for the Cortex-M4 co-processor on
ConnectCore MP15 platforms as part of DEY TrustFence framework.

https://onedigi.atlassian.net/browse/DEL-9920

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2026-01-27 13:04:26 +01:00
Arturo Buzarra fc1d3c5f75 trustfence: add TRUSTFENCE_ENCRYPT variable
Add a variable analogous to TRUSTFENCE_SIGN to enable/disable artifact
encryption. Deprecate TRUSTFENCE_DEK_PATH in favor of TRUSTFENCE_KEYS_PATH to
use a more generic name and avoid overloading it as an on/off flag. Add per-key
variables for encryption key filenames to avoid hardcoded names and allow
platform overrides.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-10-28 12:39:51 +01:00
Arturo Buzarra 3e5cf0c6e6 trustfence: add signed and encrypted firmware support for Cortex-M on STM platforms
Adds support for signing and encrypting Cortex-M firmware on STM platforms,
following the STM32 MPU Ecosystem v6.1.0. This update enables secure boot of
co-processor binaries on ConnectCore MP2, enhancing firmware protection.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-10-28 12:39:51 +01:00
Arturo Buzarra c8757b7bf3 trustfence: add encrypted boot artifact support for STM platforms
This commit updates the secure boot support for STM platforms based on the
STM32 MPU Ecosystem v6.1.0. It introduces support for encrypted boot artifacts,
including TF-A and FIP, and enables this functionality for the ConnectCore MP2
platform.

This enhancement allows secure boot deployments with both authentication and
encryption for improved protection of critical boot components.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-10-06 17:15:17 +02:00
Javier Viguera 47dbfee270 trustfence-sign-artifact: fix kernel load address for u-boot v2024
U-boot v2024 changed the default load address (SYS_LOAD_ADDR) for CC8M
platforms to:
* Ensure the kernel load address is 2MB-aligned (avoiding extra memory
  copy)
* Prevent overlap with the fixed DEK blob address at 0x40400000
    
Update the boot artifacts signing script accordingly.

https://onedigi.atlassian.net/browse/DEL-9537
https://onedigi.atlassian.net/browse/DEL-9541
https://onedigi.atlassian.net/browse/DUB-1099

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2025-04-04 11:15:29 +02:00
Arturo Buzarra b1800736af trustfence: update support to STM platforms and integrate CCMP2
This commit updates secure boot support based on the STM32 MPU Ecosystem v6.0
and integrates support for the ConnectCore MP2 platform.

https://onedigi.atlassian.net/browse/DEL-9442

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-03-26 08:53:12 +01:00
Arturo Buzarra 37517dcbe0 Merge tag 'dey-5.0-r1.3' into dey-5.0/master
Digi Embedded Yocto 5.0-r1.3

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-03-10 11:26:31 +01:00
Arturo Buzarra 829cca1214 meta-digi: update revisions for dey-5.0-r1.3
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-03-06 21:04:25 +01:00
Arturo Buzarra 8f126dc060 meta-digi: revert revisions to AUTOREV
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-02-26 12:56:25 +01:00
Arturo Buzarra 8180e53e83 meta-digi: update revisions for dey-5.0-r1.2
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-02-26 12:56:24 +01:00
Arturo Buzarra 440fd0e20f meta-digi: revert revisions to AUTOREV
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-02-24 13:52:13 +01:00
Arturo Buzarra ba0b696a75 meta-digi: update revisions for dey-5.0-r1.1
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-02-24 13:52:13 +01:00
Arturo Buzarra d5028e781d trustfence-sign-tools: unify recipes based on the latest u-boot v2024.04
The sign script has been updated to support AHAB-based modules like the CCIMX8X.
As a result, there is no longer a need to maintain two separate recipes for the
signing scripts. This commit unifies them into a single recipe.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-02-17 13:55:56 +01:00
Arturo Buzarra 3175ccdb53 switch to building from maintenance branches for dey-5.0
https://onedigi.atlassian.net/browse/DEL-9503

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2025-02-17 13:55:32 +01:00
Javier Viguera 3d2718abb7 trustfence-sign-artifact: fix AHAB-containerizing command for ccimx91
The ccmx91 uses the same AHAB-containerizing command as the ccimx93,
so fix the code to remove the hardcoding check for the ccimx93.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-11-20 18:57:24 +01:00
Javier Viguera 7228eb4738 u-boot-dey: use version v2024.04 for ccimx93
It also includes U-Boot-related recipes.

https://onedigi.atlassian.net/browse/DEL-9257

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-11-05 18:16:59 +01:00
Javier Viguera 373f061650 dey: cosmetic, mark patches as DEY specific
Our distribution is Digi Embedded Yocto (DEY), so use that to mark the
upstream status of the patches in our layer.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-10-22 15:48:00 +02:00
Gabriel Valcazar 2bc985cbea global: add Upstream-Status tag to all patches
This avoids a QA error that is triggered if a patch is missing said tag

https://onedigi.atlassian.net/browse/DEL-9011

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-10-17 13:03:37 +02:00
Gabriel Valcazar f6d91b9022 mca-tool/trustfence-tool: don't install files in /sbin when usrmerge is enabled
These recipes install binaries inside of /sbin, which causes QA errors when
usrmerge is enabled in DISTRO_FEATURES. Said feature is now required for
Yocto 5.0's version of systemd, so keep using the same versions of the tools
and simply move the binaries to /usr/sbin if needed.

https://onedigi.atlassian.net/browse/DEL-9011

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2024-10-17 13:03:37 +02:00
Mike Engel d11b291f9a meta-digi: add new CCMX91 platform into DEY
This commits adds the CCMX91 platform to the DEY
build system. Furthermore, it creates generic ccimx9
support to be used for the CCiMX91 and CCiMX93
platform.

https://onedigi.atlassian.net/browse/DEL-9106

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2024-07-19 07:32:00 +02:00
Isaac Hermida 0c642ed7ec Update Digi Copyright header
Standarize the Copyright header according to company policy.

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
2024-07-15 09:28:58 +02:00
Arturo Buzarra b9d9a0104b trustfence: stm: fix PKI tree check for ccmp13 platform
This commit fixes a race condition where, if you have an existing PKI tree with
the new format (one key_pass file for each key), the script detects that the
PKI tree is incomplete because it is always trying to find the key_pass.txt
file with the old format. This commit adds an additional validation step to
verify the new keys format.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-03-26 12:37:06 +01:00
Javier Viguera f67d59d7b8 meta-digi: support SRK revocation mask when signing boot artifacts
The script to sign the boot artifacts lacked the support to configure the
revocation mask. The at-the-moment supported platforms did not need it,
but the ccimx93 does need it, so implement it in this commit.

https://onedigi.atlassian.net/browse/DEL-8704

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-03-12 18:12:56 +01:00
Javier Viguera 15211c3133 trustfence-sign-artifact: implement support for ccimx93
https://onedigi.atlassian.net/browse/DEL-8704

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-03-12 12:18:59 +01:00
Javier Viguera 765fa48acc trustfence-sign-artifact: move srktool parameters to the platform data
With the introduction of the ccimx93 support in the following commits, the
srktool parameters not only differ for HAB/AHAB devices but also between
devices using AHAB (for example, different parameters for ccimx8x and
ccimx93). Thus, move this information to the platform-specific data table.

https://onedigi.atlassian.net/browse/DEL-8704

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-03-12 12:18:59 +01:00
Javier Viguera d8454cecc7 trustfence-sign-artifact: create a table for platform-specific data
It is a cosmetic change, as there is no change in functionality, but
convert the if..elif..fi structure to a table with the platform-specific
data, so it's easier to maintain and extend.

https://onedigi.atlassian.net/browse/DEL-8704

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-03-12 12:18:59 +01:00
Arturo Buzarra a71ab3313d switch to building from development branches
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-02-16 13:03:50 +01:00
Arturo Buzarra 52eb698999 Merge tag 'dey-4.0-r5.2' into dey-4.0/master
Digi Embedded Yocto 4.0-r5.2

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-02-16 12:59:43 +01:00
Arturo Buzarra bdf80833dc meta-digi: update revisions for dey-4.0-r5.2
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-02-06 18:07:48 +01:00
Arturo Buzarra 7fb5205e73 meta-digi: revert revisions to AUTOREV
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-01-30 16:52:26 +01:00
Arturo Buzarra 04a00b2bd0 meta-digi: update revisions for dey-4.0-r5.1
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-01-30 16:51:33 +01:00
Javier Viguera 65135645a2 trustfence-sign-tools: new recipe based on u-boot v2023.04
The ccimx93 bootloader signing requires this version of the sign script,
but at the moment, the updated script is not compatible with the other
AHAB-based module (ccimx8x), so we cannot just update the recipe for
all modules.

Thus, create a new version of the recipe and use that for the ccimx93
while we still use the old version for the rest of the platforms.

https://onedigi.atlassian.net/browse/DUB-1068

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2024-01-26 11:58:04 +01:00
Arturo Buzarra 62fa660d05 Merge branch 'dey-4.0/master' into dey-4.0/maint
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-01-19 11:46:55 +01:00
Hector Palacios 4f33afcbcf trustfence: split ccmp13 passwords in 8 files and set SWUPDATE keys
For signing SWU files we need to set a couple of variables:
 - SWUPDATE_PRIVATE_KEY_TEMPLATE to the private key file
 - SWUPDATE_PASSWORD_FILE to the password of the private key

The latter must only contain one password, whereas the current key_pass.txt
file had (for the ccmp13) the eight keys separated by a white space.

This commit:
 - If the file key_pass.txt exists, it extracts each key into a separate
   file key_pass0X.txt.
 - If the keys don't exist, generates separate files per key.
 - Changes the permissions of password files to 400.
 - Adapts the sign script to use the single password files.
 - Fixes a few quotes

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2024-01-03 13:05:05 +01:00
Arturo Buzarra e2ee631832 meta-digi: [cosmetic] alphabetize compatible machine string
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2023-10-10 14:58:58 +02:00
Hector Palacios 12c14ffc18 nativesdk: add STM signtools to SDK
The appropriate way to add STM signtools to the SDK is via RDEPENDS on
nativesdk-packagegroup-sdk-host, not through the parent recipe of STM
signtools recipe itself.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-8720
2023-10-09 15:36:44 +02:00
Hector Palacios 6b55769447 nativesdk: add STM signtools to SDK
The appropriate way to add STM signtools to the SDK is via RDEPENDS on
nativesdk-packagegroup-sdk-host, not through the parent recipe of STM
signtools recipe itself.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-8720
2023-10-02 09:35:44 +02:00
Francisco Gil ff071a17be meta-digi: revert revisions to AUTOREV
Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2023-09-15 16:42:58 +02:00
Francisco Gil c7b6a9d637 meta-digi: update revisions for dey-4.0-r4.1
Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2023-09-15 16:41:49 +02:00
Arturo Buzarra 8db6c71a95 Merge branch 'dey-4.0/master' into dey-4.0/maint
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2023-09-08 10:33:10 +02:00
Arturo Buzarra acd2ee22c1 trustfence: stm: rework PKI tree generation for CCMP15 platforms
PKI tree generation for the STM32MP15 cpu provides the undesired file
"publicKeysHashHashes.bin", which is only required by STM32MP13. This commit
generates the PKI tree according to the KeyGen tool documentation to avoid
generate this extra file and avoid confusing the end user.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2023-08-30 09:53:56 +02:00
Arturo Buzarra 4d6947e02a trustfence: stm: improve error handling for PKI tree generation script
Any errors in the PKI tree generation are not reported to bitbake, so the
script fails silently. This commit adds a validation of the script execution,
and if it fails, it aborts the execution and notifies to bitbake.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2023-08-30 09:53:56 +02:00
Arturo Buzarra a8809e68c7 trustfence: stm: fix PKI generation for CCMP13 platform
The KeyGen tool to generate 8 key pairs requires 8 consecutive passwords,
however, when the shell expands the passwords variable, it interprets it as a
single string instead of 8 different strings and fails.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2023-08-30 09:53:56 +02:00
Hector Palacios ae327e8dae trustfence: stm: move generation of PKI out of sign script
Create a new script for the generation of PKI tree for STM platforms
and leave the trustfence-sign-artifact script exclusively for signing.
The new gen-pki script only requires the platform as an argument and the
path to where to save the tree (if it doesn't exist) in
CONFIG_SIGN_KEYS_PATH.

This commit also reverts commit 13c136dbc5 by getting rid of the
trustfence-genpki-native.bb recipe and moving back the PKI generation
functions into trustfence.bbclass. This recipe didn't quite guarantee
that the PKI was generated on time for the recipes that required the
keys to exist, anyway.
Instead, the PKI generation function must be called right after
do_compile() of recipe tf-a-stm32mp to be ready for do_deploy() where
the key is used.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-08-14 09:19:16 +02:00
Gabriel Valcazar 9d98563945 trustfence-sign-tools: use appropriate signing script when using SPL and AHAB
When building imx-boot images with SPL on the ccimx8x, a different signing
procedure is required. We already have a script for this use case in our U-Boot
fork, so make use of it.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2023-07-10 11:09:37 +02:00
Mike Engel 1122980ab9 trustfence: add ccimx6qp platform to the sign tool
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2023-06-20 16:46:16 +02:00
Arturo Buzarra e679d3821d meta-digi: revert revisions to AUTOREV
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2023-05-17 15:34:53 +02:00
Arturo Buzarra 04f8e54400 meta-digi: update revisions for dey-4.0-r3.2
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2023-05-17 15:30:24 +02:00