How to reuse gpio388 as a pps input in TX2?

Hi guys,
I am a noooob for learning TX2. I want to reuse gpio388 in J21 GPIO as PPS input in my tx2. However, after following the tutorial in this forum, I still cannot create a GPIO port to receive PPS. I have opened the PPS service when building the kernel.

I am curious about how and where to add the following statements in …/hardware/nvidia/.

pps{
gpio=<&tegra_main_gpio TEGRA_MAIN_GPIO(I,4) 0>;
compatible = “pps-gpio”;
status= “okay”;
};

Please help me to figure out this problem which has been confused me for a long time.
Thanks a lot.

hello lxyjoeylee,

were you able to see system filesystem node for PPS?
for example, $ ls /sys/class/pps/pps0/

whenever interrupt occurs on falling edge of signal of GPIO pin, timestamp will be captured and seen using,
$ cat /sys/class/pps/pps0/assert

Yep, Thanks for your replying. I can found the PPS node in /sys/class/pps/pps0/, but pps0’s name is ktimer. Actually, I want to receive PPS from GNSS device. How can I figure this?

hello lxyjoeylee,

were you talking about receiving GPS data from Global Navigation Satellite System (GNSS) device?
thanks

Actually, not full NMEA information, just a PPS signal output from GNSS board.
I want to receive this PPS signal to calibrate the local time and trigger other devices.
Thanks a lot.
PS: my OS is TEGRA-186

could you please also refer to this similar discussion thread for reference, Topic 124003, thanks

Thanks for giving such reference. I wonder that what function of Ktimer? Does it generate a “fake” pps signal? I want to receive PPS from GNSS device.

Thanks a lot.
Joey

And also I cannot find the gpio338 as pps-gpio in this directory:
sudo cat /sys/kernel/debug/gpio.

Is my dtb is incorrect?
Thanks a lot.

hello lxyjoeylee,

had you added pps{} device tree node into device tree, you may adding it anywhere inside dtb blob.
for example,

pps{
gpio=<&tegra_main_gpio TEGRA_MAIN_GPIO(I,4) 0>;
compatible = “pps-gpio”;
status= “okay”;
};

you may also disassembler the dtb file into text file for examination.
for example, $ dtc -I dtb -O dts -o output.txt tegra186-quill-p3310-1000-c03-00-base.dtb
thanks

yep, pps statement appers in the ouutput.txt.
image
However, I still cannot find the gpio388 port in cat / sys / kernel / debug / gpio.
What am I wrong?
Appreciate your replying.

please help me, thanks a lot.


is it corrected?


is it correct?? many thanks.

hello lxyjoeylee,

the device tree modification looks correct,
had you also enable CONFIG_PPS and CONFIG_PPS_CLIENT_GPIO configs in kernel ?
thanks

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Hi lxyjoeylee,

Have you managed to get issue resolved? Any update?