Trying to get 1588 working on imx8 mini

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

Trying to get 1588 working on imx8 mini

2,241 Views
hutchman
Contributor II

Hi,

I found this link How to get IEEE 1588 1PPS on i.MX6Q?  talking about getting the 1PPS signal working for 1588.

I made the change to the fec_ptp.c driver and I "think" I have pinmux setup correctly in my .dts ... but I don't get a signal.

So next I thought I'd wiggle the pin manually using the gpiolib echo method just to verify I had things setup correctly.

I changed pinmux to use GPIO1_IO09 instead of 1588 then tried:

echo 41 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio41/direction

echo 1 > /sys/class/gpio/gpio41/value

echo 0 > /sys/class/gpio/gpio41/value

.. and don't see the pin wiggle.

So next I moved to more drastic measures and used devmem2 to set direction in GPIO Data Direction register (0x30200004) for bit 9 and then wrote to GPIO Data Register to toggle bit 9 and I can wiggle the pin that way (directly writing to registers) so I know hardware is good, I'm on the right pin etc.

My question is, what should the i.mx8 mini dts look like to setup 1588 signal?  (MX8MM_IOMUX_GPIO1_IO09_ENET1_1588_EVENT0_OUT)

Any ideas why the echo commands above didn't wiggle the pin?  Is gpio41 not the right pin number for GPIO1_IO09???

Thanks for any pointers.

Background, I have the linuxptp 2.0 stack running and it is syncing with my master clock so I don't get any errors when I run echo 1 > /sys/class/ptp/ptp0/pps_enable

Regards,

Brian

0 Kudos
4 Replies

1,826 Views
hutchman
Contributor II

Ok, update.  I figured out the math for GPIO names (to use gpiolib with /sysfs echo commands) is:

linux gpio number = (gpio_bank - 1) * 32 + gpio_bit

... so I should be using gpio9, not gpio41.  Now I'm wiggling the proper line with echo commands so that's one mystery solved.

1,826 Views
eric_m_will
Contributor I

Hi Brian,

It appears that I am attempting to retrace your steps. I, too, am trying to get an ENET-1588 1 PPS signal and route it to an observable pin on the i.MX8M Mini EVK. I don't quite follow what you did. Where were you able to observe the 1 PPS signal? What did you have to do to make it happen?

Also, I am running ptp4l on the A53 to get the board to sync to an external 1588 master. You said you were running the linuxptp 2.0 stack. Is that what is running underneath the user-mode ptp4l?

Thanks in advance for the help.

Eric

0 Kudos

1,827 Views
hutchman
Contributor II

Sorry, just now seeing this.

The 1PPS shows up on ENET_1588_EVENT0_OUT pin when the pinmux is set properly to get that function.

If you have ptp4l going and syncing with grand master, and the 1588_EVENT0_OUT pin configured correctly, when you do echo 1 > /sys/class/ptp/ptp0/pps_enable then you should see a pulse on the 1588_EVENT0_OUT pin.  You need a good scope as the pulse is really quick.  The link I referenced talked about changing the driver from a "pulse" to a "toggle" to make it easier to see for testing.

I'm using a 1588 profile that required me to fetch the 2.0 release of ptp4l but normal 1588 worked without it.

Regards,

Brian

0 Kudos

1,826 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Brian Hutchinson,

I'm glad that you found out what the problem was. Thanks for sharing your findings. I'm sure they will helps other Community users.

Regards,

0 Kudos