This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit e466145038ed4daebb49b0feb60c514e73769b90
Author: zhaoyiming5 <[email protected]>
AuthorDate: Fri Dec 12 10:30:29 2025 +0800

    arch/tricore: support tc4zx
    
    Add Kconfig selection and GNU/TASKING compiler and linker options for TC4ZX.
    
    Signed-off-by: zhaoyiming5 <[email protected]>
---
 arch/tricore/src/cmake/chip.cmake    |  9 +++++++++
 arch/tricore/src/tc4x/Kconfig        |  3 +++
 arch/tricore/src/tc4x/Toolchain.defs | 10 ++++++++++
 3 files changed, 22 insertions(+)

diff --git a/arch/tricore/src/cmake/chip.cmake 
b/arch/tricore/src/cmake/chip.cmake
index 7f49d9df132..3bff0a1877a 100644
--- a/arch/tricore/src/cmake/chip.cmake
+++ b/arch/tricore/src/cmake/chip.cmake
@@ -56,6 +56,15 @@ elseif(CONFIG_ARCH_CHIP_TC48X)
   else()
     list(APPEND PLATFORM_FLAGS -mcpu=tc48xx -mtc18)
   endif()
+elseif(CONFIG_ARCH_CHIP_TC4ZX)
+  if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
+    add_compile_options(--misrac-version=2004 --user-mode=hypervisor)
+    add_compile_options(--default-near-size=0)
+    add_link_options(-Ctc4zx)
+    add_link_options(--user-provided-initialization-code)
+  else()
+    list(APPEND PLATFORM_FLAGS -mcpu=tc4Zxx -mtc18)
+  endif()
 endif()
 
 if(NOT CONFIG_ARCH_HAVE_FPU)
diff --git a/arch/tricore/src/tc4x/Kconfig b/arch/tricore/src/tc4x/Kconfig
index 398999c282e..67f1fad2a04 100644
--- a/arch/tricore/src/tc4x/Kconfig
+++ b/arch/tricore/src/tc4x/Kconfig
@@ -34,6 +34,9 @@ config ARCH_CHIP_TC4DX
 config ARCH_CHIP_TC48X
        bool "TC48x SoC"
 
+config ARCH_CHIP_TC4ZX
+       bool "TC4Zx SoC"
+
 endchoice
 
 comment "TC4X Configuration Options"
diff --git a/arch/tricore/src/tc4x/Toolchain.defs 
b/arch/tricore/src/tc4x/Toolchain.defs
index cad3e963885..688a91aa5c4 100644
--- a/arch/tricore/src/tc4x/Toolchain.defs
+++ b/arch/tricore/src/tc4x/Toolchain.defs
@@ -40,6 +40,16 @@ else ifeq ($(CONFIG_ARCH_CHIP_TC48X),y)
     ARCHCPUFLAGS += -mcpu=tc48xx
     ARCHCPUFLAGS += -mtc18
   endif
+else ifeq ($(CONFIG_ARCH_CHIP_TC4ZX),y)
+  ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)
+    ARCHCPUFLAGS += --misrac-version=2004 --user-mode=hypervisor
+    ARCHCPUFLAGS += --default-near-size=0
+    LDFLAGS      += -Ctc4zx
+    LDFLAGS      += -Wl--user-provided-initialization-code
+  else
+    ARCHCPUFLAGS += -mcpu=tc4Zxx
+    ARCHCPUFLAGS += -mtc18
+  endif
 endif
 
 include $(TOPDIR)/arch/tricore/src/common/Toolchain.defs

Reply via email to