由于用HiTool烧写固件是真的麻烦,因为要更改内核驱动什么的。于是准备用tftp来烧录。
之前学IMX6U的时候,已经会tftp烧录内核和nfs挂载根目录了。
一、烧写U-boot
U-Boot 需要烧写到 fastboot
分区,起始地址为 0x0
,大小为 1M
。
下载U-boot到内存:
tftp 0x82000000 u-boot-hi3516dv300.bin
擦除并烧写:
sf probe 0
sf erase 0x0 0x100000 # 擦除 1M 空间
sf write 0x82000000 0x0 0x100000 # 烧写 U-Boot
二、烧写内核
下载内核到内存:
tftp 0x82000000 uImage_hi3516dv300_smp
擦除并烧写:
sf erase 0x100000 0x400000 # 擦除 4M 空间
sf write 0x82000000 0x100000 0x400000 # 烧写内核
三、烧写根文件
下载根文件到内存:
tftp 0x82000000 rootfs_a182_0227_hi3516dv300_64k.jffs2
擦除并烧写:
sf erase 0x500000 0x1B00000 # 擦除 27M 空间
sf write 0x82000000 0x500000 0x1B00000 # 烧写根文件系统
四、设置U-boot环境变量
参数
setenv bootargs 'mem=64M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=hi_sfc:1M(fastboot),4M(kernel),27M(rootfs)'
命令
setenv bootcmd 'sf probe 0; sf read 0x82000000 0x100000 0x400000; bootm 0x82000000'
最后保存
saveenv
重启看看
五、NFS挂载根目录
setenv bootargs 'mem=128M console=ttyAMA0,115200 root=/dev/nfs rw nfsroot=192.168.10.100:/home/prover/linux/nfs/rootfs_glibc,v3,tcp ip=192.168.10.50:192.168.10.100:192.168.10.1:255.255.255.0::eth0:off'
saveenv