uboot相關命令及用法


進入uboot時,在命令行上敲“?” ,回車就會打印出在uboot里可用的命令:

#?
?       - alias for 'help'
base    - print or set address offset
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootvx  - Boot vxWorks from an ELF image
checkcrash- check ATAGS from crash and dump to file
chpart  - change active partition
cmp     - memory compare
cp      - memory copy
crc32   - checksum calculation
echo    - echo args to console
efuse   - opt efuse data
env     - environment handling commands
exit    - exit script
ext4load- load binary file from a Ext2 filesystem
ext4ls  - list files in a directory (default /)
false   - do nothing, unsuccessfully
fastboot- fastboot
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatwrite- write file into a dos filesystem
go      - start application at address 'addr'
gpio    - input/set/clear/toggle gpio pins
help    - print command description/usage
i2c     - I2C sub-system
jtag    - jtag system
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nm      - memory modify (constant address)
nu7     - nu7 sub system
pmic    - pmic interface
printenv- print environment variables
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
showvar - print local hushshell variables
source  - run script from memory
test    - minimal test like /bin/sh
true    - do nothing, successfully
ubi     - ubi commands
ubifsload- load file from an UBIFS filesystem
ubifsls - list files in a directory
ubifsmount- mount UBIFS volume
ubifsumount- unmount UBIFS volume
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version

我們想要查看其中某個命令的用法時,在命令行上敲入“命令名 ?”即可,如“mmc ?”:

#mmc ?

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

 

mmc read用來讀取mmc內容到內存,

mmc write用來寫入內存內容到mmc中


具體用法,

mmc read <device num> addr blk# cnt [partition]

mmc write <device num> addr blk# cnt [partition]

mmc list

device num是mmc的設備號,可以通過mmc list查詢

addr是內存地址

blk# 是mmc內的塊號

cnt 塊數目


使用范例:

mmc write 2 0x90000000 0x600 0x10

把內存0x90000000開始,長度為16x512大小的數據,寫入到第2個mmc設備塊偏移位置為0x600處

mmc read 2 0x90000000 0x600 0x10

把第二個mmc設備塊偏移為0x600處開始,長度為16x512大小的數據,讀出到內存0x90000000處

 

從外置mmc卡load uImage文件:

#mmc list
SD/MMC: 0
SD/MMC: 1

#mmc dev 0
mmc0 is current device

#fatload mmc 0:1 0x82007fc0 uImage
#pri
#run default_bootargs

 

 

只設pmic vdd:
pmic vdd 1250000

設置bootargs
#setenv bootargs console=ttyS0,115200 root=/dev/mmcblk1p2 rw rootwait gpu=384M mem=792M video=nusmartfb:${resolution}-${dispformat} 706_hw_ver=2 init=/init quiet no_console_suspend 

設置default_bootargs
#setenv default_bootargs console=ttyS0,115200 root=/dev/mmcblk1p2 rw rootwait gpu=384M mem=792M video=nusmartfb:${resolution}-${dispformat} 706_hw_ver=2 init=/init quiet no_console_suspend 

#ext4load mmc 1:2 0x82007fc0 uImage

#bootm

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM