<?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 Toggling UART2 GPIOs in Layerscape</title>
    <link>https://community.nxp.com/t5/Layerscape/Toggling-UART2-GPIOs/m-p/589472#M1547</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Need to toggle UART2 GPIOs on QorIQ LS1043ARDB SDK 2.0 and need to understand how and which GPIOs are accessible sysfs for UART2 after writing to the RCW.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;To toggle the UART2 GPIOs we already know it is necessary to write to the RCW using the CW QCVS/PBL-RCW tool.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #303030;"&gt;We also know the UART function is not exposed on these pins once they’re configured for GPIO.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #303030;"&gt;To select the GPIO on UART2 pins the&lt;/SPAN&gt; &lt;SPAN style="color: #303030;"&gt;RCW would have to be modified with RCW[UART_BASE]=100, is this correct? Or should it be &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #303030;"&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;RCW[UART_BASE] = 011&lt;/SPAN&gt;.&amp;nbsp; We &lt;/SPAN&gt;only want to use UART2 and not UART1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;The information I need is similar to what was needed on i.MX6:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Writing the RCW gives access to the GPIOs, but it doesn't indicate any driver changes needed, addresses and offsets for UART2, or which /sys/class/gpio/gpioxxx to toggle for UART2 based on the gpio subsystem. Below we show how we did this for the i.MX6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;The question is how do we &lt;EM&gt;figure out &lt;/EM&gt;which /sys/class/gpio/gpioxxx to toggle for UART2 on the LS1043ARDB SDK 2.0?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;What is the command needed to send a value to the GPIOs equivalent to "echo 1 &amp;gt; /sys/class/gpio/gpio177/value" for the GPIO pins on I.MX6?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On imx6 Nitrogen we did the following, which is equivalent to writing the RCW on QorIQ SDK 2.0 for the LS1043ARDB:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kernel/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;pinctrl_uart1: uart1grp {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;fsl,pins = &amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA&amp;nbsp; 0x1b0b1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA&amp;nbsp; 0x1b0b1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;pinctrl_uart1: uart1grp {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;fsl,pins = &amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD3_DAT6__GPIO6_IO18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x1b0b1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD3_DAT7__GPIO6_IO17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x1b0b1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This causes the Linux’s PINMUX subsystem to use GPIOs instead of the UART similar to writing to the RCW.&amp;nbsp; These macros are defined in kernel/arch/arm/boot/dts/imx6q-pinfunc.h where there are offset (to the base) and one of the alts per each pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this update the serial driver for UART1 will work but without external pins. &lt;STRONG&gt;Instead of this the pins will be controlled by the GPIO subsystem and this is the information we need to know for the LS1043A SDK 2.0 (how does the mapping work)&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5*32+17 = &lt;STRONG&gt;177&lt;/STRONG&gt; (GPIO&amp;lt;X-1&amp;gt;+IO&amp;lt;Y&amp;gt;)&lt;/P&gt;&lt;P&gt;5*32+18 = &lt;STRONG&gt;178&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point thee GPIOs will be available via the kernel’s SYSFS interface (&lt;STRONG&gt;we need to determine the UART2 GPIOs accessible to the SYSFS for the LS1043A SDK 2.0, similar to the I.MX6 below&lt;/STRONG&gt;):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;echo &lt;STRONG&gt;177&lt;/STRONG&gt; &amp;gt; /sys/class/gpio/export&lt;/P&gt;&lt;P&gt;echo &lt;STRONG&gt;178&lt;/STRONG&gt; &amp;gt; /sys/class/gpio/export&lt;/P&gt;&lt;P&gt;echo out &amp;gt; / sys/class/gpio/gpio177/direction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first session:&lt;/P&gt;&lt;P&gt;watch -n 1 cat /sys/class/gpio/gpio178/value&lt;/P&gt;&lt;P&gt;the second session:&lt;/P&gt;&lt;P&gt;echo 1 &amp;gt; /sys/class/gpio/gpio177/value&lt;/P&gt;&lt;P&gt;and then:&lt;/P&gt;&lt;P&gt;echo 0 &amp;gt; /sys/class/gpio/gpio177/value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jul 2016 11:18:23 GMT</pubDate>
    <dc:creator>pro-supportengi</dc:creator>
    <dc:date>2016-07-19T11:18:23Z</dc:date>
    <item>
      <title>Toggling UART2 GPIOs</title>
      <link>https://community.nxp.com/t5/Layerscape/Toggling-UART2-GPIOs/m-p/589472#M1547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Need to toggle UART2 GPIOs on QorIQ LS1043ARDB SDK 2.0 and need to understand how and which GPIOs are accessible sysfs for UART2 after writing to the RCW.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;To toggle the UART2 GPIOs we already know it is necessary to write to the RCW using the CW QCVS/PBL-RCW tool.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #303030;"&gt;We also know the UART function is not exposed on these pins once they’re configured for GPIO.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #303030;"&gt;To select the GPIO on UART2 pins the&lt;/SPAN&gt; &lt;SPAN style="color: #303030;"&gt;RCW would have to be modified with RCW[UART_BASE]=100, is this correct? Or should it be &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #303030;"&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;RCW[UART_BASE] = 011&lt;/SPAN&gt;.&amp;nbsp; We &lt;/SPAN&gt;only want to use UART2 and not UART1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;The information I need is similar to what was needed on i.MX6:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Writing the RCW gives access to the GPIOs, but it doesn't indicate any driver changes needed, addresses and offsets for UART2, or which /sys/class/gpio/gpioxxx to toggle for UART2 based on the gpio subsystem. Below we show how we did this for the i.MX6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;The question is how do we &lt;EM&gt;figure out &lt;/EM&gt;which /sys/class/gpio/gpioxxx to toggle for UART2 on the LS1043ARDB SDK 2.0?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;What is the command needed to send a value to the GPIOs equivalent to "echo 1 &amp;gt; /sys/class/gpio/gpio177/value" for the GPIO pins on I.MX6?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On imx6 Nitrogen we did the following, which is equivalent to writing the RCW on QorIQ SDK 2.0 for the LS1043ARDB:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kernel/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;pinctrl_uart1: uart1grp {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;fsl,pins = &amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA&amp;nbsp; 0x1b0b1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA&amp;nbsp; 0x1b0b1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;pinctrl_uart1: uart1grp {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;fsl,pins = &amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD3_DAT6__GPIO6_IO18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x1b0b1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6QDL_PAD_SD3_DAT7__GPIO6_IO17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x1b0b1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This causes the Linux’s PINMUX subsystem to use GPIOs instead of the UART similar to writing to the RCW.&amp;nbsp; These macros are defined in kernel/arch/arm/boot/dts/imx6q-pinfunc.h where there are offset (to the base) and one of the alts per each pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this update the serial driver for UART1 will work but without external pins. &lt;STRONG&gt;Instead of this the pins will be controlled by the GPIO subsystem and this is the information we need to know for the LS1043A SDK 2.0 (how does the mapping work)&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5*32+17 = &lt;STRONG&gt;177&lt;/STRONG&gt; (GPIO&amp;lt;X-1&amp;gt;+IO&amp;lt;Y&amp;gt;)&lt;/P&gt;&lt;P&gt;5*32+18 = &lt;STRONG&gt;178&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point thee GPIOs will be available via the kernel’s SYSFS interface (&lt;STRONG&gt;we need to determine the UART2 GPIOs accessible to the SYSFS for the LS1043A SDK 2.0, similar to the I.MX6 below&lt;/STRONG&gt;):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;echo &lt;STRONG&gt;177&lt;/STRONG&gt; &amp;gt; /sys/class/gpio/export&lt;/P&gt;&lt;P&gt;echo &lt;STRONG&gt;178&lt;/STRONG&gt; &amp;gt; /sys/class/gpio/export&lt;/P&gt;&lt;P&gt;echo out &amp;gt; / sys/class/gpio/gpio177/direction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first session:&lt;/P&gt;&lt;P&gt;watch -n 1 cat /sys/class/gpio/gpio178/value&lt;/P&gt;&lt;P&gt;the second session:&lt;/P&gt;&lt;P&gt;echo 1 &amp;gt; /sys/class/gpio/gpio177/value&lt;/P&gt;&lt;P&gt;and then:&lt;/P&gt;&lt;P&gt;echo 0 &amp;gt; /sys/class/gpio/gpio177/value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 11:18:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/Toggling-UART2-GPIOs/m-p/589472#M1547</guid>
      <dc:creator>pro-supportengi</dc:creator>
      <dc:date>2016-07-19T11:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling UART2 GPIOs</title>
      <link>https://community.nxp.com/t5/Layerscape/Toggling-UART2-GPIOs/m-p/589473#M1548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;Look at the Table 3-3 of the LS1043 Reference Manual:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DLS1043ARM%26location%3Dnull%26fasp%3D1%26WT_TYPE%3DReference%2520Manuals%26WT_VENDOR%3DFREESCALE%26WT_FILE_FORMAT%3Dpdf%26WT_ASSET%3DDocumentation%26fileExt%3D.pdf%26Parent_nodeId%3D1412692250778715498030%26Parent_pageType%3Dproduct%26Parent_nodeId%3D1412692250778715498030%26Parent_pageType%3Dproduct%26Parent_nodeId%3D1412692250778715498030%26Parent_pageType%3Dproduct" rel="nofollow" target="_blank"&gt;https://www.nxp.com/webapp/Download?colCode=LS1043ARM&amp;amp;location=null&amp;amp;fasp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;fileExt=.pdf&amp;amp;Parent_nodeId=1412692250778715498030&amp;amp;Parent_pageType=product&amp;amp;Parent_nodeId=1412692250778715498030&amp;amp;Parent_pageType=product&amp;amp;Parent_nodeId=1412692250778715498030&amp;amp;Parent_pageType=product&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;Use this Table for setting UART1 pins to UART and UART2 pins to GPIO.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt;"&gt;Use sysfs for GPIO pins using.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Pavel Chubakov&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 05:11:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/Toggling-UART2-GPIOs/m-p/589473#M1548</guid>
      <dc:creator>Pavel</dc:creator>
      <dc:date>2016-07-20T05:11:12Z</dc:date>
    </item>
  </channel>
</rss>

