SD Card (USDHC2) Configuration on Custom Carrier Board – Colibri iMX6DL

Hello Everyone,

I am working on Colibri iMX6DL Module, and below are the OS details

root@colibri-imx6-12822473:~# tdx-info

Software summary

Bootloader: U-Boot

Kernel version: 6.6.119-7.5.0 #1 SMP PREEMPT Sat Dec 6 21:18:54 UTC 2025
Kernel command line: root=PARTUUID=f94e0a4a-02 ro rootwait console=tty1 console=ttymxc0,115200
Distro name: NAME=“TDX Wayland with XWayland Upstream”
Distro version: VERSION_ID=7.5.0-build.11
Distro variant: -
Hostname: colibri-imx6-12822473

Hardware info

HW model: Toradex Colibri iMX6DL/S on Colibri Evaluation Board V3

Toradex version: 0017 V1.1B
Serial number: 12822473
Processor arch: armv7l

Currently, I am working with an SD card interface.
On the Colibri Evaluation Board, the SD card is connected to mmc0 (USDHC1), and it is working as expected.

Queries:

Pinmux & Configuration

  • What are the required device tree changes to configure USDHC2 (mmc1) for SD card operation?
  • How to correctly set up pin multiplexing and related configurations (pinctrl, bus width, CD/WP GPIOs, etc.)?

Build and Development

  • What are the steps to rebuild the device tree with these changes
  • How to deploy/apply the updated DTB on the SOM
  • How to ensure proper boot and validate SD card functionality on the custom carrier board?

Kindly guide me on the above.

Thanks in advance!

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Based on your Colibri iMX6DL setup running BSP 7.5.0, I’ll guide you through configuring USDHC2 for SD card operation on your custom carrier board.

Device Tree Configuration for USDHC2 (1)(2)

Pin Multiplexing Configuration

You’ll need to add pin control configuration for USDHC2 in your device tree. Add this to the iomuxc node (2):

&iomuxc {
    pinctrl_usdhc2: usdhc2grp {
        fsl,pins = <
            MX6QDL_PAD_SD2_CMD__SD2_CMD     0x17059
            MX6QDL_PAD_SD2_CLK__SD2_CLK     0x10059
            MX6QDL_PAD_SD2_DAT0__SD2_DATA0  0x17059
            MX6QDL_PAD_SD2_DAT1__SD2_DATA1  0x17059
            MX6QDL_PAD_SD2_DAT2__SD2_DATA2  0x17059
            MX6QDL_PAD_SD2_DAT3__SD2_DATA3  0x17059
        >;
    };
};

(2)

USDHC2 Node Configuration

Enable and configure the USDHC2 controller (2):

&usdhc2 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usdhc2>;
    bus-width = <4>;
    cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;  /* Adjust GPIO for card detect */
    wp-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; /* Adjust GPIO for write protect */
    status = "okay";
};

(2)

Device Tree Modification Process (1)(3)

Choose Base Device Tree

For your Colibri iMX6DL, locate the base device tree file in the kernel source (3):

  • Look in /arch/arm/boot/dts/nxp/ directory
  • Find the appropriate base DTS file for your module

Create Custom Device Tree

  1. Create your custom device tree by copying the base file (3):
$ cp ./arch/arm/boot/dts/nxp/imx6dl-colibri-eval-v3.dts ./arch/arm/boot/dts/nxp/imx6dl-colibri-custom.dts

(3)

  1. Edit the Makefile to include your custom device tree (3):
dtb-$(CONFIG_SOC_*) += imx6dl-colibri-custom.dtb

(3)

Build and Deployment (1)(3)

Compile the Device Tree

Compile your custom device tree (3):

$ make DTC_FLAGS="-@" <device-tree>.dtb

(3)

Deploy to Running Device

Copy the compiled device tree to your module (3):

$ scp <custom-device-tree>.dtb root@<ip-address>:/boot

(3)

Then reboot and interrupt the autoboot sequence to access U-Boot console (3).

SD Card Validation (4)

After deployment, verify your SD card functionality:

Check Device Detection

Use the symlink to identify your SD card device (4):

# ls -l /dev/colibri-sd*

(4)

Verify Card Specifications

Check the card specifications through sysfs (4):

# cat /sys/kernel/debug/mmc1/ios

(4)

Test Performance

Use hdparm to test data transfer rates (4):

# hdparm -t /dev/mmcblk1

(4)

Important Considerations

  1. Pin Assignment: Ensure your custom carrier board routes the USDHC2 signals correctly to your SD card connector
  2. GPIO Configuration: Adjust the card detect (CD) and write protect (WP) GPIO assignments based on your carrier board design (2)
  3. Power Supply: Verify proper power supply configuration for the SD card interface

The key changes involve adding proper pin multiplexing configuration and enabling the USDHC2 controller with appropriate settings for your hardware design (1)(2).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.