Skip to content

Commit f0a82b8

Browse files
committed
tf-a-stm32mp: set the monotonic counter by using the incremental commit counts of this meta layer
1 parent 187403d commit f0a82b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

recipes-bsp/trusted-firmware-a/tf-a-stm32mp_2.8.bb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ EXTRA_OEMAKE += "STM32MP1_OPTEE_IN_SYSRAM=1"
4949
EXTRA_OEMAKE += "DTB_FILE_NAME=${TFA_DEVICETREE}.${DT_SUFFIX}"
5050

5151
# Monotonic counter to be incremented and prevent bootloader rollback
52-
TFA_MONOTONIC_CNTR ?= "1"
52+
# will be set automatically from incremental commit counts of this repo
53+
TFA_MONOTONIC_CNTR ?= "${@(str(os.popen('git rev-list --count HEAD -C ' + (d.getVar('TOPDIR') or '')).read().strip() or '1'))}"
5354
EXTRA_OEMAKE += "STM32_TF_VERSION=${TFA_MONOTONIC_CNTR}"
5455

5556
# FIP signing configuration
@@ -66,7 +67,8 @@ do_compile:prepend() {
6667

6768
# Generate FIP
6869
do_compile:append() {
69-
70+
bbwarn "STM32MP15X_BASE: ${STM32MP15X_BASE}"
71+
bbwarn "TFA_MONOTONIC_CNTR: ${TFA_MONOTONIC_CNTR}"
7072
if ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}; then
7173
oe_runmake fip \
7274
BL32=${DEPLOY_DIR_IMAGE}/optee/${OPTEE_HEADER}-${OPTEE_CONF}.${OPTEE_SUFFIX} \

0 commit comments

Comments
 (0)