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 4f8706c4b3511a82a7445012ae90718b1bdde230 Author: Saravanan Sekar <[email protected]> AuthorDate: Sat Nov 21 18:38:03 2026 +0530 boards/tricore: Add the a2g-tc375-lite board. Add the Infineon AURIX TC375 Lite Kit (KIT_A2G_TC375_LITE) with an nsh configuration. The board files follow the a2g-tc397-5v-tft board: the same CPU0 memory map of program flash and DSPR, which the TC375 has as well, and the console on ASCLIN0 at P14.0 and P14.1, which the on-board debugger provides as a USB serial port. Build it with CMake in the CI as the other TriCore boards. Signed-off-by: Saravanan Sekar <[email protected]> --- .../tricore/tc3x/boards/a2g-tc375-lite/index.rst | 39 ++++ Documentation/platforms/tricore/tc3x/index.rst | 1 + boards/Kconfig | 11 ++ boards/tricore/tc3x/a2g-tc375-lite/CMakeLists.txt | 23 +++ boards/tricore/tc3x/a2g-tc375-lite/Kconfig | 28 +++ .../tc3x/a2g-tc375-lite/configs/nsh/defconfig | 58 ++++++ boards/tricore/tc3x/a2g-tc375-lite/include/board.h | 40 ++++ .../tricore/tc3x/a2g-tc375-lite/scripts/Make.defs | 39 ++++ .../tricore/tc3x/a2g-tc375-lite/scripts/tricore.ld | 195 ++++++++++++++++++++ .../tc3x/a2g-tc375-lite/scripts/tricore.lsl | 201 +++++++++++++++++++++ .../tricore/tc3x/a2g-tc375-lite/src/CMakeLists.txt | 33 ++++ boards/tricore/tc3x/a2g-tc375-lite/src/Makefile | 28 +++ boards/tricore/tc3x/a2g-tc375-lite/src/tc375.h | 65 +++++++ .../tc3x/a2g-tc375-lite/src/tc375_boardinit.c | 55 ++++++ .../tc3x/a2g-tc375-lite/src/tc375_bringup.c | 83 +++++++++ tools/ci/testlist/tricore-01.dat | 1 + 16 files changed, 900 insertions(+) diff --git a/Documentation/platforms/tricore/tc3x/boards/a2g-tc375-lite/index.rst b/Documentation/platforms/tricore/tc3x/boards/a2g-tc375-lite/index.rst new file mode 100644 index 00000000000..e66a6cfa31b --- /dev/null +++ b/Documentation/platforms/tricore/tc3x/boards/a2g-tc375-lite/index.rst @@ -0,0 +1,39 @@ +================================================== +Infineon AURIX TC375 Lite Kit (KIT_A2G_TC375_LITE) +================================================== + +.. tags:: arch:tricore, chip:tc375, vendor:infineon + +The `KIT_A2G_TC375_LITE <https://www.infineon.com/evaluation-board/KIT-A2G-TC375-LITE>`__ is a low cost evaluation board of the +Infineon AURIX TC375 with an on-board debugger. The debugger also +provides a USB serial port, which is connected to ASCLIN0 (TX on P14.0, RX +on P14.1) and used as the NuttX console at 115200 baud. + +Toolchains +========== + +The AURIX GCC and the TASKING compiler are supported, with make and CMake. + +Configurations +============== + +Each configuration is maintained in a sub-directory and can be selected as +follows:: + + tools/configure.sh a2g-tc375-lite:<subdir> + +nsh +--- + +NuttShell with the ostest and hello examples:: + + tools/configure.sh a2g-tc375-lite:nsh + +Flashing +======== + +The image can be programmed with the Infineon AURIX OpenOCD and the board +configuration ``board/infineon/kit_a2g_tc375_lite.cfg``:: + + openocd -f board/infineon/kit_a2g_tc375_lite.cfg -c init -c "reset halt" \ + -c "program nuttx.hex verify" -c "reset run" -c shutdown diff --git a/Documentation/platforms/tricore/tc3x/index.rst b/Documentation/platforms/tricore/tc3x/index.rst index 840228bb58e..c62d11ec9dc 100644 --- a/Documentation/platforms/tricore/tc3x/index.rst +++ b/Documentation/platforms/tricore/tc3x/index.rst @@ -12,6 +12,7 @@ consists of the following features: This kernel with ostest have been tested with - Infineon's AURIX™ TC397 Evaluation Board: KIT_A2G_TC397_5V_TFT +- Infineon's AURIX™ TC375 Lite Kit: KIT_A2G_TC375_LITE Supported Boards ================ diff --git a/boards/Kconfig b/boards/Kconfig index 66f8df58482..494af75374e 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -2877,6 +2877,13 @@ config ARCH_BOARD_A2G_TC397_5V_TFT This options selects support for NuttX on the Infineon's AURIX board board featuring the TC397 6Quad CPU. +config ARCH_BOARD_A2G_TC375_LITE + bool "Infineon's AURIX TC375 board: KIT_A2G_TC375_LITE" + depends on ARCH_CHIP_TC375 + ---help--- + This options selects support for NuttX on the Infineon's AURIX board + board featuring the TC375 3-core CPU. + config ARCH_BOARD_TRIBOARD_TC4X9_COM bool "Infineon's AURIX TC4DA board: TRIBOARD_TC4X9_COM" depends on ARCH_CHIP_TC4DX @@ -4492,6 +4499,7 @@ config ARCH_BOARD default "sabre-6quad" if ARCH_BOARD_SABRE_6QUAD default "qemu-rh850-u2c" if ARCH_BOARD_QEMU_RH850_U2C default "a2g-tc397-5v-tft" if ARCH_BOARD_A2G_TC397_5V_TFT + default "a2g-tc375-lite" if ARCH_BOARD_A2G_TC375_LITE default "triboard_tc4x9_com" if ARCH_BOARD_TRIBOARD_TC4X9_COM default "qemu-armv7a" if ARCH_BOARD_QEMU_ARMV7A default "rtl8730e_evb" if ARCH_BOARD_RTL8730E_EVB @@ -4744,6 +4752,9 @@ endif if ARCH_BOARD_A2G_TC397_5V_TFT source "boards/tricore/tc3x/a2g-tc397-5v-tft/Kconfig" endif +if ARCH_BOARD_A2G_TC375_LITE +source "boards/tricore/tc3x/a2g-tc375-lite/Kconfig" +endif if ARCH_BOARD_MPS2_AN500 source "boards/arm/mps/mps2-an500/Kconfig" endif diff --git a/boards/tricore/tc3x/a2g-tc375-lite/CMakeLists.txt b/boards/tricore/tc3x/a2g-tc375-lite/CMakeLists.txt new file mode 100644 index 00000000000..dfad4de0a20 --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/CMakeLists.txt @@ -0,0 +1,23 @@ +# ############################################################################## +# boards/tricore/tc3x/a2g-tc375-lite/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +add_subdirectory(src) diff --git a/boards/tricore/tc3x/a2g-tc375-lite/Kconfig b/boards/tricore/tc3x/a2g-tc375-lite/Kconfig new file mode 100644 index 00000000000..f0791661890 --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/Kconfig @@ -0,0 +1,28 @@ +############################################################################ +# boards/tricore/tc3x/a2g-tc375-lite/Kconfig +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +if ARCH_BOARD_A2G_TC375_LITE +endif diff --git a/boards/tricore/tc3x/a2g-tc375-lite/configs/nsh/defconfig b/boards/tricore/tc3x/a2g-tc375-lite/configs/nsh/defconfig new file mode 100644 index 00000000000..5770b9dcb8c --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/configs/nsh/defconfig @@ -0,0 +1,58 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_NSH_CMDOPT_HEXDUMP is not set +CONFIG_ARCH="tricore" +CONFIG_ARCH_BOARD="a2g-tc375-lite" +CONFIG_ARCH_BOARD_A2G_TC375_LITE=y +CONFIG_ARCH_CHIP="tc3x" +CONFIG_ARCH_CHIP_TC375=y +CONFIG_ARCH_CHIP_TC3X=y +CONFIG_ARCH_INTERRUPTSTACK=2048 +CONFIG_ARCH_NUSER_INTERRUPTS=48 +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARCH_TRICORE=y +CONFIG_BOARD_LOOPSPERMSEC=99369 +CONFIG_BOOT_RUNFROMSDRAM=y +CONFIG_BUILTIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_EXAMPLES_HELLO=y +CONFIG_EXPERIMENTAL=y +CONFIG_FS_PROCFS=y +CONFIG_FS_TMPFS=y +CONFIG_HRTIMER=y +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_LIBC_MEMFD_ERROR=y +CONFIG_LIBM=y +CONFIG_NDEBUG=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_READLINE=y +CONFIG_PREALLOC_TIMERS=4 +CONFIG_RAM_SIZE=245760 +CONFIG_RAM_START=0x70000000 +CONFIG_READLINE_CMD_HISTORY=y +CONFIG_SCHED_EVENTS=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SCHED_WAITPID=y +CONFIG_SPINLOCK=y +CONFIG_STACK_COLORATION=y +CONFIG_START_MONTH=3 +CONFIG_START_YEAR=2016 +CONFIG_SYMTAB_ORDEREDBYNAME=y +CONFIG_SYSLOG_BUFFER=y +CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" +CONFIG_SYSLOG_INTBUFFER=y +CONFIG_SYSLOG_MAX_CHANNELS=2 +CONFIG_SYSTEM_NSH=y +CONFIG_TESTING_GETPRIME=y +CONFIG_TESTING_OSTEST=y +CONFIG_UART0_SERIAL_CONSOLE=y diff --git a/boards/tricore/tc3x/a2g-tc375-lite/include/board.h b/boards/tricore/tc3x/a2g-tc375-lite/include/board.h new file mode 100644 index 00000000000..2db11a3ebc7 --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/include/board.h @@ -0,0 +1,40 @@ +/**************************************************************************** + * boards/tricore/tc3x/a2g-tc375-lite/include/board.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __BOARDS_TRICORE_TC3X_A2G_TC375_LITE_INCLUDE_BOARD_H +#define __BOARDS_TRICORE_TC3X_A2G_TC375_LITE_INCLUDE_BOARD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions Definitions + ****************************************************************************/ + +#endif /* __BOARDS_TRICORE_TC3X_A2G_TC375_LITE_INCLUDE_BOARD_H */ diff --git a/boards/tricore/tc3x/a2g-tc375-lite/scripts/Make.defs b/boards/tricore/tc3x/a2g-tc375-lite/scripts/Make.defs new file mode 100644 index 00000000000..d502865ccf0 --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/scripts/Make.defs @@ -0,0 +1,39 @@ +############################################################################ +# boards/tricore/tc3x/a2g-tc375-lite/scripts/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk +include $(TOPDIR)/arch/tricore/src/tc3x/Toolchain.defs + +ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y) + ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)tricore.lsl +else + ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)tricore.ld +endif + + +CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) +CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) +CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) +CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) +AFLAGS := $(CFLAGS) -D__ASSEMBLY__ diff --git a/boards/tricore/tc3x/a2g-tc375-lite/scripts/tricore.ld b/boards/tricore/tc3x/a2g-tc375-lite/scripts/tricore.ld new file mode 100644 index 00000000000..0245a022635 --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/scripts/tricore.ld @@ -0,0 +1,195 @@ +/**************************************************************************** + * boards/tricore/tc3x/a2g-tc375-lite/scripts/tricore.ld + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#include <nuttx/config.h> + +OUTPUT_FORMAT("elf32-tricore") +OUTPUT_ARCH("tricore") +ENTRY(__start) + +/* CPU0 only: program flash bank A and the data scratchpad RAM of CPU0. + * The CSA, the interrupt stack and the idle stack are at the top of the + * data scratchpad RAM, the heap below them. + */ + +#define DSPR_ORIGIN 0x70000000 +#define DSPR_LENGTH 240K + +MEMORY +{ + pfls (rx!p) : ORIGIN = 0x80000000, LENGTH = 1536K + dspr (w!xp) : ORIGIN = DSPR_ORIGIN, LENGTH = DSPR_LENGTH +} + +REGION_ALIAS("DATA", dspr) + +__csa_size = 40K; +__istack_size = CONFIG_ARCH_INTERRUPTSTACK; +__ustack_size = CONFIG_IDLETHREAD_STACKSIZE; + +__csa_end = ORIGIN(dspr) + LENGTH(dspr); +__csa_begin = __csa_end - __csa_size; +__istack = __csa_begin; +__ustack = __istack - __istack_size; + +/* Boot stack of __start in the PSPR, as on TC4xx */ + +__psram_ustack = 0x7010eb00; + +/* The other cores start at the program flash of their own image */ + +PROVIDE(__start1 = 0x80300000); +PROVIDE(__start2 = 0x80600000); +PROVIDE(__start3 = 0x80900000); +PROVIDE(__start4 = 0x80c00000); +PROVIDE(__start5 = 0x80f00000); + +#ifdef CONFIG_ARCH_IRQPRIO +# define INTTAB_OFFSET 0x20 +#else +# define INTTAB_OFFSET 0x1fe0 +#endif + +SECTIONS +{ + /* Reset entry at +0, full BIV table at +0x20, single-entry BIV at + * +0x1fe0, trap table at +0x2000, and text at +0x2100. + */ + + .start ORIGIN(pfls) : + { + KEEP(*(.start)) + } > pfls + + .traptab ORIGIN(pfls) + 0x2000 : + { + __TRAPTAB_CPU0 = .; + KEEP(*(.traptab)) + } > pfls + + .intvec ORIGIN(pfls) + INTTAB_OFFSET : + { +#ifdef CONFIG_ARCH_IRQPRIO + __INTTAB_CPU0 = ORIGIN(pfls); +#else + __INTTAB_CPU0 = ORIGIN(pfls) + INTTAB_OFFSET; +#endif + KEEP(*(.inttab)) + } > pfls + + .text ORIGIN(pfls) + 0x2100 : + { + *(.text .text.*) + *(.gnu.linkonce.t.*) + . = ALIGN(8); + } > pfls + + .rodata : + { + *(.rodata .rodata.*) + *(.zrodata .zrodata.*) + *(.gnu.linkonce.r.*) + . = ALIGN(4); + } > pfls + + /* Small constants, addressed relative to A1 */ + + .srodata : + { + *(.srodata .srodata.*) + } > pfls + + __a1_mem = ADDR(.srodata) + 32K; + __a8_mem = __a1_mem; + + .ctors : + { + _sinit = ABSOLUTE(.); + KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) + KEEP(*(.init_array .ctors)) + _einit = ABSOLUTE(.); + . = ALIGN(8); + } > pfls + + .eh_frame : + { + KEEP(*(.eh_frame)) + } > pfls + + /* Initialized data, small data (A0) first, copied from flash at startup */ + + .data : + { + _sdata = ABSOLUTE(.); + *(.sdata .sdata.*) + *(.zdata .zdata.*) + *(.data .data.*) + *(.gnu.linkonce.d.*) + . = ALIGN(4); + _edata = ABSOLUTE(.); + } > DATA AT > pfls + + _data_flash = LOADADDR(.data); + + .bss (NOLOAD) : + { + _sbss = ABSOLUTE(.); + *(.sbss .sbss.*) + *(.zbss .zbss.*) + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(4); + _ebss = ABSOLUTE(.); + } > DATA + + __a0_mem = _sdata + 32K; + __a9_mem = __a0_mem; + + .heap (NOLOAD) : + { + . = ALIGN(8); + _sheap = ABSOLUTE(.); + } > dspr + + _eheap = __ustack - __ustack_size; + + .ustack __ustack - __ustack_size (NOLOAD) : + { + . += __ustack_size; + } > dspr + + .istack __istack - __istack_size (NOLOAD) : + { + . += __istack_size; + } > dspr + + .csa __csa_begin (NOLOAD) : + { + . += __csa_size; + } > dspr + + /DISCARD/ : + { + *(.comment) + } +} diff --git a/boards/tricore/tc3x/a2g-tc375-lite/scripts/tricore.lsl b/boards/tricore/tc3x/a2g-tc375-lite/scripts/tricore.lsl new file mode 100644 index 00000000000..cb519e04bb7 --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/scripts/tricore.lsl @@ -0,0 +1,201 @@ +/**************************************************************************** + * boards/tricore/tc3x/a2g-tc375-lite/scripts/tricore.lsl + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#include <nuttx/config.h> + +#include "tc1v1_6_2.lsl" + +/* The memory map of tricore.ld for the TASKING locator. + * CPU0 only: program flash bank A and the data scratchpad RAM of CPU0. + * The CSA, the interrupt stack and the idle stack are at the top of the + * data scratchpad RAM, the heap below them. + */ + +#define PFLS_BASE 0x80000000 +#define PFLS_SIZE 1536k + +#define DSPR_BASE 0x70000000 +#define DSPR_SIZE 240k + +#define CSA_SIZE 40k +#define ISTACK_SIZE CONFIG_ARCH_INTERRUPTSTACK +#define USTACK_SIZE CONFIG_IDLETHREAD_STACKSIZE + +#define CSA0_END (DSPR_BASE + DSPR_SIZE) +#define CSA0 (CSA0_END - CSA_SIZE) +#define ISTACK0 CSA0 +#define ISTACK0_END (ISTACK0 - ISTACK_SIZE) +#define USTACK0 ISTACK0_END +#define USTACK0_END (USTACK0 - USTACK_SIZE) + +#ifdef CONFIG_ARCH_IRQPRIO +# define INTTAB_OFFSET 0x20 +#else +# define INTTAB_OFFSET 0x1fe0 +#endif + +derivative nuttx_tc3x +{ + core tc0 + { + architecture = TC1V1.6.2; + } + + memory pfls + { + mau = 8; + type = rom; + size = PFLS_SIZE; + map (dest = bus:tc0:fpi_bus, dest_offset = PFLS_BASE, size = PFLS_SIZE); + } + + memory dspr + { + mau = 8; + type = ram; + size = DSPR_SIZE; + map (dest = bus:tc0:fpi_bus, dest_offset = DSPR_BASE, size = DSPR_SIZE); + } +} + +processor mpe +{ + derivative = nuttx_tc3x; +} + +section_setup mpe:tc0:linear +{ + start_address (symbol = "__start"); + + /* The startup code initializes .data and .bss itself, the copy table + * only has to exist for the locator. + */ + + copytable (align = 4, dest = linear); +} + +section_layout mpe:tc0:linear +{ + /* Reset entry at +0, full BIV table at +0x20, single-entry BIV at + * +0x1fe0, trap table at +0x2000, and text at +0x2100. + */ + + group start (ordered, run_addr = PFLS_BASE) + { + select ".text.start"; + } + + group traptab (ordered, run_addr = PFLS_BASE + 0x2000) + { + select ".text.traptab"; + } + + group intvec (ordered, run_addr = PFLS_BASE + INTTAB_OFFSET) + { + select ".text.inttab"; + } + + group text (ordered, run_addr = PFLS_BASE + 0x2100) + { + select ".text*"; + select ".rodata*"; + } + + /* Small data and constants, addressed relative to A0, A1, A8 and A9 */ + +#include "base_address_groups.lsl" + + /* .data and .bss at the start of the data scratchpad RAM, the heap + * from there to the idle stack + */ + + group dspr_area (ordered, contiguous, run_addr = DSPR_BASE) + { + group data (ordered, contiguous, align = 4, attributes = rwu) + { + select ".data*"; + } + + group bss (ordered, contiguous, align = 4, attributes = rwu) + { + select ".bss*"; + } + } + + /* The startup code copies .data as one block from flash, so its ROM + * copies are selected by name to get the same order as in RAM. + */ + + group data_rom (ordered, contiguous, align = 4, load_addr) + { + select ".data*"; + } + + group ustack_area (ordered, run_addr = USTACK0_END) + { + reserved "ustack" (size = USTACK_SIZE); + } + + group istack_area (ordered, run_addr = ISTACK0_END) + { + reserved "istack" (size = ISTACK_SIZE); + } + + group csa_area (ordered, run_addr = CSA0) + { + reserved "csa" (size = CSA_SIZE); + } + + "__TRAPTAB_CPU0" := PFLS_BASE + 0x2000; +#ifdef CONFIG_ARCH_IRQPRIO + "__INTTAB_CPU0" := PFLS_BASE; +#else + "__INTTAB_CPU0" := PFLS_BASE + INTTAB_OFFSET; +#endif + + "__a0_mem" := sizeof(group:a0) > 0 ? addressof(group:a0) + 0x8000 : 0; + "__a1_mem" := sizeof(group:a1) > 0 ? addressof(group:a1) + 0x8000 : 0; + "__a8_mem" := sizeof(group:a8) > 0 ? addressof(group:a8) + 0x8000 : 0; + "__a9_mem" := sizeof(group:a9) > 0 ? addressof(group:a9) + 0x8000 : 0; + + "_sdata" = "_lc_gb_data"; + "_edata" = "_lc_ge_data"; + "_data_flash" = "_lc_gb_data_rom"; + "_sbss" = "_lc_gb_bss"; + "_ebss" = "_lc_ge_bss"; + "_sheap" := addressof(group:bss) + sizeof(group:bss); + "_eheap" := USTACK0_END; + "__ustack" := USTACK0; + "__istack" := ISTACK0; + "__csa_begin" := CSA0; + "__csa_end" := CSA0_END; + + /* The other cores start at the program flash of their own image */ + + "__psram_ustack" := 0x7010eb00; + + "__start1" := 0x80300000; + "__start2" := 0x80600000; + "__start3" := 0x80900000; + "__start4" := 0x80c00000; + "__start5" := 0x80f00000; +} diff --git a/boards/tricore/tc3x/a2g-tc375-lite/src/CMakeLists.txt b/boards/tricore/tc3x/a2g-tc375-lite/src/CMakeLists.txt new file mode 100644 index 00000000000..e0f97d3a303 --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/src/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# boards/tricore/tc3x/a2g-tc375-lite/src/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +set(SRCS tc375_boardinit.c tc375_bringup.c) + +target_sources(board PRIVATE ${SRCS}) + +if(CONFIG_TRICORE_TOOLCHAIN_TASKING) + set_property(GLOBAL PROPERTY LD_SCRIPT + "${NUTTX_BOARD_DIR}/scripts/tricore.lsl") +else() + set_property(GLOBAL PROPERTY LD_SCRIPT + "${NUTTX_BOARD_DIR}/scripts/tricore.ld") +endif() diff --git a/boards/tricore/tc3x/a2g-tc375-lite/src/Makefile b/boards/tricore/tc3x/a2g-tc375-lite/src/Makefile new file mode 100644 index 00000000000..51d90510fae --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/src/Makefile @@ -0,0 +1,28 @@ +############################################################################ +# boards/tricore/tc3x/a2g-tc375-lite/src/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(TOPDIR)/Make.defs + +CSRCS = tc375_boardinit.c tc375_bringup.c + + +include $(TOPDIR)/boards/Board.mk diff --git a/boards/tricore/tc3x/a2g-tc375-lite/src/tc375.h b/boards/tricore/tc3x/a2g-tc375-lite/src/tc375.h new file mode 100644 index 00000000000..3d53a995bb4 --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/src/tc375.h @@ -0,0 +1,65 @@ +/**************************************************************************** + * boards/tricore/tc3x/a2g-tc375-lite/src/tc375.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __BOARDS_TRICORE_TC3X_A2G_TC375_LITE_SRC_TC375_H +#define __BOARDS_TRICORE_TC3X_A2G_TC375_LITE_SRC_TC375_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <stdint.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Public Functions Definitions + ****************************************************************************/ + +/**************************************************************************** + * Name: tc375_bringup + * + * Description: + * Bring up board features + * + ****************************************************************************/ + +#if defined(CONFIG_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE) +int tc375_bringup(void); +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __BOARDS_TRICORE_TC3X_A2G_TC375_LITE_SRC_TC375_H */ diff --git a/boards/tricore/tc3x/a2g-tc375-lite/src/tc375_boardinit.c b/boards/tricore/tc3x/a2g-tc375-lite/src/tc375_boardinit.c new file mode 100644 index 00000000000..4c23fe85ecb --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/src/tc375_boardinit.c @@ -0,0 +1,55 @@ +/**************************************************************************** + * boards/tricore/tc3x/a2g-tc375-lite/src/tc375_boardinit.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <nuttx/board.h> +#include <arch/board/board.h> + +#include "tc375.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_late_initialize + * + * Description: + * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional + * initialization call will be performed in the boot-up sequence to a + * function called board_late_initialize. board_late_initialize will be + * called after up_initialize and just before the initial application is + * started, to initialize the board-specific device drivers. + * + ****************************************************************************/ + +#ifdef CONFIG_BOARD_LATE_INITIALIZE +void board_late_initialize(void) +{ + tc375_bringup(); +} +#endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/tricore/tc3x/a2g-tc375-lite/src/tc375_bringup.c b/boards/tricore/tc3x/a2g-tc375-lite/src/tc375_bringup.c new file mode 100644 index 00000000000..8dfcdab323d --- /dev/null +++ b/boards/tricore/tc3x/a2g-tc375-lite/src/tc375_bringup.c @@ -0,0 +1,83 @@ +/**************************************************************************** + * boards/tricore/tc3x/a2g-tc375-lite/src/tc375_bringup.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <sys/types.h> +#include <syslog.h> + +#include <nuttx/fs/fs.h> + +#include "tricore_internal.h" +#include "tc375.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +#ifdef CONFIG_ARCH_USE_MPU +void tricore_mpuinit(void) +{ + /* TODO: Initialize the MPU. */ +} +#endif + +/**************************************************************************** + * Name: tc375_bringup + * + * Description: + * Bring up board features + * + ****************************************************************************/ + +int tc375_bringup(void) +{ + int ret; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = nx_mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); + } +#endif + +#ifdef CONFIG_FS_TMPFS + /* Mount the tmpfs file system */ + + ret = nx_mount(NULL, CONFIG_LIBC_TMPDIR, "tmpfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount tmpfs at %s: %d\n", + CONFIG_LIBC_TMPDIR, ret); + } +#endif + + UNUSED(ret); + return OK; +} diff --git a/tools/ci/testlist/tricore-01.dat b/tools/ci/testlist/tricore-01.dat index db17532944e..ee6bff92d2d 100644 --- a/tools/ci/testlist/tricore-01.dat +++ b/tools/ci/testlist/tricore-01.dat @@ -3,3 +3,4 @@ # TriCore boards build by CMake CMake,a2g-tc397-5v-tft:nsh CMake,triboard_tc4x9_com:nsh +CMake,a2g-tc375-lite:nsh
