<?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 silently fails in u-boot rel_imx_5.4.24_2.1.0 in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1374171#M183280</link>
    <description>&lt;P&gt;It looks correct, those not reserved complaints are regarding other gpio pins, which most likely are used without first being opened with the gpio_request call.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Nov 2021 08:24:04 GMT</pubDate>
    <dc:creator>lmhdoms</dc:creator>
    <dc:date>2021-11-19T08:24:04Z</dc:date>
    <item>
      <title>GPIO silently fails in u-boot rel_imx_5.4.24_2.1.0</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1176746#M164393</link>
      <description>&lt;P&gt;I am having the an issue with the Linux BSP u-boot release version&amp;nbsp;&lt;SPAN&gt;rel_imx_5.4.24_2.1.0.&amp;nbsp; I am using an i.MX6UL processor which was running fine on an older version of u-boot (2015.04 release rel_imx_4.1.15_1.1.1_patch) and now that I am updating it the GPIOs silently fail.&amp;nbsp; I am initializing and setting/clearing GPIO the same way as all the i.MX evaluation boards do based on their board files under /board/freescale/.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is where I am setting up GPIO pins:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static iomux_v3_cfg_t const led_gpio_pads[] = { 
       MX6_PAD_ENET2_TX_DATA0__GPIO2_IO11 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL), 
       MX6_PAD_ENET2_RX_ER__GPIO2_IO15 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA03__GPIO3_IO08 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA04__GPIO3_IO09 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA05__GPIO3_IO10 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA06__GPIO3_IO11 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA07__GPIO3_IO12 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA08__GPIO3_IO13 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA09__GPIO3_IO14 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA10__GPIO3_IO15 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA11__GPIO3_IO16 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
       MX6_PAD_LCD_DATA12__GPIO3_IO17 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
};&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then the following code is run and fails silently:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;imx_iomux_v3_setup_multiple_pads(led_gpio_pads, ARRAY_SIZE(led_gpio_pads)); 
puts("Starting LEDs\n"); 
gpio_request(IMX_GPIO_NR(3,8), "led1 blue"); 
gpio_direction_output(IMX_GPIO_NR(3,8), 1); 
gpio_request(IMX_GPIO_NR(2,11), "led1 red"); 
gpio_direction_output(IMX_GPIO_NR(2,11), 1); 
gpio_request(IMX_GPIO_NR(3,9), "led2 red"); 
gpio_direction_output(IMX_GPIO_NR(3,9), 0); 
gpio_request(IMX_GPIO_NR(3,12), "led3 red"); 
gpio_direction_output(IMX_GPIO_NR(3,12), 0); 
gpio_request(IMX_GPIO_NR(3,15), "led4 red"); 
gpio_direction_output(IMX_GPIO_NR(3,15), 0); 
puts("Started LEDs\n");&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;I confirmed the above code is running since I can see the message "Started LEDs" printed out to the debug UART at boot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Additionally the gpio command line tool from the hush shell is not functioning.&amp;nbsp; Using the following I get a blank response:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=&amp;gt; gpio status -a&lt;/LI-CODE&gt;&lt;P&gt;or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=&amp;gt; gpio status 72&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Using the set command on any GPIO number will get the following result:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=&amp;gt; gpio set 72
GPIO: '72' not found
Command 'gpio' failed: Error -22&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;It appears like the initialization of the GPIO is not working and no pins are registered as GPIOs.&amp;nbsp; All other functionality works fine with non-GPIO settings like UART, MMC, I2C, etc.&amp;nbsp; Any help on this would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 16:02:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1176746#M164393</guid>
      <dc:creator>compmas2</dc:creator>
      <dc:date>2020-11-02T16:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO silently fails in u-boot rel_imx_5.4.24_2.1.0</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1176782#M164400</link>
      <description>&lt;P&gt;So I have a .dts for my board and I enabled the MXC_GPIO and GPIO_HOG in the u-boot config.&amp;nbsp; This allowed me to get the gpio scripting command to work with showing status and setting and clearing values.&amp;nbsp; The issue is the C code in the board file still does not work.&amp;nbsp; Instead it reports the following errors:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gpio@20a4000: dir_output: error: gpio GPIO3_5 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_4 not reserved
gpio@20a4000: set_value: error: gpio GPIO3_4 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_24 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_6 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_7 not reserved
gpio@20a4000: set_value: error: gpio GPIO3_7 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_22 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_21 not reserved
gpio@20a4000: set_value: error: gpio GPIO3_22 not reserved&lt;/LI-CODE&gt;&lt;P&gt;I really need to be able to setup the GPIOs in C code to reset chips and prevent manipulation of the setting of certain GPIOs by users of the product.&lt;/P&gt;&lt;P&gt;Unfortunately with this version of u-boot, there is a transition from direct driver calls to using driver models and device trees.&amp;nbsp; It seems the i.MX processor support from NXP is in flux and there is no guidance from NXP as to which drivers to use in the porting guide they publish.&amp;nbsp; Is there any place that details which drivers to use and how to use the functionality associated with them in the more recent versions of u-boot from NXP?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 18:05:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1176782#M164400</guid>
      <dc:creator>compmas2</dc:creator>
      <dc:date>2020-11-02T18:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO silently fails in u-boot rel_imx_5.4.24_2.1.0</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1177008#M164421</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; In 5.4.24_2.1.0 BSP, u-boot also uses device tree, so you should configure them in dts file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path is u-boot/arch/arm/dts&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a nice day!&lt;/P&gt;
