<?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>P-Series中的主题 Re: How to access GPIO's in P1021 processor?</title>
    <link>https://community.nxp.com/t5/P-Series/How-to-access-GPIO-s-in-P1021-processor/m-p/436607#M2507</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Freescale SDK supports sysfs possibility for GPIO using from user space.&lt;/P&gt;&lt;P&gt;Check please that the following kernel configuration options are set. These options are necessary &lt;/P&gt;&lt;P&gt;for sysfs GPIO support:&lt;/P&gt;&lt;P&gt;CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB&lt;/P&gt;&lt;P&gt;CONFIG_MPC8XXX_GPIO (Platform Support / MPC8xxx GPIO support)&lt;/P&gt;&lt;P&gt;CONFIG_OF_GPIO&lt;/P&gt;&lt;P&gt;CONFIG_GPIOLIB (-*- GPIO Support&amp;nbsp; ---&amp;gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;CONFIG_GPIO_SYSFS (/sys/class/gpio/... (sysfs interface))&lt;/P&gt;&lt;P&gt;CONFIG_GENERIC_GPIO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This option can be checked using the .config file in the kernel source folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPIO controllers should be declared in the Device Tree file. &lt;/P&gt;&lt;P&gt;More information on the device tree GPIO declaration can be found in the kernel source. &lt;/P&gt;&lt;P&gt;See please the following files: &lt;/P&gt;&lt;P&gt;/Documentation/powerpc/dts-bindings/gpio.txt and /Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This possibility is available using sysfs from user space.&lt;/P&gt;&lt;P&gt;See the following pages &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://elinux.org/GPIO" rel="nofollow" target="_blank"&gt;http://elinux.org/GPIO&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://www.kernel.org/doc/Documentation/gpio/sysfs.txt" rel="nofollow" target="_blank"&gt;https://www.kernel.org/doc/Documentation/gpio/sysfs.txt&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.lindusembedded.com/blog/2011/12/29/gpio-general-purpose-inputoutput-interfaces-in-linux-2/" rel="nofollow" target="_blank"&gt;http://www.lindusembedded.com/blog/2011/12/29/gpio-general-purpose-inputoutput-interfaces-in-linux-2/&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://www.kernel.org/doc/Documentation/gpio/sysfs.txt" rel="nofollow" target="_blank"&gt;https://www.kernel.org/doc/Documentation/gpio/sysfs.txt&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached file contains .dts file and command dump for GPIO using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second method consist of using mmap command.&lt;/P&gt;&lt;P&gt;It is a POSIX-compliant Linux/Unix system call that maps files or devices into memory. &lt;/P&gt;&lt;P&gt;It is a method of memory-mapped file I/O.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example, look at the following links (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Mmap" rel="nofollow" target="_blank"&gt;http://en.wikipedia.org/wiki/Mmap&lt;/A&gt;&lt;SPAN&gt;) and &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://beej.us/guide/bgipc/output/html/multipage/mmap.html" rel="nofollow" target="_blank"&gt;http://beej.us/guide/bgipc/output/html/multipage/mmap.html&lt;/A&gt;&lt;SPAN&gt;).&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&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>Tue, 09 Jun 2015 06:37:57 GMT</pubDate>
    <dc:creator>Pavel</dc:creator>
    <dc:date>2015-06-09T06:37:57Z</dc:date>
    <item>
      <title>How to access GPIO's in P1021 processor?</title>
      <link>https://community.nxp.com/t5/P-Series/How-to-access-GPIO-s-in-P1021-processor/m-p/436605#M2505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am using P1021 processor in my project. I am using QorIQ SDK - 1.7. I have gone through the P1021 Reference Manual provided by the freescale but I am not clear with the GPIO base and offset addresses.&lt;/P&gt;&lt;P&gt;Is there any macros defined for the GPIO pins in the QorIQ SDK source code, so that they could be accessed directly through the API's?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 09:22:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/How-to-access-GPIO-s-in-P1021-processor/m-p/436605#M2505</guid>
      <dc:creator>sourabhdas</dc:creator>
      <dc:date>2015-06-08T09:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to access GPIO's in P1021 processor?</title>
      <link>https://community.nxp.com/t5/P-Series/How-to-access-GPIO-s-in-P1021-processor/m-p/436606#M2506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sourabh Das,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPIO base and offset address as below:&lt;/P&gt;&lt;P&gt;GUTS_CPODRn&amp;nbsp;&amp;nbsp;&amp;nbsp; E_0000h base + 100h offset + (32d × i), where i=0d to 2d&lt;/P&gt;&lt;P&gt;GUTS_CPDATn&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E_0000h base + 104h offset + (32d × i), where i=0d to 2d&lt;/P&gt;&lt;P&gt;GUTS_CPDIR1n&amp;nbsp;&amp;nbsp;&amp;nbsp; E_0000h base + 108h offset + (32d × i), where i=0d to 2d&lt;/P&gt;&lt;P&gt;GUTS_CPDIR2n&amp;nbsp;&amp;nbsp;&amp;nbsp; E_0000h base + 10Ch offset + (32d × i), where i=0d to 2d&lt;/P&gt;&lt;P&gt;GUTS_CPPAR1n&amp;nbsp;&amp;nbsp;&amp;nbsp; E_0000h base + 110h offset + (32d × i), where i=0d to 2d&lt;/P&gt;&lt;P&gt;GUTS_CPPAR2n&amp;nbsp;&amp;nbsp;&amp;nbsp; E_0000h base + 114h offset + (32d × i), where i=0d to 2d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is described in Section 20.5 GUITS Memory Map/Register Definition of P1021RM.pdf Rev. 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this is the example in p1021rdb-pc_32b.dts&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;soc: soc@ffe00000 {&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;ranges = &amp;lt;0x0 0x0 0xffe00000 0x100000&amp;gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;par_io@e0100 {&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;#address-cells = &amp;lt;1&amp;gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;#size-cells = &amp;lt;1&amp;gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;reg = &amp;lt;0xe0100 0x60&amp;gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;ranges = &amp;lt;0x0 0xe0100 0x60&amp;gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;device_type = "par_io";&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;num-ports = &amp;lt;3&amp;gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;qe_pio_b: gpio-controller@20 {&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;#gpio-cells = &amp;lt;2&amp;gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;compatible = "fsl,mpc8569-qe-pario-bank",&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;"fsl,mpc8323-qe-pario-bank";&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;reg = &amp;lt;0x20 0x18&amp;gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;gpio-controller;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;};&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Lunmin&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>Tue, 09 Jun 2015 06:10:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/How-to-access-GPIO-s-in-P1021-processor/m-p/436606#M2506</guid>
      <dc:creator>lunminliang</dc:creator>
      <dc:date>2015-06-09T06:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to access GPIO's in P1021 processor?</title>
      <link>https://community.nxp.com/t5/P-Series/How-to-access-GPIO-s-in-P1021-processor/m-p/436607#M2507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Freescale SDK supports sysfs possibility for GPIO using from user space.&lt;/P&gt;&lt;P&gt;Check please that the following kernel configuration options are set. These options are necessary &lt;/P&gt;&lt;P&gt;for sysfs GPIO support:&lt;/P&gt;&lt;P&gt;CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB&lt;/P&gt;&lt;P&gt;CONFIG_MPC8XXX_GPIO (Platform Support / MPC8xxx GPIO support)&lt;/P&gt;&lt;P&gt;CONFIG_OF_GPIO&lt;/P&gt;&lt;P&gt;CONFIG_GPIOLIB (-*- GPIO Support&amp;nbsp; ---&amp;gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;CONFIG_GPIO_SYSFS (/sys/class/gpio/... (sysfs interface))&lt;/P&gt;&lt;P&gt;CONFIG_GENERIC_GPIO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This option can be checked using the .config file in the kernel source folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPIO controllers should be declared in the Device Tree file. &lt;/P&gt;&lt;P&gt;More information on the device tree GPIO declaration can be found in the kernel source. &lt;/P&gt;&lt;P&gt;See please the following files: &lt;/P&gt;&lt;P&gt;/Documentation/powerpc/dts-bindings/gpio.txt and /Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This possibility is available using sysfs from user space.&lt;/P&gt;&lt;P&gt;See the following pages &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://elinux.org/GPIO" rel="nofollow" target="_blank"&gt;http://elinux.org/GPIO&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://www.kernel.org/doc/Documentation/gpio/sysfs.txt" rel="nofollow" target="_blank"&gt;https://www.kernel.org/doc/Documentation/gpio/sysfs.txt&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.lindusembedded.com/blog/2011/12/29/gpio-general-purpose-inputoutput-interfaces-in-linux-2/" rel="nofollow" target="_blank"&gt;http://www.lindusembedded.com/blog/2011/12/29/gpio-general-purpose-inputoutput-interfaces-in-linux-2/&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://www.kernel.org/doc/Documentation/gpio/sysfs.txt" rel="nofollow" target="_blank"&gt;https://www.kernel.org/doc/Documentation/gpio/sysfs.txt&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached file contains .dts file and command dump for GPIO using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second method consist of using mmap command.&lt;/P&gt;&lt;P&gt;It is a POSIX-compliant Linux/Unix system call that maps files or devices into memory. &lt;/P&gt;&lt;P&gt;It is a method of memory-mapped file I/O.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example, look at the following links (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Mmap" rel="nofollow" target="_blank"&gt;http://en.wikipedia.org/wiki/Mmap&lt;/A&gt;&lt;SPAN&gt;) and &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://beej.us/guide/bgipc/output/html/multipage/mmap.html" rel="nofollow" target="_blank"&gt;http://beej.us/guide/bgipc/output/html/multipage/mmap.html&lt;/A&gt;&lt;SPAN&gt;).&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&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>Tue, 09 Jun 2015 06:37:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/How-to-access-GPIO-s-in-P1021-processor/m-p/436607#M2507</guid>
      <dc:creator>Pavel</dc:creator>
      <dc:date>2015-06-09T06:37:57Z</dc:date>
    </item>
  </channel>
</rss>

