Repository navigation
arch/tricore: Native interrupt vector and interrupt router access (2/n) - #21504
Conversation
ccfe9e6 to
d8c82f5
Compare
d8c82f5 to
1366309
Compare
TRICORE_SRC2IRQ takes the SRC base from the iLLD MODULE_SRC, and the interrupt code reaches the service request control (SRC) registers only through IfxSrc. Add the SRC base addresses and bit fields of TC3xx and TC4xx, which differ, as checked against the TC39xB and TC4Dx iLLD headers, and use the SRC base in TRICORE_SRC2IRQ. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
1366309 to
9beaa8e
Compare
|
@xiaoxiang781216 please review |
|
9beaa8e to
ceac065
Compare
@ssekar15 please look my comment first |
Can we reach a consensus: you submit the interrupt/trap-related code based on our comment, while I provide the boot-related code? For instance, you take my interrupt/trap PR and make necessary modifications; likewise, you are welcome to offer your feedback on our boot implementation. |
We already reached in fair consensus, We are just claiming allow us to complete what we started (not claiming the duplication effort or Co-authored-by for the past completed PR), hope we already reached to fair point and now all my request is please stick with the agreement.
code review is one of maintainer duty in open source I guess.
boot implementation were also part of our initial commit, if you think there is room for improvement please review (we are always happy to take healthier review comments) or allow our PR merge and you can open improvements later. |
ceac065 to
6bd8980
Compare
I am waiting you address the comment from @zhangyu-duck @zyfeier since they are more expert on tricore arch than me. |
tricore_irq.c programs the SRC registers through IfxSrc and IfxCpu. Write them directly with the new SRC definitions instead, so the file no longer needs the iLLD, and drop the TC4xx SRC name aliases that only it used. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The interrupt vector comes from the iLLD IFX_INTERRUPT_INTERNAL macro, which on GCC also makes tricore_doirq an interrupt_handler, and on TASKING from the compiler __interrupt and __vector_table keywords. Add a native vector next to the trap vectors, which saves the lower context and enters tricore_doirq with jli, and make tricore_doirq a plain function that returns with ji. An image runs on a single core, so one vector section is enough, and the linker scripts place it at INTTAB + 0x1FE0 as they did the iLLD one. Co-authored-by: Parthiban Nallathambi <parthiban@linumiz.com> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Nothing calls the IfxSrc functions any more, since the interrupt code programs the SRC registers itself, so drop IfxSrc.c from the TC3xx and TC4xx builds. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
tricore_svcall, tricore_trapcall and tricore_doirq are entered from the vectors with jli and return with ji a11, and each spells that out with the same TASKING and GCC variants. Add tricore_jump_backto_link to arch/arch.h and use it in all three. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
6bd8980 to
0562f23
Compare
casaroli
left a comment
There was a problem hiding this comment.
The PR body still describes the per-core vectors: "a native one per core" and "core (.intvec_cpuN)", but the vector is now one .intvec section. The build table and "The interrupt vector is at 0x80001fe0 in all four images." come from before that change.
Fix: update the Summary and Impact to the single .intvec section, and give the build and boot result of this head (0562f23).
|
@zhangyu-duck @casaroli @xiaoxiang781216 thank you for your time to review :) . |
Summary
The TriCore interrupt path depends on the Infineon iLLD. The interrupt
vector comes from the iLLD IFX_INTERRUPT_INTERNAL macro on GCC and from
the compiler __interrupt/__vector_table keywords on TASKING, and both
build it for CPU0 only. tricore_irq.c programs the service request
control (SRC) registers through IfxSrc and IfxCpu, and TRICORE_SRC2IRQ
takes the SRC base from the iLLD MODULE_SRC.
This series adds the SRC register addresses and bit fields for TC3xx and
TC4xx, writes the SRC registers directly in tricore_irq.c, and replaces the
interrupt vector with a native one per core next to the trap vectors, in
GNU and TASKING assembly. tricore_doirq becomes a plain function entered
with jli. tricore_irq.c and tricore_doirq.c are now free of the iLLD, and
IfxSrc.c is no longer built.
Dependency
Depends on #21496.
Impact
TriCore only (arch/tricore and the TC397/TC4x9 linker scripts).
core (.intvec_cpuN); its address is unchanged (INTTAB + 0x1FE0).
SRC_CPU_CPU0_SB/SRC_GPSR00 alias defines are removed.
the same as before.
No Kconfig, board defconfig or documentation changes.
Testing
I confirm that changes are verified on local setup and works as intended:
(TC3x), TASKING SmartCode v10.4r1 (TC4x)
triboard_tc4x9_com image
interrupt macro in tricore_doirq.c (-Wstrict-prototypes) is gone.
Build results (tip):
The interrupt vector is at 0x80001fe0 in all four images.
Runtime, ostest:
ostest ran with the code of the vector commit (before it was committed,
hence -dirty); the tip, which only drops IfxSrc.c from the build, was boot
tested:
SRC registers read back from the boards after boot, before and after
this series (ASCLIN0 RX, STM, GPSR0 to GPSR5/6 SR0):
All values match, except that the STM SRC on TC4x7 showed a pending
request (SRR) at the moment it was read, which is timing, not setup.