The multimedia card high-speed/SDIO (MMC/SDIO) host controller provides an interface between a local host (LH) such as a microprocessor unit (MPU) or digital signal processor (DSP) and either MMC, SD® memory cards, or SDIO cards and handles MMC/SDIO transactions with minimal LH intervention.
Main features of the MMC/SDIO host controllers:
- Full compliance with MMC/SD command/response sets as defined in the Specification.
- 4-bit transfer mode specifications for SD and SDIO cards
- 8-bit transfer mode specifications for eMMC
- Built-in 1024-byte buffer for read or write
- 32-bit-wide access bus to maximize bus throughput
- Single interrupt line for multiple interrupt source events
- Two slave DMA channels (1 for TX, 1 for RX)
- Designed for low power and programmable clock generation
- Maximum operating frequency of 48MHz
- MMC/SD card hot insertion and removal
MMC/SD Driver Architecture
- JEDEC eMMC Homepage [http://www.jedec.org/category/technology-focus-area/flash-memory-ssds-ufs-emmc]
- SD ORG Homepage [http://www.sdcard.org]
184.108.40.206.3. Acronyms & Definitions¶
|HS-MMC||High Speed MMC|
|SDHC||SD High Capacity|
Table: MMC/SD: Acronyms
The SD driver supports the following features:
- The driver is built in-kernel (part of vmlinux)
- SD cards including SD High Speed and SDHC cards
- Uses block bounce buffer to aggregate scattered blocks
220.127.116.11.5. Supported High Speed Modes¶
Important Info: Certain UHS cards doesn’t enumerate in UHS cards. Find the list of functional UHS cards here: https://processors.wiki.ti.com/index.php/Linux_Core_MMC/SD_User%27s_Guide#Testing_Information
Known Workaround: For cards which doesn’t enumerate in UHS mode, removing the PULLUP resistor in CLK line and changing the GPIO to PULLDOWN increases the frequency in which the card enumerates in UHS modes.
18.104.22.168.6. Driver Configuration¶
The default kernel configuration enables support for MMC/SD(built-in to kernel).
The selection of MMC/SD/SDIO driver can be modified using the linux kernel configuration tool. Launch it by the following command:
$ make menuconfig ARCH=arm
Building into Kernel
- Ensure that the following config options are set to ‘y’:
- CONFIG_MMC_SDHCI_OMAP (for DRA7XX and AM57XX devices)
- CONFIG_MMC_OMAP (for AM335X and AM437X devices)
Building as Loadable Kernel Module
Depending on your configuration, any of the above options can be set to ‘m’ to build them as a module. Use the following command to install all modules tp your filesystem.
# sudo -E make modules_install ARCH=arm INSTALL_MOD_PATH=path/to/filesystem
Boot the kernel upto kernel prompt and use modprobe to insert the driver module and all its dependencies.
# modprobe sdhci-omap (for DRA7XX and AM57XX devices) # modprobe omap_hsmmc (for AM335X and AM437X devices)
If ‘udev’ is running and the SD card is already inserted, the devices nodes will be created and filesystem will be automatically mounted if exists on the card.
Enabling eMMC Card Background operations support
This can be done using the “mmc-utils” tool from user space or using the “mmc” command in U-boot.
Command to enable bkops from userspace using mmc-utils, assuming eMMC instance to be mmcblk0
root@dra7xx-evm:mmc bkops enable /dev/mmcblk0
You can find the instance of eMMC by reading the ios timing spec form debugfs
root@dra7xx-evm:~# cat /sys/kernel/debug/mmc0/ios ---- timing spec: 9 (mmc HS200) ---
or by looking for boot partitions, eMMC has two bootpartitions mmcblk<x>boot0 and mmcblk<x>boot1
root@dra7xx-evm:/# ls /dev/mmcblk*boot* /dev/mmcblk0boot0 /dev/mmcblk0boot1
|FUNCTIONAL UHS CARDS|
|ATP 32GB UHS CARD AF32GUD3|
|STRONTIUM NITRO 466x UHS CARD|
|SANDISK EXTREME UHS CARD|
|SANDISK ULTRA UHS CARD|
|SAMSUNG EVO+ UHS CARD|
|SAMSUNG EVO UHS CARD|
|KINGSTON UHS CARD (DDR mode)|
|TRANSCEND PREMIUM 400X UHS CARD (Non fatal error and then it re-enumerates in UHS mode)|
|FUNCTIONAL (WITH LIMITED CAPABILITY) UHS CARD|
|SONY UHS CARD - Voltage switching fails and enumerates in high speed|
|GSKILL UHS CARD - Voltage switching fails and enumerates in high speed|
|PATRIOT 8G UHS CARD - Voltage switching fails and enumerates in high speed|