diff --git a/plat/arm/board/tc/plat_fiptool.mk b/plat/arm/board/tc/plat_fiptool.mk deleted file mode 100644 index 0e1355689..000000000 --- a/plat/arm/board/tc/plat_fiptool.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (c) 2021, NXP. All rights reserved. -# Copyright (c) 2022, Arm Limited. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -# Name of the platform defined source file name, -# which contains platform defined UUID entries populated -# in the plat_def_toc_entries[]. -PLAT_DEF_UUID_CONFIG_FILE_NAME := plat_def_uuid_config - -PLAT_DEF_UUID_CONFIG_FILE_PATH := ../../plat/arm/board/tc - -PLAT_DEF_UUID := yes -PLAT_DEF_UUID_OID_CONFIG_PATH := ../../plat/arm/board/tc - - -INCLUDE_PATHS += -I${PLAT_DEF_UUID_OID_CONFIG_PATH} \ - -I./ -# Clean the stale object file. -$(shell rm ${PLAT_DEF_UUID_CONFIG_FILE_PATH}/${PLAT_DEF_UUID_CONFIG_FILE_NAME}.o) - -ifeq (${PLAT_DEF_OID},yes) -HOSTCCFLAGS += -DPLAT_DEF_OID -endif - -ifeq (${PLAT_DEF_UUID},yes) -HOSTCCFLAGS += -DPLAT_DEF_FIP_UUID -PLAT_OBJECTS += ${PLAT_DEF_UUID_CONFIG_FILE_PATH}/${PLAT_DEF_UUID_CONFIG_FILE_NAME}.o -endif - -OBJECTS += ${PLAT_OBJECTS} diff --git a/plat/arm/board/tc/platform.mk b/plat/arm/board/tc/platform.mk index 7fdc4fd84..269632503 100644 --- a/plat/arm/board/tc/platform.mk +++ b/plat/arm/board/tc/platform.mk @@ -53,9 +53,6 @@ ENABLE_SYS_REG_TRACE_FOR_NS := 1 # enable trace filter control registers access to NS by default ENABLE_TRF_FOR_NS := 1 -# Enable RSS-required FIP UUIDs -$(shell cp plat/arm/board/tc/plat_fiptool.mk ${PLAT_DIR}) - # Include GICv3 driver files include drivers/arm/gic/v3/gicv3.mk diff --git a/plat/nxp/common/fip_handler/ddr_fip/ddr_fip_io.mk b/plat/nxp/common/fip_handler/ddr_fip/ddr_fip_io.mk index 7d673ba54..36c07b735 100644 --- a/plat/nxp/common/fip_handler/ddr_fip/ddr_fip_io.mk +++ b/plat/nxp/common/fip_handler/ddr_fip/ddr_fip_io.mk @@ -1,5 +1,6 @@ # # Copyright 2020 NXP +# Copyright (c) 2023, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -22,8 +23,6 @@ PLAT_INCLUDES += -I${FIP_HANDLER_COMMON_PATH}\ DDR_FIP_IO_SOURCES += $(DDR_FIP_IO_STORAGE_PATH)/ddr_io_storage.c -$(shell cp tools/nxp/plat_fiptool/plat_fiptool.mk ${PLAT_DIR}) - ifeq (${BL_COMM_DDR_FIP_IO_NEEDED},yes) BL_COMMON_SOURCES += ${DDR_FIP_IO_SOURCES} else diff --git a/plat/nxp/common/fip_handler/fuse_fip/fuse.mk b/plat/nxp/common/fip_handler/fuse_fip/fuse.mk index d8f5ae6ad..4e84d0206 100644 --- a/plat/nxp/common/fip_handler/fuse_fip/fuse.mk +++ b/plat/nxp/common/fip_handler/fuse_fip/fuse.mk @@ -1,5 +1,6 @@ # # Copyright 2018-2020 NXP +# Copyright (c) 2023, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -29,8 +30,6 @@ fip_fuse: ${BUILD_PLAT}/${FUSE_FIP_NAME} ifeq (${FUSE_PROV_FILE},) -$(shell cp tools/nxp/plat_fiptool/plat_fiptool.mk ${PLAT_DIR}) - else ifeq (${TRUSTED_BOARD_BOOT},1) FUSE_PROV_FILE_SB = $(notdir ${FUSE_PROV_FILE})_prov.sb diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile index ac262cdff..2ebee3393 100644 --- a/tools/fiptool/Makefile +++ b/tools/fiptool/Makefile @@ -54,10 +54,13 @@ HOSTCC ?= gcc ifneq (${PLAT},) TF_PLATFORM_ROOT := ../../plat/ include ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk -PLAT_FIPTOOL_HELPER_MK := ${PLAT_DIR}/plat_fiptool.mk +COMBINED_PATH_FRAG := plat_fiptool/ +PLAT_FIPTOOL_HELPER_MK := $(foreach path_frag,$(subst /, ,$(patsubst ../../plat/%/,%,${PLAT_DIR})),\ + $(eval COMBINED_PATH_FRAG := ${COMBINED_PATH_FRAG}/${path_frag})\ + $(wildcard ${COMBINED_PATH_FRAG}/plat_fiptool.mk)) endif -ifneq (,$(wildcard ${PLAT_FIPTOOL_HELPER_MK})) +ifneq (,$(wildcard $(lastword ${PLAT_FIPTOOL_HELPER_MK}))) include ${PLAT_FIPTOOL_HELPER_MK} endif diff --git a/plat/arm/board/tc/plat_def_uuid_config.c b/tools/fiptool/plat_fiptool/arm/board/tc/plat_def_uuid_config.c similarity index 100% rename from plat/arm/board/tc/plat_def_uuid_config.c rename to tools/fiptool/plat_fiptool/arm/board/tc/plat_def_uuid_config.c diff --git a/tools/fiptool/plat_fiptool/arm/board/tc/plat_fiptool.mk b/tools/fiptool/plat_fiptool/arm/board/tc/plat_fiptool.mk new file mode 100644 index 000000000..70ccfc528 --- /dev/null +++ b/tools/fiptool/plat_fiptool/arm/board/tc/plat_fiptool.mk @@ -0,0 +1,12 @@ +# +# Copyright (c) 2021, NXP. All rights reserved. +# Copyright (c) 2022-2023, Arm Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +INCLUDE_PATHS += -I./ \ + -I../../plat/arm/board/tc + +HOSTCCFLAGS += -DPLAT_DEF_FIP_UUID +OBJECTS += plat_fiptool/arm/board/tc/plat_def_uuid_config.o diff --git a/tools/nxp/plat_fiptool/plat_def_uuid_config.c b/tools/fiptool/plat_fiptool/nxp/plat_def_uuid_config.c similarity index 100% rename from tools/nxp/plat_fiptool/plat_def_uuid_config.c rename to tools/fiptool/plat_fiptool/nxp/plat_def_uuid_config.c diff --git a/tools/nxp/plat_fiptool/plat_fiptool.mk b/tools/fiptool/plat_fiptool/nxp/plat_fiptool.mk similarity index 81% rename from tools/nxp/plat_fiptool/plat_fiptool.mk rename to tools/fiptool/plat_fiptool/nxp/plat_fiptool.mk index ca2962a04..6d7b07be7 100644 --- a/tools/nxp/plat_fiptool/plat_fiptool.mk +++ b/tools/fiptool/plat_fiptool/nxp/plat_fiptool.mk @@ -1,5 +1,6 @@ # # Copyright (c) 2021, NXP. All rights reserved. +# Copyright (c) 2023, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -9,7 +10,7 @@ # in the plat_def_toc_entries[]. PLAT_DEF_UUID_CONFIG_FILE_NAME := plat_def_uuid_config -PLAT_DEF_UUID_CONFIG_FILE_PATH := ../nxp/plat_fiptool +PLAT_DEF_UUID_CONFIG_FILE_PATH := plat_fiptool/nxp/ PLAT_DEF_OID := yes PLAT_DEF_UUID := yes @@ -18,8 +19,6 @@ PLAT_DEF_UUID_OID_CONFIG_PATH := ../../plat/nxp/common/fip_handler/common INCLUDE_PATHS += -I${PLAT_DEF_UUID_OID_CONFIG_PATH} \ -I./ -# Clean the stale object file. -$(shell rm ${PLAT_DEF_UUID_CONFIG_FILE_PATH}/${PLAT_DEF_UUID_CONFIG_FILE_NAME}.o) ifeq (${PLAT_DEF_OID},yes) HOSTCCFLAGS += -DPLAT_DEF_OID diff --git a/plat/st/stm32mp1/plat_def_uuid_config.c b/tools/fiptool/plat_fiptool/st/stm32mp1/plat_def_uuid_config.c similarity index 100% rename from plat/st/stm32mp1/plat_def_uuid_config.c rename to tools/fiptool/plat_fiptool/st/stm32mp1/plat_def_uuid_config.c diff --git a/plat/st/stm32mp1/plat_fiptool.mk b/tools/fiptool/plat_fiptool/st/stm32mp1/plat_fiptool.mk similarity index 87% rename from plat/st/stm32mp1/plat_fiptool.mk rename to tools/fiptool/plat_fiptool/st/stm32mp1/plat_fiptool.mk index 00570c2b3..1ba47c1fe 100644 --- a/plat/st/stm32mp1/plat_fiptool.mk +++ b/tools/fiptool/plat_fiptool/st/stm32mp1/plat_fiptool.mk @@ -16,7 +16,7 @@ PLAT_DEF_UUID := yes ifeq (${PLAT_DEF_UUID},yes) HOSTCCFLAGS += -DPLAT_DEF_FIP_UUID -${PLAT_DEF_UUID_FILE_NAME}.o: ${PLAT_DIR}${PLAT_DEF_UUID_FILE_NAME}.c +${PLAT_DEF_UUID_FILE_NAME}.o: plat_fiptool/st/stm32mp1/${PLAT_DEF_UUID_FILE_NAME}.c ${HOSTCC} -c ${CPPFLAGS} ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@ PLAT_OBJECTS += ${PLAT_DEF_UUID_FILE_NAME}.o