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
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_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 @@
# Link options
add_link_options(
- -mcpu=${TARGET_CPU}
+ -mcpu=${GCC_CPU}
-mthumb
--specs=nosys.specs)
@@ -63,7 +70,8 @@
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 @@
-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 @@
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()