From dcc5dd27fa17a9cf81277f9e3d93cbf15f17ba5e Mon Sep 17 00:00:00 2001 From: Filip Kokosinski Date: Mon, 1 Jul 2024 10:12:44 +0200 Subject: [PATCH] soc/openisa: rely on the `CONFIG_RISCV_ISA_EXT_*` options for arch string This commit makes the RV32M1 SoC rely on the default behavior of relying on the `CONFIG_RISCV_ISA_EXT_*` config options, and removes the `zephyr_compile_options` override when the standard toolchain is used. Signed-off-by: Filip Kokosinski --- soc/openisa/rv32m1/CMakeLists.txt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/soc/openisa/rv32m1/CMakeLists.txt b/soc/openisa/rv32m1/CMakeLists.txt index cd65ea9d628..fcfda5f17ed 100644 --- a/soc/openisa/rv32m1/CMakeLists.txt +++ b/soc/openisa/rv32m1/CMakeLists.txt @@ -2,14 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_SOC_OPENISA_RV32M1_RI5CY) - if (CONFIG_RISCV_GENERIC_TOOLCHAIN) - zephyr_compile_options(-march=rv32imc_zicsr_zifencei) - else() - zephyr_compile_options(-march=rv32imcxpulpv2) - endif() -elseif(CONFIG_SOC_OPENISA_RV32M1_ZERO_RISCY) - zephyr_compile_options(-march=rv32imc_zicsr_zifencei) +# Let's rely on `-march` being generated by the CMake script based on which `CONFIG_RISCV_ISA_EXT_*` +# options are y-selected; provide full arch string with the custom extension otherwise. +if(CONFIG_SOC_OPENISA_RV32M1_RI5CY AND NOT CONFIG_RISCV_GENERIC_TOOLCHAIN) + zephyr_compile_options(-march=rv32imcxpulpv2) endif() zephyr_sources(