From aa6edfa23113a13509e89e7b9bb1eb35ead991cd Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Mon, 26 Aug 2024 03:24:11 +0000 Subject: [PATCH] pw_toolchain: Add ARM Cortex-M55 toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: 361691368 Change-Id: Id69b311cb22b1279694239a0b7970f2f98fb9b49 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/231631 Reviewed-by: Alexei Frolov Reviewed-by: Armando Montanez Commit-Queue: Jimmy Chen Lint: Lint 🤖 --- pw_toolchain/arm_clang/BUILD.gn | 8 ++++++ pw_toolchain/arm_clang/toolchains.gni | 35 +++++++++++++++++++++++++++ pw_toolchain/arm_gcc/BUILD.gn | 6 +++++ pw_toolchain/arm_gcc/toolchains.gni | 34 ++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) diff --git a/pw_toolchain/arm_clang/BUILD.gn b/pw_toolchain/arm_clang/BUILD.gn index 2e322d2ae7..c98953228a 100644 --- a/pw_toolchain/arm_clang/BUILD.gn +++ b/pw_toolchain/arm_clang/BUILD.gn @@ -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 +} diff --git a/pw_toolchain/arm_clang/toolchains.gni b/pw_toolchain/arm_clang/toolchains.gni index 343cf6e546..95e17e9b89 100644 --- a/pw_toolchain/arm_clang/toolchains.gni +++ b/pw_toolchain/arm_clang/toolchains.gni @@ -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 = { @@ -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 @@ -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, ] diff --git a/pw_toolchain/arm_gcc/BUILD.gn b/pw_toolchain/arm_gcc/BUILD.gn index f0a9d7e3c7..1699493b0a 100644 --- a/pw_toolchain/arm_gcc/BUILD.gn +++ b/pw_toolchain/arm_gcc/BUILD.gn @@ -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 diff --git a/pw_toolchain/arm_gcc/toolchains.gni b/pw_toolchain/arm_gcc/toolchains.gni index 30a2efa647..0c4034fa65 100644 --- a/pw_toolchain/arm_gcc/toolchains.gni +++ b/pw_toolchain/arm_gcc/toolchains.gni @@ -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", @@ -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, "*") @@ -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,