Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions arch/tricore/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 "tc3x" if ARCH_CHIP_TC3X
default "tc4x" if ARCH_CHIP_TC4X

config ARCH_IRQ_DISABLE_PRIORITY
int "IRQ disable priority threshold"
Expand Down Expand Up @@ -159,7 +165,7 @@ config ARCH_HAVE_PPRS
config HAVE_SECURITY_CORE
bool
---help---
In addition to the 6 cores, tc4xx also has one more security core.
In addition to the 6 cores, tc4x also has one more security core.

config CPU_COREID
int "TRICORE CPU CORE ID"
Expand All @@ -174,12 +180,27 @@ 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
source "arch/tricore/src/tc3xx/Kconfig"
source "arch/tricore/src/common/aurix/Kconfig"

if SMP

config TRICORE_SMP_CSA_COUNT
int "CSA frames of each secondary CPU"
default 512
---help---
CPU1 and up build their pool of context save areas at the start
of their own data scratchpad RAM, followed by their interrupt
stack and their idle stack. CPU0 keeps the pool of the linker
script.

endif # SMP

if ARCH_CHIP_TC3X
source "arch/tricore/src/tc3x/Kconfig"
endif

if ARCH_CHIP_TC4XX
source "arch/tricore/src/tc4xx/Kconfig"
if ARCH_CHIP_TC4X
source "arch/tricore/src/tc4x/Kconfig"
endif

endif # ARCH_TRICORE
22 changes: 19 additions & 3 deletions arch/tricore/include/barriers.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,26 @@
#ifndef __ARCH_TRICORE_INCLUDE_BARRIERS_H
#define __ARCH_TRICORE_INCLUDE_BARRIERS_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

#define UP_DSB() __asm__ __volatile__ ("dsync" : : : "memory")
#define UP_DMB() __asm__ __volatile__ ("" : : : "memory")
#define UP_RMB() __asm__ __volatile__ ("" : : : "memory")
#define UP_WMB() __asm__ __volatile__ ("" : : : "memory")
#ifdef CONFIG_SMP
# define UP_DMB() __asm__ __volatile__ ("dsync" : : : "memory")
# define UP_RMB() __asm__ __volatile__ ("dsync" : : : "memory")
# define UP_WMB() __asm__ __volatile__ ("dsync" : : : "memory")
#else
# define UP_DMB() __asm__ __volatile__ ("" : : : "memory")
# define UP_RMB() __asm__ __volatile__ ("" : : : "memory")
# define UP_WMB() __asm__ __volatile__ ("" : : : "memory")
#endif
#define UP_ISB() __asm__ __volatile__ ("isync" : : : "memory")

#endif /* __ARCH_TRICORE_INCLUDE_BARRIERS_H */
Expand Down
2 changes: 1 addition & 1 deletion arch/tricore/include/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* arch/tricore/include/tc3xx/irq.h
* arch/tricore/include/tc3x/irq.h
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -24,8 +24,8 @@
* only indirectly through nuttx/irq.h
*/

#ifndef __ARCH_TRICORE_INCLUDE_TC3XX_IRQ_H
#define __ARCH_TRICORE_INCLUDE_TC3XX_IRQ_H
#ifndef __ARCH_TRICORE_INCLUDE_TC3X_IRQ_H
#define __ARCH_TRICORE_INCLUDE_TC3X_IRQ_H

/****************************************************************************
* Included Files
Expand Down Expand Up @@ -83,4 +83,4 @@ extern "C"
#endif
#endif

#endif /* __ARCH_TRICORE_INCLUDE_TC3XX_IRQ_H */
#endif /* __ARCH_TRICORE_INCLUDE_TC3X_IRQ_H */
48 changes: 0 additions & 48 deletions arch/tricore/include/tc3xx/chip.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* arch/tricore/include/tc4xx/irq.h
* arch/tricore/include/tc4x/irq.h
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -24,8 +24,8 @@
* only indirectly through nuttx/irq.h
*/

#ifndef __ARCH_TRICORE_INCLUDE_TC4XX_IRQ_H
#define __ARCH_TRICORE_INCLUDE_TC4XX_IRQ_H
#ifndef __ARCH_TRICORE_INCLUDE_TC4X_IRQ_H
#define __ARCH_TRICORE_INCLUDE_TC4X_IRQ_H

/****************************************************************************
* Included Files
Expand Down Expand Up @@ -85,4 +85,4 @@ extern "C"
#endif
#endif

#endif /* __ARCH_TRICORE_INCLUDE_TC4XX_IRQ_H */
#endif /* __ARCH_TRICORE_INCLUDE_TC4X_IRQ_H */
48 changes: 0 additions & 48 deletions arch/tricore/include/tc4xx/chip.h

This file was deleted.

4 changes: 2 additions & 2 deletions arch/tricore/src/cmake/chip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions arch/tricore/src/cmake/tasking.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions arch/tricore/src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ if(CONFIG_ARCH_HAVE_DEBUG)
list(APPEND SRCS tricore_hwdebug.c)
endif()

if(CONFIG_SMP)
list(APPEND SRCS tricore_cpustart.c)
endif()

target_sources(arch PRIVATE ${SRCS})
target_sources(nuttx PRIVATE tricore_doirq.c)

Expand Down
4 changes: 4 additions & 0 deletions arch/tricore/src/common/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ ifeq ($(CONFIG_ARCH_HAVE_DEBUG),y)
CMN_CSRCS += tricore_hwdebug.c
endif

ifeq ($(CONFIG_SMP),y)
CMN_CSRCS += tricore_cpustart.c
endif

# TASKING toolchain: build a fake libc_fpu.a to override the toolchain's
# default C library and provide stubs for the symbols the linker still
# references (see tricore_libc.c for details).
Expand Down
16 changes: 16 additions & 0 deletions arch/tricore/src/common/aurix/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

menu "AURIX Peripheral Support"

config TRICORE_UART0
bool "ASCLIN0 UART"
default y
select UART0_SERIALDRIVER
select ARCH_HAVE_SERIAL_TERMIOS
---help---
Use ASCLIN0 as UART0, on the P14.1 RX and P14.0 TX pins.

endmenu
8 changes: 4 additions & 4 deletions arch/tricore/src/common/aurix/tricore_asclin.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

#include <nuttx/config.h>

#if defined(CONFIG_ARCH_CHIP_TC3XX)
# include "hardware/tc3xx_asclin.h"
#elif defined(CONFIG_ARCH_CHIP_TC4XX)
# include "hardware/tc4xx_asclin.h"
#if defined(CONFIG_ARCH_CHIP_TC3X)
# include "hardware/tc3x_asclin.h"
#elif defined(CONFIG_ARCH_CHIP_TC4X)
# include "hardware/tc4x_asclin.h"
#endif

/****************************************************************************
Expand Down
Loading