From fe7b86df66b8043805ee4bcd5195968ab1a2409a Mon Sep 17 00:00:00 2001 From: Sahil Shakil Malpekar Date: Tue, 20 Jan 2026 13:13:35 +0530 Subject: [PATCH] fix(cmake): refactor duplicated build logic - Centralize VAL library selection in val.cmake and remove redundant val_* files. - Remove DRTM/PFDI/MPAM-related VAL sources and unused per-ACS execute/main files. - Avoid creating an empty output directory during configure. Signed-off-by: Sahil Shakil Malpekar Change-Id: I493f083a114e0bebbf867b1a0dc6e9167e220cad --- CMakeLists.txt | 20 ++--- pal/baremetal/pal.cmake | 5 +- test_pool/test.cmake | 5 +- tools/cmake/infra/CMakeLists.txt | 7 +- tools/cmake/toolchain/linker.cmake | 19 ++--- tools/cmake/toolchain/utils.cmake | 7 +- tools/scripts/compile_check.py | 73 ----------------- val/val.cmake | 126 +++++++++++++++++++++++++++++ val/val_bsa.cmake | 83 ------------------- val/val_pc_bsa.cmake | 83 ------------------- val/val_sbsa.cmake | 80 ------------------ 11 files changed, 151 insertions(+), 357 deletions(-) delete mode 100644 tools/scripts/compile_check.py create mode 100644 val/val.cmake delete mode 100644 val/val_bsa.cmake delete mode 100644 val/val_pc_bsa.cmake delete mode 100644 val/val_sbsa.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 298c1084..d3f2fbee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ ## @file - # Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + # Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. # SPDX-License-Identifier : Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,7 @@ # Set the minimum required version of CMake for the project cmake_minimum_required(VERSION 3.21) -project(bsa-acs LANGUAGES) +project(sysarch-acs LANGUAGES) # cmake_policy cmake_policy(SET CMP0001 NEW) @@ -29,7 +29,6 @@ get_filename_component(ROOT_DIR . ABSOLUTE) # Set internal build directory variable set(BUILD ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "Setting build directory to ${BUILD}" FORCE) -file(MAKE_DIRECTORY ${BUILD}/output/) # Set global compile list variable set(COMPILE_LIST "") @@ -133,9 +132,9 @@ option(TARGET_SIMULATION "Enable simulation/emulation optimizations (defines TAR if(TARGET_SIMULATION) message(STATUS "[ACS] : TARGET_SIMULATION is enabled (defining TARGET_SIMULATION)") add_compile_definitions(TARGET_SIMULATION) - else() +else() message(STATUS "[ACS] : TARGET_SIMULATION is disabled") - endif() +endif() # Include the files for make clean foreach(clean_item ${CLEAN_LIST}) @@ -165,7 +164,7 @@ add_custom_target(acs_all DEPENDS ${ACS_LIST} ) -message(STATUS "[ACS] : ACS is set to ${ACS}, and TAREGT to ${TARGET} based on configuration") +message(STATUS "[ACS] : ACS is set to ${ACS}, and TARGET to ${TARGET} based on configuration") message(STATUS "[ACS] : You can change overide target using -DTARGET=") message(STATUS "[ACS] : Supported values for TARGET: ${TARGET_LIST}") message(STATUS "[ACS] : Example - cmake --preset bsa -DTARGET=RDV3") @@ -173,12 +172,3 @@ message(STATUS "[ACS] : Check available presets by - `cmake --list-presets`") message(STATUS "[ACS] : To build using cmake - `cmake --build --preset bsa`") message(STATUS "[ACS] : To build using make - `cmake --preset acs_all; cd build; make bsa` (to build all baremetal acs - `make acs_all`)") add_subdirectory(${ROOT_DIR}/tools/cmake/infra) - - -### Throw waring for the files which is not compiled ### - -# list(REMOVE_DUPLICATES COMPILE_LIST) -# execute_process(COMMAND python ${ROOT_DIR}/tools/scripts/compile_check.py "${COMPILE_LIST}" "${ROOT_DIR}" "${TARGET}" OUTPUT_VARIABLE NOT_COMPILED_FILES) -# if(NOT ${NOT_COMPILED_FILES} MATCHES NULL) -# message(WARNING "Following files are not compiled ${NOT_COMPILED_FILES}") -# endif() diff --git a/pal/baremetal/pal.cmake b/pal/baremetal/pal.cmake index 3f3dbaf3..63a8767e 100644 --- a/pal/baremetal/pal.cmake +++ b/pal/baremetal/pal.cmake @@ -1,5 +1,5 @@ ## @file - # Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + # Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. # SPDX-License-Identifier : Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,8 +22,7 @@ ) #Create compile list files -list(APPEND COMPILE_LIST ${PAL_SRC}) -set(COMPILE_LIST ${COMPILE_LIST} PARENT_SCOPE) +acs_append_compile_list(${PAL_SRC}) # Create PAL library add_library(${PAL_LIB} STATIC ${PAL_SRC}) diff --git a/test_pool/test.cmake b/test_pool/test.cmake index 15506ab1..6069c472 100644 --- a/test_pool/test.cmake +++ b/test_pool/test.cmake @@ -1,5 +1,5 @@ ## @file -# Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. # SPDX-License-Identifier : Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -92,8 +92,7 @@ endforeach() add_library(${TEST_LIB} STATIC ${TEST_SRC}) #Create compile list files - list(APPEND COMPILE_LIST ${TEST_SRC}) - set(COMPILE_LIST ${COMPILE_LIST} PARENT_SCOPE) + acs_append_compile_list(${TEST_SRC}) target_include_directories(${TEST_LIB} PRIVATE ${TEST_INCLUDE} ) diff --git a/tools/cmake/infra/CMakeLists.txt b/tools/cmake/infra/CMakeLists.txt index 4c0bac0e..a3e86340 100644 --- a/tools/cmake/infra/CMakeLists.txt +++ b/tools/cmake/infra/CMakeLists.txt @@ -1,5 +1,5 @@ ## @file - # Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + # Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. # SPDX-License-Identifier : Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,11 +15,12 @@ # limitations under the License. ## -project(bsa LANGUAGES C ASM) +project(sysarch LANGUAGES C ASM) set(VAL_LIB ${ACS}_val_lib) set(PAL_LIB ${ACS}_pal_lib) -include(${ROOT_DIR}/val/val_${ACS}.cmake) +include(${ROOT_DIR}/val/val.cmake) +acs_add_val_library_for_acs(${ACS}) include(${ROOT_DIR}/pal/baremetal/pal.cmake) include(${ROOT_DIR}/test_pool/test.cmake) diff --git a/tools/cmake/toolchain/linker.cmake b/tools/cmake/toolchain/linker.cmake index 35594c79..9ba3238b 100644 --- a/tools/cmake/toolchain/linker.cmake +++ b/tools/cmake/toolchain/linker.cmake @@ -1,5 +1,5 @@ ## @file - # Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + # Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. # SPDX-License-Identifier : Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,18 +39,11 @@ function (create_executable EXE_NAME OUTPUT_DIR TEST) set(SCATTER_INPUT_FILE "${ROOT_DIR}/tools/cmake/infra/${EXE_NAME}_image.ld.S") set(SCATTER_OUTPUT_FILE "${OUTPUT_DIR}/${EXE_NAME}_image.ld") - if(ACS MATCHES "sbsa") - # Preprocess the scatter file for image layout symbols - add_custom_command(OUTPUT CPP-LD--${EXE_NAME}${TEST} - COMMAND ${CROSS_COMPILE}gcc -E -P -I${ROOT_DIR}/apps/baremetal/ -I${ROOT_DIR}/pal/baremetal/target/${TARGET}/include -I${ROOT_DIR} ${SCATTER_INPUT_FILE} -o ${SCATTER_OUTPUT_FILE} -DCMAKE_BUILD={CMAKE_BUILD} - DEPENDS ${VAL_LIB} ${PAL_LIB} ${TEST_LIB}) - add_custom_target(CPP-LD-${EXE_NAME}${TEST} ALL DEPENDS CPP-LD--${EXE_NAME}${TEST}) - elseif(ACS MATCHES "bsa") - add_custom_command(OUTPUT CPP-LD--${EXE_NAME}${TEST} - COMMAND ${CROSS_COMPILE}gcc -E -P -I${ROOT_DIR}/apps/baremetal/ -I${ROOT_DIR}/pal/baremetal/target/${TARGET}/include -I${ROOT_DIR} ${SCATTER_INPUT_FILE} -o ${SCATTER_OUTPUT_FILE} -DCMAKE_BUILD={CMAKE_BUILD} - DEPENDS ${VAL_LIB} ${PAL_LIB} ${TEST_LIB}) - add_custom_target(CPP-LD-${EXE_NAME}${TEST} ALL DEPENDS CPP-LD--${EXE_NAME}${TEST}) - endif() + add_custom_command(OUTPUT CPP-LD--${EXE_NAME}${TEST} + COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_DIR} + COMMAND ${CROSS_COMPILE}gcc -E -P -I${ROOT_DIR}/apps/baremetal/ -I${ROOT_DIR}/pal/baremetal/target/${TARGET}/include -I${ROOT_DIR} ${SCATTER_INPUT_FILE} -o ${SCATTER_OUTPUT_FILE} -DCMAKE_BUILD={CMAKE_BUILD} + DEPENDS ${VAL_LIB} ${PAL_LIB} ${TEST_LIB}) + add_custom_target(CPP-LD-${EXE_NAME}${TEST} ALL DEPENDS CPP-LD--${EXE_NAME}${TEST}) # Link the objects add_custom_command(OUTPUT ${EXE_NAME}${TEST}.elf diff --git a/tools/cmake/toolchain/utils.cmake b/tools/cmake/toolchain/utils.cmake index 8812f4ff..91192fd3 100644 --- a/tools/cmake/toolchain/utils.cmake +++ b/tools/cmake/toolchain/utils.cmake @@ -1,5 +1,5 @@ ## @file - # Copyright (c) 2023, 2025, Arm Limited or its affiliates. All rights reserved. + # Copyright (c) 2023, 2025-2026, Arm Limited or its affiliates. All rights reserved. # SPDX-License-Identifier : Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,3 +26,8 @@ function(_get_sub_dir_list result parent_dir) endforeach() set(${result} ${dir_list} PARENT_SCOPE) endfunction(_get_sub_dir_list) + +function(acs_append_compile_list) + list(APPEND COMPILE_LIST ${ARGN}) + set(COMPILE_LIST ${COMPILE_LIST} PARENT_SCOPE) +endfunction(acs_append_compile_list) diff --git a/tools/scripts/compile_check.py b/tools/scripts/compile_check.py deleted file mode 100644 index df27d1df..00000000 --- a/tools/scripts/compile_check.py +++ /dev/null @@ -1,73 +0,0 @@ -## @file - # Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. - # SPDX-License-Identifier : Apache-2.0 - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - ## - -import sys -import os -from os import walk -import warnings - -IGNORE_FILE_TYPES = ['', '.inf', '.mk', '.md', '.cmake', 'json', '.dts', '.h'] - -def compile_check(COMPILED_FILE, ROOT_DIR, TARGET): - - VAL_PATH = os.path.join(ROOT_DIR,'val') - PLAT_COMMON = os.path.join(ROOT_DIR,'platform', 'baremetal', "common") - PLAT_PATH = os.path.join(ROOT_DIR,'platform', 'baremetal', TARGET) - TEST_PATH = os.path.join(ROOT_DIR,'test_pool') - - global_filelist = [] - - for val, val_dir, val_files in os.walk(VAL_PATH): - for file in val_files: - if (os.path.splitext(file)[1] in IGNORE_FILE_TYPES): - continue - else: - global_filelist.append(os.path.join(val,file)) - - for plat, plat_dir, plat_files in os.walk(PLAT_COMMON): - for file in plat_files: - if (os.path.splitext(file)[1] in IGNORE_FILE_TYPES): - continue - else: - global_filelist.append(os.path.join(plat,file)) - - for plat, plat_dir, plat_files in os.walk(PLAT_PATH): - for file in plat_files: - if (os.path.splitext(file)[1] in IGNORE_FILE_TYPES): - continue - else: - global_filelist.append(os.path.join(plat,file)) - - for test, test_dir, test_files in os.walk(TEST_PATH): - for file in test_files: - if (os.path.splitext(file)[1] in IGNORE_FILE_TYPES): - continue - else: - global_filelist.append(os.path.join(test,file)) - - not_compiled_files = [not_compiled for not_compiled in global_filelist - if not_compiled not in COMPILED_FILE] - for i in not_compiled_files: - print(i) - - -if __name__ == "__main__": - COMPILED_FILE = sys.argv[1] - ROOT_DIR = sys.argv[2] - TARGET = sys.argv[3] - - compile_check(COMPILED_FILE, ROOT_DIR, TARGET) diff --git a/val/val.cmake b/val/val.cmake new file mode 100644 index 00000000..d7c6200d --- /dev/null +++ b/val/val.cmake @@ -0,0 +1,126 @@ +## @file + # Copyright (c) 2026, Arm Limited or its affiliates. All rights reserved. + # SPDX-License-Identifier : Apache-2.0 + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + +include_guard() + +function(acs_add_val_library) + set(options) + set(oneValueArgs) + set(multiValueArgs REMOVE_SOURCES EXTRA_DEFS) + cmake_parse_arguments(VAL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + file(GLOB VAL_SRC + "${ROOT_DIR}/val/src/AArch64/*.S" + "${ROOT_DIR}/val/src/AArch64/*.h" + "${ROOT_DIR}/val/include/*.h" + "${ROOT_DIR}/val/src/*.c" + "${ROOT_DIR}/val/driver/pcie/*.h" + "${ROOT_DIR}/val/driver/pcie/*.c" + "${ROOT_DIR}/val/driver/smmu_v3/*.h" + "${ROOT_DIR}/val/driver/smmu_v3/*.c" + "${ROOT_DIR}/val/driver/gic/*.h" + "${ROOT_DIR}/val/driver/gic/*.c" + "${ROOT_DIR}/val/driver/gic/AArch64/*.S" + "${ROOT_DIR}/val/driver/gic/its/*.h" + "${ROOT_DIR}/val/driver/gic/its/*.c" + "${ROOT_DIR}/val/driver/gic/v2/*.h" + "${ROOT_DIR}/val/driver/gic/v2/*.c" + "${ROOT_DIR}/val/driver/gic/v3/*.h" + "${ROOT_DIR}/val/driver/gic/v3/*.c" + "${ROOT_DIR}/val/driver/gic/v3/AArch64/*.S" + "${ROOT_DIR}/apps/baremetal/*.h" + "${ROOT_DIR}/apps/baremetal/*.c" + ) + + if(VAL_REMOVE_SOURCES) + list(REMOVE_ITEM VAL_SRC ${VAL_REMOVE_SOURCES}) + endif() + list(REMOVE_DUPLICATES VAL_SRC) + + acs_append_compile_list(${VAL_SRC}) + + add_library(${VAL_LIB} STATIC ${VAL_SRC}) + + # Define COMPILE_RB_EXE for gating few compilations in val for rule based + # execution infra. + target_compile_definitions(${VAL_LIB} PRIVATE COMPILE_RB_EXE ${VAL_EXTRA_DEFS}) + + target_include_directories(${VAL_LIB} PRIVATE + ${CMAKE_CURRENT_BINARY_DIR} + ${ROOT_DIR}/ + ${ROOT_DIR}/val + ${ROOT_DIR}/val/include/ + ${ROOT_DIR}/val/src/AArch64/ + ${ROOT_DIR}/val/driver/smmu_v3/ + ${ROOT_DIR}/val/driver/gic/ + ${ROOT_DIR}/val/driver/gic/its/ + ${ROOT_DIR}/val/driver/gic/v2/ + ${ROOT_DIR}/val/driver/gic/v3/ + ${ROOT_DIR}/apps/baremetal/ + ${ROOT_DIR}/pal/baremetal/target/${TARGET}/include/ + ) + + unset(VAL_SRC) +endfunction() + +## @brief Add VAL library sources/defs/includes for a specific ACS variant. +# +# @param ACS_NAME One of: bsa, sbsa, pc_bsa. +# +function(acs_add_val_library_for_acs ACS_NAME) + set(common_remove_sources + "${ROOT_DIR}/val/src/AArch64/Drtm.S" + "${ROOT_DIR}/val/src/acs_pfdi.c" + "${ROOT_DIR}/val/src/drtm_execute_test.c" + "${ROOT_DIR}/val/src/mpam_execute_test.c" + "${ROOT_DIR}/val/src/pfdi_execute_test.c" + ) + if(ACS_NAME STREQUAL "bsa") + list(APPEND remove_sources + "${ROOT_DIR}/apps/baremetal/sbsa_main.c" + "${ROOT_DIR}/apps/baremetal/pc_bsa_main.c" + "${ROOT_DIR}/val/src/sbsa_execute_test.c" + "${ROOT_DIR}/val/src/pc_bsa_execute_test.c" + ) + list(APPEND remove_sources ${common_remove_sources}) + list(APPEND extra_defs BAREMETAL_BSA_BUILD) + elseif(ACS_NAME STREQUAL "sbsa") + list(APPEND remove_sources + "${ROOT_DIR}/apps/baremetal/bsa_main.c" + "${ROOT_DIR}/apps/baremetal/pc_bsa_main.c" + "${ROOT_DIR}/val/src/bsa_execute_test.c" + "${ROOT_DIR}/val/src/pc_bsa_execute_test.c" + ) + list(APPEND remove_sources ${common_remove_sources}) + elseif(ACS_NAME STREQUAL "pc_bsa") + list(APPEND remove_sources + "${ROOT_DIR}/apps/baremetal/bsa_main.c" + "${ROOT_DIR}/apps/baremetal/sbsa_main.c" + "${ROOT_DIR}/val/src/bsa_execute_test.c" + "${ROOT_DIR}/val/src/sbsa_execute_test.c" + ) + list(APPEND remove_sources ${common_remove_sources}) + list(APPEND extra_defs BAREMETAL_PCBSA_BUILD) + else() + message(FATAL_ERROR "Unsupported ACS value for val library: ${ACS_NAME}") + endif() + + acs_add_val_library( + REMOVE_SOURCES ${remove_sources} + EXTRA_DEFS ${extra_defs} + ) +endfunction() diff --git a/val/val_bsa.cmake b/val/val_bsa.cmake deleted file mode 100644 index 546bf1a9..00000000 --- a/val/val_bsa.cmake +++ /dev/null @@ -1,83 +0,0 @@ -## @file - # Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. - # SPDX-License-Identifier : Apache-2.0 - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - ## - - file(GLOB VAL_SRC - "${ROOT_DIR}/val/src/AArch64/*.S" - "${ROOT_DIR}/val/src/AArch64/*.h" - "${ROOT_DIR}/val/include/*.h" - "${ROOT_DIR}/val/src/*.c" - "${ROOT_DIR}/val/src/AArch64/*.S" - "${ROOT_DIR}/val/src/*.c" - "${ROOT_DIR}/val/driver/pcie/*.h" - "${ROOT_DIR}/val/driver/pcie/*.c" - "${ROOT_DIR}/val/driver/smmu_v3/*.h" - "${ROOT_DIR}/val/driver/smmu_v3/*.c" - "${ROOT_DIR}/val/driver/gic/*.h" - "${ROOT_DIR}/val/driver/gic/*.c" - "${ROOT_DIR}/val/driver/gic/AArch64/*.S" - "${ROOT_DIR}/val/driver/gic/its/*.h" - "${ROOT_DIR}/val/driver/gic/its/*.c" - "${ROOT_DIR}/val/driver/gic/v2/*.h" - "${ROOT_DIR}/val/driver/gic/v2/*.c" - "${ROOT_DIR}/val/driver/gic/v3/*.h" - "${ROOT_DIR}/val/driver/gic/v3/*.c" - "${ROOT_DIR}/val/driver/gic/v3/AArch64/*.S" - "${ROOT_DIR}/apps/baremetal/*.h" - "${ROOT_DIR}/apps/baremetal/*.c" - -) - -list(REMOVE_ITEM VAL_SRC - "${ROOT_DIR}/val/src/AArch64/Drtm.S" - "${ROOT_DIR}/apps/baremetal/sbsa_main.c" - "${ROOT_DIR}/apps/baremetal/pc_bsa_main.c" - "${ROOT_DIR}/val/src/sbsa_execute_test.c" - "${ROOT_DIR}/val/src/mpam_execute_test.c" -) - - -#Create compile list files -list(APPEND COMPILE_LIST ${VAL_SRC}) -set(COMPILE_LIST ${COMPILE_LIST} PARENT_SCOPE) - -# Create VAL library -add_library(${VAL_LIB} STATIC ${VAL_SRC}) - -# Define COMPILE_RB_EXE for gating few compilations in val for rule based -# execution infra. -target_compile_definitions(${VAL_LIB} PRIVATE COMPILE_RB_EXE) -# Define BAREMETAL_BSA_BUILD -target_compile_definitions(${VAL_LIB} PRIVATE BAREMETAL_BSA_BUILD) - -target_include_directories(${VAL_LIB} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - ${ROOT_DIR}/ - ${ROOT_DIR}/val - ${ROOT_DIR}/val/include/ - ${ROOT_DIR}/val/src/AArch64/ - ${ROOT_DIR}/val/driver/smmu_v3/ - ${ROOT_DIR}/val/driver/gic/ - ${ROOT_DIR}/val/driver/gic/its/ - ${ROOT_DIR}/val/driver/gic/v2/ - ${ROOT_DIR}/val/driver/gic/v3/ - ${ROOT_DIR}/apps/baremetal/ - ${ROOT_DIR}/pal/baremetal/base/include/ - ${ROOT_DIR}/pal/baremetal/target/${TARGET}/include/ - ${ROOT_DIR}/pal/baremetal/base/src/AArch64/ -) - -unset(VAL_SRC) diff --git a/val/val_pc_bsa.cmake b/val/val_pc_bsa.cmake deleted file mode 100644 index c6a3c40a..00000000 --- a/val/val_pc_bsa.cmake +++ /dev/null @@ -1,83 +0,0 @@ -## @file - # Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved. - # SPDX-License-Identifier : Apache-2.0 - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - ## - - file(GLOB VAL_SRC - "${ROOT_DIR}/val/src/AArch64/*.S" - "${ROOT_DIR}/val/src/AArch64/*.s" - "${ROOT_DIR}/val/src/AArch64/*.h" - "${ROOT_DIR}/val/include/*.h" - "${ROOT_DIR}/val/src/*.c" - "${ROOT_DIR}/val/driver/pcie/*.h" - "${ROOT_DIR}/val/driver/pcie/*.c" - "${ROOT_DIR}/val/driver/smmu_v3/*.h" - "${ROOT_DIR}/val/driver/smmu_v3/*.c" - "${ROOT_DIR}/val/driver/gic/*.h" - "${ROOT_DIR}/val/driver/gic/*.c" - "${ROOT_DIR}/val/driver/gic/AArch64/*.S" - "${ROOT_DIR}/val/driver/gic/its/*.h" - "${ROOT_DIR}/val/driver/gic/its/*.c" - "${ROOT_DIR}/val/driver/gic/v2/*.h" - "${ROOT_DIR}/val/driver/gic/v2/*.c" - "${ROOT_DIR}/val/driver/gic/v3/*.h" - "${ROOT_DIR}/val/driver/gic/v3/*.c" - "${ROOT_DIR}/val/driver/gic/v3/AArch64/*.S" - "${ROOT_DIR}/apps/baremetal/*.h" - "${ROOT_DIR}/apps/baremetal/*.c" - -) - -list(REMOVE_ITEM VAL_SRC - "${ROOT_DIR}/val/src/AArch64/Drtm.S" - "${ROOT_DIR}/val/src/AArch64/BsaBootEntry.S" - "${ROOT_DIR}/val/src/AArch64/SbsaBootEntry.S" - "${ROOT_DIR}/apps/baremetal/bsa_main.c" - "${ROOT_DIR}/apps/baremetal/sbsa_main.c" - "${ROOT_DIR}/val/src/bsa_execute_test.c" - "${ROOT_DIR}/val/src/sbsa_execute_test.c" - "${ROOT_DIR}/val/src/mpam_execute_test.c" -) - -list(APPEND COMPILE_LIST ${VAL_SRC}) -set(COMPILE_LIST ${COMPILE_LIST} PARENT_SCOPE) - -add_library(${VAL_LIB} STATIC ${VAL_SRC}) - -# Define COMPILE_RB_EXE for gating few compilations in val for rule based -# execution infra. -target_compile_definitions(${VAL_LIB} PRIVATE COMPILE_RB_EXE) -# Define BAREMETAL_PCBSA_BUILD -target_compile_definitions(${VAL_LIB} PRIVATE BAREMETAL_PCBSA_BUILD) - -target_include_directories(${VAL_LIB} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - ${ROOT_DIR}/ - ${ROOT_DIR}/val - ${ROOT_DIR}/val/include/ - ${ROOT_DIR}/val/src/AArch64/ - ${ROOT_DIR}/val/driver/smmu_v3/ - ${ROOT_DIR}/val/driver/gic/ - ${ROOT_DIR}/val/driver/gic/its/ - ${ROOT_DIR}/val/driver/gic/v2/ - ${ROOT_DIR}/val/driver/gic/v3/ - ${ROOT_DIR}/pal/baremetal/ - ${ROOT_DIR}/pal/baremetal/base/include/ - ${ROOT_DIR}/pal/baremetal/base/src/AArch64/ - ${ROOT_DIR}/pal/baremetal/target/${TARGET}/include/ - ${ROOT_DIR}/apps/baremetal/ -) - -unset(VAL_SRC) diff --git a/val/val_sbsa.cmake b/val/val_sbsa.cmake deleted file mode 100644 index 3de18087..00000000 --- a/val/val_sbsa.cmake +++ /dev/null @@ -1,80 +0,0 @@ -## @file - # Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. - # SPDX-License-Identifier : Apache-2.0 - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - ## - - file(GLOB VAL_SRC - "${ROOT_DIR}/val/src/AArch64/*.S" - "${ROOT_DIR}/val/src/AArch64/*.s" - "${ROOT_DIR}/val/src/AArch64/*.h" - "${ROOT_DIR}/val/include/*.h" - "${ROOT_DIR}/val/src/*.c" - "${ROOT_DIR}/val/driver/pcie/*.h" - "${ROOT_DIR}/val/driver/pcie/*.c" - "${ROOT_DIR}/val/driver/smmu_v3/*.h" - "${ROOT_DIR}/val/driver/smmu_v3/*.c" - "${ROOT_DIR}/val/driver/gic/*.h" - "${ROOT_DIR}/val/driver/gic/*.c" - "${ROOT_DIR}/val/driver/gic/AArch64/*.S" - "${ROOT_DIR}/val/driver/gic/its/*.h" - "${ROOT_DIR}/val/driver/gic/its/*.c" - "${ROOT_DIR}/val/driver/gic/v2/*.h" - "${ROOT_DIR}/val/driver/gic/v2/*.c" - "${ROOT_DIR}/val/driver/gic/v3/*.h" - "${ROOT_DIR}/val/driver/gic/v3/*.c" - "${ROOT_DIR}/val/driver/gic/v3/AArch64/*.S" - "${ROOT_DIR}/apps/baremetal/*.h" - "${ROOT_DIR}/apps/baremetal/*.c" - -) - -list(REMOVE_ITEM VAL_SRC - "${ROOT_DIR}/val/src/AArch64/Drtm.S" - "${ROOT_DIR}/apps/baremetal/bsa_main.c" - "${ROOT_DIR}/apps/baremetal/pc_bsa_main.c" - "${ROOT_DIR}/val/src/bsa_execute_test.c" - "${ROOT_DIR}/val/src/mpam_execute_test.c" -) - -#Create compile list files -list(APPEND COMPILE_LIST ${VAL_SRC}) -set(COMPILE_LIST ${COMPILE_LIST} PARENT_SCOPE) - -# Create VAL library -add_library(${VAL_LIB} STATIC ${VAL_SRC}) - -# Define COMPILE_RB_EXE for gating few compilations in val for rule based -# execution infra. -target_compile_definitions(${VAL_LIB} PRIVATE COMPILE_RB_EXE) - -target_include_directories(${VAL_LIB} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - ${ROOT_DIR}/ - ${ROOT_DIR}/val - ${ROOT_DIR}/val/include/ - ${ROOT_DIR}/val/src/AArch64/ - ${ROOT_DIR}/val/driver/smmu_v3/ - ${ROOT_DIR}/val/driver/gic/ - ${ROOT_DIR}/val/driver/gic/its/ - ${ROOT_DIR}/val/driver/gic/v2/ - ${ROOT_DIR}/val/driver/gic/v3/ - ${ROOT_DIR}/pal/baremetal/ - ${ROOT_DIR}/pal/baremetal/include/ - ${ROOT_DIR}/pal/baremetal/target/${TARGET}/include/ - ${ROOT_DIR}/pal/baremetal/src/AArch64/ - ${ROOT_DIR}/apps/baremetal/ -) - -unset(VAL_SRC)