Skip to content

Commit

Permalink
pw_toolchain: Add ARM Cortex-M55 toolchain
Browse files Browse the repository at this point in the history
Bug: 361691368

Change-Id: Id69b311cb22b1279694239a0b7970f2f98fb9b49
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/231631
Reviewed-by: Alexei Frolov <[email protected]>
Reviewed-by: Armando Montanez <[email protected]>
Commit-Queue: Jimmy Chen <[email protected]>
Lint: Lint 🤖 <[email protected]>
  • Loading branch information
Jimmy Chen authored and CQ Bot Account committed Aug 26, 2024
1 parent 1f34bff commit aa6edfa
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pw_toolchain/arm_clang/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,11 @@ pw_clang_arm_config("cortex_m33f") {
asmflags = cflags
ldflags = cflags
}

pw_clang_arm_config("cortex_m55") {
cflags = [ "-mcpu=cortex-m55" ]
cflags += cortex_m_common_flags
cflags += cortex_m_software_fpu_flags
asmflags = cflags
ldflags = cflags
}
35 changes: 35 additions & 0 deletions pw_toolchain/arm_clang/toolchains.gni
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ _cortex_m33f = [
"$dir_pw_toolchain/arm_clang:cortex_m33f",
]

_cortex_m55 = [
"$dir_pw_toolchain/arm_clang:nosys",
"$dir_pw_toolchain/arm_clang:cortex_m55",
]

# Describes ARM clang toolchains for specific targets.
pw_toolchain_arm_clang = {
cortex_m0plus_debug = {
Expand Down Expand Up @@ -303,6 +308,33 @@ pw_toolchain_arm_clang = {
[ "$dir_pw_build:optimize_size_clang" ]
}
}
cortex_m55_debug = {
name = "arm_clang_cortex_m55_debug"
forward_variables_from(_arm_clang_toolchain, "*")
defaults = {
forward_variables_from(pigweed_arm_clang_defaults, "*")
default_configs = pigweed_default_configs + _cortex_m55 +
[ "$dir_pw_build:optimize_debugging" ]
}
}
cortex_m55_speed_optimized = {
name = "arm_clang_cortex_m55_speed_optimized"
forward_variables_from(_arm_clang_toolchain, "*")
defaults = {
forward_variables_from(pigweed_arm_clang_defaults, "*")
default_configs = pigweed_default_configs + _cortex_m55 +
[ "$dir_pw_build:optimize_speed" ]
}
}
cortex_m55_size_optimized = {
name = "arm_clang_cortex_m55_size_optimized"
forward_variables_from(_arm_clang_toolchain, "*")
defaults = {
forward_variables_from(pigweed_arm_clang_defaults, "*")
default_configs = pigweed_default_configs + _cortex_m55 +
[ "$dir_pw_build:optimize_size_clang" ]
}
}
}

# This list just contains the members of the above scope for convenience to make
Expand Down Expand Up @@ -333,4 +365,7 @@ pw_toolchain_arm_clang_list = [
pw_toolchain_arm_clang.cortex_m33f_debug,
pw_toolchain_arm_clang.cortex_m33f_speed_optimized,
pw_toolchain_arm_clang.cortex_m33f_size_optimized,
pw_toolchain_arm_clang.cortex_m55_debug,
pw_toolchain_arm_clang.cortex_m55_speed_optimized,
pw_toolchain_arm_clang.cortex_m55_size_optimized,
]
6 changes: 6 additions & 0 deletions pw_toolchain/arm_gcc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ config("cortex_m33") {
ldflags = cflags
}

config("cortex_m55") {
cflags = [ "-mcpu=cortex-m55" ]
asmflags = cflags
ldflags = cflags
}

config("cortex_a32") {
cflags = [ "-mcpu=cortex-a32" ]
asmflags = cflags
Expand Down
34 changes: 34 additions & 0 deletions pw_toolchain/arm_gcc/toolchains.gni
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ _cortex_m33f = [
"$dir_pw_toolchain/arm_gcc:cortex_hardware_fpu_v5_sp",
]

_cortex_m55 = [
"$dir_pw_toolchain/arm_gcc:cortex_common",
"$dir_pw_toolchain/arm_gcc:cortex_m55",
"$dir_pw_toolchain/arm_gcc:cortex_software_fpu",
]

_cortex_a32 = [
"$dir_pw_toolchain/arm_gcc:cortex_common",
"$dir_pw_toolchain/arm_gcc:cortex_a32",
Expand Down Expand Up @@ -355,6 +361,31 @@ pw_toolchain_arm_gcc = {
}
}

cortex_m55_debug = {
name = "arm_gcc_cortex_m55_debug"
forward_variables_from(arm_gcc_toolchain_tools, "*")
defaults = {
default_configs = pigweed_default_configs + _arm_gcc + _cortex_m55 +
[ "$dir_pw_build:optimize_debugging" ]
}
}
cortex_m55_speed_optimized = {
name = "arm_gcc_cortex_m55_speed_optimized"
forward_variables_from(arm_gcc_toolchain_tools, "*")
defaults = {
default_configs = pigweed_default_configs + _arm_gcc + _cortex_m55 +
[ "$dir_pw_build:optimize_speed" ]
}
}
cortex_m55_size_optimized = {
name = "arm_gcc_cortex_m55_size_optimized"
forward_variables_from(arm_gcc_toolchain_tools, "*")
defaults = {
default_configs = pigweed_default_configs + _arm_gcc + _cortex_m55 +
[ "$dir_pw_build:optimize_size" ]
}
}

cortex_a32_debug = {
name = "arm_gcc_cortex_a32_debug"
forward_variables_from(arm_gcc_toolchain_tools, "*")
Expand Down Expand Up @@ -409,6 +440,9 @@ pw_toolchain_arm_gcc_list = [
pw_toolchain_arm_gcc.cortex_m33f_debug,
pw_toolchain_arm_gcc.cortex_m33f_speed_optimized,
pw_toolchain_arm_gcc.cortex_m33f_size_optimized,
pw_toolchain_arm_gcc.cortex_m55_debug,
pw_toolchain_arm_gcc.cortex_m55_speed_optimized,
pw_toolchain_arm_gcc.cortex_m55_size_optimized,
pw_toolchain_arm_gcc.cortex_a32_debug,
pw_toolchain_arm_gcc.cortex_a32_speed_optimized,
pw_toolchain_arm_gcc.cortex_a32_size_optimized,
Expand Down

0 comments on commit aa6edfa

Please sign in to comment.