Skip to content

Commit 5f68cd3

Browse files
author
Bradley Bolen
committed
arch: arm: Add Cortex-R4 support
Pass the correct -march and -mcpu flags to the compiler when building for the Cortex-R4. Signed-off-by: Bradley Bolen <[email protected]>
1 parent 7b1afc9 commit 5f68cd3

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

arch/arm/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set(ARCH_FOR_cortex-m4 armv7e-m )
77
set(ARCH_FOR_cortex-m23 armv8-m.base )
88
set(ARCH_FOR_cortex-m33 armv8-m.main+dsp)
99
set(ARCH_FOR_cortex-m33+nodsp armv8-m.main )
10+
set(ARCH_FOR_cortex-r4 armv7-r )
1011

1112
if(ARCH_FOR_${GCC_M_CPU})
1213
set(ARCH_FLAG -march=${ARCH_FOR_${GCC_M_CPU}})

arch/arm/core/cortex_r/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
# if one selects a different ARM Cortex Family (Cortex-A or Cortex-M)
1515

1616

17+
config CPU_CORTEX_R4
18+
bool
19+
select CPU_CORTEX_R
20+
select ARMV7_R
21+
select ARMV7_R_FP if CPU_HAS_FPU
22+
help
23+
This option signifies the use of a Cortex-R4 CPU
24+
1725
if CPU_CORTEX_R
1826

1927
config ARMV7_R

cmake/gcc-m-cpu.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ if("${ARCH}" STREQUAL "arm")
2222
else()
2323
set(GCC_M_CPU cortex-m33+nodsp)
2424
endif()
25+
elseif(CONFIG_CPU_CORTEX_R4)
26+
set(GCC_M_CPU cortex-r4)
2527
else()
2628
message(FATAL_ERROR "Expected CONFIG_CPU_CORTEX_x to be defined")
2729
endif()

0 commit comments

Comments
 (0)