一、nandflash分区信息
OpenJTAG> mtdpart
device nand0 <nandflash0>, # parts = 4
#: name size offset
0: bootloader 0x00040000 0x00000000 //256k
1: params 0x00020000 0x00040000 //128k
2: kernel 0x00200000 0x00060000 //2m
3: root 0x0fba0000 0x00460000 //余下全部
二、设置机器ID
set machid 16a // jz2440,也可以用setenv machid 16a set machid 7CF // mini2440
三、设置环境变量
print //打印环境变量 save //保存环境变量 setenv bootdelay 5 //设置bootcmd延时为5 setenv ipaddr 192.168.1.226 //设置开发板IP setenv serverip 192.168.1.200 //设置服务器ip(Windows) setenv gatewayip 192.168.1.254 //设置网关 setenv netmask 255.255.255.0 //设置子网掩码 ( setenv bootargs=noinitrd root=/dev/nfs nfsroot=172.18.2.166:/work/nfs_root/tmp/first_fs ip=172.18.2.196:172.18.2.166:172.18.2.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC0 setenv bootargs noinitrd root=/dev/nfs console=ttySAC0 nfsroot=192.168.1.2:/work/nfs_root/xxxx ip=192.168.1.3:192.168.1.2:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc ) //由于是两条指令,因此需要用''引起来 //读取jffs2 文件系统并启动 setenv bootcmd 'nand read.jffs2 0x30007FC0 kernel ; bootm 0x30007FC0' //读取yaffs2文件系统并启动 setenv bootcmd 'nand read.yaffs 0x30007FC0 kernel ; bootm 0x30007FC0' //使用flash中的文件系统启动,默认为yaffs2文件系统,如果是jffs2文件系统,添加 rootfstype=jffs2 //yaffs2 setenv bootargs noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200 //jffs2 setenv bootargs noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200 rootfstype=jffs2 //使用nfs网络文件系统启动,默认为yaffs2文件系统,如果是jffs2文件系统,添加 rootfstype=jffs2 举例: 虚拟机ip :192.168.1.2 网关 :192.168.1.1 开发板ip : 192.168.1.3 子网掩码 :255.255.255.0 文件系统目录:/work/nfs_root/xxxx //yaffs2 ,注意是一行 setenv bootargs noinitrd root=/dev/nfs console=ttySAC0 nfsroot=192.168.1.2:/work/nfs_root/xxxx ip=192.168.1.3:192.168.1.2:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc //jffs2 ,注意是一行 setenv bootargs noinitrd root=/dev/nfs console=ttySAC0 nfsroot=192.168.1.2:/work/nfs_root/xxxx ip=192.168.1.3:192.168.1.2:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc rootfstype=jffs2 //清除某个环境变量 //以bootargs为例
set bootargs
//保存
Save //清除全部的环境变量 nand erase params
四、tftp烧写
四、tftp烧写 //通过tftp烧写u-boot.bin到nand Flash步骤: 打开 tftpd32.exe 软件, 将u-boot.bin 拷贝至工作目录 在SecureCRT中依次输入: tftp 0x30008000 u-boot.bin //将uboot.bin 下载到sdram 0x30008000 nand erase bootloader //擦除bootloader区域 nand write 0x30008000 bootloader //烧写到bootloader //通过tftp烧写uImage到nand Flash步骤: 打开 tftpd32.exe 软件, 将 uImage 拷贝至工作目录 在SecureCRT中依次输入: tftp 0x30008000 uImage nand erase kernel nand write 0x30008000 kernel //烧写YAFFS至NandFlash 打开 tftpd32.exe 软件, 将 fs_mini.yaffs2 拷贝至工作目录 在SecureCRT中依次输入: tftp 0x30008000 fs_mini.yaffs2 nand erase root nand write.yaffs 0x30008000 root $(filesize) // $(filesieze) 是 fs_mini.yaffs2 的大小 //烧写JFFS至NandFlash 打开 tftpd32.exe 软件,将 fs_mini.jffs2 拷贝至工作目录 在SecureCRT中依次输入: tftp 0x30008000 fs_mini.jffs2 nand erase root nand write.jffs2 0x30008000 root $(filesize) // $(filesieze) 是 fs_mini.yaffs2 的大小 //使用 jffs2 文件系统启动时记得修改 bootargs 添加 rootfstype=jffs2 当然之前的所有下载也可以换成 nfs ,假设虚拟机 ip 为 192.168.1.123 nfs 0x30008000 192.168.1.123:/work/nfs_root/u-boot.bin nfs 0x30008000 192.168.1.123:/work/nfs_root/uImage nfs 0x30008000 192.168.1.123:/work/nfs_root/fs_mini.yaffs2 nfs 0x30008000 192.168.1.123:/work/nfs_root/fs_mini.jffs2