Pinmux and GPIO Configuration

The pinmux configuration file provides pinmux and GPIO configuration, which is generated by using the pinmux spreadsheet.

The pinmux DTS file is in the Linux_for_Tegra/bootloader/generic/BCT directory.

Here is the DTS format example of a pinmux configuration file:

/dts-v1/;
#include "pinctrl-tegra.h"

#include "./tegra234-mb1-bct-gpio-p3767-dp-a03.dtsi"
/ {
      pinmux@2430000 {
              pinctrl-names = "default", "drive", "unused";
              pinctrl-0 = <&pinmux_default>;
              pinctrl-1 = <&drive_default>;
              pinctrl-2 = <&pinmux_unused_lowpower>;

              pinmux_default: common {
                      /* SFIO Pin Configuration */
                      shutdown_n {
                              nvidia,pins = "shutdown_n";
                              nvidia,function = "shutdown";
                              nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                              nvidia,tristate = <TEGRA_PIN_DISABLE>;
                              nvidia,enable-input = <TEGRA_PIN_DISABLE>;
                              nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
                              nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                      };

                      vcomp_alert_pee1 {
                              nvidia,pins = "vcomp_alert_pee1";
                              nvidia,function = "soc";
                              nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                              nvidia,tristate = <TEGRA_PIN_ENABLE>;
                              nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                              nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
                              nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                      };

                      batt_oc_pee3 {
                              nvidia,pins = "batt_oc_pee3";
                              nvidia,function = "soc";
                              nvidia,pull = <TEGRA_PIN_PULL_UP>;
                              nvidia,tristate = <TEGRA_PIN_ENABLE>;
                              nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                              nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
                              nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                      };

                      hdmi_cec_pgg0 {
                              nvidia,pins = "hdmi_cec_pgg0";
                              nvidia,function = "hdmi";
                              nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                              nvidia,tristate = <TEGRA_PIN_DISABLE>;
                              nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                              nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>;
                              nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                      };

                      touch_clk_pcc4 {
                              nvidia,pins = "touch_clk_pcc4";
                              nvidia,function = "gp";
                              nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                              nvidia,tristate = <TEGRA_PIN_ENABLE>;
                              nvidia,enable-input = <TEGRA_PIN_DISABLE>;
                              nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>;
                              nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                      };

                      uart3_tx_pcc5 {
                              nvidia,pins = "uart3_tx_pcc5";
                              nvidia,function = "uartc";
                              nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                              nvidia,tristate = <TEGRA_PIN_DISABLE>;
                              nvidia,enable-input = <TEGRA_PIN_DISABLE>;
                              nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
                              nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                      };

                      uart3_rx_pcc6 {
                              nvidia,pins = "uart3_rx_pcc6";
                              nvidia,function = "uartc";
                              nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                              nvidia,tristate = <TEGRA_PIN_ENABLE>;
                              nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                              nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
                              nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                      };

                      gen2_i2c_scl_pcc7 {
                              nvidia,pins = "gen2_i2c_scl_pcc7";
                              nvidia,function = "i2c2";
                              nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                              nvidia,tristate = <TEGRA_PIN_DISABLE>;
                              nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                              nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>;
                              nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                      };
          .
          .
          .

Here is the DTS format example of a gpio configuration file:

#include "tegra234-gpio.h"


/ {
      gpio@2200000 {
              gpio-init-names = "default";
              gpio-init-0 = <&gpio_main_default>;

              gpio_main_default: default {
                      gpio-input = <
                              TEGRA234_MAIN_GPIO(B, 0)
                              TEGRA234_MAIN_GPIO(Y, 0)
                              TEGRA234_MAIN_GPIO(Y, 1)
                              TEGRA234_MAIN_GPIO(Y, 2)
                              TEGRA234_MAIN_GPIO(Y, 3)
                              TEGRA234_MAIN_GPIO(Y, 4)
                              TEGRA234_MAIN_GPIO(Z, 1)
                              TEGRA234_MAIN_GPIO(Z, 3)
                              TEGRA234_MAIN_GPIO(Z, 4)
                              TEGRA234_MAIN_GPIO(Z, 5)
                              TEGRA234_MAIN_GPIO(Z, 6)
                              TEGRA234_MAIN_GPIO(Z, 7)
                              TEGRA234_MAIN_GPIO(P, 6)
                              TEGRA234_MAIN_GPIO(Q, 5)
                              TEGRA234_MAIN_GPIO(Q, 6)
                              TEGRA234_MAIN_GPIO(R, 4)
                              TEGRA234_MAIN_GPIO(R, 5)
                              TEGRA234_MAIN_GPIO(N, 1)
                              TEGRA234_MAIN_GPIO(G, 0)
                              TEGRA234_MAIN_GPIO(G, 6)
                              TEGRA234_MAIN_GPIO(G, 7)
                              TEGRA234_MAIN_GPIO(H, 0)
                              TEGRA234_MAIN_GPIO(H, 7)
                              TEGRA234_MAIN_GPIO(I, 0)
                              TEGRA234_MAIN_GPIO(I, 1)
                              TEGRA234_MAIN_GPIO(I, 2)
                              TEGRA234_MAIN_GPIO(AC, 6)
                              TEGRA234_MAIN_GPIO(L, 2)
                              >;
                      gpio-output-low = <
                              TEGRA234_MAIN_GPIO(H, 6)
                              TEGRA234_MAIN_GPIO(I, 5)
                              TEGRA234_MAIN_GPIO(AC, 0)
                              TEGRA234_MAIN_GPIO(K, 4)
                              TEGRA234_MAIN_GPIO(K, 5)
                              >;
                      gpio-output-high = <
                              TEGRA234_MAIN_GPIO(Q, 3)
                              TEGRA234_MAIN_GPIO(A, 0)
                              >;
              };
      };