ENET-1588 PTP with hardware timestamp on UDOO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ENET-1588 PTP with hardware timestamp on UDOO

1,341 Views
chengshiunlee
Contributor I

Hi Yuri,

I'm using UDOO quad and I stuck in this 1588 issue two weeks.

My timestamp wasn't counting, I want to put timestamp in my ethernet packet but the program caught the same timestamp again and again. I read all of the documents about this issue but still confused.

1. How to select the GPIO 16 to ALT2 mode? How to set the SION bit? Using command or I need to modify the kernel source code?

2. If I use the image which is provided by UDOO, can I still enable the 1588 feature? 

 

Best Regards,

Jeffrey.

0 Kudos
4 Replies

851 Views
chengshiunlee
Contributor I

Hi Yuri,

Here is my device tree setting. Does it mean that I'm using the external clock source? How can I modify this part? Sorry about my annoying questions, I'm new here.

imx6q-udoo {
pinctrl_hog: hoggrp {
fsl,pins = <
// Internal GPIOs
MX6QDL_PAD_NANDF_D4__GPIO2_IO04 0x80000000 // 5v enable
MX6QDL_PAD_NANDF_CS0__GPIO6_IO11 0x80000000 // Vtt enable

MX6QDL_PAD_DISP0_DAT5__GPIO4_IO26 0x80000000 // Debug UART (J18)

MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x80000000 // USB hub reset
MX6QDL_PAD_NANDF_CS2__CCM_CLKO2 0x130b0 // USB hub clock
MX6QDL_PAD_EIM_WAIT__GPIO5_IO00 0xb0b1 // USB OTG select

MX6QDL_PAD_NANDF_D5__GPIO2_IO05 0x80000000 // SD card power
MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x80000000 // SD card detect

MX6QDL_PAD_GPIO_16__GPIO7_IO11 0xb0b1 // SAM3X OTG vbus_en
MX6QDL_PAD_SD4_DAT7__GPIO2_IO15 0x80000000 // SAM3X usb host
MX6QDL_PAD_GPIO_3__GPIO1_IO03 0x30b1 // Arduino pinout pin 12

MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x80000000 // LVDS panel on (CN13)
MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 // LVDS backlight on (CN13)

MX6QDL_PAD_CSI0_DAT18__GPIO6_IO04 0x1f071 // CSI camera enable (CN11)
MX6QDL_PAD_CSI0_DAT19__GPIO6_IO05 0x1f071 // CSI camera reset (CN11)
MX6QDL_PAD_CSI0_MCLK__CCM_CLKO1 0x130b0 // CSI master clock (CN11)

>;
};

pinctrl_enet: enetgrp {
fsl,pins = <
MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x80000000 /* RGMII_nRST */
MX6QDL_PAD_EIM_EB3__GPIO2_IO31 0x80000000 /* EN_ETH_PWR */
>;
};

Regards,

Jeffrey.

0 Kudos

851 Views
Yuri
NXP Employee
NXP Employee

Hello,

 

  For UDOO (linked below), external clock from PHY is applied as Ethernet

reference clock. GPIO_16 is used as VBUS_EN, but should be non connected

to allow the internal time stamp clock to route through its IOMUX cell to the
RGMII interface; program GPR1[21] = 1.

 

 Note, there is no phc2sys running in Your system.

 

All-You-Need ARM Cortex A9 SBC Development Board | UDOO 

Regards,

Yuri.

0 Kudos

851 Views
Yuri
NXP Employee
NXP Employee

Hello,

  Please look at my comments below.

 

1.

  Is internal clocking used in Your case (GPIO_16 left floating) ?

 

From Table 2-9 (Gigabit Ethernet Recommendations) of Hardware Development

Guide for i.MX 6, for IEEE-1588 timestamp operation, the GPIO_16 ball should be left

non-connected to allow the internal time stamp clock to route through its IOMUX cell

to the RGMII interface, assuming program GPR1[21] = 1.

 

http://cache.nxp.com/assets/documents/data/en/user-guides/IMX6DQ6SDLHDG.pdf 

 

 

2.

  Please check software, using section "How to Use the Stacks in Linux OS" in
"ENET IEEE-1588 Driver" chapter of "i.MX_Linux_Reference_Manual.pdf".

 

Also, note :

  to activate PPS on master the phc2sys should be run with ptp4l.

 

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

851 Views
chengshiunlee
Contributor I

Hi Yuri,

Thanks for your reply.

How can I know internal clock is using or not? I didn't connect gpio16 to anything in my device, does it means that my device(UDOO Quad) is using the internal clock?  I have tried the "i.MX_Linux_Reference_Manual.pdf" commands and these pictures are my testing result. You can see that the follow_up packet send the same timestamp(red part) again and again. Does it means that my device's 1588 function didn't work? I'm trying to port IEEE 802.1 AS software stack on i.mx6.

Command:

udoo timestamp issue.PNG

Wireshark:

wireshark.png

Regards,

Jeffrey.

0 Kudos