Pps_gpio interrupt not asserted

Hi,
We use Orin NX on a custom carrier board with JP6.1.
I posted a question here:

but now I think I see a more focused problem: I don’t receive an interrupt at all.
I followed after many related posts regarding this matter and this is where I got so far:

  1. The GPIO is PEE.02
    sudo cat /sys/kernel/debug/gpio output:

gpio-341 (PEE.02 |pps_gpio ) in lo IRQ

Full output:
sys_debug_gpio.log (6.9 KB)

The pin is configured as input by gpio generated by execl sheet:
gpio@c2f0000 {
gpio-init-names = “default”;
gpio-init-0 = <&gpio_aon_default>;

	gpio_aon_default: default {
		gpio-input = <
			TEGRA234_AON_GPIO(EE, 2)
			TEGRA234_AON_GPIO(EE, 4)
			TEGRA234_AON_GPIO(CC, 2)
			TEGRA234_AON_GPIO(CC, 3)
			>;
		gpio-output-low = <
			TEGRA234_AON_GPIO(CC, 0)
			TEGRA234_AON_GPIO(CC, 1)
			TEGRA234_AON_GPIO(AA, 4)
			>;
		gpio-output-high = <
			TEGRA234_AON_GPIO(AA, 5)
			TEGRA234_AON_GPIO(BB, 3)
			>;
	};
};
  1. The interrupt is registered.
    cat /proc/interrupts output:

291: 0 0 0 0 c2f0000.gpio 25 Edge pps_gpio.-1

Full output:
proc_interrupts.log (13.8 KB)

  1. I modified the pps-gpio for additional info and load it as a module.
    dmesg output after insmod:

[ 293.029383] pps-gpio: Probing PPS GPIO driver
[ 293.029392] pps-gpio: Now setting up GPIO…
[ 293.029393] pps-gpio: Setting up GPIO
[ 293.029436] pps-gpio: Acquired GPIO: pin number: 341
[ 293.029439] pps-gpio: Assert falling edge: 1
[ 293.029441] pps-gpio: Mapping GPIO to IRQ…
[ 293.029492] irq: IRQ291: trimming hierarchy from :bus@0:pmc@c360000
[ 293.029497] pps-gpio: GPIO mapped to IRQ: 291
[ 293.029498] pps-gpio: Registering PPS source…
[ 293.029660] pps pps1: new PPS source pps_gpio.-1
[ 293.029664] pps-gpio: PPS source registered successfully
[ 293.029665] pps-gpio: Requesting IRQ handler…
[ 293.029666] pps-gpio: IRQ trigger flags: 2
[ 293.029700] pps-gpio: IRQ successfully requested: 291
[ 293.029702] pps pps1: Registered IRQ 291 as PPS source

Full log:
dmesg.log (61.1 KB)

  1. I tried various DT settings (following several posts here). Currently the dt node is:

pps_gpio {
interrupts = <0x22 0x02>;
assert-falling-edge;
interrupt-parent = <0x105>;
compatible = “pps-gpio”;
status = “okay”;
phandle = <0x3a2>;
gpios = <0x105 0x22 0x00>;
};

and in source:

pps: pps_gpio
{
compatible = “pps-gpio”;
gpios = <&gpio_aon TEGRA234_AON_GPIO(EE, 2) GPIO_ACTIVE_HIGH>;
status = “okay”;
interrupts = <TEGRA234_AON_GPIO(EE, 2) IRQ_TYPE_EDGE_FALLING>;
assert-falling-edge;
interrupt-parent = <&gpio_aon>;
};

Full dt:
dt.log (330.7 KB)

  1. We do noticed that the IRQ is connected to bus@0:pmc@c360000

irq: IRQ291: trimming hierarchy from :bus@0:pmc@c360000

Is this valid? shouldn’t it connected to gpio controller interrupts?

  1. user@target:~$ sudo cat /sys/kernel/debug/pinctrl/c360000.pmc/gpio-ranges

GPIO ranges handled:

I think there is something wrong with the interrupt config. Its not asserted when we toggle the signal that serves as pps source.
We do see the gpio value changes but don’t get interrupt in the system:

user@target:~$ gpioget /dev/gpiochip1 25
1
user@target:~$ gpioget /dev/gpiochip1 25
0
user@target:~$ gpioget /dev/gpiochip1 25
1
user@target:~$ gpioget /dev/gpiochip1 25
0
user@target:~$ gpioget /dev/gpiochip1 25
1
user@target:~$ gpioget /dev/gpiochip1 25

