U-BOOT中mmc命令简介
目前很多板卡都是用emmc來存儲文件,所以熟悉u-boot中的mmc操作命令還是很有必要的。
在u-boot下鍵入mmc,會顯示mmc命令的操作格式:
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 bootbus dev boot_bus_width reset_boot_bus_width boot_mode
?- Set the BOOT_BUS_WIDTH field of the specified device
mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
?- Change sizes of boot and RPMB partitions of specified device
mmc partconf dev boot_ack boot_partition partition_access
?- Change the bits of the PARTITION_CONFIG field of the specified device
mmc rst-function dev value
?- Change the RST_n_FUNCTION field of the specified device
? ?WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
mmc setdsr <value> - set DSR register value
1.mmc list?:查詢系統中可用的mmc設備;
U-Boot> mmc list
FSL_SDHC: 0 (eMMC)? ? ? ? ? ? ? ? ? ? ? ?//系統中可用的mmc設備只有一個,編號為0;
2.mmc dev:設置當前用來操作的mmc設備;
U-Boot> mmc dev 0? ? ? ? ? ? ? ? ? ? ? ? ? ?//設置當前設備為mmc 0
switch to partitions #0, OK
mmc0(part 0) is current device
3.mmc info: 顯示當前mmc設備的信息;
U-Boot> mmc info
Device: FSL_SDHC
Manufacturer ID: d6
OEM: 103
Name: 88A39?
Tran Speed: 52000000
Rd Block Len: 512? ? ? ? ? ? ? ? ? ? ? //重點關注下塊大小和容量
MMC version 4.0
High Capacity: Yes
Capacity: 7.3 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
4.mmc erase 0x600 0x4000?
從mmc設備塊編號為0x600處開始,擦除長度為0x4000 x 512大小(Block Len 指定)的數據;
5.mmc write 0x10100000 0x600 0x4000
把內存0x10100000開始,長度為0x4000 x 512大小的數據,寫入到當前mmc設備塊編號為0x600處;
6.mmc read 0x10100000 0x600 0x4000
從當前mmc設備塊偏移為0x600處開始,長度為0x4000 x 512大小的數據,讀入到內存0x10100000處;
總結
以上是生活随笔為你收集整理的U-BOOT中mmc命令简介的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: prometheus + grafana
- 下一篇: c语言中要让音乐暂停还用什么指令,【An