Skip to content

Commit 9162f83

Browse files
committed
Make changes for Cortex-A5 support
1 parent af60d83 commit 9162f83

File tree

10 files changed

+42
-6
lines changed

10 files changed

+42
-6
lines changed

platform/include/platform/mbed_application.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include<stdint.h>
2222

2323
#if defined(__CORTEX_M0PLUS) || defined(__CORTEX_M3) || defined(__CORTEX_M4) || defined(__CORTEX_M7)\
24-
|| defined(__CORTEX_M23) || defined(__CORTEX_A9) || defined(__CORTEX_M33)
24+
|| defined(__CORTEX_M23) || defined(__CORTEX_A9) || defined(__CORTEX_A5) || defined(__CORTEX_M33)
2525
#define MBED_APPLICATION_SUPPORT 1
2626
#else
2727
#define MBED_APPLICATION_SUPPORT 0

platform/source/mbed_application.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#if MBED_APPLICATION_SUPPORT
2525

26-
#if defined(__CORTEX_A9)
26+
#if defined(__CORTEX_A9) || defined(__CORTEX_A5)
2727

2828
static void powerdown_gic(void);
2929

platform/source/mbed_wait_api_no_rtos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void wait_us(int us)
9191
#define LOOP_SCALER 2000
9292
#endif
9393
#elif defined __CORTEX_A
94-
#if __CORTEX_A == 9
94+
#if __CORTEX_A == 9 || __CORTEX_A == 5
9595
// Cortex-A9 can dual issue for 3 cycles per iteration (SUB,NOP) = 1, (NOP,BCS) = 2
9696
#define LOOP_SCALER 3000
9797
#endif

platform/tests/TESTS/mbed_platform/stats_cpu/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ DigitalOut led1(LED1);
3333
#endif
3434

3535
// Targets with these cores have their RAM enough size to create threads with bigger stacks
36-
#if defined(__CORTEX_A9) || defined(__CORTEX_M23) || defined(__CORTEX_M33) || defined(__CORTEX_M7)
36+
#if defined(__CORTEX_A9) || defined(__CORTEX_A5) || defined(__CORTEX_M23) || defined(__CORTEX_M33) || defined(__CORTEX_M7)
3737
#define MAX_THREAD_STACK 512
3838
#else
3939
#define MAX_THREAD_STACK 384

rtos/tests/TESTS/mbed_rtos/malloc/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ volatile bool thread_should_continue = true;
3232
#define NUM_THREADS 4
3333
#define THREAD_MALLOC_SIZE 100
3434

35-
#if defined(__CORTEX_A9)
35+
#if defined(__CORTEX_A9) || defined(__CORTEX_A5)
3636
#define THREAD_STACK_SIZE 512
3737
#elif defined(__CORTEX_M23) || defined(__CORTEX_M33)
3838
#define THREAD_STACK_SIZE 512

rtos/tests/TESTS/mbed_rtos/threads/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <type_traits>
3333

3434
#define THREAD_STACK_SIZE 512
35-
#if defined(__CORTEX_A9) || defined(__CORTEX_M23) || defined(__CORTEX_M33) || defined(TARGET_ARM_FM) || defined(TARGET_CY8CKIT_062_WIFI_BT_PSA)
35+
#if defined(__CORTEX_A9) || defined(__CORTEX_A5) || defined(__CORTEX_M23) || defined(__CORTEX_M33) || defined(TARGET_ARM_FM) || defined(TARGET_CY8CKIT_062_WIFI_BT_PSA)
3636
#define PARALLEL_THREAD_STACK_SIZE 512
3737
#define CHILD_THREAD_STACK_SIZE 512
3838
#else

tools/cmake/cores/Cortex-A5.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
list(APPEND common_options
6+
"-mthumb-interwork"
7+
"-marm"
8+
"-mfpu=vfpv3"
9+
"-mfloat-abi=softfp"
10+
"-mno-unaligned-access"
11+
"-mcpu=cortex-a5"
12+
)
13+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
14+
list(APPEND common_options
15+
"-mfpu=vfpv3"
16+
"-mfloat-abi=hard"
17+
"-mcpu=cortex-a5"
18+
)
19+
endif()
20+
21+
function(mbed_set_cpu_core_definitions target)
22+
target_compile_definitions(${target}
23+
INTERFACE
24+
__CORTEX_A5
25+
ARM_MATH_CA5
26+
__FPU_PRESENT
27+
__CMSIS_RTOS
28+
__EVAL
29+
)
30+
endfunction()

tools/cmake/mbed_toolchain.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ endfunction()
2525
# Set the system processor depending on the CPU core type
2626
if (MBED_CPU_CORE STREQUAL Cortex-A9)
2727
set(CMAKE_SYSTEM_PROCESSOR cortex-a9)
28+
elseif (MBED_CPU_CORE STREQUAL Cortex-A5)
29+
set(CMAKE_SYSTEM_PROCESSOR cortex-a5)
2830
elseif (MBED_CPU_CORE STREQUAL Cortex-M0+)
2931
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
3032
elseif (MBED_CPU_CORE STREQUAL Cortex-M0)

tools/targets/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"Cortex-M7F": ["M7", "CORTEX_M", "RTOS_M4_M7", "LIKE_CORTEX_M7", "CORTEX"],
5050
"Cortex-M7FD": ["M7", "CORTEX_M", "RTOS_M4_M7", "LIKE_CORTEX_M7",
5151
"CORTEX"],
52+
"Cortex-A5": ["A5", "CORTEX_A", "LIKE_CORTEX_A5", "CORTEX"],
5253
"Cortex-A9": ["A9", "CORTEX_A", "LIKE_CORTEX_A9", "CORTEX"],
5354
"Cortex-M23": ["M23", "CORTEX_M", "LIKE_CORTEX_M23", "CORTEX"],
5455
"Cortex-M23-NS": ["M23", "M23_NS", "CORTEX_M", "LIKE_CORTEX_M23",
@@ -74,6 +75,7 @@
7475
"Cortex-M7": 7,
7576
"Cortex-M7F": 7,
7677
"Cortex-M7FD": 7,
78+
"Cortex-A5": 7,
7779
"Cortex-A9": 7,
7880
"Cortex-M23": 8,
7981
"Cortex-M23-NS": 8,

tools/toolchains/mbed_toolchain.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
"__CMSIS_RTOS"],
8181
"Cortex-M7FD": ["__CORTEX_M7", "ARM_MATH_CM7", "__FPU_PRESENT=1",
8282
"__CMSIS_RTOS"],
83+
"Cortex-A5": ["__CORTEX_A5", "ARM_MATH_CA5", "__FPU_PRESENT",
84+
"__CMSIS_RTOS", "__EVAL"],
8385
"Cortex-A9": ["__CORTEX_A9", "ARM_MATH_CA9", "__FPU_PRESENT",
8486
"__CMSIS_RTOS", "__EVAL"],
8587
"Cortex-M23-NS": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "DOMAIN_NS=1",

0 commit comments

Comments
 (0)