Colibri IMX6ULL SODIMM_99 pin issues in u-boot

Hello,

We’re having some issues in u-boot with the pin SODIMM_99 (GPIO1 14) which acts as an LED (Output).
The pin is nor set nor clearable using the u-boot CLI:

gpio set GPIO1_14
gpio: pin GPIO1_14 (gpio 14) value is 1
   Warning: value of pin is still 0
gpio clear GPIO1_14
gpio: pin GPIO1_14 (gpio 14) value is 0

I can always measure a steady ~1.66V to GND, regardless of what I try to set, which causes the LED to glow lightely.

The LED is connected directly from GND to the PIN (using a series resistor).

We have further, similar LEDs on other pins (SODIMM 101,103,105) which don’t have that problem and are set/clearable.

As soon as the OS is running, I can set all the pins using sysfs (/sys/class/leds/) without an issue, including Pin99, so this shouldn’t be a hardware issue.

It seems that something else is using this pin in u-boot, but I checked the devicetree and couldn’t find anything:

For verification I tested with the default BSP 6.7.0, installed from web using TEZI, but got the same result in u-boot.

 tdx-info

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.1.96-6.7.0+git.99e6a620de00 #1 SMP Thu Jun 27 11:46:24 UTC 2024
Kernel command line:      user_debug=30 root=PARTUUID=68be4b3e-02 ro rootwait console=tty1 console=ttymxc0,115200n8 consoleblank=0
Distro name:              NAME="TDX Wayland with XWayland Upstream"
Distro version:           VERSION_ID=6.7.0-build.13
Distro variant:           -
Hostname:                 colibri-imx6ull-emmc-07324483
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Colibri iMX6ULL 1GB (eMMC) on Colibri Evaluation Board V3
Toradex version:          0062 V1.1A
Serial number:            07324483
Processor arch:           armv7l
------------------------------------------------------------

Thanks and regards,

Simon

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello Simon,

It seems like you’re experiencing an issue with controlling the GPIO1_14 (SODIMM_99) pin in U-Boot on the Colibri iMX6ULL module. Given that the pin works correctly under the Linux OS, it suggests that the hardware is functioning properly and the issue is likely related to U-Boot configuration or initialization.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check Pin Multiplexing in U-Boot:
    Ensure that the pin is correctly configured as a GPIO in U-Boot. You can check the pin multiplexing settings in the U-Boot device tree files (imx6ull-colibri.dtsi, imx6ull-colibri-u-boot.dtsi, etc.). Look for the pin configuration and ensure it is set as a GPIO and not being used by another peripheral.

  2. Check U-Boot GPIO Initialization:
    Verify that the GPIO subsystem is properly initialized in U-Boot. Sometimes, GPIOs might not be correctly initialized, leading to issues in setting or clearing them.

  3. Check for Conflicting Configurations:
    Ensure that there are no conflicting configurations in the U-Boot device tree or board-specific files that might be affecting the GPIO1_14 pin.

  4. Test with a Minimal U-Boot Configuration:
    Try testing with a minimal U-Boot configuration to isolate the issue. Disable any unnecessary peripherals or configurations that might be interfering with the GPIO.

  5. Check U-Boot Version:
    Ensure you are using a stable and supported version of U-Boot. Sometimes, upgrading or downgrading U-Boot can resolve such issues.

  6. Debugging:
    Add debug prints in the U-Boot GPIO driver code to trace the execution and see where it might be failing to set or clear the pin.

  7. Compare with Working Pins:
    Compare the configuration and initialization of the problematic pin (GPIO1_14) with the other working pins (SODIMM 101, 103, 105). Look for any differences that might explain the issue.

If after these steps the issue persists, you might want to reach out to Toradex technical support for further assistance. They can provide more specific guidance and help you debug the issue in detail.

Best regards,
[Your Name]

Please, also check if these links can help you solve your problem:

Flashing RootFS from u-boot on Colibri IMX6ULL.

Hello @SimonG,

Checking the device tree, SODIMM 99 is configured as a regular GPIO in u-boot for the Colibri iMX6ULL eMMC, not being used elsewhere.
I would also recommend that you check the source from DENX, which is where we get u-boot from.

That being said, it seems that, when using u-boot from the Toradex Reference Minimal Image 6.7.0, the pin is not configured with the alt mode 5 for GPIO:

Colibri iMX6ULL # md.l 0x020E0054 1
020e0054: 00000000

By manually setting the iomuxc register, it is possible to use the pin as a GPIO:

