分类: LINUX
2014-06-09 07:44:48
在内核代码中drivers\mtd\nand\s3c_nand.c定义好NAND Flash的分区表,根据需要可以修改drivers\mtd\nand\s3c_nand.c文件,比如:
gedit drivers/mtd/nand/s3c_nand.c
struct mtd_partition s3c_partition_info[] = {
{
.name = "uboot",
.offset = 0, /* for bootloader */
.size = (1*SZ_1M),
.mask_flags = MTD_CAP_NANDFLASH,
},
{
.name = "recovery",
.offset = MTDPART_OFS_APPEND,
.size = (5*SZ_1M),
},
{
.name = "kernel",
.offset = MTDPART_OFS_APPEND,
.size = (5*SZ_1M),
},
{
.name = "ramdisk",
.offset = MTDPART_OFS_APPEND,
.size = (3*SZ_1M),
},
{
.name = "root",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
},
};
在上述修改过程中,将NANDFlash分成了5个区,读者可以根据自己编译出的bootloader或者内核的大小来修改。