Skip to content
Merged
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
24 changes: 6 additions & 18 deletions arch/tricore/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ config ARCH_FAMILY
default "tc1v8" if ARCH_TC1V8

config ARCH_CHIP_TC3XX
bool
bool "infineon aurix tc3xx"
select ARCH_TC1V6
select ARCH_HAVE_ADDRENV
select ARCH_HAVE_I2CRESET
Expand All @@ -69,7 +69,7 @@ config ARCH_CHIP_TC3XX
Infineon aurix tc3xx (six cores)

config ARCH_CHIP_TC4XX
bool
bool "infineon aurix tc4xx"
select ARCH_TC1V8
select ARCH_HAVE_ADDRENV
select ARCH_HAVE_FPU if !TRICORE_CSRM
Expand All @@ -83,18 +83,10 @@ config ARCH_CHIP_TC4XX
---help---
Infineon aurix tc4xx (six cores and one security core)

config ARCH_CHIP_TC397
bool "AURIX CHIP TC397"
select ARCH_CHIP_TC3XX

config ARCH_CHIP_TC4DA
bool "AURIX CHIP TC4DA"
select ARCH_CHIP_TC4XX

config ARCH_CHIP
string
default "tc397" if ARCH_CHIP_TC397
default "tc4da" if ARCH_CHIP_TC4DA
default "tc3xx" if ARCH_CHIP_TC3XX
default "tc4xx" if ARCH_CHIP_TC4XX

config ARCH_DCACHE_ADDR
hex "AURIX Dcache base address"
Expand Down Expand Up @@ -134,13 +126,9 @@ config CPU_COREID
if ARCH_CHIP_TC3XX
source "arch/tricore/src/tc3xx/Kconfig"
endif

if ARCH_CHIP_TC4XX
source "arch/tricore/src/tc4xx/Kconfig"
endif
if ARCH_CHIP_TC397
source "arch/tricore/src/tc397/Kconfig"
endif
if ARCH_CHIP_TC4DA
source "arch/tricore/src/tc4da/Kconfig"
endif

endif # ARCH_TRICORE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* arch/tricore/include/tc397/chip.h
* arch/tricore/include/tc3xx/chip.h
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -20,8 +20,8 @@
*
****************************************************************************/

#ifndef __ARCH_TRICORE_INCLUDE_TC397_CHIP_H
#define __ARCH_TRICORE_INCLUDE_TC397_CHIP_H
#ifndef __ARCH_TRICORE_INCLUDE_TC3XX_CHIP_H
#define __ARCH_TRICORE_INCLUDE_TC3XX_CHIP_H

/****************************************************************************
* Included Files
Expand All @@ -45,4 +45,4 @@
* Public Functions Prototypes
****************************************************************************/

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

#ifndef __ARCH_TRICORE_INCLUDE_TC397_IRQ_H
#define __ARCH_TRICORE_INCLUDE_TC397_IRQ_H
#ifndef __ARCH_TRICORE_INCLUDE_TC3XX_IRQ_H
#define __ARCH_TRICORE_INCLUDE_TC3XX_IRQ_H

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

#endif /* __ARCH_TRICORE_INCLUDE_TC397_IRQ_H */
#endif /* __ARCH_TRICORE_INCLUDE_TC3XX_IRQ_H */
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* arch/tricore/include/tc4da/chip.h
* arch/tricore/include/tc4xx/chip.h
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -20,8 +20,8 @@
*
****************************************************************************/

#ifndef __ARCH_TRICORE_INCLUDE_TC4DA_CHIP_H
#define __ARCH_TRICORE_INCLUDE_TC4DA_CHIP_H
#ifndef __ARCH_TRICORE_INCLUDE_TC4XX_CHIP_H
#define __ARCH_TRICORE_INCLUDE_TC4XX_CHIP_H

/****************************************************************************
* Included Files
Expand All @@ -45,4 +45,4 @@
* Public Functions Prototypes
****************************************************************************/

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