Colibri iMX6ULL # mw.l 0x020E0054 0x00000005
Colibri iMX6ULL # md.l 0x020E0054 1         
020e0054: 00000005
Colibri iMX6ULL # gpio clear GPIO1_14
gpio: pin GPIO1_14 (gpio 14) value is 0
Colibri iMX6ULL # gpio set GPIO1_14  
gpio: pin GPIO1_14 (gpio 14) value is 1
   Warning: value of pin is still 0

Please note that the warning is still present when setting the pin value to 1, but I can measure it at 3.3V.

Best Regards,
Bruno

Hello @bruno.tx

Thanks for your response.
I can reproduce your solution on my Hardware using the default Image and my custom BSP, the LED can be set/cleared as expected after these commands.

Would it be possible to setup the iomux properly in the Code/dtb already (preferrably dtb)? Where should this be done?

Best Regards,
Simon

Hello @SimonG,

I need to do some further testing to confirm why this is not the default configuration, as the u-boot device tree appears to be correct.

Before then, you could manually add the mw.l 0x020E0054 0x00000005 before you make use of this GPIO.

Once I get a conclusion on the device tree topic, I will send an update here.

Best Regards,
Bruno

1 Like

Hello @SimonG,

Upon further investigation, u-boot is not applying the pinctrl from the device tree.
This is likely due to the limited device tree support which is present in u-boot.
A way to guarantee this configuration would be to include it in the board initialization file, please see the attached patch, which does just that for this GPIO pin.

0001-colibri-imx6ull-Configure-GPIO1_IO14-as-GPIO.patch (1.3 KB)

Best Regards,
Bruno

Hello @bruno.tx

Thanks for the patch.
I changed the Pin to Pulldown, because with PU the LED keeps glowing slighely.

#define GPIO_PAD_CTRL (PAD_CTL_PUS_100K_DOWN | PAD_CTL_SPEED_LOW |
PAD_CTL_DSE_60ohm | PAD_CTL_SRE_SLOW)

Otherways, it works now, the Pin is low on boot and I can set/clear the GPIO.

Is this a workaround that can be dropped later? E.g. with the next Bootloader/BSP upgrade?

Regards,
Simon

Hello @SimonG,

Thanks for the update.

Most likely yes, however when this could be done is not clear.
We usually update the u-boot version with every major BSP release (5, 6, 7, etc.), so if there is an update to u-boot that allows for the gpios to be automatically configured according to the device tree this feature would eventually be available in a new BSP version.

Best Regards,
Bruno

Hello @bruno.tx

Okay, we can live with this solution, I will re-check this as soon as we update to the new BSP Major version.

Thanks you again for your help.

Regards,
Simon

1 Like

Hello again @bruno.tx

We’re in the process of upgrading to the new BSP7. Unfortunately, the Pinmux still doesn’t work using the DT.
Further, setting the pin in the board.c file also doesn’t work the same as in BPS6: The pin is still configured as GPIO (Can be set and cleared) but without actively setting the Pin to low (gpio clear GPIO1_14) the LED is now yet again glowing lightely, with ~1.6V. Previously, just configuring with a Pulldown worked.

My definition:

#define GPIO_PAD_CTRL  (PAD_CTL_PUS_100K_DOWN | PAD_CTL_SPEED_LOW | \
                        PAD_CTL_DSE_60ohm | PAD_CTL_SRE_SLOW)
static const iomux_v3_cfg_t set_pin_mux_workaround[] = {
  MX6_PAD_JTAG_TCK__GPIO1_IO14 | MUX_PAD_CTRL(GPIO_PAD_CTRL), /* SODIMM_99 */
};

in board_init():

/* Workaround: Set Pin as output low */
#define SODIMM_99_PIN IMX_GPIO_NR(1, 14)
imx_iomux_v3_setup_multiple_pads(set_pin_mux_workaround, ARRAY_SIZE(set_pin_mux_workaround));
//BSP7 now requires to actively set the pin as output to have a properly defined state...
gpio_request(SODIMM_99_PIN, "led-level2-failure");
gpio_direction_output(SODIMM_99_PIN, 0);

In Linux, everything still seems to work alright, this only affects the bootloader.

Is this a known issue, or are there other steps required with the new BSP/U-Boot for proper setup?

Thanks and regards,
Simon

Hello @SimonG,

Sorry for the delay here.

To ensure the GPIO is low, you can simply set it as low in the board file, after the pin is initialized:

...
gpio_request(SODIMM_99_PIN, "led-level2-failure");
gpio_set_value(SODIMM_99_PIN, 0);

Best Regards,
Bruno

1 Like