Skip to content

{bp-19783} arch/tricore: drop iLLD dependency in cache and perf paths - #19829

Merged
xiaoxiang781216 merged 3 commits into
apache:releases/13.0from
jerpelea:bp-19783
Aug 13, 2026
Merged

{bp-19783} arch/tricore: drop iLLD dependency in cache and perf paths#19829
xiaoxiang781216 merged 3 commits into
apache:releases/13.0from
jerpelea:bp-19783

Conversation

@jerpelea

Copy link
Copy Markdown
Contributor

Summary

Remove the Infineon iLLD dependency from the arch/tricore cache and
performance-counter paths, replacing the iLLD intrinsics and register
structures with direct CSR (Core Special Function Register) accesses.

The series contains three commits, kept separate to match the internal
development history:

add tricore_mtcr and tricore_mfcr macros — introduce
tricore_mtcr() / tricore_mfcr() inline-assembly wrappers for the
MTCR/MFCR instructions in arch/arch.h, so arch/tricore code can access
CSRs without the iLLD intrinsics.
cachecode donot depend on illd — replace the iLLD register structures
(Ifx_CPU_PCON0/1/2, Ifx_CPU_DCON0/1/2) and IfxCpu_cfg.h cache macros
in tricore_cache.c with tricore_mtcr()/tricore_mfcr() plus locally
defined PCON/DCON CSR numbers and bit masks. barriers.h UP_ISB() /
UP_DSB() now emit the isync / dsync instructions directly instead of
the iLLD __isync() / __dsync() intrinsics.
perf.c donot depend on illd — replace IfxCpu_resetAndStartCounters()
and IfxCpu_getClockCounter() with direct CCTRL/CCNT CSR accesses.

The CSR register numbers previously pulled in from the iLLD IfxCpu_reg.h
are now defined locally in each file that needs them.

Impact

RELEASE

Testing

CI

Add tricore_mtcr()/tricore_mfcr() inline-assembly wrappers for the
MTCR/MFCR (move to/from Core Special Function Register) instructions.
These let arch/tricore code access CSRs directly without relying on the
Infineon iLLD intrinsics, and are used by the following iLLD-removal
change in the performance-counter path.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
Replace the iLLD register structures (Ifx_CPU_PCON0/1/2, Ifx_CPU_DCON0/1/2)
and the IfxCpu_cfg.h cache-size/line-size macros in the cache path with
direct CSR accesses via tricore_mtcr()/tricore_mfcr() and locally defined
PCON/DCON bit masks.  Also switch __isync()/__dsync() to the UP_ISB()/
UP_DSB() barrier wrappers.

This removes the arch/tricore cache path's dependency on the Infineon
iLLD layer.  No behavior change.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
Replace the iLLD helpers IfxCpu_resetAndStartCounters() and
IfxCpu_getClockCounter() in the performance-counter path with direct
CSR accesses via tricore_mtcr()/tricore_mfcr().

tricore_reset_ccnt() disables the CPU cycle counter (CPU_CCTRL), clears
CPU_CCNT, then re-enables it; up_perf_gettime() reads CPU_CCNT directly.
This removes the arch/tricore perf path's dependency on the Infineon
iLLD layer. No behavior change.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
@github-actions github-actions Bot added Arch: tricore Issues related to the TriCore architecture from Infineon Size: M The size of the change in this PR is medium labels Aug 13, 2026
@jerpelea

Copy link
Copy Markdown
Contributor Author

do not restart Ci until #19814 is merged

@xiaoxiang781216
xiaoxiang781216 merged commit 807f33e into apache:releases/13.0 Aug 13, 2026
7 of 13 checks passed
@jerpelea
jerpelea deleted the bp-19783 branch August 13, 2026 12:34
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 Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants