Select GPIO in DTS throws errors when building kernel

On our board we have a GPIO I2C multiplexer. We have used this chip with the TX1 module attached to our board but when we attempt to use it with the TX2 we have observed an issue.

In order to use this multiplexer I configure two pins to be an output. I looked up the port and offset for this particular pin (G7) within the Pinmux Spreadsheet, this yields Port ‘V’ offset 5

Within my dts file I use the macro TEGRA_MAIN_GPIO(PORT, OFFSET) to get the correct address.

I’ve verified this works with other GPIOs but when I try and compile the kernel with

TEGRA_MAIN_GPIO(V, 5)

I get this error:

Error: /home/cospan/Projects/nvidia_3.0/Linux_for_Tegra/sources/kernel/kernel-4.4/../../hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/tegra186-camera-mit-uav-revb.dtsi:40.2-9 syntax error
FATAL ERROR: Unable to parse input tree

If I temporarily change the GPIO to a free GPIO things build just fine but I need this pin.

Is there something I’m doing wrong?

Thanks for any help,

Dave

Please use TEGRA_AON_GPIO() to define the pin number.

#define TEGRA_AON_GPIO(bank, offset) \
	((TEGRA_GPIO_BANK_ID_##bank * 8) + offset)

#endif

You can also find the port # define in the tegra186-gpio.h
For TX2 there have two group GPIO PIN, port V is in the AON group. You can find which port define in which group.

…/kernel/kernel-4.4/include/dt-bindings/gpio/

Shane,

TEGRA_AON_GPIO worked! I still got some other debugging to do but this seems to have solved the build issue.

just for my edification, in order to use the GPIO on the AON processor does the main processor send a command to the AON processor to set that GPIO?

It seems like the main processor is using the AON processor as a GPIO expander for this case.

Dave