<?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: GPIO Interface on u-boot</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376623#M54028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kursad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply. We are using the u-boot gpio api . I need to configure the gpio163 as out and need to set value for it. Kindly let me know what modifications are needed in u-boot source code. Please find the beagle.c file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;board/beagle.c&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#include &amp;lt;common.h&amp;gt;&lt;BR /&gt;#include &amp;lt;twl4030.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/io.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/arch/mux.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/arch/sys_proto.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/arch/gpio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/mach-types.h&amp;gt;&lt;BR /&gt;#include "beagle.h"&lt;/P&gt;&lt;P&gt;static int beagle_revision_c;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: board_init&lt;BR /&gt; * Description: Early hardware init.&lt;BR /&gt; */&lt;BR /&gt;int board_init(void)&lt;BR /&gt;{&lt;BR /&gt; DECLARE_GLOBAL_DATA_PTR;&lt;/P&gt;&lt;P&gt; gpmc_init(); /* in SRAM or SDRAM, finish GPMC */&lt;BR /&gt; /* board id for Linux */&lt;BR /&gt; gd-&amp;gt;bd-&amp;gt;bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;&lt;BR /&gt; /* boot param addr */&lt;BR /&gt; gd-&amp;gt;bd-&amp;gt;bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);&lt;/P&gt;&lt;P&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: beagle_get_revision&lt;BR /&gt; * Description: Return the revision of the BeagleBoard this code is running on.&lt;BR /&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; If it is a revision Ax/Bx board, this function returns 0,&lt;BR /&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; on a revision C board you will get a 1.&lt;BR /&gt; */&lt;BR /&gt;int beagle_get_revision(void)&lt;BR /&gt;{&lt;BR /&gt; return beagle_revision_c;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: beagle_identify&lt;BR /&gt; * Description: Detect if we are running on a Beagle revision Ax/Bx or&lt;BR /&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; Cx. This can be done by GPIO_171. If this is low, we are&lt;BR /&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; running on a revision C board.&lt;BR /&gt; */&lt;BR /&gt;void beagle_identify(void)&lt;BR /&gt;{&lt;BR /&gt; beagle_revision_c = 0;&lt;BR /&gt; if (!omap_request_gpio(171)) {&lt;BR /&gt;&amp;nbsp; unsigned int val;&lt;/P&gt;&lt;P&gt;&amp;nbsp; omap_set_gpio_direction(171, 1);&lt;BR /&gt;&amp;nbsp; val = omap_get_gpio_datain(171);&lt;BR /&gt;&amp;nbsp; omap_free_gpio(171);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (val)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; beagle_revision_c = 0;&lt;BR /&gt;&amp;nbsp; else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; beagle_revision_c = 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt; printf("Board revision ");&lt;BR /&gt; if (beagle_revision_c)&lt;BR /&gt;&amp;nbsp; printf("C\n");&lt;BR /&gt; else&lt;BR /&gt;&amp;nbsp; printf("Ax/Bx\n");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: misc_init_r&lt;BR /&gt; * Description: Configure board specific parts&lt;BR /&gt; */&lt;BR /&gt;int misc_init_r(void)&lt;BR /&gt;{&lt;BR /&gt; struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;&lt;BR /&gt; struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;&lt;/P&gt;&lt;P&gt; twl4030_power_init();&lt;BR /&gt; twl4030_led_init();&lt;/P&gt;&lt;P&gt; /* Configure GPIOs to output */&lt;BR /&gt; writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &amp;amp;gpio6_base-&amp;gt;oe);&lt;BR /&gt; writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |&lt;BR /&gt;&amp;nbsp; GPIO15 | GPIO14 | GPIO13 | GPIO12), &amp;amp;gpio5_base-&amp;gt;oe);&lt;/P&gt;&lt;P&gt; /* Set GPIOs */&lt;BR /&gt; writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1,&lt;BR /&gt;&amp;nbsp; &amp;amp;gpio6_base-&amp;gt;setdataout);&lt;BR /&gt; writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |&lt;BR /&gt;&amp;nbsp; GPIO15 | GPIO14 | GPIO13 | GPIO12, &amp;amp;gpio5_base-&amp;gt;setdataout);&lt;/P&gt;&lt;P&gt; beagle_identify();&lt;/P&gt;&lt;P&gt; dieid_num_r();&lt;/P&gt;&lt;P&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: set_muxconf_regs&lt;BR /&gt; * Description: Setting up the configuration Mux registers specific to the&lt;BR /&gt; *&amp;nbsp; hardware. Many pins need to be moved from protect to primary&lt;BR /&gt; *&amp;nbsp; mode.&lt;BR /&gt; */&lt;BR /&gt;void set_muxconf_regs(void)&lt;BR /&gt;{&lt;BR /&gt; MUX_BEAGLE();&lt;/P&gt;&lt;P&gt; if (beagle_revision_c) {&lt;BR /&gt;&amp;nbsp; MUX_BEAGLE_C();&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Divya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2015 06:35:33 GMT</pubDate>
    <dc:creator>divyardharan</dc:creator>
    <dc:date>2015-03-12T06:35:33Z</dc:date>
    <item>
      <title>GPIO Interface on u-boot</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376621#M54026</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 configured the GPIO in kernel to read switch status and light LED.Kindly help me with suggestions to configure the same in u boot.We are using sabresd imx6q board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Divya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 12:40:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376621#M54026</guid>
      <dc:creator>divyardharan</dc:creator>
      <dc:date>2015-03-11T12:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO Interface on u-boot</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376622#M54027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. Set iomuxing for your gpio. Your board.c file should already have some iomux examples.&lt;/P&gt;&lt;P&gt;2. Use the u-boot gpio api: &lt;A href="http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/gpio/mxc_gpio.c;h=815407bb03eecac7c4e8c300a1355d874b7051d3;hb=HEAD" title="http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/gpio/mxc_gpio.c;h=815407bb03eecac7c4e8c300a1355d874b7051d3;hb=HEAD"&gt;http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/gpio/mxc_gpio.c;h=815407bb03eecac7c4e8c300a1355d874b7051d3;hb=HEAD&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 17:28:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376622#M54027</guid>
      <dc:creator>KursadOney</dc:creator>
      <dc:date>2015-03-11T17:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO Interface on u-boot</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376623#M54028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kursad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply. We are using the u-boot gpio api . I need to configure the gpio163 as out and need to set value for it. Kindly let me know what modifications are needed in u-boot source code. Please find the beagle.c file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;board/beagle.c&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#include &amp;lt;common.h&amp;gt;&lt;BR /&gt;#include &amp;lt;twl4030.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/io.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/arch/mux.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/arch/sys_proto.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/arch/gpio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;asm/mach-types.h&amp;gt;&lt;BR /&gt;#include "beagle.h"&lt;/P&gt;&lt;P&gt;static int beagle_revision_c;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: board_init&lt;BR /&gt; * Description: Early hardware init.&lt;BR /&gt; */&lt;BR /&gt;int board_init(void)&lt;BR /&gt;{&lt;BR /&gt; DECLARE_GLOBAL_DATA_PTR;&lt;/P&gt;&lt;P&gt; gpmc_init(); /* in SRAM or SDRAM, finish GPMC */&lt;BR /&gt; /* board id for Linux */&lt;BR /&gt; gd-&amp;gt;bd-&amp;gt;bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;&lt;BR /&gt; /* boot param addr */&lt;BR /&gt; gd-&amp;gt;bd-&amp;gt;bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);&lt;/P&gt;&lt;P&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: beagle_get_revision&lt;BR /&gt; * Description: Return the revision of the BeagleBoard this code is running on.&lt;BR /&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; If it is a revision Ax/Bx board, this function returns 0,&lt;BR /&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; on a revision C board you will get a 1.&lt;BR /&gt; */&lt;BR /&gt;int beagle_get_revision(void)&lt;BR /&gt;{&lt;BR /&gt; return beagle_revision_c;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: beagle_identify&lt;BR /&gt; * Description: Detect if we are running on a Beagle revision Ax/Bx or&lt;BR /&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; Cx. This can be done by GPIO_171. If this is low, we are&lt;BR /&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; running on a revision C board.&lt;BR /&gt; */&lt;BR /&gt;void beagle_identify(void)&lt;BR /&gt;{&lt;BR /&gt; beagle_revision_c = 0;&lt;BR /&gt; if (!omap_request_gpio(171)) {&lt;BR /&gt;&amp;nbsp; unsigned int val;&lt;/P&gt;&lt;P&gt;&amp;nbsp; omap_set_gpio_direction(171, 1);&lt;BR /&gt;&amp;nbsp; val = omap_get_gpio_datain(171);&lt;BR /&gt;&amp;nbsp; omap_free_gpio(171);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (val)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; beagle_revision_c = 0;&lt;BR /&gt;&amp;nbsp; else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; beagle_revision_c = 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt; printf("Board revision ");&lt;BR /&gt; if (beagle_revision_c)&lt;BR /&gt;&amp;nbsp; printf("C\n");&lt;BR /&gt; else&lt;BR /&gt;&amp;nbsp; printf("Ax/Bx\n");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: misc_init_r&lt;BR /&gt; * Description: Configure board specific parts&lt;BR /&gt; */&lt;BR /&gt;int misc_init_r(void)&lt;BR /&gt;{&lt;BR /&gt; struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;&lt;BR /&gt; struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;&lt;/P&gt;&lt;P&gt; twl4030_power_init();&lt;BR /&gt; twl4030_led_init();&lt;/P&gt;&lt;P&gt; /* Configure GPIOs to output */&lt;BR /&gt; writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &amp;amp;gpio6_base-&amp;gt;oe);&lt;BR /&gt; writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |&lt;BR /&gt;&amp;nbsp; GPIO15 | GPIO14 | GPIO13 | GPIO12), &amp;amp;gpio5_base-&amp;gt;oe);&lt;/P&gt;&lt;P&gt; /* Set GPIOs */&lt;BR /&gt; writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1,&lt;BR /&gt;&amp;nbsp; &amp;amp;gpio6_base-&amp;gt;setdataout);&lt;BR /&gt; writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |&lt;BR /&gt;&amp;nbsp; GPIO15 | GPIO14 | GPIO13 | GPIO12, &amp;amp;gpio5_base-&amp;gt;setdataout);&lt;/P&gt;&lt;P&gt; beagle_identify();&lt;/P&gt;&lt;P&gt; dieid_num_r();&lt;/P&gt;&lt;P&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Routine: set_muxconf_regs&lt;BR /&gt; * Description: Setting up the configuration Mux registers specific to the&lt;BR /&gt; *&amp;nbsp; hardware. Many pins need to be moved from protect to primary&lt;BR /&gt; *&amp;nbsp; mode.&lt;BR /&gt; */&lt;BR /&gt;void set_muxconf_regs(void)&lt;BR /&gt;{&lt;BR /&gt; MUX_BEAGLE();&lt;/P&gt;&lt;P&gt; if (beagle_revision_c) {&lt;BR /&gt;&amp;nbsp; MUX_BEAGLE_C();&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Divya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 06:35:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376623#M54028</guid>
      <dc:creator>divyardharan</dc:creator>
      <dc:date>2015-03-12T06:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO Interface on u-boot</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376624#M54029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Divya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer&lt;/P&gt;&lt;P&gt;board\freescale\mx6qsabresd\mx6qsabresd.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make modification for your GPIO according to setup_iomux_enet().&lt;/P&gt;&lt;P&gt;I hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 07:00:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-Interface-on-u-boot/m-p/376624#M54029</guid>
      <dc:creator>saurabh206</dc:creator>
      <dc:date>2015-03-12T07:00:30Z</dc:date>
    </item>
  </channel>
</rss>

