PPS drivers not installing

Hello,

I’m having trouble getting the pps driver to install. So far I’ve followed these
steps

  1. I added the pps device to the device tree:
    sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
pps {
        gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(I, 4) GPIO_ACTIVE_LOW>;

        compatible = "pps-gpio";
        status = "okay";
    };
  1. I added PPS to the kernel configuration, in .config
#
# PPS support
#
CONFIG_PPS=y
CONFIG_PPS_DEBUG=y

#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
CONFIG_PPS_CLIENT_LDISC=y
CONFIG_PPS_CLIENT_GPIO=y
  1. Recompiled and installed the kernel via the typical method I’ve used for other device tree and device driver installs.

But /dev/pps* or /sys/class/pps/* are empty. Any ideas why this isn’t working? dmesg gives the following:

$ dmesg | grep pps
[    0.315274] pps_core: LinuxPPS API ver. 1 registered
[    0.315300] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.709183] pps_ldisc: PPS line discipline registered

I’ve studied the following resources:

https://devtalk.nvidia.com/default/topic/1014936/jetson-tx1/jetson-tx1-tx2-pps-pulse-per-second-on-pin-b18/
http://connecttech.com/resource-center/kdb349-gps-time-synchronization-linux/
https://github.com/madisongh/meta-tegra/wiki/PPS-GPIO-Support-on-Jetson-TX1-TX2
https://github.com/beagleboard/meta-beagleboard/blob/master/common-bsp/recipes-kernel/linux/linux-mainline-3.8/pps/0003-pps-gpio-add-device-tree-binding-and-support.patch

and I verified that the KTIMER works.

Many thanks for your help

Do check “/proc/device-tree/” and see if your tree changes actually made it in. FYI, procedures for install of device tree has changed a lot between every recent release. If this is in place, then you probably want to add more details on how any related hardware is physically connected.

The pps node is not showing up in the device tree (/pro/device-tree/). Does it matter where the pps block is located in the device tree source, so long as the file is loaded by the device tree compiler? I have some uart changes to the device tree in the same source file which are working.

If dtc was able to compile from source form to binary form (the dtb file), then probably it isn’t an issue of how the device tree is formatted. However, different releases of L4T have different methods of updating the device tree. There could be issues with your particular tree, but it sounds like the tree changes never made their way in. How did you update the tree?

To update the tree and kernel I did the following :

cd ~/Jetson/64_TX2/Linux_for_Tegra_tx2/sources/kernel/kernel-4.4
export TEGRA_KERNEL_OUT=output
export CROSS_COMPILE=aarch64-linux-gnu-
export CROSS32CC=arm-linux-gnueabi-gcc
export ARCH=arm64
mkdir $TEGRA_KERNEL_OUT
make O=$TEGRA_KERNEL_OUT tegra18_defconfig

Then I modified the output/.config to add the CONFIG_PPS_CLIENT_LDISC and CONFIG_PPS_CLIENT_GPIO.

make O=$TEGRA_KERNEL_OUT zImage
make O=$TEGRA_KERNEL_OUT dtbs
make O=$TEGRA_KERNEL_OUT modules
make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=modules_out
cd output/arch/arm64
tar -zcvf boot.tgz boot
scp boot.tgz ubuntu@target:~/tmp/

cd ../../modules_out/lib
tar -zcvf modules.tgz modules
scp modules.tgz ubuntu@target:~/tmp/

ssh ubuntu@target
cd tmp
tar -zxvf boot.tgz
tar -zxvf modules.tgz
sudo cp -r modules/4.4.38+ /lib/modules/
sudo cp boot/Image boot/zImage /boot/
sudo cp boot/dts/*.dtb /boot/
sudo cp /boot/tegra186-quill-p3310-1000-c03-00-base.dtb /boot/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb
reboot

And to check that the pps is in the DT:

$ cd ../output/arch/arm64/boot/dts/
$ dtc -I dtb -O dts -o ~/tmp/dt.dts tegra186-quill-p3310-1000-c03-00-base.dtb
$ grep pps -B 5 -A 5 ~/tmp/dt.dts 
	};

	pps {
		gpios = <0x12 0x44 0x1>;
		compatible = "pps-gpio";
		status = "okay";
	};

	hsp_top {
		status = "okay";

The kernel update was probably ok, but verify you have modules at “/lib/modules/$(uname -r)/”. However, if this is R28.2, then files in “/boot” are no longer used for device tree. You’ll need to use the flash tool for this since the tree is now a partition (and possibly signed). Is this R28.2 (“head -n 1 /etc/nv_tegra_release”)?

Ah, that was the problem! I needed to update the device tree using flash.sh

$ cd ~/JetPack-3.2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4/output/arch/arm64/boot/dts
$ cp tegra186-quill-p3310-1000-c03-00-base.dtb ~/JetPack-3.2/64_TX2/Linux_for_Tegra/kernel/dtb/
$ cd ~/JetPack-3.2/64_TX2/Linux_for_Tegra
$ sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1

Now ppstest /dev/pps0 appears to work.

Thank you so much.