在u-boot console中输入mmc,可以看到帮助信息:
mmc - MMC sub system
Usage:
mmc info - display info of the current MMC device
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
mmc hwpartition [args...] - does hardware partitioning
arguments (sizes in 512-byte blocks):
[user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
[gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
[check|set|complete] - mode, complete set partitioning completed
WARNING: Partitioning is a write-once setting once it is set to complete.
Power cycling is required to initialize partitions after set to complete.
mmc setdsr <value> - set DSR register value 一:mmc的命令如下:
1:对mmc读操作
mmc read addr blk# cnt
2:对mmc写操作
mmc write addr blk# cnt
3:对mmc擦除操作
mmc erase blk# cnt
4:重新搜索mmc设备
mmc rescan
5:列出mmc的分区
mmc part - lists available partition oncurrent mmc device
6:查看当前的设备号,或者设置设备号及分区
mmc dev [dev] [part] - show or set currentmmc device [partition]
7:显示boot分区号
mmc bootpart [dev] [part] - show or setboot partition
8:列出当前的mmc设备
mmc list - lists available devices
9: 打印一些当前mmc设备的信息
mmcinfo
二:mmc的命令详解
1:mmcinfo
输入:
mmcinfo(mmc与info之间有空格与没有空格的结果相同)
显示结果:
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
3:mmc dev[dev] [part] - show or set current mmc device [partition]
输入:
mmc dev 3
显示如下:
mmc3(part 0) is current device
分析:表示当前处于EMMC设备的第0个分区。
注意:当你想从eMMC读取内容的时候,你需要先确定目标内容在哪一个分区。否则读出的内容是错误的。
从JEDEC标准里,可以看到eMMC在进行分区之前,包括User Data Area , RPMB,和两个启动分区。
输入:
mmc dev 3 1
显示如下:
mmc3(part 1) is current device
分析:设置当前处于EMMC设备的第1个分区
# mmc dev 0 0
switch to partitions #0, OK
mmc0(part 0) is current device
分析:切换到mmc0设备的第0个分区
4:mmc bootpart [dev] [part] - show or set boot partition
输入:
mmc bootpart
显示如下:
Device 3: boot partition 1 is for boot
分析:uboot处于第一个分区
5:mmc part -lists available partition on current mmc device
输入:
mmc part
显示如下:
Partition Map for UNKNOWN device 3 -- Partition Type: DOS