I am having the an issue with the Linux BSP u-boot release version rel_imx_5.4.24_2.1.0. 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. 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/.
Here is where I am setting up GPIO pins:
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),
};
Then the following code is run and fails silently:
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");
I confirmed the above code is running since I can see the message "Started LEDs" printed out to the debug UART at boot.
Additionally the gpio command line tool from the hush shell is not functioning. Using the following I get a blank response:
=> gpio status -a
or
=> gpio status 72
Using the set command on any GPIO number will get the following result:
=> gpio set 72
GPIO: '72' not found
Command 'gpio' failed: Error -22
It appears like the initialization of the GPIO is not working and no pins are registered as GPIOs. All other functionality works fine with non-GPIO settings like UART, MMC, I2C, etc. Any help on this would be appreciated.