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

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

commit a8b3921ae99debccc57d81540ec3094219c10887
Author: Saravanan Sekar <[email protected]>
AuthorDate: Tue Nov 10 12:23:06 2026 +0530

    arch/tricore: Select the AURIX family with a Kconfig choice.
    
    ARCH_CHIP_TC3XX and ARCH_CHIP_TC4XX are two independent options with a
    prompt, so a configuration can enable both families, or none, and then
    ARCH_CHIP has no value.  Make them a choice, named after the family as
    ARCH_CHIP_TC3X and ARCH_CHIP_TC4X like the arm chip choice
    (ARCH_CHIP_STM32F4, ARCH_CHIP_SAMV7), and update their users and the two
    board configurations.
    
    Signed-off-by: Saravanan Sekar <[email protected]>
---
 arch/tricore/Kconfig                               | 26 +++++++++++++---------
 arch/tricore/include/irq.h                         |  2 +-
 arch/tricore/src/cmake/chip.cmake                  |  4 ++--
 arch/tricore/src/cmake/tasking.cmake               |  8 +++----
 arch/tricore/src/common/aurix/tricore_asclin.h     |  4 ++--
 arch/tricore/src/common/aurix/tricore_serial.c     | 12 +++++-----
 arch/tricore/src/common/gnu/tricore_head.S         | 16 ++++++-------
 arch/tricore/src/common/tasking/tricore_head.asm   | 18 +++++++--------
 arch/tricore/src/common/tricore_irq.c              |  2 +-
 arch/tricore/src/common/tricore_stm.h              |  4 ++--
 arch/tricore/src/tc4xx/Toolchain.defs              |  2 +-
 .../tc3xx/a2g-tc397-5v-tft/configs/nsh/defconfig   |  2 +-
 .../tc4xx/triboard_tc4x9_com/configs/nsh/defconfig |  2 +-
 13 files changed, 54 insertions(+), 48 deletions(-)

diff --git a/arch/tricore/Kconfig b/arch/tricore/Kconfig
index 175a06f121f..6937fe665ad 100644
--- a/arch/tricore/Kconfig
+++ b/arch/tricore/Kconfig
@@ -81,8 +81,12 @@ config ARCH_FAMILY
        default "tc1v6"         if ARCH_TC1V6
        default "tc1v8"         if ARCH_TC1V8
 
-config ARCH_CHIP_TC3XX
-       bool "infineon aurix tc3xx"
+choice
+       prompt "AURIX family"
+       default ARCH_CHIP_TC3X
+
+config ARCH_CHIP_TC3X
+       bool "Infineon AURIX TC3x"
        select ARCH_TC1V6
        select ARCH_HAVE_ADDRENV
        select ARCH_HAVE_MULTICPU
@@ -93,10 +97,10 @@ config ARCH_CHIP_TC3XX
        select ONESHOT
        select ONESHOT_COUNT
        ---help---
-               Infineon aurix tc3xx (six cores)
+               Infineon AURIX TC3x (six cores)
 
-config ARCH_CHIP_TC4XX
-       bool "infineon aurix tc4xx"
+config ARCH_CHIP_TC4X
+       bool "Infineon AURIX TC4x"
        select ARCH_TC1V8
        select ARCH_HAVE_ADDRENV
        select ARCH_HAVE_FPU if !TRICORE_CSRM
@@ -109,12 +113,14 @@ config ARCH_CHIP_TC4XX
        select ONESHOT_COUNT
        select HAVE_SECURITY_CORE
        ---help---
-               Infineon aurix tc4xx (six cores and one security core)
+               Infineon AURIX TC4x (six cores and one security core)
+
+endchoice # AURIX family
 
 config ARCH_CHIP
        string
-       default "tc3xx"         if ARCH_CHIP_TC3XX
-       default "tc4xx"         if ARCH_CHIP_TC4XX
+       default "tc3xx"         if ARCH_CHIP_TC3X
+       default "tc4xx"         if ARCH_CHIP_TC4X
 
 config ARCH_IRQ_DISABLE_PRIORITY
        int "IRQ disable priority threshold"
@@ -174,11 +180,11 @@ config TRICORE_TRAP_ALERT
                Print the trap name and reason before the trap panics.  The
                panic message has the trap class and TIN in any case.
 
