Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
David Hu | 52c65f0 | 2020-01-10 11:19:19 +0800 | [diff] [blame] | 2 | # Copyright (c) 2018-2020, Arm Limited. All rights reserved. |
Alamy Liu | d33851f | 2019-11-21 13:17:58 -0800 | [diff] [blame] | 3 | # Copyright (c) 2019-2020, Cypress Semiconductor Corporation. All rights reserved. |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | #------------------------------------------------------------------------------- |
| 8 | |
| 9 | #This file gathers all Cypress PSoC 6 specific files in the application. |
| 10 | |
| 11 | include("Common/MultiCore") |
| 12 | |
| 13 | # Select configuration of multi-core topology |
| 14 | enable_multi_core_topology_config() |
| 15 | |
David Hu | 08d5572 | 2019-11-28 17:50:53 +0800 | [diff] [blame] | 16 | # Enable multiple outstanding NS PSA Client calls |
| 17 | enable_multi_core_multi_client_call() |
| 18 | |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 19 | set(TFM_NS_CLIENT_IDENTIFICATION OFF) |
| 20 | |
| 21 | add_definitions(-DCYB0644ABZI_S2D44=1) |
| 22 | |
| 23 | add_definitions(-DTFM_CORE_DEBUG) |
| 24 | |
| 25 | # psoc64 platform doesn't yet use TF-M BL2 |
| 26 | set(BL2 False) |
| 27 | remove_definitions(-DBL2) |
| 28 | |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 29 | # Skip peripheral access test |
| 30 | set(TFM_ENABLE_PERIPH_ACCESS_TEST OFF) |
David Hu | 7014bf4 | 2019-11-15 20:44:58 +0800 | [diff] [blame] | 31 | if (REGRESSION) |
| 32 | # Enable multi-core specific test cases |
| 33 | set(TFM_MULTI_CORE_TEST ON) |
| 34 | endif() |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 35 | |
| 36 | # Set Cortex-M0plus as secure core |
| 37 | set_secure_cpu_type("CpuM0p") |
| 38 | # Set Cortex-M4 as non-secure core |
| 39 | set_ns_cpu_type("CpuM4") |
| 40 | |
| 41 | # Set PSoC62 specific secure definitions |
| 42 | add_platform_secure_definitions(CY_PSOC6_CM0P=1) |
| 43 | |
| 44 | set(PLATFORM_DIR ${CMAKE_CURRENT_LIST_DIR}) |
| 45 | |
| 46 | #Specify the location of platform specific build dependencies. |
| 47 | if(COMPILER STREQUAL "ARMCLANG") |
| 48 | set (S_SCATTER_FILE_NAME "${PLATFORM_DIR}/common/armclang/tfm_common_s.sct") |
| 49 | set (NS_SCATTER_FILE_NAME "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/armclang/psoc6_ns.sct") |
Kevin Peng | 2131fdb | 2020-05-21 15:51:36 +0800 | [diff] [blame] | 50 | if (DEFINED CMSIS_DIR) |
| 51 | # not all project defines CMSIS_DIR, only the ones that use it. |
| 52 | set (RTX_LIB_PATH "${CMSIS_DIR}/RTOS2/RTX/Library/ARM/RTX_CM4F.lib") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 53 | endif() |
| 54 | elseif(COMPILER STREQUAL "GNUARM") |
| 55 | set (S_SCATTER_FILE_NAME "${PLATFORM_DIR}/common/gcc/tfm_common_s.ld") |
| 56 | set (NS_SCATTER_FILE_NAME "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/gcc/psoc6_ns.ld") |
Kevin Peng | 2131fdb | 2020-05-21 15:51:36 +0800 | [diff] [blame] | 57 | if (DEFINED CMSIS_DIR) |
| 58 | # not all project defines CMSIS_DIR, only the ones that use it. |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 59 | # [libRTX_CM3.a should be used for CM4 without FPU] |
Kevin Peng | 2131fdb | 2020-05-21 15:51:36 +0800 | [diff] [blame] | 60 | set (RTX_LIB_PATH "${CMSIS_DIR}/RTOS2/RTX/Library/GCC/libRTX_CM3.a") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 61 | endif() |
TTornblom | e3ef1fd | 2020-01-23 16:50:19 +0100 | [diff] [blame] | 62 | elseif(COMPILER STREQUAL "IARARM") |
| 63 | set (S_SCATTER_FILE_NAME "${PLATFORM_DIR}/common/iar/tfm_common_s.icf") |
| 64 | set (NS_SCATTER_FILE_NAME "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/iar/psoc6_ns.icf") |
Kevin Peng | 2131fdb | 2020-05-21 15:51:36 +0800 | [diff] [blame] | 65 | if (DEFINED CMSIS_DIR) |
| 66 | # not all project defines CMSIS_DIR, only the ones that use it. |
TTornblom | e3ef1fd | 2020-01-23 16:50:19 +0100 | [diff] [blame] | 67 | # [RTX_CM3.a should be used for CM4 without FPU] |
Kevin Peng | 2131fdb | 2020-05-21 15:51:36 +0800 | [diff] [blame] | 68 | set (RTX_LIB_PATH "${CMSIS_DIR}/RTOS2/RTX/Library/IAR/RTX_CM3.a") |
TTornblom | e3ef1fd | 2020-01-23 16:50:19 +0100 | [diff] [blame] | 69 | endif() |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 70 | else() |
| 71 | message(FATAL_ERROR "No startup file is available for compiler '${CMAKE_C_COMPILER_ID}'.") |
| 72 | endif() |
| 73 | set (FLASH_LAYOUT "${PLATFORM_DIR}/target/cypress/psoc64/partition/flash_layout.h") |
| 74 | set (PLATFORM_LINK_INCLUDES "${PLATFORM_DIR}/target/cypress/psoc64/partition") |
| 75 | |
| 76 | embedded_include_directories(PATH "${PLATFORM_DIR}/cmsis" ABSOLUTE) |
| 77 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64" ABSOLUTE) |
| 78 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/CMSIS_Driver/Config" ABSOLUTE) |
| 79 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/Device/Config" ABSOLUTE) |
| 80 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/Device/Include" ABSOLUTE) |
| 81 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/include" ABSOLUTE) |
| 82 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/generated_source" ABSOLUTE) |
| 83 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/mailbox" ABSOLUTE) |
| 84 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/partition" ABSOLUTE) |
| 85 | embedded_include_directories(PATH "${TFM_ROOT_DIR}/interface/include" ABSOLUTE) |
| 86 | embedded_include_directories(PATH "${TFM_ROOT_DIR}/platform/include" ABSOLUTE) |
Summer Qin | 8f231c4 | 2020-06-29 17:59:35 +0800 | [diff] [blame] | 87 | embedded_include_directories(PATH "${TFM_ROOT_DIR}/secure_fw/spm/arch" ABSOLUTE) |
| 88 | embedded_include_directories(PATH "${TFM_ROOT_DIR}/secure_fw/spm/model_ipc/include" ABSOLUTE) |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 89 | |
Shawn Shan | 61afaa2 | 2020-09-15 16:11:42 +0800 | [diff] [blame] | 90 | add_definitions(-DTFM_SPM_LOG_LEVEL=1) |
| 91 | |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 92 | #Gather all source files we need. |
| 93 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/mailbox/platform_multicore.c") |
| 94 | list(APPEND ALL_SRC_C_NS "${PLATFORM_DIR}/target/cypress/psoc64/mailbox/platform_ns_mailbox.c") |
| 95 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/mailbox/mailbox_ipc_intr.c") |
| 96 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/mailbox/platform_spe_mailbox.c") |
| 97 | |
| 98 | install(FILES ${PLATFORM_DIR}/target/cypress/psoc64/mailbox/ns_ipc_config.h |
| 99 | ${PLATFORM_DIR}/target/cypress/psoc64/mailbox/platform_multicore.h |
David Hu | 52c65f0 | 2020-01-10 11:19:19 +0800 | [diff] [blame] | 100 | DESTINATION export/tfm/include) |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 101 | |
| 102 | install(FILES ${PLATFORM_DIR}/target/cypress/psoc64/mailbox/platform_multicore.c |
| 103 | ${PLATFORM_DIR}/target/cypress/psoc64/mailbox/platform_ns_mailbox.c |
| 104 | DESTINATION export/tfm/src) |
| 105 | |
| 106 | if (NOT DEFINED BUILD_CMSIS_CORE) |
| 107 | message(FATAL_ERROR "Configuration variable BUILD_CMSIS_CORE (true|false) is undefined!") |
| 108 | elseif(BUILD_CMSIS_CORE) |
| 109 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/system_psoc6_cm0plus.c") |
| 110 | list(APPEND ALL_SRC_C_NS "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/system_psoc6_cm4.c") |
| 111 | endif() |
| 112 | |
| 113 | if (NOT DEFINED BUILD_RETARGET) |
| 114 | message(FATAL_ERROR "Configuration variable BUILD_RETARGET (true|false) is undefined!") |
| 115 | elseif(BUILD_RETARGET) |
| 116 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/device_definition.c") |
| 117 | endif() |
| 118 | |
| 119 | if (NOT DEFINED BUILD_UART_STDOUT) |
| 120 | message(FATAL_ERROR "Configuration variable BUILD_UART_STDOUT (true|false) is undefined!") |
| 121 | elseif(BUILD_UART_STDOUT) |
| 122 | if (NOT DEFINED SECURE_UART1) |
| 123 | message(FATAL_ERROR "Configuration variable SECURE_UART1 (true|false) is undefined!") |
| 124 | elseif(SECURE_UART1) |
| 125 | message(FATAL_ERROR "Configuration SECURE_UART1 TRUE is invalid for this target!") |
| 126 | endif() |
Shawn Shan | 61afaa2 | 2020-09-15 16:11:42 +0800 | [diff] [blame] | 127 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/common/uart_stdout.c" |
| 128 | "${PLATFORM_DIR}/common/tfm_hal_spm_logdev_peripheral.c") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 129 | embedded_include_directories(PATH "${PLATFORM_DIR}/common" ABSOLUTE) |
| 130 | set(BUILD_NATIVE_DRIVERS true) |
| 131 | set(BUILD_CMSIS_DRIVERS true) |
| 132 | endif() |
| 133 | |
| 134 | if (NOT DEFINED BUILD_NATIVE_DRIVERS) |
| 135 | message(FATAL_ERROR "Configuration variable BUILD_NATIVE_DRIVERS (true|false) is undefined!") |
| 136 | elseif(BUILD_NATIVE_DRIVERS) |
| 137 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_device.c") |
| 138 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_flash.c") |
| 139 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_gpio.c") |
| 140 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_prot.c") |
| 141 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_ipc_drv.c") |
| 142 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_ipc_pipe.c") |
| 143 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_ipc_sema.c") |
| 144 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_scb_common.c") |
| 145 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_scb_uart.c") |
| 146 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_sysclk.c") |
| 147 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_sysint.c") |
| 148 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_syslib.c") |
| 149 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_syspm.c") |
| 150 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_systick.c") |
Alamy Liu | d33851f | 2019-11-21 13:17:58 -0800 | [diff] [blame] | 151 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_tcpwm_counter.c") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 152 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_trigmux.c") |
| 153 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/source/cy_wdt.c") |
| 154 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/generated_source/cycfg.c") |
| 155 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/generated_source/cycfg_clocks.c") |
| 156 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/generated_source/cycfg_clocks.c") |
| 157 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/generated_source/cycfg_peripherals.c") |
| 158 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/generated_source/cycfg_pins.c") |
| 159 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/generated_source/cycfg_routing.c") |
| 160 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/Native_Driver/generated_source/cycfg_system.c") |
| 161 | if(CMAKE_C_COMPILER_ID STREQUAL "ARMCLANG") |
| 162 | list(APPEND ALL_SRC_ASM "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/armclang/cy_syslib_mdk.s") |
| 163 | elseif(CMAKE_C_COMPILER_ID STREQUAL "GNUARM") |
| 164 | list(APPEND ALL_SRC_ASM "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/gcc/cy_syslib_gcc.S") |
TTornblom | e3ef1fd | 2020-01-23 16:50:19 +0100 | [diff] [blame] | 165 | elseif(CMAKE_C_COMPILER_ID STREQUAL "IARARM") |
| 166 | list(APPEND ALL_SRC_ASM "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/iar/cy_syslib_iar.c") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 167 | else() |
| 168 | message(FATAL_ERROR "No cy_syslib is available for compiler '${CMAKE_C_COMPILER_ID}'.") |
| 169 | endif() |
| 170 | endif() |
| 171 | |
| 172 | if (NOT DEFINED BUILD_TIME) |
| 173 | message(FATAL_ERROR "Configuration variable BUILD_TIME (true|false) is undefined!") |
| 174 | elseif(BUILD_TIME) |
| 175 | endif() |
| 176 | |
| 177 | if (NOT DEFINED BUILD_STARTUP) |
| 178 | message(FATAL_ERROR "Configuration variable BUILD_STARTUP (true|false) is undefined!") |
| 179 | elseif(BUILD_STARTUP) |
| 180 | if(CMAKE_C_COMPILER_ID STREQUAL "ARMCLANG") |
| 181 | list(APPEND ALL_SRC_ASM_S "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/armclang/startup_psoc64_s.s") |
| 182 | list(APPEND ALL_SRC_ASM_NS "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/armclang/startup_psoc64_ns.s") |
| 183 | elseif(CMAKE_C_COMPILER_ID STREQUAL "GNUARM") |
| 184 | list(APPEND ALL_SRC_ASM_S "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/gcc/startup_psoc64_s.S") |
| 185 | list(APPEND ALL_SRC_ASM_NS "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/gcc/startup_psoc64_ns.S") |
| 186 | set_property(SOURCE "${ALL_SRC_ASM_S}" "${ALL_SRC_ASM_NS}" APPEND |
| 187 | PROPERTY COMPILE_DEFINITIONS "__STARTUP_CLEAR_BSS_MULTIPLE" "__STARTUP_COPY_MULTIPLE") |
TTornblom | e3ef1fd | 2020-01-23 16:50:19 +0100 | [diff] [blame] | 188 | elseif(CMAKE_C_COMPILER_ID STREQUAL "IARARM") |
| 189 | list(APPEND ALL_SRC_ASM_S "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/iar/startup_psoc64_s.s") |
| 190 | list(APPEND ALL_SRC_ASM_NS "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/iar/startup_psoc64_ns.s") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 191 | else() |
| 192 | message(FATAL_ERROR "No startup file is available for compiler '${CMAKE_C_COMPILER_ID}'.") |
| 193 | endif() |
| 194 | endif() |
| 195 | |
Balint Matyi | 95f58eb | 2020-05-22 08:52:32 +0100 | [diff] [blame] | 196 | #Enable the checks of attestation claims against hard-coded values. |
| 197 | set(ATTEST_CLAIM_VALUE_CHECK ON) |
| 198 | |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 199 | if (NOT DEFINED BUILD_TARGET_CFG) |
| 200 | message(FATAL_ERROR "Configuration variable BUILD_TARGET_CFG (true|false) is undefined!") |
| 201 | elseif(BUILD_TARGET_CFG) |
| 202 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/target_cfg.c") |
| 203 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/spm_hal.c") |
| 204 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/attest_hal.c") |
| 205 | if (TFM_PARTITION_PLATFORM) |
| 206 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/services/src/tfm_platform_system.c") |
| 207 | endif() |
Chris Brand | c47d710 | 2020-02-20 11:12:18 -0800 | [diff] [blame] | 208 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/common/tfm_hal_its.c") |
| 209 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/common/tfm_hal_ps.c") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 210 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/common/tfm_platform.c") |
| 211 | embedded_include_directories(PATH "${PLATFORM_DIR}/common" ABSOLUTE) |
| 212 | endif() |
| 213 | |
Alamy Liu | cc419f9 | 2019-11-21 15:55:33 -0800 | [diff] [blame] | 214 | if (NOT DEFINED BUILD_PLAT_TEST) |
| 215 | message(FATAL_ERROR "Configuration variable BUILD_PLAT_TEST (true|false) is undefined!") |
| 216 | elseif(BUILD_PLAT_TEST) |
| 217 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/plat_test.c") |
| 218 | endif() |
| 219 | |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 220 | if (NOT DEFINED BUILD_TARGET_HARDWARE_KEYS) |
| 221 | message(FATAL_ERROR "Configuration variable BUILD_TARGET_HARDWARE_KEYS (true|false) is undefined!") |
| 222 | elseif(BUILD_TARGET_HARDWARE_KEYS) |
David Hu | b3d2d62 | 2019-12-06 10:24:44 +0800 | [diff] [blame] | 223 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/common/template/tfm_initial_attestation_key_material.c") |
David Hu | 086ffe3 | 2019-12-06 10:36:56 +0800 | [diff] [blame] | 224 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/common/template/tfm_rotpk.c") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 225 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/dummy_crypto_keys.c") |
| 226 | endif() |
| 227 | |
| 228 | if (NOT DEFINED BUILD_TARGET_NV_COUNTERS) |
| 229 | message(FATAL_ERROR "Configuration variable BUILD_TARGET_NV_COUNTERS (true|false) is undefined!") |
| 230 | elseif(BUILD_TARGET_NV_COUNTERS) |
Chris Brand | cfc5114 | 2020-03-23 14:02:28 -0700 | [diff] [blame] | 231 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/nv_counters.c") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 232 | set(TARGET_NV_COUNTERS_ENABLE ON) |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame] | 233 | # Sets PS_ROLLBACK_PROTECTION flag to compile in the PS services |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 234 | # rollback protection code as the target supports nv counters. |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame] | 235 | set (PS_ROLLBACK_PROTECTION ON) |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 236 | endif() |
| 237 | |
| 238 | if (NOT DEFINED BUILD_CMSIS_DRIVERS) |
| 239 | message(FATAL_ERROR "Configuration variable BUILD_CMSIS_DRIVERS (true|false) is undefined!") |
| 240 | elseif(BUILD_CMSIS_DRIVERS) |
| 241 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/driver_smpu.c") |
| 242 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/driver_ppu.c") |
Andrei Narkevitch | 995bb45 | 2020-01-15 13:58:47 -0800 | [diff] [blame] | 243 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/driver_dap.c") |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 244 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/CMSIS_Driver/Driver_USART.c") |
| 245 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/CMSIS_Driver" ABSOLUTE) |
| 246 | embedded_include_directories(PATH "${PLATFORM_DIR}/driver" ABSOLUTE) |
| 247 | endif() |
| 248 | |
| 249 | if (NOT DEFINED BUILD_FLASH) |
| 250 | message(FATAL_ERROR "Configuration variable BUILD_FLASH (true|false) is undefined!") |
| 251 | elseif(BUILD_FLASH) |
| 252 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/cypress/psoc64/CMSIS_Driver/Driver_Flash.c") |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame] | 253 | # As the PS area is going to be in RAM, it is required to set PS_CREATE_FLASH_LAYOUT |
| 254 | # to be sure the PS service knows that when it starts the PS area does not contain any |
| 255 | # valid PS flash layout and it needs to create one. |
| 256 | set(PS_CREATE_FLASH_LAYOUT ON) |
Chris Brand | b42fed5 | 2019-12-02 16:10:17 -0800 | [diff] [blame] | 257 | set(ITS_CREATE_FLASH_LAYOUT ON) |
| 258 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/cypress/psoc64/CMSIS_Driver" ABSOLUTE) |
| 259 | embedded_include_directories(PATH "${PLATFORM_DIR}/driver" ABSOLUTE) |
| 260 | endif() |
| 261 | |
| 262 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/dummy_boot_seed.c") |
| 263 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/cypress/psoc64/dummy_device_id.c") |