User`s guide
Adding Support for the i.MX53 ESDHC
i.MX53 System Development User’s Guide, Rev. 1
Freescale Semiconductor 15-3
{
.flags = IORESOURCE_IRQ,
},
};
struct platform_device mxcsdhcXX_device = {
.name = "mxsdhci",
.id = YY,
.num_resources = ARRAY_SIZE(mxcsdhcXX_resources),
.resource = mxcsdhcXX_resources,
};
Variables have values as follows:
• XX can be 1, 2, 3 or 4 depending on the SD port.
• YY can have a value between 0 and 3.
• SD1’s ID is 0; SD2's ID is 1; SD3's ID is 2; and SD4's ID is 3.
Declare the structures as externs in <ltib>/linux/arch/arm/mach-mx5/devices.h with the following code.
extern struct platform_device mxcsdhc1_device;
extern struct platform_device mxcsdhc2_device;
extern struct platform_device mxcsdhc3_device;
extern struct platform_device mxcsdhc4_device;
15.2.2 Configuring Pins for SD Function
IOMUX allows several configurations, each with slight variances in the pins. The iomux-mx53.h file
contains the definitions for all i.MX53 pads. Add entries in this file to define the configuration for the SD
function. See Chapter 13, “Configuring the IOMUX Controller (IOMUXC),” for a description of how to
set up the IOMUX and pads for routing signals as desired.
15.2.3 Creating the Platform Data Structure
After pin out configuration, SD card characteristics need to be described in an mxc_mmc_platform_data
structure. Create one structure per SD in the system: mmc1_data, mmc2_data, mmc3_data, and/or
mmc4_data. These structures must be placed in
<ltib>/linux/arch/arm/mach-mx5/mx53_<board name>.c.
static struct mxc_mmc_platform_data mmc4_data = {
.ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29 | MMC_VDD_29_30 | MMC_VDD_31_32,
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | MMC_CAP_DATA_DDR,
.min_clk = 400000,
.max_clk = 50000000,
.card_inserted_state = 0,
.status = sdhc_get_card_det_status,
.wp_status = sdhc_write_protect,
.clock_mmc = "esdhc_clk",
.power_mmc = NULL,
};
The preceding example shows the an example of an SD4 structure for a custom board. The SD4 interface
supports either 4 bit or 8 bit data transfers (SD4_DAT[7:0]). Clock frequency can be set to a value between