Hi NXP,
We are using the imx93 11x11 kernel 6.1.36 for our board.
I need to set the GPIO to HIGH during the bootloader stage.
How can I control the GPIO output from the CPU and set the pin to HIGH in U-Boot?
Below is the relevant configuration I found in board/freescale/imx93_evk/imx93_evk.c.
Q1: How is gpio@22_13 configured?
Q2: ret = dm_gpio_request(&desc, "EXT1_PWREN");
How do I set EXT1_PWREN as a GPIO output from the CPU?
Or have other suggestions.
static void board_gpio_init(void)
{
struct gpio_desc desc;
int ret;
/* Enable EXT1_PWREN for PCIE_3.3V */
ret = dm_gpio_lookup_name("gpio@22_13", &desc);
if (ret)
return;
ret = dm_gpio_request(&desc, "EXT1_PWREN");
if (ret)
return;
dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
dm_gpio_set_value(&desc, 1);
/* Deassert SD3_nRST */
ret = dm_gpio_lookup_name("gpio@22_12", &desc);
if (ret)
return;
ret = dm_gpio_request(&desc, "SD3_nRST");
if (ret)
return;
dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
dm_gpio_set_value(&desc, 1);
if (IS_ENABLED(CONFIG_TARGET_IMX93_14X14_EVK)) {
/* Enable I2C_LS_EN levelshift */
ret = dm_gpio_lookup_name("gpio@20_16", &desc);
if (ret)
return;
ret = dm_gpio_request(&desc, "I2C_LS_EN");
if (ret)
return;
dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
dm_gpio_set_value(&desc, 1);
}
}
Thanks,
Solved! Go to Solution.
Hi @charleshuang!
Thank you for contacting NXP Support!
For the u-boot stage, I recommend declaring the gpio in the u-boot device tree.
You can take the device tree of iMX8MP as a reference.
Best Regards!
Chavira
Hi @charleshuang!
Thank you for contacting NXP Support!
For the u-boot stage, I recommend declaring the gpio in the u-boot device tree.
You can take the device tree of iMX8MP as a reference.
Best Regards!
Chavira