I am using ARMV8 processor. I am trying to read the Physical timer counter CNTPCT_EL0 (read system timer ticks) for the purpose of comparing timestamp between 2 instances in the code.
However when i read the register, it always reads '0'. When i opened the peripheral window in the Trace32 debugger, i saw that the the value in the CNTPCT_EL0 register is reading 00000000.
I have set the CNTFRQ_EL0 to 100000000
I think the clock to increment the counter is not provided. Is there a way to do it for the ARMv8 processor. I am using LS1046A ARM NXP processor for the same.
See the following pages about this timer:
https://discuss.96boards.org/t/how-to-read-the-system-timer/3847/4
https://github.com/qemu/u-boot/blob/master/arch/arm/cpu/armv8/generic_timer.c
https://lists.denx.de/pipermail/u-boot/2018-June/333000.html
https://git.tsaro.io/fkantere/linux-kernel/commit/985c0679dfa459a1deed31b999b26e4420786874
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I have the same question .
but linux-kernel patchhttps://git.tsaro.io/fkantere/linux-kernel/commit/985c0679dfa459a1deed31b999b26e4420786874 can not connect.
Thank you.
I got this issue sorted.
I set the Control register (CNTCR) of the System counter to 1. This enabled the clock to the ARM timer block.
One i did that, the CNTCP_EL0 started ticking.
Thanks for your links. It was useful in lot of aspects.