.. _SD.Bootloader.GpioInterruptMapConfig:

.. include:: /content/swdocs.rsts

.. spelling::
   pad
   init
   DTS
   sdmmc
   SDMMC
   hv
   eqos
   io
   ao
   ufs
   qspi
   DTSI
   SoC
   PMC
   IMPL
   bct
   GPIO
   pinmux
   dtsi
   pinctrl
   lpdr
   tristate
   ps
   PADCTL
   i2c
   I2C
   DRAM
   FPS
   PWM
   MMIO
   PMIC
   Vout
   SOC
   Hz
   pwm
   mmio
   pad
   prod
   QSPI
   DDR
   ddr
   SDR
   sdr
   BootROM
   val
   qspiflash
   sata
   BPMP
   FW
   UPHY
   uphy
   gpio

GPIO Interrupt Mapping Configuration
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

To reduce the interrupt hunt time for GPIO pins from an ISR, in T23x, each GPO controller has eight interrupt lines to LIC. This provides the opportunity to map the GPIO pin to any of these interrupts. The configuration is specified in the GPIO interrupt configuration file.

Each entry in the configuration file is in the following form: 

.. code-block:: none

   gpio-intmap {
      port@<PORT-ID> {
          pin-<N>-int-line = <INTERRUPT-NUMBER>;
      };
      port@<PORT-ID> {
          pin-<N>-int-line = <INTERRUPT-NUMBER>;
      }
   };

where:

- ``<PORT-ID>`` is the port name like A, B, C..Z, AA, BB
- ``<N>`` is the pin id in the port. Valid values are 0-7.
- ``<INTERRUPT-NUMBER>`` is interrupt route for that pin. Valid values are 0-7.

The gpio-interrupt mapping configuration file is in the ``hardware/nvidia/platform/t23x/<platform>/bct/`` directory.

The new DTS format example of prod config file:

.. code-block:: none

   /dts-v1/;

   / {
      gpio-intmap {
         port@B {
             pin-1-int-line = <0>; // GPIO B1 to INT0
         };
         port@AA {
             pin-0-int-line = <0>; // GPIO AA0 to INT0
             pin-1-int-line = <0>; // GPIO AA1 to INT0
             pin-2-int-line = <0>; // GPIO AA2 to INT0
         };
      };
   };

Here is the previous CFG file format:

.. code-block:: none

   gpio-intmap.port.B.pin.1 = 0; // GPIO B1 to INT0
   gpio-intmap.port.AA.pin.0 = 0; // GPIO AA0 to INT0
   gpio-intmap.port.AA.pin.1 = 0; // GPIO AA1 to INT0
   gpio-intmap.port.AA.pin.2 = 0; // GPIO AA2 to INT0