Hello,
I need to set an input and output GPIO in 40 pin header port using AON GPIO.
The AON GPIO for 40 pin header are:
Pin GPIO
31 GPIO3_PAA.00
29 GPIO3_PAA.01
33 GPIO3_PAA.02
37 GPIO3_PAA.03
32 GPIO3_PBB.00
16 GPIO3_PBB.01
Trying to set the output value manually using the command line, For example:
nvidia@tegra-ubuntu:~$ sudo gpiofind PB.00
gpiochip0 8
nvidia@tegra-ubuntu:~$ sudo gpioset --mode=wait gpiochip0 8=1
^C
nvidia@tegra-ubuntu:~$ sudo gpioset --mode=wait gpiochip0 8=0
Measuring the voltage level I have seen the Pin 32 is always high. it seems the GPIO is not working but had the same result for other GPIOs tested including Main GPIOs.
Changing the pinmux configuration for Main GPIOs, it solves the problem, This change let me set the Pin 15 as and output and Pin 22 as and input and both working correctly:
diff --git a/hardware/nvidia/t23x/nv-public/tegra234.dtsi b/hardware/nvidia/t23x/nv-public/tegra234.dtsi
index f909b93..0832b19 100644
--- a/hardware/nvidia/t23x/nv-public/tegra234.dtsi
+++ b/hardware/nvidia/t23x/nv-public/tegra234.dtsi
@@ -111,10 +111,52 @@
gpio-controller;
gpio-ranges = <&pinmux 0 0 164>;
};
-
+#include <dt-bindings/pinctrl/pinctrl-tegra.h>
pinmux: pinmux@2430000 {
compatible = "nvidia,tegra234-pinmux";
reg = <0x0 0x2430000 0x0 0x19100>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&jetson_io_pinmux>;
+ jetson_io_pinmux: exp-header-pinmux {
+ hdr40-pin15 { /* Output */
+ nvidia,pins = "soc_gpio39_pn1";
+ nvidia,function = "gp";
+ nvidia,pin-group = "pwm1";
+ nvidia,tristate = <TEGRA_PIN_DISABLE>;
+ nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+ };
+ hdr40-pin22 { /* Input */
+ nvidia,pins = "spi3_miso_py1";
+ nvidia,function = "gp";
+ nvidia,tristate = <TEGRA_PIN_DISABLE>;
+ nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+ };
+ };
};
gpcdma: dma-controller@2600000 {
I have tried to apply a similar pinmux configuration for AON GPIOs, but this configuration doesn’t allow me to control the GPIO as output. For example, this is the configuration applied to pin32.
diff --git a/hardware/nvidia/t23x/nv-public/tegra234.dtsi b/hardware/nvidia/t23x/nv-public/tegra234.dtsi
index f909b93..0832b19 100644
--- a/hardware/nvidia/t23x/nv-public/tegra234.dtsi
+++ b/hardware/nvidia/t23x/nv-public/tegra234.dtsi
@@ -1853,6 +1912,35 @@
pinmux_aon: pinmux@c300000 {
compatible = "nvidia,tegra234-pinmux-aon";
reg = <0x0 0xc300000 0x0 0x4000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&jetson_io_pinmux_aon>;
+ jetson_io_pinmux_aon: exp-header-pinmux {
+ hdr40-pin16 { /* Input */
+ nvidia,pins = "can1_en_pbb1";
+ nvidia,tristate = <TEGRA_PIN_DISABLE>;
+ nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+ };
+ hdr40-pin32 { /* Output */
+ nvidia,pins = "can1_stb_pbb0";
+ nvidia,tristate = <TEGRA_PIN_DISABLE>;
+ nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+ };
+
+ };
};
pwm4: pwm@c340000 {
Do you know why I can’t control the AON GPIO?
Regards,
-Manuel