feat(handoff): make tl generation flexible

Make the process of compiling a TL from DT source flexible. Provide a
top level recipe to make it easier for developers to build a transfer
list. Clean up integration of TLC into the build system.

Change-Id: I4466e27a457dfd5bf709dc3a360a2b63bf6030ce
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
This commit is contained in:
Harrison Mutai 2024-08-28 13:27:19 +00:00
parent 9b05c3739c
commit 2329e22b8b
5 changed files with 14 additions and 19 deletions

View file

@ -1496,7 +1496,7 @@ endif #(SPD)
# Build targets
################################################################################
.PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool sptool fip sp fwu_fip certtool dtbs memmap doc enctool
.PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool sptool fip sp tl fwu_fip certtool dtbs memmap doc enctool
.SUFFIXES:
all: msg_start
@ -1742,6 +1742,11 @@ else
${PYTHON} -m memory.memmap -sr ${BUILD_PLAT}
endif
tl: ${BUILD_PLAT}/tl.bin
${BUILD_PLAT}/tl.bin: ${HW_CONFIG}
$(q)poetry -q install
$(q)poetry run tlc create --fdt $< -s ${FW_HANDOFF_SIZE} $@
doc:
$(s)echo " BUILD DOCUMENTATION"
$(q)${MAKE} --no-print-directory -C ${DOCS_PATH} html

View file

@ -149,6 +149,10 @@
#define PLAT_ARM_EL3_FW_HANDOFF_BASE ARM_BL_RAM_BASE
#define PLAT_ARM_EL3_FW_HANDOFF_LIMIT PLAT_ARM_EL3_FW_HANDOFF_BASE + PLAT_ARM_FW_HANDOFF_SIZE
#if RESET_TO_BL31
#define PLAT_ARM_TRANSFER_LIST_DTB_OFFSET FW_NS_HANDOFF_BASE + TRANSFER_LIST_DTB_OFFSET
#endif
#else
#define PLAT_ARM_FW_HANDOFF_SIZE U(0)
#endif

View file

@ -392,9 +392,10 @@ include lib/transfer_list/transfer_list.mk
ifeq ($(RESET_TO_BL31), 1)
HW_CONFIG := ${FVP_HW_CONFIG}
FW_HANDOFF_SIZE := 20000
FW_HANDOFF_SIZE := 20000
$(eval $(call add_define,ARM_PRELOADED_DTB_OFFSET))
TRANSFER_LIST_DTB_OFFSET := 0x20
$(eval $(call add_define,TRANSFER_LIST_DTB_OFFSET))
endif
endif

View file

@ -147,8 +147,7 @@ void __init arm_bl31_early_platform_setup(u_register_t arg0, u_register_t arg1,
bl33_image_ep_info.spsr = arm_get_spsr_for_bl33_entry();
SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE);
bl33_image_ep_info.args.arg0 =
FW_NS_HANDOFF_BASE + ARM_PRELOADED_DTB_OFFSET;
bl33_image_ep_info.args.arg0 = PLAT_ARM_TRANSFER_LIST_DTB_OFFSET;
bl33_image_ep_info.args.arg1 =
TRANSFER_LIST_HANDOFF_X1_VALUE(REGISTER_CONVENTION_VERSION);
bl33_image_ep_info.args.arg3 = FW_NS_HANDOFF_BASE;

View file

@ -469,20 +469,6 @@ ifeq (${RECLAIM_INIT_CODE}, 1)
endif
endif
TRANSFER_LIST_BIN := ${BUILD_PLAT}/tl.bin
.PHONY: tl
tl: ${HW_CONFIG}
@echo " TLC ${TRANSFER_LIST_BIN}"
$(Q)${PYTHON} -m tools.tlc.tlc create --fdt ${HW_CONFIG} -s ${FW_HANDOFF_SIZE} ${TRANSFER_LIST_BIN}
$(Q)$(eval ARM_PRELOADED_DTB_OFFSET := `tlc info --fdt-offset ${TRANSFER_LIST_BIN}`)
ifeq (${TRANSFER_LIST}, 1)
ifeq (${RESET_TO_BL31}, 1)
bl31: tl
endif
endif
ifneq ($(COTDTPATH),)
cot-dt-defines = IMAGE_BL2 $(BL2_DEFINES) $(PLAT_BL_COMMON_DEFINES)
cot-dt-include-dirs = $(BL2_INCLUDE_DIRS) $(PLAT_BL_COMMON_INCLUDE_DIRS)