Maybe the interrupt is not connected to the right controller? maybe it masked? how can we verify all these things?

Thanks

In addition,
I saw in old posts that there is a driver called: nvpps.
We don’t use it. We use the in-tree pps-gpio driver.
Is it possible they are conflicting? maybe we need to use nvpps?

Thanks

Hi bsp_dev,

pps-gpio should work in your case.

Do you add this by yourself?

It seems you’ve gotten expected PPS signal.
Interrupt configuration is not needed for pps-gpio.
May I know what’s your use case and requirement?

Yes I added by myself. I tried whiteout this as well. I tried a mix of settings according to different posts.

Yes we can see the GPIO input value changes.

The use case is to use a PPS generator and provide 1PPS sync for user apps.

Currently I use a power supply to simulate the PPS source. I just power it on and off in order to change the GPIO value.

Since we see the value changes, I suspect the interrupt mechanism.

It seems you have to configure interrupt gpio in gpio@c2f0000 { rather than pps: pps_gpio node.

OK, that’s my first time working with interrupts in dt.
So now the new pps node will be:

pps: pps_gpio
{
compatible = “pps-gpio”;
gpios = <&gpio_aon TEGRA234_AON_GPIO(EE, 2) GPIO_ACTIVE_HIGH>;
status = “okay”;
//interrupts = <291 IRQ_TYPE_EDGE_FALLING>;
assert-falling-edge;
//interrupt-parent = <&gpio>;
};

and the current node is:

gpio_aon: gpio@c2f0000 {
compatible = “nvidia,tegra234-gpio-aon”;
reg-names = “security”, “gpio”;
reg = <0x0 0x0c2f0000 0x0 0x1000>,
<0x0 0x0c2f1000 0x0 0x1000>;
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
#interrupt-cells = <2>;
interrupt-controller;
#gpio-cells = <2>;
gpio-controller;
gpio-ranges = <&pinmux_aon 0 0 32>;
};

Which config I need to modify in gpio@c2f0000

Sorry that it seems I had some mis-understanding before.

Could you try to configure it as following to check if you can get the expected count through /proc/interrupts?

pps: pps_gpio
{
	compatible = "pps-gpio";
	gpios = <&gpio_aon TEGRA234_AON_GPIO(EE, 2) GPIO_ACTIVE_HIGH>;
	status = "okay";
	interrupts = <TEGRA234_AON_GPIO(EE, 2) IRQ_TYPE_EDGE_RISING>;
	assert-falling-edge;
	interrupt-parent = <&gpio_aon>;
};

I tried an still don’t see the interrupt.

dt:
dt.txt (330.7 KB)

dmesg:
dmesg.txt (61.7 KB)

Could you also share the result of $ /proc/interrupts and $ zcat /proc/config.gz | grep "PPS" on your board?

Have you tried running ppstest?

$ sudo apt update
$ sudo apt install pps-tools
$ sudo ppstest /dev/pps1

conifg_pps.log (168 Bytes)
proc_inter.log (13.8 KB)
pps.log (456 Bytes)

Could you refer to Enable PPS on Jetson Linux 35.3.1 for Xavier AGX - #5 by emil.martens to enable all PPS related kernel config to check if it could help?

You log and configurations look good to me but it seems ppstest not working in your case.
Have you gotten a devkit to reproduce the similar issue?

[   61.265776] pps-gpio: Probing PPS GPIO driver
[   61.265785] pps-gpio: Now setting up GPIO...
[   61.265786] pps-gpio: Setting up GPIO
[   61.265831] pps-gpio: Acquired GPIO: pin number: 341
[   61.265834] pps-gpio: Assert falling edge: 1
[   61.265835] pps-gpio: Mapping GPIO to IRQ...
[   61.265881] irq: IRQ291: trimming hierarchy from :bus@0:pmc@c360000
[   61.265884] pps-gpio: GPIO mapped to IRQ: 291
[   61.265886] pps-gpio: Registering PPS source...
[   61.266089] pps pps1: new PPS source pps_gpio.-1
[   61.266093] pps-gpio: PPS source registered successfully
[   61.266094] pps-gpio: Requesting IRQ handler...
[   61.266095] pps-gpio: IRQ trigger flags: 2
[   61.266139] pps-gpio: IRQ successfully requested: 291
[   61.266141] pps pps1: Registered IRQ 291 as PPS source

Do you add above debug message in pps-gpio driver manually?
Please share your pps-gpio.c for further check.

The gpio int mapping was wrong. We fixed it and now its working. Thank you very much for your help and patience!

1 Like