The original Linux distribution for the iMX6SL EVK configured the SDMMC2 interface as a 4-Data line interface. Our hardware uses the 8-Data line with CLK, CMD, and RST.
1) Make sure the IOMUX is configured correctly for the SDMMCx interface, i.e., SDMMC2.
In the IOMUX pad table, make sure it has the following like this, it might varies depending the the speed your interface support.
| MX6SL_PAD_SD2_RST__USDHC2_RST, |
| MX6SL_PAD_SD2_CLK__USDHC2_CLK_50MHZ, |
| MX6SL_PAD_SD2_CMD__USDHC2_CMD_50MHZ, |
| MX6SL_PAD_SD2_DAT0__USDHC2_DAT0_50MHZ, |
| MX6SL_PAD_SD2_DAT1__USDHC2_DAT1_50MHZ, |
| MX6SL_PAD_SD2_DAT2__USDHC2_DAT2_50MHZ, |
| MX6SL_PAD_SD2_DAT3__USDHC2_DAT3_50MHZ, |
| MX6SL_PAD_SD2_DAT4__USDHC2_DAT4_50MHZ, |
| MX6SL_PAD_SD2_DAT5__USDHC2_DAT5_50MHZ, |
| MX6SL_PAD_SD2_DAT6__USDHC2_DAT6_50MHZ, |
| MX6SL_PAD_SD2_DAT7__USDHC2_DAT7_50MHZ, |
In the board initialization file, i.e. board-mx6sl_evk.c
static const struct esdhc_platform_data mx6sl_sd2_data __initconst = {
.cd_type = ESDHC_CD_PERMANENT,
.always_present = 1,
.support_8bit = 1,
.keep_power_at_suspend = 1,
.delay_line = 0,
.support_18v = 0,
.platform_pad_change = plt_sd_pad_change,
};
In the main initialization function, i.e.,
static void __init mx6_evk_init(void)
{
...
...
..
| imx6q_add_sdhci_usdhc_imx(1, &mx6sl_sd2_data); |
....
}
It is appropriately configured - you should see the mmcblk0, mmcblk0boot0, and mmcblk0boo1 block devices get enumerated once the Linux kernel is booted.
Not all the features are supported in the Linux distribution but at least writes/reads to the eMMC appropriately. To boot from the eMMC once uboot, Linux, and root filesystem are stored on the device, you need to specify the correct boot pins to boot from the eMMC device.