Skip to content

arch/tricore: Start up TC3xx and TC4xx without the iLLD (5/n) - #21546

Merged
xiaoxiang781216 merged 7 commits into
apache:masterfrom
linumiz:native-2.6-start
Nov 19, 2026
Merged

xiaoxiang781216 merged 7 commits into
apache:masterfrom
linumiz:native-2.6-start

Conversation

@ssekar15

@ssekar15 ssekar15 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

TriCore still starts from the Infineon iLLD startup code and links with the
iLLD example linker scripts. This PR replaces both with native code: a
common assembly head in the style of arm_head.S (GNU and TASKING) that sets
up the core, the CSAs and the RAMs, copies .data and clears .bss, followed
by a common C entry that starts the other cores and enters NuttX. Each
board gets a simple CPU0 tricore.ld and tricore.lsl.

Dependency

None. The watchdog and clock setup of #21519 is merged.

Impact

TriCore only. The iLLD startup and linker scripts are no longer used. The
clocks are now set up after every reset, and the iLLD key-off check after
an application reset is gone. The new scripts describe a CPU0 image, as the
defconfigs build; images for the other cores (CONFIG_CPU_COREID) need
per-core memory maps in a later change.

Testing

I confirm that changes are verified on local setup and works as intended:

  • Build Host(s): Linux x86_64, Debian GNU/Linux 12 (bookworm)
  • Toolchains: AURIX GCC 11.3.1 (tricore-elf-gcc), TASKING VX-toolset v6.4r1
    (TC3x), TASKING SmartCode v10.4r1 (TC4x)
  • Build systems: make, cmake (Ninja)
  • Target(s): a2g-tc397-5v-tft:nsh, triboard_tc4x9_com:nsh
  • Hardware: TriBoard TC397 V2.0; TriBoard TC4x7 COM V3.0 for the
    triboard_tc4x9_com image
  • Each commit passes tools/checkpatch.sh and builds both boards with GCC
    and TASKING.

Build results:

Board GCC make GCC cmake TASKING make TASKING cmake
a2g-tc397-5v-tft:nsh pass pass pass pass
triboard_tc4x9_com:nsh pass pass pass pass

Runtime, ostest:

Board GCC TASKING
TriBoard TC397 (a2g-tc397-5v-tft:nsh) pass boots to nsh
TriBoard TC4x7 (triboard_tc4x9_com:nsh) pass boots to nsh
nsh> uname -a
NuttX 10.4.0 3dab2cc4bd4 Nov 17 2026 12:18:44 tricore triboard_tc4x9_com
nsh> ostest
...
ostest_main: Exiting with status 0

The DSPR and DLMU clear before the CSA list, which the default UCB
skips, was also forced in a test build on the TriBoard TC4x7: it boots
without a watchdog reset and ostest passes.

@github-actions github-actions Bot added Arch: tricore Issues related to the TriCore architecture from Infineon Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: tricore labels Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

Comment thread arch/tricore/src/aurix/Make.defs Resolved
Comment thread arch/tricore/src/common/tricore_irq.c Resolved
Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
@ssekar15 ssekar15 changed the title arch/tricore: Start up TC3xx and TC4xx without the iLLD (6/n) arch/tricore: Start up TC3xx and TC4xx without the iLLD (5/n) Nov 10, 2026
@github-actions github-actions Bot added the Area: OS Components OS Components issues label Nov 10, 2026
@ssekar15

Copy link
Copy Markdown
Contributor Author

now start up is on top of #21518 and #21519

Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
@ssekar15
ssekar15 force-pushed the native-2.6-start branch 3 times, most recently from 50ceb1b to 1397725 Compare November 13, 2026 03:46
@ssekar15

Copy link
Copy Markdown
Contributor Author

@acassis @GUIDINGLI @xiaoxiang781216 @casaroli please review

acassis
acassis previously approved these changes Nov 13, 2026
Comment thread arch/tricore/src/common/tricore_main.c Resolved
Comment thread arch/tricore/src/tc3xx/tc3xx_start.c Resolved
Comment thread arch/tricore/src/tc3xx/tc3xx_start.c Resolved
Comment thread arch/tricore/src/tc3xx/tc3xx_wdt.c Resolved
Comment thread arch/tricore/src/tc4xx/tc4xx_start.c Resolved
@ssekar15

Copy link
Copy Markdown
Contributor Author

@zhangyu-duck please advice whether huge chunk of single PR which remove iLLD code completely and native startup sequence in assembly or little step by step removal?

Comment thread arch/tricore/src/cmake/tasking.cmake Resolved
@ssekar15

Copy link
Copy Markdown
Contributor Author

I will handle any further adjustments later.

Review is to address the changes needed, doesn't make sense to merge now and rework again e.g #21951

The linker script includes a user script for "protect mode"—doesn't that need to be modified?

Never tested or enabled user mode, I will check

