From 27ea9f7625e083274a1a2efa4c9ce978f266b315 Mon Sep 17 00:00:00 2001 From: wangbowen6 Date: Thu, 8 Dec 2022 15:09:55 +0800 Subject: [PATCH] arm/Kconfig: add cortex-m85 config Signed-off-by: wangbowen6 --- arch/arm/Kconfig | 17 ++++++++++++++++ arch/arm/src/armv8-m/Toolchain.defs | 30 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 754e698df5..d3c2eecf32 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -910,6 +910,23 @@ config ARCH_CORTEXM55 select ARCH_HAVE_USAGEFAULT_DEBUG select ARCH_HAVE_SECUREFAULT_DEBUG if ARCH_TRUSTZONE_SECURE +config ARCH_CORTEXM85 + bool + default n + select ARM_THUMB + select ARCH_ARMV8M + select ARCH_HAVE_IRQPRIO + select ARCH_HAVE_IRQTRIGGER + select ARCH_HAVE_RAMVECTORS + select ARCH_HAVE_HIPRI_INTERRUPT + select ARCH_HAVE_RESET + select ARCH_HAVE_TESTSET + select ARCH_HAVE_HARDFAULT_DEBUG + select ARCH_HAVE_MEMFAULT_DEBUG + select ARCH_HAVE_BUSFAULT_DEBUG + select ARCH_HAVE_USAGEFAULT_DEBUG + select ARCH_HAVE_SECUREFAULT_DEBUG if ARCH_TRUSTZONE_SECURE + config ARCH_FAMILY string default "arm" if ARCH_ARM7TDMI || ARCH_ARM920T || ARCH_ARM926EJS || ARCH_ARM1136J || ARCH_ARM1156T2 || ARCH_ARM1176JZ diff --git a/arch/arm/src/armv8-m/Toolchain.defs b/arch/arm/src/armv8-m/Toolchain.defs index 8407e7cd8c..e694f6e7ed 100644 --- a/arch/arm/src/armv8-m/Toolchain.defs +++ b/arch/arm/src/armv8-m/Toolchain.defs @@ -46,6 +46,16 @@ else ifeq ($(CONFIG_ARCH_CORTEXM55),y) ifeq ($(CONFIG_ARCH_FPU),y) TOOLCHAIN_MFLOAT := -mfpu=fpv5-d16 endif +else ifeq ($(CONFIG_ARCH_CORTEXM85),y) + TOOLCHAIN_MTUNE := -mtune=cortex-m85 + ifeq ($(CONFIG_ARM_HAVE_MVE),y) + TOOLCHAIN_MARCH := -march=armv8.1-m.main+mve.fp+fp.dp + else + TOOLCHAIN_MARCH := -march=armv8.1-m.main$(EXTCPUFLAGS) + endif + ifeq ($(CONFIG_ARCH_FPU),y) + TOOLCHAIN_MFLOAT := -mfpu=fpv5-d16 + endif endif ifeq ($(CONFIG_ARCH_FPU),y) @@ -82,6 +92,12 @@ ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y) else TOOLCHAIN_MARCH += --config armv8.1m.main_soft_nofp_nomve_nosys endif + else ifeq ($(CONFIG_ARCH_CORTEXM85),y) + ifeq ($(CONFIG_ARCH_FPU),y) + TOOLCHAIN_MARCH += --config armv8.1m.main_hard_fp + else + TOOLCHAIN_MARCH += --config armv8.1m.main_soft_nofp_nomve + endif endif else ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y) @@ -114,6 +130,20 @@ else ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y) LDFLAGS += --cpu=Cortex-M55.no_mve.no_fp endif endif + else ifeq ($(CONFIG_ARCH_CORTEXM85),y) + ifeq ($(CONFIG_ARM_HAVE_MVE),y) + ifeq ($(CONFIG_ARCH_FPU),y) + LDFLAGS += --cpu=Cortex-M85 + else + LDFLAGS += --cpu=Cortex-M85.no_fp + endif + else + ifeq ($(CONFIG_ARCH_FPU),y) + LDFLAGS += --cpu=Cortex-M85.no_mve + else + LDFLAGS += --cpu=Cortex-M85.no_mve.no_fp + endif + endif endif endif