u-boot版本: u-boot-2010.03_tekkamanninja修改的u-boot
1、将uboot通过j-link烧写到norflash,启动后 saveenv 将参数保存到 nandflash的 0x60000位置。
2、由于uboot将param保存在0x60000位置,与内核不对应,需要修改内核的nand分区,修改内核文件arch/arm/mach-s3c2440/mach-mini2440.c
282 static struct mtd_partition friendly_arm_default_nand_part[] = { 283 [0] = { 284 .name = "supervivi", 285 .size = 0x00060000, 286 .offset = 0, 287 }, 288 [1] = { 289 .name = "param", 290 .offset = 0x00060000, 291 .size = 0x00020000, 292 }, 293 [2] = { 294 .name = "Kernel", 295 .offset = 0x00080000, 296 .size = 0x00500000, 297 }, 298 [3] = { 299 .name = "root", 300 .offset = 0x00580000, 301 .size = 1024 * 1024 * 1024, // 302 }, 303 [4] = { 304 .name = "nand", 305 .offset = 0x00000000, 306 .size = 1024 * 1024 * 1024, // 307 } 308 };
3、烧写uboot到nand flash
tftp 30008000 uboot.bin
nand erase 0 0x60000
nand write 30008000 0x0 60000
4、烧写kernel到nand flash
这里要看zImage.img是如何制作的
(1)若mkimage –n ‘linux-2.6.32.2’ –A arm –O linux –T kernel –C none –a 0x30008000 –e 0x30008000 –d zImage zImage.img
由此方法制作的烧写方法如下,否则出错
tftp 31000000 zImage.img (不能是0x30008000,否则会出错,启动内核时显示 data abort)
nand erase 0x80000 0x400000 (0x400000 不能是0x500000, 否则又会出错)
nand write 31000000 0x80000 400000
若使用0x30008000 会出错,错误如下:
============================================================
Verifying Checksum ... OK XIP Kernel Image ... OK OK Starting kernel ... data abort pc : [<30008008>] lr : [<33fa6500>] sp : 33f3dd24 ip : 00000000 fp : 30008000 r10: 33fc2f08 r9 : 000007cf r8 : 33f3ffe0 r7 : 33f3ffc4 r6 : 33f4131a r5 : 30000100 r4 : 00000000 r3 : 00000000 r2 : 30000100 r1 : 000007cf r0 : 00000000
============================================================
(2)若mkimage –n ‘linux-2.6.32.2’ –A arm –O linux –T kernel –C none –a 0x30008000 –e 0x30008040 –d zImage zImage.img
由此方法既可以使用30008000地址来烧写
(3)设置bootcmd参数
setenv bootcmd ‘nand read 31000000 0x80000 400000; bootm 31000000’
5、烧写yaffs2文件系统的时候老是出错,应该把文件系统缩到64M以下再烧写,不知道行不行,待续…………………………