# Uboot command set
## Note
All u-boot command could find in u-boot directory, path: u-boot-bcom\common
Every command has it C file, e.g., Mii, C file name is “cmd_mii.c”.
Could find some command in U_BOOT_CMD. Like following image:

## RAM Test
| Command | Note |
|:--- |:---|
| mtest <start-address> <end-address> <test pattern> <# of iterations> | Test address start to end by testpattern |
| nand erase [offset] [size] | Clean size of address, start at [offset] |
| nand write [addr] [offset] [size] | Write size of [addr] to [offset] |
| nand read [addr] [offset] [size] | Read size of [offset] to [addr] |
| cmp.b [addr1] [addr2] [size] | compare memory size of addr1 and addr2 |
| sf probe | init flash device on given SPI bus and chip select, need do it before use all sf command |
| sf erase [offset] [size] erase [size] | bytes from [offset] + [size] round up [size] to block size |
| sf read [addr] [offset] [size] read [size] | bytes starting at [offset] to memory at [addr] |
| sf write [addr] [offset] [size] write [size] | bytes from memory at [addr] to flash at [offset] |
## USB
| Command | Note |
|:--- |:---|
| usb start start (scan) | USB controller |
| usb write [addr] [blk] [cnt ] | write [cnt] blocks starting at block [blk#] from memory address [addr] |
| usb read [addr] [blk] [cnt] | Read [cnt] blocks starting at block [blk#] to memory address [addr] |
## I2c
| Command | Note |
|:--- |:---|
| i2c probe | test for and show device(s) on the I2C bus, under u-boott |
| i2cdetect -l detect | I2C chips bust |
| i2cdetect -y -r 1 detect | I2C chips and get addresst |
| i2cdump -f -y 1 [chip-addr] | examine registers value at address [chipaddr] on the I2C bus 1t |
| i2cset -f -y 1 [chip-addr] [reg-addr] [value] | set registers value at address [chip-addr] on the I2C bus 1t |
| i2cget -f -y 1 [chip-addr] [reg-addr] | read registers value at address [chip-addr] on the I2C bus 1t |
## GPIO
| Command | Note |
|:--- |:---|
| gpio clear [pin] | Clear [pin], write 0, return success |
| gpio set [pin] | Set [pin], write 1, return success |
| gpio input [pin] | Set [pin] to input mode. |
| gpio status [-a] [<bank> \| <pin>] | Show [all/claimed] GPIOs |
## MII
| Command | Note |
|:--- |:---|
| device | list available devices |
| mii device [devname] | set current device |
| mii info [addr] | display MII PHY info |
| mii write [addr] [register] [value] | Write [value] at register on [addr] |
| mii read [addr] [register] | Read value at register on [addr] |
| mii dump [addr] [register] | pretty-print [addr] [reg] |
## Devmem
| Command | Note |
|:--- |:---|
| devmem [addr] [32\16\8] | read value at [addr], by 8, 16, 32 bit |
| devmem [addr] [32\16\8] [value] | write [value] at [addr], by 8, 16, 32 bit |