2021-02-24 10:23:46 +08:00
|
|
|
# Copyright (c) 2021 Arm Limited (or its affiliates). All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
set(armfvp_bin_path $ENV{ARMFVP_BIN_PATH})
|
|
|
|
|
|
|
|
find_program(
|
|
|
|
ARMFVP
|
|
|
|
PATHS ${armfvp_bin_path}
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
NAMES ${ARMFVP_BIN_NAME}
|
|
|
|
)
|
|
|
|
|
2021-08-11 17:25:01 +08:00
|
|
|
if(CONFIG_ARMV8_A_NS)
|
|
|
|
foreach(filetype BL1 FIP)
|
|
|
|
if ((NOT DEFINED ARMFVP_${filetype}_FILE) AND (EXISTS "$ENV{ARMFVP_${filetype}_FILE}"))
|
|
|
|
set(ARMFVP_${filetype}_FILE "$ENV{ARMFVP_${filetype}_FILE}" CACHE FILEPATH
|
|
|
|
"ARM FVP ${filetype} File specified in environment"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT EXISTS "${ARMFVP_${filetype}_FILE}")
|
|
|
|
string(TOLOWER ${filetype} filename)
|
|
|
|
message(FATAL_ERROR "Please specify ARMFVP_${filetype}_FILE in environment "
|
|
|
|
"or with -DARMFVP_${filetype}_FILE=</path/to/${filename}.bin>")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set(ARMFVP_FLAGS ${ARMFVP_FLAGS}
|
|
|
|
-C bp.secureflashloader.fname=${ARMFVP_BL1_FILE}
|
|
|
|
-C bp.flashloader0.fname=${ARMFVP_FIP_FILE}
|
|
|
|
--data cluster0.cpu0="${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_BIN_NAME}"@0x88000000
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(ARMFVP_FLAGS ${ARMFVP_FLAGS}
|
|
|
|
-a ${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-08-30 19:09:48 +08:00
|
|
|
add_custom_target(run_armfvp
|
2021-02-24 10:23:46 +08:00
|
|
|
COMMAND
|
|
|
|
${ARMFVP}
|
|
|
|
${ARMFVP_FLAGS}
|
|
|
|
DEPENDS ${ARMFVP} ${logical_target_for_zephyr_elf}
|
|
|
|
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
|
|
|
|
COMMENT "FVP: ${ARMFVP}"
|
|
|
|
USES_TERMINAL
|
|
|
|
)
|