User`s guide

Adding Support for the i.MX53 ESDHC
i.MX53 System Development User’s Guide, Rev. 1
15-2 Freescale Semiconductor
15.2 Including Support for SD1/SD2/SD3/SD4
For hardware that includes connectivity for any SD interface, include SD support from the BSP. Make the
required changes in the mach-mx5 folder at <ltib>/linux/arch/arm/mach-mx5 and follow the steps below.
1. Create the platform_device struct for all SD cards.
2. Configure the SD card pins.
3. Create struct mxc_mmc_platform_data.
4. Set up card detection.
These steps are discussed in detail in the following subsections.
15.2.1 Creating Platform Device Structures for all SD Cards
To create required platform device structures, open <ltib>/linux/arch/arm/mach-mx5/devices.c. Use the
following code to ensure that your BSP include all required SD platform devices.
static struct resource mxcsdhcXX_resources[] = {
{
.start = MMC_SDHCXX_BASE_ADDR,
.end = MMC_SDHCXX_BASE_ADDR + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
{
.start = MXC_INT_MMC_SDHCXX,
.end = MXC_INT_MMC_SDHCXX,
.flags = IORESOURCE_IRQ,
},
Table 15-1. Structure Descriptions
Struct member Description
ocr_mask Control the voltage on SD pads to be high voltage (around 3.0 V) or low voltage (around
1.8 V). ‘0’ stands for low voltage range Optional output
vendor_ver Vendor version
caps Modes of operation - data transfer modes
min_clk Minimum SD operating frequency in Hz.
max_clk Maximum SD operating frequency in Hz.
clk_flg 0 clock disabled, 1 Clock enabled.
reserved reserved (unused)
card_fixed 0 Read Only Memory (ROM) cards, 1 Read/Write (RW) cards.
card_inserted_state 1 SD card inserted in the slot, 0 there is no SD card attached to the socket.
status Function pointer to the card detection status routine.
wp_status Function pointer to the card write protection routine.
power_mmc power supply for ESDHC
clock_mmc Current MMC clock