Thanks for the feedback.
The issue actually lied in my original config:
-CONFIG_PPS_CLIENT_GPIO=y
+CONFIG_PPS_CLIENT_GPIO=m
If you make this change, it seems to activate pps_gpio
, you must run sudo modprobe pps_gpio
and then you can find the driver in lsmod | grep gpio
.
If you leave the config file as CONFIG_PPS_CLIENT_GPIO=y
, then pps_gpio
is always available, but does NOT show up in lsmod | grep gpio
.
I did end up getting this overlay to work for pin 16 on the header with the CONFIG_PPS_CLIENT_GPIO=y
config using this source (dts):
/dts-v1/;
/plugin/;
/ {
compatible = "nvidia,p3737-0000+p3701-0005";
overlay-name = "PPS Overlay";
jetson-header-name = "Jetson 40pin Header";
fragment@0 {
target-path = "/";
__overlay__ {
pps: pps-gpio {
status = "okay";
compatible = "pps-gpio";
gpios = <&gpio 16 1>;
assert-falling-edge;
};
};
};
};
The overlay can be turned in a blob overlay (dtbo) with dtc -I dts -O dtb -o /boot/pps-overlay.dtbo /boot/pps-overlay.dts
And adding the overlay to the boot option in /boot/extlinux/extlinux.conf
+OVERLAYS /boot/pps-overlay.dtbo
This doesn’t require any of the source code from the kernels and is less likely to break your setup, so I’m pleased with the result. For anyone wondering how 16
comes from Pin 16
on the 40 pin header, it took a bit of digging. Pin 16
is called GPIO8
, but is actually gpio-357
or PC.00
on the pinmux sheet. Looking into the header file using grep -rn "TEGRA_GPIO"
in the kernel source files, we can find that the function TEGRA_GPIO
is defined as:
#define TEGRA_GPIO(port, offset)
((TEGRA_GPIO_PORT_##port * 8) + offset)
So gpio PC.00
hasPC
from #define TEGRA_GPIO_PORT_C 2
, and offset
is the value 00
, which results in 16
.
With one last confirmation, run sudo cat /sys/kernel/debug/gpio | grep PC.00
to see the output:
gpio-357 (PC.00 |pps-gpio ) in lo IRQ ACTIVE LOW
Success!