@@ -166,6 +166,196 @@ To disable cut through on all queues
166166
167167 devlink dev param set platform/icssg1-eth name cut_thru value 0 cmode runtime
168168
169+ PTP
170+ """
171+ PTP can be run during switch mode. To run PTP in switch mode, 3 AM64x EVMs need to be connected with middle EVM acting as the switch. Use the following ptp config file on all slave EVMs. For Master EVM, priority1 filed needs to be changed.
172+
173+ **gPTP.cfg **
174+
175+ .. code-block :: console
176+
177+ # 802.1AS example configuration containing those attributes which
178+ # differ from the defaults. See the file, default.cfg, for the
179+ # complete list of available options.
180+ #
181+ [global]
182+ gmCapable 1
183+ priority1 248
184+ priority2 248
185+ logAnnounceInterval 0
186+ logSyncInterval -3
187+ syncReceiptTimeout 3
188+ neighborPropDelayThresh 800
189+ min_neighbor_prop_delay -20000000
190+ assume_two_step 1
191+ path_trace_enabled 1
192+ follow_up_info 1
193+ transportSpecific 0x1
194+ ptp_dst_mac 01:80:C2:00:00:0E
195+ network_transport L2
196+ delay_mechanism P2P
197+ ingressLatency 88
198+ egressLatency 288
199+
200+ **Steps: **
201+
202+ 1. On EVM1 run below command assuming eth1 is the ICSSG interface connected and ptp2 is the device associated with it.
203+
204+ .. code-block :: console
205+
206+ ptp4l -P -2 -H -i eth1 -f gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp2
207+
208+ 2. On EVM3 run below command assuming eth2 is the ICSSG interface connected and ptp2 is the device associated with it.
209+
210+ .. code-block :: console
211+
212+ ptp4l -P -2 -H -i eth2 -f gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp2
213+
214+ 3. On EVM2 acting as the switch run below command assuming eth1 and eth2 are the ICSSG interfaces connected and ptp2 is the device associated with them.
215+
216+ .. code-block :: console
217+
218+ # Edit priority1 of EVM2 to make sure it runs as master.
219+ sed -i 's/priority1 248/priority1 100/g' gPTP.cfg
220+
221+ # Add mdb entry for switch interface with multicast mac address used for forwarding PTP packets.
222+ # This address is same as ptp_dst_mac field in gPTP.cfg file.
223+ bridge mdb add dev br0 port br0 grp $ptp_dst_mac permanent vid 1
224+
225+ # Start PTP on Master EVM
226+ ptp4l -P -2 -H -i eth1 -i eth2 -f gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp2
227+
228+ **Observed Outputs: **
229+
230+ 1. On EVM1
231+
232+ .. code-block :: console
233+
234+ root@am64xx-evm:~# cat gPTP.cfg | grep priority
235+ priority1 248
236+ priority2 248
237+ root@am64xx-evm:~# ptp4l -P -2 -H -i eth1 -f gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp2
238+ ptp4l[3673.262]: selected /dev/ptp2 as PTP clock
239+ ptp4l[3673.296]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
240+ ptp4l[3673.297]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
241+ ptp4l[3676.325]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
242+ ptp4l[3676.325]: selected local clock 70ff76.fffe.1e2db3 as best master
243+ ptp4l[3676.325]: port 1: assuming the grand master role
244+ ptp4l[3677.050]: port 1: new foreign master 70ff76.fffe.1f3f8e-1
245+ ptp4l[3679.050]: selected best master clock 70ff76.fffe.1f3f8e
246+ ptp4l[3679.050]: port 1: MASTER to UNCALIBRATED on RS_SLAVE
247+ ptp4l[3679.433]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
248+ ptp4l[3680.183]: rms 11123 max 14721 freq +9512 +/- 7654 delay 83 +/- 0
249+ ptp4l[3681.184]: rms 2050 max 3143 freq +2824 +/- 2781 delay 83 +/- 0
250+ ptp4l[3682.184]: rms 3425 max 3591 freq -3401 +/- 910 delay 83 +/- 0
251+ ptp4l[3683.185]: rms 2175 max 2887 freq -4622 +/- 87 delay 83 +/- 0
252+ ptp4l[3684.185]: rms 705 max 1163 freq -3960 +/- 252 delay 83 +/- 0
253+ ptp4l[3685.185]: rms 124 max 196 freq -3218 +/- 159 delay 84 +/- 0
254+ ptp4l[3686.186]: rms 203 max 216 freq -2865 +/- 49 delay 84 +/- 0
255+ ptp4l[3687.186]: rms 121 max 156 freq -2810 +/- 8 delay 84 +/- 0
256+ ptp4l[3688.186]: rms 39 max 64 freq -2846 +/- 13 delay 84 +/- 0
257+ ptp4l[3689.187]: rms 6 max 12 freq -2886 +/- 8 delay 84 +/- 0
258+ ptp4l[3690.187]: rms 14 max 20 freq -2910 +/- 7 delay 84 +/- 0
259+ ptp4l[3691.188]: rms 7 max 12 freq -2911 +/- 5 delay 84 +/- 0
260+ ptp4l[3692.188]: rms 5 max 9 freq -2909 +/- 6 delay 85 +/- 0
261+ ptp4l[3693.189]: rms 4 max 8 freq -2908 +/- 6 delay 84 +/- 0
262+ ptp4l[3694.189]: rms 5 max 7 freq -2907 +/- 7 delay 85 +/- 0
263+ ptp4l[3695.189]: rms 3 max 8 freq -2911 +/- 4 delay 84 +/- 0
264+ ptp4l[3696.190]: rms 4 max 8 freq -2913 +/- 5 delay 84 +/- 0
265+ ptp4l[3697.190]: rms 3 max 4 freq -2908 +/- 4 delay 84 +/- 0
266+ ptp4l[3698.191]: rms 4 max 9 freq -2908 +/- 6 delay 83 +/- 0
267+ ptp4l[3699.191]: rms 5 max 9 freq -2905 +/- 6 delay 83 +/- 0
268+ ptp4l[3700.191]: rms 5 max 9 freq -2913 +/- 5 delay 85 +/- 0
269+ ptp4l[3701.192]: rms 4 max 7 freq -2911 +/- 5 delay 83 +/- 0
270+ ptp4l[3702.192]: rms 4 max 5 freq -2908 +/- 5 delay 83 +/- 0
271+ ptp4l[3703.192]: rms 5 max 8 freq -2905 +/- 6 delay 84 +/- 0
272+ ptp4l[3704.193]: rms 6 max 8 freq -2897 +/- 3 delay 84 +/- 0
273+ ptp4l[3705.193]: rms 5 max 8 freq -2898 +/- 7 delay 84 +/- 0
274+ ptp4l[3706.193]: rms 5 max 12 freq -2904 +/- 6 delay 84 +/- 0
275+ ptp4l[3707.194]: rms 4 max 9 freq -2907 +/- 5 delay 85 +/- 0
276+ ptp4l[3708.194]: rms 3 max 6 freq -2907 +/- 4 delay 86 +/- 0
277+ ptp4l[3709.195]: rms 5 max 7 freq -2905 +/- 7 delay 85 +/- 0
278+
279+ 2. On EVM2 actings as switch
280+
281+ .. code-block :: console
282+
283+ root@am64xx-evm:~# cat gPTP.cfg | grep priority
284+ priority1 100
285+ priority2 248
286+ root@am64xx-evm:~# ptp4l -P -2 -H -i eth1 -i eth2 -f gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp2
287+ ptp4l[3635.479]: selected /dev/ptp2 as PTP clock
288+ ptp4l[3635.516]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
289+ ptp4l[3635.548]: port 2: INITIALIZING to LISTENING on INIT_COMPLETE
290+ ptp4l[3635.549]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
291+ ptp4l[3638.522]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
292+ ptp4l[3638.522]: selected local clock 70ff76.fffe.1f3f8e as best master
293+ ptp4l[3638.522]: port 1: assuming the grand master role
294+ ptp4l[3639.278]: port 2: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
295+ ptp4l[3639.278]: selected local clock 70ff76.fffe.1f3f8e as best master
296+ ptp4l[3639.278]: port 1: assuming the grand master role
297+ ptp4l[3639.278]: port 2: assuming the grand master role
298+ ptp4l[3660.790]: port 2: new foreign master 70ff76.fffe.1f3e6a-1
299+ ptp4l[3662.790]: selected best master clock 70ff76.fffe.1f3e6a
300+ ptp4l[3662.790]: port 1: assuming the grand master role
301+ ptp4l[3662.791]: port 2: assuming the grand master role
302+ ptp4l[3663.800]: port 1: new foreign master 70ff76.fffe.1e2db3-1
303+ ptp4l[3665.800]: selected best master clock 70ff76.fffe.1e2db3
304+ ptp4l[3665.800]: port 1: assuming the grand master role
305+ ptp4l[3665.800]: port 2: assuming the grand master role
306+
307+ 3. On EVM3
308+
309+ .. code-block :: console
310+
311+ root@am64xx-evm:~# cat gPTP.cfg | grep priority
312+ priority1 248
313+ priority2 248
314+ root@am64xx-evm:~# ptp4l -P -2 -H -i eth2 -f gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp2
315+ ptp4l[3651.298]: selected /dev/ptp2 as PTP clock
316+ ptp4l[3651.336]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
317+ ptp4l[3651.337]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
318+ ptp4l[3654.775]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
319+ ptp4l[3654.775]: selected local clock 70ff76.fffe.1f3e6a as best master
320+ ptp4l[3654.775]: port 1: assuming the grand master role
321+ ptp4l[3655.266]: port 1: new foreign master 70ff76.fffe.1f3f8e-2
322+ ptp4l[3657.266]: selected best master clock 70ff76.fffe.1f3f8e
323+ ptp4l[3657.266]: port 1: MASTER to UNCALIBRATED on RS_SLAVE
324+ ptp4l[3657.520]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
325+ ptp4l[3658.270]: rms 6047 max 8004 freq +5665 +/- 4160 delay 88 +/- 0
326+ ptp4l[3659.271]: rms 1112 max 1709 freq +2037 +/- 1510 delay 89 +/- 0
327+ ptp4l[3660.271]: rms 1865 max 1953 freq -1356 +/- 501 delay 89 +/- 0
328+ ptp4l[3661.271]: rms 1190 max 1582 freq -2032 +/- 45 delay 90 +/- 0
329+ ptp4l[3662.272]: rms 386 max 637 freq -1668 +/- 142 delay 89 +/- 0
330+ ptp4l[3663.272]: rms 71 max 111 freq -1256 +/- 89 delay 89 +/- 0
331+ ptp4l[3664.272]: rms 109 max 119 freq -1070 +/- 27 delay 89 +/- 0
332+ ptp4l[3665.273]: rms 67 max 83 freq -1037 +/- 5 delay 89 +/- 0
333+ ptp4l[3666.273]: rms 22 max 35 freq -1056 +/- 8 delay 89 +/- 0
334+ ptp4l[3667.273]: rms 6 max 11 freq -1073 +/- 8 delay 89 +/- 0
335+ ptp4l[3668.274]: rms 10 max 13 freq -1094 +/- 4 delay 89 +/- 0
336+ ptp4l[3669.274]: rms 3 max 5 freq -1090 +/- 3 delay 89 +/- 0
337+ ptp4l[3670.274]: rms 3 max 5 freq -1087 +/- 4 delay 89 +/- 0
338+ ptp4l[3671.274]: rms 5 max 7 freq -1086 +/- 6 delay 89 +/- 0
339+ ptp4l[3672.275]: rms 4 max 7 freq -1089 +/- 5 delay 89 +/- 0
340+ ptp4l[3673.275]: rms 5 max 7 freq -1087 +/- 7 delay 89 +/- 0
341+ ptp4l[3674.275]: rms 3 max 4 freq -1088 +/- 4 delay 88 +/- 0
342+ ptp4l[3675.276]: rms 4 max 8 freq -1091 +/- 5 delay 88 +/- 0
343+ ptp4l[3676.276]: rms 5 max 6 freq -1084 +/- 5 delay 90 +/- 0
344+ ptp4l[3677.276]: rms 3 max 6 freq -1085 +/- 5 delay 90 +/- 0
345+ ptp4l[3678.276]: rms 5 max 10 freq -1084 +/- 7 delay 90 +/- 0
346+ ptp4l[3679.277]: rms 4 max 9 freq -1088 +/- 5 delay 89 +/- 0
347+ ptp4l[3680.277]: rms 5 max 8 freq -1092 +/- 5 delay 88 +/- 0
348+ ptp4l[3681.277]: rms 3 max 5 freq -1089 +/- 4 delay 89 +/- 0
349+ ptp4l[3682.277]: rms 5 max 8 freq -1084 +/- 6 delay 88 +/- 0
350+ ptp4l[3683.278]: rms 4 max 7 freq -1088 +/- 6 delay 89 +/- 0
351+ ptp4l[3684.278]: rms 5 max 7 freq -1086 +/- 7 delay 89 +/- 0
352+ ptp4l[3685.278]: rms 3 max 8 freq -1087 +/- 5 delay 88 +/- 0
353+ ptp4l[3686.279]: rms 4 max 8 freq -1088 +/- 5 delay 88 +/- 0
354+ ptp4l[3687.279]: rms 4 max 8 freq -1088 +/- 5 delay 88 +/- 0
355+
356+
357+ **Results: ** It can be observed that the clocks on Slave devices are getting synchronised with the clock on Master device.
358+
169359SRAM Requirement
170360""""""""""""""""
171361
0 commit comments