[u-boot v2024.04] can't request gpio before "dm_init_and_scan"

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

[u-boot v2024.04] can't request gpio before "dm_init_and_scan"

1,158 Views
yoooh8668
Contributor III

Hi,

We are trying u-boot v2024.04 for release: LF6.6.23_2.0.0.

I have a question about GPIO request:

In v2023.04,  `board_early_init_f`  can't run DM_GPIO function().
We can use `imx_iomux_v3_setup_multiple_pads` and `gpio_request` request them.

But in v2024.04, either of them can request the GPIO.

We notice that imx91_evk use setbits_le32 to perform operation of GPIO.
Can you please tell which modification cause this? And how?

this issue seems to be related to changes of DM_SPL?

commit 8c103c33fb14086aad6feda504934314d4397dd7
Author: Simon Glass <sjg@chromium.org>
Date: Mon Feb 13 08:56:33 2023 -0700

dm: dts: Convert driver model tags to use new schema

Now that Linux has accepted these tags, move the device tree files in
U-Boot over to use them.

Signed-off-by: Simon Glass <sjg@chromium.org>

THANKS~~

Joe

Labels (2)
Tags (3)
0 Kudos
Reply
2 Replies

1,133 Views
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @yoooh8668 

 

Could you please point to me what Board or processor are you using?

In post you described the imx91_evk and in the labels the i.MX8M.

 

Best regards,

Salas.

0 Kudos
Reply

1,102 Views
yoooh8668
Contributor III

I'm using i.MX8MP, but this issue should happen on all of the platform.

We can't request GPIO in u-boot before the DM init.

i.MX91 is the platform the evidence of the behavior, it directly control the register.

int board_early_init_f(void)
{
imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
imx_iomux_v3_setup_multiple_pads(lcdif_gpio_pads, ARRAY_SIZE(lcdif_gpio_pads));

/* Workaround LCD panel leakage, output low of CLK/DE/VSYNC/HSYNC as early as possible */
struct gpio_regs *gpio2 = (struct gpio_regs *)(GPIO2_BASE_ADDR + 0x40);
setbits_le32(&gpio2->gpio_pcor, 0xf);
setbits_le32(&gpio2->gpio_pddr, 0xf);
/* Set GPIO2_26 to output high to disable panel backlight at default */
setbits_le32(&gpio2->gpio_psor, BIT(26));
setbits_le32(&gpio2->gpio_pddr, BIT(26));

init_uart_clk(LPUART1_CLK_ROOT);

return 0;
}

0 Kudos
Reply