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(synquacer-bl2)
13
14# cmake-lint: disable=E1122
15
16target_include_directories(
17    synquacer-bl2
18    PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include"
19           "${CMAKE_CURRENT_SOURCE_DIR}")
20
21include(${CMAKE_CURRENT_SOURCE_DIR}/../src/CMakeLists.txt)
22
23target_sources(
24    synquacer-bl2
25    PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_armv7m_mpu.c"
26            "${CMAKE_CURRENT_SOURCE_DIR}/config_ccn512.c"
27            "${CMAKE_CURRENT_SOURCE_DIR}/config_clock.c"
28            "${CMAKE_CURRENT_SOURCE_DIR}/config_css_clock.c"
29            "${CMAKE_CURRENT_SOURCE_DIR}/config_f_i2c.c"
30            "${CMAKE_CURRENT_SOURCE_DIR}/config_hsspi.c"
31            "${CMAKE_CURRENT_SOURCE_DIR}/config_nor.c"
32            "${CMAKE_CURRENT_SOURCE_DIR}/config_mhu.c"
33            "${CMAKE_CURRENT_SOURCE_DIR}/config_pik_clock.c"
34            "${CMAKE_CURRENT_SOURCE_DIR}/config_power_domain.c"
35            "${CMAKE_CURRENT_SOURCE_DIR}/config_ppu_v0_synquacer.c"
36            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi.c"
37            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi_apcore.c"
38            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi_system_power.c"
39            "${CMAKE_CURRENT_SOURCE_DIR}/config_transport.c"
40            "${CMAKE_CURRENT_SOURCE_DIR}/config_synquacer_memc.c"
41            "${CMAKE_CURRENT_SOURCE_DIR}/config_system_power.c"
42            "${CMAKE_CURRENT_SOURCE_DIR}/config_timer.c"
43            "${CMAKE_CURRENT_SOURCE_DIR}/config_scmi_power_domain.c")
44
45if(SYNQUACER_UART MATCHES "uart0")
46    target_sources(synquacer-bl2
47                   PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_f_uart3.c")
48elseif(SYNQUACER_UART MATCHES "uart1")
49    target_sources(synquacer-bl2
50                   PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_pl011.c")
51elseif(SYNQUACER_UART MATCHES "debug_uart")
52    target_sources(synquacer-bl2
53                   PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_pl011.c")
54else()
55    target_sources(synquacer-bl2
56                   PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_f_uart3.c")
57endif()
58
59#
60# Some of our firmware includes require CMSIS.
61#
62
63target_link_libraries(synquacer-bl2 PUBLIC cmsis::core-m)
64
65#
66# We explicitly add the CMSIS include directories to our interfaceinclude
67# directories. Each module target adds these include directories totheir own,
68# allowing them to include any firmware includes we expose.
69#
70
71target_include_directories(
72    synquacer-bl2
73    PUBLIC $<TARGET_PROPERTY:cmsis::core-m,INTERFACE_INCLUDE_DIRECTORIES>)
74