修改linux:
sudo vi /work/system/linux3.4.2/arch/arm/mach-s3c24xx/common-smdk.c:
static struct mtd_partition smdk_default_nand_part[] = {
[2] = {
.name = "kernel",
.offset = MTDPART_OFS_APPEND,
.size = SZ_5M,
},
SZ_5M没有,需要自己自己定义到/work/system/linux3.4.2/include/asm-generic/sizes.h
修改uboot:
cd /work/system/u-boot-1.1.6/include/configs/100ask24x0.h
#define MTDPARTS_DEFAULT "mtdparts=jz2440-0:256k(u-boot)," \
"128k(params)," \
"5m(kernel)," \
"-(rootfs)"
然后把编译好的uboot.bin下载到开发板上
在菜单中使用命令mtd查看分区情况如下
device nand0 , # parts = 4
#: name size o ffset mask_flags
0: u-boot 0x00040000 0x00000000 0
1: params 0x00020000 0x00040000 0
2: kernel 0x00200000 0x00060000 0
3: rootfs 0x0fda0000 0x00260000 0
active partition: nand0,0 - (u-boot) 0x00040000 @ 0x00000000
defaults:
mtdids : nand0=jz2440-0
mtdparts: mtdparts=jz2440-0:256k(u-boot),128k(params),2m(kernel),-(rootfs)
使用命令mtdparts default进行分区然后save保存,以后分区就不变
device nand0 <nandflash0>, # parts = 4
#: name size offset mask_flags
0: bootloader 0x00040000 0x00000000 0
1: params 0x00020000 0x00040000 0
2: kernel 0x00500000 0x00060000 0
3: root 0x0faa0000 0x00560000 0
active partition: nand0,0 - (bootloader) 0x00040000 @ 0x00000000
defaults:
mtdids : nand0=nandflash0
mtdparts: mtdparts=nandflash0:256k@0(bootloader),128k(params),5m(kernel),-(root)
进行分区成功