What exactly is the nvpps driver supposed to do?

and how is it supposed to be used?

In reference to this thread…

I’m trying to figure out exactly what the nvpps driver is supposed to do. I have the device tree set to route AON_GPIO DD-00 (40-pin header pin 27) to the driver and it creates /dev/nvpps0 but I’m not sure how to use it in relation to pps-gpio, ntpd and ptp4l.

From looking at the code, it looks like it’s supposed to synchronize the phc clock to the pps input but I’m not seeing how or where it’s used.

I do have AON_GPIO CC-07 (40-pin header pin 28) to pps-gpio which does work fine.

And… ptp-notifier? What’s its job?
And… How does the Generic Timestamp Engine fit in?

I spent the weekend wrestling with nvpps and have it acting as a system pps source and creating a /dev/ppsX node which ntpd is happy with. At least this way you don’t need pps-gpio and nvpps loaded and you only need 1 gpio pin allocated. It does appear to be using the Generic Timestamp Engine which is good but I still can’t figure out what the driver is used for. :)

  • It gets the phc time but never sets it.
  • It exposes ioctls via /dev/nvpps0 but I can’t find any reference to those ioctls anywhere else in the source code.

hello gtj,

we do not use nvpps driver, we can use gpio-pps instead.
BTW,
you might refer to post #16 from Topic 124003, which produce pps signals on GPIO.
this driver is to feed pps signals in GPIO and capture timestamps to synchronize system every second.
thanks

I’ve seen that post (and many others) but I already have an external pps source. What I was looking for was the lowest latency/jitter mechanism to sync the PHC to that pps source so it can act as a grand master clock. Seeing as nvpps has references to the eqos driver registers, I was hoping it would do that without having to come out to userspace.

My questions still stand though… what are/were nvpps and ptp_notifier supposed to do?

@JerryChang , @gtj
Given I intend to use Jetson NX as time server broadcasting via ptp to other Jetsons the time that comes through connected to Jetson NX GPS unit with pps.
Shall I use nvpps? gps/pps-io? both? neither of the two?
What will work with better latency? with higher frequency? with better accuracy?

nvpps is used to generate a pps signal on a gpio so unless you actually need to feed a PPS signal to something else, you shouldn’t use it. You should use pps-gpio to take a PPS signal in from the GPS and it should be mapped to a pin on the AON/GTE gpio which are…

Signal Header
Pin
GPIO
GPIO12 15 GPIO3_PCC.04
I2C0_SDA 27 GPIO3_PDD.00
I2C0_SCL 28 GPIO3_PCC.07

thank you for following up!
it seems as the only need to pas pps to timeserver it is required to use gps pps gpio
but could we improve it if to apply RTOS Sensor Processing Engine[SPE] patch so that a cortex R5 will be in AONon that gpio?

I meant to reply in your other thread but I forgot. It sounds like an interesting ideas but i have no experience in that area.

@gtj
their patch configures pin 27 as INPUT
so assigning it to pps we would change the gpio the in the code below [ default pin7]

compatible = "pps-gpio";
				gpios = <&tegra_main_gpio 148 1>;

to which statement do we change the latter line to match 27 pin? that seems identified at jetsonhacks gpiotable as [ I2C0_SDAI2C Bus 1].
we can use it for pps input, right?
reference

  1. NVIDIA Jetson Xavier NX GPIO Header Pinout - JetsonHacks
  2. Time sensitive networking [TSN] on NX - #30 by gtj

Actually you have to tell it to use the aon gpio controller specifically…

gpios = <&tegra_aon_gpio TEGRA194_AON_GPIO(DD, 0) GPIO_ACTIVE_HIGH>;
which resolves to
gpios = <&tegra_aon_gpio 24 0>;
GPIO_ACTIVE_HIGH actually = 0.

@gtj Thank you I will try.

It seems we would be also wishing to get NMEA [ via UART SPE].
But examples only define uart SPE for AGX Xavier
uart.md (3.9 KB)
They pointed out that SPE UART will only work on AGX, as on NX these are occupied.
So it will be a trial for AGX to get both pps/ UART on SPE mode