Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linuxdsp:docs:linux_yocto_distrubution_and_applications:linuxptp [10 Jul 2020 11:18] – [More information] Sunny Fengresources:tools-software:linuxdsp:docs:linux_yocto_distribution_and_applications:linuxptp [22 Sep 2020 11:14] (current) – [Device tree configuration] Sunny Feng
Line 16: Line 16:
 <code> <code>
 vim build/conf/local.conf vim build/conf/local.conf
-IMAGE_INSTALL_append = "linuxptp"+IMAGE_INSTALL_append = " linuxptp"
 </code> </code>
  
Line 46: Line 46:
 \\ \\
 ==== Device tree configuration ==== ==== Device tree configuration ====
-The timestamps that are the basis of PTP can be acquired with greater accuracy when they are captured by the ethernet PHY hardware. The RMII PHY interface supports hardware timestamps but the RGMII PHY interface does not. In order to obtain a higher accuracy of time synchronization the RMII PHY is the better choice, even though this means being limited to 10/100 Mbps operation+The timestamps that are the basis of PTP can be acquired with greater accuracy when they are captured by the ethernet PHY hardware. The PHY interface can support hardware timestampsthe default phy-mode is RGMII. 
-The phy-mode can be changed to "rmii" in the device tree header in the linux kernel source arch/arm/boot/dts/sc589-ezkit.dts other board specific sc5xx.dts files. Run "//**bitbake linux-adi -c devshell**//" to enter into linux kernel source code.+ 
 +The phy-mode also can be changed to "rmii" in the device tree header in the linux kernel source arch/arm/boot/dts/sc589-ezkit.dts and other board specific sc5xx.dts files. 
 <WRAP info> <WRAP info>
 ... : ellipsis, means other properties in EMAC0 node stay the same\\ ... : ellipsis, means other properties in EMAC0 node stay the same\\
Line 54: Line 55:
 </WRAP> </WRAP>
  
 +Run "**//bitbake linux-adi -c devshell//**" to enter into linux kernel source code and then change the dts file.
 <code> <code>
 $ vim arch/arm/boot/dts/sc589-ezkit.dts $ vim arch/arm/boot/dts/sc589-ezkit.dts
Line 64: Line 66:
 </code> </code>
  
-Run "//**bitbake linux-adi -C compile**//" to generate zImage and dtb files, they are now ready to be loaded onto the target board. See [[resources/tools-software/linuxdsp/docs/quickstartguide/installing#installing_linux_on_the_hardware| SC5xx ezkit Linux quick start guide]] for details.+Run "//**bitbake linux-adi -C compile**//" to generate zImage and dtb files, they are now ready to be loaded onto the target board. 
  
 +As to the linuxptp example needs the ethernet up, so users should use the ramboot rather than nfsboot. Run "//**bitbake adsp-sc5xx-ramdisk -C compile**//" to generate the file system. See [[resources/tools-software/linuxdsp/docs/quickstartguide/building| SC5xx ezkit Linux quick start guide]] for details.
 \\ \\
 ===== Example ===== ===== Example =====
Line 74: Line 77:
 Two ADSP-SC5xx boards are required. One board act as a master, and the other act as a slave. The two boards are connected by their respective EMAC0 ports using a standard crossover network cable. Two ADSP-SC5xx boards are required. One board act as a master, and the other act as a slave. The two boards are connected by their respective EMAC0 ports using a standard crossover network cable.
  
-**2) Enable PTP in U-Boot** +**2) Master's MAC address must be different from slave's**
-\\ +
-Add "stmmac.debug=11" to the kernel boot arguments in U-Boot. +
-<code> +
-$ set bootargs root=/dev/mtdblock0 rw stmmac.debug=11 console=ttyBF0,57600  +
-</code> +
- +
-**3) Master's MAC address must be different from slave's**+
 \\ \\
 In order to make the master's and the slave's MAC address different, change the slave's address in U-Boot. In order to make the master's and the slave's MAC address different, change the slave's address in U-Boot.
Line 88: Line 84:
 </code> </code>
  
-**4) Master's ip address must be different from slave ip**+**3) Master's ip address must be different from slave ip**
 \\ \\
 Reset IP address after linux boot up. Reset IP address after linux boot up.
Line 108: Line 104:
 # testptp -s # testptp -s
 set time okay set time okay
- hwstamp_ctl -i eth0 -r 6 -t 1+# hwstamp_ctl -i eth0 -r 6 -t 1
 tx_type 1 tx_type 1
 rx_filter 6 rx_filter 6
-# ptp4l -i eth0 &+</code> 
 +Change tx_timestamp_timeout to 100 
 +<code> 
 +# vi /etc/ptp4l.cfg 
 +-tx_timestamp_timeout    1 
 ++tx_timestamp_timeout    100 
 +
 +# ptp4l -i eth0 -f /etc/ptp4l.cfg &
 # date # date
 Fri Jan  1 13:30:51 UTC 2010 Fri Jan  1 13:30:51 UTC 2010
Line 118: Line 121:
 === 2) Slave === === 2) Slave ===
 <code> <code>
- hwstamp_ctl -i eth0 -r 6 -t 1+# hwstamp_ctl -i eth0 -r 6 -t 1
 tx_type 1 tx_type 1
 rx_filter 6 rx_filter 6
- ptp4l -i eth0 -s & +# ptp4l -i eth0 -s & 
- date+# date
 Mon Jan  1 00:02:24 UTC 2007 Mon Jan  1 00:02:24 UTC 2007
- phc2sys -s /dev/ptp0 -O 0 & +# phc2sys -s /dev/ptp0 -O 0 & 
- date+# date
 Mon Jan  1 00:02:24 UTC 2007 Mon Jan  1 00:02:24 UTC 2007
 ... ...
- date+# date
 Fri Jan  1 13:30:58 UTC 2010 Fri Jan  1 13:30:58 UTC 2010
 Date on the slave board is 2007.1.1-00:02:24 before synchronization, and changes to 2010.1.1-13:30:58 after a few seconds of synchronization with the master. Date on the slave board is 2007.1.1-00:02:24 before synchronization, and changes to 2010.1.1-13:30:58 after a few seconds of synchronization with the master.
Line 142: Line 145:
 \\ \\
 ---- ----
-**Back to** [[resources/tools-software/linuxdsp/docs/linux_yocto_distrubution_and_applications/start|Yocto Linux Distrubution and Applications]]+**Back to** [[resources:tools-software:linuxdsp:docs:linux_yocto_distribution_and_applications:start|Yocto Linux Distrubution and Applications]]
resources/tools-software/linuxdsp/docs/linux_yocto_distribution_and_applications/linuxptp.1594372701.txt.gz · Last modified: 10 Jul 2020 11:18 by Sunny Feng