1#
2# Arm SCP/MCP Software
3# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8#
9# Create the firmware target.
10#
11
12add_executable(tc1-bl2)
13
14target_include_directories(
15    tc1-bl2 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include"
16                   "${CMAKE_CURRENT_SOURCE_DIR}")
17
18# cmake-lint: disable=E1122
19
20target_sources(
21    tc1-bl2
22    PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_system_power.c"
23            "${CMAKE_CURRENT_SOURCE_DIR}/config_armv7m_mpu.c"
24            "${CMAKE_CURRENT_SOURCE_DIR}/config_pl011.c"
25            "${CMAKE_CURRENT_SOURCE_DIR}/config_power_domain.c"
26            "${CMAKE_CURRENT_SOURCE_DIR}/config_ppu_v1.c"
27            "${CMAKE_CURRENT_SOURCE_DIR}/config_mhu2.c"
28            "${CMAKE_CURRENT_SOURCE_DIR}/config_transport.c"
29            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi.c"
30            "${CMAKE_CURRENT_SOURCE_DIR}/config_sds.c"
31            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi_system_power.c"
32            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi_clock.c"
33            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi_perf.c"
34            "${CMAKE_CURRENT_SOURCE_DIR}/config_gtimer.c"
35            "${CMAKE_CURRENT_SOURCE_DIR}/config_timer.c"
36            "${CMAKE_CURRENT_SOURCE_DIR}/config_dvfs.c"
37            "${CMAKE_CURRENT_SOURCE_DIR}/config_psu.c"
38            "${CMAKE_CURRENT_SOURCE_DIR}/config_mock_psu.c"
39            "${CMAKE_CURRENT_SOURCE_DIR}/config_system_pll.c"
40            "${CMAKE_CURRENT_SOURCE_DIR}/config_pik_clock.c"
41            "${CMAKE_CURRENT_SOURCE_DIR}/config_css_clock.c"
42            "${CMAKE_CURRENT_SOURCE_DIR}/config_clock.c"
43            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi_power_domain.c")
44
45if(SCP_ENABLE_RESOURCE_PERMISSIONS)
46    target_sources(tc1-bl2 PRIVATE "config_resource_perms.c")
47endif()
48
49#
50# Some of our firmware includes require CMSIS.
51#
52
53target_link_libraries(tc1-bl2 PUBLIC cmsis::core-m)
54
55#
56# We explicitly add the CMSIS include directories to our interface include
57# directories. Each module target adds these include directories to their own,
58# allowing them to include any firmware includes we expose.
59#
60
61target_include_directories(tc1-bl2
62    PUBLIC $<TARGET_PROPERTY:cmsis::core-m,INTERFACE_INCLUDE_DIRECTORIES>)
63