arch/arm/src/imxrt: Start the DWT cycle counter for perf events.

CONFIG_ARCH_PERF_EVENTS is on by default for ARMv7-M, but imxrt never
called up_perf_init(), so perf_gettime() read zero and anything timed
with it, rpmsg_ping for one, reported 0 ns.  Initialise the counter with
BOARD_CPU_FREQUENCY after the MPU is set up, as samv7 and stm32h7 do.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Lourens Naude <lourens@bearmetal.eu>
This commit is contained in:
Lourens Naude 2026-10-08 17:26:26 +01:00 • committed by Xiang Xiao
parent 879a19e153
commit 447ebd7fd5

View file

@ -282,6 +282,10 @@ void __start(void)
imxrt_mpu_initialize();
#endif
#ifdef CONFIG_ARCH_PERF_EVENTS
up_perf_init((void *)BOARD_CPU_FREQUENCY);
#endif
/* Enable I- and D-Caches */
up_enable_icache();