aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorDavide Grohmann <davide.grohmann@arm.com>2022-05-06 16:35:16 +0200
committerDavide Grohmann <davide.grohmann@arm.com>2022-05-12 19:07:46 +0200
commita8832ccaa0c5183f70a0c2aee8ae86e7bb5418ff (patch)
treea3f79f6936c0596f2b2a05a6cca36e2e5be266e3 /cmake
parente6df5a799b5b0f3f2f7aeb7cbd071722ca2b80fb (diff)
downloadethos-u-core-platform-a8832ccaa0c5183f70a0c2aee8ae86e7bb5418ff.tar.gz
Add support for Cortex-M85
Rely on CMSIS code for initializing Cortex-M85 devices. Fallback to mcpu=cortex-m55 for gcc until support for cortex-m85 is available. Change-Id: I8b47563c3f0f44e35735a569f2abf8a308948e67
Diffstat (limited to 'cmake')
-rw-r--r--cmake/toolchain/arm-none-eabi-gcc.cmake18
-rw-r--r--cmake/toolchain/armclang.cmake4
2 files changed, 15 insertions, 7 deletions
diff --git a/cmake/toolchain/arm-none-eabi-gcc.cmake b/cmake/toolchain/arm-none-eabi-gcc.cmake
index d37a3dc..ec10b2f 100644
--- a/cmake/toolchain/arm-none-eabi-gcc.cmake
+++ b/cmake/toolchain/arm-none-eabi-gcc.cmake
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2020-2021 Arm Limited. All rights reserved.
+# Copyright (c) 2020-2022 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -40,9 +40,16 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
+set(GCC_CPU "${TARGET_CPU}")
+if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "cortex-m85")
+ set(GCC_CPU "cortex-m55")
+ list(APPEND GCC_CPU ${TARGET_CPU_FEATURES})
+ list(JOIN GCC_CPU "+" GCC_CPU)
+endif()
+
# Compile options
add_compile_options(
- -mcpu=${TARGET_CPU}
+ -mcpu=${GCC_CPU}
-mthumb
"$<$<CONFIG:DEBUG>:-gdwarf-3>"
"$<$<COMPILE_LANGUAGE:CXX>:-fno-unwind-tables;-fno-rtti;-fno-exceptions>")
@@ -53,7 +60,7 @@ add_compile_definitions(
# Link options
add_link_options(
- -mcpu=${TARGET_CPU}
+ -mcpu=${GCC_CPU}
-mthumb
--specs=nosys.specs)
@@ -63,7 +70,8 @@ if("${TARGET_CPU}" MATCHES "\\+fp")
elseif("${TARGET_CPU}" MATCHES "\\+nofp")
set(FLOAT soft)
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "cortex-m33" OR
- "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "cortex-m55")
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "cortex-m55" OR
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "cortex-m85")
set(FLOAT hard)
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "cortex-m4" OR
"${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "cortex-m7")
@@ -97,4 +105,4 @@ add_compile_options(
-Wunused
-Wno-redundant-decls
-) \ No newline at end of file
+)
diff --git a/cmake/toolchain/armclang.cmake b/cmake/toolchain/armclang.cmake
index f65b9a5..aa19ff4 100644
--- a/cmake/toolchain/armclang.cmake
+++ b/cmake/toolchain/armclang.cmake
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2020-2021 Arm Limited. All rights reserved.
+# Copyright (c) 2020-2022 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -42,7 +42,7 @@ if ("nofp" IN_LIST __CPU_FEATURES)
string(APPEND __LINK_TARGET ".no_fp")
endif()
-if (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m55")
+if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "cortex-m55")
set(__LINK_TARGET 8.1-M.Main.dsp)
endif()