feat(arm): makefile invoke CoT dt2c

Change the makefile to call the cot-dt2c tool
during the build for Arm platform

Change-Id: Idb7c02cca6b9ddd87f575a42c88e7b2660b896e0
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
This commit is contained in:
Xialin Liu 2024-06-28 12:52:29 -05:00 committed by Manish V Badarkhe
parent 4274d6f885
commit 0e0fab0ca2
2 changed files with 28 additions and 4 deletions

View file

@ -121,6 +121,9 @@ SPTOOL ?= ${SPTOOLPATH}/sptool.py
SP_MK_GEN ?= ${SPTOOLPATH}/sp_mk_generator.py
SP_DTS_LIST_FRAGMENT ?= ${BUILD_PLAT}/sp_list_fragment.dts
# Variables for use with Certificate Conversion (cot-dt2c) Tool
CERTCONVPATH ?= tools/cot_dt2c
# Variables for use with ROMLIB
ROMLIBPATH ?= lib/romlib
@ -1582,6 +1585,7 @@ endif #(CHECKPATCH)
clean:
$(s)echo " CLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_PLAT})
$(q)${MAKE} -C ${CERTCONVPATH} clean
ifdef UNIX_MK
$(q)${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
else
@ -1597,6 +1601,7 @@ realclean distclean:
$(s)echo " REALCLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_BASE})
$(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*)
$(q)${MAKE} -C ${CERTCONVPATH} clean
ifdef UNIX_MK
$(q)${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
else

View file

@ -387,20 +387,25 @@ ifneq (${TRUSTED_BOARD_BOOT},0)
BL1_SOURCES += drivers/auth/dualroot/bl1_cot.c
ifneq (${COT_DESC_IN_DTB},0)
BL2_SOURCES += lib/fconf/fconf_cot_getter.c
else
BL2_SOURCES += drivers/auth/dualroot/bl2_cot.c
endif
else ifeq (${COT},cca)
BL1_SOURCES += drivers/auth/cca/bl1_cot.c
ifneq (${COT_DESC_IN_DTB},0)
BL2_SOURCES += lib/fconf/fconf_cot_getter.c
else
BL2_SOURCES += drivers/auth/cca/bl2_cot.c
endif
else
$(error Unknown chain of trust ${COT})
endif
ifeq (${COT_DESC_IN_DTB},0)
ifeq (${COT},dualroot)
COTDTPATH := fdts/dualroot_cot_descriptors.dtsi
else ifeq (${COT},cca)
COTDTPATH := fdts/cca_cot_descriptors.dtsi
endif
bl2: cot-dt2c
endif
BL1_SOURCES += ${AUTH_SOURCES} \
bl1/tbbr/tbbr_img_desc.c \
plat/arm/common/arm_bl1_fwu.c \
@ -472,3 +477,17 @@ ifeq (${TRANSFER_LIST}, 1)
bl31: tl
endif
endif
cot-dt2c:
ifneq ($(COTDTPATH),)
$(info COT CONVERSION FOR ${COTDTPATH})
toolpath := $(shell which cot-dt2c)
ifeq (${toolpath},)
output := $(shell make -C ./${CERTCONVPATH} install)
$(info install output ${output})
toolpath := $(shell which cot-dt2c)
endif
output := $(shell ${toolpath} convert-to-c ${COTDTPATH} ${BUILD_PLAT}/bl2_cot.c)
$(info ${output})
BL2_SOURCES += ${BUILD_PLAT}/bl2_cot.c
endif