aboutsummaryrefslogtreecommitdiff
path: root/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt
blob: 9d1eb9f062de5c3b652813af9e8b3a51ec4674c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#-------------------------------------------------------------------------------
# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------

cmake_policy(SET CMP0076 NEW)
set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})

#========================= Platform region defs ===============================#

target_include_directories(platform_region_defs
    INTERFACE
        partition
)

#========================= Platform common defs ===============================#

target_sources(tfm_s
    PRIVATE
        $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armgcc/startup_LPC55S69_cm33_core0_s.S>
        $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_LPC55S69_cm33_core0_s.s>
)
target_add_scatter_file(tfm_s
    $<$<C_COMPILER_ID:GNU>:${CMAKE_BINARY_DIR}/generated/platform/ext/common/gcc/tfm_common_s.ld>
    $<$<C_COMPILER_ID:IAR>:${CMAKE_BINARY_DIR}/generated/platform/ext/common/iar/tfm_common_s.icf>
)

if(NS)
    target_sources(tfm_ns
        PRIVATE
            $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armgcc/startup_LPC55S69_cm33_core0_ns.S>
            $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/startup_LPC55S69_cm33_core0_ns.s>
    )
    target_add_scatter_file(tfm_ns
            $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/armgcc/LPC55S69_cm33_core0_ns.ld>
            $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/LPC55S69_cm33_core0_ns.icf>
    )
    target_link_libraries(tfm_ns
        PRIVATE
            $<$<C_COMPILER_ID:GNU>:${CMSIS_5_PATH}/RTOS2/RTX/Library/GCC/libRTX_V8MMN.a>
            $<$<C_COMPILER_ID:IAR>:${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_V8MMN.a>
            # These libraries require linking to the veneers, so the veneers are
            # marked again here as a link dependency to get the ordering right
            tfm_s_veneers
    )
endif()

#========================= Platform Secure ====================================#

target_include_directories(platform_s
    PUBLIC
        .
        Native_Driver
        Native_Driver/project_template/s
        Device/Config
        Device/Include
        partition
        ${PLATFORM_DIR}/ext/common
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/components/serial_manager
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/components/uart
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/utilities/debug_console
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/utilities/str
        ${PLATFORM_DIR}/include
)

target_sources(platform_s
    PRIVATE
        target_cfg.c
        spm_hal.c
        Native_Driver/project_template/s/board.c
        Native_Driver/project_template/s/clock_config.c
        Native_Driver/project_template/s/hardware_init.c
        Native_Driver/project_template/s/peripherals.c
        Native_Driver/project_template/s/pin_mux.c
        Native_Driver/system_LPC55S69_cm33_core0.c
        ../common/CMSIS_Driver/Driver_Flash.c
        ../common/CMSIS_Driver/Driver_USART.c
        ../common/Native_Driver/components/lists/generic_list.c
        ../common/Native_Driver/components/serial_manager/serial_manager.c
        ../common/Native_Driver/components/serial_manager/serial_port_uart.c
        ../common/Native_Driver/components/uart/usart_adapter.c
        ../common/Native_Driver/drivers/fsl_casper.c
        ../common/Native_Driver/drivers/fsl_clock.c
        ../common/Native_Driver/drivers/fsl_common.c
        ../common/Native_Driver/drivers/fsl_ctimer.c
        ../common/Native_Driver/drivers/fsl_flexcomm.c
        ../common/Native_Driver/drivers/fsl_gpio.c
        ../common/Native_Driver/drivers/fsl_hashcrypt.c
        ../common/Native_Driver/drivers/fsl_iap.c
        ../common/Native_Driver/drivers/fsl_power.c
        ../common/Native_Driver/drivers/fsl_reset.c
        ../common/Native_Driver/drivers/fsl_rng.c
        ../common/Native_Driver/drivers/fsl_usart.c
        ../common/Native_Driver/utilities/fsl_assert.c
        ../common/Native_Driver/utilities/fsl_sbrk.c
        ../common/Native_Driver/utilities/debug_console/fsl_debug_console.c
        ../common/Native_Driver/utilities/str/fsl_str.c
        ../common/Native_Driver/mpu_armv8m_drv.c
        ../common/Native_Driver/components/lists/generic_list.c
        ../common/Native_Driver/components/serial_manager/serial_manager.c
        ../common/Native_Driver/components/serial_manager/serial_port_uart.c
        ../common/Native_Driver/components/uart/usart_adapter.c
        ../common/Native_Driver/drivers/fsl_casper.c
        ../common/Native_Driver/drivers/fsl_clock.c
        ../common/Native_Driver/drivers/fsl_common.c
        ../common/Native_Driver/drivers/fsl_ctimer.c
        ../common/Native_Driver/drivers/fsl_flexcomm.c
        ../common/Native_Driver/drivers/fsl_gpio.c
        ../common/Native_Driver/drivers/fsl_hashcrypt.c
        ../common/Native_Driver/drivers/fsl_iap.c
        ../common/Native_Driver/drivers/fsl_power.c
        ../common/Native_Driver/drivers/fsl_reset.c
        ../common/Native_Driver/drivers/fsl_rng.c
        ../common/Native_Driver/drivers/fsl_usart.c
        ../common/Native_Driver/utilities/fsl_assert.c
        ../common/Native_Driver/utilities/fsl_sbrk.c
        ../common/Native_Driver/utilities/debug_console/fsl_debug_console.c
        ../common/Native_Driver/utilities/str/fsl_str.c
        ../lpcxpresso55s69/Native_Driver/system_LPC55S69_cm33_core0.c
        $<$<BOOL:TFM_PARTITION_PLATFORM>:${CMAKE_CURRENT_SOURCE_DIR}/plat_test.c>
        $<$<BOOL:TFM_PARTITION_PLATFORM>:${CMAKE_CURRENT_SOURCE_DIR}/services/src/tfm_platform_system.c>
)

target_compile_options(platform_s
    PUBLIC
        ${COMPILER_CMSE_FLAG}
)

target_compile_definitions(platform_s
    PUBLIC
        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
)

#========================= Platform Non-Secure ================================#

target_sources(platform_ns
    PRIVATE
        Native_Driver/system_LPC55S69_cm33_core0.c
        Native_Driver/project_template/ns/board.c
        Native_Driver/project_template/ns/hardware_init.c
        Native_Driver/project_template/ns/clock_config.c
        Native_Driver/project_template/ns/peripherals.c
        Native_Driver/project_template/ns/pin_mux.c
        ${PLATFORM_DIR}/ext/target/nxp/common/CMSIS_Driver/Driver_USART.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/components/lists/generic_list.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/components/serial_manager/serial_manager.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/components/serial_manager/serial_port_uart.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/components/uart/usart_adapter.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_casper.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_clock.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_common.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_ctimer.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_flexcomm.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_gpio.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_hashcrypt.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_iap.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_power.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_reset.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_rng.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers/fsl_usart.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/utilities/fsl_assert.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/utilities/fsl_sbrk.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/utilities/debug_console/fsl_debug_console.c
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/utilities/str/fsl_str.c
)

target_include_directories(platform_ns
    PUBLIC
        .
        Device/Config
        Device/Include
        Native_Driver
        Native_Driver/project_template/ns
        ${PLATFORM_DIR}/ext/common
        ${PLATFORM_DIR}/ext/driver
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/components/uart
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/components/serial_manager
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/drivers
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/utilities/debug_console
        ${PLATFORM_DIR}/ext/target/nxp/common/Native_Driver/utilities/str
)