Repository navigation
arch/tricore: Start up TC3xx and TC4xx without the iLLD (5/n) - #21546
Conversation
|
4eecee8 to
59f7513
Compare
59f7513 to
cae6cfb
Compare
50ceb1b to
1397725
Compare
|
@acassis @GUIDINGLI @xiaoxiang781216 @casaroli please review |
1397725 to
e8e43e0
Compare
|
@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? |
Review is to address the changes needed, doesn't make sense to merge now and rework again e.g #21951
Never tested or enabled user mode, I will check
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.
yes which one to stay main or start? |
|
@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. |
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. |
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 |
I don’t understand the logic behind how my comment could cause your PR to grow in size.?? |
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. |
I meant the review request leads to added more changes. Lets come to alignment of below to satisfy this PR to be merged. agree? |
Let’s tentatively identify a few core points of divergence so that we can move forward:
what about this, my previous comments have adhered to these two points; do have any questions about this? |
Alright I'm changing now. |
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>
8c47948 to
2d6bebf
Compare
|
@zhangyu-duck anything missing to merge? |
|
@zhangyu981027 could you check anything missing to merge? |
|
adding @GUIDINGLI |
ok, this works overall; I’ll make some further adjustments based on this. |
|
@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. |
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:
(TC3x), TASKING SmartCode v10.4r1 (TC4x)
triboard_tc4x9_com image
and TASKING.
Build results:
Runtime, ostest:
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.