I don´t know if you have already solved this issue.
Currently I am working in a project in which I need to implement special communication protocols using PRUs and I need to store all communication transfers with their specific timestamp in order to generate communications reports to verify that everything has been carried out as expected.
To accomplish this task I have used Beaglebone Black RTC module. If you consult AM335x user reference manual, you could see a complete explanation of this module, its registers and accuracy. If you only need seconds accuracy, which is its limit, this module is perfect for you. If not, you can combine the information provided by its registers with IEP timer. The second option is a little bit more vast to be explained here. If this is your case, please tell me and I will try to provide a step-by-step guide.
To use RTC module from PRU, it could be accessed using OCP port. Here is a piece of code with which you can access RTC registers from PRUs. Then I store each value (hour, min, sec, year, month, day) in PRU0 RAM in order to make them readable from host.c program and check that I get the same value than typing date in Linux terminal.
//************************************************************************
// Reading RTC from PRU
//************************************************************************
// Author : Pablo Alías Mateos
// Project : General
// Description:
//**************************************************************************
//==========================================================================
//**************************************************************************
//==========================================================================
.origin 0
.entrypoint START
//----------------------------------------------------------------------
#define RTC_BASE_ADDRESS 0x44E3E000
#define RTC_SECONDS_OFFSET 0x00000000
#define RTC_MIN_OFFSET 0x00000004
#define RTC_HOUR_OFFSET 0x00000008
#define RTC_DAYS_OFFSET 0x0000000C
#define RTC_MONTH_OFFSET 0x00000010
#define RTC_YEAR_OFFSET 0x00000014
//----------------------------------------------------------------------
START:
// Enable the OCP master port
LBCO r0, c4, 4, 4 // load SYSCFG reg into r0 (use c4 const addr)
CLR r0, r0, 4 // clear bit 4 (STANDBY_INIT)
SBCO r0, c4, 4, 4 // store the modified r0 back at the load addr
MOV r0, RTC_BASE_ADDRESS
MOV r1, 0x00000000 // base RAM0
LBBO r2,r0,RTC_HOUR_OFFSET,4
SBBO r2,r1,0,4
LBBO r2,r0,RTC_MIN_OFFSET,4
SBBO r2,r1,4,4
LBBO r2,r0,RTC_SECONDS_OFFSET,4
SBBO r2,r1,8,4
LBBO r2,r0,RTC_DAYS_OFFSET,4
SBBO r2,r1,12,4
LBBO r2,r0,RTC_MONTH_OFFSET,4
SBBO r2,r1,16,4
LBBO r2,r0,RTC_YEAR_OFFSET,4
SBBO r2,r1,20,4
I hope you find this information useful,
Pablo