-if ARCH_CHIP_TC3XX
+if ARCH_CHIP_TC3X
 source "arch/tricore/src/tc3xx/Kconfig"
 endif
 
-if ARCH_CHIP_TC4XX
+if ARCH_CHIP_TC4X
 source "arch/tricore/src/tc4xx/Kconfig"
 endif
 
diff --git a/arch/tricore/include/irq.h b/arch/tricore/include/irq.h
index f2586278b39..4c00e8fad19 100644
--- a/arch/tricore/include/irq.h
+++ b/arch/tricore/include/irq.h
@@ -266,7 +266,7 @@ static inline_function int up_cpu_index(void)
 
   uint8_t id = tricore_mfcr(TRICORE_CPU_CORE_ID) & 0x7;
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
   id = id > 5 ? 5 : id;
 #endif
 
diff --git a/arch/tricore/src/cmake/chip.cmake 
b/arch/tricore/src/cmake/chip.cmake
index c509b8f9f52..7b82534efe3 100644
--- a/arch/tricore/src/cmake/chip.cmake
+++ b/arch/tricore/src/cmake/chip.cmake
@@ -22,7 +22,7 @@
 
 set(PLATFORM_FLAGS)
 
-if(CONFIG_ARCH_CHIP_TC3XX)
+if(CONFIG_ARCH_CHIP_TC3X)
   if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
     add_compile_options(--default-near-size=0)
     add_compile_options(--cpu=tc39xb)
@@ -31,7 +31,7 @@ if(CONFIG_ARCH_CHIP_TC3XX)
   else()
     list(APPEND PLATFORM_FLAGS -mcpu=tc39xx -mtc162)
   endif()
-elseif(CONFIG_ARCH_CHIP_TC4XX)
+elseif(CONFIG_ARCH_CHIP_TC4X)
   if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
     add_compile_options(--misrac-version=2004 --user-mode=hypervisor)
     add_compile_options(--default-near-size=0)
