Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 4/01/2024
Public
Document Table of Contents

5.1.7.15. Programming the SMTG Hub

SMTG hub functionality is programmable through the software driver using read/write operations in the EMAC registers.

To program the SMTG hub follow these steps:

  1. Write to MAC_GPIO_Status register (offset: 0x27C) with a bit mask of 0x00010000 to trigger timestamp capture which sets gpo[0] pin to high. The gpo[0] status can be checked by reading MAC_GPIO_Status register (offset: 0x27C) with a bit mask of 0x00010000.
  2. Read from MAC_Timestamp_Status register (offset: 0xD20) with a bit mask of 0x00000004 to check if auxiliary timestamp is updated. This bit is set high when the auxiliary snapshot is written to the FIFO. This bit gets cleared during reads.
  3. After the auxiliary timestamp trigger snapshot is set, read the MAC_Auxiliary_Timestamp_Nanoseconds register (offset: 0xD48) which contains the lower 31 bits (nanoseconds field) of the auxiliary timestamp. Then read MAC_Auxiliary_Timestamp_Seconds register (offset: 0xD4C) which contains the lower 32 bits of the seconds field of the auxiliary timestamp. Both registers combine gives the 64-bit timestamp for EMAC’s ToD.
  4. SMTG hub registers are available in the MIMO register space by performing reads through the following MDIO registers in the MAC:
    • MAC_MDIO_Address offset: 0x0200
    • MAC_MDIO_Data offset: 0x0204
  5. The unique address for SMTG hub MDIO target device (port-ID) is 0x15. To read the 64 bit value of time-stamp counter[0], perform four consecutive read operations from the SMTG hub addresses 5’hF, 5’hE, 5’hD, 5’hC. Concatenate the four 16-bit read data into the 64-bit timestamp, where the lowest address corresponds to the lowest 16-bit data.
  6. To read the 64-bit value from the time-stamp counter [1], perform four consecutive read operations from the SMTG hub address at 5’h13, 5’h12, 5’h11, 5’h10. Concatenate the four 16-bit read data into the 64-bit timestamp, where the lowest address corresponds to the lowest 16-bit data.
  7. To reset a trigger for timestamp capture, write to MAC_GPIO_Status register (offset: 0x27c) with a bit mask of 0x00000000 which sets gpo[0] pin to low.