<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GPIO number in iMX8 in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929389#M139465</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does that mean formula should always be this,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;&lt;STRONG&gt;#define IMX_GPIO_NR(port, index) (((port)*32)+((index)&amp;amp;31)) ?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this formula is wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; color: #51626f; font-weight: bold;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;#define IMX_GPIO_NR(bank, pin) (480 - (bank * 32) + (pin &amp;amp; 0x1f))&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; color: #51626f;"&gt;I think both are wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; color: #51626f;"&gt;But then how in kernel /sys/class/gpio we get these chip numbers (in bold)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; color: #51626f;"&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpio448 -&amp;gt; ../../devices/platform/5d090000.gpio/gpiochip1/gpio/gpio448&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip208 -&amp;gt; ../../devices/platform/5a810000.i2c/i2c-4/i2c-8/8-001d/gpio/gpiochip208&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip216 -&amp;gt; ../../devices/platform/5a810000.i2c/i2c-4/i2c-8/8-001a/gpio/gpiochip216&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip224 -&amp;gt; ../../devices/platform/58222000.gpio/gpio/gpiochip224&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip256 -&amp;gt; ../../devices/platform/5d0f0000.gpio/gpio/gpiochip256&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip288 -&amp;gt; ../../devices/platform/5d0e0000.gpio/gpio/gpiochip288&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip320&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d0d0000.gpio/gpio/gpiochip320&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip352&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d0c0000.gpio/gpio/gpiochip352&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip384&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d0b0000.gpio/gpio/gpiochip384&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip416&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d0a0000.gpio/gpio/gpiochip416&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip448&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d090000.gpio/gpio/gpiochip448&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip480&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d080000.gpio/gpio/gpiochip480&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Jun 2019 04:33:21 GMT</pubDate>
    <dc:creator>mrigendra_chaub</dc:creator>
    <dc:date>2019-06-03T04:33:21Z</dc:date>
    <item>
      <title>GPIO number in iMX8</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929387#M139463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am confused about gpio number calculation, in uboot there is commit on this file&lt;/P&gt;&lt;P&gt;arch/arm/include/asm/arch-imx8/gpio.h&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;commit 3733fc85c1f29f2d0ac2af42eca64d5939902fe3&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Author: Adrian Alonso &amp;lt;adrian.alonso@nxp.com&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Date: Tue Mar 8 14:53:31 2016 -0600&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MLK-14938-21 mxc_gpio: add support for i.MX8&lt;/STRONG&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;STRONG&gt; Add support for iMX8 SoC platforms, and extend to support LSIO GPIO0..GPIO7 ports.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; Since the i.MX8 GPIO banks are indexed from 0 not 1 on other i.MX platforms,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; so we have to adjust the index accordingly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where, to calculate gpio number we use this formula,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+/* IMX8 the GPIO index is from 0 not 1 */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;+#define IMX_GPIO_NR(port, index) (((port)*32)+((index)&amp;amp;31))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;+#endif /* __ASM_ARCH_IMX8_GPIO_H */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in kernel to get gpio number we are using this formula and it works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#define IMX_GPIO_NR(bank, pin) (480 - (bank * 32) + (pin &amp;amp; 0x1f))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To&amp;nbsp;get gpio3_25 both gives different gpio number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which one is correct? Kindly clarify.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2019 04:04:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929387#M139463</guid>
      <dc:creator>mrigendra_chaub</dc:creator>
      <dc:date>2019-05-31T04:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO number in iMX8</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929388#M139464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The i.MX8QuadMax Reference Manual document indicates that the processor contains 7 GPIO ports, GPIO0 to GPIO6. Each of GPIO0 to GPIO5 ports contains 32 signals, the GPIO6 port contains 22 signals, totally 32*6 + 22 = 214 signals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;/P&gt;&lt;P&gt;Artur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2019 10:40:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929388#M139464</guid>
      <dc:creator>art</dc:creator>
      <dc:date>2019-05-31T10:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO number in iMX8</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929389#M139465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does that mean formula should always be this,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;&lt;STRONG&gt;#define IMX_GPIO_NR(port, index) (((port)*32)+((index)&amp;amp;31)) ?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this formula is wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; color: #51626f; font-weight: bold;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;#define IMX_GPIO_NR(bank, pin) (480 - (bank * 32) + (pin &amp;amp; 0x1f))&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; color: #51626f;"&gt;I think both are wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; color: #51626f;"&gt;But then how in kernel /sys/class/gpio we get these chip numbers (in bold)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; color: #51626f;"&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpio448 -&amp;gt; ../../devices/platform/5d090000.gpio/gpiochip1/gpio/gpio448&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip208 -&amp;gt; ../../devices/platform/5a810000.i2c/i2c-4/i2c-8/8-001d/gpio/gpiochip208&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip216 -&amp;gt; ../../devices/platform/5a810000.i2c/i2c-4/i2c-8/8-001a/gpio/gpiochip216&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip224 -&amp;gt; ../../devices/platform/58222000.gpio/gpio/gpiochip224&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip256 -&amp;gt; ../../devices/platform/5d0f0000.gpio/gpio/gpiochip256&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 gpiochip288 -&amp;gt; ../../devices/platform/5d0e0000.gpio/gpio/gpiochip288&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip320&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d0d0000.gpio/gpio/gpiochip320&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip352&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d0c0000.gpio/gpio/gpiochip352&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip384&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d0b0000.gpio/gpio/gpiochip384&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip416&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d0a0000.gpio/gpio/gpiochip416&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip448&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d090000.gpio/gpio/gpiochip448&lt;BR /&gt;lrwxrwxrwx 1 root root 0 2019-05-29 10:04 &lt;STRONG&gt;gpiochip480&lt;/STRONG&gt; -&amp;gt; ../../devices/platform/5d080000.gpio/gpio/gpiochip480&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2019 04:33:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929389#M139465</guid>
      <dc:creator>mrigendra_chaub</dc:creator>
      <dc:date>2019-06-03T04:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO number in iMX8</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929390#M139466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, I even don't know what this IMX_GPIO_NR parameter refers to. As I told before, from the hardware point of view, the i.MX8QuadMax processor has 214 Low Speed I/O (LSIO) signals, divided to 6 banks by 32 signals and 1 bank by 22 &lt;BR /&gt;signals and available as the ALT3 IOMUX function on some of the processor's pads. For details, you can download the latest version of the i.MX Pins Tool software:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/pages/pins-tool-for-i.mx-application-processors:PINS-TOOL-IMX"&gt;https://www.nxp.com/pages/pins-tool-for-i.mx-application-processors:PINS-TOOL-IMX&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/pages/pins-tool-for-i.mx-application-processors:PINS-TOOL-IMX?tab=Design_Tools_Tab"&gt;https://www.nxp.com/pages/pins-tool-for-i.mx-application-processors:PINS-TOOL-IMX?tab=Design_Tools_Tab&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select the i.MX8QuadMax processor there and then check the exact LSIO signals location on the external pads.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Artur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2019 10:29:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929390#M139466</guid>
      <dc:creator>art</dc:creator>
      <dc:date>2019-06-03T10:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO number in iMX8</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929391#M139467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have different GPIO numbering in u-boot and kernel because u-boot defines aliases for GPIO controllers in DTS but kernel does not. See&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/uboot-imx/tree/arch/arm/dts/fsl-imx8qm.dtsi?h=imx_v2018.03_4.14.98_2.0.0_ga#n54" title="https://source.codeaurora.org/external/imx/uboot-imx/tree/arch/arm/dts/fsl-imx8qm.dtsi?h=imx_v2018.03_4.14.98_2.0.0_ga#n54"&gt;fsl-imx8qm.dtsi\dts\arm\arch - uboot-imx - i.MX U-Boot&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/fsl-imx8qm.dtsi?h=imx_4.14.98_2.0.0_ga" title="https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/fsl-imx8qm.dtsi?h=imx_4.14.98_2.0.0_ga"&gt;fsl-imx8qm.dtsi\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The GPIO numbering in i.MX8QM kernel is really backwards. I think it's a bug that should be fixed.&lt;/P&gt;&lt;P&gt;i.MX8M and i.MX8M Mini kernels have correct numbering, but i.MX8QM and i.MX8QXP have not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Felix.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2019 05:35:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929391#M139467</guid>
      <dc:creator>felixradensky</dc:creator>
      <dc:date>2019-06-04T05:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO number in iMX8</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929392#M139468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it really so that there isn't macro in kernel similar to u-boot that'll return the GPIO - number? I really don't care how the numbering goes if you can get it with that macro and it would also made it independent from processor to processor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the formula I've used to calculate GPIO number atm: (9 - gpio_bank) * 32 + 192 + gpio_bit&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Far cry from imx6's 'gpio_bank * 32 + gpio_bit' but oh well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2020 03:38:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-number-in-iMX8/m-p/929392#M139468</guid>
      <dc:creator>Maddis</dc:creator>
      <dc:date>2020-04-27T03:38:44Z</dc:date>
    </item>
  </channel>
</rss>