diff --git a/arch/tricore/src/cmake/tasking.cmake 
b/arch/tricore/src/cmake/tasking.cmake
index 055b6641833..1cfab8c32d2 100644
--- a/arch/tricore/src/cmake/tasking.cmake
+++ b/arch/tricore/src/cmake/tasking.cmake
@@ -128,9 +128,9 @@ set(CMAKE_CXX_LINK_EXECUTABLE
 # Architecture flags
 
 add_link_options(-v)
-if(CONFIG_ARCH_CHIP_TC3XX)
+if(CONFIG_ARCH_CHIP_TC3X)
   add_compile_options($<$<COMPILE_LANGUAGE:C>:--iso=11>)
-elseif(CONFIG_ARCH_CHIP_TC4XX)
+elseif(CONFIG_ARCH_CHIP_TC4X)
   add_compile_options($<$<COMPILE_LANGUAGE:C>:--iso=17>)
 endif()
 add_compile_options(
@@ -278,9 +278,9 @@ endif()
 set(NUTTX_FIND_TOOLCHAIN_LIB_DEFINED true)
 function(nuttx_find_toolchain_lib)
   if(TASKING_ROOT_PATH AND ARGN)
-    if(CONFIG_ARCH_CHIP_TC3XX)
+    if(CONFIG_ARCH_CHIP_TC3X)
       nuttx_add_extra_library(${TASKING_ROOT_PATH}/lib/tc162/${ARGN})
-    elseif(CONFIG_ARCH_CHIP_TC4XX)
+    elseif(CONFIG_ARCH_CHIP_TC4X)
       nuttx_add_extra_library(${TASKING_ROOT_PATH}/lib/tc18/${ARGN})
     endif()
   endif()
diff --git a/arch/tricore/src/common/aurix/tricore_asclin.h 
b/arch/tricore/src/common/aurix/tricore_asclin.h
index c6fa39d8787..7a598c3ffb8 100644
--- a/arch/tricore/src/common/aurix/tricore_asclin.h
+++ b/arch/tricore/src/common/aurix/tricore_asclin.h
@@ -29,9 +29,9 @@
 
 #include <nuttx/config.h>
 
-#if defined(CONFIG_ARCH_CHIP_TC3XX)
+#if defined(CONFIG_ARCH_CHIP_TC3X)
 #  include "hardware/tc3xx_asclin.h"
-#elif defined(CONFIG_ARCH_CHIP_TC4XX)
+#elif defined(CONFIG_ARCH_CHIP_TC4X)
 #  include "hardware/tc4xx_asclin.h"
 #endif
 
diff --git a/arch/tricore/src/common/aurix/tricore_serial.c 
b/arch/tricore/src/common/aurix/tricore_serial.c
index 675f4dafdf8..99db36be1d2 100644
--- a/arch/tricore/src/common/aurix/tricore_serial.c
+++ b/arch/tricore/src/common/aurix/tricore_serial.c
@@ -46,10 +46,10 @@
 #include "tricore_internal.h"
 #include "tricore_asclin.h"
 
-#if defined(CONFIG_ARCH_CHIP_TC3XX)
+#if defined(CONFIG_ARCH_CHIP_TC3X)
 #  include "hardware/tc3xx_port.h"
 #  include "tc3xx_wdt.h"
-#elif defined(CONFIG_ARCH_CHIP_TC4XX)
+#elif defined(CONFIG_ARCH_CHIP_TC4X)
 #  include "hardware/tc4xx_port.h"
 #endif
 
@@ -240,7 +240,7 @@ static void asclin_modify(uintptr_t reg, uint32_t clear, 
uint32_t set)
 
 static void asclin_pin_config(uintptr_t port, int pin, bool tx)
 {
-#if defined(CONFIG_ARCH_CHIP_TC3XX)
+#if defined(CONFIG_ARCH_CHIP_TC3X)
   int shift = TC3XX_PORT_IOCR_SHIFT(pin);
 
   asclin_modify(TC3XX_PORT_IOCR(port, pin), TC3XX_PORT_IOCR_MASK << shift,
@@ -251,7 +251,7 @@ static void asclin_pin_config(uintptr_t port, int pin, bool 
tx)
   asclin_modify(TC3XX_PORT_PDR(port, pin), TC3XX_PORT_PDR_MASK << shift,
                 TC3XX_PORT_PAD_SPEED1 << shift);
   tc3xx_wdt_cpu_endinit(true);
-#elif defined(CONFIG_ARCH_CHIP_TC4XX)
+#elif defined(CONFIG_ARCH_CHIP_TC4X)
   uintptr_t drvcfg = TC4XX_PORT_DRVCFG(port, pin);
 
   asclin_modify(drvcfg, TC4XX_PORT_DRVCFG_MODE_MASK,
@@ -359,11 +359,11 @@ static void asclin_init(struct up_dev_s *priv)
 {
   /* Enable the module, under the CPU ENDINIT on TC3xx */
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
   tc3xx_wdt_cpu_endinit(false);
 #endif
   asclin_modify(ASCLIN_REG(priv, CLC), ASCLIN_CLC_DISR, 0);
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
   tc3xx_wdt_cpu_endinit(true);
 #endif
 
diff --git a/arch/tricore/src/common/gnu/tricore_head.S 
b/arch/tricore/src/common/gnu/tricore_head.S
index be92cb48283..797766adfe9 100644
--- a/arch/tricore/src/common/gnu/tricore_head.S
+++ b/arch/tricore/src/common/gnu/tricore_head.S
@@ -34,10 +34,10 @@
 #define TRICORE_PSW_RESET  0x980   /* Supervisor, call depth counting on */
 #define TRICORE_BIV_VECTOR 0x1fe0  /* Single interrupt vector at INTTAB + 
0x1fe0 */
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
 #  define TC3XX_WDTCPU0_CON0 0xf003624c  /* CPU0 watchdog CON0, 0xc apart per 
CPU */
 #endif
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
 #  define TC4XX_PSW_VIRT   0xb00       /* PSW for disabling the virtualization 
*/
 #endif
 
@@ -91,7 +91,7 @@ tricore_head:
        movh.a  %a9, hi:__a9_mem
        lea     %a9, [%a9]lo:__a9_mem
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
        jl      tc3xx_endinit_clear
 
 #endif
@@ -101,7 +101,7 @@ tricore_head:
        mtcr    TRICORE_CPU_BTV, %d15
        isync
 
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
        movh.a  %a15, hi:__psram_boot_csa
        lea     %a15, [%a15]lo:__psram_boot_csa
        mov.d   %d15, %a15
@@ -189,7 +189,7 @@ tricore_head:
        mtcr    TRICORE_CPU_LCX, %d15
        isync
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
        jl      tc3xx_endinit_set
 
 #endif
@@ -201,7 +201,7 @@ tricore_head:
        mtcr    TRICORE_CPU_PSW, %d0
        isync
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
        call    tricore_wdt_disable
 
 #endif
@@ -243,7 +243,7 @@ tricore_head:
        lea     %a15, [%a15]lo:tricore_start
        ji      %a15
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
 /****************************************************************************
  * Name: tc3xx_endinit_clear, tc3xx_endinit_set
  *
@@ -293,7 +293,7 @@ tc3xx_endinit_set:
        ji      %a11
 #endif
 
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
 /****************************************************************************
  * Name: tricore_virt_off
  *
diff --git a/arch/tricore/src/common/tasking/tricore_head.asm 
b/arch/tricore/src/common/tasking/tricore_head.asm
index 2e6cbf9d270..bcb69ebeb12 100644
--- a/arch/tricore/src/common/tasking/tricore_head.asm
+++ b/arch/tricore/src/common/tasking/tricore_head.asm
@@ -34,10 +34,10 @@
 #define TRICORE_PSW_RESET  0x980   /* Supervisor, call depth counting on */
 #define TRICORE_BIV_VECTOR 0x1fe0  /* Single interrupt vector at INTTAB + 
0x1fe0 */
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
 #  define TC3XX_WDTCPU0_CON0 0xf003624c  /* CPU0 watchdog CON0, 0xc apart per 
CPU */
 #endif
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
 #  define TC4XX_PSW_VIRT   0xb00       /* PSW for disabling the virtualization 
*/
 #endif
 
@@ -70,7 +70,7 @@ tricore_csa_link .macro addr, tmp1, tmp2
        .extern __TRAPTAB_CPU0
        .extern __INTTAB_CPU0
        .extern __psram_ustack
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
        .extern __psram_boot_csa
        .extern __psram_boot_csa_end
        .extern tricore_ram_init
@@ -116,7 +116,7 @@ tricore_head:
        movh.a  a9, #@HIS(__a9_mem)
        lea     a9, [a9]@LOS(__a9_mem)
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
        jl      tc3xx_endinit_clear
 
 #endif
@@ -126,7 +126,7 @@ tricore_head:
        mtcr    #TRICORE_CPU_BTV, d15
        isync
 
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
        movh.a  a15, #@HIS(__psram_boot_csa)
        lea     a15, [a15]@LOS(__psram_boot_csa)
        mov.d   d15, a15
@@ -213,7 +213,7 @@ tricore_head:
        mtcr    #TRICORE_CPU_LCX, d15
        isync
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
        jl      tc3xx_endinit_set
 
 #endif
@@ -225,7 +225,7 @@ tricore_head:
        mtcr    #TRICORE_CPU_PSW, d0
        isync
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
        call    tricore_wdt_disable
 
 #endif
@@ -266,7 +266,7 @@ tricore_head:
        lea     a15, [a15]@LOS(tricore_start)
        ji      a15
 
-#ifdef CONFIG_ARCH_CHIP_TC3XX
+#ifdef CONFIG_ARCH_CHIP_TC3X
 /****************************************************************************
  * Name: tc3xx_endinit_clear, tc3xx_endinit_set
  *
@@ -313,7 +313,7 @@ tc3xx_endinit_set:
        ji      a11
 #endif
 
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
 /****************************************************************************
  * Name: tricore_virt_off
  *
diff --git a/arch/tricore/src/common/tricore_irq.c 
b/arch/tricore/src/common/tricore_irq.c
index 4176c35906a..e4d3a3555ef 100644
--- a/arch/tricore/src/common/tricore_irq.c
+++ b/arch/tricore/src/common/tricore_irq.c
@@ -127,7 +127,7 @@ static void tricore_gpsrinitialize(void)
 
   /* Cpucs gpsr init */
 
-#ifndef CONFIG_ARCH_CHIP_TC3XX
+#ifndef CONFIG_ARCH_CHIP_TC3X
   tricore_src_init(TRICORE_IRQ2SRC(TRICORE_GPSR_IRQNUM(6, cpu)), tos,
                    IRQ_TO_NDX(TRICORE_GPSR_IRQNUM(6, cpu)));
 #endif
diff --git a/arch/tricore/src/common/tricore_stm.h 
b/arch/tricore/src/common/tricore_stm.h
index 66bfda87ca9..813cd0c0777 100644
--- a/arch/tricore/src/common/tricore_stm.h
+++ b/arch/tricore/src/common/tricore_stm.h
@@ -35,7 +35,7 @@
 
 /* System timer hardware registers. */
 
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
 #  define TRICORE_STM_BASE(n)      (0xf8800000 + ((n) << 18)) /* STMn */
 #  define TRICORE_STM_SRC(n)       (0xf4432028 + (n) * 0x40)  /* SR2 */
 
@@ -69,7 +69,7 @@
 
 /* OCS can only be written with OCDS enabled */
 
-#ifdef CONFIG_ARCH_CHIP_TC4XX
+#ifdef CONFIG_ARCH_CHIP_TC4X
 #  define TRICORE_CBS_OSTATE       0xfa18006c
 #else
 #  define TRICORE_CBS_OSTATE       0xf0000480
diff --git a/arch/tricore/src/tc4xx/Toolchain.defs 
b/arch/tricore/src/tc4xx/Toolchain.defs
index c7c5a5e5ac8..0f030aea288 100644
--- a/arch/tricore/src/tc4xx/Toolchain.defs
+++ b/arch/tricore/src/tc4xx/Toolchain.defs
@@ -20,7 +20,7 @@
 #
 ############################################################################
 
-ifeq ($(CONFIG_ARCH_CHIP_TC4XX),y)
+ifeq ($(CONFIG_ARCH_CHIP_TC4X),y)
   ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)
     ARCHCPUFLAGS += --misrac-version=2004 --user-mode=hypervisor
     ARCHCPUFLAGS += --default-near-size=0
diff --git a/boards/tricore/tc3xx/a2g-tc397-5v-tft/configs/nsh/defconfig 
b/boards/tricore/tc3xx/a2g-tc397-5v-tft/configs/nsh/defconfig
index 3d60fa5ef5f..9f7dd1e4137 100644
--- a/boards/tricore/tc3xx/a2g-tc397-5v-tft/configs/nsh/defconfig
+++ b/boards/tricore/tc3xx/a2g-tc397-5v-tft/configs/nsh/defconfig
@@ -11,7 +11,7 @@ CONFIG_ARCH_BOARD="a2g-tc397-5v-tft"
 CONFIG_ARCH_BOARD_A2G_TC397_5V_TFT=y
 CONFIG_ARCH_CHIP="tc3xx"
 CONFIG_ARCH_CHIP_TC39X=y
-CONFIG_ARCH_CHIP_TC3XX=y
+CONFIG_ARCH_CHIP_TC3X=y
 CONFIG_ARCH_INTERRUPTSTACK=2048
 CONFIG_ARCH_NUSER_INTERRUPTS=48
 CONFIG_ARCH_STACKDUMP=y
diff --git a/boards/tricore/tc4xx/triboard_tc4x9_com/configs/nsh/defconfig 
b/boards/tricore/tc4xx/triboard_tc4x9_com/configs/nsh/defconfig
index 4d82ca70f48..5dda49ae9c0 100644
--- a/boards/tricore/tc4xx/triboard_tc4x9_com/configs/nsh/defconfig
+++ b/boards/tricore/tc4xx/triboard_tc4x9_com/configs/nsh/defconfig
@@ -11,7 +11,7 @@ CONFIG_ARCH_BOARD="triboard_tc4x9_com"
 CONFIG_ARCH_BOARD_TRIBOARD_TC4X9_COM=y
 CONFIG_ARCH_CHIP="tc4xx"
 CONFIG_ARCH_CHIP_TC4DX=y
-CONFIG_ARCH_CHIP_TC4XX=y
+CONFIG_ARCH_CHIP_TC4X=y
 CONFIG_ARCH_INTERRUPTSTACK=2048
 CONFIG_ARCH_NUSER_INTERRUPTS=48
 CONFIG_ARCH_STACKDUMP=y

Reply via email to