Jetson Xavier NX - Configure GPIO11 as interrupt pin

I am using Jetson Xavier NX (Dev kit) and trying to bring-up Wi-Fi SDIO on M.2 Key E interface. I am able to download firmware to the Wi-Fi chip and do the basic test. We want to have out-of-band SDIO interrupt option. So we have routed GPIO11 (40-pin header pin31) to M.2 Key E interface (pin 21). I don’t see the interrupt received by the host (Xavier NX). I see no records under “/proc/interrupts”. I would like to get your suggestions on how to properly configure GPIO11 as an interrupt pin. Here are some of the logs that i could share:

root@host:/sys/kernel/debug# cat /sys/kernel/debug/tegra_pinctrl_reg | grep pq6
Bank: 0 Reg: 0x02430030 Val: 0x0000005a -> soc_gpio42_pq6
root@host:/sys/kernel/debug# cat tegra_gpio | grep Q:6
Q:6 0x1 0x0 0x0 0x1 0x0 0x0

Whether the pinmux value needs to be changed in order to use GPIO11 as interrupt pin? If yes, can you please explain with some example on how to do this?

hello prah,

please also check Topic 192147 for GPIO interrupt configuration.

No luck on this yet. Here is my DTS entry:

        bcmdhd_wlan_0: bcmdhd_wlan@0 {
                compatible = "android,bcmdhd_wlan";
                sdhci-host = <&sdmmc3>;
                pwr-retry-cnt = <3>;
                wlreg_on-supply = <&wlreg_on>;
                interrupt-parent = <&tegra_main_gpio>;
                interrupts = <TEGRA194_MAIN_GPIO(Q, 6) IRQ_TYPE_EDGE_RISING>;
                interrupt-names = "host-wake";
                status = "okay";
        };

I believe if the driver was successful in registering the IRQ with kernel, then i should see it under /proc/interrupts. In this case, I don’t see it.

My first question is mainly on GPIO11 pin configuration, whether the default pinmux setting on this gpio is correct or do i need to change anything for interrupt usage? I think the pin is not set as an interrupt pin, and that’s the reason the driver has failed to register the IRQ.

hello prah,

it should be able to configured as interrupt,
could you please have an alternative way, taking gpio353 as an example,
here’re steps to enable rising interrupt and check events.

$ sudo -i
# echo 353 > /sys/class/gpio/export
# echo in > /sys/class/gpio/gpio353/direction
# echo rising > /sys/class/gpio/gpio353/edge
# cat /proc/interrupts | grep gpiolib

Hi @JerryChang ,

Working with sysfs works fine for GPIO11, as shown below:

root@ifxhost:/sys/class/gpio# echo 422 >export
root@ifxhost:/sys/class/gpio# cd gpio422
root@ifxhost:/sys/class/gpio/gpio422# cat value
0
root@ifxhost:/sys/class/gpio/gpio422# cat active_low
0
root@ifxhost:/sys/class/gpio/gpio422# cat direction
in
root@ifxhost:/sys/class/gpio/gpio422# cat edge
none
root@ifxhost:/sys/class/gpio/gpio422# cat /proc/interrupts | grep gpiolib
root@ifxhost:/sys/class/gpio/gpio422# echo rising >edge
root@ifxhost:/sys/class/gpio/gpio422# cat /proc/interrupts | grep gpiolib
324:          0          0          0          0  tegra-gpio 134 Edge      gpiolib

But I want to register the GPIO11 with “sdmmc” driver instead of “gpiolib”.

On further debugging, it was found that, call to enable_irq_wake() returned error (-22). And, this is because irq->desc has depth=0.

Does it mean any interrupt configuration issue? Could you please review my DTS entry given in my previous response?

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

hello prah,

is this already not used for sdcard detect in for Xavier NX?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.