<?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>i.MX ProcessorsのトピックRe: i.MX6: Using GPIO1_IO19</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406776#M60552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure if I got your question right. A common trick is to use the GPIO as a LED. In the device tree, insert a block like:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;/ {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; leds {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compatible = "gpio-leds";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_led {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpios = &amp;lt;&amp;amp;gpio1 19 GPIO_ACTIVE_LOW&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;which will automatically create a LED that can be switched on and off:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt; &lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;echo 1 &amp;gt;&amp;nbsp; /sys/class/leds/my_led/brightness&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt; echo 0 &amp;gt;&amp;nbsp; /sys/class/leds/my_led/brightness&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Aug 2015 15:21:07 GMT</pubDate>
    <dc:creator>frankba</dc:creator>
    <dc:date>2015-08-03T15:21:07Z</dc:date>
    <item>
      <title>i.MX6: Using GPIO1_IO19</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406775#M60551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My intent is to configure the WDOG1 pin on the i.MX6 as GPIO output (to trigger a custom power-off circuit). The i.MX6 Reference Manual states that this is achievable by setting the &lt;EM&gt;Pad Mux Register&lt;/EM&gt; (IOMUXC_SW_MUX_CTL_PAD_SD1_DATA2) MUX_MODE to ALT5, which selects the signal GPIO1_IO19.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to implement this, I have added the following lines to the iomuxc-block in the Linux Kernel device tree:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;gpio19 {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pinctrl_gpio19_1: gpio19grp-1 {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fsl,pins = &amp;lt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD1_DAT2__GPIO1_IO19 0x80000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From userspace I am now able to configure and use the GPIO like this:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;$ echo 19 &amp;gt; /sys/class/gpio/export&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;$ echo out &amp;gt; /sys/class/gpio/gpio19/direction&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;$ echo 1 &amp;gt; /sys/class/gpio/gpio19/active_low&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;$ echo 1 &amp;gt; /sys/class/gpio/gpio19/value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(unfortunately I don't have a scope so I can't verify that the output value actually changes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question now is how to do this initialization in the device tree, so that I have the GPIO properly set up on system boot without using userland scripts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My understanding is that I'd have to create a "gpio19" device in the tree that makes use of the pinctrl block I have defined, but I don't know how to declare such a device. &lt;A href="http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt"&gt;This document&lt;/A&gt; describes properties for such a device that I don't know which values I'd have to assign to, e.g. the interrupt number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a TQMa6S board with the latest BSP 0105.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any feedback! :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 12:57:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406775#M60551</guid>
      <dc:creator>lynix</dc:creator>
      <dc:date>2015-08-03T12:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6: Using GPIO1_IO19</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406776#M60552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure if I got your question right. A common trick is to use the GPIO as a LED. In the device tree, insert a block like:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;/ {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; leds {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compatible = "gpio-leds";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_led {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpios = &amp;lt;&amp;amp;gpio1 19 GPIO_ACTIVE_LOW&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;which will automatically create a LED that can be switched on and off:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt; &lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;echo 1 &amp;gt;&amp;nbsp; /sys/class/leds/my_led/brightness&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt; echo 0 &amp;gt;&amp;nbsp; /sys/class/leds/my_led/brightness&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 15:21:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406776#M60552</guid>
      <dc:creator>frankba</dc:creator>
      <dc:date>2015-08-03T15:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6: Using GPIO1_IO19</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406777#M60553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check the base and lable to indetify the number of gpio in linux.&lt;/P&gt;&lt;P&gt;GPIO1_19 should be the GPIO1 base + 19.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;r&lt;A href="mailto:root@imx6qdlsolo"&gt;oot@imx6qdlsolo&lt;/A&gt;:~# cat /sys/class/gpio/gpiochip32/base&lt;/P&gt;&lt;P&gt;32&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:root@imx6qdlsolo"&gt;root@imx6qdlsolo&lt;/A&gt;:~# cat /sys/class/gpio/gpiochip32/label&lt;/P&gt;&lt;P&gt;20a0000.gpio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 10:20:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406777#M60553</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2015-08-04T10:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6: Using GPIO1_IO19</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406778#M60554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Exactly what I was looking for, thanks! :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 11:02:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406778#M60554</guid>
      <dc:creator>lynix</dc:creator>
      <dc:date>2015-08-04T11:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6: Using GPIO1_IO19</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406779#M60555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the hint; I was naive and assumed it to be 19.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check according your hint confirmed that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; root@MBa6x:~ cat /sys/class/gpio/gpiochip0/base &lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(There is no /sys/class/gpio/gpiochip1, I think they are just indexed by 0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 11:04:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406779#M60555</guid>
      <dc:creator>lynix</dc:creator>
      <dc:date>2015-08-04T11:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6: Using GPIO1_IO19</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406780#M60556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the lable?&lt;/P&gt;&lt;P&gt;It is the value to indentify the gpio, which is in the device tree.&lt;/P&gt;&lt;P&gt;In that way, you can figure out which is the base for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 04:56:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-Using-GPIO1-IO19/m-p/406780#M60556</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2015-08-05T04:56:01Z</dc:date>
    </item>
  </channel>
</rss>

