summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f698099)
raw | patch | inline | side by side (parent: f698099)
author | Vineet Roy <vroy@ti.com> | |
Fri, 23 Apr 2021 07:22:24 +0000 (12:52 +0530) | ||
committer | Ankur <ankurbaranwal@ti.com> | |
Tue, 27 Apr 2021 15:33:11 +0000 (10:33 -0500) |
A safety feature was added for V1 ICSS to make sure that Tx timestamp has indeed changed and this was carried over to V2 ICSS like AM5. In this we have a state machine to
compare current and previous timestamps and make sure that timestamps are indeed different. This check is not required for AM5 because we push more number of bytes (>22) before PTP timestamp is taken. This helps save cycles.
compare current and previous timestamps and make sure that timestamps are indeed different. This check is not required for AM5 because we push more number of bytes (>22) before PTP timestamp is taken. This helps save cycles.
packages/ti/drv/icss_emac/firmware/icss_dualemac/src/emac_ptp.asm | patch | blob | history | |
packages/ti/drv/icss_emac/firmware/icss_dualemac/src/icss_ptp_macro.h | patch | blob | history |
diff --git a/packages/ti/drv/icss_emac/firmware/icss_dualemac/src/emac_ptp.asm b/packages/ti/drv/icss_emac/firmware/icss_dualemac/src/emac_ptp.asm
index 989530205bc2b980f531dae949ff68153d2a02f5..274238bc96f0033884c03bc3e661dd4681ea72ff 100644 (file)
FN_GET_TX_TIMESTAMP:
+ .if $defined("ICSS_REV1")
;we need to make sure that the timestamp here is actual value
;this we do by comparing with Tx SOF of previous frame
.if $defined("ICSS_SWITCH_BUILD")
.endif ; switch build
LOAD_TX_SOF_TS:
+ .endif ;ICSS_REV1
.if $defined("ICSS_SWITCH_BUILD")
.if $defined (PRU0)
LBCO &R4, IEP_CONST, CAP_RISE_TX_SOF_PORT2_OFFSET, 4
.endif
.endif
-
- QBEQ LOAD_TX_SOF_TS, R4, R5
+ .if $defined("ICSS_REV1")
+ QBEQ LOAD_TX_SOF_TS, R4, R5
+ .endif ;ICSS_REV1
;This also loads 2 bytes in R3.w0
LBCO &R2, ICSS_SHARED_CONST, TIMESYNC_SECONDS_COUNT_OFFSET, 6
QBBC EXIT_PTP_TX_ADD_DELAY, R22, TX_IS_PTP_BIT
CLR R22, R22, TX_IS_PTP_BIT
- ;we need to make sure that the timestamp here is actual value
- ;this we do by comparing with Tx SOF of previous frame
- .if $isdefed("PRU0")
- LDI R20.w0, PTP_PREV_TX_TIMESTAMP_P1
- .else
- LDI R20.w0, PTP_PREV_TX_TIMESTAMP_P2
- .endif
- LBCO &R20, ICSS_SHARED_CONST, R20.w0, 8
- ;get the timestamp
-
LOAD_TX_SOF_TS:
.if $defined("ICSS_SWITCH_BUILD")
.endif
.endif
- QBNE TX_SOF_OK, R10, R20
- QBEQ LOAD_TX_SOF_TS, R11, R21
-
-TX_SOF_OK:
-
;Do phy delay correction here
LDI R0.w2, MII_TX_CORRECTION_OFFSET
LBCO &R25.w0, ICSS_SHARED_CONST, R0.w2, 2
SET two_step_reg_udp_vlan, two_step_reg_udp_vlan, GPTP_802_3_two_step_bit
PTP_TX_UDP_GET_TS:
- ;we need to make sure that the timestamp here is actual value
- ;this we do by comparing with Tx SOF of previous frame
- .if $isdefed("PRU0")
- LDI R20.w0, PTP_PREV_TX_TIMESTAMP_P1
- .else
- LDI R20.w0, PTP_PREV_TX_TIMESTAMP_P2
- .endif
- LBCO &R20, ICSS_SHARED_CONST, R20.w0, 8
- ;get the timestamp
-
LOAD_TX_SOF_TS_UDP:
.if $defined("ICSS_SWITCH_BUILD")
LBCO &R10, IEP_CONST, CAP_RISE_TX_SOF_PORT2_OFFSET, 8
.endif
.endif
-
- QBNE TX_SOF_OK_UDP, R10, R20
- QBEQ LOAD_TX_SOF_TS_UDP, R11, R21
-
+
TX_SOF_OK_UDP:
QBNE NOT_DELAY_REQ_TX_UDP, PTP_MSG_ID_REG_UDP, PTP_DLY_REQ_MSG_ID
diff --git a/packages/ti/drv/icss_emac/firmware/icss_dualemac/src/icss_ptp_macro.h b/packages/ti/drv/icss_emac/firmware/icss_dualemac/src/icss_ptp_macro.h
index 6497a0157b10950c0e2eb5df23752074485adbaa..541c4fd603f4f858edffcebc0d71d84e93f79887 100644 (file)
CONTINUE_PRE_PROC:
- .if !$defined(ICSS_REV1)
- ;Just before pushing to FIFO store the current Tx SOF TS
- ;This is used for comparison later to make sure SOF has actually
- ;updated.
-
- .if $defined("ICSS_SWITCH_BUILD")
- .if $defined(PRU0)
- LBCO &R10, IEP_CONST, CAP_RISE_TX_SOF_PORT2_OFFSET, 8
- LDI RCV_TEMP_REG_1.w0, PTP_PREV_TX_TIMESTAMP_P2
- SBCO &R10, ICSS_SHARED_CONST, RCV_TEMP_REG_1.w0, 8
- .else
- LBCO &R10, IEP_CONST, CAP_RISE_TX_SOF_PORT1_OFFSET, 8
- LDI RCV_TEMP_REG_1.w0, PTP_PREV_TX_TIMESTAMP_P1
- SBCO &R10, ICSS_SHARED_CONST, RCV_TEMP_REG_1.w0, 8
- .endif ; PRU0
- .else
- .if $defined(PRU0)
- LBCO &R10, IEP_CONST, CAP_RISE_TX_SOF_PORT1_OFFSET, 8
- LDI RCV_TEMP_REG_1.w0, PTP_PREV_TX_TIMESTAMP_P1
- SBCO &R10, ICSS_SHARED_CONST, RCV_TEMP_REG_1.w0, 8
- .else
- LBCO &R10, IEP_CONST, CAP_RISE_TX_SOF_PORT2_OFFSET, 8
- LDI RCV_TEMP_REG_1.w0, PTP_PREV_TX_TIMESTAMP_P2
- SBCO &R10, ICSS_SHARED_CONST, RCV_TEMP_REG_1.w0, 8
- .endif ; PRU0
- .endif ; ICSS_SWITCH_BUILD
- .endif ; ICSS_REV1
EXIT_PTP_TX_PRE_PROC:
.endm