#ifndef __ARCH_TRICORE_INCLUDE_TC4DA_IRQ_H
#define __ARCH_TRICORE_INCLUDE_TC4DA_IRQ_H
#ifndef __ARCH_TRICORE_INCLUDE_TC4XX_IRQ_H
#define __ARCH_TRICORE_INCLUDE_TC4XX_IRQ_H

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

#endif /* __ARCH_TRICORE_INCLUDE_TC4DA_IRQ_H */
#endif /* __ARCH_TRICORE_INCLUDE_TC4XX_IRQ_H */
6 changes: 2 additions & 4 deletions arch/tricore/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
#
# ##############################################################################

add_subdirectory(${ARCH_SUBDIR})
add_subdirectory(${NUTTX_CHIP_ABS_DIR} exclude_chip EXCLUDE_FROM_ALL)
add_subdirectory(common)

# Include directories (before system ones) as PUBLIC so that it can be exposed
# to libboard
target_include_directories(arch BEFORE PUBLIC ${NUTTX_CHIP_ABS_DIR} common
${ARCH_SUBDIR})
target_include_directories(arch BEFORE PUBLIC ${NUTTX_CHIP_ABS_DIR} common)

if(NOT CONFIG_BUILD_FLAT)
target_include_directories(arch_interface BEFORE PUBLIC ${NUTTX_CHIP_ABS_DIR}
common ${ARCH_SUBDIR})
common)
endif()
10 changes: 0 additions & 10 deletions arch/tricore/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,10 @@ include $(TOPDIR)/Make.defs
include chip/Make.defs
include common/Make.defs

ifeq ($(CONFIG_ARCH_CHIP_TC3XX),y)
ARCH_SUBDIR = tc3xx
include $(ARCH_SUBDIR)/Make.defs
else ifeq ($(CONFIG_ARCH_CHIP_TC4XX),y)
ARCH_SUBDIR = tc4xx
include $(ARCH_SUBDIR)/Make.defs
endif

ARCH_SRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src

INCLUDES += ${INCDIR_PREFIX}$(ARCH_SRCDIR)$(DELIM)chip
INCLUDES += ${INCDIR_PREFIX}$(ARCH_SRCDIR)$(DELIM)common
INCLUDES += ${INCDIR_PREFIX}$(ARCH_SRCDIR)$(DELIM)$(ARCH_SUBDIR)
INCLUDES += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)sched

CPPFLAGS += $(INCLUDES)
Expand Down Expand Up @@ -133,7 +124,6 @@ endif

VPATH += chip
VPATH += common
VPATH += $(ARCH_SUBDIR)

all: $(HEAD_COBJ) $(BIN)

Expand Down
6 changes: 0 additions & 6 deletions arch/tricore/src/cmake/gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)

if(CONFIG_ARCH_CHIP_TC3XX)
set(ARCH_SUBDIR tc3xx)
elseif(CONFIG_ARCH_CHIP_TC4XX)
set(ARCH_SUBDIR tc4xx)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/chip.cmake)

set(TOOLCHAIN_PREFIX tricore-elf)
Expand Down
6 changes: 0 additions & 6 deletions arch/tricore/src/cmake/tasking.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)

if(CONFIG_ARCH_CHIP_TC3XX)
set(ARCH_SUBDIR tc3xx)
elseif(CONFIG_ARCH_CHIP_TC4XX)
set(ARCH_SUBDIR tc4xx)
endif()

include(chip.cmake)

set(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}cctc)
Expand Down
11 changes: 11 additions & 0 deletions arch/tricore/src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,14 @@ target_compile_options(nuttx PRIVATE ${IFXFLAGS})
target_include_directories(
nuttx SYSTEM PRIVATE ${NUTTX_DIR}/include ${NUTTX_BINARY_DIR}/include
${NUTTX_BINARY_DIR}/include_arch)

# 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).

if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
nuttx_add_kernel_library(c_fpu)
target_sources(c_fpu PRIVATE tricore_libc.c)
target_link_options(nuttx PRIVATE
--library-directory=${CMAKE_CURRENT_BINARY_DIR})
endif()
16 changes: 16 additions & 0 deletions arch/tricore/src/common/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,19 @@ endif

