天天看点

mmc命令 uboot_u-boot中mmc命令使用

mmc命令的帮助信息如下:

U-Bootmmc

mmc – MMC sub system

Usage:

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

当系统启动后,系统会将mci0设置为当前设备。使用mmcinfo就可以看到插入到mmc controller 0的sdcard信息。

U-Bootmmcinfo

Device: mci

Manufacturer ID: 3

OEM: 5344

Name: SD04G

Tran Speed: 25000000

Rd Block Len: 512

SD version 2.0

High Capacity: Yes

Capacity: 3.8 GiB

Bus Width: 4-bit

如果SoC支持多个mmc controller并且使能,使用mmc list来查看使能了几个,可以通过mmc dev来查看当前是那个设备,或者通过mmc dev NO.来切换。

像我的系统支持两个mmc controller.

U-Bootmmc list(显示有几个mmc controller)

mci 0

mci 1

U-Bootmmc dev(显示当前是那个device)

mmc1 is current device

U-Bootmmc dev 0(设置0为当前设备)

mmc0 is current device

如果,换sdcard,则使用mmc rescan来重新获取sdcard信息

U-Bootmmc rescan(重新scan当前设备)

mci: setting clock 257812 Hz, block size 512

mci: setting clock 22000000 Hz, block size 512

mci: setting clock 257812 Hz, block size 512

gen_atmel_mci: CMDR 00001048 ( 8) ARGR 000001aa (SR: 0c100025) Command Failed

mci: setting clock 257812 Hz, block size 512

mci: setting clock 22000000 Hz, block size 512

U-Bootmmcinfo(列出当前设备的信息)

Device: mci

Manufacturer ID: 1

OEM: 5041

Name: SK512

Tran Speed: 25000000

Rd Block Len: 512

SD version 1.10

High Capacity: No

Capacity: 472.5 MiB

Bus Width: 4-bit