eMMC support for SAMA5D27 SOM1 EK board


Introduction

This page represents a summary of tested eMMC devices with our SAMA5D27 SOM1 EK .

The eMMC are of different versions and different vendors. Our software support tries to accommodate with best effort all the possible vendors and versions, capacities that are present on the market.

Drive strength configuration

The SOM1EK board comes by default with a standard medium drive strength for the SDMMC0 lines. This means that there is a standard current consumption, EMI (ElectroMagnetic Interference), according to the datasheet, as specified in the Electric Characteristics chapter.

Because some of the eMMC boards come with adapters to SD-Cards or are soldered directly on custom PCBs, the medium default drive strength might not be enough to drive the lines from the MPU, SOM board, EK board, SD-Card slot, additional PCB and wiring, to the memory.

In this case the MPU can be configured to increase the drive strength on the lines, to ensure the signal integrity, power loss or other reasons.

Warning, important Increasing drive strength also increases ElectroMagnetic Interference and current consumption

Pointing hand Whether or not the increase of drive strength is needed or not, depends on the adapter board. Some adapter boards have a higher capacitance. The standard imposes that the total capacitance of the Host + Device + Bus does not exceed 20 pF. If this capacitance is exceeded, higher drive strength is required in order to accommodate the loss in signal integrity.

By patching the device tree in U-boot, the user can select an overlay that will increase the drive strength and apply it over the stock device tree when booting Linux. This means that only by a single command, the drive strength can be increased or restored, at boot time.

To achieve this, the bootm command in U-boot must be altered to add the sdmmc0_hi overlay , as in the example below:

bootm 0x24000000#kernel_dtb${at91_overlays_config}#sdmmc0_hi

We provide an out-of-tree overlay for this specific purpose. The overlay needs to be applied to our dt-overlay-at91 tree. The overlay is provided on this page as a patch here
* 0001-sama5d27_som1_ek-add-overlay-for-high-drive-strength.patch: overlay for high drive strength for sdmmc0.

Warning, important This overlay is not available in Linux4SAM release and also not available in any git trees that we provide. Only on this page as an attached patch.

For more information about FIT image and how to use it in U-boot, follow this link . This overlay is named sdmmc0_hi and it can be added manually per user's desire from the U-boot prompt whenever needed.

Pointing hand AT91Bootstrap needs to have the SDMMC0 lines configured with a high drive strength if we plan to use AT91Bootstrap to load the U-boot image from the same eMMC. AT91Bootstrap provides a board file where the PIO controller is configured for SDMMC0 and the drive strength is selected. Please take notice of the section below.

AT91Bootstrap modifications

In AT91Bootstrap, the drive strength may need modifications.

Here is an example on how to set the drive strength for the SDMMC0 pins to High. Regarding drive strength and when it's required, please check above section.

