imx93 uboot setting gpio

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx93 uboot setting gpio

Jump to solution
779 Views
charleshuang
Senior Contributor II

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,

0 Kudos
Reply
1 Solution
759 Views
Chavira
NXP TechSupport
NXP TechSupport

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.

 

https://github.com/nxp-imx/uboot-imx/blob/7376547b9e424b2d0f42dfe96394168c781ca297/arch/arm/dts/imx8... 

 

Best Regards!

Chavira

View solution in original post

0 Kudos
Reply
1 Reply
760 Views
Chavira
NXP TechSupport
NXP TechSupport

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.

 

https://github.com/nxp-imx/uboot-imx/blob/7376547b9e424b2d0f42dfe96394168c781ca297/arch/arm/dts/imx8... 

 

Best Regards!

Chavira

0 Kudos
Reply