This section describes Ethernet port receive events. Ethernet port generates time synchronization events for valid received time sync packets. For every packet received on the Ethernet port, a timestamp will be captured by the receive module inside the CPTS for the corresponding port. The time stamp will be captured by the receive module regardless of whether or not the packet is a time synchronization packet to make sure that the time stamp is captured as soon as possible. The packet is sampled on both the rising and falling edges of the CPTS_RFT_CLK, and the time stamp will be captured once the start of frame delimiter for the receive packet is detected.
After the time stamp has been captured, the receive interface will begin parsing the packet to determine if it is a valid Ethernet time synchronization packet. The CPSW decoder determines if the packet is a valid Ethernet receive time synchronization event. The receive interface for the port will use the following criteria to determine if the packet is a valid Annex D, Annex E, or Annex F time synchronization Ethernet receive event:
Annex D (IPv4)
- Receive annex D time sync is enabled
(TS_RX_ANNEX_D_EN is set in the CPSW_PN_TS_CTL_REG register).
- One of the sequences below is true.
- The first packet LTYPE matches 0x0800
- The first packet LTYPE matches TS_VLAN_LTYPE1 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE1_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
0x0800
- The first packet LTYPE matches TS_VLAN_LTYPE2 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE2_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
0x0800
- The first packet LTYPE matches TS_VLAN_LTYPE1 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE1_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
TS_VLAN_LTYPE2 in the CPSW_PN_TS_VLAN_LTYPE_REG register and
TS_RX_VLAN_LTYPE2_EN is set in the CPSW_PN_TS_CTL_REG register and the
third packet LTYPE matches 0x0800
- Byte 14 (the byte after the LTYPE) contains 0x45 (IPv4).
Note: The byte numbering assumes that there are no VLANs. The byte number is intended to show the relative order of the bytes.
- Byte 20 contains 0bXXX00000 (5 lower bits zero) and Byte 21 contains 0x00 (fragment offset zero)
- Byte 22 contains 0x01 (HOP Limit = 1) if the
TS_TTL_NONZERO bit in the switch CPSW_PN_TS_CTL_LTYPE2_REG register is cleared
to 0h, or byte 22 contains any value if CPSW_PN_TS_CTL_LTYPE2_REG is set to 1h.
Byte 22 is the TTL/HOP field.
- Byte 23 contains 0x11 (Next Header UDP Fixed).
- The TS_UNI_EN bit in the
CPSW_PN_TS_CTL_LTYPE2_REG register is cleared to 0h and Bytes 30 through 33
contain:
- Decimal 224.0.1.129 and
the TS_129 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set, or
- Decimal 224.0.1.130 and
the TS_130 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set, or
- Decimal 224.0.1.131 and
the TS_131 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set, or
- Decimal 224.0.1.132 and
the TS_132 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set, or
- Decimal 224.0.0.107 and
the TS_107 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set
-OR-
The TS_UNI_EN bit in the
CPSW_PN_TS_CTL_LTYPE2_REG register is set and Bytes 30 through 33 contain
any values.
- Bytes 36 and 37 contain:
- Decimal 0x01 and 0x3F respectively and the TS_319
bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set -OR-
- Decimal 0x01 and 0x40 respectively and the TS_320
bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set.
- The PTP message begins in byte 42.
- The packet message type is enabled in the
TS_MSG_TYPE_EN field in the CPSW_PN_TS_CTL_REG register.
- The packet was received without error (not long/short/mac_ctl/CRC/code/align).
Annex E (IPv6)
- Receive annex E time sync is enabled
(TS_RX_ANNEX_E_EN bit is set in the switch CPSW_PN_TS_CTL_REG register).
- One of the sequences below is true.
- The first packet LTYPE matches 0x86dd.
- The first packet LTYPE matches TS_VLAN_LTYPE1 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE1_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
0x86dd
- The first packet LTYPE matches TS_VLAN_LTYPE2 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE2_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
0x86dd
- The first packet LTYPE matches TS_VLAN_LTYPE1 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE1_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
TS_VLAN_LTYPE2 in the CPSW_PN_TS_VLAN_LTYPE_REG register and
TS_RX_VLAN_LTYPE2_EN is set in the CPSW_PN_TS_CTL_REG register and the
third packet LTYPE matches 0x86dd
- Byte 14 (the byte after the LTYPE) contains 0x6X (IPv6).
- Byte 20 contains 0x11 (UDP Fixed Next Header).
- Byte 21 contains 0x01 (Hop Limit = 1) if the
TS_TTL_NONZERO bit in the switch CPSW_PN_TS_CTL_LTYPE2_REG register is cleared
to 0h, or byte 21 contains any value if TS_TTL_NONZERO is set to 1h. Byte 21 is
the TTL/HOP field.
- The TS_UNI_EN bit in the
CPSW_PN_TS_CTL_LTYPE2_REG register is cleared to 0 and Bytes 38 through 53
contain:
- FF0M:0:0:0:0:0:0:0181 and
the TS_129 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set, or
- FF0M:0:0:0:0:0:0:0182 and
the TS_130 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set, or
- FF0M:0:0:0:0:0:0:0183 and
the TS_131 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set, or
- FF0M:0:0:0:0:0:0:0184 and
the TS_132 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set, or
- FF0M:0:0:0:0:0:0:006B and
the TS_107 bit in the CPSW_PN_TS_CTL_LTYPE2_REG register is set
Note:
All values above
are 16-bit hex numbers where M is enabled in the
TS_MCAST_TYPE_EN field in the CPSW_PN_TS_CTL2_REG register.
-OR-
The TS_UNI_EN bit in
the CPSW_PN_TS_CTL_LTYPE2_REG register is set to 1h and Bytes 38
through 53 contain any value.
- Bytes 56 and 57 contain (UDP Header in bytes 54 through 61):
- Decimal 0x01 and 0x3F respectively and the TS_319
bit in the CPSW_PN_TS_CTL2_REG register is set, or
- Decimal 0x01 and 0x40 respectively and the TS_320
bit in the CPSW_PN_TS_CTL2_REG register is set.
- The PTP message begins in byte 62.
- The packet message type is enabled in the
MSG_TYPE_EN field in the CPSW_PN_TS_CTL2_REG register.
- The packet was received without error (not long/short/mac_ctl/CRC/code/align).
Annex F (IEEE 802.3)
- Receive Annex F time sync is enabled
(TS_RX_ANNEX_F_EN is set in the switch CPSW_PN_TS_CTL_REG register).
- One of the sequences below is true:
- The first packet LTYPE matches TS_LTYPE1 in the
CPSW_PN_TS_SEQ_LTYPE_REG/ CPSW_PN_TS_SEQ_LTYPE_REG register. LTYPE 1
should be used when only one time sync LTYPE is to be enabled.
- The first packet LTYPE matches TS_LTYPE2 in the
CPSW_PN_TS_CTL_LTYPE2_REG register and LTYPE2_EN is set in the
CPSW_PN_TS_CTL_REG register.
- The first packet LTYPE matches TS_VLAN_LTYPE1 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE1_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
TS_LTYPE1 in the CPSW_PN_TS_SEQ_LTYPE_REG register
- The first packet LTYPE matches TS_VLAN_LTYPE1 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE1_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
TS_LTYPE2 in the CPSW_PN_TS_CTL_LTYPE2_REG register and TS_LTYPE2_EN is
set in the CPSW_PN_TS_CTL_REG register.
- The first packet LTYPE matches TS_VLAN_LTYPE2 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE2_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
TS_LTYPE1 in the CPSW_PN_TS_SEQ_LTYPE_REG register.
- The first packet LTYPE matches TS_VLAN_LTYPE2 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE2_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
TS_LTYPE2 in the CPSW_PN_TS_CTL_LTYPE2_REG register and TS_LTYPE2_EN is
set in the CPSW_PN_TS_CTL_REG register.
- The first packet LTYPE matches TS_VLAN_LTYPE1 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE1_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
TS_VLAN_LTYPE2 in the CPSW_PN_TS_VLAN_LTYPE_REG register and
TS_RX_VLAN_LTYPE2_EN is set in the CPSW_PN_TS_CTL_REG register and the
third packet LTYPE matches TS_LTYPE1 in the CPSW_PN_TS_SEQ_LTYPE_REG
register.
- The first packet LTYPE matches TS_VLAN_LTYPE1 in
the CPSW_PN_TS_VLAN_LTYPE_REG register and TS_RX_VLAN_LTYPE1_EN is set
in the CPSW_PN_TS_CTL_REG register and the second packet LTYPE matches
TS_VLAN_LTYPE2 in the CPSW_PN_TS_VLAN_LTYPE_REG register and
TS_RX_VLAN_LTYPE2_EN is set in the CPSW_PN_TS_CTL_REG register and the
third packet LTYPE matches TS_LTYPE2 in the CPSW_PN_TS_CTL_LTYPE2_REG
register and TS_LTYPE2_EN is set in the CPSW_PN_TS_CTL_REG register
- The PTP message begins in the byte after the LTYPE.
- The packet message type is enabled in the
TS_MSG_TYPE_EN field in the CPSW_PN_TS_CTL_REG register.
- The packet was received without error (not long/short/mac_ctl/CRC/code/align).
If all of the criteria described above are met for either Annex D, Annex E, or Annex F, and the packet is determined to be a valid time synchronization packet, then the RX interface will push an Ethernet receive event into the event FIFO.