Hi ARM expert,
I am trying to use generic timer, but seems the generic timer wasn't enabled. My steps are:
4. Read CNTP_CTL in a loop, wait for bit 2 of CNTPCTL to be 1, and then break.
I expected that it would delay 100us and then break the loop, but the bit 2 of CNTPCTL was never to be 1. I read the CNTPCT, the number was always 0 while I expected the number should increment.
I also set CNTP_TVAL with 100, and expected it would decrements to 0 after about 100us, but i read the CNTP_TVAL, the number didn't change, it was always 100.
I think i must make some makes during init generic timer, but i reviewed RM, seems there is nothing should be done except i have done.
For the CNTFRQ, I saw the description: "Typically, the system drives the system counter at a fixed frequency and the CNTFRQ register must be programmed to this value during the system boot process." Feel confusion if the number pushed to CNTFRQ should related the real frequency ARM core running? For example, the ARM run with 480MHz, does this frequency affect the CNTFRQ setting? Or i can push any value, such as 1Hz, or 1MHz to CNTFRQ?
Sort of. The question is how would you know what the frequency was.
For firmware, this is SoC/board specific. Therefore "knowing" what the frequency is doesn't tend to be a problem.
For an OS, you might have one binary which can run on a number of different platforms or on the same platform in a number of different configurations. So it's helpful to have a standardized to report to higher level software the frequency. That's what CNTFRQ is intended for.
Thanks Martin!