From 14ec9e9dcb875505d9142e3b6ffb77146516dbfb Mon Sep 17 00:00:00 2001 From: Nikolay Agishev Date: Thu, 16 Mar 2023 11:22:21 +0400 Subject: [PATCH] ARC: Add MWDT support into qemu_arc_hs platform Add Metaware toolchain into qemu_arc_hs* platforms Signed-off-by: Nikolay Agishev --- boards/arc/qemu_arc/qemu_arc_hs.yaml | 1 + soc/arc/snps_qemu/CMakeLists.txt | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/boards/arc/qemu_arc/qemu_arc_hs.yaml b/boards/arc/qemu_arc/qemu_arc_hs.yaml index 2ead7ebff93..05b4428710f 100644 --- a/boards/arc/qemu_arc/qemu_arc_hs.yaml +++ b/boards/arc/qemu_arc/qemu_arc_hs.yaml @@ -6,6 +6,7 @@ arch: arc toolchain: - zephyr - cross-compile + - arcmwdt testing: default: true ignore_tags: diff --git a/soc/arc/snps_qemu/CMakeLists.txt b/soc/arc/snps_qemu/CMakeLists.txt index cf3a34062ec..c77f0003c4c 100644 --- a/soc/arc/snps_qemu/CMakeLists.txt +++ b/soc/arc/snps_qemu/CMakeLists.txt @@ -1,5 +1,21 @@ # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_ISA_ARCV2) - zephyr_compile_options(-mno-sdata) +if(COMPILER STREQUAL gcc) + zephyr_compile_options(-mcpu=${GCC_M_CPU}) + + zephyr_compile_options_ifdef(CONFIG_ISA_ARCV2 -mno-sdata) + +else() + + zephyr_compile_options_ifdef(CONFIG_SOC_QEMU_ARC_HS -arcv2hs -core2 -Xatomic + -Xunaligned -Xcode_density -Xswap -Xbitscan + -Xmpy_option=qmpyh -Xshift_assist -Xbarrel_shifter + -Xtimer0 -Xtimer1) + + zephyr_ld_option_ifdef(CONFIG_SOC_QEMU_ARC_HS -Hlib=hs38_full) + + if(NOT CONFIG_SOC_QEMU_ARC_HS) + message(WARNING "QEMU ARC platforms other than HS are not supported yet with MW toolchain") + endif() + endif()