Other Parts Discussed in Thread: TPIC2810
Hello TI,
We are trying to use the PTP on a AM335X ICE V2 Board.
On previous test with the pre-compiled 6.3.0.005 Linux Image we could use the PTP and compile with PTP support.
We are currently starting development on the 7.3.0, where even on the pre-compiled version we cannot use the PTP functionality, since there is no ptp tx irq / hsr ptp tx irq and consequently no support for timestamping "ptp4l[126.352]: interface 'eth0' does not support requested timestamping mode".
Also on our on compiled images we keep having problems, such as:
root@am335x-evm:~# ptp4l -m - i eth0 -l 6 ptp4l[209.530]: selected /dev/ptp0 as PTP clock [ 209.544088] Division by zero in kernel. [ 209.552283] CPU: 0 PID: 824 Comm: ptp4l Tainted: G O 5.4.106-g023faefa70 #1 [ 209.565137] Hardware name: Generic AM33XX (Flattened Device Tree) [ 209.572045] [<c010e6d8>] (unwind_backtrace) from [<c010b2f0>] (show_stack+0x10/0x14) [ 209.580355] [<c010b2f0>] (show_stack) from [<c09463bc>] (Ldiv0+0x8/0x10) [ 209.587487] [<c09463bc>] (Ldiv0) from [<bf0f3468>] (icss_iep_ptp_adjfreq+0xc4/0xfc [icss_iep]) [ 209.596184] [<bf0f3468>] (icss_iep_ptp_adjfreq [icss_iep]) from [<c070a2f4>] (ptp_clock_adjtime+0xf4/0x128) [ 209.606562] [<c070a2f4>] (ptp_clock_adjtime) from [<c0191bfc>] (pc_clock_adjtime+0x60/0xa0) [ 209.615283] [<c0191bfc>] (pc_clock_adjtime) from [<c018f320>] (__do_sys_clock_adjtime32+0x60/0x7c) [ 209.624614] [<c018f320>] (__do_sys_clock_adjtime32) from [<c0101000>] (ret_fast_syscall+0x0/0x54) [ 209.633805] Exception stack(0xc8f0dfa8 to 0xc8f0dff0) [ 209.639176] dfa0: 0003a248 00000000 ffffffdb be96da88 ffffffff be96da88 ptp4l[209.643]: port 1: INITIALIZING to LISTENING on INIT_COMPLE[ 209.647839] dfc0: 0003a248 00000000 00000000 00000174 00000000 00000000 49f49000 00000000 TE ptp4l[209.658]: port 0: INITIALIZING to LISTENING on INIT_COMPLE[ 209.647848] dfe0: 00038038 be96da74 000154cd 49fe8ad8
So far we have done the following:
- Add missing PTP TX and HSR PTP TX interrups
- Also tried adding IEP CAP CMP interrupt
We are using the am335x-icev2-prueth.dts as our base and edited the pruss_eth as follows:
/ { aliases { ethernet0 = &pruss_emac0; ethernet1 = &pruss_emac1; }; /* Dual mac ethernet application node on icss */ pruss_eth: pruss_eth { compatible = "ti,am3359-prueth"; prus = <&pru0>, <&pru1>; sram = <&ocmcram>; interrupt-parent = <&pruss_intc>; mii-rt = <&pruss_mii_rt>; iep = <&pruss_iep>; ecap = <&pruss_ecap>; pinctrl-0 = <&pruss_eth_default>; pinctrl-names = "default"; interrupts = <20>, <21>, <7>; interrupt-names = "rx_lre_hp", "rx_lre_lp", "iep_cap_cmp"; pruss_emac0: ethernet-mii0 { phy-handle = <&pruss_eth0_phy>; phy-mode = "mii"; interrupts = <20>, <22>, <23>, <26>; interrupt-names = "rx", "tx", "hsr_ptp_tx", "emac_ptp_tx"; ti,no-half-duplex; /* Filled in by bootloader */ local-mac-address = [00 00 00 00 00 00]; }; pruss_emac1: ethernet-mii1 { phy-handle = <&pruss_eth1_phy>; phy-mode = "mii"; interrupts = <21>, <23>, <24>, <27>; interrupt-names = "rx", "tx", "hsr_ptp_tx", "emac_ptp_tx"; ti,no-half-duplex; /* Filled in by bootloader */ local-mac-address = [00 00 00 00 00 00]; }; }; };
The last log we got after adding the IEP CAP CMP:
root@am335x-evm:~# ptp4l -m -l6 -i eth0 ptp4l[163.866]: selected /dev/ptp0 as PTP clock[ 163.878610] Division by zero in kernel. [ 163.883019] CPU: 0 PID: 800 Comm: ptp4l Tainted: G O 5.4.106-g023faefa70 #1 [ 163.892235] Hardware name: Generic AM33XX (Flattened Device Tree) [ 163.898404] [<c010e6d8>] (unwind_backtrace) from [<c010b2f0>] (show_stack+0x10/0x14) [ 163.906898] [<c010b2f0>] (show_stack) from [<c09463bc>] (Ldiv0+0x8/0x10) [ 163.914062] [<c09463bc>] (Ldiv0) from [<bf0fb468>] (icss_iep_ptp_adjfreq+0xc4/0xfc [icss_iep]) [ 163.923078] [<bf0fb468>] (icss_iep_ptp_adjfreq [icss_iep]) from [<c070a2f4>] (ptp_clock_adjtime+0xf4/0x128) [ 163.933204] [<c070a2f4>] (ptp_clock_adjtime) from [<c0191bfc>] (pc_clock_adjtime+0x60/0xa0) [ 163.941925] [<c0191bfc>] (pc_clock_adjtime) from [<c018f320>] (__do_sys_clock_adjtime32+0x60/0x7c) [ 163.951214] [<c018f320>] (__do_sys_clock_adjtime32) from [<c0101000>] (ret_fast_syscall+0x0/0x54) [ 163.960384] Exception stack(0xc6887fa8 to 0xc6887ff0) [ 163.965464] 7fa0: 0003a248 00000000 ffffffdb bedf1a98 ffffffff bedf1a98 [ 163.974290] 7fc0: 0003a248 00000000 00000000 00000174 00000000 00000000 49f49000 00000000 [ 163.982801] 7fe0: 00038038 bedf1a84 000154cd 49fe8ad8 ptp4l[163.981]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[163.983]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[175.532]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[175.538]: selected best master clock 2c6b7d.fffe.49ec1f ptp4l[175.558]: assuming the grand master role ptp4l[176.540]: timed out while polling for tx timestamp ptp4l[176.540]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug ptp4l[176.540]: port 1: send sync failed ptp4l[176.541]: port 1: MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) ptp4l[192.543]: port 1: FAULTY to LISTENING on INIT_COMPLETE ptp4l[199.555]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[199.556]: selected best master clock 2c6b7d.fffe.49ec1f ptp4l[199.556]: assuming the grand master role [ 200.566428] prueth pruss_eth eth0: Dropped event waiting for tx ts. ptp4l[200.568]: timed out while polling for tx timestamp ptp4l[200.569]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug ptp4l[200.569]: port 1: send sync failed ptp4l[200.569]: port 1: MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) ptp4l[216.580]: port 1: FAULTY to LISTENING on INIT_COMPLETE ptp4l[223.755]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[223.755]: selected best master clock 2c6b7d.fffe.49ec1f ptp4l[223.755]: assuming the grand master role [ 224.766223] prueth pruss_eth eth0: Dropped event waiting for tx ts. ptp4l[224.768]: timed out while polling for tx timestamp ptp4l[224.768]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug ptp4l[224.768]: port 1: send sync failed ptp4l[224.769]: port 1: MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) ptp4l[240.772]: port 1: FAULTY to LISTENING on INIT_COMPLETE ptp4l[247.377]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[247.377]: selected best master clock 2c6b7d.fffe.49ec1f ptp4l[247.378]: assuming the grand master role [ 248.388557] prueth pruss_eth eth0: Dropped event waiting for tx ts. ptp4l[248.390]: timed out while polling for tx timestamp ptp4l[248.390]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug ptp4l[248.391]: port 1: send sync failed ptp4l[248.391]: port 1: MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) ptp4l[264.394]: port 1: FAULTY to LISTENING on INIT_COMPLETE ptp4l[270.913]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[270.914]: selected best master clock 2c6b7d.fffe.49ec1f ptp4l[270.914]: assuming the grand master role [ 271.925078] prueth pruss_eth eth0: Dropped event waiting for tx ts. ptp4l[271.926]: timed out while polling for tx timestamp ptp4l[271.926]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug ptp4l[271.927]: port 1: send sync failed ptp4l[271.927]: port 1: MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) [ 283.130444] ------------[ cut here ]------------ [ 283.135203] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:447 dev_watchdog+0x2c8/0x2cc [ 283.143519] NETDEV WATCHDOG: eth0 (prueth): transmit queue 0 timed out [ 283.150083] Modules linked in: xt_conntrack xt_MASQUERADE xfrm_user xfrm_algo xt_addrtype iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_tables x_tables br_netfilter bridge stp llc overlay ti_am335x_adc prueth icss_iep prueth_ecap pru_rproc pruss irq_pruss_intc pm33xx omap_aes_driver crypto_engine omap_crypto omap_sham libaes ti_emif_sram gpio_pisosr gpio_tpic2810 wkup_m3_ipc rtc_omap omap_wdt ti_am335x_tscadc pvrsrvkm(O) wkup_m3_rproc gpio_decoder input_polldev sch_fq_codel cryptodev(O) [ 283.197441] CPU: 0 PID: 0 Comm: swapper Tainted: G O 5.4.106-g023faefa70 #1 [ 283.205750] Hardware name: Generic AM33XX (Flattened Device Tree) [ 283.211989] [<c010e6d8>] (unwind_backtrace) from [<c010b2f0>] (show_stack+0x10/0x14) [ 283.219799] [<c010b2f0>] (show_stack) from [<c095f4e8>] (__warn+0xd0/0xe8) [ 283.226731] [<c095f4e8>] (__warn) from [<c095f598>] (warn_slowpath_fmt+0x98/0xc8) [ 283.234277] [<c095f598>] (warn_slowpath_fmt) from [<c08320f4>] (dev_watchdog+0x2c8/0x2cc) [ 283.242535] [<c08320f4>] (dev_watchdog) from [<c01825d8>] (call_timer_fn.constprop.0+0x24/0x98) [ 283.251304] [<c01825d8>] (call_timer_fn.constprop.0) from [<c0182b20>] (run_timer_softirq+0x4d4/0x554) [ 283.260684] [<c0182b20>] (run_timer_softirq) from [<c01022ac>] (__do_softirq+0xec/0x278) [ 283.268854] [<c01022ac>] (__do_softirq) from [<c012c1ec>] (irq_exit+0xdc/0xe0) [ 283.276146] [<c012c1ec>] (irq_exit) from [<c016adb8>] (__handle_domain_irq+0x58/0xa4) [ 283.284075] [<c016adb8>] (__handle_domain_irq) from [<c0101a8c>] (__irq_svc+0x6c/0xa8) [ 283.292041] Exception stack(0xc0f01f00 to 0xc0f01f48) [ 283.297145] 1f00: 00000000 00000041 05355555 c0f0e480 cf628400 00000001 c0f3d868 ebe0fe24 [ 283.305384] 1f20: e984373a 00000041 00000041 00000000 fffffff5 c0f01f50 c072f908 c072f910 [ 283.313609] 1f40: 200e0013 ffffffff [ 283.317158] [<c0101a8c>] (__irq_svc) from [<c072f910>] (cpuidle_enter_state+0x84/0x3a0) [ 283.325232] [<c072f910>] (cpuidle_enter_state) from [<c072fc68>] (cpuidle_enter+0x28/0x38) [ 283.333573] [<c072fc68>] (cpuidle_enter) from [<c0152110>] (do_idle+0x180/0x22c) [ 283.341031] [<c0152110>] (do_idle) from [<c01524a4>] (cpu_startup_entry+0xc/0x10) [ 283.348580] [<c01524a4>] (cpu_startup_entry) from [<c0e00d8c>] (start_kernel+0x43c/0x470) [ 283.356808] ---[ end trace c6ce4a9fed738e2b ]--- [ 283.361479] prueth pruss_eth eth0: xmit timeout ptp4l[287.930]: port 1: FAULTY to LISTENING on INIT_COMPLETE [ 288.090505] prueth pruss_eth eth0: xmit timeout [ 293.130474] prueth pruss_eth eth0: xmit timeout ptp4l[295.229]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[295.230]: selected best master clock 2c6b7d.fffe.49ec1f ptp4l[295.230]: assuming the grand master role ptp4l[296.231]: timed out while polling for tx timestamp ptp4l[296.231]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug ptp4l[296.231]: port 1: send sync failed ptp4l[296.232]: port 1: MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) [ 298.090577] prueth pruss_eth eth0: xmit timeout [ 303.050612] prueth pruss_eth eth0: xmit timeout [ 305.130614] EXT4-fs (mmcblk0p2): error count since last fsck: 10 [ 305.136709] EXT4-fs (mmcblk0p2): initial error at time 1624465224: htree_dirblock_to_tree:1017: inode 458466: block 3408835 [ 305.147917] EXT4-fs (mmcblk0p2): last error at time 1624465224: ext4_empty_dir:2872: inode 458475: block 3408840 [ 308.090644] prueth pruss_eth eth0: xmit timeout ptp4l[312.235]: port 1: FAULTY to LISTENING on INIT_COMPLETE [ 313.050671] prueth pruss_eth eth0: xmit timeout [ 318.090626] prueth pruss_eth eth0: xmit timeout ptp4l[319.987]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[319.987]: selected best master clock 2c6b7d.fffe.49ec1f ptp4l[319.988]: assuming the grand master role ptp4l[320.989]: timed out while polling for tx timestamp ptp4l[320.990]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug ptp4l[320.990]: port 1: send sync failed ptp4l[320.990]: port 1: MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) [ 323.050776] prueth pruss_eth eth0: xmit timeout
Could TI provide us with some much needed help? To get the PTP working as in 6.3.0.
Also what changes are required to also have the PPS working?
Thanks,
José Ferreira