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 3ba8fbd43c279b154a959b3c40fb55c329602fd4
Author: zhangyuan29 <[email protected]>
AuthorDate: Thu Mar 27 19:51:04 2025 +0800

    arch/tricore: support tc48x build
    
    Add Kconfig selection and GNU/TASKING compiler and linker options for TC48x.
    
    Signed-off-by: zhangyuan29 <[email protected]>
---
 arch/tricore/src/cmake/chip.cmake    | 11 ++++++++++-
 arch/tricore/src/tc4x/Kconfig        |  4 ++++
 arch/tricore/src/tc4x/Toolchain.defs | 14 ++++++++++++--
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/arch/tricore/src/cmake/chip.cmake 
b/arch/tricore/src/cmake/chip.cmake
index 77a007d045b..7f49d9df132 100644
--- a/arch/tricore/src/cmake/chip.cmake
+++ b/arch/tricore/src/cmake/chip.cmake
@@ -38,7 +38,7 @@ if(CONFIG_ARCH_CHIP_TC3X)
   else()
     list(APPEND PLATFORM_FLAGS -mcpu=tc39xx -mtc162)
   endif()
-elseif(CONFIG_ARCH_CHIP_TC4X)
+elseif(CONFIG_ARCH_CHIP_TC4DX)
   if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
     add_compile_options(--misrac-version=2004 --user-mode=hypervisor)
     add_compile_options(--default-near-size=0)
@@ -47,6 +47,15 @@ elseif(CONFIG_ARCH_CHIP_TC4X)
   else()
     list(APPEND PLATFORM_FLAGS -mcpu=tc4DAx -mtc18)
   endif()
+elseif(CONFIG_ARCH_CHIP_TC48X)
+  if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
+    add_compile_options(--misrac-version=2004 --user-mode=hypervisor)
+    add_compile_options(--default-near-size=0)
+    add_link_options(-Ctc48x)
+    add_link_options(--user-provided-initialization-code)
+  else()
+    list(APPEND PLATFORM_FLAGS -mcpu=tc48xx -mtc18)
+  endif()
 endif()
 
 if(NOT CONFIG_ARCH_HAVE_FPU)
diff --git a/arch/tricore/src/tc4x/Kconfig b/arch/tricore/src/tc4x/Kconfig
index 669f086818b..398999c282e 100644
--- a/arch/tricore/src/tc4x/Kconfig
+++ b/arch/tricore/src/tc4x/Kconfig
@@ -31,10 +31,14 @@ choice
 config ARCH_CHIP_TC4DX
        bool "TC4Dx SoC"
 
+config ARCH_CHIP_TC48X
+       bool "TC48x SoC"
+
 endchoice
 
 comment "TC4X Configuration Options"
 
 config CPU_CLOCK_FREQUENCY
        int "CPU clock frequency (Hz)"
+       default 400000000 if ARCH_CHIP_TC48X
        default 500000000
diff --git a/arch/tricore/src/tc4x/Toolchain.defs 
b/arch/tricore/src/tc4x/Toolchain.defs
index e01c38d1c6a..cad3e963885 100644
--- a/arch/tricore/src/tc4x/Toolchain.defs
+++ b/arch/tricore/src/tc4x/Toolchain.defs
@@ -20,7 +20,7 @@
 #
 ############################################################################
 
-ifeq ($(CONFIG_ARCH_CHIP_TC4X),y)
+ifeq ($(CONFIG_ARCH_CHIP_TC4DX),y)
   ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)
     ARCHCPUFLAGS += --misrac-version=2004 --user-mode=hypervisor
     ARCHCPUFLAGS += --default-near-size=0
@@ -29,7 +29,17 @@ ifeq ($(CONFIG_ARCH_CHIP_TC4X),y)
   else
     ARCHCPUFLAGS += -mcpu=tc4DAx
     ARCHCPUFLAGS += -mtc18
-endif
+  endif
+else ifeq ($(CONFIG_ARCH_CHIP_TC48X),y)
+  ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)
+    ARCHCPUFLAGS += --misrac-version=2004 --user-mode=hypervisor
+    ARCHCPUFLAGS += --default-near-size=0
+    LDFLAGS      += -Ctc48x
+    LDFLAGS      += -Wl--user-provided-initialization-code
+  else
+    ARCHCPUFLAGS += -mcpu=tc48xx
+    ARCHCPUFLAGS += -mtc18
+  endif
 endif
 
 include $(TOPDIR)/arch/tricore/src/common/Toolchain.defs

Reply via email to