armfvp.cmake 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright (c) 2021 Arm Limited (or its affiliates). All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0
  3. set(armfvp_bin_path $ENV{ARMFVP_BIN_PATH})
  4. find_program(
  5. ARMFVP
  6. PATHS ${armfvp_bin_path}
  7. NO_DEFAULT_PATH
  8. NAMES ${ARMFVP_BIN_NAME}
  9. )
  10. if(CONFIG_ARMV8_A_NS)
  11. foreach(filetype BL1 FIP)
  12. if ((NOT DEFINED ARMFVP_${filetype}_FILE) AND (EXISTS "$ENV{ARMFVP_${filetype}_FILE}"))
  13. set(ARMFVP_${filetype}_FILE "$ENV{ARMFVP_${filetype}_FILE}" CACHE FILEPATH
  14. "ARM FVP ${filetype} File specified in environment"
  15. )
  16. endif()
  17. if(NOT EXISTS "${ARMFVP_${filetype}_FILE}")
  18. string(TOLOWER ${filetype} filename)
  19. message(FATAL_ERROR "Please specify ARMFVP_${filetype}_FILE in environment "
  20. "or with -DARMFVP_${filetype}_FILE=</path/to/${filename}.bin>")
  21. endif()
  22. endforeach()
  23. set(ARMFVP_FLAGS ${ARMFVP_FLAGS}
  24. -C bp.secureflashloader.fname=${ARMFVP_BL1_FILE}
  25. -C bp.flashloader0.fname=${ARMFVP_FIP_FILE}
  26. --data cluster0.cpu0="${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_BIN_NAME}"@0x88000000
  27. )
  28. else()
  29. set(ARMFVP_FLAGS ${ARMFVP_FLAGS}
  30. -a ${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME}
  31. )
  32. endif()
  33. add_custom_target(run
  34. COMMAND
  35. ${ARMFVP}
  36. ${ARMFVP_FLAGS}
  37. DEPENDS ${ARMFVP} ${logical_target_for_zephyr_elf}
  38. WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
  39. COMMENT "FVP: ${ARMFVP}"
  40. USES_TERMINAL
  41. )