One: The MMC commands are as follows:
1: Read operation to MMC
MMC Read addr blk# cnt
2: Write operation to MMC
MMC Write addr blk# cnt
3: To the MMC erase operation
MMC Erase blk# CNT
4: Re-search MMC devices
MMC rescan
5: List the partitions of the MMC
MMC part-lists available partition oncurrent MMC device
6: View the current device number, or set the device number and partition
MMC dev [Dev] [part]-Show or set CURRENTMMC device [partition]
7: Show boot partition area
MMC bootpart [Dev] [part]-Show or Setboot partition
8: List the current MMC device
MMC list-lists available devices
9: Print some information about the current MMC device
Mmcinfo
Second: An explanation of MMC commands
1:mmcinfo
Input:
Mmcinfo
Show Results:
Manufacturer ID:45
oem:100
Name:sem08
Tran speed:25000000
Rd Block len:512
MMC version 4.0
clock:52000000
High Capacity:yes
capacity:7944011776 Bytes
Bus Width:8-bit DDR
Current Partition for Boot:boot Partition 1
2:MMC list-lists Available Devices
Input:
MMC list
Shown below:
fsl_usdhc:0
Fsl_usdhc:1
Fsl_usdhc:2
Fsl_usdhc:3
Analysis: Boot is configured with four MMC resources, SD card is 2,EMMC 3
3:MMC Dev[dev] [part]-Show or set current MMC device [partition]
Input:
MMC Dev 3
Shown below:
MMC3 (part 0) are current device
Analysis: Represents the No. 0 partition that is currently in the EMMC device
Input:
MMC Dev 3 1
Shown below:
MMC3 (Part 1) are current device
Analysis: Set the 1th partition currently in the EMMC device
4:mmc Bootpart [Dev] [part]-Show or set boot partition
Input:
MMC Bootpart
Shown below:
Device 3:boot partition 1 is for boot
Analysis: Uboot in the first partition
5:MMC part-lists available partition on the current MMC device
Input:
MMC part
Shown below:
Partition Map for UNKNOWN device 3--Partition Type:dos
Partition Start Sector Num Sectors Type
1 16384 16384 83
2 32768 16384 83
3 49152 6397952 5 EXTD
4 6447104 9150464 83
5 49153 3145727 83
6 3194881 3145727 83
7 6340609 16383 83
8 6356993 8191 83
Analysis: Displays all partitions of the current EMMC
6:MMC Read addr blk# cnt
The purpose of this command is to read the data on the MMC to the memory
Parameters:
Addr: Read to memory location
Blk: Reads the block position, which is the offset of the 0 address of the MMC, is 16 binary, the block unit is 512 bytes
CNT: Reads the number of blocks, the size of the data to be read to the memory, is 16 binary
Block Unit is 512 bytes
Cases:
MMC Dev 3 0
MMC Read 0x10800000 600 10
Command parsing: Represents the beginning of 1536x512 bytes from the MMC (1536 is 600 decimal), reads 16x512 bytes (16 is 10 of 10 binary) to memory 0x10800000
Show Results:
MMC Read:dev #3, Block # 1536, Count 16 ... Blocks Read:ok
Results Analysis:
We can only see from the results read success, but not sure read the content is correct, so print the memory of the data, to see whether the content in the MMC is consistent with
Input:
md.b 0x10800000 100
Command analysis: Print memory location 0x10800000 100 bytes
Show Results:
10800000:b15ecb3c 6f62 746f 6564 616c 3d79 0033 ^.<.bootdelay=3.
10800010:61626475 6172 6574 313d 3531 3032 0030 baudrate=115200.
10800020:70696461 7264 313d 3239 312e 3836 312e ipaddr=192.168.1
10800030:312e3330 7300 7265 6576 6972 3d70 3931.103.serverip=19
10800040:2e323631 2e38 2e31 3031 0031 656e 6d74 2.168.1.101.netm
10800050:73613d6b 3532 2e35 3532 2e35 3532 2e35 ask=255.255.255.
.....
.......
Results Analysis:
I stored the environment variable in the MMC location 1536x512, consistent with the memory print, read correctly
7:mmc Write addr blk# cnt
The purpose of this command is to write the in-memory data to the MMC
Parameters:
Addr: Where to read from memory
Blk: Write to the block position in MMC, this position is an offset of 0 address of MMC, is 16 binary, block unit is 512 bytes
CNT: The number of blocks written to the MMC, the size of the data to be written, is 16 binary,
Block Unit is 512 bytes
Cases:
MMC Dev 3
MMC Write 0x108000000 0 100
Command analysis: Indicates that the data from the memory 0x108000000 is read 256*512 (256 is 100 decimal) to the location of 0 on the MMC, there is no example to verify
MMC on the 0 location is the partition table, I put the memory of the chaotic data in the Uboot, the partition is not detected
8:mmc Erase blk# CNT
Parameters:
Blk: The block position in the erased MMC, which is the offset of the 0 address of the MMC, is 16 binary, the block unit is 512 bytes
CNT: The number of blocks in the erased MMC is 16 binary, Block Unit is 512 bytes