Skip to content

Commit 77d91b5

Browse files
danish-ticshilwant
authored andcommitted
feat(PRU-ICSS): Add documentation for PTP in switch mode
Add documentation for running PTP to synchronise time between master and slave DUTs in switch mode. Signed-off-by: MD Danish Anwar <[email protected]>
1 parent 801d75f commit 77d91b5

File tree

1 file changed

+189
-0
lines changed

1 file changed

+189
-0
lines changed

source/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU_ICSSG_Ethernet_Switch.rst

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

0 commit comments

Comments
 (0)