GPIO Kernel explaination FAN Example JEtson Xavier NX

Hello
I was investigating on how to change DTSI files to accomodate my backboard. I was searching for an example and I started from FAN PWM. As for the documentation and for the pinmux excel file, the FAN PWM must be connected on GPIO14, pin 230 of the Javier NX module p3668. From the excel file 1.06 I see that this GPIO is placed in H-1, so I tried to find it inside kernel sources. Searching inside the kernel distribution (I’m using JP 32.7.2) I can’t find any reference to it (only inside .h files)

nvidia@ubuntu:~/JetsonXavier/kernel_src/hardware$ grep -R “MAIN_GPIO(H, 1” *

nvidia/soc/tegra/kernel-include/dt-common/jetson/tegra186-p3509-0000-p3636-0001.h:#define HDR40_PIN21_GPIO TEGRA_MAIN_GPIO(H, 1)

After I searched for pwm fan following the DTSI chain starting from

nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-p3509-0000-a00.dtsi

As I can see, the gpio pwm is defined in

nvidia/platform/t19x/common/kernel-dts/t19x-common-platforms/tegra194-pwm-fan.dtsi

[LINE34] pwm_gpio = <&tegra_aon_gpio TEGRA194_AON_GPIO(CC, 4) GPIO_ACTIVE_LOW>;

But this CC-4 gpio refears to GPIO12 (from the excel file 1.06). So…what I’m missing? Why this difference and where is the configuration of the pin GPIO14?

Thanks

hello f.ortolano,

there’s different pinmux spreadsheets for AGX Xavier and Xavier NX.
this is used by AGX Xavier, as you can see in AGX Xavier’s pinmux, it’s indeed fan_pwm for CC.4

please see-also pinmux config, Xavier NX to define this pin as SFIO, i.e. GP_PWM6
for example, /bct/pinmux/tegra19x-mb1-pinmux-p3668-a01.cfg
pinmux.0x02434098 = 0x00000401; # soc_gpio13_ph1: gp, tristate-disable, input-disable, lpdr-disable
it’s device tree definition here for pwm-fan, which is using… tegra_pwm6

        pwm-fan {
                pwms = <&tegra_pwm6 0 45334>;
        tegra_pwm6: pwm@32d0000 {
                compatible = "nvidia,tegra194-pwm";
...

Hello JerryChang
Ok, in other words, if I understand right… if the GPIO functionality (called SFIO aka Special Funcion) is defined into pinmux, there is no needing to define something on kernel sources because it’s already configured for that purpose.
For Xavier NX p3668… I will not find nothing regarding for example GPIO14 (aka GP_PWM6) as this is configured by cboot using pinmux.
All the configured/used gpios inside kernel DTSI that I found will be referred to a GPIO configured as General Purpose inside pinmux and used in case of needing by the kernel modules.

It’s right?

hello f.ortolano,

yes, your understanding looks correct.

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