This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[TDA4VM] How to get timestamp from same source on A72 & R5F



Dear experts,

We are designing a system using a GPIO interrupt to A72 Linux, and a camera connected to R5F. And now we want to get the timestamps of GPIO interrupt and image capture.

There is a gettimeofday API in linux, but it is not synced with R5F.

There is a Timestamp_get64 in R5F RTOS, but it is not syned with A72 Linux.

And I saw there is a Global Time Counter(GTC) in the SoC.

Is it possible to use it? And is there any driver to do that?

From PDK, I can find some code to set & read register. But how to do it in A72 Linux?

Thanks & Best Regards!

ZM

  • HI

    As i understand your requirement is to use a common clock reference for timestampping events on R5 vs A72

    We currently do not have means to map and access the same register from both cores

    So AFAIK, we do not have a solution now

  • Thanks Siriam.

    I try to map the GTC register to Linux. Base address is 0x00A90000. mmap success, but read this register will cause segment fault in user space.

    Is there a limitation on accessing this memory?

    Thanks & Best Regards!

    ZM

  • devmem2 works.

    devmem2 0xa90000

  • Ming

    is the timer instance initialized and managed from R5F?

    Would linux just be a client trying to read the current timestamp value

    To be able to access the timer instance, the clocks for the module need to be enabled - given that devmem2 seems to be working, i am assuming the clock configuration, request has been handled from R5F already

    this kind of shared usage(with both parties trying to access the same HW) is atypical, hence no clean way exists

    If you are using this for demonstration, prototyping you may continue to use the same way(using devmem2) - but bear in mind that there is no way to ensure access from Linux are read only and access can be enabled only when configuration from R5F is complete.

    You can look at devmem2 implementation if you want to implement similar logic for access from user space in your application