四、EMMC 和 SD 卡操作命令
uboot 支持 EMMC 和 SD 卡,因此也要提供 EMMC 和 SD 卡的操作命令。一般认为 EMMC和 SD 卡是同一个东西,所以没有特殊说明,使用 MMC 来代指 EMMC 和 SD 卡。uboot 中常用于操作 MMC 设备的命令为“mmc”。
输入“?mmc”即可查看 mmc 有关的命令(有的开发板可能是“mmc”)PS:注意命令数字为16进制

mmc read addr blk# cnt#用于读取 mmc 设备的数据
mmc write addr blk# cnt#mmc write addr blk# cnt
千万不要写 SD 卡或者 EMMC 的前两个块(扇区),里面保存着分区表!
mmc dev 1 0 //切换到 EMMC 分区 0
tftp 80800000 u-boot.imx //下载 u-boot.imx 到 DRAM
mmc write 80800000 2 32E //烧写 u-boot.imx 到 EMMC 中
mmc partconf 1 1 0 0 //分区配置,EMMC 需要这一步!
在 uboot 中更新 EMMC 对应的 uboot
mmc dev 1 0 //切换到 EMMC 分区 0
tftp 80800000 u-boot.imx //下载 u-boot.im