我的nand flash分区如下:
device nand0 <nand.0>, # parts = 10
#: name size offset mask_flags
0: NAND.SPL 0x00020000 0x00000000 0
1: NAND.SPL.backup1 0x00020000 0x00020000 0
2: NAND.SPL.backup2 0x00020000 0x00040000 0
3: NAND.SPL.backup3 0x00020000 0x00060000 0
4: NAND.u-boot-spl-os 0x00040000 0x00080000 0
5: NAND.u-boot 0x00100000 0x000c0000 0
6: NAND.u-boot-env 0x00020000 0x001c0000 0
7: NAND.u-boot-env.backup10x00020000 0x001e0000 0
8: NAND.kernel 0x00800000 0x00200000 0
9: NAND.file-system 0x3f600000 0x00a00000 0
我的根文件系统大概有334M,所以我使用0x15e00000(大概350M)使用如下命令写进nand flash:
U-Boot# mmc rescan
U-Boot# mw.b 0x82000000 0xFF 0x15e00000
U-Boot# ext4load mmc 0:2 0x82000000 /boot/rootfs_new.jffs2
U-Boot# nand erase 0x80000 0x3f600000
U-Boot# nand write.i 0x82000000 0xa00000 0x15e00000