The BIST (Built-In Self-Test) in the startup code appears to be written in C; since it functions as a driver, it shouldn't be placed inside head.asm.

It is one time initialization sequence and calling C functions needs CSAs and a stack, and the DSPR can't be cleared once the CSAs live there or again setting CSA list is redundant.

It seems unnecessary to have both main and start. can we merge them?

yes which one to stay main or start?

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@ssekar15 could you split the unrelated change to separated pr? some patches need more discuss to pass the review which will block other simple patch get merged.

@zhangyu981027

Copy link
Copy Markdown
Contributor

I will handle any further adjustments later.

Review is to address the changes needed, doesn't make sense to merge now and rework again e.g #21951

The linker script includes a user script for "protect mode"—doesn't that need to be modified?

Never tested or enabled user mode, I will check

The BIST (Built-In Self-Test) in the startup code appears to be written in C; since it functions as a driver, it shouldn't be placed inside head.asm.

It is one time initialization sequence and calling C functions needs CSAs and a stack, and the DSPR can't be cleared once the CSAs live there or again setting CSA list is redundant.

It seems unnecessary to have both main and start. can we merge them?

yes which one to stay main or start?

Please refer to the implementation by illd; it also included MBIST for the DSPR. Also, since this is a driver, I strongly recommend using the C programming language.

@ssekar15

Copy link
Copy Markdown
Contributor Author

@ssekar15 could you split the unrelated change to separated pr? some patches need more discuss to pass the review which will block other simple patch get merged.

Sorry I don't understand, initially this PR was small then @zhangyu-duck gave comments and becomes huge to accommodate all. I asked the same 5days before, now again and again rework due to conflict of comments between reviewer is painful
#21546 (comment)

@zhangyu981027

Copy link
Copy Markdown
Contributor

@ssekar15 could you split the unrelated change to separated pr? some patches need more discuss to pass the review which will block other simple patch get merged.

Sorry I don't understand, initially this PR was small then @zhangyu-duck gave comments and becomes huge to accommodate all. I asked the same 5days before, now again and again rework due to conflict of comments between reviewer is painful #21546 (comment)

I don’t understand the logic behind how my comment could cause your PR to grow in size.??

@ssekar15

Copy link
Copy Markdown
Contributor Author

Please refer to the implementation by illd; it also included MBIST for the DSPR. Also, since this is a driver, I strongly recommend using the C programming language.

As single point of caller only in initial stage, I would recommend in assembly. iLLD doesn't have assembly so it can not be taken as reference, any blocking reason to be in C?

@xiaoxiang781216

xiaoxiang781216 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Please refer to the implementation by illd; it also included MBIST for the DSPR. Also, since this is a driver, I strongly recommend using the C programming language.

As single point of caller only in initial stage, I would recommend in assembly. iLLD doesn't have assembly so it can not be taken as reference, any blocking reason to be in C?

if it can be done in c, why write the assembly? assembly isn't portable at least we need write two version for gcc/tasking and even more later if more compiler is supported.
so, we should try our best to avoid assembly code except the performance critical code path or arch specific code which can't write by c(e.g. interrupt/boot).

@ssekar15

Copy link
Copy Markdown
Contributor Author

@ssekar15 could you split the unrelated change to separated pr? some patches need more discuss to pass the review which will block other simple patch get merged.

Sorry I don't understand, initially this PR was small then @zhangyu-duck gave comments and becomes huge to accommodate all. I asked the same 5days before, now again and again rework due to conflict of comments between reviewer is painful #21546 (comment)

I don’t understand the logic behind how my comment could cause your PR to grow in size.??

I meant the review request leads to added more changes. Lets come to alignment of below to satisfy this PR to be merged.
#21546 (comment)

agree?

@zhangyu981027

Copy link
Copy Markdown
Contributor

@ssekar15 could you split the unrelated change to separated pr? some patches need more discuss to pass the review which will block other simple patch get merged.

Sorry I don't understand, initially this PR was small then @zhangyu-duck gave comments and becomes huge to accommodate all. I asked the same 5days before, now again and again rework due to conflict of comments between reviewer is painful #21546 (comment)

I don’t understand the logic behind how my comment could cause your PR to grow in size.??

I meant the review request leads to added more changes. Lets come to alignment of below to satisfy this PR to be merged. #21546 (comment)

agree?

Let’s tentatively identify a few core points of divergence so that we can move forward:

  1. First, I consider sp, btv, and biv to be assembly-level constructs, which are tightly coupled to the underlying architecture.
  2. For drivers—such as those for BIST—it is preferable to use C.

what about this, my previous comments have adhered to these two points; do have any questions about this?

@ssekar15

Copy link
Copy Markdown
Contributor Author

@ssekar15 could you split the unrelated change to separated pr? some patches need more discuss to pass the review which will block other simple patch get merged.

