一、u-boot基本常用命令
1. 基本环境设置
setenv serverip 192.168.1.201
setenv ipaddr 192.168.1.211
setenv gatewayip 192.168.1.1
setenv ethaddr 11:22:33:44:55:66
setenv bootargs root=/dev/mtdblock2 rootfstype=yaffs init=/linuxrc mem=64M console=ttySAC0,115200
saveenv
2. 烧写Boot
tftp 30008000 u-boot-v1.0.bin
nand erase 0 30000
nand write 30008000 0 30000
3. 加载内核
tftp 30008000 zImage
go 30008000
4. 烧写rootfs
tftp 30008000 rootfs_udev.yaffs
tftp 30008000 rootfs_mdev.yaffs //只考这里其中一个即可
nand erase 240000 800000
nand write.yaffs 30008000 240000 $(filesize)
setenv bootargs root=/dev/mtdblock2 rootfstype=yaffs init=/linuxrc mem=64M console=ttySAC0,115200
saveenv
5. 烧写内核
tftp 30008000 zImage
nand erase 40000 200000
nand write 30008000 40000 200000
setenv bootcmd nand read 30008000 40000 200000 /; go 30008000
saveenv
6. erase appfs分区
nand erase 1240000 2DC0000
7. 使用nfs配置:
setenv bootargs root=nfs nfsroot=192.168.1.201:/source/rootfs ip=192.168.1.211 console=ttySAC0,115200 init=/linuxrc mem=64M
二、Linux 2.6.19 fs2410 移植
1.修改nand flash分区: (1和2让内核可以识别yaffs文件系统,因为本出用的内核不支持yaffs文件系统,所以要分区和打补丁)
原始分区为八个分区,与64MB不匹配;所以分为四个;可以根据自己的需求来分区
arch/arm/plat-s3c24xx/common-smdk.c
/* NAND parititon from 2.4.18-swl5 */
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "BootLoader",
.size = 0x00040000, /* 256KB */
.offset = 0,
},
[1] = {
.name = "Kernel",
.size = 0x00200000, /* 2MB */
.offset = 0x00040000,
},
[2] = {
.name = "Rootfs",
.size = 0x01000000, /* 16MB */
.offset = 0x00240000,
},
[3] = {
.name &