Skip to content

Commit d081549

Browse files
Lapshinespressif-bot
authored andcommitted
feat(tools): enable zc* extensions for esp32p4 revision >= 3.0
1 parent fd7d9c9 commit d081549

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

components/esp_hw_support/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,12 @@ endif()
190190

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

tools/cmake/toolchain-esp32p4.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ set(CMAKE_CXX_COMPILER riscv32-esp-elf-g++)
77
set(CMAKE_ASM_COMPILER riscv32-esp-elf-gcc)
88
set(_CMAKE_TOOLCHAIN_PREFIX riscv32-esp-elf-)
99

10-
set(_CMAKE_TOOLCHAIN_COMMON_FLAGS "-march=rv32imafc_zicsr_zifencei_zaamo_zalrsc_xespv_xesploop -mabi=ilp32f")
10+
set(_CMAKE_TOOLCHAIN_COMMON_FLAGS "-march=rv32imafc_zicsr_zifencei_zaamo_zalrsc_zcb_zcmp_zcmt_xesploop_xespv \
11+
-mabi=ilp32f \
12+
-mno-cm-popret -mno-cm-push-reverse")
1113

1214
remove_duplicated_flags("${_CMAKE_TOOLCHAIN_COMMON_FLAGS} -mtune=esp-base ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS)
1315
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE)

0 commit comments

Comments
 (0)