feat(tools): enable zc* extensions for esp32p4 revision >= 3.0

This commit is contained in:
Alexey Lapshin
2025-09-25 13:09:29 +07:00
committed by BOT
parent fd7d9c9ee9
commit d081549979
2 changed files with 9 additions and 2 deletions

View File

@@ -190,7 +190,12 @@ endif()
if(CONFIG_ESP32P4_SELECTS_REV_LESS_V3) if(CONFIG_ESP32P4_SELECTS_REV_LESS_V3)
if(CMAKE_C_COMPILER_ID MATCHES "GNU") if(CMAKE_C_COMPILER_ID MATCHES "GNU")
idf_build_set_property(COMPILE_OPTIONS "-mespv-spec=2p1" APPEND) # 1. Set xespv2p1 explicitly to override the default xespv2p2.
# 2. Remove zc* extensions:
# The ESP32-P4 has always supported the zc* extensions,
# but revisions earlier than v3.0 are affected by hardware issue DIG-661
# and lack the mintthresh_csr register needed for the workaround.
idf_build_set_property(COMPILE_OPTIONS "-march=rv32imafc_zicsr_zifencei_zaamo_zalrsc_xesploop_xespv2p1" APPEND)
endif() endif()
elseif(CONFIG_IDF_TARGET_ESP32P4) elseif(CONFIG_IDF_TARGET_ESP32P4)
if(CMAKE_C_COMPILER_ID MATCHES "Clang") # TODO: LLVM-478 if(CMAKE_C_COMPILER_ID MATCHES "Clang") # TODO: LLVM-478

View File

@@ -7,7 +7,9 @@ set(CMAKE_CXX_COMPILER riscv32-esp-elf-g++)
set(CMAKE_ASM_COMPILER riscv32-esp-elf-gcc) set(CMAKE_ASM_COMPILER riscv32-esp-elf-gcc)
set(_CMAKE_TOOLCHAIN_PREFIX riscv32-esp-elf-) set(_CMAKE_TOOLCHAIN_PREFIX riscv32-esp-elf-)
set(_CMAKE_TOOLCHAIN_COMMON_FLAGS "-march=rv32imafc_zicsr_zifencei_zaamo_zalrsc_xespv_xesploop -mabi=ilp32f") set(_CMAKE_TOOLCHAIN_COMMON_FLAGS "-march=rv32imafc_zicsr_zifencei_zaamo_zalrsc_zcb_zcmp_zcmt_xesploop_xespv \
-mabi=ilp32f \
-mno-cm-popret -mno-cm-push-reverse")
remove_duplicated_flags("${_CMAKE_TOOLCHAIN_COMMON_FLAGS} -mtune=esp-base ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) remove_duplicated_flags("${_CMAKE_TOOLCHAIN_COMMON_FLAGS} -mtune=esp-base ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE)