-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Make changes for Cortex-A5 support #14718
Conversation
@Meano, thank you for your changes. |
@Meano, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Meano Thanks for the addition!
Checking what we have for A9 (grep -rnI CORTEX_A9
), I also found the following
- hal/tests/TESTS/mbed_hal/critical_section/main.cpp
- platform/include/platform/mbed_application.h
- platform/source/mbed_sdk_boot.c
- platform/source/mbed_application.c
- platform/tests/TESTS/mbed_platform/stats_cpu/main.cpp
- cmsis/device/rtos/source/mbed_boot.c
- rtos/tests/TESTS/mbed_rtos/threads/main.cpp
I think at least some (most?) of them would also need to be done for A5.
@ARMmbed/mbed-os-maintainers Who is the best to help with Cortex-A support? Is it possible to unify (at least some of) the macro checks to Cortex-A in general rather than targeting A9 and A5 specifically?
As a verification, it'd be really helpful to run Greentea tests on the following inside mbed-os
with
as those test cases contain Cortex-A specifics. Thanks! |
tools/cmake/cores/Cortex-A5.cmake
Outdated
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") | ||
list(APPEND common_options | ||
"-mthumb-interwork" | ||
"-marm" | ||
"-mfpu=vfpv3" | ||
"-mfloat-abi=softfp" | ||
"-mno-unaligned-access" | ||
"-mcpu=cortex-a5" | ||
) | ||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") | ||
list(APPEND common_options | ||
"-mfpu=vfpv3" | ||
"-mfloat-abi=hard" | ||
"-mcpu=cortex-a5" | ||
) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ARMmbed/mbed-os-maintainers If we can get some expert to check the architectural features specific to A5, it'd be nice. But otherwise the flags look fairly generic and okay to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I compared with m cores and one a core we currently have, no difference.
tools/cmake/cores/Cortex-A5.cmake
Outdated
INTERFACE | ||
__CORTEX_A5 | ||
ARM_MATH_CA5 | ||
__FPU_PRESENT | ||
__CMSIS_RTOS | ||
__EVAL | ||
__MBED_CMSIS_RTOS_CA5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(More of a note to the Mbed team for future reference: at some point we might check if all of them are still used and do a clean-up. They are defined for A9 too, so okay to keep for consistency)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required, lets remove it.
The old symbols are not used anymore neither (__MBED_CMSIS_RTOS_CA9
or __MBED_CMSIS_RTOS_CM
)
@Meano + @ARMmbed/team-renesas-rz would be the best bet to align them. I'll rereview and find better macro to be used, good point |
@@ -26,7 +26,7 @@ static bool state_saved = false; | |||
|
|||
static bool are_interrupts_enabled(void) | |||
{ | |||
#if defined(__CORTEX_A9) | |||
#if defined(__CORTEX_A9) || defined(__CORTEX_A5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can become __CORTEX_A
only in all where we distinguish cortex-m vs cortex-a cores. CMSIs headers provide __CORTEX_A and __CORTEX_M definition for each, it should be sufficient to check for these.
tools/cmake/cores/Cortex-A5.cmake
Outdated
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") | ||
list(APPEND common_options | ||
"-mthumb-interwork" | ||
"-marm" | ||
"-mfpu=vfpv3" | ||
"-mfloat-abi=softfp" | ||
"-mno-unaligned-access" | ||
"-mcpu=cortex-a5" | ||
) | ||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") | ||
list(APPEND common_options | ||
"-mfpu=vfpv3" | ||
"-mfloat-abi=hard" | ||
"-mcpu=cortex-a5" | ||
) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I compared with m cores and one a core we currently have, no difference.
tools/cmake/cores/Cortex-A5.cmake
Outdated
INTERFACE | ||
__CORTEX_A5 | ||
ARM_MATH_CA5 | ||
__FPU_PRESENT | ||
__CMSIS_RTOS | ||
__EVAL | ||
__MBED_CMSIS_RTOS_CA5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required, lets remove it.
The old symbols are not used anymore neither (__MBED_CMSIS_RTOS_CA9
or __MBED_CMSIS_RTOS_CM
)
@LDong-Arm @0xc0170 I'll try to unify the macro and run Greentea tests. |
The CA9 board passed Greentea tests. Our CA5 chip will be tested as soon as possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. The main purpose of this PR is adding Cortex-A5 support, so any further refactoring can be done by the Mbed team in the future if we need.
The Travis failure is okay to ignore. The path tools/targets
is for compatibility with the old build system and frozen from major changes, but we can allow it case by case.
tools/toolchains/mbed_toolchain.py
Outdated
"Cortex-M0": ["__CORTEX_M0", "ARM_MATH_CM0", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"Cortex-M0+": ["__CORTEX_M0PLUS", "ARM_MATH_CM0PLUS", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"Cortex-M1": ["__CORTEX_M3", "ARM_MATH_CM1", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"Cortex-M3": ["__CORTEX_M3", "ARM_MATH_CM3", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"Cortex-M4": ["__CORTEX_M4", "ARM_MATH_CM4", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"Cortex-M0": ["__CORTEX_M0", "ARM_MATH_CM0", "__CMSIS_RTOS"], | ||
"Cortex-M0+": ["__CORTEX_M0PLUS", "ARM_MATH_CM0PLUS", "__CMSIS_RTOS"], | ||
"Cortex-M1": ["__CORTEX_M3", "ARM_MATH_CM1", "__CMSIS_RTOS"], | ||
"Cortex-M3": ["__CORTEX_M3", "ARM_MATH_CM3", "__CMSIS_RTOS"], | ||
"Cortex-M4": ["__CORTEX_M4", "ARM_MATH_CM4", "__CMSIS_RTOS"], | ||
"Cortex-M4F": ["__CORTEX_M4", "ARM_MATH_CM4", "__FPU_PRESENT=1", | ||
"__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"], | ||
"Cortex-M7": ["__CORTEX_M7", "ARM_MATH_CM7", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"__CMSIS_RTOS"], | ||
"Cortex-M7": ["__CORTEX_M7", "ARM_MATH_CM7", "__CMSIS_RTOS"], | ||
"Cortex-M7F": ["__CORTEX_M7", "ARM_MATH_CM7", "__FPU_PRESENT=1", | ||
"__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"], | ||
"__CMSIS_RTOS"], | ||
"Cortex-M7FD": ["__CORTEX_M7", "ARM_MATH_CM7", "__FPU_PRESENT=1", | ||
"__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"], | ||
"__CMSIS_RTOS"], | ||
"Cortex-A9": ["__CORTEX_A9", "ARM_MATH_CA9", "__FPU_PRESENT", | ||
"__CMSIS_RTOS", "__EVAL", "__MBED_CMSIS_RTOS_CA9"], | ||
"__CMSIS_RTOS", "__EVAL"], | ||
"Cortex-M23-NS": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "DOMAIN_NS=1", | ||
"__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"], | ||
"Cortex-M23": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"__CMSIS_RTOS"], | ||
"Cortex-M23": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "__CMSIS_RTOS"], | ||
"Cortex-M33-NS": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "DOMAIN_NS=1", | ||
"__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"], | ||
"Cortex-M33": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"__CMSIS_RTOS"], | ||
"Cortex-M33": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "__CMSIS_RTOS"], | ||
"Cortex-M33F-NS": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "DOMAIN_NS=1", | ||
"__FPU_PRESENT=1U", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"__FPU_PRESENT=1U", "__CMSIS_RTOS"], | ||
"Cortex-M33F": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", | ||
"__FPU_PRESENT=1U", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM"], | ||
"__FPU_PRESENT=1U", "__CMSIS_RTOS"], | ||
"Cortex-M33FE-NS": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "DOMAIN_NS=1", | ||
"__FPU_PRESENT=1U", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM", "__DSP_PRESENT=1U"], | ||
"__DSP_PRESENT=1U"], | ||
"Cortex-M33FE": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", | ||
"__FPU_PRESENT=1U", "__CMSIS_RTOS", | ||
"__MBED_CMSIS_RTOS_CM", "__DSP_PRESENT=1U"], | ||
"__DSP_PRESENT=1U"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Patater Revert this file in this commit?
"Cortex-A5": ["__CORTEX_A5", "ARM_MATH_CA5", "__FPU_PRESENT", | ||
"__CMSIS_RTOS", "__EVAL"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes to mbed_toolchain.py could be approved? @Patater
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a new core added without changing existing ones, so it should be okay
I have reverted the changes of @LDong-Arm @0xc0170 @Patater Please review again. |
"Cortex-A5": ["__CORTEX_A5", "ARM_MATH_CA5", "__FPU_PRESENT", | ||
"__CMSIS_RTOS", "__EVAL"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a new core added without changing existing ones, so it should be okay
CI started (while waiting for the approval) |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-hal, please complete review of the changes to move the PR forward. Thank you for your contributions. |
@Patater If you approve it, this should be ready for integration |
Summary of changes
It's a PR that add Cortex-A5 support for mbed-os custom targets.
Unify some __CORTEX_A macros.
__MBED_CMSIS_RTOS_CM
and__MBED_CMSIS_RTOS_CA9
have been removed from CMake as they're not used anymore.Impact of changes
Migration actions required
Documentation
None
Pull request type
Test results
Reviewers