BBB pps0 assigned to serial4

I have a BeagleBone Black configured with U-Boot overlays for PPS input on header pin 9.12 and UART4 on 9.11 and 9.13. This is being fed from an AdaFruit Ultimate GPS breakout board.

Excerpt from /boot/uEnv.txt


No other mods were made to uEnv.txt. Initially when I set it up, all appeared good, with the PPS input getting assigned to /dev/pps0 Then all of a sudden on my last reboot the PPS input started getting assigned to /dev/pps1 and serial4 getting assigned to /dev/pps0 I noticed something like this before I installed the latest BBB debian image but dismissed it. Now that I see it again I have questions as to what is causing it. I need to be able to reliably predict what PPS device is getting assigned, as this BBB is being set up as a GPS NTP server using GPSD and Chrony. See dmesg output below.

[ 17.330602] pps_ldisc: PPS line discipline registered
[ 17.332357] pps pps0: new PPS source serial4
[ 17.332431] pps pps0: source “/dev/ttyS4” added

Then later in dmesg output…

[ 26.246745] pps pps1: new PPS source ocp:bs_pinmode_P9_12_0x27_pinm
[ 26.246871] pps pps1: Registered IRQ 88 as PPS source

Does anybody have any ideas as to what is causing this? The uEnv.txt mods above are the only system changes made other than doing apt-gets to install the necessary debian packages for ppstools, gpsd, man-db, and chrony. I also had to build and “make install” chrony from source in order to get PPS support built in. If the answer is that it’ll always be /dev/pps1 I’m OK with that. It’s just that it has flopped around on me a couple of times now for reasons I don’t understand. Now when I power-cycle or reboot the BBB, the chrony service will not start because it fails to open /dev/pps1 yet when I do a ppstest /dev/pps1 I see the PPS input coming in. Almost as if during startup the chrony service is trying to access /dev/pps1 before it is ready. If I then start chrony manually with systemctl start chrony, it starts up successfully.

debian@beaglebone:~$ uname -a
Linux beaglebone 4.4.91-ti-r133 #1 SMP Tue Oct 10 05:18:08 UTC 2017 armv7l GNU/Linux

I have discovered that gpsd was causing the PPS device to get created for /dev/ttyS4. I had to recompile gpsd to turn off PPS support and that solved that particular part of the problem.

The issue I’m running into now is that when systemd goes to start chronyd, the kernel has not yet created the PPS source /dev/pps0 corresponding the the NF3H-PPS-00A0.dtbo overlay. Does anybody know how I can prevent chronyd from starting before /dev/pps0 is created by the kernel?