Sorry I don't understand, initially this PR was small then @zhangyu-duck gave comments and becomes huge to accommodate all. I asked the same 5days before, now again and again rework due to conflict of comments between reviewer is painful #21546 (comment)

I don’t understand the logic behind how my comment could cause your PR to grow in size.??

I meant the review request leads to added more changes. Lets come to alignment of below to satisfy this PR to be merged. #21546 (comment)
agree?

Let’s tentatively identify a few core points of divergence so that we can move forward:

  1. First, I consider sp, btv, and biv to be assembly-level constructs, which are tightly coupled to the underlying architecture.
  2. For drivers—such as those for BIST—it is preferable to use C.

what about this, my previous comments have adhered to these two points; do have any questions about this?

Alright I'm changing now.

parthitce and others added 5 commits November 18, 2026 13:13
Replace the iLLD startup (Ifx_Ssw_Tc0.c, Ifx_Ssw_Infra.c, Ifx_Cfg_Ssw.c)
with a native one in the structure of arm_head.S.  tricore_head sets up
the vectors, the interrupt stack, the caches and the CSA list under the
CPU ENDINIT, disables the watchdogs, copies .data, clears .bss and sets
up the clocks.  The common tricore_start then releases the other cores
and enters NuttX through tricore_main.  The iLLD scripts give the
symbols that the native startup uses.

Co-authored-by: Saravanan Sekar <saravanan@linumiz.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Use the native startup of TC3xx on TC4xx.  tricore_head first disables
the virtualization on the boot stack and CSA in the PSPR, then links the
boot CSAs there and calls tricore_wdt_disable and tricore_ram_init
before the CSA list in the DSPR.  tricore_ram_init clears the DSPR and
DLMU of CPU0 with their SSH, unless UCB0_RAMINIT has the boot firmware
initialize them, and the LMU and MCAN RAMs, which the boot firmware
never initializes.  The iLLD key-off check, the watchdog reload values
and the core0_main to core6_main entries of the iLLD per core startup
go.

Co-authored-by: Parthiban Nallathambi <parthiban@linumiz.com>
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The TASKING build still compiles the iLLD CompilerTasking.c, whose
Ifx_C_Init calls _c_init, the copy table init of the locator, and takes
cinit.o out of the toolchain C library for it.  Only the iLLD startup
called Ifx_C_Init, and tricore_head now copies .data and clears .bss
itself.  Drop CompilerTasking.c and cinit.o, build the replacement
libc_fpu.a from tricore_libc.c alone, and link with
--user-provided-initialization-code, so that the locator emits no copy
table.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The iLLD example scripts map all six cores and place sections that NuttX
does not use.  Replace them with tricore.ld, a CPU0 map with the vectors
at the same addresses, the CSA and the stacks at the top of the DSPR and
the symbols of the native startup.

The CMake side of the script selection is in src/CMakeLists.txt, which
changes with it [skip-cmake-parity].

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Replace the iLLD Lcf_Tasking_Tricore_Tc.lsl.kernel scripts with
tricore.lsl, the same CPU0 map and symbols as tricore.ld.  The single
core is tc0, so drop --lsl-core=vtc and link the cmake build for
mpe:tc0; the protected build .user scripts name their core tc0 too.

The CMake side of the script selection is in src/CMakeLists.txt, which
changes with it [skip-cmake-parity].

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
@ssekar15

Copy link
Copy Markdown
Contributor Author

@zhangyu-duck anything missing to merge?

@ssekar15

Copy link
Copy Markdown
Contributor Author

@zhangyu981027 could you check anything missing to merge?

@ssekar15

Copy link
Copy Markdown
Contributor Author

adding @GUIDINGLI

@zhangyu981027

Copy link
Copy Markdown
Contributor

@zhangyu981027 could you check anything missing to merge?

ok, this works overall; I’ll make some further adjustments based on this.

@ssekar15
ssekar15 requested a review from acassis November 19, 2026 10:23
@ssekar15

Copy link
Copy Markdown
Contributor Author

@xiaoxiang781216 could you review and merge this

@zhangyu981027

Copy link
Copy Markdown
Contributor

@xiaoxiang781216 could you review and merge this

may i ask this pr #22047. Didn't we agree that we wouldn't submit our boot code—leaving that for you to submit instead—and that we would then submit the BMP after making our own modifications?

@ssekar15

Copy link
Copy Markdown
Contributor Author

@xiaoxiang781216 could you review and merge this

may i ask this pr #22047. Didn't we agree that we wouldn't submit our boot code—leaving that for you to submit instead—and that we would then submit the BMP after making our own modifications?

boot code and other our current split up of open PR are from our initial PR.
otherwise there is agreement, I think yesterday was the first time you mentioned about your BMP work.

@xiaoxiang781216
xiaoxiang781216 merged commit 26cf8bc into apache:master Nov 19, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: tricore Issues related to the TriCore architecture from Infineon Board: tricore Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants