Skip to content

Commit b5c2f70

Browse files
authored
Merge pull request #14718 from Meano/develop
Feature: Make changes for Cortex-A5 support
2 parents 43116a2 + 2d2d1cf commit b5c2f70

37 files changed

+37
-41
lines changed

cmsis/device/rtos/source/mbed_boot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static void mbed_cpy_nvic(void)
128128
VTOR register and for A9 for which CMSIS doesn't define NVIC_SetVector; in both cases target code is
129129
responsible for correctly handling the vectors.
130130
*/
131-
#if !defined(__CORTEX_M0) && !defined(__CORTEX_A9)
131+
#if !defined(__CORTEX_M0) && !defined(__CORTEX_A)
132132
#ifdef NVIC_RAM_VECTOR_ADDRESS
133133
uint32_t *old_vectors = (uint32_t *)SCB->VTOR;
134134
uint32_t *vectors = (uint32_t *)NVIC_RAM_VECTOR_ADDRESS;
@@ -137,5 +137,5 @@ static void mbed_cpy_nvic(void)
137137
}
138138
SCB->VTOR = (uint32_t)NVIC_RAM_VECTOR_ADDRESS;
139139
#endif /* NVIC_RAM_VECTOR_ADDRESS */
140-
#endif /* !defined(__CORTEX_M0) && !defined(__CORTEX_A9) */
140+
#endif /* !defined(__CORTEX_M0) && !defined(__CORTEX_A) */
141141
}

hal/source/mbed_critical_section_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static bool state_saved = false;
2626

2727
static bool are_interrupts_enabled(void)
2828
{
29-
#if defined(__CORTEX_A9)
29+
#if defined(__CORTEX_A)
3030
return ((__get_CPSR() & 0x80) == 0);
3131
#else
3232
return ((__get_PRIMASK() & 0x1) == 0);

hal/tests/TESTS/mbed_hal/critical_section/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using utest::v1::Case;
2929

3030
bool test_are_interrupts_enabled(void)
3131
{
32-
#if defined(__CORTEX_A9)
32+
#if defined(__CORTEX_A)
3333
return ((__get_CPSR() & 0x80) == 0);
3434
#else
3535
return ((__get_PRIMASK() & 0x1) == 0);

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_critical.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static uint32_t critical_section_reentrancy_counter = 0;
2727

2828
bool core_util_are_interrupts_enabled(void)
2929
{
30-
#if defined(__CORTEX_A9)
30+
#if defined(__CORTEX_A)
3131
return ((__get_CPSR() & 0x80) == 0);
3232
#else
3333
return ((__get_PRIMASK() & 0x1) == 0);
@@ -36,7 +36,7 @@ bool core_util_are_interrupts_enabled(void)
3636

3737
bool core_util_is_isr_active(void)
3838
{
39-
#if defined(__CORTEX_A9)
39+
#if defined(__CORTEX_A)
4040
switch (__get_CPSR() & 0x1FU) {
4141
case CPSR_M_USR:
4242
case CPSR_M_SYS:

platform/source/mbed_sdk_boot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void mbed_copy_nvic(void)
6363
VTOR register and for A9 for which CMSIS doesn't define NVIC_SetVector; in both cases target code is
6464
responsible for correctly handling the vectors.
6565
*/
66-
#if !defined(__CORTEX_M0) && !defined(__CORTEX_A9)
66+
#if !defined(__CORTEX_M0) && !defined(__CORTEX_A)
6767
#ifdef NVIC_RAM_VECTOR_ADDRESS
6868
uint32_t *old_vectors = (uint32_t *)SCB->VTOR;
6969
uint32_t *vectors = (uint32_t *)NVIC_RAM_VECTOR_ADDRESS;
@@ -72,7 +72,7 @@ void mbed_copy_nvic(void)
7272
}
7373
SCB->VTOR = (uint32_t)NVIC_RAM_VECTOR_ADDRESS;
7474
#endif /* NVIC_RAM_VECTOR_ADDRESS */
75-
#endif /* !defined(__CORTEX_M0) && !defined(__CORTEX_A9) */
75+
#endif /* !defined(__CORTEX_M0) && !defined(__CORTEX_A) */
7676
}
7777

7878
void mbed_init(void)

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

0 commit comments

Comments
 (0)