diff --git a/board/sama5d27_som1_ek/sama5d27_som1_ek.c b/board/sama5d27_som1_ek/sama5d27_som1_ek.c
index 0297eed..7ee184a 100644
--- a/board/sama5d27_som1_ek/sama5d27_som1_ek.c
+++ b/board/sama5d27_som1_ek/sama5d27_som1_ek.c
@@ -517,16 +517,16 @@ void at91_sdhc_hw_init(void)
 
 #ifdef CONFIG_SDHC0
        const struct pio_desc sdmmc_pins[] = {
-               {"SDMMC0_CK",   AT91C_PIN_PA(0), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_CMD",  AT91C_PIN_PA(1), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_DAT0", AT91C_PIN_PA(2), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_DAT1", AT91C_PIN_PA(3), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_DAT2", AT91C_PIN_PA(4), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_DAT3", AT91C_PIN_PA(5), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_DAT4", AT91C_PIN_PA(6), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_DAT5", AT91C_PIN_PA(7), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_DAT6", AT91C_PIN_PA(8), 0, PIO_DEFAULT, PIO_PERIPH_A},
-               {"SDMMC0_DAT7", AT91C_PIN_PA(9), 0, PIO_DEFAULT, PIO_PERIPH_A},
+               {"SDMMC0_CK",   AT91C_PIN_PA(0), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_CMD",  AT91C_PIN_PA(1), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_DAT0", AT91C_PIN_PA(2), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_DAT1", AT91C_PIN_PA(3), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_DAT2", AT91C_PIN_PA(4), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_DAT3", AT91C_PIN_PA(5), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_DAT4", AT91C_PIN_PA(6), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_DAT5", AT91C_PIN_PA(7), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_DAT6", AT91C_PIN_PA(8), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
+               {"SDMMC0_DAT7", AT91C_PIN_PA(9), 0, PIO_DRVSTR_HI, PIO_PERIPH_A},
                {"SDMMC0_RSTN", AT91C_PIN_PA(10), 0, PIO_DEFAULT, PIO_PERIPH_A},
                {"SDMMC0_VDDSEL", AT91C_PIN_PA(11), 0, PIO_DEFAULT, PIO_PERIPH_A},
                {"SDMMC0_WP",   AT91C_PIN_PA(12), 1, PIO_DEFAULT, PIO_PERIPH_A},

Tested eMMCs

For the below memories, we test booting with AT91Bootstrap, which will auto detect the bus width (8 bit, 4 bit or 1 bit) and enable DDR if possible.

Next, we test linux to enable DDR mode if possible and display information.

We create a 100 Mbyte file and read it from the eMMC and display the required time in Linux.

Manufacturer Capacity eMMC version Part number AT91Bootstrap log Linux kernel log Performance test
Toshiba 14.7 GBytes v5.0/v5.01 THGBMFG7C1LBA1L MMC: Specification Version 4.0 or higher
MMC: v5.0/5.01 detected
MMC: highspeed supported
MMC: Dual Data Rate supported
MMC: detecting buswidth...
MMC: 8-bit bus width detected
SD/MMC: Done to load image
mmc0: new DDR MMC card at address 0001
mmcblk0: mmc0:0001 016G70 14.7 GiB
real 0m1.761s
user 0m0.000s
sys 0m1.120s
Samsung 14.6 GBytes v5.1 KLMAG1JENB B041
adapter only has 4 data lines
MMC: Specification Version 4.0 or higher
MMC: v5.1 detected
MMC: highspeed supported
MMC: Dual Data Rate supported
MMC: detecting buswidth...
MMC: 4-bit bus width detected
SD/MMC: Done to load image
mmc0: switch to bus width 8 failed
mmc0: new DDR MMC card at address 0001
mmcblk0: mmc0:0001 AJNB4R 14.6 GiB
real 0m2.418s
user 0m0.010s
sys 0m1.150s
Kingston 14.6 GBytes v5.0/v5.01 EMMC16G-S100 MMC: Specification Version 4.0 or higher
MMC: v5.0/5.01 detected
MMC: highspeed supported
MMC: Dual Data Rate supported
MMC: detecting buswidth...
MMC: 8-bit bus width detected
SD/MMC: Done to load image
mmc0: new DDR MMC card at address 0001
mmcblk0: mmc0:0001 S10016 14.6 GiB
real 0m1.758s
user 0m0.010s
sys 0m1.120s
Kingston 14.3 GBytes v5.0/v5.01 EMMC16G-S110 MMC: Specification Version 4.0 or higher
MMC: v5.0/5.01 detected
MMC: highspeed supported
MMC: Dual Data Rate supported
MMC: detecting buswidth...
MMC: 8-bit bus width detected
SD/MMC: Done to load image
mmc0: new DDR MMC card at address 0001
mmcblk0: mmc0:0001 S11016 14.3 GiB
real 0m1.757s
user 0m0.030s
sys 0m1.090s
Micron 14.6 GBytes v5.0/v5.01 N2M400HDB321A3C MMC: Specification Version 4.0 or higher
MMC: v5.0/5.01 detected
MMC: highspeed supported
MMC: Dual Data Rate supported
MMC: detecting buswidth...
MMC: 8-bit bus width detected
SD/MMC: Done to load image
mmc0: new high speed MMC card at address 0001
mmcblk0: mmc0:0001 MMC16G 14.6 GiB
During tests there were transfer errors in DDR mode. This can be due to signal integrity.
The card was forced into high speed mode only, 8 bit bus, 52 Mhz.
real 0m2.755s
user 0m0.010s
sys 0m1.060s
Kingston 7.20 GBytes v4.5/v4.51 KE4CN3K6A MMC: Specification Version 4.0 or higher
MMC: v4.5/v4.51 detected
MMC: highspeed supported
MMC: Dual Data Rate supported
MMC: detecting buswidth...
MMC: 8-bit bus width detected
SD/MMC: Done to load image
mmc0: new DDR MMC card at address 0001
mmcblk0: mmc0:0001 MMC08G 7.20 GiB
Failing in Linux with current adapter. Failures detected when connected to laptop connector. TBD

I Attachment Action Size Date Who Comment
Unknown file formatpatch 0001-sama5d27_som1_ek-add-overlay-for-high-drive-strength.patch manage 2.4 K 2019-08-20 - 07:07 UnknownUser overlay for high drive strength for sdmmc0