Skip to content

Commit 259b3d0

Browse files
duynguyenxanashif
authored andcommitted
arch: arm: Add initial support for Cortex-M85 Core
Add initial support for the Cortex-M85 Core which is an implementation of the Armv8.1-M mainline architecture. The support is based on the Cortex-M55 support that already exists in Zephyr. Signed-off-by: Duy Nguyen <[email protected]>
1 parent fa9e933 commit 259b3d0

File tree

11 files changed

+62
-3
lines changed

11 files changed

+62
-3
lines changed

arch/arm/core/cortex_m/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ config CPU_CORTEX_M55
7373
help
7474
This option signifies the use of a Cortex-M55 CPU
7575

76+
config CPU_CORTEX_M85
77+
bool
78+
select CPU_CORTEX_M
79+
select ARMV8_1_M_MAINLINE
80+
select ARMV8_M_SE if CPU_HAS_TEE
81+
select ARMV7_M_ARMV8_M_FP if CPU_HAS_FPU
82+
select CPU_HAS_DCACHE
83+
select CPU_HAS_ICACHE
84+
help
85+
This option signifies the use of a Cortex-M85 CPU
86+
7687
config CPU_CORTEX_M7
7788
bool
7889
select CPU_CORTEX_M

arch/arm/core/mpu/arm_mpu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ static uint8_t static_regions_num;
5454
#elif defined(CONFIG_CPU_CORTEX_M23) || \
5555
defined(CONFIG_CPU_CORTEX_M33) || \
5656
defined(CONFIG_CPU_CORTEX_M55) || \
57+
defined(CONFIG_CPU_CORTEX_M85) || \
5758
defined(CONFIG_AARCH32_ARMV8_R)
5859
#include "arm_mpu_v8_internal.h"
5960
#else

arch/arm/core/mpu/arm_mpu_v8_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct dynamic_region_info {
3131
*/
3232
static struct dynamic_region_info dyn_reg_info[MPU_DYNAMIC_REGION_AREAS_NUM];
3333
#if defined(CONFIG_CPU_CORTEX_M23) || defined(CONFIG_CPU_CORTEX_M33) || \
34-
defined(CONFIG_CPU_CORTEX_M55)
34+
defined(CONFIG_CPU_CORTEX_M55) || defined(CONFIG_CPU_CORTEX_M85)
3535
static inline void mpu_set_mair0(uint32_t mair0)
3636
{
3737
MPU->MAIR0 = mair0;

cmake/gcc-m-cpu.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ if("${ARCH}" STREQUAL "arm")
3434
else()
3535
set(GCC_M_CPU cortex-m55+nodsp)
3636
endif()
37+
elseif(CONFIG_CPU_CORTEX_M85)
38+
if (CONFIG_ARMV8_1_M_MVEF)
39+
set(GCC_M_CPU cortex-m85)
40+
elseif(CONFIG_ARMV8_1_M_MVEI)
41+
set(GCC_M_CPU cortex-m85+nomve.fp)
42+
elseif(CONFIG_ARMV8_M_DSP)
43+
set(GCC_M_CPU cortex-m85+nomve)
44+
else()
45+
set(GCC_M_CPU cortex-m85+nodsp)
46+
endif()
3747
elseif(CONFIG_CPU_CORTEX_R4)
3848
if(CONFIG_FPU AND CONFIG_CPU_HAS_VFP)
3949
set(GCC_M_CPU cortex-r4f)

cmake/gcc-m-fpu.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ if("${ARCH}" STREQUAL "arm")
3939
set(FPU_FOR_cortex-m55+nomve.fp auto)
4040
set(FPU_FOR_cortex-m55+nomve auto)
4141
set(FPU_FOR_cortex-m55+nodsp auto)
42+
set(FPU_FOR_cortex-m85 auto)
43+
set(FPU_FOR_cortex-m85+nomve.fp auto)
44+
set(FPU_FOR_cortex-m85+nomve auto)
45+
set(FPU_FOR_cortex-m85+nodsp auto)
4246

4347
set(GCC_M_FPU ${FPU_FOR_${GCC_M_CPU}})
4448
endif()

dts/bindings/cpu/arm,cortex-m85.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: ARM Cortex-M85 CPU
5+
6+
compatible: "arm,cortex-m85"
7+
8+
include: arm,cortex-m.yaml

dts/bindings/cpu/arm,cortex-m85f.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: ARM Cortex-M85F CPU
5+
6+
compatible: "arm,cortex-m85f"
7+
8+
include: arm,cortex-m.yaml

include/zephyr/arch/arm/cortex_m/memory_map.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
#define _PPB_INT_RSVD_2 0xE000F000
6868
#elif defined(CONFIG_CPU_CORTEX_M23) || \
6969
defined(CONFIG_CPU_CORTEX_M33) || \
70-
defined(CONFIG_CPU_CORTEX_M55)
70+
defined(CONFIG_CPU_CORTEX_M55) || \
71+
defined(CONFIG_CPU_CORTEX_M85)
7172
#define _PPB_INT_RSVD_0 0xE0000000
7273
#define _PPB_INT_SCS 0xE000E000
7374
#define _PPB_INT_SCB 0xE000ED00
@@ -88,7 +89,8 @@
8889
#define _PPB_EXT_PPB 0xE0042000
8990
#define _PPB_EXT_ROM_TABLE 0xE00FF000
9091
#define _PPB_EXT_END_ADDR 0xE00FFFFF
91-
#elif defined(CONFIG_CPU_CORTEX_M33) || defined(CONFIG_CPU_CORTEX_M55)
92+
#elif defined(CONFIG_CPU_CORTEX_M33) || defined(CONFIG_CPU_CORTEX_M55) \
93+
|| defined(CONFIG_CPU_CORTEX_M85)
9294
#undef _PPB_EXT_BASE_ADDR
9395
#define _PPB_EXT_BASE_ADDR 0xE0044000
9496
#define _PPB_EXT_ROM_TABLE 0xE00FF000

include/zephyr/arch/arm/mpu/arm_mpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#elif defined(CONFIG_CPU_CORTEX_M23) || \
1616
defined(CONFIG_CPU_CORTEX_M33) || \
1717
defined(CONFIG_CPU_CORTEX_M55) || \
18+
defined(CONFIG_CPU_CORTEX_M85) || \
1819
defined(CONFIG_AARCH32_ARMV8_R)
1920
#include <zephyr/arch/arm/mpu/arm_mpu_v8.h>
2021
#else

modules/cmsis/cmsis_core_m_defaults.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ typedef enum {
6464
#define __CM33_REV 0
6565
#elif defined(CONFIG_CPU_CORTEX_M55)
6666
#define __CM55_REV 0
67+
#elif defined(CONFIG_CPU_CORTEX_M85)
68+
#define __CM85_REV 0
6769
#else
6870
#error "Unknown Cortex-M device"
6971
#endif
@@ -135,6 +137,8 @@ typedef enum {
135137
#include <core_cm33.h>
136138
#elif defined(CONFIG_CPU_CORTEX_M55)
137139
#include <core_cm55.h>
140+
#elif defined(CONFIG_CPU_CORTEX_M85)
141+
#include <core_cm85.h>
138142
#else
139143
#error "Unknown Cortex-M device"
140144
#endif

0 commit comments

Comments
 (0)