CFLAGS += -DIFX_CFG_EXTEND_TRAP_HOOKS
CFLAGS += -DIFX_USE_SW_MANAGED_INT

# 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).

ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)

tricore_libc$(OBJEXT): tricore_libc.c
$(call COMPILE, $<, $@)

libc_fpu$(LIBEXT): tricore_libc$(OBJEXT)
$(call ARCHIVE, $@, $<)

EXTRA_LIBS += libc_fpu$(LIBEXT)

endif
2 changes: 1 addition & 1 deletion arch/tricore/src/common/tricore_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ volatile bool g_interrupt_context[CONFIG_SMP_NCPUS];
void up_initialize(void)
{
#ifdef CONFIG_ARCH_PERF_EVENTS
up_perf_init((void *)IFX_CFG_CPU_CLOCK_FREQUENCY);
up_perf_init((void *)CONFIG_CPU_CLOCK_FREQUENCY);
#endif

tricore_trapinit();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* arch/tricore/src/tc4xx/tc4xx_libc.c
* arch/tricore/src/common/tricore_libc.c
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
3 changes: 0 additions & 3 deletions arch/tricore/src/tc397/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions arch/tricore/src/tc397/CMakeLists.txt

This file was deleted.

5 changes: 0 additions & 5 deletions arch/tricore/src/tc397/Kconfig

This file was deleted.

21 changes: 0 additions & 21 deletions arch/tricore/src/tc397/Make.defs

This file was deleted.

1 change: 0 additions & 1 deletion arch/tricore/src/tc3xx/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/*_unpack
/tc397
/*tar.gz
8 changes: 0 additions & 8 deletions arch/tricore/src/tc3xx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ set(SRCS tc3xx_timerisr.c tc3xx_serial.c)

target_sources(arch PRIVATE ${SRCS})

if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
nuttx_add_kernel_library(c_fpu)
target_sources(c_fpu PRIVATE tc3xx_libc.c)
target_link_options(
nuttx PRIVATE
--library-directory=${NUTTX_BINARY_DIR}/arch/tricore/src/exclude_chip)
endif()

set(ILLD_UNPACK "${CMAKE_CURRENT_SOURCE_DIR}/../illd/tc3xx")
set(ILLD_TARBALL "${ILLD_UNPACK}/illd.tar.gz")
set(ILLD_UNPACK_NAME "illd_release_tc3x-main")
Expand Down
13 changes: 13 additions & 0 deletions arch/tricore/src/tc3xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@
# see the file kconfig-language.txt in the NuttX tools repository.
#

choice
prompt "TC3XX Chip Selection"
default ARCH_CHIP_TC39X

config ARCH_CHIP_TC39X
bool "TC3XX TC39X"

endchoice

comment "TC3XX Configuration Options"

config CPU_CLOCK_FREQUENCY
int "CPU clock frequency (Hz)"
default 300000000

menu "TC3XX Peripheral Support"

# These are the peripheral selections proper
Expand Down
22 changes: 0 additions & 22 deletions arch/tricore/src/tc3xx/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,6 @@ CHIP_CSRCS += tc3xx_serial.c

VPATH += tc3xx

ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)

tc3xx_libc$(OBJEXT): tc3xx_libc.c
$(call COMPILE, $<, $@)

libc_fpu$(LIBEXT): tc3xx_libc$(OBJEXT)
$(call ARCHIVE, $@, $<)

EXTRA_LIBS += libc_fpu$(LIBEXT)

else

tc3xx_dummy$(OBJEXT): tc3xx_dummy.c
$(call COMPILE, $<, $@)

libos$(LIBEXT): tc3xx_dummy$(OBJEXT)
$(call ARCHIVE, $@, $<)

EXTRA_LIBS += libos$(LIBEXT)

endif

ILLD_UNPACK = illd/tc3xx
ILLD_TARBALL = $(ILLD_UNPACK)/illd.tar.gz
ILLD_UNPACK_NAME = illd_release_tc3x-main
Expand Down
Loading
Loading