&lt;P&gt;B.R,&lt;/P&gt;
&lt;P&gt;Weidong&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 06:19:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1177008#M164421</guid>
      <dc:creator>weidong_sun</dc:creator>
      <dc:date>2020-11-03T06:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO silently fails in u-boot rel_imx_5.4.24_2.1.0</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1178074#M164519</link>
      <description>&lt;P&gt;I defined the GPIOs in the device tree under the hog entry and I am getting the same failure messages:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gpio@20a4000: dir_output: error: gpio GPIO3_5 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_4 not reserved
gpio@20a4000: set_value: error: gpio GPIO3_4 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_24 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_6 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_7 not reserved
gpio@20a4000: set_value: error: gpio GPIO3_7 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_22 not reserved
gpio@20a4000: dir_output: error: gpio GPIO3_21 not reserved
gpio@20a4000: set_value: error: gpio GPIO3_22 not reserved&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I commented out the following code in the board file since the device tree is handling the IOMUX of the GPIO pins:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//static iomux_v3_cfg_t const led_gpio_pads[] = { 
//       MX6_PAD_ENET2_TX_DATA0__GPIO2_IO11 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL), 
//       MX6_PAD_ENET2_RX_ER__GPIO2_IO15 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA03__GPIO3_IO08 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA04__GPIO3_IO09 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA05__GPIO3_IO10 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA06__GPIO3_IO11 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA07__GPIO3_IO12 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA08__GPIO3_IO13 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA09__GPIO3_IO14 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA10__GPIO3_IO15 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA11__GPIO3_IO16 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//       MX6_PAD_LCD_DATA12__GPIO3_IO17 | MUX_PAD_CTRL(GPIO_PULL_DOWN_PAD_CTRL),
//};

//imx_iomux_v3_setup_multiple_pads(led_gpio_pads, ARRAY_SIZE(led_gpio_pads));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my hog entries in the .dts file for my board that cover the GPIOs:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;amp;iomuxc {
	pinctrl-names = "default";
	pinctrl-0 = &amp;lt;&amp;amp;pinctrl_hog_1&amp;gt;;

	board {
		pinctrl_hog_1: hoggrp-1 {
			fsl,pins = &amp;lt;
				MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11    0x030b0
				MX6UL_PAD_ENET2_RX_ER__GPIO2_IO15       0x030b0
				MX6UL_PAD_LCD_DATA03__GPIO3_IO08        0x030b0
				MX6UL_PAD_LCD_DATA04__GPIO3_IO09        0x030b0
				MX6UL_PAD_LCD_DATA05__GPIO3_IO10        0x030b0
				MX6UL_PAD_LCD_DATA06__GPIO3_IO11        0x030b0
				MX6UL_PAD_LCD_DATA07__GPIO3_IO12        0x030b0
				MX6UL_PAD_LCD_DATA08__GPIO3_IO13        0x030b0
				MX6UL_PAD_LCD_DATA09__GPIO3_IO14        0x030b0
				MX6UL_PAD_LCD_DATA10__GPIO3_IO15        0x030b0
				MX6UL_PAD_LCD_DATA11__GPIO3_IO16        0x030b0
				MX6UL_PAD_LCD_DATA12__GPIO3_IO17        0x030b0
			&amp;gt;;
		};
	};
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are the&amp;nbsp;&lt;SPAN&gt;gpio_request() and&amp;nbsp;gpio_direction_output() functions still supposed to work with the device tree method of initializing the GPIOs?&amp;nbsp; It looks like that is how all the i.MX6UL eval board files did it.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 17:02:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1178074#M164519</guid>
      <dc:creator>compmas2</dc:creator>
      <dc:date>2020-11-04T17:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO silently fails in u-boot rel_imx_5.4.24_2.1.0</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1374171#M183280</link>
      <description>&lt;P&gt;It looks correct, those not reserved complaints are regarding other gpio pins, which most likely are used without first being opened with the gpio_request call.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 08:24:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-silently-fails-in-u-boot-rel-imx-5-4-24-2-1-0/m-p/1374171#M183280</guid>
      <dc:creator>lmhdoms</dc:creator>
      <dc:date>2021-11-19T08:24:04Z</dc:date>
    </item>
  </channel>
</rss>

