Pps0 not showing after flashing

Hey, I have been trying to modify the dtb file to enable pps using one of the gpio pin, here is the procedure how I did it.

First, I added

pps {
gpios = <0x29 0x00 0x01>;
compatible = “pps-gpio”;
assert-falling-edge;
status = “okay”;
};

in the dts file and converted to dtb and put the dtb under Linux_for_Tegra/kernel/dtb folder on the host machine.

Then, by setting the Orin in recovery mode, I flashed the ./flash.sh within Linux_for_Tegra.

However, after the Orin finished flashing, I checked the /dev/pps, there is not a pps0 under this folder, then I tried to use dmsg and searched for all the messages related to pps, I got this error:

/dev$ dmesg |grep pps
[ 0.088928] pps_core: LinuxPPS API ver. 1 registered
[ 0.088934] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it
[ 2.634113] OF: /pps: could not get #gpio-cells for /cbb/p2u@03e60000
[ 2.638361] pps-gpio pps: failed to request PPS GPIO
[ 2.643345] pps-gpio: probe of pps failed with error -22

I wonder if there is a problem with the procedure or because of the pin I have been setting for pps. Could someone show me which pin should I set for enabling the pps, then what modification should be made on .dts file correspondingly for the configuration, and the right way to enable pps and check if it is working. Thanks!

hello yezelin2018,

may I know which GPIO pin, i.e. gpios = <0x29 0x00 0x01>; you’re used to enable pps-gpio?
it looks you’re not able to request PPS GPIO, you may have a workaround to build PPS-GPIO driver as a module which load after the kernel setup.
or, please have below kernel changes to avoid probe failed.
for example, public_sources/kernel_src/kernel/kernel-5.10/drivers/pps/clients/pps-gpio.c

static int pps_gpio_probe(struct platform_device *pdev)
{
...
	} else {
		ret = pps_gpio_setup(pdev);
		if (ret)
-			return -EINVAL;
+			return ret;
	}

you may see-also similar discussion thread, such as Topic 224203 for reference,
thanks

I am planning to use Pin31, but I think the hex number is not a match, is there any hint for it, thank!

hello yezelin2018,

please check pinmux spreadsheets, pin-31, CAN0_DOUT is by default configured as SFIO in the DevKits.
you may update the pinmux to modify this pin as GPIO for your usage. please see-also Changing the Pinmux.
thanks

Hi Jerry,
There is a PIN that is setup by default as INPUT on the 40-pin connector that we could use for PPS so we don’t have to change the pinmux? If there is what would be the
“gpios” value for that PIN?

Thanks!

hello bastibr8yu,

please check you’ve device tree settings to define this pin as… <&tegra_main_gpio TEGRA234_AON_GPIO(AA, 0) 0>;