SSD_Emmc usage reference


1. Overview

At present, SSD20X can support Emmc in Uboot/Kernel stage, that is to say, it supports booting the Rootfs/Kernel partition from Emmc after starting from Uboot.

Common usage scenarios: Nor (small capacity) + Emmc startup, the partition before (including) Uboot is placed on Nor Flash, and the partition after Uboot is placed on Emmc for use.

SSD20X only has one SDIO, so to use EMMC, you need to close SDMMC and then open EMMC


2. Uboot stage configuration

Disable SDMMC CONFIG:

#CONFIG_MS_SDMMC is not set

Enable EMMC CONFIG:

CONFIG_MS_EMMC=y
CONFIG_SUPPORT_EMMC_BOOT=y

As shown below, first disable MSTAR SDMMC through make menuconfig, then open MSTAR eMMC and Support eMMC BOOT

make menuconfig
#Device Driver 
    [*]Mstar driver 
        [*]MSTAR emmc
      [*]support eMMC BOOT
      [ ]MSTAR sdmmc (Do not select)

3. Kernel stage configuration

a. Disable SDMMC and enable EMMC config support:

CONFIG_MS_EMMC=y
CONFIG_MS_EMMC_UNIFY_DRIVER=y
# CONFIG_MS_SDMMC is not set

b. Enable the file system to support EMMC partitions:

CONFIG_PARTITION_ADVANCED=y
CONFIG_EMMC_PARTITION=y

c. Enable the ext4 related config:

CONFIG_LBDAF=y (supports ext4 large-capacity block devices and files)
CONFIG_EXT4_FS=y (enable to support ext4 file system, CONFIG_EXT4_FS sub-option config can be kept by default)

Suboptions after ext4 config is enabled:

CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_JBD2=y
CONFIG_FS_MBCACHE=y
CONFIG_CRYPTO_CRC32C=y

Referring to the figure below, use make menuconfig to configure:

make menuconfig
#Enable the block layer
[*]Support for large (2TB+) block devices and files(required when emmc starts)
[*]Partition Types
    [*]EMMC PARTITION table support
#Device Drivers 
    [*]MMC/SD/SDIO card support 
        [*]HW reset support for eMMC
    [*]Simple HW reset support for MMC
    [*]MMC block device driver
[*]SStar Soc platform drivers 
    [*]EMMC driver
    [*]UNIFY EMMC DRIVER
    [*]MMC block device driver
    [ ]SStar SD/MMC Card Interface Suport (Do not select)
#File systems 
    [*]The Extended 4 (ext4) filesystem (required when emmc starts, sub-options remain default)

4. Reference for the EMMC partition configuration that has been done in the public version

Because SSD20X does not support an empty chip booting from EMMC, and the empty chip before Uboot must be booted from SPI FLASH, so the EMMC partition needs to be used in combination with Nand/Nor Flash, and the common use is small-capacity Nor+EMMC.

Nand + EMMC Nor + EMMC
project ./setup_config.sh
./configs/nvr/i2m/8.2.1/emmc_spinand.glibc-ext4fs.011a.64
./setup_config.sh
./configs/nvr/i2m/8.2.1/emmc_nor.glibc-ext4fs.011a.64
kernel make infinity2m_emmc_spinand_ssc011a_s01a_defconfig make infinity2m_emmc_nor_ssc011a_s01a_defconfig
uboot make infinity2m_spinand_emmc_defconfig make infinity2m_nor_emmc_defconfig