cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
locad
Observer
Observer
947 Views
Registered: ‎04-30-2019

How can I read current physical counter frequency ?

Hello,

I'm using a Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit.

I would like to read the current value of the Physical Counter frequency, i guess this information is available in a memory mapped register, but I do not find in the documentation where?

Thanks.

Regards.

0 Kudos
Reply
5 Replies
pthakare
Moderator
Moderator
907 Views
Registered: ‎08-08-2017

Hi @locad 

The register referene is available in UG1087.

https://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascale-registers.html

Please let us know if you are looking for the same and elaborate more on physical counter frequency .

-------------------------------------------------------------------------------------------------------------------------------
Reply if you have any queries, give kudos and accept as solution
-------------------------------------------------------------------------------------------------------------------------------
locad
Observer
Observer
881 Views
Registered: ‎04-30-2019

Hi @pthakare,

Thanks for the pointer, I already found this page... But i'm getting lost in the tons of documentation.

Sorry if my questions looks stupids, but I'm not very familliar with those low levels concepts...

I want to use the APU Secure Physical timer, CNTPNS IRQ (interrupt ID 29 according to ug1085 doc).

The code i'm porting to the A53 cores of ZCU102 basically does the following:

  • Enable/Disable timer interrupts using CNTPS_CTL_EL1 register.
  • Read counter value from CNTPCT_EL0 register.
  • Set comparator value using CNTPS_CVAL_EL1 register.
  • Read clock frequency of physical timer from CNTFRQ_EL0 register.

However I first need to set the initial value of CNTFRQ_EL0 register on all A53 cores, and this value must be set to the frequency of the APU Secure Physical timer. So, my question is: Which memory mapped register should I read to obtain the APU Secure Physical timer frequency?

The other question I have is: Can this value be changed? If yes, what is the valid range for ZCU102 board?

Thanks a lot.

Regards.

0 Kudos
Reply
locad
Observer
Observer
857 Views
Registered: ‎04-30-2019

Hi again,

After more investigation, I did try to read the frequency from the base_frequency_ID_register (IOU_SCNTRS) Register, which contain a value closed to 100Mhz. This seems to provide me a tick every 10nsec, which is what I'm looking for.

However, if I set base_frequency_ID_register to 10Mhz, I'm still getting a tick every 10nsec... I was expecting every 100msec...

So it seems that the reference clock frequency is set elsewhere... But where?

Thanks.

Regards.

0 Kudos
Reply
locad
Observer
Observer
778 Views
Registered: ‎04-30-2019

Hello @pthakare ,

Any idea, on the above question?

Thanks,

Regards.

0 Kudos
Reply
rsey
Contributor
Contributor
712 Views
Registered: ‎07-18-2018

Hi,

Maybe this help:

 

 

Selection_026.png

ref: UG1085

 

 

\Razi
-- Don’t forget to Reply, Kudo, and Accept as Solution --
0 Kudos
Reply