imx93 uboot setting gpio

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

imx93 uboot setting gpio

ソリューションへジャンプ
2,531件の閲覧回数
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 件の賞賛
返信
1 解決策
2,511件の閲覧回数
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 件の賞賛
返信
1 返信
2,512件の閲覧回数
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 件の賞賛
返信